xref: /aosp_15_r20/external/cronet/third_party/libxml/src/testapi.c (revision 6777b5387eb2ff775bb5750e3f5d96f37fb7352b)
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  * [email protected]
9  */
10 
11 /* Disable deprecation warnings */
12 #define XML_DEPRECATED
13 
14 #include "config.h"
15 #include <stdio.h>
16 #include <stdlib.h>
17 #include <string.h>
18 #include <libxml/xmlerror.h>
19 #include <libxml/catalog.h>
20 #include <libxml/relaxng.h>
21 #include <libxml/parser.h>
22 
23 
24 static int testlibxml2(void);
25 static int test_module(const char *module);
26 
27 static int generic_errors = 0;
28 static int call_tests = 0;
29 static int function_tests = 0;
30 
31 static xmlChar chartab[1024];
32 static int inttab[1024];
33 static unsigned long longtab[1024];
34 
35 static xmlDocPtr api_doc = NULL;
36 static xmlDtdPtr api_dtd = NULL;
37 static xmlNodePtr api_root = NULL;
38 static xmlAttrPtr api_attr = NULL;
39 static xmlNsPtr api_ns = NULL;
40 
41 static void
structured_errors(void * userData ATTRIBUTE_UNUSED,const xmlError * error ATTRIBUTE_UNUSED)42 structured_errors(void *userData ATTRIBUTE_UNUSED,
43                   const xmlError *error ATTRIBUTE_UNUSED) {
44     generic_errors++;
45 }
46 
47 static void
free_api_doc(void)48 free_api_doc(void) {
49     xmlFreeDoc(api_doc);
50     api_doc = NULL;
51     api_dtd = NULL;
52     api_root = NULL;
53     api_attr = NULL;
54     api_ns = NULL;
55 }
56 
57 static xmlDocPtr
get_api_doc(void)58 get_api_doc(void) {
59     if (api_doc == NULL) {
60         api_doc = xmlReadMemory("<!DOCTYPE root [<!ELEMENT root EMPTY>]><root xmlns:h='http://example.com/' h:foo='bar'/>", 88, "root_test", NULL, 0);
61 	api_root = NULL;
62 	api_attr = NULL;
63     }
64     return(api_doc);
65 }
66 
67 static xmlDtdPtr
get_api_dtd(void)68 get_api_dtd(void) {
69     if ((api_dtd == NULL) || (api_dtd->type != XML_DTD_NODE)) {
70         get_api_doc();
71 	if ((api_doc != NULL) && (api_doc->children != NULL) &&
72 	    (api_doc->children->type == XML_DTD_NODE))
73 	    api_dtd = (xmlDtdPtr) api_doc->children;
74     }
75     return(api_dtd);
76 }
77 
78 static xmlNodePtr
get_api_root(void)79 get_api_root(void) {
80     if ((api_root == NULL) || (api_root->type != XML_ELEMENT_NODE)) {
81         get_api_doc();
82 	if ((api_doc != NULL) && (api_doc->children != NULL) &&
83 	    (api_doc->children->next != NULL) &&
84 	    (api_doc->children->next->type == XML_ELEMENT_NODE))
85 	    api_root = api_doc->children->next;
86     }
87     return(api_root);
88 }
89 
90 static xmlNsPtr
get_api_ns(void)91 get_api_ns(void) {
92     get_api_root();
93     if (api_root != NULL)
94         api_ns = api_root->nsDef;
95     return(api_ns);
96 }
97 
98 static xmlAttrPtr
get_api_attr(void)99 get_api_attr(void) {
100 #if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_XINCLUDE_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED) || defined(LIBXML_HTML_ENABLED)
101     static int nr = 0;
102     xmlChar name[20];
103 #endif
104 
105     if ((api_root == NULL) || (api_root->type != XML_ELEMENT_NODE)) {
106         get_api_root();
107     }
108     if (api_root == NULL)
109         return(NULL);
110     if (api_root->properties != NULL) {
111         api_attr = api_root->properties;
112         return(api_root->properties);
113     }
114     api_attr = NULL;
115 #if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_XINCLUDE_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED) || defined(LIBXML_HTML_ENABLED)
116     snprintf((char *) name, 20, "foo%d", nr++);
117     api_attr = xmlSetProp(api_root, name, (const xmlChar *) "bar");
118 #endif
119     return(api_attr);
120 }
121 
122 static int quiet = 0;
123 
main(int argc,char ** argv)124 int main(int argc, char **argv) {
125     int ret;
126     int blocks, mem;
127 
128 #if defined(_WIN32)
129     setvbuf(stdout, NULL, _IONBF, 0);
130     setvbuf(stderr, NULL, _IONBF, 0);
131 
132     printf("Skipping on Windows for now\n");
133     return(0);
134 #endif
135 
136     memset(chartab, 0, sizeof(chartab));
137     strncpy((char *) chartab, "  chartab\n", 20);
138     memset(inttab, 0, sizeof(inttab));
139     memset(longtab, 0, sizeof(longtab));
140 
141     xmlInitParser();
142 #ifdef LIBXML_CATALOG_ENABLED
143     xmlInitializeCatalog();
144 #endif
145 #ifdef LIBXML_SCHEMAS_ENABLED
146     xmlRelaxNGInitTypes();
147 #endif
148 
149     LIBXML_TEST_VERSION
150 
151     xmlSetStructuredErrorFunc(NULL, structured_errors);
152     xmlSetExternalEntityLoader(xmlNoNetExternalEntityLoader);
153 
154     if (argc >= 2) {
155         if (!strcmp(argv[1], "-q")) {
156 	    quiet = 1;
157 	    if (argc >= 3)
158 	        ret = test_module(argv[2]);
159 	    else
160 		ret = testlibxml2();
161         } else {
162 	   ret = test_module(argv[1]);
163 	}
164     } else
165 	ret = testlibxml2();
166 
167     xmlCleanupParser();
168     blocks = xmlMemBlocks();
169     mem = xmlMemUsed();
170     if ((blocks != 0) || (mem != 0)) {
171         printf("testapi leaked %d bytes in %d blocks\n", mem, blocks);
172         ret = 1;
173     }
174 
175     return (ret != 0);
176 }
177 
178 #include <libxml/HTMLparser.h>
179 #include <libxml/HTMLtree.h>
180 #include <libxml/chvalid.h>
181 #include <libxml/dict.h>
182 #include <libxml/encoding.h>
183 #include <libxml/entities.h>
184 #include <libxml/hash.h>
185 #include <libxml/list.h>
186 #include <libxml/nanoftp.h>
187 #include <libxml/nanohttp.h>
188 #include <libxml/parser.h>
189 #include <libxml/parserInternals.h>
190 #include <libxml/pattern.h>
191 #include <libxml/relaxng.h>
192 #include <libxml/schemasInternals.h>
193 #include <libxml/schematron.h>
194 #include <libxml/tree.h>
195 #include <libxml/uri.h>
196 #include <libxml/valid.h>
197 #include <libxml/xinclude.h>
198 #include <libxml/xmlIO.h>
199 #include <libxml/xmlerror.h>
200 #include <libxml/xmlreader.h>
201 #include <libxml/xmlsave.h>
202 #include <libxml/xmlschemas.h>
203 #include <libxml/xmlschemastypes.h>
204 #include <libxml/xmlstring.h>
205 #include <libxml/xmlwriter.h>
206 #include <libxml/xpath.h>
207 #include <libxml/xpointer.h>
208 #include <libxml/debugXML.h>
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:http://http"
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 #define gen_nb_userdata 3
227 
gen_userdata(int no,int nr ATTRIBUTE_UNUSED)228 static void *gen_userdata(int no, int nr ATTRIBUTE_UNUSED) {
229     if (no == 0) return((void *) &call_tests);
230     if (no == 1) return((void *) -1);
231     return(NULL);
232 }
des_userdata(int no ATTRIBUTE_UNUSED,void * val ATTRIBUTE_UNUSED,int nr ATTRIBUTE_UNUSED)233 static void des_userdata(int no ATTRIBUTE_UNUSED, void *val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
234 }
235 
236 
237 #define gen_nb_int 4
238 
gen_int(int no,int nr ATTRIBUTE_UNUSED)239 static int gen_int(int no, int nr ATTRIBUTE_UNUSED) {
240     if (no == 0) return(0);
241     if (no == 1) return(1);
242     if (no == 2) return(-1);
243     if (no == 3) return(122);
244     return(-1);
245 }
246 
des_int(int no ATTRIBUTE_UNUSED,int val ATTRIBUTE_UNUSED,int nr ATTRIBUTE_UNUSED)247 static void des_int(int no ATTRIBUTE_UNUSED, int val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
248 }
249 
250 #define gen_nb_parseroptions 5
251 
gen_parseroptions(int no,int nr ATTRIBUTE_UNUSED)252 static int gen_parseroptions(int no, int nr ATTRIBUTE_UNUSED) {
253     if (no == 0) return(XML_PARSE_NOBLANKS | XML_PARSE_RECOVER);
254     if (no == 1) return(XML_PARSE_NOENT | XML_PARSE_DTDLOAD | XML_PARSE_DTDATTR | XML_PARSE_DTDVALID | XML_PARSE_NOCDATA);
255     if (no == 2) return(XML_PARSE_XINCLUDE | XML_PARSE_NOXINCNODE | XML_PARSE_NSCLEAN);
256     if (no == 3) return(XML_PARSE_XINCLUDE | XML_PARSE_NODICT);
257     return(XML_PARSE_SAX1);
258 }
259 
des_parseroptions(int no ATTRIBUTE_UNUSED,int val ATTRIBUTE_UNUSED,int nr ATTRIBUTE_UNUSED)260 static void des_parseroptions(int no ATTRIBUTE_UNUSED, int val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
261 }
262 
263 #if 0
264 #define gen_nb_long 5
265 
266 static long gen_long(int no, int nr ATTRIBUTE_UNUSED) {
267     if (no == 0) return(0);
268     if (no == 1) return(1);
269     if (no == 2) return(-1);
270     if (no == 3) return(122);
271     return(-1);
272 }
273 
274 static void des_long(int no ATTRIBUTE_UNUSED, long val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
275 }
276 #endif
277 
278 #define gen_nb_xmlChar 4
279 
gen_xmlChar(int no,int nr ATTRIBUTE_UNUSED)280 static xmlChar gen_xmlChar(int no, int nr ATTRIBUTE_UNUSED) {
281     if (no == 0) return('a');
282     if (no == 1) return(' ');
283     if (no == 2) return((xmlChar) '\xf8');
284     return(0);
285 }
286 
des_xmlChar(int no ATTRIBUTE_UNUSED,xmlChar val ATTRIBUTE_UNUSED,int nr ATTRIBUTE_UNUSED)287 static void des_xmlChar(int no ATTRIBUTE_UNUSED, xmlChar val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
288 }
289 
290 #define gen_nb_unsigned_int 3
291 
gen_unsigned_int(int no,int nr ATTRIBUTE_UNUSED)292 static unsigned int gen_unsigned_int(int no, int nr ATTRIBUTE_UNUSED) {
293     if (no == 0) return(0);
294     if (no == 1) return(1);
295     if (no == 2) return(122);
296     return((unsigned int) -1);
297 }
298 
des_unsigned_int(int no ATTRIBUTE_UNUSED,unsigned int val ATTRIBUTE_UNUSED,int nr ATTRIBUTE_UNUSED)299 static void des_unsigned_int(int no ATTRIBUTE_UNUSED, unsigned int val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
300 }
301 
302 #ifdef LIBXML_SCHEMAS_ENABLED
303 
304 #define gen_nb_unsigned_long 4
305 
gen_unsigned_long(int no,int nr ATTRIBUTE_UNUSED)306 static unsigned long gen_unsigned_long(int no, int nr ATTRIBUTE_UNUSED) {
307     if (no == 0) return(0);
308     if (no == 1) return(1);
309     if (no == 2) return(122);
310     return((unsigned long) -1);
311 }
312 
des_unsigned_long(int no ATTRIBUTE_UNUSED,unsigned long val ATTRIBUTE_UNUSED,int nr ATTRIBUTE_UNUSED)313 static void des_unsigned_long(int no ATTRIBUTE_UNUSED, unsigned long val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
314 }
315 
316 #define gen_nb_unsigned_long_ptr 2
317 
gen_unsigned_long_ptr(int no,int nr)318 static unsigned long *gen_unsigned_long_ptr(int no, int nr) {
319     if (no == 0) return(&longtab[nr]);
320     return(NULL);
321 }
322 
des_unsigned_long_ptr(int no ATTRIBUTE_UNUSED,unsigned long * val ATTRIBUTE_UNUSED,int nr ATTRIBUTE_UNUSED)323 static void des_unsigned_long_ptr(int no ATTRIBUTE_UNUSED, unsigned long *val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
324 }
325 
326 #endif /* LIBXML_SCHEMAS_ENABLED */
327 
328 #if defined(LIBXML_XPATH_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED)
329 
330 #define gen_nb_double 4
331 
gen_double(int no,int nr ATTRIBUTE_UNUSED)332 static double gen_double(int no, int nr ATTRIBUTE_UNUSED) {
333     if (no == 0) return(0);
334     if (no == 1) return(-1.1);
335 #if defined(LIBXML_XPATH_ENABLED)
336     if (no == 2) return(xmlXPathNAN);
337 #endif
338     return(-1);
339 }
340 
des_double(int no ATTRIBUTE_UNUSED,double val ATTRIBUTE_UNUSED,int nr ATTRIBUTE_UNUSED)341 static void des_double(int no ATTRIBUTE_UNUSED, double val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
342 }
343 
344 #endif /* defined(LIBXML_XPATH_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED) */
345 
346 #define gen_nb_int_ptr 2
347 
gen_int_ptr(int no,int nr)348 static int *gen_int_ptr(int no, int nr) {
349     if (no == 0) return(&inttab[nr]);
350     return(NULL);
351 }
352 
des_int_ptr(int no ATTRIBUTE_UNUSED,int * val ATTRIBUTE_UNUSED,int nr ATTRIBUTE_UNUSED)353 static void des_int_ptr(int no ATTRIBUTE_UNUSED, int *val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
354 }
355 
356 #define gen_nb_const_char_ptr 4
357 
gen_const_char_ptr(int no,int nr ATTRIBUTE_UNUSED)358 static const char *gen_const_char_ptr(int no, int nr ATTRIBUTE_UNUSED) {
359     if (no == 0) return((char *) "foo");
360     if (no == 1) return((char *) "<foo/>");
361     if (no == 2) return((char *) "test/ent2");
362     return(NULL);
363 }
des_const_char_ptr(int no ATTRIBUTE_UNUSED,const char * val ATTRIBUTE_UNUSED,int nr ATTRIBUTE_UNUSED)364 static void des_const_char_ptr(int no ATTRIBUTE_UNUSED, const char *val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
365 }
366 
367 #define gen_nb_xmlChar_ptr 2
368 
gen_xmlChar_ptr(int no,int nr ATTRIBUTE_UNUSED)369 static xmlChar *gen_xmlChar_ptr(int no, int nr ATTRIBUTE_UNUSED) {
370     if (no == 0) return(&chartab[0]);
371     return(NULL);
372 }
des_xmlChar_ptr(int no ATTRIBUTE_UNUSED,xmlChar * val ATTRIBUTE_UNUSED,int nr ATTRIBUTE_UNUSED)373 static void des_xmlChar_ptr(int no ATTRIBUTE_UNUSED, xmlChar *val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
374 }
375 
376 #define gen_nb_FILE_ptr 2
377 
gen_FILE_ptr(int no,int nr ATTRIBUTE_UNUSED)378 static FILE *gen_FILE_ptr(int no, int nr ATTRIBUTE_UNUSED) {
379     if (no == 0) return(fopen("test.out", "a+"));
380     return(NULL);
381 }
des_FILE_ptr(int no ATTRIBUTE_UNUSED,FILE * val,int nr ATTRIBUTE_UNUSED)382 static void des_FILE_ptr(int no ATTRIBUTE_UNUSED, FILE *val, int nr ATTRIBUTE_UNUSED) {
383     if (val != NULL) fclose(val);
384 }
385 
386 #ifdef LIBXML_DEBUG_ENABLED
387 #define gen_nb_debug_FILE_ptr 2
gen_debug_FILE_ptr(int no ATTRIBUTE_UNUSED,int nr ATTRIBUTE_UNUSED)388 static FILE *gen_debug_FILE_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
389     return(fopen("test.out", "a+"));
390 }
des_debug_FILE_ptr(int no ATTRIBUTE_UNUSED,FILE * val,int nr ATTRIBUTE_UNUSED)391 static void des_debug_FILE_ptr(int no ATTRIBUTE_UNUSED, FILE *val, int nr ATTRIBUTE_UNUSED) {
392     if (val != NULL) fclose(val);
393 }
394 #endif
395 
396 #define gen_nb_const_xmlChar_ptr 5
397 
gen_const_xmlChar_ptr(int no,int nr ATTRIBUTE_UNUSED)398 static const xmlChar *gen_const_xmlChar_ptr(int no, int nr ATTRIBUTE_UNUSED) {
399     if (no == 0) return((xmlChar *) "foo");
400     if (no == 1) return((xmlChar *) "<foo/>");
401     if (no == 2) return((xmlChar *) "n" "\xf8" "ne");
402     if (no == 3) return((xmlChar *) " 2ab ");
403     return(NULL);
404 }
des_const_xmlChar_ptr(int no ATTRIBUTE_UNUSED,const xmlChar * val ATTRIBUTE_UNUSED,int nr ATTRIBUTE_UNUSED)405 static void des_const_xmlChar_ptr(int no ATTRIBUTE_UNUSED, const xmlChar *val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
406 }
407 
408 #define gen_nb_filepath 8
409 
gen_filepath(int no,int nr ATTRIBUTE_UNUSED)410 static const char *gen_filepath(int no, int nr ATTRIBUTE_UNUSED) {
411     if (no == 0) return("missing.xml");
412     if (no == 1) return("<foo/>");
413     if (no == 2) return("test/ent2");
414     if (no == 3) return("test/valid/REC-xml-19980210.xml");
415     if (no == 4) return("test/valid/dtds/xhtml1-strict.dtd");
416     if (no == 5) return(REMOTE1GOOD);
417     if (no == 6) return(REMOTE1BAD);
418     return(NULL);
419 }
des_filepath(int no ATTRIBUTE_UNUSED,const char * val ATTRIBUTE_UNUSED,int nr ATTRIBUTE_UNUSED)420 static void des_filepath(int no ATTRIBUTE_UNUSED, const char *val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
421 }
422 
423 #define gen_nb_eaten_name 2
424 
gen_eaten_name(int no,int nr ATTRIBUTE_UNUSED)425 static xmlChar *gen_eaten_name(int no, int nr ATTRIBUTE_UNUSED) {
426     if (no == 0) return(xmlStrdup(BAD_CAST "eaten"));
427     return(NULL);
428 }
des_eaten_name(int no ATTRIBUTE_UNUSED,xmlChar * val ATTRIBUTE_UNUSED,int nr ATTRIBUTE_UNUSED)429 static void des_eaten_name(int no ATTRIBUTE_UNUSED, xmlChar *val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
430 }
431 
432 #define gen_nb_fileoutput 6
433 
gen_fileoutput(int no,int nr ATTRIBUTE_UNUSED)434 static const char *gen_fileoutput(int no, int nr ATTRIBUTE_UNUSED) {
435     if (no == 0) return("missing/dir/missing.xml");
436     if (no == 1) return("<foo/>");
437     if (no == 2) return(REMOTE2GOOD);
438     if (no == 3) return(REMOTE1GOOD);
439     if (no == 4) return(REMOTE1BAD);
440     return(NULL);
441 }
des_fileoutput(int no ATTRIBUTE_UNUSED,const char * val ATTRIBUTE_UNUSED,int nr ATTRIBUTE_UNUSED)442 static void des_fileoutput(int no ATTRIBUTE_UNUSED, const char *val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
443 }
444 
445 #define gen_nb_xmlParserCtxtPtr 3
gen_xmlParserCtxtPtr(int no,int nr ATTRIBUTE_UNUSED)446 static xmlParserCtxtPtr gen_xmlParserCtxtPtr(int no, int nr ATTRIBUTE_UNUSED) {
447     if (no == 0) return(xmlNewParserCtxt());
448     if (no == 1) return(xmlCreateMemoryParserCtxt("<doc/>", 6));
449     return(NULL);
450 }
des_xmlParserCtxtPtr(int no ATTRIBUTE_UNUSED,xmlParserCtxtPtr val,int nr ATTRIBUTE_UNUSED)451 static void des_xmlParserCtxtPtr(int no ATTRIBUTE_UNUSED, xmlParserCtxtPtr val, int nr ATTRIBUTE_UNUSED) {
452     if (val != NULL)
453         xmlFreeParserCtxt(val);
454 }
455 
456 #if defined(LIBXML_SAX1_ENABLED) || \
457     defined(LIBXML_VALID_ENABLED) || \
458     defined(LIBXML_PUSH_ENABLED)
459 #define gen_nb_xmlSAXHandlerPtr 2
gen_xmlSAXHandlerPtr(int no,int nr ATTRIBUTE_UNUSED)460 static xmlSAXHandlerPtr gen_xmlSAXHandlerPtr(int no, int nr ATTRIBUTE_UNUSED) {
461     (void) no;
462 #ifdef LIBXML_SAX1_ENABLED
463     if (no == 0) return((xmlSAXHandlerPtr) &xmlDefaultSAXHandler);
464 #endif
465     return(NULL);
466 }
des_xmlSAXHandlerPtr(int no ATTRIBUTE_UNUSED,xmlSAXHandlerPtr val ATTRIBUTE_UNUSED,int nr ATTRIBUTE_UNUSED)467 static void des_xmlSAXHandlerPtr(int no ATTRIBUTE_UNUSED, xmlSAXHandlerPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
468 }
469 #endif
470 
471 #define gen_nb_xmlValidCtxtPtr 2
gen_xmlValidCtxtPtr(int no,int nr ATTRIBUTE_UNUSED)472 static xmlValidCtxtPtr gen_xmlValidCtxtPtr(int no, int nr ATTRIBUTE_UNUSED) {
473     (void) no;
474 #ifdef LIBXML_VALID_ENABLED
475     if (no == 0) return(xmlNewValidCtxt());
476 #endif
477     return(NULL);
478 }
des_xmlValidCtxtPtr(int no ATTRIBUTE_UNUSED,xmlValidCtxtPtr val,int nr ATTRIBUTE_UNUSED)479 static void des_xmlValidCtxtPtr(int no ATTRIBUTE_UNUSED, xmlValidCtxtPtr val, int nr ATTRIBUTE_UNUSED) {
480     (void) val;
481 #ifdef LIBXML_VALID_ENABLED
482     if (val != NULL)
483         xmlFreeValidCtxt(val);
484 #endif
485 }
486 
487 #define gen_nb_xmlParserInputBufferPtr 8
488 
gen_xmlParserInputBufferPtr(int no,int nr ATTRIBUTE_UNUSED)489 static xmlParserInputBufferPtr gen_xmlParserInputBufferPtr(int no, int nr ATTRIBUTE_UNUSED) {
490     if (no == 0) return(xmlParserInputBufferCreateFilename("missing.xml", XML_CHAR_ENCODING_NONE));
491     if (no == 1) return(xmlParserInputBufferCreateFilename("<foo/>", XML_CHAR_ENCODING_NONE));
492     if (no == 2) return(xmlParserInputBufferCreateFilename("test/ent2", XML_CHAR_ENCODING_NONE));
493     if (no == 3) return(xmlParserInputBufferCreateFilename("test/valid/REC-xml-19980210.xml", XML_CHAR_ENCODING_NONE));
494     if (no == 4) return(xmlParserInputBufferCreateFilename("test/valid/dtds/xhtml1-strict.dtd", XML_CHAR_ENCODING_NONE));
495     if (no == 5) return(xmlParserInputBufferCreateFilename(REMOTE1GOOD, XML_CHAR_ENCODING_NONE));
496     if (no == 6) return(xmlParserInputBufferCreateFilename(REMOTE1BAD, XML_CHAR_ENCODING_NONE));
497     return(NULL);
498 }
des_xmlParserInputBufferPtr(int no ATTRIBUTE_UNUSED,xmlParserInputBufferPtr val,int nr ATTRIBUTE_UNUSED)499 static void des_xmlParserInputBufferPtr(int no ATTRIBUTE_UNUSED, xmlParserInputBufferPtr val, int nr ATTRIBUTE_UNUSED) {
500     xmlFreeParserInputBuffer(val);
501 }
502 
503 #define gen_nb_xmlDocPtr 4
gen_xmlDocPtr(int no,int nr ATTRIBUTE_UNUSED)504 static xmlDocPtr gen_xmlDocPtr(int no, int nr ATTRIBUTE_UNUSED) {
505     if (no == 0) return(xmlNewDoc(BAD_CAST "1.0"));
506     if (no == 1) return(xmlReadMemory("<foo/>", 6, "test", NULL, 0));
507     if (no == 2) return(xmlReadMemory("<!DOCTYPE foo []> <foo/>", 24, "test", NULL, 0));
508     return(NULL);
509 }
des_xmlDocPtr(int no ATTRIBUTE_UNUSED,xmlDocPtr val,int nr ATTRIBUTE_UNUSED)510 static void des_xmlDocPtr(int no ATTRIBUTE_UNUSED, xmlDocPtr val, int nr ATTRIBUTE_UNUSED) {
511     if ((val != NULL) && (val != api_doc) && (val->doc != api_doc))
512         xmlFreeDoc(val);
513 }
514 
515 #define gen_nb_xmlAttrPtr 2
gen_xmlAttrPtr(int no,int nr ATTRIBUTE_UNUSED)516 static xmlAttrPtr gen_xmlAttrPtr(int no, int nr ATTRIBUTE_UNUSED) {
517     if (no == 0) return(get_api_attr());
518     return(NULL);
519 }
des_xmlAttrPtr(int no,xmlAttrPtr val ATTRIBUTE_UNUSED,int nr ATTRIBUTE_UNUSED)520 static void des_xmlAttrPtr(int no, xmlAttrPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
521     if (no == 0) free_api_doc();
522 }
523 
524 #define gen_nb_xmlDictPtr 2
gen_xmlDictPtr(int no,int nr ATTRIBUTE_UNUSED)525 static xmlDictPtr gen_xmlDictPtr(int no, int nr ATTRIBUTE_UNUSED) {
526     if (no == 0) return(xmlDictCreate());
527     return(NULL);
528 }
des_xmlDictPtr(int no ATTRIBUTE_UNUSED,xmlDictPtr val,int nr ATTRIBUTE_UNUSED)529 static void des_xmlDictPtr(int no ATTRIBUTE_UNUSED, xmlDictPtr val, int nr ATTRIBUTE_UNUSED) {
530     if (val != NULL)
531         xmlDictFree(val);
532 }
533 
534 #define gen_nb_xmlNodePtr 3
gen_xmlNodePtr(int no,int nr ATTRIBUTE_UNUSED)535 static xmlNodePtr gen_xmlNodePtr(int no, int nr ATTRIBUTE_UNUSED) {
536     if (no == 0) return(xmlNewPI(BAD_CAST "test", NULL));
537     if (no == 1) return(get_api_root());
538     return(NULL);
539 /*     if (no == 2) return((xmlNodePtr) get_api_doc()); */
540 }
des_xmlNodePtr(int no,xmlNodePtr val,int nr ATTRIBUTE_UNUSED)541 static void des_xmlNodePtr(int no, xmlNodePtr val, int nr ATTRIBUTE_UNUSED) {
542     if (no == 1) {
543         free_api_doc();
544     } else if (val != NULL) {
545         xmlUnlinkNode(val);
546         xmlFreeNode(val);
547     }
548 }
549 
550 #define gen_nb_xmlDtdPtr 3
gen_xmlDtdPtr(int no,int nr ATTRIBUTE_UNUSED)551 static xmlDtdPtr gen_xmlDtdPtr(int no, int nr ATTRIBUTE_UNUSED) {
552     if (no == 0)
553         return(xmlNewDtd(NULL, BAD_CAST "dtd", BAD_CAST"foo", BAD_CAST"bar"));
554     if (no == 1) return(get_api_dtd());
555     return(NULL);
556 }
des_xmlDtdPtr(int no,xmlDtdPtr val,int nr ATTRIBUTE_UNUSED)557 static void des_xmlDtdPtr(int no, xmlDtdPtr val, int nr ATTRIBUTE_UNUSED) {
558     if (no == 1) free_api_doc();
559     else if (val != NULL) {
560         xmlUnlinkNode((xmlNodePtr) val);
561         xmlFreeNode((xmlNodePtr) val);
562     }
563 }
564 
565 #define gen_nb_xmlNsPtr 2
gen_xmlNsPtr(int no,int nr ATTRIBUTE_UNUSED)566 static xmlNsPtr gen_xmlNsPtr(int no, int nr ATTRIBUTE_UNUSED) {
567     if (no == 0) return(get_api_ns());
568     return(NULL);
569 }
des_xmlNsPtr(int no,xmlNsPtr val ATTRIBUTE_UNUSED,int nr ATTRIBUTE_UNUSED)570 static void des_xmlNsPtr(int no, xmlNsPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
571     if (no == 0) free_api_doc();
572 }
573 
574 #define gen_nb_xmlNodePtr_in 3
gen_xmlNodePtr_in(int no,int nr ATTRIBUTE_UNUSED)575 static xmlNodePtr gen_xmlNodePtr_in(int no, int nr ATTRIBUTE_UNUSED) {
576     if (no == 0) return(xmlNewPI(BAD_CAST "test", NULL));
577     if (no == 0) return(xmlNewText(BAD_CAST "text"));
578     return(NULL);
579 }
des_xmlNodePtr_in(int no ATTRIBUTE_UNUSED,xmlNodePtr val ATTRIBUTE_UNUSED,int nr ATTRIBUTE_UNUSED)580 static void des_xmlNodePtr_in(int no ATTRIBUTE_UNUSED, xmlNodePtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
581 }
582 
583 #ifdef LIBXML_WRITER_ENABLED
584 #define gen_nb_xmlTextWriterPtr 2
gen_xmlTextWriterPtr(int no,int nr ATTRIBUTE_UNUSED)585 static xmlTextWriterPtr gen_xmlTextWriterPtr(int no, int nr ATTRIBUTE_UNUSED) {
586     if (no == 0) return(xmlNewTextWriterFilename("test.out", 0));
587     return(NULL);
588 }
des_xmlTextWriterPtr(int no ATTRIBUTE_UNUSED,xmlTextWriterPtr val,int nr ATTRIBUTE_UNUSED)589 static void des_xmlTextWriterPtr(int no ATTRIBUTE_UNUSED, xmlTextWriterPtr val, int nr ATTRIBUTE_UNUSED) {
590     if (val != NULL) xmlFreeTextWriter(val);
591 }
592 #endif
593 
594 #ifdef LIBXML_READER_ENABLED
595 #define gen_nb_xmlTextReaderPtr 4
gen_xmlTextReaderPtr(int no,int nr ATTRIBUTE_UNUSED)596 static xmlTextReaderPtr gen_xmlTextReaderPtr(int no, int nr ATTRIBUTE_UNUSED) {
597     if (no == 0) return(xmlNewTextReaderFilename("test/ent2"));
598     if (no == 1) return(xmlNewTextReaderFilename("test/valid/REC-xml-19980210.xml"));
599     if (no == 2) return(xmlNewTextReaderFilename("test/valid/dtds/xhtml1-strict.dtd"));
600     return(NULL);
601 }
des_xmlTextReaderPtr(int no ATTRIBUTE_UNUSED,xmlTextReaderPtr val,int nr ATTRIBUTE_UNUSED)602 static void des_xmlTextReaderPtr(int no ATTRIBUTE_UNUSED, xmlTextReaderPtr val, int nr ATTRIBUTE_UNUSED) {
603     if (val != NULL) xmlFreeTextReader(val);
604 }
605 #endif
606 
607 #define gen_nb_xmlBufferPtr 3
608 static const xmlChar *static_buf_content = (xmlChar *)"a static buffer";
gen_xmlBufferPtr(int no,int nr ATTRIBUTE_UNUSED)609 static xmlBufferPtr gen_xmlBufferPtr(int no, int nr ATTRIBUTE_UNUSED) {
610     if (no == 0) return(xmlBufferCreate());
611     if (no == 1) return(xmlBufferCreateStatic((void *)static_buf_content, 13));
612     return(NULL);
613 }
des_xmlBufferPtr(int no ATTRIBUTE_UNUSED,xmlBufferPtr val,int nr ATTRIBUTE_UNUSED)614 static void des_xmlBufferPtr(int no ATTRIBUTE_UNUSED, xmlBufferPtr val, int nr ATTRIBUTE_UNUSED) {
615     if (val != NULL) {
616         xmlBufferFree(val);
617     }
618 }
619 
620 #define gen_nb_xmlListPtr 2
gen_xmlListPtr(int no,int nr ATTRIBUTE_UNUSED)621 static xmlListPtr gen_xmlListPtr(int no, int nr ATTRIBUTE_UNUSED) {
622     if (no == 0) return(xmlListCreate(NULL, NULL));
623     return(NULL);
624 }
des_xmlListPtr(int no ATTRIBUTE_UNUSED,xmlListPtr val,int nr ATTRIBUTE_UNUSED)625 static void des_xmlListPtr(int no ATTRIBUTE_UNUSED, xmlListPtr val, int nr ATTRIBUTE_UNUSED) {
626     if (val != NULL) {
627         xmlListDelete(val);
628     }
629 }
630 
631 #define gen_nb_xmlHashTablePtr 2
gen_xmlHashTablePtr(int no,int nr ATTRIBUTE_UNUSED)632 static xmlHashTablePtr gen_xmlHashTablePtr(int no, int nr ATTRIBUTE_UNUSED) {
633     if (no == 0) return(xmlHashCreate(10));
634     return(NULL);
635 }
des_xmlHashTablePtr(int no ATTRIBUTE_UNUSED,xmlHashTablePtr val,int nr ATTRIBUTE_UNUSED)636 static void des_xmlHashTablePtr(int no ATTRIBUTE_UNUSED, xmlHashTablePtr val, int nr ATTRIBUTE_UNUSED) {
637     if (val != NULL) {
638         xmlHashFree(val, NULL);
639     }
640 }
641 
642 #include <libxml/xpathInternals.h>
643 
644 #ifdef LIBXML_XPATH_ENABLED
645 #define gen_nb_xmlXPathObjectPtr 5
gen_xmlXPathObjectPtr(int no,int nr ATTRIBUTE_UNUSED)646 static xmlXPathObjectPtr gen_xmlXPathObjectPtr(int no, int nr ATTRIBUTE_UNUSED) {
647     if (no == 0) return(xmlXPathNewString(BAD_CAST "string object"));
648     if (no == 1) return(xmlXPathNewFloat(1.1));
649     if (no == 2) return(xmlXPathNewBoolean(1));
650     if (no == 3) return(xmlXPathNewNodeSet(NULL));
651     return(NULL);
652 }
des_xmlXPathObjectPtr(int no ATTRIBUTE_UNUSED,xmlXPathObjectPtr val,int nr ATTRIBUTE_UNUSED)653 static void des_xmlXPathObjectPtr(int no ATTRIBUTE_UNUSED, xmlXPathObjectPtr val, int nr ATTRIBUTE_UNUSED) {
654     if (val != NULL) {
655         xmlXPathFreeObject(val);
656     }
657 }
658 #endif
659 
660 #ifdef LIBXML_OUTPUT_ENABLED
661 #define gen_nb_xmlOutputBufferPtr 2
gen_xmlOutputBufferPtr(int no,int nr ATTRIBUTE_UNUSED)662 static xmlOutputBufferPtr gen_xmlOutputBufferPtr(int no, int nr ATTRIBUTE_UNUSED) {
663     if (no == 0) return(xmlOutputBufferCreateFilename("test.out", NULL, 0));
664     return(NULL);
665 }
des_xmlOutputBufferPtr(int no ATTRIBUTE_UNUSED,xmlOutputBufferPtr val,int nr ATTRIBUTE_UNUSED)666 static void des_xmlOutputBufferPtr(int no ATTRIBUTE_UNUSED, xmlOutputBufferPtr val, int nr ATTRIBUTE_UNUSED) {
667     if (val != NULL) {
668         xmlOutputBufferClose(val);
669     }
670 }
671 #endif
672 
673 #ifdef LIBXML_HTTP_ENABLED
674 #define gen_nb_xmlNanoHTTPCtxtPtr 1
gen_xmlNanoHTTPCtxtPtr(int no,int nr ATTRIBUTE_UNUSED)675 static void *gen_xmlNanoHTTPCtxtPtr(int no, int nr ATTRIBUTE_UNUSED) {
676     if (no == 0) return(xmlNanoHTTPOpen(REMOTE1GOOD, NULL));
677     if (no == 1) return(xmlNanoHTTPOpen(REMOTE2GOOD, NULL));
678     if (no == 2) return(xmlNanoHTTPOpen(REMOTE1BAD, NULL));
679     return(NULL);
680 }
des_xmlNanoHTTPCtxtPtr(int no ATTRIBUTE_UNUSED,void * val,int nr ATTRIBUTE_UNUSED)681 static void des_xmlNanoHTTPCtxtPtr(int no ATTRIBUTE_UNUSED, void *val, int nr ATTRIBUTE_UNUSED) {
682     if (val != NULL) {
683 	xmlNanoHTTPClose(val);
684     }
685 }
686 #endif
687 
688 #define gen_nb_xmlCharEncoding 4
gen_xmlCharEncoding(int no,int nr ATTRIBUTE_UNUSED)689 static xmlCharEncoding gen_xmlCharEncoding(int no, int nr ATTRIBUTE_UNUSED) {
690     if (no == 0) return(XML_CHAR_ENCODING_UTF8);
691     if (no == 1) return(XML_CHAR_ENCODING_NONE);
692     if (no == 2) return(XML_CHAR_ENCODING_8859_1);
693     return(XML_CHAR_ENCODING_ERROR);
694 }
des_xmlCharEncoding(int no ATTRIBUTE_UNUSED,xmlCharEncoding val ATTRIBUTE_UNUSED,int nr ATTRIBUTE_UNUSED)695 static void des_xmlCharEncoding(int no ATTRIBUTE_UNUSED, xmlCharEncoding val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
696 }
697 
698 #if defined(LIBXML_REGEXP_ENABLED) && defined(LIBXML_EXPR_ENABLED)
699 
700 #define gen_nb_xmlExpCtxtPtr 1
gen_xmlExpCtxtPtr(int no ATTRIBUTE_UNUSED,int nr ATTRIBUTE_UNUSED)701 static xmlExpCtxtPtr gen_xmlExpCtxtPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
702     return(NULL);
703 }
des_xmlExpCtxtPtr(int no ATTRIBUTE_UNUSED,xmlExpCtxtPtr val ATTRIBUTE_UNUSED,int nr ATTRIBUTE_UNUSED)704 static void des_xmlExpCtxtPtr(int no ATTRIBUTE_UNUSED, xmlExpCtxtPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
705 }
706 
707 #define gen_nb_xmlExpNodePtr 1
gen_xmlExpNodePtr(int no ATTRIBUTE_UNUSED,int nr ATTRIBUTE_UNUSED)708 static xmlExpNodePtr gen_xmlExpNodePtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
709     return(NULL);
710 }
des_xmlExpNodePtr(int no ATTRIBUTE_UNUSED,xmlExpNodePtr val ATTRIBUTE_UNUSED,int nr ATTRIBUTE_UNUSED)711 static void des_xmlExpNodePtr(int no ATTRIBUTE_UNUSED, xmlExpNodePtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
712 }
713 
714 #endif
715 
716 #if defined(LIBXML_SCHEMAS_ENABLED)
717 #define gen_nb_xmlSchemaPtr 1
gen_xmlSchemaPtr(int no ATTRIBUTE_UNUSED,int nr ATTRIBUTE_UNUSED)718 static xmlSchemaPtr gen_xmlSchemaPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
719     return(NULL);
720 }
des_xmlSchemaPtr(int no ATTRIBUTE_UNUSED,xmlSchemaPtr val ATTRIBUTE_UNUSED,int nr ATTRIBUTE_UNUSED)721 static void des_xmlSchemaPtr(int no ATTRIBUTE_UNUSED, xmlSchemaPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
722 }
723 
724 #define gen_nb_xmlSchemaValidCtxtPtr 1
gen_xmlSchemaValidCtxtPtr(int no ATTRIBUTE_UNUSED,int nr ATTRIBUTE_UNUSED)725 static xmlSchemaValidCtxtPtr gen_xmlSchemaValidCtxtPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
726     return(NULL);
727 }
des_xmlSchemaValidCtxtPtr(int no ATTRIBUTE_UNUSED,xmlSchemaValidCtxtPtr val ATTRIBUTE_UNUSED,int nr ATTRIBUTE_UNUSED)728 static void des_xmlSchemaValidCtxtPtr(int no ATTRIBUTE_UNUSED, xmlSchemaValidCtxtPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
729 }
730 
731 #endif /* LIBXML_SCHEMAS_ENABLED */
732 
733 #define gen_nb_xmlHashDeallocator 2
734 static void
test_xmlHashDeallocator(void * payload ATTRIBUTE_UNUSED,const xmlChar * name ATTRIBUTE_UNUSED)735 test_xmlHashDeallocator(void *payload ATTRIBUTE_UNUSED,
736                         const xmlChar *name ATTRIBUTE_UNUSED) {
737 }
738 
gen_xmlHashDeallocator(int no,int nr ATTRIBUTE_UNUSED)739 static xmlHashDeallocator gen_xmlHashDeallocator(int no, int nr ATTRIBUTE_UNUSED) {
740     if (no == 0) return(test_xmlHashDeallocator);
741     return(NULL);
742 }
des_xmlHashDeallocator(int no ATTRIBUTE_UNUSED,xmlHashDeallocator val ATTRIBUTE_UNUSED,int nr ATTRIBUTE_UNUSED)743 static void des_xmlHashDeallocator(int no ATTRIBUTE_UNUSED, xmlHashDeallocator val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
744 }
745 
746 
desret_int(int val ATTRIBUTE_UNUSED)747 static void desret_int(int val ATTRIBUTE_UNUSED) {
748 }
desret_xmlChar(xmlChar val ATTRIBUTE_UNUSED)749 static void desret_xmlChar(xmlChar val ATTRIBUTE_UNUSED) {
750 }
desret_long(long val ATTRIBUTE_UNUSED)751 static void desret_long(long val ATTRIBUTE_UNUSED) {
752 }
desret_unsigned_long(unsigned long val ATTRIBUTE_UNUSED)753 static void desret_unsigned_long(unsigned long val ATTRIBUTE_UNUSED) {
754 }
755 #if defined(LIBXML_XPATH_ENABLED)
desret_double(double val ATTRIBUTE_UNUSED)756 static void desret_double(double val ATTRIBUTE_UNUSED) {
757 }
758 #endif
desret_xmlCharEncoding(xmlCharEncoding val ATTRIBUTE_UNUSED)759 static void desret_xmlCharEncoding(xmlCharEncoding val ATTRIBUTE_UNUSED) {
760 }
761 #if 0
762 static void desret_const_void_ptr(void *val ATTRIBUTE_UNUSED) {
763 }
764 #endif
desret_void_ptr(void * val ATTRIBUTE_UNUSED)765 static void desret_void_ptr(void *val ATTRIBUTE_UNUSED) {
766 }
desret_const_char_ptr(const char * val ATTRIBUTE_UNUSED)767 static void desret_const_char_ptr(const char *val ATTRIBUTE_UNUSED) {
768 }
desret_const_xmlChar_ptr(const xmlChar * val ATTRIBUTE_UNUSED)769 static void desret_const_xmlChar_ptr(const xmlChar *val ATTRIBUTE_UNUSED) {
770 }
desret_xmlChar_ptr(xmlChar * val)771 static void desret_xmlChar_ptr(xmlChar *val) {
772     if (val != NULL)
773 	xmlFree(val);
774 }
desret_xmlDocPtr(xmlDocPtr val)775 static void desret_xmlDocPtr(xmlDocPtr val) {
776     if (val != api_doc)
777 	xmlFreeDoc(val);
778 }
desret_xmlDictPtr(xmlDictPtr val)779 static void desret_xmlDictPtr(xmlDictPtr val) {
780     xmlDictFree(val);
781 }
782 #ifdef LIBXML_OUTPUT_ENABLED
desret_xmlOutputBufferPtr(xmlOutputBufferPtr val)783 static void desret_xmlOutputBufferPtr(xmlOutputBufferPtr val) {
784     xmlOutputBufferClose(val);
785 }
786 #endif
787 #ifdef LIBXML_READER_ENABLED
desret_xmlTextReaderPtr(xmlTextReaderPtr val)788 static void desret_xmlTextReaderPtr(xmlTextReaderPtr val) {
789     xmlFreeTextReader(val);
790 }
791 #endif
desret_xmlNodePtr(xmlNodePtr val)792 static void desret_xmlNodePtr(xmlNodePtr val) {
793     if ((val != NULL) && (val != api_root) && (val != (xmlNodePtr) api_doc)) {
794 	xmlUnlinkNode(val);
795 	xmlFreeNode(val);
796     }
797 }
desret_xmlAttrPtr(xmlAttrPtr val)798 static void desret_xmlAttrPtr(xmlAttrPtr val) {
799     if (val != NULL) {
800 	xmlUnlinkNode((xmlNodePtr) val);
801 	xmlFreeNode((xmlNodePtr) val);
802     }
803 }
desret_xmlEntityPtr(xmlEntityPtr val)804 static void desret_xmlEntityPtr(xmlEntityPtr val) {
805     if (val != NULL) {
806 	xmlUnlinkNode((xmlNodePtr) val);
807 	xmlFreeNode((xmlNodePtr) val);
808     }
809 }
desret_xmlElementPtr(xmlElementPtr val)810 static void desret_xmlElementPtr(xmlElementPtr val) {
811     if (val != NULL) {
812 	xmlUnlinkNode((xmlNodePtr) val);
813     }
814 }
desret_xmlAttributePtr(xmlAttributePtr val)815 static void desret_xmlAttributePtr(xmlAttributePtr val) {
816     if (val != NULL) {
817 	xmlUnlinkNode((xmlNodePtr) val);
818     }
819 }
desret_xmlNsPtr(xmlNsPtr val ATTRIBUTE_UNUSED)820 static void desret_xmlNsPtr(xmlNsPtr val ATTRIBUTE_UNUSED) {
821 }
desret_xmlDtdPtr(xmlDtdPtr val)822 static void desret_xmlDtdPtr(xmlDtdPtr val) {
823     desret_xmlNodePtr((xmlNodePtr)val);
824 }
825 #ifdef LIBXML_XPATH_ENABLED
desret_xmlXPathObjectPtr(xmlXPathObjectPtr val)826 static void desret_xmlXPathObjectPtr(xmlXPathObjectPtr val) {
827     xmlXPathFreeObject(val);
828 }
desret_xmlNodeSetPtr(xmlNodeSetPtr val)829 static void desret_xmlNodeSetPtr(xmlNodeSetPtr val) {
830     xmlXPathFreeNodeSet(val);
831 }
832 #endif
desret_xmlParserCtxtPtr(xmlParserCtxtPtr val)833 static void desret_xmlParserCtxtPtr(xmlParserCtxtPtr val) {
834     xmlFreeParserCtxt(val);
835 }
desret_xmlParserInputBufferPtr(xmlParserInputBufferPtr val)836 static void desret_xmlParserInputBufferPtr(xmlParserInputBufferPtr val) {
837     xmlFreeParserInputBuffer(val);
838 }
desret_xmlParserInputPtr(xmlParserInputPtr val)839 static void desret_xmlParserInputPtr(xmlParserInputPtr val) {
840     xmlFreeInputStream(val);
841 }
842 #ifdef LIBXML_WRITER_ENABLED
desret_xmlTextWriterPtr(xmlTextWriterPtr val)843 static void desret_xmlTextWriterPtr(xmlTextWriterPtr val) {
844     xmlFreeTextWriter(val);
845 }
846 #endif
desret_xmlBufferPtr(xmlBufferPtr val)847 static void desret_xmlBufferPtr(xmlBufferPtr val) {
848     xmlBufferFree(val);
849 }
850 #ifdef LIBXML_SCHEMAS_ENABLED
desret_xmlSchemaParserCtxtPtr(xmlSchemaParserCtxtPtr val)851 static void desret_xmlSchemaParserCtxtPtr(xmlSchemaParserCtxtPtr val) {
852     xmlSchemaFreeParserCtxt(val);
853 }
desret_xmlSchemaTypePtr(xmlSchemaTypePtr val ATTRIBUTE_UNUSED)854 static void desret_xmlSchemaTypePtr(xmlSchemaTypePtr val ATTRIBUTE_UNUSED) {
855 }
desret_xmlRelaxNGParserCtxtPtr(xmlRelaxNGParserCtxtPtr val)856 static void desret_xmlRelaxNGParserCtxtPtr(xmlRelaxNGParserCtxtPtr val) {
857     xmlRelaxNGFreeParserCtxt(val);
858 }
859 #endif
860 #ifdef LIBXML_HTML_ENABLED
desret_const_htmlEntityDesc_ptr(const htmlEntityDesc * val ATTRIBUTE_UNUSED)861 static void desret_const_htmlEntityDesc_ptr(const htmlEntityDesc * val ATTRIBUTE_UNUSED) {
862 }
863 #endif
864 #ifdef LIBXML_HTTP_ENABLED
desret_xmlNanoHTTPCtxtPtr(void * val)865 static void desret_xmlNanoHTTPCtxtPtr(void *val) {
866     xmlNanoHTTPClose(val);
867 }
868 #endif
869 /* cut and pasted from autogenerated to avoid troubles */
870 #define gen_nb_const_xmlChar_ptr_ptr 1
871 static const xmlChar **
gen_const_xmlChar_ptr_ptr(int no ATTRIBUTE_UNUSED,int nr ATTRIBUTE_UNUSED)872 gen_const_xmlChar_ptr_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
873     return(NULL);
874 }
des_const_xmlChar_ptr_ptr(int no ATTRIBUTE_UNUSED,const xmlChar ** val ATTRIBUTE_UNUSED,int nr ATTRIBUTE_UNUSED)875 static void des_const_xmlChar_ptr_ptr(int no ATTRIBUTE_UNUSED, const xmlChar ** val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
876 }
877 
878 #define gen_nb_unsigned_char_ptr 1
gen_unsigned_char_ptr(int no ATTRIBUTE_UNUSED,int nr ATTRIBUTE_UNUSED)879 static unsigned char * gen_unsigned_char_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
880     return(NULL);
881 }
des_unsigned_char_ptr(int no ATTRIBUTE_UNUSED,unsigned char * val ATTRIBUTE_UNUSED,int nr ATTRIBUTE_UNUSED)882 static void des_unsigned_char_ptr(int no ATTRIBUTE_UNUSED, unsigned char * val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
883 }
884 
885 #define gen_nb_const_unsigned_char_ptr 1
886 static const unsigned char *
gen_const_unsigned_char_ptr(int no ATTRIBUTE_UNUSED,int nr ATTRIBUTE_UNUSED)887 gen_const_unsigned_char_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
888     return(NULL);
889 }
des_const_unsigned_char_ptr(int no ATTRIBUTE_UNUSED,const unsigned char * val ATTRIBUTE_UNUSED,int nr ATTRIBUTE_UNUSED)890 static void des_const_unsigned_char_ptr(int no ATTRIBUTE_UNUSED, const unsigned char * val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
891 }
892 
893 #ifdef LIBXML_HTML_ENABLED
894 #define gen_nb_htmlDocPtr 3
gen_htmlDocPtr(int no ATTRIBUTE_UNUSED,int nr ATTRIBUTE_UNUSED)895 static htmlDocPtr gen_htmlDocPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
896     if (no == 0) return(htmlNewDoc(NULL, NULL));
897     if (no == 1) return(htmlReadMemory("<html/>", 7, "test", NULL, 0));
898     return(NULL);
899 }
des_htmlDocPtr(int no ATTRIBUTE_UNUSED,htmlDocPtr val ATTRIBUTE_UNUSED,int nr ATTRIBUTE_UNUSED)900 static void des_htmlDocPtr(int no ATTRIBUTE_UNUSED, htmlDocPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
901     if ((val != NULL) && (val != api_doc) && (val->doc != api_doc))
902         xmlFreeDoc(val);
903 }
desret_htmlDocPtr(htmlDocPtr val)904 static void desret_htmlDocPtr(htmlDocPtr val) {
905     if ((val != NULL) && (val != api_doc) && (val->doc != api_doc))
906         xmlFreeDoc(val);
907 }
908 #define gen_nb_htmlParserCtxtPtr 3
gen_htmlParserCtxtPtr(int no ATTRIBUTE_UNUSED,int nr ATTRIBUTE_UNUSED)909 static htmlParserCtxtPtr gen_htmlParserCtxtPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
910     if (no == 0) return(xmlNewParserCtxt());
911     if (no == 1) return(htmlCreateMemoryParserCtxt("<html/>", 7));
912     return(NULL);
913 }
des_htmlParserCtxtPtr(int no ATTRIBUTE_UNUSED,htmlParserCtxtPtr val ATTRIBUTE_UNUSED,int nr ATTRIBUTE_UNUSED)914 static void des_htmlParserCtxtPtr(int no ATTRIBUTE_UNUSED, htmlParserCtxtPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
915     if (val != NULL)
916         htmlFreeParserCtxt(val);
917 }
desret_htmlParserCtxtPtr(htmlParserCtxtPtr val)918 static void desret_htmlParserCtxtPtr(htmlParserCtxtPtr val) {
919     if (val != NULL)
920         htmlFreeParserCtxt(val);
921 }
922 #endif
923 
924 #ifdef LIBXML_XPATH_ENABLED
925 #define gen_nb_xmlNodeSetPtr 1
gen_xmlNodeSetPtr(int no ATTRIBUTE_UNUSED,int nr ATTRIBUTE_UNUSED)926 static xmlNodeSetPtr gen_xmlNodeSetPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
927     return(NULL);
928 }
des_xmlNodeSetPtr(int no ATTRIBUTE_UNUSED,xmlNodeSetPtr val ATTRIBUTE_UNUSED,int nr ATTRIBUTE_UNUSED)929 static void des_xmlNodeSetPtr(int no ATTRIBUTE_UNUSED, xmlNodeSetPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
930 }
931 #endif
932 
933 #ifdef LIBXML_DEBUG_ENABLED
934 #ifdef LIBXML_XPATH_ENABLED
935 #define gen_nb_xmlShellCtxtPtr 1
gen_xmlShellCtxtPtr(int no ATTRIBUTE_UNUSED,int nr ATTRIBUTE_UNUSED)936 static xmlShellCtxtPtr gen_xmlShellCtxtPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
937     return(NULL);
938 }
des_xmlShellCtxtPtr(int no ATTRIBUTE_UNUSED,xmlShellCtxtPtr val ATTRIBUTE_UNUSED,int nr ATTRIBUTE_UNUSED)939 static void des_xmlShellCtxtPtr(int no ATTRIBUTE_UNUSED, xmlShellCtxtPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
940 }
941 #endif
942 #endif
943 
944 #ifdef LIBXML_PATTERN_ENABLED
945 #define gen_nb_xmlPatternPtr 1
gen_xmlPatternPtr(int no ATTRIBUTE_UNUSED,int nr ATTRIBUTE_UNUSED)946 static xmlPatternPtr gen_xmlPatternPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
947     return(NULL);
948 }
des_xmlPatternPtr(int no ATTRIBUTE_UNUSED,xmlPatternPtr val ATTRIBUTE_UNUSED,int nr ATTRIBUTE_UNUSED)949 static void des_xmlPatternPtr(int no ATTRIBUTE_UNUSED, xmlPatternPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
950 }
951 #endif
952 
953 #define gen_nb_xmlElementContentPtr 1
gen_xmlElementContentPtr(int no ATTRIBUTE_UNUSED,int nr ATTRIBUTE_UNUSED)954 static xmlElementContentPtr gen_xmlElementContentPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
955     return(NULL);
956 }
des_xmlElementContentPtr(int no ATTRIBUTE_UNUSED,xmlElementContentPtr val,int nr ATTRIBUTE_UNUSED)957 static void des_xmlElementContentPtr(int no ATTRIBUTE_UNUSED, xmlElementContentPtr val, int nr ATTRIBUTE_UNUSED) {
958     if (val != NULL)
959         xmlFreeElementContent(val);
960 }
desret_xmlElementContentPtr(xmlElementContentPtr val)961 static void desret_xmlElementContentPtr(xmlElementContentPtr val) {
962     if (val != NULL)
963         xmlFreeElementContent(val);
964 }
965 
966 #define gen_nb_xmlParserNodeInfoSeqPtr 1
gen_xmlParserNodeInfoSeqPtr(int no ATTRIBUTE_UNUSED,int nr ATTRIBUTE_UNUSED)967 static xmlParserNodeInfoSeqPtr gen_xmlParserNodeInfoSeqPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
968     return(NULL);
969 }
des_xmlParserNodeInfoSeqPtr(int no ATTRIBUTE_UNUSED,xmlParserNodeInfoSeqPtr val ATTRIBUTE_UNUSED,int nr ATTRIBUTE_UNUSED)970 static void des_xmlParserNodeInfoSeqPtr(int no ATTRIBUTE_UNUSED, xmlParserNodeInfoSeqPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
971 }
972 
desret_const_xmlParserNodeInfo_ptr(const xmlParserNodeInfo * val ATTRIBUTE_UNUSED)973 static void desret_const_xmlParserNodeInfo_ptr(const xmlParserNodeInfo *val ATTRIBUTE_UNUSED) {
974 }
975 
976 #if defined(LIBXML_MODULES_ENABLED) || defined(LIBXML_READER_ENABLED) || \
977     defined(LIBXML_SCHEMAS_ENABLED)
978 #define gen_nb_void_ptr_ptr 1
gen_void_ptr_ptr(int no ATTRIBUTE_UNUSED,int nr ATTRIBUTE_UNUSED)979 static void ** gen_void_ptr_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
980     return(NULL);
981 }
des_void_ptr_ptr(int no ATTRIBUTE_UNUSED,void ** val ATTRIBUTE_UNUSED,int nr ATTRIBUTE_UNUSED)982 static void des_void_ptr_ptr(int no ATTRIBUTE_UNUSED, void ** val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
983 }
984 #endif
985 
986 /************************************************************************
987  *									*
988  *   WARNING: end of the manually maintained part of the test code	*
989  *            do not remove or alter the CUT HERE line			*
990  *									*
991  ************************************************************************/
992 
993 /* CUT HERE: everything below that line is generated */
994 #ifdef LIBXML_HTML_ENABLED
desret_htmlStatus(htmlStatus val ATTRIBUTE_UNUSED)995 static void desret_htmlStatus(htmlStatus val ATTRIBUTE_UNUSED) {
996 }
997 
998 #endif
999 
1000 #define gen_nb_xmlAttributeDefault 4
gen_xmlAttributeDefault(int no,int nr ATTRIBUTE_UNUSED)1001 static xmlAttributeDefault gen_xmlAttributeDefault(int no, int nr ATTRIBUTE_UNUSED) {
1002     if (no == 1) return(XML_ATTRIBUTE_FIXED);
1003     if (no == 2) return(XML_ATTRIBUTE_IMPLIED);
1004     if (no == 3) return(XML_ATTRIBUTE_NONE);
1005     if (no == 4) return(XML_ATTRIBUTE_REQUIRED);
1006     return(0);
1007 }
1008 
des_xmlAttributeDefault(int no ATTRIBUTE_UNUSED,xmlAttributeDefault val ATTRIBUTE_UNUSED,int nr ATTRIBUTE_UNUSED)1009 static void des_xmlAttributeDefault(int no ATTRIBUTE_UNUSED, xmlAttributeDefault val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
1010 }
1011 
1012 #define gen_nb_xmlAttributeType 4
gen_xmlAttributeType(int no,int nr ATTRIBUTE_UNUSED)1013 static xmlAttributeType gen_xmlAttributeType(int no, int nr ATTRIBUTE_UNUSED) {
1014     if (no == 1) return(XML_ATTRIBUTE_CDATA);
1015     if (no == 2) return(XML_ATTRIBUTE_ENTITIES);
1016     if (no == 3) return(XML_ATTRIBUTE_ENTITY);
1017     if (no == 4) return(XML_ATTRIBUTE_ENUMERATION);
1018     return(0);
1019 }
1020 
des_xmlAttributeType(int no ATTRIBUTE_UNUSED,xmlAttributeType val ATTRIBUTE_UNUSED,int nr ATTRIBUTE_UNUSED)1021 static void des_xmlAttributeType(int no ATTRIBUTE_UNUSED, xmlAttributeType val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
1022 }
1023 
1024 #define gen_nb_xmlBufferAllocationScheme 4
gen_xmlBufferAllocationScheme(int no,int nr ATTRIBUTE_UNUSED)1025 static xmlBufferAllocationScheme gen_xmlBufferAllocationScheme(int no, int nr ATTRIBUTE_UNUSED) {
1026     if (no == 1) return(XML_BUFFER_ALLOC_BOUNDED);
1027     if (no == 2) return(XML_BUFFER_ALLOC_DOUBLEIT);
1028     if (no == 3) return(XML_BUFFER_ALLOC_EXACT);
1029     if (no == 4) return(XML_BUFFER_ALLOC_HYBRID);
1030     return(0);
1031 }
1032 
des_xmlBufferAllocationScheme(int no ATTRIBUTE_UNUSED,xmlBufferAllocationScheme val ATTRIBUTE_UNUSED,int nr ATTRIBUTE_UNUSED)1033 static void des_xmlBufferAllocationScheme(int no ATTRIBUTE_UNUSED, xmlBufferAllocationScheme val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
1034 }
1035 
desret_xmlBufferAllocationScheme(xmlBufferAllocationScheme val ATTRIBUTE_UNUSED)1036 static void desret_xmlBufferAllocationScheme(xmlBufferAllocationScheme val ATTRIBUTE_UNUSED) {
1037 }
1038 
1039 #ifdef LIBXML_CATALOG_ENABLED
1040 #define gen_nb_xmlCatalogAllow 4
gen_xmlCatalogAllow(int no,int nr ATTRIBUTE_UNUSED)1041 static xmlCatalogAllow gen_xmlCatalogAllow(int no, int nr ATTRIBUTE_UNUSED) {
1042     if (no == 1) return(XML_CATA_ALLOW_ALL);
1043     if (no == 2) return(XML_CATA_ALLOW_DOCUMENT);
1044     if (no == 3) return(XML_CATA_ALLOW_GLOBAL);
1045     if (no == 4) return(XML_CATA_ALLOW_NONE);
1046     return(0);
1047 }
1048 
des_xmlCatalogAllow(int no ATTRIBUTE_UNUSED,xmlCatalogAllow val ATTRIBUTE_UNUSED,int nr ATTRIBUTE_UNUSED)1049 static void des_xmlCatalogAllow(int no ATTRIBUTE_UNUSED, xmlCatalogAllow val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
1050 }
1051 
desret_xmlCatalogAllow(xmlCatalogAllow val ATTRIBUTE_UNUSED)1052 static void desret_xmlCatalogAllow(xmlCatalogAllow val ATTRIBUTE_UNUSED) {
1053 }
1054 
1055 #endif
1056 
1057 #ifdef LIBXML_CATALOG_ENABLED
1058 #define gen_nb_xmlCatalogPrefer 3
gen_xmlCatalogPrefer(int no,int nr ATTRIBUTE_UNUSED)1059 static xmlCatalogPrefer gen_xmlCatalogPrefer(int no, int nr ATTRIBUTE_UNUSED) {
1060     if (no == 1) return(XML_CATA_PREFER_NONE);
1061     if (no == 2) return(XML_CATA_PREFER_PUBLIC);
1062     if (no == 3) return(XML_CATA_PREFER_SYSTEM);
1063     return(0);
1064 }
1065 
des_xmlCatalogPrefer(int no ATTRIBUTE_UNUSED,xmlCatalogPrefer val ATTRIBUTE_UNUSED,int nr ATTRIBUTE_UNUSED)1066 static void des_xmlCatalogPrefer(int no ATTRIBUTE_UNUSED, xmlCatalogPrefer val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
1067 }
1068 
desret_xmlCatalogPrefer(xmlCatalogPrefer val ATTRIBUTE_UNUSED)1069 static void desret_xmlCatalogPrefer(xmlCatalogPrefer val ATTRIBUTE_UNUSED) {
1070 }
1071 
1072 #endif
1073 
1074 #define gen_nb_xmlElementContentType 4
gen_xmlElementContentType(int no,int nr ATTRIBUTE_UNUSED)1075 static xmlElementContentType gen_xmlElementContentType(int no, int nr ATTRIBUTE_UNUSED) {
1076     if (no == 1) return(XML_ELEMENT_CONTENT_ELEMENT);
1077     if (no == 2) return(XML_ELEMENT_CONTENT_OR);
1078     if (no == 3) return(XML_ELEMENT_CONTENT_PCDATA);
1079     if (no == 4) return(XML_ELEMENT_CONTENT_SEQ);
1080     return(0);
1081 }
1082 
des_xmlElementContentType(int no ATTRIBUTE_UNUSED,xmlElementContentType val ATTRIBUTE_UNUSED,int nr ATTRIBUTE_UNUSED)1083 static void des_xmlElementContentType(int no ATTRIBUTE_UNUSED, xmlElementContentType val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
1084 }
1085 
1086 #define gen_nb_xmlElementTypeVal 4
gen_xmlElementTypeVal(int no,int nr ATTRIBUTE_UNUSED)1087 static xmlElementTypeVal gen_xmlElementTypeVal(int no, int nr ATTRIBUTE_UNUSED) {
1088     if (no == 1) return(XML_ELEMENT_TYPE_ANY);
1089     if (no == 2) return(XML_ELEMENT_TYPE_ELEMENT);
1090     if (no == 3) return(XML_ELEMENT_TYPE_EMPTY);
1091     if (no == 4) return(XML_ELEMENT_TYPE_MIXED);
1092     return(0);
1093 }
1094 
des_xmlElementTypeVal(int no ATTRIBUTE_UNUSED,xmlElementTypeVal val ATTRIBUTE_UNUSED,int nr ATTRIBUTE_UNUSED)1095 static void des_xmlElementTypeVal(int no ATTRIBUTE_UNUSED, xmlElementTypeVal val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
1096 }
1097 
1098 #define gen_nb_xmlFeature 4
gen_xmlFeature(int no,int nr ATTRIBUTE_UNUSED)1099 static xmlFeature gen_xmlFeature(int no, int nr ATTRIBUTE_UNUSED) {
1100     if (no == 1) return(XML_WITH_AUTOMATA);
1101     if (no == 2) return(XML_WITH_C14N);
1102     if (no == 3) return(XML_WITH_CATALOG);
1103     if (no == 4) return(XML_WITH_DEBUG);
1104     return(0);
1105 }
1106 
des_xmlFeature(int no ATTRIBUTE_UNUSED,xmlFeature val ATTRIBUTE_UNUSED,int nr ATTRIBUTE_UNUSED)1107 static void des_xmlFeature(int no ATTRIBUTE_UNUSED, xmlFeature val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
1108 }
1109 
desret_xmlParserErrors(xmlParserErrors val ATTRIBUTE_UNUSED)1110 static void desret_xmlParserErrors(xmlParserErrors val ATTRIBUTE_UNUSED) {
1111 }
1112 
1113 #ifdef LIBXML_SCHEMAS_ENABLED
1114 #define gen_nb_xmlSchemaValType 4
gen_xmlSchemaValType(int no,int nr ATTRIBUTE_UNUSED)1115 static xmlSchemaValType gen_xmlSchemaValType(int no, int nr ATTRIBUTE_UNUSED) {
1116     if (no == 1) return(XML_SCHEMAS_ANYSIMPLETYPE);
1117     if (no == 2) return(XML_SCHEMAS_ANYTYPE);
1118     if (no == 3) return(XML_SCHEMAS_ANYURI);
1119     if (no == 4) return(XML_SCHEMAS_BASE64BINARY);
1120     return(0);
1121 }
1122 
des_xmlSchemaValType(int no ATTRIBUTE_UNUSED,xmlSchemaValType val ATTRIBUTE_UNUSED,int nr ATTRIBUTE_UNUSED)1123 static void des_xmlSchemaValType(int no ATTRIBUTE_UNUSED, xmlSchemaValType val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
1124 }
1125 
desret_xmlSchemaValType(xmlSchemaValType val ATTRIBUTE_UNUSED)1126 static void desret_xmlSchemaValType(xmlSchemaValType val ATTRIBUTE_UNUSED) {
1127 }
1128 
1129 #endif
1130 
1131 #ifdef LIBXML_SCHEMAS_ENABLED
1132 #define gen_nb_xmlSchemaWhitespaceValueType 4
gen_xmlSchemaWhitespaceValueType(int no,int nr ATTRIBUTE_UNUSED)1133 static xmlSchemaWhitespaceValueType gen_xmlSchemaWhitespaceValueType(int no, int nr ATTRIBUTE_UNUSED) {
1134     if (no == 1) return(XML_SCHEMA_WHITESPACE_COLLAPSE);
1135     if (no == 2) return(XML_SCHEMA_WHITESPACE_PRESERVE);
1136     if (no == 3) return(XML_SCHEMA_WHITESPACE_REPLACE);
1137     if (no == 4) return(XML_SCHEMA_WHITESPACE_UNKNOWN);
1138     return(0);
1139 }
1140 
des_xmlSchemaWhitespaceValueType(int no ATTRIBUTE_UNUSED,xmlSchemaWhitespaceValueType val ATTRIBUTE_UNUSED,int nr ATTRIBUTE_UNUSED)1141 static void des_xmlSchemaWhitespaceValueType(int no ATTRIBUTE_UNUSED, xmlSchemaWhitespaceValueType val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
1142 }
1143 
1144 #endif
1145 
1146 #include <libxml/HTMLparser.h>
1147 #include <libxml/HTMLtree.h>
1148 #include <libxml/SAX2.h>
1149 #include <libxml/c14n.h>
1150 #include <libxml/catalog.h>
1151 #include <libxml/chvalid.h>
1152 #include <libxml/debugXML.h>
1153 #include <libxml/dict.h>
1154 #include <libxml/encoding.h>
1155 #include <libxml/entities.h>
1156 #include <libxml/hash.h>
1157 #include <libxml/list.h>
1158 #include <libxml/nanohttp.h>
1159 #include <libxml/parser.h>
1160 #include <libxml/parserInternals.h>
1161 #include <libxml/pattern.h>
1162 #include <libxml/relaxng.h>
1163 #include <libxml/schemasInternals.h>
1164 #include <libxml/schematron.h>
1165 #include <libxml/tree.h>
1166 #include <libxml/uri.h>
1167 #include <libxml/valid.h>
1168 #include <libxml/xinclude.h>
1169 #include <libxml/xmlIO.h>
1170 #include <libxml/xmlautomata.h>
1171 #include <libxml/xmlerror.h>
1172 #include <libxml/xmlmodule.h>
1173 #include <libxml/xmlreader.h>
1174 #include <libxml/xmlregexp.h>
1175 #include <libxml/xmlsave.h>
1176 #include <libxml/xmlschemas.h>
1177 #include <libxml/xmlschemastypes.h>
1178 #include <libxml/xmlstring.h>
1179 #include <libxml/xmlunicode.h>
1180 #include <libxml/xmlwriter.h>
1181 #include <libxml/xpath.h>
1182 #include <libxml/xpathInternals.h>
1183 #include <libxml/xpointer.h>
1184 static int test_HTMLparser(void);
1185 static int test_HTMLtree(void);
1186 static int test_SAX2(void);
1187 static int test_c14n(void);
1188 static int test_catalog(void);
1189 static int test_chvalid(void);
1190 static int test_debugXML(void);
1191 static int test_dict(void);
1192 static int test_encoding(void);
1193 static int test_entities(void);
1194 static int test_hash(void);
1195 static int test_list(void);
1196 static int test_nanohttp(void);
1197 static int test_parser(void);
1198 static int test_parserInternals(void);
1199 static int test_pattern(void);
1200 static int test_relaxng(void);
1201 static int test_schemasInternals(void);
1202 static int test_schematron(void);
1203 static int test_tree(void);
1204 static int test_uri(void);
1205 static int test_valid(void);
1206 static int test_xinclude(void);
1207 static int test_xmlIO(void);
1208 static int test_xmlautomata(void);
1209 static int test_xmlerror(void);
1210 static int test_xmlmodule(void);
1211 static int test_xmlreader(void);
1212 static int test_xmlregexp(void);
1213 static int test_xmlsave(void);
1214 static int test_xmlschemas(void);
1215 static int test_xmlschemastypes(void);
1216 static int test_xmlstring(void);
1217 static int test_xmlunicode(void);
1218 static int test_xmlwriter(void);
1219 static int test_xpath(void);
1220 static int test_xpathInternals(void);
1221 static int test_xpointer(void);
1222 
1223 /**
1224  * testlibxml2:
1225  *
1226  * Main entry point of the tester for the full libxml2 module,
1227  * it calls all the tester entry point for each module.
1228  *
1229  * Returns the number of error found
1230  */
1231 static int
testlibxml2(void)1232 testlibxml2(void)
1233 {
1234     int test_ret = 0;
1235 
1236     test_ret += test_HTMLparser();
1237     test_ret += test_HTMLtree();
1238     test_ret += test_SAX2();
1239     test_ret += test_c14n();
1240     test_ret += test_catalog();
1241     test_ret += test_chvalid();
1242     test_ret += test_debugXML();
1243     test_ret += test_dict();
1244     test_ret += test_encoding();
1245     test_ret += test_entities();
1246     test_ret += test_hash();
1247     test_ret += test_list();
1248     test_ret += test_nanohttp();
1249     test_ret += test_parser();
1250     test_ret += test_parserInternals();
1251     test_ret += test_pattern();
1252     test_ret += test_relaxng();
1253     test_ret += test_schemasInternals();
1254     test_ret += test_schematron();
1255     test_ret += test_tree();
1256     test_ret += test_uri();
1257     test_ret += test_valid();
1258     test_ret += test_xinclude();
1259     test_ret += test_xmlIO();
1260     test_ret += test_xmlautomata();
1261     test_ret += test_xmlerror();
1262     test_ret += test_xmlmodule();
1263     test_ret += test_xmlreader();
1264     test_ret += test_xmlregexp();
1265     test_ret += test_xmlsave();
1266     test_ret += test_xmlschemas();
1267     test_ret += test_xmlschemastypes();
1268     test_ret += test_xmlstring();
1269     test_ret += test_xmlunicode();
1270     test_ret += test_xmlwriter();
1271     test_ret += test_xpath();
1272     test_ret += test_xpathInternals();
1273     test_ret += test_xpointer();
1274 
1275     printf("Total: %d functions, %d tests, %d errors\n",
1276            function_tests, call_tests, test_ret);
1277     return(test_ret);
1278 }
1279 
1280 
1281 static int
test_UTF8ToHtml(void)1282 test_UTF8ToHtml(void) {
1283     int test_ret = 0;
1284 
1285 #if defined(LIBXML_HTML_ENABLED)
1286     int mem_base;
1287     int ret_val;
1288     unsigned char * out; /* a pointer to an array of bytes to store the result */
1289     int n_out;
1290     int * outlen; /* the length of @out */
1291     int n_outlen;
1292     const unsigned char * in; /* a pointer to an array of UTF-8 chars */
1293     int n_in;
1294     int * inlen; /* the length of @in */
1295     int n_inlen;
1296 
1297     for (n_out = 0;n_out < gen_nb_unsigned_char_ptr;n_out++) {
1298     for (n_outlen = 0;n_outlen < gen_nb_int_ptr;n_outlen++) {
1299     for (n_in = 0;n_in < gen_nb_const_unsigned_char_ptr;n_in++) {
1300     for (n_inlen = 0;n_inlen < gen_nb_int_ptr;n_inlen++) {
1301         mem_base = xmlMemBlocks();
1302         out = gen_unsigned_char_ptr(n_out, 0);
1303         outlen = gen_int_ptr(n_outlen, 1);
1304         in = gen_const_unsigned_char_ptr(n_in, 2);
1305         inlen = gen_int_ptr(n_inlen, 3);
1306 
1307         ret_val = UTF8ToHtml(out, outlen, in, inlen);
1308         desret_int(ret_val);
1309         call_tests++;
1310         des_unsigned_char_ptr(n_out, out, 0);
1311         des_int_ptr(n_outlen, outlen, 1);
1312         des_const_unsigned_char_ptr(n_in, in, 2);
1313         des_int_ptr(n_inlen, inlen, 3);
1314         xmlResetLastError();
1315         if (mem_base != xmlMemBlocks()) {
1316             printf("Leak of %d blocks found in UTF8ToHtml",
1317 	           xmlMemBlocks() - mem_base);
1318 	    test_ret++;
1319             printf(" %d", n_out);
1320             printf(" %d", n_outlen);
1321             printf(" %d", n_in);
1322             printf(" %d", n_inlen);
1323             printf("\n");
1324         }
1325     }
1326     }
1327     }
1328     }
1329     function_tests++;
1330 #endif
1331 
1332     return(test_ret);
1333 }
1334 
1335 #ifdef LIBXML_HTML_ENABLED
1336 
1337 #define gen_nb_const_htmlElemDesc_ptr 1
1338 #define gen_const_htmlElemDesc_ptr(no, nr) NULL
1339 #define des_const_htmlElemDesc_ptr(no, val, nr)
1340 #endif
1341 
1342 
1343 static int
test_htmlAttrAllowed(void)1344 test_htmlAttrAllowed(void) {
1345     int test_ret = 0;
1346 
1347 #if defined(LIBXML_HTML_ENABLED)
1348     int mem_base;
1349     htmlStatus ret_val;
1350     const htmlElemDesc * elt; /* HTML element */
1351     int n_elt;
1352     const xmlChar * attr; /* HTML attribute */
1353     int n_attr;
1354     int legacy; /* whether to allow deprecated attributes */
1355     int n_legacy;
1356 
1357     for (n_elt = 0;n_elt < gen_nb_const_htmlElemDesc_ptr;n_elt++) {
1358     for (n_attr = 0;n_attr < gen_nb_const_xmlChar_ptr;n_attr++) {
1359     for (n_legacy = 0;n_legacy < gen_nb_int;n_legacy++) {
1360         mem_base = xmlMemBlocks();
1361         elt = gen_const_htmlElemDesc_ptr(n_elt, 0);
1362         attr = gen_const_xmlChar_ptr(n_attr, 1);
1363         legacy = gen_int(n_legacy, 2);
1364 
1365         ret_val = htmlAttrAllowed(elt, attr, legacy);
1366         desret_htmlStatus(ret_val);
1367         call_tests++;
1368         des_const_htmlElemDesc_ptr(n_elt, elt, 0);
1369         des_const_xmlChar_ptr(n_attr, attr, 1);
1370         des_int(n_legacy, legacy, 2);
1371         xmlResetLastError();
1372         if (mem_base != xmlMemBlocks()) {
1373             printf("Leak of %d blocks found in htmlAttrAllowed",
1374 	           xmlMemBlocks() - mem_base);
1375 	    test_ret++;
1376             printf(" %d", n_elt);
1377             printf(" %d", n_attr);
1378             printf(" %d", n_legacy);
1379             printf("\n");
1380         }
1381     }
1382     }
1383     }
1384     function_tests++;
1385 #endif
1386 
1387     return(test_ret);
1388 }
1389 
1390 #ifdef LIBXML_HTML_ENABLED
1391 
1392 #define gen_nb_htmlNodePtr 1
1393 #define gen_htmlNodePtr(no, nr) NULL
1394 #define des_htmlNodePtr(no, val, nr)
1395 #endif
1396 
1397 
1398 static int
test_htmlAutoCloseTag(void)1399 test_htmlAutoCloseTag(void) {
1400     int test_ret = 0;
1401 
1402 #if defined(LIBXML_HTML_ENABLED)
1403     int mem_base;
1404     int ret_val;
1405     htmlDocPtr doc; /* the HTML document */
1406     int n_doc;
1407     const xmlChar * name; /* The tag name */
1408     int n_name;
1409     htmlNodePtr elem; /* the HTML element */
1410     int n_elem;
1411 
1412     for (n_doc = 0;n_doc < gen_nb_htmlDocPtr;n_doc++) {
1413     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
1414     for (n_elem = 0;n_elem < gen_nb_htmlNodePtr;n_elem++) {
1415         mem_base = xmlMemBlocks();
1416         doc = gen_htmlDocPtr(n_doc, 0);
1417         name = gen_const_xmlChar_ptr(n_name, 1);
1418         elem = gen_htmlNodePtr(n_elem, 2);
1419 
1420         ret_val = htmlAutoCloseTag(doc, name, elem);
1421         desret_int(ret_val);
1422         call_tests++;
1423         des_htmlDocPtr(n_doc, doc, 0);
1424         des_const_xmlChar_ptr(n_name, name, 1);
1425         des_htmlNodePtr(n_elem, elem, 2);
1426         xmlResetLastError();
1427         if (mem_base != xmlMemBlocks()) {
1428             printf("Leak of %d blocks found in htmlAutoCloseTag",
1429 	           xmlMemBlocks() - mem_base);
1430 	    test_ret++;
1431             printf(" %d", n_doc);
1432             printf(" %d", n_name);
1433             printf(" %d", n_elem);
1434             printf("\n");
1435         }
1436     }
1437     }
1438     }
1439     function_tests++;
1440 #endif
1441 
1442     return(test_ret);
1443 }
1444 
1445 
1446 static int
test_htmlCreateFileParserCtxt(void)1447 test_htmlCreateFileParserCtxt(void) {
1448     int test_ret = 0;
1449 
1450 #if defined(LIBXML_HTML_ENABLED)
1451     int mem_base;
1452     htmlParserCtxtPtr ret_val;
1453     const char * filename; /* the filename */
1454     int n_filename;
1455     const char * encoding; /* a free form C string describing the HTML document encoding, or NULL */
1456     int n_encoding;
1457 
1458     for (n_filename = 0;n_filename < gen_nb_fileoutput;n_filename++) {
1459     for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
1460         mem_base = xmlMemBlocks();
1461         filename = gen_fileoutput(n_filename, 0);
1462         encoding = gen_const_char_ptr(n_encoding, 1);
1463 
1464         ret_val = htmlCreateFileParserCtxt(filename, encoding);
1465         desret_htmlParserCtxtPtr(ret_val);
1466         call_tests++;
1467         des_fileoutput(n_filename, filename, 0);
1468         des_const_char_ptr(n_encoding, encoding, 1);
1469         xmlResetLastError();
1470         if (mem_base != xmlMemBlocks()) {
1471             printf("Leak of %d blocks found in htmlCreateFileParserCtxt",
1472 	           xmlMemBlocks() - mem_base);
1473 	    test_ret++;
1474             printf(" %d", n_filename);
1475             printf(" %d", n_encoding);
1476             printf("\n");
1477         }
1478     }
1479     }
1480     function_tests++;
1481 #endif
1482 
1483     return(test_ret);
1484 }
1485 
1486 
1487 static int
test_htmlCreateMemoryParserCtxt(void)1488 test_htmlCreateMemoryParserCtxt(void) {
1489     int test_ret = 0;
1490 
1491 #if defined(LIBXML_HTML_ENABLED)
1492     int mem_base;
1493     htmlParserCtxtPtr ret_val;
1494     const char * buffer; /* a pointer to a char array */
1495     int n_buffer;
1496     int size; /* the size of the array */
1497     int n_size;
1498 
1499     for (n_buffer = 0;n_buffer < gen_nb_const_char_ptr;n_buffer++) {
1500     for (n_size = 0;n_size < gen_nb_int;n_size++) {
1501         mem_base = xmlMemBlocks();
1502         buffer = gen_const_char_ptr(n_buffer, 0);
1503         size = gen_int(n_size, 1);
1504         if ((buffer != NULL) &&
1505             (size > xmlStrlen(BAD_CAST buffer)))
1506             size = 0;
1507 
1508         ret_val = htmlCreateMemoryParserCtxt(buffer, size);
1509         desret_htmlParserCtxtPtr(ret_val);
1510         call_tests++;
1511         des_const_char_ptr(n_buffer, buffer, 0);
1512         des_int(n_size, size, 1);
1513         xmlResetLastError();
1514         if (mem_base != xmlMemBlocks()) {
1515             printf("Leak of %d blocks found in htmlCreateMemoryParserCtxt",
1516 	           xmlMemBlocks() - mem_base);
1517 	    test_ret++;
1518             printf(" %d", n_buffer);
1519             printf(" %d", n_size);
1520             printf("\n");
1521         }
1522     }
1523     }
1524     function_tests++;
1525 #endif
1526 
1527     return(test_ret);
1528 }
1529 
1530 #ifdef LIBXML_HTML_ENABLED
1531 
1532 #define gen_nb_htmlSAXHandlerPtr 1
1533 #define gen_htmlSAXHandlerPtr(no, nr) NULL
1534 #define des_htmlSAXHandlerPtr(no, val, nr)
1535 #endif
1536 
1537 
1538 static int
test_htmlCreatePushParserCtxt(void)1539 test_htmlCreatePushParserCtxt(void) {
1540     int test_ret = 0;
1541 
1542 #if defined(LIBXML_HTML_ENABLED) && defined(LIBXML_PUSH_ENABLED)
1543     int mem_base;
1544     htmlParserCtxtPtr ret_val;
1545     htmlSAXHandlerPtr sax; /* a SAX handler */
1546     int n_sax;
1547     void * user_data; /* The user data returned on SAX callbacks */
1548     int n_user_data;
1549     const char * chunk; /* a pointer to an array of chars */
1550     int n_chunk;
1551     int size; /* number of chars in the array */
1552     int n_size;
1553     const char * filename; /* an optional file name or URI */
1554     int n_filename;
1555     xmlCharEncoding enc; /* an optional encoding */
1556     int n_enc;
1557 
1558     for (n_sax = 0;n_sax < gen_nb_htmlSAXHandlerPtr;n_sax++) {
1559     for (n_user_data = 0;n_user_data < gen_nb_userdata;n_user_data++) {
1560     for (n_chunk = 0;n_chunk < gen_nb_const_char_ptr;n_chunk++) {
1561     for (n_size = 0;n_size < gen_nb_int;n_size++) {
1562     for (n_filename = 0;n_filename < gen_nb_fileoutput;n_filename++) {
1563     for (n_enc = 0;n_enc < gen_nb_xmlCharEncoding;n_enc++) {
1564         mem_base = xmlMemBlocks();
1565         sax = gen_htmlSAXHandlerPtr(n_sax, 0);
1566         user_data = gen_userdata(n_user_data, 1);
1567         chunk = gen_const_char_ptr(n_chunk, 2);
1568         size = gen_int(n_size, 3);
1569         filename = gen_fileoutput(n_filename, 4);
1570         enc = gen_xmlCharEncoding(n_enc, 5);
1571         if ((chunk != NULL) &&
1572             (size > xmlStrlen(BAD_CAST chunk)))
1573             size = 0;
1574 
1575         ret_val = htmlCreatePushParserCtxt(sax, user_data, chunk, size, filename, enc);
1576         desret_htmlParserCtxtPtr(ret_val);
1577         call_tests++;
1578         des_htmlSAXHandlerPtr(n_sax, sax, 0);
1579         des_userdata(n_user_data, user_data, 1);
1580         des_const_char_ptr(n_chunk, chunk, 2);
1581         des_int(n_size, size, 3);
1582         des_fileoutput(n_filename, filename, 4);
1583         des_xmlCharEncoding(n_enc, enc, 5);
1584         xmlResetLastError();
1585         if (mem_base != xmlMemBlocks()) {
1586             printf("Leak of %d blocks found in htmlCreatePushParserCtxt",
1587 	           xmlMemBlocks() - mem_base);
1588 	    test_ret++;
1589             printf(" %d", n_sax);
1590             printf(" %d", n_user_data);
1591             printf(" %d", n_chunk);
1592             printf(" %d", n_size);
1593             printf(" %d", n_filename);
1594             printf(" %d", n_enc);
1595             printf("\n");
1596         }
1597     }
1598     }
1599     }
1600     }
1601     }
1602     }
1603     function_tests++;
1604 #endif
1605 
1606     return(test_ret);
1607 }
1608 
1609 
1610 static int
test_htmlCtxtReadDoc(void)1611 test_htmlCtxtReadDoc(void) {
1612     int test_ret = 0;
1613 
1614 #if defined(LIBXML_HTML_ENABLED)
1615     int mem_base;
1616     htmlDocPtr ret_val;
1617     htmlParserCtxtPtr ctxt; /* an HTML parser context */
1618     int n_ctxt;
1619     const xmlChar * str; /* a pointer to a zero terminated string */
1620     int n_str;
1621     const char * URL; /* the base URL to use for the document */
1622     int n_URL;
1623     const char * encoding; /* the document encoding, or NULL */
1624     int n_encoding;
1625     int options; /* a combination of htmlParserOption(s) */
1626     int n_options;
1627 
1628     for (n_ctxt = 0;n_ctxt < gen_nb_htmlParserCtxtPtr;n_ctxt++) {
1629     for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) {
1630     for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) {
1631     for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
1632     for (n_options = 0;n_options < gen_nb_int;n_options++) {
1633         mem_base = xmlMemBlocks();
1634         ctxt = gen_htmlParserCtxtPtr(n_ctxt, 0);
1635         str = gen_const_xmlChar_ptr(n_str, 1);
1636         URL = gen_filepath(n_URL, 2);
1637         encoding = gen_const_char_ptr(n_encoding, 3);
1638         options = gen_int(n_options, 4);
1639 
1640         ret_val = htmlCtxtReadDoc(ctxt, str, URL, encoding, options);
1641         desret_htmlDocPtr(ret_val);
1642         call_tests++;
1643         des_htmlParserCtxtPtr(n_ctxt, ctxt, 0);
1644         des_const_xmlChar_ptr(n_str, str, 1);
1645         des_filepath(n_URL, URL, 2);
1646         des_const_char_ptr(n_encoding, encoding, 3);
1647         des_int(n_options, options, 4);
1648         xmlResetLastError();
1649         if (mem_base != xmlMemBlocks()) {
1650             printf("Leak of %d blocks found in htmlCtxtReadDoc",
1651 	           xmlMemBlocks() - mem_base);
1652 	    test_ret++;
1653             printf(" %d", n_ctxt);
1654             printf(" %d", n_str);
1655             printf(" %d", n_URL);
1656             printf(" %d", n_encoding);
1657             printf(" %d", n_options);
1658             printf("\n");
1659         }
1660     }
1661     }
1662     }
1663     }
1664     }
1665     function_tests++;
1666 #endif
1667 
1668     return(test_ret);
1669 }
1670 
1671 
1672 static int
test_htmlCtxtReadFile(void)1673 test_htmlCtxtReadFile(void) {
1674     int test_ret = 0;
1675 
1676 #if defined(LIBXML_HTML_ENABLED)
1677     htmlDocPtr ret_val;
1678     htmlParserCtxtPtr ctxt; /* an HTML parser context */
1679     int n_ctxt;
1680     const char * filename; /* a file or URL */
1681     int n_filename;
1682     const char * encoding; /* the document encoding, or NULL */
1683     int n_encoding;
1684     int options; /* a combination of htmlParserOption(s) */
1685     int n_options;
1686 
1687     for (n_ctxt = 0;n_ctxt < gen_nb_htmlParserCtxtPtr;n_ctxt++) {
1688     for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
1689     for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
1690     for (n_options = 0;n_options < gen_nb_int;n_options++) {
1691         ctxt = gen_htmlParserCtxtPtr(n_ctxt, 0);
1692         filename = gen_filepath(n_filename, 1);
1693         encoding = gen_const_char_ptr(n_encoding, 2);
1694         options = gen_int(n_options, 3);
1695 
1696         ret_val = htmlCtxtReadFile(ctxt, filename, encoding, options);
1697         desret_htmlDocPtr(ret_val);
1698         call_tests++;
1699         des_htmlParserCtxtPtr(n_ctxt, ctxt, 0);
1700         des_filepath(n_filename, filename, 1);
1701         des_const_char_ptr(n_encoding, encoding, 2);
1702         des_int(n_options, options, 3);
1703         xmlResetLastError();
1704     }
1705     }
1706     }
1707     }
1708     function_tests++;
1709 #endif
1710 
1711     return(test_ret);
1712 }
1713 
1714 
1715 static int
test_htmlCtxtReadMemory(void)1716 test_htmlCtxtReadMemory(void) {
1717     int test_ret = 0;
1718 
1719 #if defined(LIBXML_HTML_ENABLED)
1720     int mem_base;
1721     htmlDocPtr ret_val;
1722     htmlParserCtxtPtr ctxt; /* an HTML parser context */
1723     int n_ctxt;
1724     const char * buffer; /* a pointer to a char array */
1725     int n_buffer;
1726     int size; /* the size of the array */
1727     int n_size;
1728     const char * URL; /* the base URL to use for the document */
1729     int n_URL;
1730     const char * encoding; /* the document encoding, or NULL */
1731     int n_encoding;
1732     int options; /* a combination of htmlParserOption(s) */
1733     int n_options;
1734 
1735     for (n_ctxt = 0;n_ctxt < gen_nb_htmlParserCtxtPtr;n_ctxt++) {
1736     for (n_buffer = 0;n_buffer < gen_nb_const_char_ptr;n_buffer++) {
1737     for (n_size = 0;n_size < gen_nb_int;n_size++) {
1738     for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) {
1739     for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
1740     for (n_options = 0;n_options < gen_nb_int;n_options++) {
1741         mem_base = xmlMemBlocks();
1742         ctxt = gen_htmlParserCtxtPtr(n_ctxt, 0);
1743         buffer = gen_const_char_ptr(n_buffer, 1);
1744         size = gen_int(n_size, 2);
1745         URL = gen_filepath(n_URL, 3);
1746         encoding = gen_const_char_ptr(n_encoding, 4);
1747         options = gen_int(n_options, 5);
1748         if ((buffer != NULL) &&
1749             (size > xmlStrlen(BAD_CAST buffer)))
1750             size = 0;
1751 
1752         ret_val = htmlCtxtReadMemory(ctxt, buffer, size, URL, encoding, options);
1753         desret_htmlDocPtr(ret_val);
1754         call_tests++;
1755         des_htmlParserCtxtPtr(n_ctxt, ctxt, 0);
1756         des_const_char_ptr(n_buffer, buffer, 1);
1757         des_int(n_size, size, 2);
1758         des_filepath(n_URL, URL, 3);
1759         des_const_char_ptr(n_encoding, encoding, 4);
1760         des_int(n_options, options, 5);
1761         xmlResetLastError();
1762         if (mem_base != xmlMemBlocks()) {
1763             printf("Leak of %d blocks found in htmlCtxtReadMemory",
1764 	           xmlMemBlocks() - mem_base);
1765 	    test_ret++;
1766             printf(" %d", n_ctxt);
1767             printf(" %d", n_buffer);
1768             printf(" %d", n_size);
1769             printf(" %d", n_URL);
1770             printf(" %d", n_encoding);
1771             printf(" %d", n_options);
1772             printf("\n");
1773         }
1774     }
1775     }
1776     }
1777     }
1778     }
1779     }
1780     function_tests++;
1781 #endif
1782 
1783     return(test_ret);
1784 }
1785 
1786 
1787 static int
test_htmlCtxtReset(void)1788 test_htmlCtxtReset(void) {
1789     int test_ret = 0;
1790 
1791 #if defined(LIBXML_HTML_ENABLED)
1792     int mem_base;
1793     htmlParserCtxtPtr ctxt; /* an HTML parser context */
1794     int n_ctxt;
1795 
1796     for (n_ctxt = 0;n_ctxt < gen_nb_htmlParserCtxtPtr;n_ctxt++) {
1797         mem_base = xmlMemBlocks();
1798         ctxt = gen_htmlParserCtxtPtr(n_ctxt, 0);
1799 
1800         htmlCtxtReset(ctxt);
1801         call_tests++;
1802         des_htmlParserCtxtPtr(n_ctxt, ctxt, 0);
1803         xmlResetLastError();
1804         if (mem_base != xmlMemBlocks()) {
1805             printf("Leak of %d blocks found in htmlCtxtReset",
1806 	           xmlMemBlocks() - mem_base);
1807 	    test_ret++;
1808             printf(" %d", n_ctxt);
1809             printf("\n");
1810         }
1811     }
1812     function_tests++;
1813 #endif
1814 
1815     return(test_ret);
1816 }
1817 
1818 
1819 static int
test_htmlCtxtUseOptions(void)1820 test_htmlCtxtUseOptions(void) {
1821     int test_ret = 0;
1822 
1823 #if defined(LIBXML_HTML_ENABLED)
1824     int mem_base;
1825     int ret_val;
1826     htmlParserCtxtPtr ctxt; /* an HTML parser context */
1827     int n_ctxt;
1828     int options; /* a combination of htmlParserOption(s) */
1829     int n_options;
1830 
1831     for (n_ctxt = 0;n_ctxt < gen_nb_htmlParserCtxtPtr;n_ctxt++) {
1832     for (n_options = 0;n_options < gen_nb_int;n_options++) {
1833         mem_base = xmlMemBlocks();
1834         ctxt = gen_htmlParserCtxtPtr(n_ctxt, 0);
1835         options = gen_int(n_options, 1);
1836 
1837         ret_val = htmlCtxtUseOptions(ctxt, options);
1838         desret_int(ret_val);
1839         call_tests++;
1840         des_htmlParserCtxtPtr(n_ctxt, ctxt, 0);
1841         des_int(n_options, options, 1);
1842         xmlResetLastError();
1843         if (mem_base != xmlMemBlocks()) {
1844             printf("Leak of %d blocks found in htmlCtxtUseOptions",
1845 	           xmlMemBlocks() - mem_base);
1846 	    test_ret++;
1847             printf(" %d", n_ctxt);
1848             printf(" %d", n_options);
1849             printf("\n");
1850         }
1851     }
1852     }
1853     function_tests++;
1854 #endif
1855 
1856     return(test_ret);
1857 }
1858 
1859 
1860 static int
test_htmlElementAllowedHere(void)1861 test_htmlElementAllowedHere(void) {
1862     int test_ret = 0;
1863 
1864 #if defined(LIBXML_HTML_ENABLED)
1865     int mem_base;
1866     int ret_val;
1867     const htmlElemDesc * parent; /* HTML parent element */
1868     int n_parent;
1869     const xmlChar * elt; /* HTML element */
1870     int n_elt;
1871 
1872     for (n_parent = 0;n_parent < gen_nb_const_htmlElemDesc_ptr;n_parent++) {
1873     for (n_elt = 0;n_elt < gen_nb_const_xmlChar_ptr;n_elt++) {
1874         mem_base = xmlMemBlocks();
1875         parent = gen_const_htmlElemDesc_ptr(n_parent, 0);
1876         elt = gen_const_xmlChar_ptr(n_elt, 1);
1877 
1878         ret_val = htmlElementAllowedHere(parent, elt);
1879         desret_int(ret_val);
1880         call_tests++;
1881         des_const_htmlElemDesc_ptr(n_parent, parent, 0);
1882         des_const_xmlChar_ptr(n_elt, elt, 1);
1883         xmlResetLastError();
1884         if (mem_base != xmlMemBlocks()) {
1885             printf("Leak of %d blocks found in htmlElementAllowedHere",
1886 	           xmlMemBlocks() - mem_base);
1887 	    test_ret++;
1888             printf(" %d", n_parent);
1889             printf(" %d", n_elt);
1890             printf("\n");
1891         }
1892     }
1893     }
1894     function_tests++;
1895 #endif
1896 
1897     return(test_ret);
1898 }
1899 
1900 
1901 static int
test_htmlElementStatusHere(void)1902 test_htmlElementStatusHere(void) {
1903     int test_ret = 0;
1904 
1905 #if defined(LIBXML_HTML_ENABLED)
1906     int mem_base;
1907     htmlStatus ret_val;
1908     const htmlElemDesc * parent; /* HTML parent element */
1909     int n_parent;
1910     const htmlElemDesc * elt; /* HTML element */
1911     int n_elt;
1912 
1913     for (n_parent = 0;n_parent < gen_nb_const_htmlElemDesc_ptr;n_parent++) {
1914     for (n_elt = 0;n_elt < gen_nb_const_htmlElemDesc_ptr;n_elt++) {
1915         mem_base = xmlMemBlocks();
1916         parent = gen_const_htmlElemDesc_ptr(n_parent, 0);
1917         elt = gen_const_htmlElemDesc_ptr(n_elt, 1);
1918 
1919         ret_val = htmlElementStatusHere(parent, elt);
1920         desret_htmlStatus(ret_val);
1921         call_tests++;
1922         des_const_htmlElemDesc_ptr(n_parent, parent, 0);
1923         des_const_htmlElemDesc_ptr(n_elt, elt, 1);
1924         xmlResetLastError();
1925         if (mem_base != xmlMemBlocks()) {
1926             printf("Leak of %d blocks found in htmlElementStatusHere",
1927 	           xmlMemBlocks() - mem_base);
1928 	    test_ret++;
1929             printf(" %d", n_parent);
1930             printf(" %d", n_elt);
1931             printf("\n");
1932         }
1933     }
1934     }
1935     function_tests++;
1936 #endif
1937 
1938     return(test_ret);
1939 }
1940 
1941 
1942 static int
test_htmlEncodeEntities(void)1943 test_htmlEncodeEntities(void) {
1944     int test_ret = 0;
1945 
1946 #if defined(LIBXML_HTML_ENABLED)
1947     int mem_base;
1948     int ret_val;
1949     unsigned char * out; /* a pointer to an array of bytes to store the result */
1950     int n_out;
1951     int * outlen; /* the length of @out */
1952     int n_outlen;
1953     const unsigned char * in; /* a pointer to an array of UTF-8 chars */
1954     int n_in;
1955     int * inlen; /* the length of @in */
1956     int n_inlen;
1957     int quoteChar; /* the quote character to escape (' or ") or zero. */
1958     int n_quoteChar;
1959 
1960     for (n_out = 0;n_out < gen_nb_unsigned_char_ptr;n_out++) {
1961     for (n_outlen = 0;n_outlen < gen_nb_int_ptr;n_outlen++) {
1962     for (n_in = 0;n_in < gen_nb_const_unsigned_char_ptr;n_in++) {
1963     for (n_inlen = 0;n_inlen < gen_nb_int_ptr;n_inlen++) {
1964     for (n_quoteChar = 0;n_quoteChar < gen_nb_int;n_quoteChar++) {
1965         mem_base = xmlMemBlocks();
1966         out = gen_unsigned_char_ptr(n_out, 0);
1967         outlen = gen_int_ptr(n_outlen, 1);
1968         in = gen_const_unsigned_char_ptr(n_in, 2);
1969         inlen = gen_int_ptr(n_inlen, 3);
1970         quoteChar = gen_int(n_quoteChar, 4);
1971 
1972         ret_val = htmlEncodeEntities(out, outlen, in, inlen, quoteChar);
1973         desret_int(ret_val);
1974         call_tests++;
1975         des_unsigned_char_ptr(n_out, out, 0);
1976         des_int_ptr(n_outlen, outlen, 1);
1977         des_const_unsigned_char_ptr(n_in, in, 2);
1978         des_int_ptr(n_inlen, inlen, 3);
1979         des_int(n_quoteChar, quoteChar, 4);
1980         xmlResetLastError();
1981         if (mem_base != xmlMemBlocks()) {
1982             printf("Leak of %d blocks found in htmlEncodeEntities",
1983 	           xmlMemBlocks() - mem_base);
1984 	    test_ret++;
1985             printf(" %d", n_out);
1986             printf(" %d", n_outlen);
1987             printf(" %d", n_in);
1988             printf(" %d", n_inlen);
1989             printf(" %d", n_quoteChar);
1990             printf("\n");
1991         }
1992     }
1993     }
1994     }
1995     }
1996     }
1997     function_tests++;
1998 #endif
1999 
2000     return(test_ret);
2001 }
2002 
2003 
2004 static int
test_htmlEntityLookup(void)2005 test_htmlEntityLookup(void) {
2006     int test_ret = 0;
2007 
2008 #if defined(LIBXML_HTML_ENABLED)
2009     int mem_base;
2010     const htmlEntityDesc * ret_val;
2011     const xmlChar * name; /* the entity name */
2012     int n_name;
2013 
2014     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
2015         mem_base = xmlMemBlocks();
2016         name = gen_const_xmlChar_ptr(n_name, 0);
2017 
2018         ret_val = htmlEntityLookup(name);
2019         desret_const_htmlEntityDesc_ptr(ret_val);
2020         call_tests++;
2021         des_const_xmlChar_ptr(n_name, name, 0);
2022         xmlResetLastError();
2023         if (mem_base != xmlMemBlocks()) {
2024             printf("Leak of %d blocks found in htmlEntityLookup",
2025 	           xmlMemBlocks() - mem_base);
2026 	    test_ret++;
2027             printf(" %d", n_name);
2028             printf("\n");
2029         }
2030     }
2031     function_tests++;
2032 #endif
2033 
2034     return(test_ret);
2035 }
2036 
2037 
2038 static int
test_htmlEntityValueLookup(void)2039 test_htmlEntityValueLookup(void) {
2040     int test_ret = 0;
2041 
2042 #if defined(LIBXML_HTML_ENABLED)
2043     int mem_base;
2044     const htmlEntityDesc * ret_val;
2045     unsigned int value; /* the entity's unicode value */
2046     int n_value;
2047 
2048     for (n_value = 0;n_value < gen_nb_unsigned_int;n_value++) {
2049         mem_base = xmlMemBlocks();
2050         value = gen_unsigned_int(n_value, 0);
2051 
2052         ret_val = htmlEntityValueLookup(value);
2053         desret_const_htmlEntityDesc_ptr(ret_val);
2054         call_tests++;
2055         des_unsigned_int(n_value, value, 0);
2056         xmlResetLastError();
2057         if (mem_base != xmlMemBlocks()) {
2058             printf("Leak of %d blocks found in htmlEntityValueLookup",
2059 	           xmlMemBlocks() - mem_base);
2060 	    test_ret++;
2061             printf(" %d", n_value);
2062             printf("\n");
2063         }
2064     }
2065     function_tests++;
2066 #endif
2067 
2068     return(test_ret);
2069 }
2070 
2071 
2072 static int
test_htmlHandleOmittedElem(void)2073 test_htmlHandleOmittedElem(void) {
2074     int test_ret = 0;
2075 
2076 #if defined(LIBXML_HTML_ENABLED)
2077     int mem_base;
2078     int ret_val;
2079     int val; /* int 0 or 1 */
2080     int n_val;
2081 
2082     for (n_val = 0;n_val < gen_nb_int;n_val++) {
2083         mem_base = xmlMemBlocks();
2084         val = gen_int(n_val, 0);
2085 
2086         ret_val = htmlHandleOmittedElem(val);
2087         desret_int(ret_val);
2088         call_tests++;
2089         des_int(n_val, val, 0);
2090         xmlResetLastError();
2091         if (mem_base != xmlMemBlocks()) {
2092             printf("Leak of %d blocks found in htmlHandleOmittedElem",
2093 	           xmlMemBlocks() - mem_base);
2094 	    test_ret++;
2095             printf(" %d", n_val);
2096             printf("\n");
2097         }
2098     }
2099     function_tests++;
2100 #endif
2101 
2102     return(test_ret);
2103 }
2104 
2105 
2106 static int
test_htmlInitAutoClose(void)2107 test_htmlInitAutoClose(void) {
2108     int test_ret = 0;
2109 
2110 #if defined(LIBXML_HTML_ENABLED)
2111     int mem_base;
2112 
2113         mem_base = xmlMemBlocks();
2114 
2115         htmlInitAutoClose();
2116         call_tests++;
2117         xmlResetLastError();
2118         if (mem_base != xmlMemBlocks()) {
2119             printf("Leak of %d blocks found in htmlInitAutoClose",
2120 	           xmlMemBlocks() - mem_base);
2121 	    test_ret++;
2122             printf("\n");
2123         }
2124     function_tests++;
2125 #endif
2126 
2127     return(test_ret);
2128 }
2129 
2130 
2131 static int
test_htmlIsAutoClosed(void)2132 test_htmlIsAutoClosed(void) {
2133     int test_ret = 0;
2134 
2135 #if defined(LIBXML_HTML_ENABLED)
2136     int mem_base;
2137     int ret_val;
2138     htmlDocPtr doc; /* the HTML document */
2139     int n_doc;
2140     htmlNodePtr elem; /* the HTML element */
2141     int n_elem;
2142 
2143     for (n_doc = 0;n_doc < gen_nb_htmlDocPtr;n_doc++) {
2144     for (n_elem = 0;n_elem < gen_nb_htmlNodePtr;n_elem++) {
2145         mem_base = xmlMemBlocks();
2146         doc = gen_htmlDocPtr(n_doc, 0);
2147         elem = gen_htmlNodePtr(n_elem, 1);
2148 
2149         ret_val = htmlIsAutoClosed(doc, elem);
2150         desret_int(ret_val);
2151         call_tests++;
2152         des_htmlDocPtr(n_doc, doc, 0);
2153         des_htmlNodePtr(n_elem, elem, 1);
2154         xmlResetLastError();
2155         if (mem_base != xmlMemBlocks()) {
2156             printf("Leak of %d blocks found in htmlIsAutoClosed",
2157 	           xmlMemBlocks() - mem_base);
2158 	    test_ret++;
2159             printf(" %d", n_doc);
2160             printf(" %d", n_elem);
2161             printf("\n");
2162         }
2163     }
2164     }
2165     function_tests++;
2166 #endif
2167 
2168     return(test_ret);
2169 }
2170 
2171 
2172 static int
test_htmlIsScriptAttribute(void)2173 test_htmlIsScriptAttribute(void) {
2174     int test_ret = 0;
2175 
2176 #if defined(LIBXML_HTML_ENABLED)
2177     int mem_base;
2178     int ret_val;
2179     const xmlChar * name; /* an attribute name */
2180     int n_name;
2181 
2182     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
2183         mem_base = xmlMemBlocks();
2184         name = gen_const_xmlChar_ptr(n_name, 0);
2185 
2186         ret_val = htmlIsScriptAttribute(name);
2187         desret_int(ret_val);
2188         call_tests++;
2189         des_const_xmlChar_ptr(n_name, name, 0);
2190         xmlResetLastError();
2191         if (mem_base != xmlMemBlocks()) {
2192             printf("Leak of %d blocks found in htmlIsScriptAttribute",
2193 	           xmlMemBlocks() - mem_base);
2194 	    test_ret++;
2195             printf(" %d", n_name);
2196             printf("\n");
2197         }
2198     }
2199     function_tests++;
2200 #endif
2201 
2202     return(test_ret);
2203 }
2204 
2205 
2206 static int
test_htmlNewParserCtxt(void)2207 test_htmlNewParserCtxt(void) {
2208     int test_ret = 0;
2209 
2210 #if defined(LIBXML_HTML_ENABLED)
2211     int mem_base;
2212     htmlParserCtxtPtr ret_val;
2213 
2214         mem_base = xmlMemBlocks();
2215 
2216         ret_val = htmlNewParserCtxt();
2217         desret_htmlParserCtxtPtr(ret_val);
2218         call_tests++;
2219         xmlResetLastError();
2220         if (mem_base != xmlMemBlocks()) {
2221             printf("Leak of %d blocks found in htmlNewParserCtxt",
2222 	           xmlMemBlocks() - mem_base);
2223 	    test_ret++;
2224             printf("\n");
2225         }
2226     function_tests++;
2227 #endif
2228 
2229     return(test_ret);
2230 }
2231 
2232 #ifdef LIBXML_HTML_ENABLED
2233 
2234 #define gen_nb_const_htmlSAXHandler_ptr 1
2235 #define gen_const_htmlSAXHandler_ptr(no, nr) NULL
2236 #define des_const_htmlSAXHandler_ptr(no, val, nr)
2237 #endif
2238 
2239 
2240 static int
test_htmlNewSAXParserCtxt(void)2241 test_htmlNewSAXParserCtxt(void) {
2242     int test_ret = 0;
2243 
2244 #if defined(LIBXML_HTML_ENABLED)
2245     int mem_base;
2246     htmlParserCtxtPtr ret_val;
2247     const htmlSAXHandler * sax; /* SAX handler */
2248     int n_sax;
2249     void * userData; /* user data */
2250     int n_userData;
2251 
2252     for (n_sax = 0;n_sax < gen_nb_const_htmlSAXHandler_ptr;n_sax++) {
2253     for (n_userData = 0;n_userData < gen_nb_userdata;n_userData++) {
2254         mem_base = xmlMemBlocks();
2255         sax = gen_const_htmlSAXHandler_ptr(n_sax, 0);
2256         userData = gen_userdata(n_userData, 1);
2257 
2258         ret_val = htmlNewSAXParserCtxt(sax, userData);
2259         desret_htmlParserCtxtPtr(ret_val);
2260         call_tests++;
2261         des_const_htmlSAXHandler_ptr(n_sax, sax, 0);
2262         des_userdata(n_userData, userData, 1);
2263         xmlResetLastError();
2264         if (mem_base != xmlMemBlocks()) {
2265             printf("Leak of %d blocks found in htmlNewSAXParserCtxt",
2266 	           xmlMemBlocks() - mem_base);
2267 	    test_ret++;
2268             printf(" %d", n_sax);
2269             printf(" %d", n_userData);
2270             printf("\n");
2271         }
2272     }
2273     }
2274     function_tests++;
2275 #endif
2276 
2277     return(test_ret);
2278 }
2279 
2280 
2281 static int
test_htmlNodeStatus(void)2282 test_htmlNodeStatus(void) {
2283     int test_ret = 0;
2284 
2285 #if defined(LIBXML_HTML_ENABLED)
2286     int mem_base;
2287     htmlStatus ret_val;
2288     htmlNodePtr node; /* an htmlNodePtr in a tree */
2289     int n_node;
2290     int legacy; /* whether to allow deprecated elements (YES is faster here for Element nodes) */
2291     int n_legacy;
2292 
2293     for (n_node = 0;n_node < gen_nb_htmlNodePtr;n_node++) {
2294     for (n_legacy = 0;n_legacy < gen_nb_int;n_legacy++) {
2295         mem_base = xmlMemBlocks();
2296         node = gen_htmlNodePtr(n_node, 0);
2297         legacy = gen_int(n_legacy, 1);
2298 
2299         ret_val = htmlNodeStatus(node, legacy);
2300         desret_htmlStatus(ret_val);
2301         call_tests++;
2302         des_htmlNodePtr(n_node, node, 0);
2303         des_int(n_legacy, legacy, 1);
2304         xmlResetLastError();
2305         if (mem_base != xmlMemBlocks()) {
2306             printf("Leak of %d blocks found in htmlNodeStatus",
2307 	           xmlMemBlocks() - mem_base);
2308 	    test_ret++;
2309             printf(" %d", n_node);
2310             printf(" %d", n_legacy);
2311             printf("\n");
2312         }
2313     }
2314     }
2315     function_tests++;
2316 #endif
2317 
2318     return(test_ret);
2319 }
2320 
2321 
2322 static int
test_htmlParseCharRef(void)2323 test_htmlParseCharRef(void) {
2324     int test_ret = 0;
2325 
2326 #if defined(LIBXML_HTML_ENABLED)
2327     int mem_base;
2328     int ret_val;
2329     htmlParserCtxtPtr ctxt; /* an HTML parser context */
2330     int n_ctxt;
2331 
2332     for (n_ctxt = 0;n_ctxt < gen_nb_htmlParserCtxtPtr;n_ctxt++) {
2333         mem_base = xmlMemBlocks();
2334         ctxt = gen_htmlParserCtxtPtr(n_ctxt, 0);
2335 
2336         ret_val = htmlParseCharRef(ctxt);
2337         desret_int(ret_val);
2338         call_tests++;
2339         des_htmlParserCtxtPtr(n_ctxt, ctxt, 0);
2340         xmlResetLastError();
2341         if (mem_base != xmlMemBlocks()) {
2342             printf("Leak of %d blocks found in htmlParseCharRef",
2343 	           xmlMemBlocks() - mem_base);
2344 	    test_ret++;
2345             printf(" %d", n_ctxt);
2346             printf("\n");
2347         }
2348     }
2349     function_tests++;
2350 #endif
2351 
2352     return(test_ret);
2353 }
2354 
2355 
2356 static int
test_htmlParseChunk(void)2357 test_htmlParseChunk(void) {
2358     int test_ret = 0;
2359 
2360 #if defined(LIBXML_HTML_ENABLED) && defined(LIBXML_PUSH_ENABLED)
2361     int mem_base;
2362     int ret_val;
2363     htmlParserCtxtPtr ctxt; /* an HTML parser context */
2364     int n_ctxt;
2365     const char * chunk; /* an char array */
2366     int n_chunk;
2367     int size; /* the size in byte of the chunk */
2368     int n_size;
2369     int terminate; /* last chunk indicator */
2370     int n_terminate;
2371 
2372     for (n_ctxt = 0;n_ctxt < gen_nb_htmlParserCtxtPtr;n_ctxt++) {
2373     for (n_chunk = 0;n_chunk < gen_nb_const_char_ptr;n_chunk++) {
2374     for (n_size = 0;n_size < gen_nb_int;n_size++) {
2375     for (n_terminate = 0;n_terminate < gen_nb_int;n_terminate++) {
2376         mem_base = xmlMemBlocks();
2377         ctxt = gen_htmlParserCtxtPtr(n_ctxt, 0);
2378         chunk = gen_const_char_ptr(n_chunk, 1);
2379         size = gen_int(n_size, 2);
2380         terminate = gen_int(n_terminate, 3);
2381         if ((chunk != NULL) &&
2382             (size > xmlStrlen(BAD_CAST chunk)))
2383             size = 0;
2384 
2385         ret_val = htmlParseChunk(ctxt, chunk, size, terminate);
2386         if (ctxt != NULL) {xmlFreeDoc(ctxt->myDoc); ctxt->myDoc = NULL;}
2387         desret_int(ret_val);
2388         call_tests++;
2389         des_htmlParserCtxtPtr(n_ctxt, ctxt, 0);
2390         des_const_char_ptr(n_chunk, chunk, 1);
2391         des_int(n_size, size, 2);
2392         des_int(n_terminate, terminate, 3);
2393         xmlResetLastError();
2394         if (mem_base != xmlMemBlocks()) {
2395             printf("Leak of %d blocks found in htmlParseChunk",
2396 	           xmlMemBlocks() - mem_base);
2397 	    test_ret++;
2398             printf(" %d", n_ctxt);
2399             printf(" %d", n_chunk);
2400             printf(" %d", n_size);
2401             printf(" %d", n_terminate);
2402             printf("\n");
2403         }
2404     }
2405     }
2406     }
2407     }
2408     function_tests++;
2409 #endif
2410 
2411     return(test_ret);
2412 }
2413 
2414 
2415 static int
test_htmlParseDoc(void)2416 test_htmlParseDoc(void) {
2417     int test_ret = 0;
2418 
2419 #if defined(LIBXML_HTML_ENABLED)
2420     int mem_base;
2421     htmlDocPtr ret_val;
2422     const xmlChar * cur; /* a pointer to an array of xmlChar */
2423     int n_cur;
2424     const char * encoding; /* a free form C string describing the HTML document encoding, or NULL */
2425     int n_encoding;
2426 
2427     for (n_cur = 0;n_cur < gen_nb_const_xmlChar_ptr;n_cur++) {
2428     for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
2429         mem_base = xmlMemBlocks();
2430         cur = gen_const_xmlChar_ptr(n_cur, 0);
2431         encoding = gen_const_char_ptr(n_encoding, 1);
2432 
2433         ret_val = htmlParseDoc(cur, encoding);
2434         desret_htmlDocPtr(ret_val);
2435         call_tests++;
2436         des_const_xmlChar_ptr(n_cur, cur, 0);
2437         des_const_char_ptr(n_encoding, encoding, 1);
2438         xmlResetLastError();
2439         if (mem_base != xmlMemBlocks()) {
2440             printf("Leak of %d blocks found in htmlParseDoc",
2441 	           xmlMemBlocks() - mem_base);
2442 	    test_ret++;
2443             printf(" %d", n_cur);
2444             printf(" %d", n_encoding);
2445             printf("\n");
2446         }
2447     }
2448     }
2449     function_tests++;
2450 #endif
2451 
2452     return(test_ret);
2453 }
2454 
2455 
2456 static int
test_htmlParseDocument(void)2457 test_htmlParseDocument(void) {
2458     int test_ret = 0;
2459 
2460 #if defined(LIBXML_HTML_ENABLED)
2461     int mem_base;
2462     int ret_val;
2463     htmlParserCtxtPtr ctxt; /* an HTML parser context */
2464     int n_ctxt;
2465 
2466     for (n_ctxt = 0;n_ctxt < gen_nb_htmlParserCtxtPtr;n_ctxt++) {
2467         mem_base = xmlMemBlocks();
2468         ctxt = gen_htmlParserCtxtPtr(n_ctxt, 0);
2469 
2470         ret_val = htmlParseDocument(ctxt);
2471         if (ctxt != NULL) {xmlFreeDoc(ctxt->myDoc); ctxt->myDoc = NULL;}
2472         desret_int(ret_val);
2473         call_tests++;
2474         des_htmlParserCtxtPtr(n_ctxt, ctxt, 0);
2475         xmlResetLastError();
2476         if (mem_base != xmlMemBlocks()) {
2477             printf("Leak of %d blocks found in htmlParseDocument",
2478 	           xmlMemBlocks() - mem_base);
2479 	    test_ret++;
2480             printf(" %d", n_ctxt);
2481             printf("\n");
2482         }
2483     }
2484     function_tests++;
2485 #endif
2486 
2487     return(test_ret);
2488 }
2489 
2490 
2491 static int
test_htmlParseElement(void)2492 test_htmlParseElement(void) {
2493     int test_ret = 0;
2494 
2495 #if defined(LIBXML_HTML_ENABLED)
2496     int mem_base;
2497     htmlParserCtxtPtr ctxt; /* an HTML parser context */
2498     int n_ctxt;
2499 
2500     for (n_ctxt = 0;n_ctxt < gen_nb_htmlParserCtxtPtr;n_ctxt++) {
2501         mem_base = xmlMemBlocks();
2502         ctxt = gen_htmlParserCtxtPtr(n_ctxt, 0);
2503 
2504         htmlParseElement(ctxt);
2505         call_tests++;
2506         des_htmlParserCtxtPtr(n_ctxt, ctxt, 0);
2507         xmlResetLastError();
2508         if (mem_base != xmlMemBlocks()) {
2509             printf("Leak of %d blocks found in htmlParseElement",
2510 	           xmlMemBlocks() - mem_base);
2511 	    test_ret++;
2512             printf(" %d", n_ctxt);
2513             printf("\n");
2514         }
2515     }
2516     function_tests++;
2517 #endif
2518 
2519     return(test_ret);
2520 }
2521 
2522 
2523 static int
test_htmlParseEntityRef(void)2524 test_htmlParseEntityRef(void) {
2525     int test_ret = 0;
2526 
2527 #if defined(LIBXML_HTML_ENABLED)
2528     int mem_base;
2529     const htmlEntityDesc * ret_val;
2530     htmlParserCtxtPtr ctxt; /* an HTML parser context */
2531     int n_ctxt;
2532     const xmlChar ** str; /* location to store the entity name */
2533     int n_str;
2534 
2535     for (n_ctxt = 0;n_ctxt < gen_nb_htmlParserCtxtPtr;n_ctxt++) {
2536     for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr_ptr;n_str++) {
2537         mem_base = xmlMemBlocks();
2538         ctxt = gen_htmlParserCtxtPtr(n_ctxt, 0);
2539         str = gen_const_xmlChar_ptr_ptr(n_str, 1);
2540 
2541         ret_val = htmlParseEntityRef(ctxt, str);
2542         desret_const_htmlEntityDesc_ptr(ret_val);
2543         call_tests++;
2544         des_htmlParserCtxtPtr(n_ctxt, ctxt, 0);
2545         des_const_xmlChar_ptr_ptr(n_str, str, 1);
2546         xmlResetLastError();
2547         if (mem_base != xmlMemBlocks()) {
2548             printf("Leak of %d blocks found in htmlParseEntityRef",
2549 	           xmlMemBlocks() - mem_base);
2550 	    test_ret++;
2551             printf(" %d", n_ctxt);
2552             printf(" %d", n_str);
2553             printf("\n");
2554         }
2555     }
2556     }
2557     function_tests++;
2558 #endif
2559 
2560     return(test_ret);
2561 }
2562 
2563 
2564 static int
test_htmlParseFile(void)2565 test_htmlParseFile(void) {
2566     int test_ret = 0;
2567 
2568 #if defined(LIBXML_HTML_ENABLED)
2569     htmlDocPtr ret_val;
2570     const char * filename; /* the filename */
2571     int n_filename;
2572     const char * encoding; /* a free form C string describing the HTML document encoding, or NULL */
2573     int n_encoding;
2574 
2575     for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
2576     for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
2577         filename = gen_filepath(n_filename, 0);
2578         encoding = gen_const_char_ptr(n_encoding, 1);
2579 
2580         ret_val = htmlParseFile(filename, encoding);
2581         desret_htmlDocPtr(ret_val);
2582         call_tests++;
2583         des_filepath(n_filename, filename, 0);
2584         des_const_char_ptr(n_encoding, encoding, 1);
2585         xmlResetLastError();
2586     }
2587     }
2588     function_tests++;
2589 #endif
2590 
2591     return(test_ret);
2592 }
2593 
2594 
2595 static int
test_htmlReadDoc(void)2596 test_htmlReadDoc(void) {
2597     int test_ret = 0;
2598 
2599 #if defined(LIBXML_HTML_ENABLED)
2600     int mem_base;
2601     htmlDocPtr ret_val;
2602     const xmlChar * cur; /* a pointer to a zero terminated string */
2603     int n_cur;
2604     const char * URL; /* the base URL to use for the document */
2605     int n_URL;
2606     const char * encoding; /* the document encoding, or NULL */
2607     int n_encoding;
2608     int options; /* a combination of htmlParserOption(s) */
2609     int n_options;
2610 
2611     for (n_cur = 0;n_cur < gen_nb_const_xmlChar_ptr;n_cur++) {
2612     for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) {
2613     for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
2614     for (n_options = 0;n_options < gen_nb_int;n_options++) {
2615         mem_base = xmlMemBlocks();
2616         cur = gen_const_xmlChar_ptr(n_cur, 0);
2617         URL = gen_filepath(n_URL, 1);
2618         encoding = gen_const_char_ptr(n_encoding, 2);
2619         options = gen_int(n_options, 3);
2620 
2621         ret_val = htmlReadDoc(cur, URL, encoding, options);
2622         desret_htmlDocPtr(ret_val);
2623         call_tests++;
2624         des_const_xmlChar_ptr(n_cur, cur, 0);
2625         des_filepath(n_URL, URL, 1);
2626         des_const_char_ptr(n_encoding, encoding, 2);
2627         des_int(n_options, options, 3);
2628         xmlResetLastError();
2629         if (mem_base != xmlMemBlocks()) {
2630             printf("Leak of %d blocks found in htmlReadDoc",
2631 	           xmlMemBlocks() - mem_base);
2632 	    test_ret++;
2633             printf(" %d", n_cur);
2634             printf(" %d", n_URL);
2635             printf(" %d", n_encoding);
2636             printf(" %d", n_options);
2637             printf("\n");
2638         }
2639     }
2640     }
2641     }
2642     }
2643     function_tests++;
2644 #endif
2645 
2646     return(test_ret);
2647 }
2648 
2649 
2650 static int
test_htmlReadFile(void)2651 test_htmlReadFile(void) {
2652     int test_ret = 0;
2653 
2654 #if defined(LIBXML_HTML_ENABLED)
2655     int mem_base;
2656     htmlDocPtr ret_val;
2657     const char * filename; /* a file or URL */
2658     int n_filename;
2659     const char * encoding; /* the document encoding, or NULL */
2660     int n_encoding;
2661     int options; /* a combination of htmlParserOption(s) */
2662     int n_options;
2663 
2664     for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
2665     for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
2666     for (n_options = 0;n_options < gen_nb_int;n_options++) {
2667         mem_base = xmlMemBlocks();
2668         filename = gen_filepath(n_filename, 0);
2669         encoding = gen_const_char_ptr(n_encoding, 1);
2670         options = gen_int(n_options, 2);
2671 
2672         ret_val = htmlReadFile(filename, encoding, options);
2673         desret_htmlDocPtr(ret_val);
2674         call_tests++;
2675         des_filepath(n_filename, filename, 0);
2676         des_const_char_ptr(n_encoding, encoding, 1);
2677         des_int(n_options, options, 2);
2678         xmlResetLastError();
2679         if (mem_base != xmlMemBlocks()) {
2680             printf("Leak of %d blocks found in htmlReadFile",
2681 	           xmlMemBlocks() - mem_base);
2682 	    test_ret++;
2683             printf(" %d", n_filename);
2684             printf(" %d", n_encoding);
2685             printf(" %d", n_options);
2686             printf("\n");
2687         }
2688     }
2689     }
2690     }
2691     function_tests++;
2692 #endif
2693 
2694     return(test_ret);
2695 }
2696 
2697 
2698 static int
test_htmlReadMemory(void)2699 test_htmlReadMemory(void) {
2700     int test_ret = 0;
2701 
2702 #if defined(LIBXML_HTML_ENABLED)
2703     int mem_base;
2704     htmlDocPtr ret_val;
2705     const char * buffer; /* a pointer to a char array */
2706     int n_buffer;
2707     int size; /* the size of the array */
2708     int n_size;
2709     const char * URL; /* the base URL to use for the document */
2710     int n_URL;
2711     const char * encoding; /* the document encoding, or NULL */
2712     int n_encoding;
2713     int options; /* a combination of htmlParserOption(s) */
2714     int n_options;
2715 
2716     for (n_buffer = 0;n_buffer < gen_nb_const_char_ptr;n_buffer++) {
2717     for (n_size = 0;n_size < gen_nb_int;n_size++) {
2718     for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) {
2719     for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
2720     for (n_options = 0;n_options < gen_nb_int;n_options++) {
2721         mem_base = xmlMemBlocks();
2722         buffer = gen_const_char_ptr(n_buffer, 0);
2723         size = gen_int(n_size, 1);
2724         URL = gen_filepath(n_URL, 2);
2725         encoding = gen_const_char_ptr(n_encoding, 3);
2726         options = gen_int(n_options, 4);
2727         if ((buffer != NULL) &&
2728             (size > xmlStrlen(BAD_CAST buffer)))
2729             size = 0;
2730 
2731         ret_val = htmlReadMemory(buffer, size, URL, encoding, options);
2732         desret_htmlDocPtr(ret_val);
2733         call_tests++;
2734         des_const_char_ptr(n_buffer, buffer, 0);
2735         des_int(n_size, size, 1);
2736         des_filepath(n_URL, URL, 2);
2737         des_const_char_ptr(n_encoding, encoding, 3);
2738         des_int(n_options, options, 4);
2739         xmlResetLastError();
2740         if (mem_base != xmlMemBlocks()) {
2741             printf("Leak of %d blocks found in htmlReadMemory",
2742 	           xmlMemBlocks() - mem_base);
2743 	    test_ret++;
2744             printf(" %d", n_buffer);
2745             printf(" %d", n_size);
2746             printf(" %d", n_URL);
2747             printf(" %d", n_encoding);
2748             printf(" %d", n_options);
2749             printf("\n");
2750         }
2751     }
2752     }
2753     }
2754     }
2755     }
2756     function_tests++;
2757 #endif
2758 
2759     return(test_ret);
2760 }
2761 
2762 
2763 static int
test_htmlSAXParseDoc(void)2764 test_htmlSAXParseDoc(void) {
2765     int test_ret = 0;
2766 
2767 #if defined(LIBXML_HTML_ENABLED)
2768     int mem_base;
2769     htmlDocPtr ret_val;
2770     const xmlChar * cur; /* a pointer to an array of xmlChar */
2771     int n_cur;
2772     const char * encoding; /* a free form C string describing the HTML document encoding, or NULL */
2773     int n_encoding;
2774     htmlSAXHandlerPtr sax; /* the SAX handler block */
2775     int n_sax;
2776     void * userData; /* if using SAX, this pointer will be provided on callbacks. */
2777     int n_userData;
2778 
2779     for (n_cur = 0;n_cur < gen_nb_const_xmlChar_ptr;n_cur++) {
2780     for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
2781     for (n_sax = 0;n_sax < gen_nb_htmlSAXHandlerPtr;n_sax++) {
2782     for (n_userData = 0;n_userData < gen_nb_userdata;n_userData++) {
2783         mem_base = xmlMemBlocks();
2784         cur = gen_const_xmlChar_ptr(n_cur, 0);
2785         encoding = gen_const_char_ptr(n_encoding, 1);
2786         sax = gen_htmlSAXHandlerPtr(n_sax, 2);
2787         userData = gen_userdata(n_userData, 3);
2788 
2789         ret_val = htmlSAXParseDoc(cur, encoding, sax, userData);
2790         desret_htmlDocPtr(ret_val);
2791         call_tests++;
2792         des_const_xmlChar_ptr(n_cur, cur, 0);
2793         des_const_char_ptr(n_encoding, encoding, 1);
2794         des_htmlSAXHandlerPtr(n_sax, sax, 2);
2795         des_userdata(n_userData, userData, 3);
2796         xmlResetLastError();
2797         if (mem_base != xmlMemBlocks()) {
2798             printf("Leak of %d blocks found in htmlSAXParseDoc",
2799 	           xmlMemBlocks() - mem_base);
2800 	    test_ret++;
2801             printf(" %d", n_cur);
2802             printf(" %d", n_encoding);
2803             printf(" %d", n_sax);
2804             printf(" %d", n_userData);
2805             printf("\n");
2806         }
2807     }
2808     }
2809     }
2810     }
2811     function_tests++;
2812 #endif
2813 
2814     return(test_ret);
2815 }
2816 
2817 
2818 static int
test_htmlSAXParseFile(void)2819 test_htmlSAXParseFile(void) {
2820     int test_ret = 0;
2821 
2822 #if defined(LIBXML_HTML_ENABLED)
2823     int mem_base;
2824     htmlDocPtr ret_val;
2825     const char * filename; /* the filename */
2826     int n_filename;
2827     const char * encoding; /* a free form C string describing the HTML document encoding, or NULL */
2828     int n_encoding;
2829     htmlSAXHandlerPtr sax; /* the SAX handler block */
2830     int n_sax;
2831     void * userData; /* if using SAX, this pointer will be provided on callbacks. */
2832     int n_userData;
2833 
2834     for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
2835     for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
2836     for (n_sax = 0;n_sax < gen_nb_htmlSAXHandlerPtr;n_sax++) {
2837     for (n_userData = 0;n_userData < gen_nb_userdata;n_userData++) {
2838         mem_base = xmlMemBlocks();
2839         filename = gen_filepath(n_filename, 0);
2840         encoding = gen_const_char_ptr(n_encoding, 1);
2841         sax = gen_htmlSAXHandlerPtr(n_sax, 2);
2842         userData = gen_userdata(n_userData, 3);
2843 
2844         ret_val = htmlSAXParseFile(filename, encoding, sax, userData);
2845         desret_htmlDocPtr(ret_val);
2846         call_tests++;
2847         des_filepath(n_filename, filename, 0);
2848         des_const_char_ptr(n_encoding, encoding, 1);
2849         des_htmlSAXHandlerPtr(n_sax, sax, 2);
2850         des_userdata(n_userData, userData, 3);
2851         xmlResetLastError();
2852         if (mem_base != xmlMemBlocks()) {
2853             printf("Leak of %d blocks found in htmlSAXParseFile",
2854 	           xmlMemBlocks() - mem_base);
2855 	    test_ret++;
2856             printf(" %d", n_filename);
2857             printf(" %d", n_encoding);
2858             printf(" %d", n_sax);
2859             printf(" %d", n_userData);
2860             printf("\n");
2861         }
2862     }
2863     }
2864     }
2865     }
2866     function_tests++;
2867 #endif
2868 
2869     return(test_ret);
2870 }
2871 
2872 
2873 static int
test_htmlTagLookup(void)2874 test_htmlTagLookup(void) {
2875     int test_ret = 0;
2876 
2877 
2878     /* missing type support */
2879     return(test_ret);
2880 }
2881 
2882 static int
test_HTMLparser(void)2883 test_HTMLparser(void) {
2884     int test_ret = 0;
2885 
2886     if (quiet == 0) printf("Testing HTMLparser : 35 of 41 functions ...\n");
2887     test_ret += test_UTF8ToHtml();
2888     test_ret += test_htmlAttrAllowed();
2889     test_ret += test_htmlAutoCloseTag();
2890     test_ret += test_htmlCreateFileParserCtxt();
2891     test_ret += test_htmlCreateMemoryParserCtxt();
2892     test_ret += test_htmlCreatePushParserCtxt();
2893     test_ret += test_htmlCtxtReadDoc();
2894     test_ret += test_htmlCtxtReadFile();
2895     test_ret += test_htmlCtxtReadMemory();
2896     test_ret += test_htmlCtxtReset();
2897     test_ret += test_htmlCtxtUseOptions();
2898     test_ret += test_htmlElementAllowedHere();
2899     test_ret += test_htmlElementStatusHere();
2900     test_ret += test_htmlEncodeEntities();
2901     test_ret += test_htmlEntityLookup();
2902     test_ret += test_htmlEntityValueLookup();
2903     test_ret += test_htmlHandleOmittedElem();
2904     test_ret += test_htmlInitAutoClose();
2905     test_ret += test_htmlIsAutoClosed();
2906     test_ret += test_htmlIsScriptAttribute();
2907     test_ret += test_htmlNewParserCtxt();
2908     test_ret += test_htmlNewSAXParserCtxt();
2909     test_ret += test_htmlNodeStatus();
2910     test_ret += test_htmlParseCharRef();
2911     test_ret += test_htmlParseChunk();
2912     test_ret += test_htmlParseDoc();
2913     test_ret += test_htmlParseDocument();
2914     test_ret += test_htmlParseElement();
2915     test_ret += test_htmlParseEntityRef();
2916     test_ret += test_htmlParseFile();
2917     test_ret += test_htmlReadDoc();
2918     test_ret += test_htmlReadFile();
2919     test_ret += test_htmlReadMemory();
2920     test_ret += test_htmlSAXParseDoc();
2921     test_ret += test_htmlSAXParseFile();
2922     test_ret += test_htmlTagLookup();
2923 
2924     if (test_ret != 0)
2925 	printf("Module HTMLparser: %d errors\n", test_ret);
2926     return(test_ret);
2927 }
2928 
2929 static int
test_htmlDocContentDumpFormatOutput(void)2930 test_htmlDocContentDumpFormatOutput(void) {
2931     int test_ret = 0;
2932 
2933 #if defined(LIBXML_HTML_ENABLED) && defined(LIBXML_OUTPUT_ENABLED)
2934     int mem_base;
2935     xmlOutputBufferPtr buf; /* the HTML buffer output */
2936     int n_buf;
2937     xmlDocPtr cur; /* the document */
2938     int n_cur;
2939     const char * encoding; /* the encoding string (unused) */
2940     int n_encoding;
2941     int format; /* should formatting spaces been added */
2942     int n_format;
2943 
2944     for (n_buf = 0;n_buf < gen_nb_xmlOutputBufferPtr;n_buf++) {
2945     for (n_cur = 0;n_cur < gen_nb_xmlDocPtr;n_cur++) {
2946     for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
2947     for (n_format = 0;n_format < gen_nb_int;n_format++) {
2948         mem_base = xmlMemBlocks();
2949         buf = gen_xmlOutputBufferPtr(n_buf, 0);
2950         cur = gen_xmlDocPtr(n_cur, 1);
2951         encoding = gen_const_char_ptr(n_encoding, 2);
2952         format = gen_int(n_format, 3);
2953 
2954         htmlDocContentDumpFormatOutput(buf, cur, encoding, format);
2955         call_tests++;
2956         des_xmlOutputBufferPtr(n_buf, buf, 0);
2957         des_xmlDocPtr(n_cur, cur, 1);
2958         des_const_char_ptr(n_encoding, encoding, 2);
2959         des_int(n_format, format, 3);
2960         xmlResetLastError();
2961         if (mem_base != xmlMemBlocks()) {
2962             printf("Leak of %d blocks found in htmlDocContentDumpFormatOutput",
2963 	           xmlMemBlocks() - mem_base);
2964 	    test_ret++;
2965             printf(" %d", n_buf);
2966             printf(" %d", n_cur);
2967             printf(" %d", n_encoding);
2968             printf(" %d", n_format);
2969             printf("\n");
2970         }
2971     }
2972     }
2973     }
2974     }
2975     function_tests++;
2976 #endif
2977 
2978     return(test_ret);
2979 }
2980 
2981 
2982 static int
test_htmlDocContentDumpOutput(void)2983 test_htmlDocContentDumpOutput(void) {
2984     int test_ret = 0;
2985 
2986 #if defined(LIBXML_HTML_ENABLED) && defined(LIBXML_OUTPUT_ENABLED)
2987     int mem_base;
2988     xmlOutputBufferPtr buf; /* the HTML buffer output */
2989     int n_buf;
2990     xmlDocPtr cur; /* the document */
2991     int n_cur;
2992     const char * encoding; /* the encoding string (unused) */
2993     int n_encoding;
2994 
2995     for (n_buf = 0;n_buf < gen_nb_xmlOutputBufferPtr;n_buf++) {
2996     for (n_cur = 0;n_cur < gen_nb_xmlDocPtr;n_cur++) {
2997     for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
2998         mem_base = xmlMemBlocks();
2999         buf = gen_xmlOutputBufferPtr(n_buf, 0);
3000         cur = gen_xmlDocPtr(n_cur, 1);
3001         encoding = gen_const_char_ptr(n_encoding, 2);
3002 
3003         htmlDocContentDumpOutput(buf, cur, encoding);
3004         call_tests++;
3005         des_xmlOutputBufferPtr(n_buf, buf, 0);
3006         des_xmlDocPtr(n_cur, cur, 1);
3007         des_const_char_ptr(n_encoding, encoding, 2);
3008         xmlResetLastError();
3009         if (mem_base != xmlMemBlocks()) {
3010             printf("Leak of %d blocks found in htmlDocContentDumpOutput",
3011 	           xmlMemBlocks() - mem_base);
3012 	    test_ret++;
3013             printf(" %d", n_buf);
3014             printf(" %d", n_cur);
3015             printf(" %d", n_encoding);
3016             printf("\n");
3017         }
3018     }
3019     }
3020     }
3021     function_tests++;
3022 #endif
3023 
3024     return(test_ret);
3025 }
3026 
3027 
3028 static int
test_htmlDocDump(void)3029 test_htmlDocDump(void) {
3030     int test_ret = 0;
3031 
3032 #if defined(LIBXML_HTML_ENABLED) && defined(LIBXML_OUTPUT_ENABLED)
3033     int mem_base;
3034     int ret_val;
3035     FILE * f; /* the FILE* */
3036     int n_f;
3037     xmlDocPtr cur; /* the document */
3038     int n_cur;
3039 
3040     for (n_f = 0;n_f < gen_nb_FILE_ptr;n_f++) {
3041     for (n_cur = 0;n_cur < gen_nb_xmlDocPtr;n_cur++) {
3042         mem_base = xmlMemBlocks();
3043         f = gen_FILE_ptr(n_f, 0);
3044         cur = gen_xmlDocPtr(n_cur, 1);
3045 
3046         ret_val = htmlDocDump(f, cur);
3047         desret_int(ret_val);
3048         call_tests++;
3049         des_FILE_ptr(n_f, f, 0);
3050         des_xmlDocPtr(n_cur, cur, 1);
3051         xmlResetLastError();
3052         if (mem_base != xmlMemBlocks()) {
3053             printf("Leak of %d blocks found in htmlDocDump",
3054 	           xmlMemBlocks() - mem_base);
3055 	    test_ret++;
3056             printf(" %d", n_f);
3057             printf(" %d", n_cur);
3058             printf("\n");
3059         }
3060     }
3061     }
3062     function_tests++;
3063 #endif
3064 
3065     return(test_ret);
3066 }
3067 
3068 
3069 #define gen_nb_xmlChar_ptr_ptr 1
3070 #define gen_xmlChar_ptr_ptr(no, nr) NULL
3071 #define des_xmlChar_ptr_ptr(no, val, nr)
3072 
3073 static int
test_htmlDocDumpMemory(void)3074 test_htmlDocDumpMemory(void) {
3075     int test_ret = 0;
3076 
3077 #if defined(LIBXML_HTML_ENABLED) && defined(LIBXML_OUTPUT_ENABLED)
3078     int mem_base;
3079     xmlDocPtr cur; /* the document */
3080     int n_cur;
3081     xmlChar ** mem; /* OUT: the memory pointer */
3082     int n_mem;
3083     int * size; /* OUT: the memory length */
3084     int n_size;
3085 
3086     for (n_cur = 0;n_cur < gen_nb_xmlDocPtr;n_cur++) {
3087     for (n_mem = 0;n_mem < gen_nb_xmlChar_ptr_ptr;n_mem++) {
3088     for (n_size = 0;n_size < gen_nb_int_ptr;n_size++) {
3089         mem_base = xmlMemBlocks();
3090         cur = gen_xmlDocPtr(n_cur, 0);
3091         mem = gen_xmlChar_ptr_ptr(n_mem, 1);
3092         size = gen_int_ptr(n_size, 2);
3093 
3094         htmlDocDumpMemory(cur, mem, size);
3095         call_tests++;
3096         des_xmlDocPtr(n_cur, cur, 0);
3097         des_xmlChar_ptr_ptr(n_mem, mem, 1);
3098         des_int_ptr(n_size, size, 2);
3099         xmlResetLastError();
3100         if (mem_base != xmlMemBlocks()) {
3101             printf("Leak of %d blocks found in htmlDocDumpMemory",
3102 	           xmlMemBlocks() - mem_base);
3103 	    test_ret++;
3104             printf(" %d", n_cur);
3105             printf(" %d", n_mem);
3106             printf(" %d", n_size);
3107             printf("\n");
3108         }
3109     }
3110     }
3111     }
3112     function_tests++;
3113 #endif
3114 
3115     return(test_ret);
3116 }
3117 
3118 
3119 static int
test_htmlDocDumpMemoryFormat(void)3120 test_htmlDocDumpMemoryFormat(void) {
3121     int test_ret = 0;
3122 
3123 #if defined(LIBXML_HTML_ENABLED) && defined(LIBXML_OUTPUT_ENABLED)
3124     int mem_base;
3125     xmlDocPtr cur; /* the document */
3126     int n_cur;
3127     xmlChar ** mem; /* OUT: the memory pointer */
3128     int n_mem;
3129     int * size; /* OUT: the memory length */
3130     int n_size;
3131     int format; /* should formatting spaces been added */
3132     int n_format;
3133 
3134     for (n_cur = 0;n_cur < gen_nb_xmlDocPtr;n_cur++) {
3135     for (n_mem = 0;n_mem < gen_nb_xmlChar_ptr_ptr;n_mem++) {
3136     for (n_size = 0;n_size < gen_nb_int_ptr;n_size++) {
3137     for (n_format = 0;n_format < gen_nb_int;n_format++) {
3138         mem_base = xmlMemBlocks();
3139         cur = gen_xmlDocPtr(n_cur, 0);
3140         mem = gen_xmlChar_ptr_ptr(n_mem, 1);
3141         size = gen_int_ptr(n_size, 2);
3142         format = gen_int(n_format, 3);
3143 
3144         htmlDocDumpMemoryFormat(cur, mem, size, format);
3145         call_tests++;
3146         des_xmlDocPtr(n_cur, cur, 0);
3147         des_xmlChar_ptr_ptr(n_mem, mem, 1);
3148         des_int_ptr(n_size, size, 2);
3149         des_int(n_format, format, 3);
3150         xmlResetLastError();
3151         if (mem_base != xmlMemBlocks()) {
3152             printf("Leak of %d blocks found in htmlDocDumpMemoryFormat",
3153 	           xmlMemBlocks() - mem_base);
3154 	    test_ret++;
3155             printf(" %d", n_cur);
3156             printf(" %d", n_mem);
3157             printf(" %d", n_size);
3158             printf(" %d", n_format);
3159             printf("\n");
3160         }
3161     }
3162     }
3163     }
3164     }
3165     function_tests++;
3166 #endif
3167 
3168     return(test_ret);
3169 }
3170 
3171 
3172 static int
test_htmlGetMetaEncoding(void)3173 test_htmlGetMetaEncoding(void) {
3174     int test_ret = 0;
3175 
3176 #if defined(LIBXML_HTML_ENABLED)
3177     int mem_base;
3178     const xmlChar * ret_val;
3179     htmlDocPtr doc; /* the document */
3180     int n_doc;
3181 
3182     for (n_doc = 0;n_doc < gen_nb_htmlDocPtr;n_doc++) {
3183         mem_base = xmlMemBlocks();
3184         doc = gen_htmlDocPtr(n_doc, 0);
3185 
3186         ret_val = htmlGetMetaEncoding(doc);
3187         desret_const_xmlChar_ptr(ret_val);
3188         call_tests++;
3189         des_htmlDocPtr(n_doc, doc, 0);
3190         xmlResetLastError();
3191         if (mem_base != xmlMemBlocks()) {
3192             printf("Leak of %d blocks found in htmlGetMetaEncoding",
3193 	           xmlMemBlocks() - mem_base);
3194 	    test_ret++;
3195             printf(" %d", n_doc);
3196             printf("\n");
3197         }
3198     }
3199     function_tests++;
3200 #endif
3201 
3202     return(test_ret);
3203 }
3204 
3205 
3206 static int
test_htmlIsBooleanAttr(void)3207 test_htmlIsBooleanAttr(void) {
3208     int test_ret = 0;
3209 
3210 #if defined(LIBXML_HTML_ENABLED)
3211     int mem_base;
3212     int ret_val;
3213     const xmlChar * name; /* the name of the attribute to check */
3214     int n_name;
3215 
3216     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
3217         mem_base = xmlMemBlocks();
3218         name = gen_const_xmlChar_ptr(n_name, 0);
3219 
3220         ret_val = htmlIsBooleanAttr(name);
3221         desret_int(ret_val);
3222         call_tests++;
3223         des_const_xmlChar_ptr(n_name, name, 0);
3224         xmlResetLastError();
3225         if (mem_base != xmlMemBlocks()) {
3226             printf("Leak of %d blocks found in htmlIsBooleanAttr",
3227 	           xmlMemBlocks() - mem_base);
3228 	    test_ret++;
3229             printf(" %d", n_name);
3230             printf("\n");
3231         }
3232     }
3233     function_tests++;
3234 #endif
3235 
3236     return(test_ret);
3237 }
3238 
3239 
3240 static int
test_htmlNewDoc(void)3241 test_htmlNewDoc(void) {
3242     int test_ret = 0;
3243 
3244 #if defined(LIBXML_HTML_ENABLED)
3245     int mem_base;
3246     htmlDocPtr ret_val;
3247     const xmlChar * URI; /* URI for the dtd, or NULL */
3248     int n_URI;
3249     const xmlChar * ExternalID; /* the external ID of the DTD, or NULL */
3250     int n_ExternalID;
3251 
3252     for (n_URI = 0;n_URI < gen_nb_const_xmlChar_ptr;n_URI++) {
3253     for (n_ExternalID = 0;n_ExternalID < gen_nb_const_xmlChar_ptr;n_ExternalID++) {
3254         mem_base = xmlMemBlocks();
3255         URI = gen_const_xmlChar_ptr(n_URI, 0);
3256         ExternalID = gen_const_xmlChar_ptr(n_ExternalID, 1);
3257 
3258         ret_val = htmlNewDoc(URI, ExternalID);
3259         desret_htmlDocPtr(ret_val);
3260         call_tests++;
3261         des_const_xmlChar_ptr(n_URI, URI, 0);
3262         des_const_xmlChar_ptr(n_ExternalID, ExternalID, 1);
3263         xmlResetLastError();
3264         if (mem_base != xmlMemBlocks()) {
3265             printf("Leak of %d blocks found in htmlNewDoc",
3266 	           xmlMemBlocks() - mem_base);
3267 	    test_ret++;
3268             printf(" %d", n_URI);
3269             printf(" %d", n_ExternalID);
3270             printf("\n");
3271         }
3272     }
3273     }
3274     function_tests++;
3275 #endif
3276 
3277     return(test_ret);
3278 }
3279 
3280 
3281 static int
test_htmlNewDocNoDtD(void)3282 test_htmlNewDocNoDtD(void) {
3283     int test_ret = 0;
3284 
3285 #if defined(LIBXML_HTML_ENABLED)
3286     int mem_base;
3287     htmlDocPtr ret_val;
3288     const xmlChar * URI; /* URI for the dtd, or NULL */
3289     int n_URI;
3290     const xmlChar * ExternalID; /* the external ID of the DTD, or NULL */
3291     int n_ExternalID;
3292 
3293     for (n_URI = 0;n_URI < gen_nb_const_xmlChar_ptr;n_URI++) {
3294     for (n_ExternalID = 0;n_ExternalID < gen_nb_const_xmlChar_ptr;n_ExternalID++) {
3295         mem_base = xmlMemBlocks();
3296         URI = gen_const_xmlChar_ptr(n_URI, 0);
3297         ExternalID = gen_const_xmlChar_ptr(n_ExternalID, 1);
3298 
3299         ret_val = htmlNewDocNoDtD(URI, ExternalID);
3300         desret_htmlDocPtr(ret_val);
3301         call_tests++;
3302         des_const_xmlChar_ptr(n_URI, URI, 0);
3303         des_const_xmlChar_ptr(n_ExternalID, ExternalID, 1);
3304         xmlResetLastError();
3305         if (mem_base != xmlMemBlocks()) {
3306             printf("Leak of %d blocks found in htmlNewDocNoDtD",
3307 	           xmlMemBlocks() - mem_base);
3308 	    test_ret++;
3309             printf(" %d", n_URI);
3310             printf(" %d", n_ExternalID);
3311             printf("\n");
3312         }
3313     }
3314     }
3315     function_tests++;
3316 #endif
3317 
3318     return(test_ret);
3319 }
3320 
3321 
3322 static int
test_htmlNodeDump(void)3323 test_htmlNodeDump(void) {
3324     int test_ret = 0;
3325 
3326 #if defined(LIBXML_HTML_ENABLED) && defined(LIBXML_OUTPUT_ENABLED)
3327     int mem_base;
3328     int ret_val;
3329     xmlBufferPtr buf; /* the HTML buffer output */
3330     int n_buf;
3331     xmlDocPtr doc; /* the document */
3332     int n_doc;
3333     xmlNodePtr cur; /* the current node */
3334     int n_cur;
3335 
3336     for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
3337     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
3338     for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
3339         mem_base = xmlMemBlocks();
3340         buf = gen_xmlBufferPtr(n_buf, 0);
3341         doc = gen_xmlDocPtr(n_doc, 1);
3342         cur = gen_xmlNodePtr(n_cur, 2);
3343 
3344         ret_val = htmlNodeDump(buf, doc, cur);
3345         desret_int(ret_val);
3346         call_tests++;
3347         des_xmlBufferPtr(n_buf, buf, 0);
3348         des_xmlDocPtr(n_doc, doc, 1);
3349         des_xmlNodePtr(n_cur, cur, 2);
3350         xmlResetLastError();
3351         if (mem_base != xmlMemBlocks()) {
3352             printf("Leak of %d blocks found in htmlNodeDump",
3353 	           xmlMemBlocks() - mem_base);
3354 	    test_ret++;
3355             printf(" %d", n_buf);
3356             printf(" %d", n_doc);
3357             printf(" %d", n_cur);
3358             printf("\n");
3359         }
3360     }
3361     }
3362     }
3363     function_tests++;
3364 #endif
3365 
3366     return(test_ret);
3367 }
3368 
3369 
3370 static int
test_htmlNodeDumpFile(void)3371 test_htmlNodeDumpFile(void) {
3372     int test_ret = 0;
3373 
3374 #if defined(LIBXML_HTML_ENABLED) && defined(LIBXML_OUTPUT_ENABLED)
3375     int mem_base;
3376     FILE * out; /* the FILE pointer */
3377     int n_out;
3378     xmlDocPtr doc; /* the document */
3379     int n_doc;
3380     xmlNodePtr cur; /* the current node */
3381     int n_cur;
3382 
3383     for (n_out = 0;n_out < gen_nb_FILE_ptr;n_out++) {
3384     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
3385     for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
3386         mem_base = xmlMemBlocks();
3387         out = gen_FILE_ptr(n_out, 0);
3388         doc = gen_xmlDocPtr(n_doc, 1);
3389         cur = gen_xmlNodePtr(n_cur, 2);
3390 
3391         htmlNodeDumpFile(out, doc, cur);
3392         call_tests++;
3393         des_FILE_ptr(n_out, out, 0);
3394         des_xmlDocPtr(n_doc, doc, 1);
3395         des_xmlNodePtr(n_cur, cur, 2);
3396         xmlResetLastError();
3397         if (mem_base != xmlMemBlocks()) {
3398             printf("Leak of %d blocks found in htmlNodeDumpFile",
3399 	           xmlMemBlocks() - mem_base);
3400 	    test_ret++;
3401             printf(" %d", n_out);
3402             printf(" %d", n_doc);
3403             printf(" %d", n_cur);
3404             printf("\n");
3405         }
3406     }
3407     }
3408     }
3409     function_tests++;
3410 #endif
3411 
3412     return(test_ret);
3413 }
3414 
3415 
3416 static int
test_htmlNodeDumpFileFormat(void)3417 test_htmlNodeDumpFileFormat(void) {
3418     int test_ret = 0;
3419 
3420 #if defined(LIBXML_HTML_ENABLED) && defined(LIBXML_OUTPUT_ENABLED)
3421     int mem_base;
3422     int ret_val;
3423     FILE * out; /* the FILE pointer */
3424     int n_out;
3425     xmlDocPtr doc; /* the document */
3426     int n_doc;
3427     xmlNodePtr cur; /* the current node */
3428     int n_cur;
3429     const char * encoding; /* the document encoding */
3430     int n_encoding;
3431     int format; /* should formatting spaces been added */
3432     int n_format;
3433 
3434     for (n_out = 0;n_out < gen_nb_FILE_ptr;n_out++) {
3435     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
3436     for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
3437     for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
3438     for (n_format = 0;n_format < gen_nb_int;n_format++) {
3439         mem_base = xmlMemBlocks();
3440         out = gen_FILE_ptr(n_out, 0);
3441         doc = gen_xmlDocPtr(n_doc, 1);
3442         cur = gen_xmlNodePtr(n_cur, 2);
3443         encoding = gen_const_char_ptr(n_encoding, 3);
3444         format = gen_int(n_format, 4);
3445 
3446         ret_val = htmlNodeDumpFileFormat(out, doc, cur, encoding, format);
3447         desret_int(ret_val);
3448         call_tests++;
3449         des_FILE_ptr(n_out, out, 0);
3450         des_xmlDocPtr(n_doc, doc, 1);
3451         des_xmlNodePtr(n_cur, cur, 2);
3452         des_const_char_ptr(n_encoding, encoding, 3);
3453         des_int(n_format, format, 4);
3454         xmlResetLastError();
3455         if (mem_base != xmlMemBlocks()) {
3456             printf("Leak of %d blocks found in htmlNodeDumpFileFormat",
3457 	           xmlMemBlocks() - mem_base);
3458 	    test_ret++;
3459             printf(" %d", n_out);
3460             printf(" %d", n_doc);
3461             printf(" %d", n_cur);
3462             printf(" %d", n_encoding);
3463             printf(" %d", n_format);
3464             printf("\n");
3465         }
3466     }
3467     }
3468     }
3469     }
3470     }
3471     function_tests++;
3472 #endif
3473 
3474     return(test_ret);
3475 }
3476 
3477 
3478 static int
test_htmlNodeDumpFormatOutput(void)3479 test_htmlNodeDumpFormatOutput(void) {
3480     int test_ret = 0;
3481 
3482 #if defined(LIBXML_HTML_ENABLED) && defined(LIBXML_OUTPUT_ENABLED)
3483     int mem_base;
3484     xmlOutputBufferPtr buf; /* the HTML buffer output */
3485     int n_buf;
3486     xmlDocPtr doc; /* the document */
3487     int n_doc;
3488     xmlNodePtr cur; /* the current node */
3489     int n_cur;
3490     const char * encoding; /* the encoding string (unused) */
3491     int n_encoding;
3492     int format; /* should formatting spaces been added */
3493     int n_format;
3494 
3495     for (n_buf = 0;n_buf < gen_nb_xmlOutputBufferPtr;n_buf++) {
3496     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
3497     for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
3498     for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
3499     for (n_format = 0;n_format < gen_nb_int;n_format++) {
3500         mem_base = xmlMemBlocks();
3501         buf = gen_xmlOutputBufferPtr(n_buf, 0);
3502         doc = gen_xmlDocPtr(n_doc, 1);
3503         cur = gen_xmlNodePtr(n_cur, 2);
3504         encoding = gen_const_char_ptr(n_encoding, 3);
3505         format = gen_int(n_format, 4);
3506 
3507         htmlNodeDumpFormatOutput(buf, doc, cur, encoding, format);
3508         call_tests++;
3509         des_xmlOutputBufferPtr(n_buf, buf, 0);
3510         des_xmlDocPtr(n_doc, doc, 1);
3511         des_xmlNodePtr(n_cur, cur, 2);
3512         des_const_char_ptr(n_encoding, encoding, 3);
3513         des_int(n_format, format, 4);
3514         xmlResetLastError();
3515         if (mem_base != xmlMemBlocks()) {
3516             printf("Leak of %d blocks found in htmlNodeDumpFormatOutput",
3517 	           xmlMemBlocks() - mem_base);
3518 	    test_ret++;
3519             printf(" %d", n_buf);
3520             printf(" %d", n_doc);
3521             printf(" %d", n_cur);
3522             printf(" %d", n_encoding);
3523             printf(" %d", n_format);
3524             printf("\n");
3525         }
3526     }
3527     }
3528     }
3529     }
3530     }
3531     function_tests++;
3532 #endif
3533 
3534     return(test_ret);
3535 }
3536 
3537 
3538 static int
test_htmlNodeDumpOutput(void)3539 test_htmlNodeDumpOutput(void) {
3540     int test_ret = 0;
3541 
3542 #if defined(LIBXML_HTML_ENABLED) && defined(LIBXML_OUTPUT_ENABLED)
3543     int mem_base;
3544     xmlOutputBufferPtr buf; /* the HTML buffer output */
3545     int n_buf;
3546     xmlDocPtr doc; /* the document */
3547     int n_doc;
3548     xmlNodePtr cur; /* the current node */
3549     int n_cur;
3550     const char * encoding; /* the encoding string (unused) */
3551     int n_encoding;
3552 
3553     for (n_buf = 0;n_buf < gen_nb_xmlOutputBufferPtr;n_buf++) {
3554     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
3555     for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
3556     for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
3557         mem_base = xmlMemBlocks();
3558         buf = gen_xmlOutputBufferPtr(n_buf, 0);
3559         doc = gen_xmlDocPtr(n_doc, 1);
3560         cur = gen_xmlNodePtr(n_cur, 2);
3561         encoding = gen_const_char_ptr(n_encoding, 3);
3562 
3563         htmlNodeDumpOutput(buf, doc, cur, encoding);
3564         call_tests++;
3565         des_xmlOutputBufferPtr(n_buf, buf, 0);
3566         des_xmlDocPtr(n_doc, doc, 1);
3567         des_xmlNodePtr(n_cur, cur, 2);
3568         des_const_char_ptr(n_encoding, encoding, 3);
3569         xmlResetLastError();
3570         if (mem_base != xmlMemBlocks()) {
3571             printf("Leak of %d blocks found in htmlNodeDumpOutput",
3572 	           xmlMemBlocks() - mem_base);
3573 	    test_ret++;
3574             printf(" %d", n_buf);
3575             printf(" %d", n_doc);
3576             printf(" %d", n_cur);
3577             printf(" %d", n_encoding);
3578             printf("\n");
3579         }
3580     }
3581     }
3582     }
3583     }
3584     function_tests++;
3585 #endif
3586 
3587     return(test_ret);
3588 }
3589 
3590 
3591 static int
test_htmlSaveFile(void)3592 test_htmlSaveFile(void) {
3593     int test_ret = 0;
3594 
3595 #if defined(LIBXML_HTML_ENABLED) && defined(LIBXML_OUTPUT_ENABLED)
3596     int mem_base;
3597     int ret_val;
3598     const char * filename; /* the filename (or URL) */
3599     int n_filename;
3600     xmlDocPtr cur; /* the document */
3601     int n_cur;
3602 
3603     for (n_filename = 0;n_filename < gen_nb_fileoutput;n_filename++) {
3604     for (n_cur = 0;n_cur < gen_nb_xmlDocPtr;n_cur++) {
3605         mem_base = xmlMemBlocks();
3606         filename = gen_fileoutput(n_filename, 0);
3607         cur = gen_xmlDocPtr(n_cur, 1);
3608 
3609         ret_val = htmlSaveFile(filename, cur);
3610         desret_int(ret_val);
3611         call_tests++;
3612         des_fileoutput(n_filename, filename, 0);
3613         des_xmlDocPtr(n_cur, cur, 1);
3614         xmlResetLastError();
3615         if (mem_base != xmlMemBlocks()) {
3616             printf("Leak of %d blocks found in htmlSaveFile",
3617 	           xmlMemBlocks() - mem_base);
3618 	    test_ret++;
3619             printf(" %d", n_filename);
3620             printf(" %d", n_cur);
3621             printf("\n");
3622         }
3623     }
3624     }
3625     function_tests++;
3626 #endif
3627 
3628     return(test_ret);
3629 }
3630 
3631 
3632 static int
test_htmlSaveFileEnc(void)3633 test_htmlSaveFileEnc(void) {
3634     int test_ret = 0;
3635 
3636 #if defined(LIBXML_HTML_ENABLED) && defined(LIBXML_OUTPUT_ENABLED)
3637     int mem_base;
3638     int ret_val;
3639     const char * filename; /* the filename */
3640     int n_filename;
3641     xmlDocPtr cur; /* the document */
3642     int n_cur;
3643     const char * encoding; /* the document encoding */
3644     int n_encoding;
3645 
3646     for (n_filename = 0;n_filename < gen_nb_fileoutput;n_filename++) {
3647     for (n_cur = 0;n_cur < gen_nb_xmlDocPtr;n_cur++) {
3648     for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
3649         mem_base = xmlMemBlocks();
3650         filename = gen_fileoutput(n_filename, 0);
3651         cur = gen_xmlDocPtr(n_cur, 1);
3652         encoding = gen_const_char_ptr(n_encoding, 2);
3653 
3654         ret_val = htmlSaveFileEnc(filename, cur, encoding);
3655         desret_int(ret_val);
3656         call_tests++;
3657         des_fileoutput(n_filename, filename, 0);
3658         des_xmlDocPtr(n_cur, cur, 1);
3659         des_const_char_ptr(n_encoding, encoding, 2);
3660         xmlResetLastError();
3661         if (mem_base != xmlMemBlocks()) {
3662             printf("Leak of %d blocks found in htmlSaveFileEnc",
3663 	           xmlMemBlocks() - mem_base);
3664 	    test_ret++;
3665             printf(" %d", n_filename);
3666             printf(" %d", n_cur);
3667             printf(" %d", n_encoding);
3668             printf("\n");
3669         }
3670     }
3671     }
3672     }
3673     function_tests++;
3674 #endif
3675 
3676     return(test_ret);
3677 }
3678 
3679 
3680 static int
test_htmlSaveFileFormat(void)3681 test_htmlSaveFileFormat(void) {
3682     int test_ret = 0;
3683 
3684 #if defined(LIBXML_HTML_ENABLED) && defined(LIBXML_OUTPUT_ENABLED)
3685     int mem_base;
3686     int ret_val;
3687     const char * filename; /* the filename */
3688     int n_filename;
3689     xmlDocPtr cur; /* the document */
3690     int n_cur;
3691     const char * encoding; /* the document encoding */
3692     int n_encoding;
3693     int format; /* should formatting spaces been added */
3694     int n_format;
3695 
3696     for (n_filename = 0;n_filename < gen_nb_fileoutput;n_filename++) {
3697     for (n_cur = 0;n_cur < gen_nb_xmlDocPtr;n_cur++) {
3698     for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
3699     for (n_format = 0;n_format < gen_nb_int;n_format++) {
3700         mem_base = xmlMemBlocks();
3701         filename = gen_fileoutput(n_filename, 0);
3702         cur = gen_xmlDocPtr(n_cur, 1);
3703         encoding = gen_const_char_ptr(n_encoding, 2);
3704         format = gen_int(n_format, 3);
3705 
3706         ret_val = htmlSaveFileFormat(filename, cur, encoding, format);
3707         desret_int(ret_val);
3708         call_tests++;
3709         des_fileoutput(n_filename, filename, 0);
3710         des_xmlDocPtr(n_cur, cur, 1);
3711         des_const_char_ptr(n_encoding, encoding, 2);
3712         des_int(n_format, format, 3);
3713         xmlResetLastError();
3714         if (mem_base != xmlMemBlocks()) {
3715             printf("Leak of %d blocks found in htmlSaveFileFormat",
3716 	           xmlMemBlocks() - mem_base);
3717 	    test_ret++;
3718             printf(" %d", n_filename);
3719             printf(" %d", n_cur);
3720             printf(" %d", n_encoding);
3721             printf(" %d", n_format);
3722             printf("\n");
3723         }
3724     }
3725     }
3726     }
3727     }
3728     function_tests++;
3729 #endif
3730 
3731     return(test_ret);
3732 }
3733 
3734 
3735 static int
test_htmlSetMetaEncoding(void)3736 test_htmlSetMetaEncoding(void) {
3737     int test_ret = 0;
3738 
3739 #if defined(LIBXML_HTML_ENABLED)
3740     int mem_base;
3741     int ret_val;
3742     htmlDocPtr doc; /* the document */
3743     int n_doc;
3744     const xmlChar * encoding; /* the encoding string */
3745     int n_encoding;
3746 
3747     for (n_doc = 0;n_doc < gen_nb_htmlDocPtr;n_doc++) {
3748     for (n_encoding = 0;n_encoding < gen_nb_const_xmlChar_ptr;n_encoding++) {
3749         mem_base = xmlMemBlocks();
3750         doc = gen_htmlDocPtr(n_doc, 0);
3751         encoding = gen_const_xmlChar_ptr(n_encoding, 1);
3752 
3753         ret_val = htmlSetMetaEncoding(doc, encoding);
3754         desret_int(ret_val);
3755         call_tests++;
3756         des_htmlDocPtr(n_doc, doc, 0);
3757         des_const_xmlChar_ptr(n_encoding, encoding, 1);
3758         xmlResetLastError();
3759         if (mem_base != xmlMemBlocks()) {
3760             printf("Leak of %d blocks found in htmlSetMetaEncoding",
3761 	           xmlMemBlocks() - mem_base);
3762 	    test_ret++;
3763             printf(" %d", n_doc);
3764             printf(" %d", n_encoding);
3765             printf("\n");
3766         }
3767     }
3768     }
3769     function_tests++;
3770 #endif
3771 
3772     return(test_ret);
3773 }
3774 
3775 static int
test_HTMLtree(void)3776 test_HTMLtree(void) {
3777     int test_ret = 0;
3778 
3779     if (quiet == 0) printf("Testing HTMLtree : 18 of 18 functions ...\n");
3780     test_ret += test_htmlDocContentDumpFormatOutput();
3781     test_ret += test_htmlDocContentDumpOutput();
3782     test_ret += test_htmlDocDump();
3783     test_ret += test_htmlDocDumpMemory();
3784     test_ret += test_htmlDocDumpMemoryFormat();
3785     test_ret += test_htmlGetMetaEncoding();
3786     test_ret += test_htmlIsBooleanAttr();
3787     test_ret += test_htmlNewDoc();
3788     test_ret += test_htmlNewDocNoDtD();
3789     test_ret += test_htmlNodeDump();
3790     test_ret += test_htmlNodeDumpFile();
3791     test_ret += test_htmlNodeDumpFileFormat();
3792     test_ret += test_htmlNodeDumpFormatOutput();
3793     test_ret += test_htmlNodeDumpOutput();
3794     test_ret += test_htmlSaveFile();
3795     test_ret += test_htmlSaveFileEnc();
3796     test_ret += test_htmlSaveFileFormat();
3797     test_ret += test_htmlSetMetaEncoding();
3798 
3799     if (test_ret != 0)
3800 	printf("Module HTMLtree: %d errors\n", test_ret);
3801     return(test_ret);
3802 }
3803 
3804 static int
test_htmlDefaultSAXHandlerInit(void)3805 test_htmlDefaultSAXHandlerInit(void) {
3806     int test_ret = 0;
3807 
3808 #if defined(LIBXML_HTML_ENABLED)
3809 #ifdef LIBXML_HTML_ENABLED
3810     int mem_base;
3811 
3812         mem_base = xmlMemBlocks();
3813 
3814         htmlDefaultSAXHandlerInit();
3815         call_tests++;
3816         xmlResetLastError();
3817         if (mem_base != xmlMemBlocks()) {
3818             printf("Leak of %d blocks found in htmlDefaultSAXHandlerInit",
3819 	           xmlMemBlocks() - mem_base);
3820 	    test_ret++;
3821             printf("\n");
3822         }
3823     function_tests++;
3824 #endif
3825 #endif
3826 
3827     return(test_ret);
3828 }
3829 
3830 
3831 static int
test_xmlDefaultSAXHandlerInit(void)3832 test_xmlDefaultSAXHandlerInit(void) {
3833     int test_ret = 0;
3834 
3835     int mem_base;
3836 
3837         mem_base = xmlMemBlocks();
3838 
3839         xmlDefaultSAXHandlerInit();
3840         call_tests++;
3841         xmlResetLastError();
3842         if (mem_base != xmlMemBlocks()) {
3843             printf("Leak of %d blocks found in xmlDefaultSAXHandlerInit",
3844 	           xmlMemBlocks() - mem_base);
3845 	    test_ret++;
3846             printf("\n");
3847         }
3848     function_tests++;
3849 
3850     return(test_ret);
3851 }
3852 
3853 
3854 #define gen_nb_xmlEnumerationPtr 1
3855 #define gen_xmlEnumerationPtr(no, nr) NULL
3856 #define des_xmlEnumerationPtr(no, val, nr)
3857 
3858 static int
test_xmlSAX2AttributeDecl(void)3859 test_xmlSAX2AttributeDecl(void) {
3860     int test_ret = 0;
3861 
3862     int mem_base;
3863     void * ctx; /* the user data (XML parser context) */
3864     int n_ctx;
3865     const xmlChar * elem; /* the name of the element */
3866     int n_elem;
3867     const xmlChar * fullname; /* the attribute name */
3868     int n_fullname;
3869     int type; /* the attribute type */
3870     int n_type;
3871     int def; /* the type of default value */
3872     int n_def;
3873     const xmlChar * defaultValue; /* the attribute default value */
3874     int n_defaultValue;
3875     xmlEnumerationPtr tree; /* the tree of enumerated value set */
3876     int n_tree;
3877 
3878     for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
3879     for (n_elem = 0;n_elem < gen_nb_const_xmlChar_ptr;n_elem++) {
3880     for (n_fullname = 0;n_fullname < gen_nb_const_xmlChar_ptr;n_fullname++) {
3881     for (n_type = 0;n_type < gen_nb_int;n_type++) {
3882     for (n_def = 0;n_def < gen_nb_int;n_def++) {
3883     for (n_defaultValue = 0;n_defaultValue < gen_nb_const_xmlChar_ptr;n_defaultValue++) {
3884     for (n_tree = 0;n_tree < gen_nb_xmlEnumerationPtr;n_tree++) {
3885         mem_base = xmlMemBlocks();
3886         ctx = gen_void_ptr(n_ctx, 0);
3887         elem = gen_const_xmlChar_ptr(n_elem, 1);
3888         fullname = gen_const_xmlChar_ptr(n_fullname, 2);
3889         type = gen_int(n_type, 3);
3890         def = gen_int(n_def, 4);
3891         defaultValue = gen_const_xmlChar_ptr(n_defaultValue, 5);
3892         tree = gen_xmlEnumerationPtr(n_tree, 6);
3893 
3894         xmlSAX2AttributeDecl(ctx, elem, fullname, type, def, defaultValue, tree);
3895         call_tests++;
3896         des_void_ptr(n_ctx, ctx, 0);
3897         des_const_xmlChar_ptr(n_elem, elem, 1);
3898         des_const_xmlChar_ptr(n_fullname, fullname, 2);
3899         des_int(n_type, type, 3);
3900         des_int(n_def, def, 4);
3901         des_const_xmlChar_ptr(n_defaultValue, defaultValue, 5);
3902         des_xmlEnumerationPtr(n_tree, tree, 6);
3903         xmlResetLastError();
3904         if (mem_base != xmlMemBlocks()) {
3905             printf("Leak of %d blocks found in xmlSAX2AttributeDecl",
3906 	           xmlMemBlocks() - mem_base);
3907 	    test_ret++;
3908             printf(" %d", n_ctx);
3909             printf(" %d", n_elem);
3910             printf(" %d", n_fullname);
3911             printf(" %d", n_type);
3912             printf(" %d", n_def);
3913             printf(" %d", n_defaultValue);
3914             printf(" %d", n_tree);
3915             printf("\n");
3916         }
3917     }
3918     }
3919     }
3920     }
3921     }
3922     }
3923     }
3924     function_tests++;
3925 
3926     return(test_ret);
3927 }
3928 
3929 
3930 static int
test_xmlSAX2CDataBlock(void)3931 test_xmlSAX2CDataBlock(void) {
3932     int test_ret = 0;
3933 
3934     int mem_base;
3935     void * ctx; /* the user data (XML parser context) */
3936     int n_ctx;
3937     const xmlChar * value; /* The pcdata content */
3938     int n_value;
3939     int len; /* the block length */
3940     int n_len;
3941 
3942     for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
3943     for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
3944     for (n_len = 0;n_len < gen_nb_int;n_len++) {
3945         mem_base = xmlMemBlocks();
3946         ctx = gen_void_ptr(n_ctx, 0);
3947         value = gen_const_xmlChar_ptr(n_value, 1);
3948         len = gen_int(n_len, 2);
3949         if ((value != NULL) &&
3950             (len > xmlStrlen(BAD_CAST value)))
3951             len = 0;
3952 
3953         xmlSAX2CDataBlock(ctx, value, len);
3954         call_tests++;
3955         des_void_ptr(n_ctx, ctx, 0);
3956         des_const_xmlChar_ptr(n_value, value, 1);
3957         des_int(n_len, len, 2);
3958         xmlResetLastError();
3959         if (mem_base != xmlMemBlocks()) {
3960             printf("Leak of %d blocks found in xmlSAX2CDataBlock",
3961 	           xmlMemBlocks() - mem_base);
3962 	    test_ret++;
3963             printf(" %d", n_ctx);
3964             printf(" %d", n_value);
3965             printf(" %d", n_len);
3966             printf("\n");
3967         }
3968     }
3969     }
3970     }
3971     function_tests++;
3972 
3973     return(test_ret);
3974 }
3975 
3976 
3977 static int
test_xmlSAX2Characters(void)3978 test_xmlSAX2Characters(void) {
3979     int test_ret = 0;
3980 
3981     int mem_base;
3982     void * ctx; /* the user data (XML parser context) */
3983     int n_ctx;
3984     const xmlChar * ch; /* a xmlChar string */
3985     int n_ch;
3986     int len; /* the number of xmlChar */
3987     int n_len;
3988 
3989     for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
3990     for (n_ch = 0;n_ch < gen_nb_const_xmlChar_ptr;n_ch++) {
3991     for (n_len = 0;n_len < gen_nb_int;n_len++) {
3992         mem_base = xmlMemBlocks();
3993         ctx = gen_void_ptr(n_ctx, 0);
3994         ch = gen_const_xmlChar_ptr(n_ch, 1);
3995         len = gen_int(n_len, 2);
3996         if ((ch != NULL) &&
3997             (len > xmlStrlen(BAD_CAST ch)))
3998             len = 0;
3999 
4000         xmlSAX2Characters(ctx, ch, len);
4001         call_tests++;
4002         des_void_ptr(n_ctx, ctx, 0);
4003         des_const_xmlChar_ptr(n_ch, ch, 1);
4004         des_int(n_len, len, 2);
4005         xmlResetLastError();
4006         if (mem_base != xmlMemBlocks()) {
4007             printf("Leak of %d blocks found in xmlSAX2Characters",
4008 	           xmlMemBlocks() - mem_base);
4009 	    test_ret++;
4010             printf(" %d", n_ctx);
4011             printf(" %d", n_ch);
4012             printf(" %d", n_len);
4013             printf("\n");
4014         }
4015     }
4016     }
4017     }
4018     function_tests++;
4019 
4020     return(test_ret);
4021 }
4022 
4023 
4024 static int
test_xmlSAX2Comment(void)4025 test_xmlSAX2Comment(void) {
4026     int test_ret = 0;
4027 
4028     int mem_base;
4029     void * ctx; /* the user data (XML parser context) */
4030     int n_ctx;
4031     const xmlChar * value; /* the xmlSAX2Comment content */
4032     int n_value;
4033 
4034     for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
4035     for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
4036         mem_base = xmlMemBlocks();
4037         ctx = gen_void_ptr(n_ctx, 0);
4038         value = gen_const_xmlChar_ptr(n_value, 1);
4039 
4040         xmlSAX2Comment(ctx, value);
4041         call_tests++;
4042         des_void_ptr(n_ctx, ctx, 0);
4043         des_const_xmlChar_ptr(n_value, value, 1);
4044         xmlResetLastError();
4045         if (mem_base != xmlMemBlocks()) {
4046             printf("Leak of %d blocks found in xmlSAX2Comment",
4047 	           xmlMemBlocks() - mem_base);
4048 	    test_ret++;
4049             printf(" %d", n_ctx);
4050             printf(" %d", n_value);
4051             printf("\n");
4052         }
4053     }
4054     }
4055     function_tests++;
4056 
4057     return(test_ret);
4058 }
4059 
4060 
4061 static int
test_xmlSAX2ElementDecl(void)4062 test_xmlSAX2ElementDecl(void) {
4063     int test_ret = 0;
4064 
4065     int mem_base;
4066     void * ctx; /* the user data (XML parser context) */
4067     int n_ctx;
4068     const xmlChar * name; /* the element name */
4069     int n_name;
4070     int type; /* the element type */
4071     int n_type;
4072     xmlElementContentPtr content; /* the element value tree */
4073     int n_content;
4074 
4075     for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
4076     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
4077     for (n_type = 0;n_type < gen_nb_int;n_type++) {
4078     for (n_content = 0;n_content < gen_nb_xmlElementContentPtr;n_content++) {
4079         mem_base = xmlMemBlocks();
4080         ctx = gen_void_ptr(n_ctx, 0);
4081         name = gen_const_xmlChar_ptr(n_name, 1);
4082         type = gen_int(n_type, 2);
4083         content = gen_xmlElementContentPtr(n_content, 3);
4084 
4085         xmlSAX2ElementDecl(ctx, name, type, content);
4086         call_tests++;
4087         des_void_ptr(n_ctx, ctx, 0);
4088         des_const_xmlChar_ptr(n_name, name, 1);
4089         des_int(n_type, type, 2);
4090         des_xmlElementContentPtr(n_content, content, 3);
4091         xmlResetLastError();
4092         if (mem_base != xmlMemBlocks()) {
4093             printf("Leak of %d blocks found in xmlSAX2ElementDecl",
4094 	           xmlMemBlocks() - mem_base);
4095 	    test_ret++;
4096             printf(" %d", n_ctx);
4097             printf(" %d", n_name);
4098             printf(" %d", n_type);
4099             printf(" %d", n_content);
4100             printf("\n");
4101         }
4102     }
4103     }
4104     }
4105     }
4106     function_tests++;
4107 
4108     return(test_ret);
4109 }
4110 
4111 
4112 static int
test_xmlSAX2EndDocument(void)4113 test_xmlSAX2EndDocument(void) {
4114     int test_ret = 0;
4115 
4116     int mem_base;
4117     void * ctx; /* the user data (XML parser context) */
4118     int n_ctx;
4119 
4120     for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
4121         mem_base = xmlMemBlocks();
4122         ctx = gen_void_ptr(n_ctx, 0);
4123 
4124         xmlSAX2EndDocument(ctx);
4125         call_tests++;
4126         des_void_ptr(n_ctx, ctx, 0);
4127         xmlResetLastError();
4128         if (mem_base != xmlMemBlocks()) {
4129             printf("Leak of %d blocks found in xmlSAX2EndDocument",
4130 	           xmlMemBlocks() - mem_base);
4131 	    test_ret++;
4132             printf(" %d", n_ctx);
4133             printf("\n");
4134         }
4135     }
4136     function_tests++;
4137 
4138     return(test_ret);
4139 }
4140 
4141 
4142 static int
test_xmlSAX2EndElement(void)4143 test_xmlSAX2EndElement(void) {
4144     int test_ret = 0;
4145 
4146 #if defined(LIBXML_SAX1_ENABLED) || defined(LIBXML_HTML_ENABLED) || defined(LIBXML_WRITER_ENABLED) || defined(LIBXML_LEGACY_ENABLED)
4147 #ifdef LIBXML_SAX1_ENABLED
4148     int mem_base;
4149     void * ctx; /* the user data (XML parser context) */
4150     int n_ctx;
4151     const xmlChar * name; /* The element name */
4152     int n_name;
4153 
4154     for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
4155     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
4156         mem_base = xmlMemBlocks();
4157         ctx = gen_void_ptr(n_ctx, 0);
4158         name = gen_const_xmlChar_ptr(n_name, 1);
4159 
4160         xmlSAX2EndElement(ctx, name);
4161         call_tests++;
4162         des_void_ptr(n_ctx, ctx, 0);
4163         des_const_xmlChar_ptr(n_name, name, 1);
4164         xmlResetLastError();
4165         if (mem_base != xmlMemBlocks()) {
4166             printf("Leak of %d blocks found in xmlSAX2EndElement",
4167 	           xmlMemBlocks() - mem_base);
4168 	    test_ret++;
4169             printf(" %d", n_ctx);
4170             printf(" %d", n_name);
4171             printf("\n");
4172         }
4173     }
4174     }
4175     function_tests++;
4176 #endif
4177 #endif
4178 
4179     return(test_ret);
4180 }
4181 
4182 
4183 static int
test_xmlSAX2EndElementNs(void)4184 test_xmlSAX2EndElementNs(void) {
4185     int test_ret = 0;
4186 
4187     int mem_base;
4188     void * ctx; /* the user data (XML parser context) */
4189     int n_ctx;
4190     const xmlChar * localname; /* the local name of the element */
4191     int n_localname;
4192     const xmlChar * prefix; /* the element namespace prefix if available */
4193     int n_prefix;
4194     const xmlChar * URI; /* the element namespace name if available */
4195     int n_URI;
4196 
4197     for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
4198     for (n_localname = 0;n_localname < gen_nb_const_xmlChar_ptr;n_localname++) {
4199     for (n_prefix = 0;n_prefix < gen_nb_const_xmlChar_ptr;n_prefix++) {
4200     for (n_URI = 0;n_URI < gen_nb_const_xmlChar_ptr;n_URI++) {
4201         mem_base = xmlMemBlocks();
4202         ctx = gen_void_ptr(n_ctx, 0);
4203         localname = gen_const_xmlChar_ptr(n_localname, 1);
4204         prefix = gen_const_xmlChar_ptr(n_prefix, 2);
4205         URI = gen_const_xmlChar_ptr(n_URI, 3);
4206 
4207         xmlSAX2EndElementNs(ctx, localname, prefix, URI);
4208         call_tests++;
4209         des_void_ptr(n_ctx, ctx, 0);
4210         des_const_xmlChar_ptr(n_localname, localname, 1);
4211         des_const_xmlChar_ptr(n_prefix, prefix, 2);
4212         des_const_xmlChar_ptr(n_URI, URI, 3);
4213         xmlResetLastError();
4214         if (mem_base != xmlMemBlocks()) {
4215             printf("Leak of %d blocks found in xmlSAX2EndElementNs",
4216 	           xmlMemBlocks() - mem_base);
4217 	    test_ret++;
4218             printf(" %d", n_ctx);
4219             printf(" %d", n_localname);
4220             printf(" %d", n_prefix);
4221             printf(" %d", n_URI);
4222             printf("\n");
4223         }
4224     }
4225     }
4226     }
4227     }
4228     function_tests++;
4229 
4230     return(test_ret);
4231 }
4232 
4233 
4234 static int
test_xmlSAX2EntityDecl(void)4235 test_xmlSAX2EntityDecl(void) {
4236     int test_ret = 0;
4237 
4238     int mem_base;
4239     void * ctx; /* the user data (XML parser context) */
4240     int n_ctx;
4241     const xmlChar * name; /* the entity name */
4242     int n_name;
4243     int type; /* the entity type */
4244     int n_type;
4245     const xmlChar * publicId; /* The public ID of the entity */
4246     int n_publicId;
4247     const xmlChar * systemId; /* The system ID of the entity */
4248     int n_systemId;
4249     xmlChar * content; /* the entity value (without processing). */
4250     int n_content;
4251 
4252     for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
4253     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
4254     for (n_type = 0;n_type < gen_nb_int;n_type++) {
4255     for (n_publicId = 0;n_publicId < gen_nb_const_xmlChar_ptr;n_publicId++) {
4256     for (n_systemId = 0;n_systemId < gen_nb_const_xmlChar_ptr;n_systemId++) {
4257     for (n_content = 0;n_content < gen_nb_xmlChar_ptr;n_content++) {
4258         mem_base = xmlMemBlocks();
4259         ctx = gen_void_ptr(n_ctx, 0);
4260         name = gen_const_xmlChar_ptr(n_name, 1);
4261         type = gen_int(n_type, 2);
4262         publicId = gen_const_xmlChar_ptr(n_publicId, 3);
4263         systemId = gen_const_xmlChar_ptr(n_systemId, 4);
4264         content = gen_xmlChar_ptr(n_content, 5);
4265 
4266         xmlSAX2EntityDecl(ctx, name, type, publicId, systemId, content);
4267         call_tests++;
4268         des_void_ptr(n_ctx, ctx, 0);
4269         des_const_xmlChar_ptr(n_name, name, 1);
4270         des_int(n_type, type, 2);
4271         des_const_xmlChar_ptr(n_publicId, publicId, 3);
4272         des_const_xmlChar_ptr(n_systemId, systemId, 4);
4273         des_xmlChar_ptr(n_content, content, 5);
4274         xmlResetLastError();
4275         if (mem_base != xmlMemBlocks()) {
4276             printf("Leak of %d blocks found in xmlSAX2EntityDecl",
4277 	           xmlMemBlocks() - mem_base);
4278 	    test_ret++;
4279             printf(" %d", n_ctx);
4280             printf(" %d", n_name);
4281             printf(" %d", n_type);
4282             printf(" %d", n_publicId);
4283             printf(" %d", n_systemId);
4284             printf(" %d", n_content);
4285             printf("\n");
4286         }
4287     }
4288     }
4289     }
4290     }
4291     }
4292     }
4293     function_tests++;
4294 
4295     return(test_ret);
4296 }
4297 
4298 
4299 static int
test_xmlSAX2ExternalSubset(void)4300 test_xmlSAX2ExternalSubset(void) {
4301     int test_ret = 0;
4302 
4303     int mem_base;
4304     void * ctx; /* the user data (XML parser context) */
4305     int n_ctx;
4306     const xmlChar * name; /* the root element name */
4307     int n_name;
4308     const xmlChar * ExternalID; /* the external ID */
4309     int n_ExternalID;
4310     const xmlChar * SystemID; /* the SYSTEM ID (e.g. filename or URL) */
4311     int n_SystemID;
4312 
4313     for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
4314     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
4315     for (n_ExternalID = 0;n_ExternalID < gen_nb_const_xmlChar_ptr;n_ExternalID++) {
4316     for (n_SystemID = 0;n_SystemID < gen_nb_const_xmlChar_ptr;n_SystemID++) {
4317         mem_base = xmlMemBlocks();
4318         ctx = gen_void_ptr(n_ctx, 0);
4319         name = gen_const_xmlChar_ptr(n_name, 1);
4320         ExternalID = gen_const_xmlChar_ptr(n_ExternalID, 2);
4321         SystemID = gen_const_xmlChar_ptr(n_SystemID, 3);
4322 
4323         xmlSAX2ExternalSubset(ctx, name, ExternalID, SystemID);
4324         call_tests++;
4325         des_void_ptr(n_ctx, ctx, 0);
4326         des_const_xmlChar_ptr(n_name, name, 1);
4327         des_const_xmlChar_ptr(n_ExternalID, ExternalID, 2);
4328         des_const_xmlChar_ptr(n_SystemID, SystemID, 3);
4329         xmlResetLastError();
4330         if (mem_base != xmlMemBlocks()) {
4331             printf("Leak of %d blocks found in xmlSAX2ExternalSubset",
4332 	           xmlMemBlocks() - mem_base);
4333 	    test_ret++;
4334             printf(" %d", n_ctx);
4335             printf(" %d", n_name);
4336             printf(" %d", n_ExternalID);
4337             printf(" %d", n_SystemID);
4338             printf("\n");
4339         }
4340     }
4341     }
4342     }
4343     }
4344     function_tests++;
4345 
4346     return(test_ret);
4347 }
4348 
4349 
4350 static int
test_xmlSAX2GetColumnNumber(void)4351 test_xmlSAX2GetColumnNumber(void) {
4352     int test_ret = 0;
4353 
4354     int mem_base;
4355     int ret_val;
4356     void * ctx; /* the user data (XML parser context) */
4357     int n_ctx;
4358 
4359     for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
4360         mem_base = xmlMemBlocks();
4361         ctx = gen_void_ptr(n_ctx, 0);
4362 
4363         ret_val = xmlSAX2GetColumnNumber(ctx);
4364         desret_int(ret_val);
4365         call_tests++;
4366         des_void_ptr(n_ctx, ctx, 0);
4367         xmlResetLastError();
4368         if (mem_base != xmlMemBlocks()) {
4369             printf("Leak of %d blocks found in xmlSAX2GetColumnNumber",
4370 	           xmlMemBlocks() - mem_base);
4371 	    test_ret++;
4372             printf(" %d", n_ctx);
4373             printf("\n");
4374         }
4375     }
4376     function_tests++;
4377 
4378     return(test_ret);
4379 }
4380 
4381 
4382 static int
test_xmlSAX2GetEntity(void)4383 test_xmlSAX2GetEntity(void) {
4384     int test_ret = 0;
4385 
4386     int mem_base;
4387     xmlEntityPtr ret_val;
4388     void * ctx; /* the user data (XML parser context) */
4389     int n_ctx;
4390     const xmlChar * name; /* The entity name */
4391     int n_name;
4392 
4393     for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
4394     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
4395         mem_base = xmlMemBlocks();
4396         ctx = gen_void_ptr(n_ctx, 0);
4397         name = gen_const_xmlChar_ptr(n_name, 1);
4398 
4399         ret_val = xmlSAX2GetEntity(ctx, name);
4400         desret_xmlEntityPtr(ret_val);
4401         call_tests++;
4402         des_void_ptr(n_ctx, ctx, 0);
4403         des_const_xmlChar_ptr(n_name, name, 1);
4404         xmlResetLastError();
4405         if (mem_base != xmlMemBlocks()) {
4406             printf("Leak of %d blocks found in xmlSAX2GetEntity",
4407 	           xmlMemBlocks() - mem_base);
4408 	    test_ret++;
4409             printf(" %d", n_ctx);
4410             printf(" %d", n_name);
4411             printf("\n");
4412         }
4413     }
4414     }
4415     function_tests++;
4416 
4417     return(test_ret);
4418 }
4419 
4420 
4421 static int
test_xmlSAX2GetLineNumber(void)4422 test_xmlSAX2GetLineNumber(void) {
4423     int test_ret = 0;
4424 
4425     int mem_base;
4426     int ret_val;
4427     void * ctx; /* the user data (XML parser context) */
4428     int n_ctx;
4429 
4430     for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
4431         mem_base = xmlMemBlocks();
4432         ctx = gen_void_ptr(n_ctx, 0);
4433 
4434         ret_val = xmlSAX2GetLineNumber(ctx);
4435         desret_int(ret_val);
4436         call_tests++;
4437         des_void_ptr(n_ctx, ctx, 0);
4438         xmlResetLastError();
4439         if (mem_base != xmlMemBlocks()) {
4440             printf("Leak of %d blocks found in xmlSAX2GetLineNumber",
4441 	           xmlMemBlocks() - mem_base);
4442 	    test_ret++;
4443             printf(" %d", n_ctx);
4444             printf("\n");
4445         }
4446     }
4447     function_tests++;
4448 
4449     return(test_ret);
4450 }
4451 
4452 
4453 static int
test_xmlSAX2GetParameterEntity(void)4454 test_xmlSAX2GetParameterEntity(void) {
4455     int test_ret = 0;
4456 
4457     int mem_base;
4458     xmlEntityPtr ret_val;
4459     void * ctx; /* the user data (XML parser context) */
4460     int n_ctx;
4461     const xmlChar * name; /* The entity name */
4462     int n_name;
4463 
4464     for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
4465     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
4466         mem_base = xmlMemBlocks();
4467         ctx = gen_void_ptr(n_ctx, 0);
4468         name = gen_const_xmlChar_ptr(n_name, 1);
4469 
4470         ret_val = xmlSAX2GetParameterEntity(ctx, name);
4471         desret_xmlEntityPtr(ret_val);
4472         call_tests++;
4473         des_void_ptr(n_ctx, ctx, 0);
4474         des_const_xmlChar_ptr(n_name, name, 1);
4475         xmlResetLastError();
4476         if (mem_base != xmlMemBlocks()) {
4477             printf("Leak of %d blocks found in xmlSAX2GetParameterEntity",
4478 	           xmlMemBlocks() - mem_base);
4479 	    test_ret++;
4480             printf(" %d", n_ctx);
4481             printf(" %d", n_name);
4482             printf("\n");
4483         }
4484     }
4485     }
4486     function_tests++;
4487 
4488     return(test_ret);
4489 }
4490 
4491 
4492 static int
test_xmlSAX2GetPublicId(void)4493 test_xmlSAX2GetPublicId(void) {
4494     int test_ret = 0;
4495 
4496     int mem_base;
4497     const xmlChar * ret_val;
4498     void * ctx; /* the user data (XML parser context) */
4499     int n_ctx;
4500 
4501     for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
4502         mem_base = xmlMemBlocks();
4503         ctx = gen_void_ptr(n_ctx, 0);
4504 
4505         ret_val = xmlSAX2GetPublicId(ctx);
4506         desret_const_xmlChar_ptr(ret_val);
4507         call_tests++;
4508         des_void_ptr(n_ctx, ctx, 0);
4509         xmlResetLastError();
4510         if (mem_base != xmlMemBlocks()) {
4511             printf("Leak of %d blocks found in xmlSAX2GetPublicId",
4512 	           xmlMemBlocks() - mem_base);
4513 	    test_ret++;
4514             printf(" %d", n_ctx);
4515             printf("\n");
4516         }
4517     }
4518     function_tests++;
4519 
4520     return(test_ret);
4521 }
4522 
4523 
4524 static int
test_xmlSAX2GetSystemId(void)4525 test_xmlSAX2GetSystemId(void) {
4526     int test_ret = 0;
4527 
4528     int mem_base;
4529     const xmlChar * ret_val;
4530     void * ctx; /* the user data (XML parser context) */
4531     int n_ctx;
4532 
4533     for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
4534         mem_base = xmlMemBlocks();
4535         ctx = gen_void_ptr(n_ctx, 0);
4536 
4537         ret_val = xmlSAX2GetSystemId(ctx);
4538         desret_const_xmlChar_ptr(ret_val);
4539         call_tests++;
4540         des_void_ptr(n_ctx, ctx, 0);
4541         xmlResetLastError();
4542         if (mem_base != xmlMemBlocks()) {
4543             printf("Leak of %d blocks found in xmlSAX2GetSystemId",
4544 	           xmlMemBlocks() - mem_base);
4545 	    test_ret++;
4546             printf(" %d", n_ctx);
4547             printf("\n");
4548         }
4549     }
4550     function_tests++;
4551 
4552     return(test_ret);
4553 }
4554 
4555 
4556 static int
test_xmlSAX2HasExternalSubset(void)4557 test_xmlSAX2HasExternalSubset(void) {
4558     int test_ret = 0;
4559 
4560     int mem_base;
4561     int ret_val;
4562     void * ctx; /* the user data (XML parser context) */
4563     int n_ctx;
4564 
4565     for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
4566         mem_base = xmlMemBlocks();
4567         ctx = gen_void_ptr(n_ctx, 0);
4568 
4569         ret_val = xmlSAX2HasExternalSubset(ctx);
4570         desret_int(ret_val);
4571         call_tests++;
4572         des_void_ptr(n_ctx, ctx, 0);
4573         xmlResetLastError();
4574         if (mem_base != xmlMemBlocks()) {
4575             printf("Leak of %d blocks found in xmlSAX2HasExternalSubset",
4576 	           xmlMemBlocks() - mem_base);
4577 	    test_ret++;
4578             printf(" %d", n_ctx);
4579             printf("\n");
4580         }
4581     }
4582     function_tests++;
4583 
4584     return(test_ret);
4585 }
4586 
4587 
4588 static int
test_xmlSAX2HasInternalSubset(void)4589 test_xmlSAX2HasInternalSubset(void) {
4590     int test_ret = 0;
4591 
4592     int mem_base;
4593     int ret_val;
4594     void * ctx; /* the user data (XML parser context) */
4595     int n_ctx;
4596 
4597     for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
4598         mem_base = xmlMemBlocks();
4599         ctx = gen_void_ptr(n_ctx, 0);
4600 
4601         ret_val = xmlSAX2HasInternalSubset(ctx);
4602         desret_int(ret_val);
4603         call_tests++;
4604         des_void_ptr(n_ctx, ctx, 0);
4605         xmlResetLastError();
4606         if (mem_base != xmlMemBlocks()) {
4607             printf("Leak of %d blocks found in xmlSAX2HasInternalSubset",
4608 	           xmlMemBlocks() - mem_base);
4609 	    test_ret++;
4610             printf(" %d", n_ctx);
4611             printf("\n");
4612         }
4613     }
4614     function_tests++;
4615 
4616     return(test_ret);
4617 }
4618 
4619 
4620 static int
test_xmlSAX2IgnorableWhitespace(void)4621 test_xmlSAX2IgnorableWhitespace(void) {
4622     int test_ret = 0;
4623 
4624     int mem_base;
4625     void * ctx; /* the user data (XML parser context) */
4626     int n_ctx;
4627     const xmlChar * ch; /* a xmlChar string */
4628     int n_ch;
4629     int len; /* the number of xmlChar */
4630     int n_len;
4631 
4632     for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
4633     for (n_ch = 0;n_ch < gen_nb_const_xmlChar_ptr;n_ch++) {
4634     for (n_len = 0;n_len < gen_nb_int;n_len++) {
4635         mem_base = xmlMemBlocks();
4636         ctx = gen_void_ptr(n_ctx, 0);
4637         ch = gen_const_xmlChar_ptr(n_ch, 1);
4638         len = gen_int(n_len, 2);
4639         if ((ch != NULL) &&
4640             (len > xmlStrlen(BAD_CAST ch)))
4641             len = 0;
4642 
4643         xmlSAX2IgnorableWhitespace(ctx, ch, len);
4644         call_tests++;
4645         des_void_ptr(n_ctx, ctx, 0);
4646         des_const_xmlChar_ptr(n_ch, ch, 1);
4647         des_int(n_len, len, 2);
4648         xmlResetLastError();
4649         if (mem_base != xmlMemBlocks()) {
4650             printf("Leak of %d blocks found in xmlSAX2IgnorableWhitespace",
4651 	           xmlMemBlocks() - mem_base);
4652 	    test_ret++;
4653             printf(" %d", n_ctx);
4654             printf(" %d", n_ch);
4655             printf(" %d", n_len);
4656             printf("\n");
4657         }
4658     }
4659     }
4660     }
4661     function_tests++;
4662 
4663     return(test_ret);
4664 }
4665 
4666 
4667 #define gen_nb_xmlSAXHandler_ptr 1
4668 #define gen_xmlSAXHandler_ptr(no, nr) NULL
4669 #define des_xmlSAXHandler_ptr(no, val, nr)
4670 
4671 static int
test_xmlSAX2InitDefaultSAXHandler(void)4672 test_xmlSAX2InitDefaultSAXHandler(void) {
4673     int test_ret = 0;
4674 
4675     int mem_base;
4676     xmlSAXHandler * hdlr; /* the SAX handler */
4677     int n_hdlr;
4678     int warning; /* flag if non-zero sets the handler warning procedure */
4679     int n_warning;
4680 
4681     for (n_hdlr = 0;n_hdlr < gen_nb_xmlSAXHandler_ptr;n_hdlr++) {
4682     for (n_warning = 0;n_warning < gen_nb_int;n_warning++) {
4683         mem_base = xmlMemBlocks();
4684         hdlr = gen_xmlSAXHandler_ptr(n_hdlr, 0);
4685         warning = gen_int(n_warning, 1);
4686 
4687         xmlSAX2InitDefaultSAXHandler(hdlr, warning);
4688         call_tests++;
4689         des_xmlSAXHandler_ptr(n_hdlr, hdlr, 0);
4690         des_int(n_warning, warning, 1);
4691         xmlResetLastError();
4692         if (mem_base != xmlMemBlocks()) {
4693             printf("Leak of %d blocks found in xmlSAX2InitDefaultSAXHandler",
4694 	           xmlMemBlocks() - mem_base);
4695 	    test_ret++;
4696             printf(" %d", n_hdlr);
4697             printf(" %d", n_warning);
4698             printf("\n");
4699         }
4700     }
4701     }
4702     function_tests++;
4703 
4704     return(test_ret);
4705 }
4706 
4707 
4708 static int
test_xmlSAX2InitHtmlDefaultSAXHandler(void)4709 test_xmlSAX2InitHtmlDefaultSAXHandler(void) {
4710     int test_ret = 0;
4711 
4712 #if defined(LIBXML_HTML_ENABLED)
4713     int mem_base;
4714     xmlSAXHandler * hdlr; /* the SAX handler */
4715     int n_hdlr;
4716 
4717     for (n_hdlr = 0;n_hdlr < gen_nb_xmlSAXHandler_ptr;n_hdlr++) {
4718         mem_base = xmlMemBlocks();
4719         hdlr = gen_xmlSAXHandler_ptr(n_hdlr, 0);
4720 
4721         xmlSAX2InitHtmlDefaultSAXHandler(hdlr);
4722         call_tests++;
4723         des_xmlSAXHandler_ptr(n_hdlr, hdlr, 0);
4724         xmlResetLastError();
4725         if (mem_base != xmlMemBlocks()) {
4726             printf("Leak of %d blocks found in xmlSAX2InitHtmlDefaultSAXHandler",
4727 	           xmlMemBlocks() - mem_base);
4728 	    test_ret++;
4729             printf(" %d", n_hdlr);
4730             printf("\n");
4731         }
4732     }
4733     function_tests++;
4734 #endif
4735 
4736     return(test_ret);
4737 }
4738 
4739 
4740 static int
test_xmlSAX2InternalSubset(void)4741 test_xmlSAX2InternalSubset(void) {
4742     int test_ret = 0;
4743 
4744     int mem_base;
4745     void * ctx; /* the user data (XML parser context) */
4746     int n_ctx;
4747     const xmlChar * name; /* the root element name */
4748     int n_name;
4749     const xmlChar * ExternalID; /* the external ID */
4750     int n_ExternalID;
4751     const xmlChar * SystemID; /* the SYSTEM ID (e.g. filename or URL) */
4752     int n_SystemID;
4753 
4754     for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
4755     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
4756     for (n_ExternalID = 0;n_ExternalID < gen_nb_const_xmlChar_ptr;n_ExternalID++) {
4757     for (n_SystemID = 0;n_SystemID < gen_nb_const_xmlChar_ptr;n_SystemID++) {
4758         mem_base = xmlMemBlocks();
4759         ctx = gen_void_ptr(n_ctx, 0);
4760         name = gen_const_xmlChar_ptr(n_name, 1);
4761         ExternalID = gen_const_xmlChar_ptr(n_ExternalID, 2);
4762         SystemID = gen_const_xmlChar_ptr(n_SystemID, 3);
4763 
4764         xmlSAX2InternalSubset(ctx, name, ExternalID, SystemID);
4765         call_tests++;
4766         des_void_ptr(n_ctx, ctx, 0);
4767         des_const_xmlChar_ptr(n_name, name, 1);
4768         des_const_xmlChar_ptr(n_ExternalID, ExternalID, 2);
4769         des_const_xmlChar_ptr(n_SystemID, SystemID, 3);
4770         xmlResetLastError();
4771         if (mem_base != xmlMemBlocks()) {
4772             printf("Leak of %d blocks found in xmlSAX2InternalSubset",
4773 	           xmlMemBlocks() - mem_base);
4774 	    test_ret++;
4775             printf(" %d", n_ctx);
4776             printf(" %d", n_name);
4777             printf(" %d", n_ExternalID);
4778             printf(" %d", n_SystemID);
4779             printf("\n");
4780         }
4781     }
4782     }
4783     }
4784     }
4785     function_tests++;
4786 
4787     return(test_ret);
4788 }
4789 
4790 
4791 static int
test_xmlSAX2IsStandalone(void)4792 test_xmlSAX2IsStandalone(void) {
4793     int test_ret = 0;
4794 
4795     int mem_base;
4796     int ret_val;
4797     void * ctx; /* the user data (XML parser context) */
4798     int n_ctx;
4799 
4800     for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
4801         mem_base = xmlMemBlocks();
4802         ctx = gen_void_ptr(n_ctx, 0);
4803 
4804         ret_val = xmlSAX2IsStandalone(ctx);
4805         desret_int(ret_val);
4806         call_tests++;
4807         des_void_ptr(n_ctx, ctx, 0);
4808         xmlResetLastError();
4809         if (mem_base != xmlMemBlocks()) {
4810             printf("Leak of %d blocks found in xmlSAX2IsStandalone",
4811 	           xmlMemBlocks() - mem_base);
4812 	    test_ret++;
4813             printf(" %d", n_ctx);
4814             printf("\n");
4815         }
4816     }
4817     function_tests++;
4818 
4819     return(test_ret);
4820 }
4821 
4822 
4823 static int
test_xmlSAX2NotationDecl(void)4824 test_xmlSAX2NotationDecl(void) {
4825     int test_ret = 0;
4826 
4827     int mem_base;
4828     void * ctx; /* the user data (XML parser context) */
4829     int n_ctx;
4830     const xmlChar * name; /* The name of the notation */
4831     int n_name;
4832     const xmlChar * publicId; /* The public ID of the entity */
4833     int n_publicId;
4834     const xmlChar * systemId; /* The system ID of the entity */
4835     int n_systemId;
4836 
4837     for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
4838     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
4839     for (n_publicId = 0;n_publicId < gen_nb_const_xmlChar_ptr;n_publicId++) {
4840     for (n_systemId = 0;n_systemId < gen_nb_const_xmlChar_ptr;n_systemId++) {
4841         mem_base = xmlMemBlocks();
4842         ctx = gen_void_ptr(n_ctx, 0);
4843         name = gen_const_xmlChar_ptr(n_name, 1);
4844         publicId = gen_const_xmlChar_ptr(n_publicId, 2);
4845         systemId = gen_const_xmlChar_ptr(n_systemId, 3);
4846 
4847         xmlSAX2NotationDecl(ctx, name, publicId, systemId);
4848         call_tests++;
4849         des_void_ptr(n_ctx, ctx, 0);
4850         des_const_xmlChar_ptr(n_name, name, 1);
4851         des_const_xmlChar_ptr(n_publicId, publicId, 2);
4852         des_const_xmlChar_ptr(n_systemId, systemId, 3);
4853         xmlResetLastError();
4854         if (mem_base != xmlMemBlocks()) {
4855             printf("Leak of %d blocks found in xmlSAX2NotationDecl",
4856 	           xmlMemBlocks() - mem_base);
4857 	    test_ret++;
4858             printf(" %d", n_ctx);
4859             printf(" %d", n_name);
4860             printf(" %d", n_publicId);
4861             printf(" %d", n_systemId);
4862             printf("\n");
4863         }
4864     }
4865     }
4866     }
4867     }
4868     function_tests++;
4869 
4870     return(test_ret);
4871 }
4872 
4873 
4874 static int
test_xmlSAX2ProcessingInstruction(void)4875 test_xmlSAX2ProcessingInstruction(void) {
4876     int test_ret = 0;
4877 
4878     int mem_base;
4879     void * ctx; /* the user data (XML parser context) */
4880     int n_ctx;
4881     const xmlChar * target; /* the target name */
4882     int n_target;
4883     const xmlChar * data; /* the PI data's */
4884     int n_data;
4885 
4886     for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
4887     for (n_target = 0;n_target < gen_nb_const_xmlChar_ptr;n_target++) {
4888     for (n_data = 0;n_data < gen_nb_const_xmlChar_ptr;n_data++) {
4889         mem_base = xmlMemBlocks();
4890         ctx = gen_void_ptr(n_ctx, 0);
4891         target = gen_const_xmlChar_ptr(n_target, 1);
4892         data = gen_const_xmlChar_ptr(n_data, 2);
4893 
4894         xmlSAX2ProcessingInstruction(ctx, target, data);
4895         call_tests++;
4896         des_void_ptr(n_ctx, ctx, 0);
4897         des_const_xmlChar_ptr(n_target, target, 1);
4898         des_const_xmlChar_ptr(n_data, data, 2);
4899         xmlResetLastError();
4900         if (mem_base != xmlMemBlocks()) {
4901             printf("Leak of %d blocks found in xmlSAX2ProcessingInstruction",
4902 	           xmlMemBlocks() - mem_base);
4903 	    test_ret++;
4904             printf(" %d", n_ctx);
4905             printf(" %d", n_target);
4906             printf(" %d", n_data);
4907             printf("\n");
4908         }
4909     }
4910     }
4911     }
4912     function_tests++;
4913 
4914     return(test_ret);
4915 }
4916 
4917 
4918 static int
test_xmlSAX2Reference(void)4919 test_xmlSAX2Reference(void) {
4920     int test_ret = 0;
4921 
4922     int mem_base;
4923     void * ctx; /* the user data (XML parser context) */
4924     int n_ctx;
4925     const xmlChar * name; /* The entity name */
4926     int n_name;
4927 
4928     for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
4929     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
4930         mem_base = xmlMemBlocks();
4931         ctx = gen_void_ptr(n_ctx, 0);
4932         name = gen_const_xmlChar_ptr(n_name, 1);
4933 
4934         xmlSAX2Reference(ctx, name);
4935         call_tests++;
4936         des_void_ptr(n_ctx, ctx, 0);
4937         des_const_xmlChar_ptr(n_name, name, 1);
4938         xmlResetLastError();
4939         if (mem_base != xmlMemBlocks()) {
4940             printf("Leak of %d blocks found in xmlSAX2Reference",
4941 	           xmlMemBlocks() - mem_base);
4942 	    test_ret++;
4943             printf(" %d", n_ctx);
4944             printf(" %d", n_name);
4945             printf("\n");
4946         }
4947     }
4948     }
4949     function_tests++;
4950 
4951     return(test_ret);
4952 }
4953 
4954 
4955 static int
test_xmlSAX2ResolveEntity(void)4956 test_xmlSAX2ResolveEntity(void) {
4957     int test_ret = 0;
4958 
4959     int mem_base;
4960     xmlParserInputPtr ret_val;
4961     void * ctx; /* the user data (XML parser context) */
4962     int n_ctx;
4963     const xmlChar * publicId; /* The public ID of the entity */
4964     int n_publicId;
4965     const xmlChar * systemId; /* The system ID of the entity */
4966     int n_systemId;
4967 
4968     for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
4969     for (n_publicId = 0;n_publicId < gen_nb_const_xmlChar_ptr;n_publicId++) {
4970     for (n_systemId = 0;n_systemId < gen_nb_const_xmlChar_ptr;n_systemId++) {
4971         mem_base = xmlMemBlocks();
4972         ctx = gen_void_ptr(n_ctx, 0);
4973         publicId = gen_const_xmlChar_ptr(n_publicId, 1);
4974         systemId = gen_const_xmlChar_ptr(n_systemId, 2);
4975 
4976         ret_val = xmlSAX2ResolveEntity(ctx, publicId, systemId);
4977         desret_xmlParserInputPtr(ret_val);
4978         call_tests++;
4979         des_void_ptr(n_ctx, ctx, 0);
4980         des_const_xmlChar_ptr(n_publicId, publicId, 1);
4981         des_const_xmlChar_ptr(n_systemId, systemId, 2);
4982         xmlResetLastError();
4983         if (mem_base != xmlMemBlocks()) {
4984             printf("Leak of %d blocks found in xmlSAX2ResolveEntity",
4985 	           xmlMemBlocks() - mem_base);
4986 	    test_ret++;
4987             printf(" %d", n_ctx);
4988             printf(" %d", n_publicId);
4989             printf(" %d", n_systemId);
4990             printf("\n");
4991         }
4992     }
4993     }
4994     }
4995     function_tests++;
4996 
4997     return(test_ret);
4998 }
4999 
5000 
5001 #define gen_nb_xmlSAXLocatorPtr 1
5002 #define gen_xmlSAXLocatorPtr(no, nr) NULL
5003 #define des_xmlSAXLocatorPtr(no, val, nr)
5004 
5005 static int
test_xmlSAX2SetDocumentLocator(void)5006 test_xmlSAX2SetDocumentLocator(void) {
5007     int test_ret = 0;
5008 
5009     int mem_base;
5010     void * ctx; /* the user data (XML parser context) */
5011     int n_ctx;
5012     xmlSAXLocatorPtr loc; /* A SAX Locator */
5013     int n_loc;
5014 
5015     for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
5016     for (n_loc = 0;n_loc < gen_nb_xmlSAXLocatorPtr;n_loc++) {
5017         mem_base = xmlMemBlocks();
5018         ctx = gen_void_ptr(n_ctx, 0);
5019         loc = gen_xmlSAXLocatorPtr(n_loc, 1);
5020 
5021         xmlSAX2SetDocumentLocator(ctx, loc);
5022         call_tests++;
5023         des_void_ptr(n_ctx, ctx, 0);
5024         des_xmlSAXLocatorPtr(n_loc, loc, 1);
5025         xmlResetLastError();
5026         if (mem_base != xmlMemBlocks()) {
5027             printf("Leak of %d blocks found in xmlSAX2SetDocumentLocator",
5028 	           xmlMemBlocks() - mem_base);
5029 	    test_ret++;
5030             printf(" %d", n_ctx);
5031             printf(" %d", n_loc);
5032             printf("\n");
5033         }
5034     }
5035     }
5036     function_tests++;
5037 
5038     return(test_ret);
5039 }
5040 
5041 
5042 static int
test_xmlSAX2StartDocument(void)5043 test_xmlSAX2StartDocument(void) {
5044     int test_ret = 0;
5045 
5046     int mem_base;
5047     void * ctx; /* the user data (XML parser context) */
5048     int n_ctx;
5049 
5050     for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
5051         mem_base = xmlMemBlocks();
5052         ctx = gen_void_ptr(n_ctx, 0);
5053 
5054         xmlSAX2StartDocument(ctx);
5055         call_tests++;
5056         des_void_ptr(n_ctx, ctx, 0);
5057         xmlResetLastError();
5058         if (mem_base != xmlMemBlocks()) {
5059             printf("Leak of %d blocks found in xmlSAX2StartDocument",
5060 	           xmlMemBlocks() - mem_base);
5061 	    test_ret++;
5062             printf(" %d", n_ctx);
5063             printf("\n");
5064         }
5065     }
5066     function_tests++;
5067 
5068     return(test_ret);
5069 }
5070 
5071 
5072 static int
test_xmlSAX2StartElement(void)5073 test_xmlSAX2StartElement(void) {
5074     int test_ret = 0;
5075 
5076 #if defined(LIBXML_SAX1_ENABLED) || defined(LIBXML_HTML_ENABLED) || defined(LIBXML_WRITER_ENABLED) || defined(LIBXML_LEGACY_ENABLED)
5077 #ifdef LIBXML_SAX1_ENABLED
5078     int mem_base;
5079     void * ctx; /* the user data (XML parser context) */
5080     int n_ctx;
5081     const xmlChar * fullname; /* The element name, including namespace prefix */
5082     int n_fullname;
5083     const xmlChar ** atts; /* An array of name/value attributes pairs, NULL terminated */
5084     int n_atts;
5085 
5086     for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
5087     for (n_fullname = 0;n_fullname < gen_nb_const_xmlChar_ptr;n_fullname++) {
5088     for (n_atts = 0;n_atts < gen_nb_const_xmlChar_ptr_ptr;n_atts++) {
5089         mem_base = xmlMemBlocks();
5090         ctx = gen_void_ptr(n_ctx, 0);
5091         fullname = gen_const_xmlChar_ptr(n_fullname, 1);
5092         atts = gen_const_xmlChar_ptr_ptr(n_atts, 2);
5093 
5094         xmlSAX2StartElement(ctx, fullname, atts);
5095         call_tests++;
5096         des_void_ptr(n_ctx, ctx, 0);
5097         des_const_xmlChar_ptr(n_fullname, fullname, 1);
5098         des_const_xmlChar_ptr_ptr(n_atts, atts, 2);
5099         xmlResetLastError();
5100         if (mem_base != xmlMemBlocks()) {
5101             printf("Leak of %d blocks found in xmlSAX2StartElement",
5102 	           xmlMemBlocks() - mem_base);
5103 	    test_ret++;
5104             printf(" %d", n_ctx);
5105             printf(" %d", n_fullname);
5106             printf(" %d", n_atts);
5107             printf("\n");
5108         }
5109     }
5110     }
5111     }
5112     function_tests++;
5113 #endif
5114 #endif
5115 
5116     return(test_ret);
5117 }
5118 
5119 
5120 static int
test_xmlSAX2StartElementNs(void)5121 test_xmlSAX2StartElementNs(void) {
5122     int test_ret = 0;
5123 
5124     int mem_base;
5125     void * ctx; /* the user data (XML parser context) */
5126     int n_ctx;
5127     const xmlChar * localname; /* the local name of the element */
5128     int n_localname;
5129     const xmlChar * prefix; /* the element namespace prefix if available */
5130     int n_prefix;
5131     const xmlChar * URI; /* the element namespace name if available */
5132     int n_URI;
5133     int nb_namespaces; /* number of namespace definitions on that node */
5134     int n_nb_namespaces;
5135     const xmlChar ** namespaces; /* pointer to the array of prefix/URI pairs namespace definitions */
5136     int n_namespaces;
5137     int nb_attributes; /* the number of attributes on that node */
5138     int n_nb_attributes;
5139     int nb_defaulted; /* the number of defaulted attributes. */
5140     int n_nb_defaulted;
5141     const xmlChar ** attributes; /* pointer to the array of (localname/prefix/URI/value/end) attribute values. */
5142     int n_attributes;
5143 
5144     for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
5145     for (n_localname = 0;n_localname < gen_nb_const_xmlChar_ptr;n_localname++) {
5146     for (n_prefix = 0;n_prefix < gen_nb_const_xmlChar_ptr;n_prefix++) {
5147     for (n_URI = 0;n_URI < gen_nb_const_xmlChar_ptr;n_URI++) {
5148     for (n_nb_namespaces = 0;n_nb_namespaces < gen_nb_int;n_nb_namespaces++) {
5149     for (n_namespaces = 0;n_namespaces < gen_nb_const_xmlChar_ptr_ptr;n_namespaces++) {
5150     for (n_nb_attributes = 0;n_nb_attributes < gen_nb_int;n_nb_attributes++) {
5151     for (n_nb_defaulted = 0;n_nb_defaulted < gen_nb_int;n_nb_defaulted++) {
5152     for (n_attributes = 0;n_attributes < gen_nb_const_xmlChar_ptr_ptr;n_attributes++) {
5153         mem_base = xmlMemBlocks();
5154         ctx = gen_void_ptr(n_ctx, 0);
5155         localname = gen_const_xmlChar_ptr(n_localname, 1);
5156         prefix = gen_const_xmlChar_ptr(n_prefix, 2);
5157         URI = gen_const_xmlChar_ptr(n_URI, 3);
5158         nb_namespaces = gen_int(n_nb_namespaces, 4);
5159         namespaces = gen_const_xmlChar_ptr_ptr(n_namespaces, 5);
5160         nb_attributes = gen_int(n_nb_attributes, 6);
5161         nb_defaulted = gen_int(n_nb_defaulted, 7);
5162         attributes = gen_const_xmlChar_ptr_ptr(n_attributes, 8);
5163 
5164         xmlSAX2StartElementNs(ctx, localname, prefix, URI, nb_namespaces, namespaces, nb_attributes, nb_defaulted, attributes);
5165         call_tests++;
5166         des_void_ptr(n_ctx, ctx, 0);
5167         des_const_xmlChar_ptr(n_localname, localname, 1);
5168         des_const_xmlChar_ptr(n_prefix, prefix, 2);
5169         des_const_xmlChar_ptr(n_URI, URI, 3);
5170         des_int(n_nb_namespaces, nb_namespaces, 4);
5171         des_const_xmlChar_ptr_ptr(n_namespaces, namespaces, 5);
5172         des_int(n_nb_attributes, nb_attributes, 6);
5173         des_int(n_nb_defaulted, nb_defaulted, 7);
5174         des_const_xmlChar_ptr_ptr(n_attributes, attributes, 8);
5175         xmlResetLastError();
5176         if (mem_base != xmlMemBlocks()) {
5177             printf("Leak of %d blocks found in xmlSAX2StartElementNs",
5178 	           xmlMemBlocks() - mem_base);
5179 	    test_ret++;
5180             printf(" %d", n_ctx);
5181             printf(" %d", n_localname);
5182             printf(" %d", n_prefix);
5183             printf(" %d", n_URI);
5184             printf(" %d", n_nb_namespaces);
5185             printf(" %d", n_namespaces);
5186             printf(" %d", n_nb_attributes);
5187             printf(" %d", n_nb_defaulted);
5188             printf(" %d", n_attributes);
5189             printf("\n");
5190         }
5191     }
5192     }
5193     }
5194     }
5195     }
5196     }
5197     }
5198     }
5199     }
5200     function_tests++;
5201 
5202     return(test_ret);
5203 }
5204 
5205 
5206 static int
test_xmlSAX2UnparsedEntityDecl(void)5207 test_xmlSAX2UnparsedEntityDecl(void) {
5208     int test_ret = 0;
5209 
5210     int mem_base;
5211     void * ctx; /* the user data (XML parser context) */
5212     int n_ctx;
5213     const xmlChar * name; /* The name of the entity */
5214     int n_name;
5215     const xmlChar * publicId; /* The public ID of the entity */
5216     int n_publicId;
5217     const xmlChar * systemId; /* The system ID of the entity */
5218     int n_systemId;
5219     const xmlChar * notationName; /* the name of the notation */
5220     int n_notationName;
5221 
5222     for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
5223     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
5224     for (n_publicId = 0;n_publicId < gen_nb_const_xmlChar_ptr;n_publicId++) {
5225     for (n_systemId = 0;n_systemId < gen_nb_const_xmlChar_ptr;n_systemId++) {
5226     for (n_notationName = 0;n_notationName < gen_nb_const_xmlChar_ptr;n_notationName++) {
5227         mem_base = xmlMemBlocks();
5228         ctx = gen_void_ptr(n_ctx, 0);
5229         name = gen_const_xmlChar_ptr(n_name, 1);
5230         publicId = gen_const_xmlChar_ptr(n_publicId, 2);
5231         systemId = gen_const_xmlChar_ptr(n_systemId, 3);
5232         notationName = gen_const_xmlChar_ptr(n_notationName, 4);
5233 
5234         xmlSAX2UnparsedEntityDecl(ctx, name, publicId, systemId, notationName);
5235         call_tests++;
5236         des_void_ptr(n_ctx, ctx, 0);
5237         des_const_xmlChar_ptr(n_name, name, 1);
5238         des_const_xmlChar_ptr(n_publicId, publicId, 2);
5239         des_const_xmlChar_ptr(n_systemId, systemId, 3);
5240         des_const_xmlChar_ptr(n_notationName, notationName, 4);
5241         xmlResetLastError();
5242         if (mem_base != xmlMemBlocks()) {
5243             printf("Leak of %d blocks found in xmlSAX2UnparsedEntityDecl",
5244 	           xmlMemBlocks() - mem_base);
5245 	    test_ret++;
5246             printf(" %d", n_ctx);
5247             printf(" %d", n_name);
5248             printf(" %d", n_publicId);
5249             printf(" %d", n_systemId);
5250             printf(" %d", n_notationName);
5251             printf("\n");
5252         }
5253     }
5254     }
5255     }
5256     }
5257     }
5258     function_tests++;
5259 
5260     return(test_ret);
5261 }
5262 
5263 
5264 static int
test_xmlSAXDefaultVersion(void)5265 test_xmlSAXDefaultVersion(void) {
5266     int test_ret = 0;
5267 
5268 #if defined(LIBXML_SAX1_ENABLED)
5269 #ifdef LIBXML_SAX1_ENABLED
5270     int mem_base;
5271     int ret_val;
5272     int version; /* the version, 1 or 2 */
5273     int n_version;
5274 
5275     for (n_version = 0;n_version < gen_nb_int;n_version++) {
5276         mem_base = xmlMemBlocks();
5277         version = gen_int(n_version, 0);
5278 
5279         {
5280             int original_version = xmlSAXDefaultVersion(2);
5281 
5282 
5283         ret_val = xmlSAXDefaultVersion(version);
5284 
5285             (void)xmlSAXDefaultVersion(original_version);
5286         }
5287 
5288         desret_int(ret_val);
5289         call_tests++;
5290         des_int(n_version, version, 0);
5291         xmlResetLastError();
5292         if (mem_base != xmlMemBlocks()) {
5293             printf("Leak of %d blocks found in xmlSAXDefaultVersion",
5294 	           xmlMemBlocks() - mem_base);
5295 	    test_ret++;
5296             printf(" %d", n_version);
5297             printf("\n");
5298         }
5299     }
5300     function_tests++;
5301 #endif
5302 #endif
5303 
5304     return(test_ret);
5305 }
5306 
5307 
5308 static int
test_xmlSAXVersion(void)5309 test_xmlSAXVersion(void) {
5310     int test_ret = 0;
5311 
5312     int mem_base;
5313     int ret_val;
5314     xmlSAXHandler * hdlr; /* the SAX handler */
5315     int n_hdlr;
5316     int version; /* the version, 1 or 2 */
5317     int n_version;
5318 
5319     for (n_hdlr = 0;n_hdlr < gen_nb_xmlSAXHandler_ptr;n_hdlr++) {
5320     for (n_version = 0;n_version < gen_nb_int;n_version++) {
5321         mem_base = xmlMemBlocks();
5322         hdlr = gen_xmlSAXHandler_ptr(n_hdlr, 0);
5323         version = gen_int(n_version, 1);
5324 
5325         ret_val = xmlSAXVersion(hdlr, version);
5326         desret_int(ret_val);
5327         call_tests++;
5328         des_xmlSAXHandler_ptr(n_hdlr, hdlr, 0);
5329         des_int(n_version, version, 1);
5330         xmlResetLastError();
5331         if (mem_base != xmlMemBlocks()) {
5332             printf("Leak of %d blocks found in xmlSAXVersion",
5333 	           xmlMemBlocks() - mem_base);
5334 	    test_ret++;
5335             printf(" %d", n_hdlr);
5336             printf(" %d", n_version);
5337             printf("\n");
5338         }
5339     }
5340     }
5341     function_tests++;
5342 
5343     return(test_ret);
5344 }
5345 
5346 static int
test_SAX2(void)5347 test_SAX2(void) {
5348     int test_ret = 0;
5349 
5350     if (quiet == 0) printf("Testing SAX2 : 36 of 36 functions ...\n");
5351     test_ret += test_htmlDefaultSAXHandlerInit();
5352     test_ret += test_xmlDefaultSAXHandlerInit();
5353     test_ret += test_xmlSAX2AttributeDecl();
5354     test_ret += test_xmlSAX2CDataBlock();
5355     test_ret += test_xmlSAX2Characters();
5356     test_ret += test_xmlSAX2Comment();
5357     test_ret += test_xmlSAX2ElementDecl();
5358     test_ret += test_xmlSAX2EndDocument();
5359     test_ret += test_xmlSAX2EndElement();
5360     test_ret += test_xmlSAX2EndElementNs();
5361     test_ret += test_xmlSAX2EntityDecl();
5362     test_ret += test_xmlSAX2ExternalSubset();
5363     test_ret += test_xmlSAX2GetColumnNumber();
5364     test_ret += test_xmlSAX2GetEntity();
5365     test_ret += test_xmlSAX2GetLineNumber();
5366     test_ret += test_xmlSAX2GetParameterEntity();
5367     test_ret += test_xmlSAX2GetPublicId();
5368     test_ret += test_xmlSAX2GetSystemId();
5369     test_ret += test_xmlSAX2HasExternalSubset();
5370     test_ret += test_xmlSAX2HasInternalSubset();
5371     test_ret += test_xmlSAX2IgnorableWhitespace();
5372     test_ret += test_xmlSAX2InitDefaultSAXHandler();
5373     test_ret += test_xmlSAX2InitHtmlDefaultSAXHandler();
5374     test_ret += test_xmlSAX2InternalSubset();
5375     test_ret += test_xmlSAX2IsStandalone();
5376     test_ret += test_xmlSAX2NotationDecl();
5377     test_ret += test_xmlSAX2ProcessingInstruction();
5378     test_ret += test_xmlSAX2Reference();
5379     test_ret += test_xmlSAX2ResolveEntity();
5380     test_ret += test_xmlSAX2SetDocumentLocator();
5381     test_ret += test_xmlSAX2StartDocument();
5382     test_ret += test_xmlSAX2StartElement();
5383     test_ret += test_xmlSAX2StartElementNs();
5384     test_ret += test_xmlSAX2UnparsedEntityDecl();
5385     test_ret += test_xmlSAXDefaultVersion();
5386     test_ret += test_xmlSAXVersion();
5387 
5388     if (test_ret != 0)
5389 	printf("Module SAX2: %d errors\n", test_ret);
5390     return(test_ret);
5391 }
5392 
5393 static int
test_xmlC14NDocDumpMemory(void)5394 test_xmlC14NDocDumpMemory(void) {
5395     int test_ret = 0;
5396 
5397 #if defined(LIBXML_C14N_ENABLED)
5398     int mem_base;
5399     int ret_val;
5400     xmlDocPtr doc; /* the XML document for canonization */
5401     int n_doc;
5402     xmlNodeSetPtr nodes; /* the nodes set to be included in the canonized image or NULL if all document nodes should be included */
5403     int n_nodes;
5404     int mode; /* the c14n mode (see @xmlC14NMode) */
5405     int n_mode;
5406     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) */
5407     int n_inclusive_ns_prefixes;
5408     int with_comments; /* include comments in the result (!=0) or not (==0) */
5409     int n_with_comments;
5410     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 */
5411     int n_doc_txt_ptr;
5412 
5413     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
5414     for (n_nodes = 0;n_nodes < gen_nb_xmlNodeSetPtr;n_nodes++) {
5415     for (n_mode = 0;n_mode < gen_nb_int;n_mode++) {
5416     for (n_inclusive_ns_prefixes = 0;n_inclusive_ns_prefixes < gen_nb_xmlChar_ptr_ptr;n_inclusive_ns_prefixes++) {
5417     for (n_with_comments = 0;n_with_comments < gen_nb_int;n_with_comments++) {
5418     for (n_doc_txt_ptr = 0;n_doc_txt_ptr < gen_nb_xmlChar_ptr_ptr;n_doc_txt_ptr++) {
5419         mem_base = xmlMemBlocks();
5420         doc = gen_xmlDocPtr(n_doc, 0);
5421         nodes = gen_xmlNodeSetPtr(n_nodes, 1);
5422         mode = gen_int(n_mode, 2);
5423         inclusive_ns_prefixes = gen_xmlChar_ptr_ptr(n_inclusive_ns_prefixes, 3);
5424         with_comments = gen_int(n_with_comments, 4);
5425         doc_txt_ptr = gen_xmlChar_ptr_ptr(n_doc_txt_ptr, 5);
5426 
5427         ret_val = xmlC14NDocDumpMemory(doc, nodes, mode, inclusive_ns_prefixes, with_comments, doc_txt_ptr);
5428         desret_int(ret_val);
5429         call_tests++;
5430         des_xmlDocPtr(n_doc, doc, 0);
5431         des_xmlNodeSetPtr(n_nodes, nodes, 1);
5432         des_int(n_mode, mode, 2);
5433         des_xmlChar_ptr_ptr(n_inclusive_ns_prefixes, inclusive_ns_prefixes, 3);
5434         des_int(n_with_comments, with_comments, 4);
5435         des_xmlChar_ptr_ptr(n_doc_txt_ptr, doc_txt_ptr, 5);
5436         xmlResetLastError();
5437         if (mem_base != xmlMemBlocks()) {
5438             printf("Leak of %d blocks found in xmlC14NDocDumpMemory",
5439 	           xmlMemBlocks() - mem_base);
5440 	    test_ret++;
5441             printf(" %d", n_doc);
5442             printf(" %d", n_nodes);
5443             printf(" %d", n_mode);
5444             printf(" %d", n_inclusive_ns_prefixes);
5445             printf(" %d", n_with_comments);
5446             printf(" %d", n_doc_txt_ptr);
5447             printf("\n");
5448         }
5449     }
5450     }
5451     }
5452     }
5453     }
5454     }
5455     function_tests++;
5456 #endif
5457 
5458     return(test_ret);
5459 }
5460 
5461 
5462 static int
test_xmlC14NDocSave(void)5463 test_xmlC14NDocSave(void) {
5464     int test_ret = 0;
5465 
5466 #if defined(LIBXML_C14N_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 mode; /* the c14n mode (see @xmlC14NMode) */
5474     int n_mode;
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     const char * filename; /* the filename to store canonical XML image */
5480     int n_filename;
5481     int compression; /* the compression level (zlib required): -1 - libxml default, 0 - uncompressed, >0 - compression level */
5482     int n_compression;
5483 
5484     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
5485     for (n_nodes = 0;n_nodes < gen_nb_xmlNodeSetPtr;n_nodes++) {
5486     for (n_mode = 0;n_mode < gen_nb_int;n_mode++) {
5487     for (n_inclusive_ns_prefixes = 0;n_inclusive_ns_prefixes < gen_nb_xmlChar_ptr_ptr;n_inclusive_ns_prefixes++) {
5488     for (n_with_comments = 0;n_with_comments < gen_nb_int;n_with_comments++) {
5489     for (n_filename = 0;n_filename < gen_nb_fileoutput;n_filename++) {
5490     for (n_compression = 0;n_compression < gen_nb_int;n_compression++) {
5491         mem_base = xmlMemBlocks();
5492         doc = gen_xmlDocPtr(n_doc, 0);
5493         nodes = gen_xmlNodeSetPtr(n_nodes, 1);
5494         mode = gen_int(n_mode, 2);
5495         inclusive_ns_prefixes = gen_xmlChar_ptr_ptr(n_inclusive_ns_prefixes, 3);
5496         with_comments = gen_int(n_with_comments, 4);
5497         filename = gen_fileoutput(n_filename, 5);
5498         compression = gen_int(n_compression, 6);
5499 
5500         ret_val = xmlC14NDocSave(doc, nodes, mode, inclusive_ns_prefixes, with_comments, filename, compression);
5501         desret_int(ret_val);
5502         call_tests++;
5503         des_xmlDocPtr(n_doc, doc, 0);
5504         des_xmlNodeSetPtr(n_nodes, nodes, 1);
5505         des_int(n_mode, mode, 2);
5506         des_xmlChar_ptr_ptr(n_inclusive_ns_prefixes, inclusive_ns_prefixes, 3);
5507         des_int(n_with_comments, with_comments, 4);
5508         des_fileoutput(n_filename, filename, 5);
5509         des_int(n_compression, compression, 6);
5510         xmlResetLastError();
5511         if (mem_base != xmlMemBlocks()) {
5512             printf("Leak of %d blocks found in xmlC14NDocSave",
5513 	           xmlMemBlocks() - mem_base);
5514 	    test_ret++;
5515             printf(" %d", n_doc);
5516             printf(" %d", n_nodes);
5517             printf(" %d", n_mode);
5518             printf(" %d", n_inclusive_ns_prefixes);
5519             printf(" %d", n_with_comments);
5520             printf(" %d", n_filename);
5521             printf(" %d", n_compression);
5522             printf("\n");
5523         }
5524     }
5525     }
5526     }
5527     }
5528     }
5529     }
5530     }
5531     function_tests++;
5532 #endif
5533 
5534     return(test_ret);
5535 }
5536 
5537 
5538 static int
test_xmlC14NDocSaveTo(void)5539 test_xmlC14NDocSaveTo(void) {
5540     int test_ret = 0;
5541 
5542 #if defined(LIBXML_C14N_ENABLED)
5543     int mem_base;
5544     int ret_val;
5545     xmlDocPtr doc; /* the XML document for canonization */
5546     int n_doc;
5547     xmlNodeSetPtr nodes; /* the nodes set to be included in the canonized image or NULL if all document nodes should be included */
5548     int n_nodes;
5549     int mode; /* the c14n mode (see @xmlC14NMode) */
5550     int n_mode;
5551     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) */
5552     int n_inclusive_ns_prefixes;
5553     int with_comments; /* include comments in the result (!=0) or not (==0) */
5554     int n_with_comments;
5555     xmlOutputBufferPtr buf; /* the output buffer to store canonical XML; this buffer MUST have encoder==NULL because C14N requires UTF-8 output */
5556     int n_buf;
5557 
5558     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
5559     for (n_nodes = 0;n_nodes < gen_nb_xmlNodeSetPtr;n_nodes++) {
5560     for (n_mode = 0;n_mode < gen_nb_int;n_mode++) {
5561     for (n_inclusive_ns_prefixes = 0;n_inclusive_ns_prefixes < gen_nb_xmlChar_ptr_ptr;n_inclusive_ns_prefixes++) {
5562     for (n_with_comments = 0;n_with_comments < gen_nb_int;n_with_comments++) {
5563     for (n_buf = 0;n_buf < gen_nb_xmlOutputBufferPtr;n_buf++) {
5564         mem_base = xmlMemBlocks();
5565         doc = gen_xmlDocPtr(n_doc, 0);
5566         nodes = gen_xmlNodeSetPtr(n_nodes, 1);
5567         mode = gen_int(n_mode, 2);
5568         inclusive_ns_prefixes = gen_xmlChar_ptr_ptr(n_inclusive_ns_prefixes, 3);
5569         with_comments = gen_int(n_with_comments, 4);
5570         buf = gen_xmlOutputBufferPtr(n_buf, 5);
5571 
5572         ret_val = xmlC14NDocSaveTo(doc, nodes, mode, inclusive_ns_prefixes, with_comments, buf);
5573         desret_int(ret_val);
5574         call_tests++;
5575         des_xmlDocPtr(n_doc, doc, 0);
5576         des_xmlNodeSetPtr(n_nodes, nodes, 1);
5577         des_int(n_mode, mode, 2);
5578         des_xmlChar_ptr_ptr(n_inclusive_ns_prefixes, inclusive_ns_prefixes, 3);
5579         des_int(n_with_comments, with_comments, 4);
5580         des_xmlOutputBufferPtr(n_buf, buf, 5);
5581         xmlResetLastError();
5582         if (mem_base != xmlMemBlocks()) {
5583             printf("Leak of %d blocks found in xmlC14NDocSaveTo",
5584 	           xmlMemBlocks() - mem_base);
5585 	    test_ret++;
5586             printf(" %d", n_doc);
5587             printf(" %d", n_nodes);
5588             printf(" %d", n_mode);
5589             printf(" %d", n_inclusive_ns_prefixes);
5590             printf(" %d", n_with_comments);
5591             printf(" %d", n_buf);
5592             printf("\n");
5593         }
5594     }
5595     }
5596     }
5597     }
5598     }
5599     }
5600     function_tests++;
5601 #endif
5602 
5603     return(test_ret);
5604 }
5605 
5606 
5607 static int
test_xmlC14NExecute(void)5608 test_xmlC14NExecute(void) {
5609     int test_ret = 0;
5610 
5611 
5612     /* missing type support */
5613     return(test_ret);
5614 }
5615 
5616 static int
test_c14n(void)5617 test_c14n(void) {
5618     int test_ret = 0;
5619 
5620     if (quiet == 0) printf("Testing c14n : 3 of 4 functions ...\n");
5621     test_ret += test_xmlC14NDocDumpMemory();
5622     test_ret += test_xmlC14NDocSave();
5623     test_ret += test_xmlC14NDocSaveTo();
5624     test_ret += test_xmlC14NExecute();
5625 
5626     if (test_ret != 0)
5627 	printf("Module c14n: %d errors\n", test_ret);
5628     return(test_ret);
5629 }
5630 #ifdef LIBXML_CATALOG_ENABLED
5631 
5632 #define gen_nb_xmlCatalogPtr 1
5633 #define gen_xmlCatalogPtr(no, nr) NULL
5634 #define des_xmlCatalogPtr(no, val, nr)
5635 #endif
5636 
5637 
5638 static int
test_xmlACatalogAdd(void)5639 test_xmlACatalogAdd(void) {
5640     int test_ret = 0;
5641 
5642 #if defined(LIBXML_CATALOG_ENABLED)
5643     int mem_base;
5644     int ret_val;
5645     xmlCatalogPtr catal; /* a Catalog */
5646     int n_catal;
5647     const xmlChar * type; /* the type of record to add to the catalog */
5648     int n_type;
5649     const xmlChar * orig; /* the system, public or prefix to match */
5650     int n_orig;
5651     const xmlChar * replace; /* the replacement value for the match */
5652     int n_replace;
5653 
5654     for (n_catal = 0;n_catal < gen_nb_xmlCatalogPtr;n_catal++) {
5655     for (n_type = 0;n_type < gen_nb_const_xmlChar_ptr;n_type++) {
5656     for (n_orig = 0;n_orig < gen_nb_const_xmlChar_ptr;n_orig++) {
5657     for (n_replace = 0;n_replace < gen_nb_const_xmlChar_ptr;n_replace++) {
5658         mem_base = xmlMemBlocks();
5659         catal = gen_xmlCatalogPtr(n_catal, 0);
5660         type = gen_const_xmlChar_ptr(n_type, 1);
5661         orig = gen_const_xmlChar_ptr(n_orig, 2);
5662         replace = gen_const_xmlChar_ptr(n_replace, 3);
5663 
5664         ret_val = xmlACatalogAdd(catal, type, orig, replace);
5665         desret_int(ret_val);
5666         call_tests++;
5667         des_xmlCatalogPtr(n_catal, catal, 0);
5668         des_const_xmlChar_ptr(n_type, type, 1);
5669         des_const_xmlChar_ptr(n_orig, orig, 2);
5670         des_const_xmlChar_ptr(n_replace, replace, 3);
5671         xmlResetLastError();
5672         if (mem_base != xmlMemBlocks()) {
5673             printf("Leak of %d blocks found in xmlACatalogAdd",
5674 	           xmlMemBlocks() - mem_base);
5675 	    test_ret++;
5676             printf(" %d", n_catal);
5677             printf(" %d", n_type);
5678             printf(" %d", n_orig);
5679             printf(" %d", n_replace);
5680             printf("\n");
5681         }
5682     }
5683     }
5684     }
5685     }
5686     function_tests++;
5687 #endif
5688 
5689     return(test_ret);
5690 }
5691 
5692 
5693 static int
test_xmlACatalogDump(void)5694 test_xmlACatalogDump(void) {
5695     int test_ret = 0;
5696 
5697 #if defined(LIBXML_CATALOG_ENABLED) && defined(LIBXML_OUTPUT_ENABLED)
5698     int mem_base;
5699     xmlCatalogPtr catal; /* a Catalog */
5700     int n_catal;
5701     FILE * out; /* the file. */
5702     int n_out;
5703 
5704     for (n_catal = 0;n_catal < gen_nb_xmlCatalogPtr;n_catal++) {
5705     for (n_out = 0;n_out < gen_nb_FILE_ptr;n_out++) {
5706         mem_base = xmlMemBlocks();
5707         catal = gen_xmlCatalogPtr(n_catal, 0);
5708         out = gen_FILE_ptr(n_out, 1);
5709 
5710         xmlACatalogDump(catal, out);
5711         call_tests++;
5712         des_xmlCatalogPtr(n_catal, catal, 0);
5713         des_FILE_ptr(n_out, out, 1);
5714         xmlResetLastError();
5715         if (mem_base != xmlMemBlocks()) {
5716             printf("Leak of %d blocks found in xmlACatalogDump",
5717 	           xmlMemBlocks() - mem_base);
5718 	    test_ret++;
5719             printf(" %d", n_catal);
5720             printf(" %d", n_out);
5721             printf("\n");
5722         }
5723     }
5724     }
5725     function_tests++;
5726 #endif
5727 
5728     return(test_ret);
5729 }
5730 
5731 
5732 static int
test_xmlACatalogRemove(void)5733 test_xmlACatalogRemove(void) {
5734     int test_ret = 0;
5735 
5736 #if defined(LIBXML_CATALOG_ENABLED)
5737     int mem_base;
5738     int ret_val;
5739     xmlCatalogPtr catal; /* a Catalog */
5740     int n_catal;
5741     const xmlChar * value; /* the value to remove */
5742     int n_value;
5743 
5744     for (n_catal = 0;n_catal < gen_nb_xmlCatalogPtr;n_catal++) {
5745     for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
5746         mem_base = xmlMemBlocks();
5747         catal = gen_xmlCatalogPtr(n_catal, 0);
5748         value = gen_const_xmlChar_ptr(n_value, 1);
5749 
5750         ret_val = xmlACatalogRemove(catal, value);
5751         desret_int(ret_val);
5752         call_tests++;
5753         des_xmlCatalogPtr(n_catal, catal, 0);
5754         des_const_xmlChar_ptr(n_value, value, 1);
5755         xmlResetLastError();
5756         if (mem_base != xmlMemBlocks()) {
5757             printf("Leak of %d blocks found in xmlACatalogRemove",
5758 	           xmlMemBlocks() - mem_base);
5759 	    test_ret++;
5760             printf(" %d", n_catal);
5761             printf(" %d", n_value);
5762             printf("\n");
5763         }
5764     }
5765     }
5766     function_tests++;
5767 #endif
5768 
5769     return(test_ret);
5770 }
5771 
5772 
5773 static int
test_xmlACatalogResolve(void)5774 test_xmlACatalogResolve(void) {
5775     int test_ret = 0;
5776 
5777 #if defined(LIBXML_CATALOG_ENABLED)
5778     int mem_base;
5779     xmlChar * ret_val;
5780     xmlCatalogPtr catal; /* a Catalog */
5781     int n_catal;
5782     const xmlChar * pubID; /* the public ID string */
5783     int n_pubID;
5784     const xmlChar * sysID; /* the system ID string */
5785     int n_sysID;
5786 
5787     for (n_catal = 0;n_catal < gen_nb_xmlCatalogPtr;n_catal++) {
5788     for (n_pubID = 0;n_pubID < gen_nb_const_xmlChar_ptr;n_pubID++) {
5789     for (n_sysID = 0;n_sysID < gen_nb_const_xmlChar_ptr;n_sysID++) {
5790         mem_base = xmlMemBlocks();
5791         catal = gen_xmlCatalogPtr(n_catal, 0);
5792         pubID = gen_const_xmlChar_ptr(n_pubID, 1);
5793         sysID = gen_const_xmlChar_ptr(n_sysID, 2);
5794 
5795         ret_val = xmlACatalogResolve(catal, pubID, sysID);
5796         desret_xmlChar_ptr(ret_val);
5797         call_tests++;
5798         des_xmlCatalogPtr(n_catal, catal, 0);
5799         des_const_xmlChar_ptr(n_pubID, pubID, 1);
5800         des_const_xmlChar_ptr(n_sysID, sysID, 2);
5801         xmlResetLastError();
5802         if (mem_base != xmlMemBlocks()) {
5803             printf("Leak of %d blocks found in xmlACatalogResolve",
5804 	           xmlMemBlocks() - mem_base);
5805 	    test_ret++;
5806             printf(" %d", n_catal);
5807             printf(" %d", n_pubID);
5808             printf(" %d", n_sysID);
5809             printf("\n");
5810         }
5811     }
5812     }
5813     }
5814     function_tests++;
5815 #endif
5816 
5817     return(test_ret);
5818 }
5819 
5820 
5821 static int
test_xmlACatalogResolvePublic(void)5822 test_xmlACatalogResolvePublic(void) {
5823     int test_ret = 0;
5824 
5825 #if defined(LIBXML_CATALOG_ENABLED)
5826     int mem_base;
5827     xmlChar * ret_val;
5828     xmlCatalogPtr catal; /* a Catalog */
5829     int n_catal;
5830     const xmlChar * pubID; /* the public ID string */
5831     int n_pubID;
5832 
5833     for (n_catal = 0;n_catal < gen_nb_xmlCatalogPtr;n_catal++) {
5834     for (n_pubID = 0;n_pubID < gen_nb_const_xmlChar_ptr;n_pubID++) {
5835         mem_base = xmlMemBlocks();
5836         catal = gen_xmlCatalogPtr(n_catal, 0);
5837         pubID = gen_const_xmlChar_ptr(n_pubID, 1);
5838 
5839         ret_val = xmlACatalogResolvePublic(catal, pubID);
5840         desret_xmlChar_ptr(ret_val);
5841         call_tests++;
5842         des_xmlCatalogPtr(n_catal, catal, 0);
5843         des_const_xmlChar_ptr(n_pubID, pubID, 1);
5844         xmlResetLastError();
5845         if (mem_base != xmlMemBlocks()) {
5846             printf("Leak of %d blocks found in xmlACatalogResolvePublic",
5847 	           xmlMemBlocks() - mem_base);
5848 	    test_ret++;
5849             printf(" %d", n_catal);
5850             printf(" %d", n_pubID);
5851             printf("\n");
5852         }
5853     }
5854     }
5855     function_tests++;
5856 #endif
5857 
5858     return(test_ret);
5859 }
5860 
5861 
5862 static int
test_xmlACatalogResolveSystem(void)5863 test_xmlACatalogResolveSystem(void) {
5864     int test_ret = 0;
5865 
5866 #if defined(LIBXML_CATALOG_ENABLED)
5867     int mem_base;
5868     xmlChar * ret_val;
5869     xmlCatalogPtr catal; /* a Catalog */
5870     int n_catal;
5871     const xmlChar * sysID; /* the system ID string */
5872     int n_sysID;
5873 
5874     for (n_catal = 0;n_catal < gen_nb_xmlCatalogPtr;n_catal++) {
5875     for (n_sysID = 0;n_sysID < gen_nb_const_xmlChar_ptr;n_sysID++) {
5876         mem_base = xmlMemBlocks();
5877         catal = gen_xmlCatalogPtr(n_catal, 0);
5878         sysID = gen_const_xmlChar_ptr(n_sysID, 1);
5879 
5880         ret_val = xmlACatalogResolveSystem(catal, sysID);
5881         desret_xmlChar_ptr(ret_val);
5882         call_tests++;
5883         des_xmlCatalogPtr(n_catal, catal, 0);
5884         des_const_xmlChar_ptr(n_sysID, sysID, 1);
5885         xmlResetLastError();
5886         if (mem_base != xmlMemBlocks()) {
5887             printf("Leak of %d blocks found in xmlACatalogResolveSystem",
5888 	           xmlMemBlocks() - mem_base);
5889 	    test_ret++;
5890             printf(" %d", n_catal);
5891             printf(" %d", n_sysID);
5892             printf("\n");
5893         }
5894     }
5895     }
5896     function_tests++;
5897 #endif
5898 
5899     return(test_ret);
5900 }
5901 
5902 
5903 static int
test_xmlACatalogResolveURI(void)5904 test_xmlACatalogResolveURI(void) {
5905     int test_ret = 0;
5906 
5907 #if defined(LIBXML_CATALOG_ENABLED)
5908     int mem_base;
5909     xmlChar * ret_val;
5910     xmlCatalogPtr catal; /* a Catalog */
5911     int n_catal;
5912     const xmlChar * URI; /* the URI */
5913     int n_URI;
5914 
5915     for (n_catal = 0;n_catal < gen_nb_xmlCatalogPtr;n_catal++) {
5916     for (n_URI = 0;n_URI < gen_nb_const_xmlChar_ptr;n_URI++) {
5917         mem_base = xmlMemBlocks();
5918         catal = gen_xmlCatalogPtr(n_catal, 0);
5919         URI = gen_const_xmlChar_ptr(n_URI, 1);
5920 
5921         ret_val = xmlACatalogResolveURI(catal, URI);
5922         desret_xmlChar_ptr(ret_val);
5923         call_tests++;
5924         des_xmlCatalogPtr(n_catal, catal, 0);
5925         des_const_xmlChar_ptr(n_URI, URI, 1);
5926         xmlResetLastError();
5927         if (mem_base != xmlMemBlocks()) {
5928             printf("Leak of %d blocks found in xmlACatalogResolveURI",
5929 	           xmlMemBlocks() - mem_base);
5930 	    test_ret++;
5931             printf(" %d", n_catal);
5932             printf(" %d", n_URI);
5933             printf("\n");
5934         }
5935     }
5936     }
5937     function_tests++;
5938 #endif
5939 
5940     return(test_ret);
5941 }
5942 
5943 
5944 static int
test_xmlCatalogAdd(void)5945 test_xmlCatalogAdd(void) {
5946     int test_ret = 0;
5947 
5948 #if defined(LIBXML_CATALOG_ENABLED)
5949     int mem_base;
5950     int ret_val;
5951     const xmlChar * type; /* the type of record to add to the catalog */
5952     int n_type;
5953     const xmlChar * orig; /* the system, public or prefix to match */
5954     int n_orig;
5955     const xmlChar * replace; /* the replacement value for the match */
5956     int n_replace;
5957 
5958     for (n_type = 0;n_type < gen_nb_const_xmlChar_ptr;n_type++) {
5959     for (n_orig = 0;n_orig < gen_nb_const_xmlChar_ptr;n_orig++) {
5960     for (n_replace = 0;n_replace < gen_nb_const_xmlChar_ptr;n_replace++) {
5961         mem_base = xmlMemBlocks();
5962         type = gen_const_xmlChar_ptr(n_type, 0);
5963         orig = gen_const_xmlChar_ptr(n_orig, 1);
5964         replace = gen_const_xmlChar_ptr(n_replace, 2);
5965 
5966         ret_val = xmlCatalogAdd(type, orig, replace);
5967         desret_int(ret_val);
5968         call_tests++;
5969         des_const_xmlChar_ptr(n_type, type, 0);
5970         des_const_xmlChar_ptr(n_orig, orig, 1);
5971         des_const_xmlChar_ptr(n_replace, replace, 2);
5972         xmlResetLastError();
5973         if (mem_base != xmlMemBlocks()) {
5974             printf("Leak of %d blocks found in xmlCatalogAdd",
5975 	           xmlMemBlocks() - mem_base);
5976 	    test_ret++;
5977             printf(" %d", n_type);
5978             printf(" %d", n_orig);
5979             printf(" %d", n_replace);
5980             printf("\n");
5981         }
5982     }
5983     }
5984     }
5985     function_tests++;
5986 #endif
5987 
5988     return(test_ret);
5989 }
5990 
5991 
5992 static int
test_xmlCatalogCleanup(void)5993 test_xmlCatalogCleanup(void) {
5994     int test_ret = 0;
5995 
5996 #if defined(LIBXML_CATALOG_ENABLED)
5997 
5998 
5999         xmlCatalogCleanup();
6000         call_tests++;
6001         xmlResetLastError();
6002     function_tests++;
6003 #endif
6004 
6005     return(test_ret);
6006 }
6007 
6008 
6009 static int
test_xmlCatalogConvert(void)6010 test_xmlCatalogConvert(void) {
6011     int test_ret = 0;
6012 
6013 #if defined(LIBXML_CATALOG_ENABLED)
6014     int ret_val;
6015 
6016 
6017         ret_val = xmlCatalogConvert();
6018         desret_int(ret_val);
6019         call_tests++;
6020         xmlResetLastError();
6021     function_tests++;
6022 #endif
6023 
6024     return(test_ret);
6025 }
6026 
6027 
6028 static int
test_xmlCatalogDump(void)6029 test_xmlCatalogDump(void) {
6030     int test_ret = 0;
6031 
6032 #if defined(LIBXML_CATALOG_ENABLED) && defined(LIBXML_OUTPUT_ENABLED)
6033     int mem_base;
6034     FILE * out; /* the file. */
6035     int n_out;
6036 
6037     for (n_out = 0;n_out < gen_nb_FILE_ptr;n_out++) {
6038         mem_base = xmlMemBlocks();
6039         out = gen_FILE_ptr(n_out, 0);
6040 
6041         xmlCatalogDump(out);
6042         call_tests++;
6043         des_FILE_ptr(n_out, out, 0);
6044         xmlResetLastError();
6045         if (mem_base != xmlMemBlocks()) {
6046             printf("Leak of %d blocks found in xmlCatalogDump",
6047 	           xmlMemBlocks() - mem_base);
6048 	    test_ret++;
6049             printf(" %d", n_out);
6050             printf("\n");
6051         }
6052     }
6053     function_tests++;
6054 #endif
6055 
6056     return(test_ret);
6057 }
6058 
6059 
6060 static int
test_xmlCatalogGetDefaults(void)6061 test_xmlCatalogGetDefaults(void) {
6062     int test_ret = 0;
6063 
6064 #if defined(LIBXML_CATALOG_ENABLED)
6065     int mem_base;
6066     xmlCatalogAllow ret_val;
6067 
6068         mem_base = xmlMemBlocks();
6069 
6070         ret_val = xmlCatalogGetDefaults();
6071         desret_xmlCatalogAllow(ret_val);
6072         call_tests++;
6073         xmlResetLastError();
6074         if (mem_base != xmlMemBlocks()) {
6075             printf("Leak of %d blocks found in xmlCatalogGetDefaults",
6076 	           xmlMemBlocks() - mem_base);
6077 	    test_ret++;
6078             printf("\n");
6079         }
6080     function_tests++;
6081 #endif
6082 
6083     return(test_ret);
6084 }
6085 
6086 
6087 static int
test_xmlCatalogIsEmpty(void)6088 test_xmlCatalogIsEmpty(void) {
6089     int test_ret = 0;
6090 
6091 #if defined(LIBXML_CATALOG_ENABLED)
6092     int mem_base;
6093     int ret_val;
6094     xmlCatalogPtr catal; /* should this create an SGML catalog */
6095     int n_catal;
6096 
6097     for (n_catal = 0;n_catal < gen_nb_xmlCatalogPtr;n_catal++) {
6098         mem_base = xmlMemBlocks();
6099         catal = gen_xmlCatalogPtr(n_catal, 0);
6100 
6101         ret_val = xmlCatalogIsEmpty(catal);
6102         desret_int(ret_val);
6103         call_tests++;
6104         des_xmlCatalogPtr(n_catal, catal, 0);
6105         xmlResetLastError();
6106         if (mem_base != xmlMemBlocks()) {
6107             printf("Leak of %d blocks found in xmlCatalogIsEmpty",
6108 	           xmlMemBlocks() - mem_base);
6109 	    test_ret++;
6110             printf(" %d", n_catal);
6111             printf("\n");
6112         }
6113     }
6114     function_tests++;
6115 #endif
6116 
6117     return(test_ret);
6118 }
6119 
6120 
6121 static int
test_xmlCatalogLocalResolve(void)6122 test_xmlCatalogLocalResolve(void) {
6123     int test_ret = 0;
6124 
6125 #if defined(LIBXML_CATALOG_ENABLED)
6126     int mem_base;
6127     xmlChar * ret_val;
6128     void * catalogs; /* a document's list of catalogs */
6129     int n_catalogs;
6130     const xmlChar * pubID; /* the public ID string */
6131     int n_pubID;
6132     const xmlChar * sysID; /* the system ID string */
6133     int n_sysID;
6134 
6135     for (n_catalogs = 0;n_catalogs < gen_nb_void_ptr;n_catalogs++) {
6136     for (n_pubID = 0;n_pubID < gen_nb_const_xmlChar_ptr;n_pubID++) {
6137     for (n_sysID = 0;n_sysID < gen_nb_const_xmlChar_ptr;n_sysID++) {
6138         mem_base = xmlMemBlocks();
6139         catalogs = gen_void_ptr(n_catalogs, 0);
6140         pubID = gen_const_xmlChar_ptr(n_pubID, 1);
6141         sysID = gen_const_xmlChar_ptr(n_sysID, 2);
6142 
6143         ret_val = xmlCatalogLocalResolve(catalogs, pubID, sysID);
6144         desret_xmlChar_ptr(ret_val);
6145         call_tests++;
6146         des_void_ptr(n_catalogs, catalogs, 0);
6147         des_const_xmlChar_ptr(n_pubID, pubID, 1);
6148         des_const_xmlChar_ptr(n_sysID, sysID, 2);
6149         xmlResetLastError();
6150         if (mem_base != xmlMemBlocks()) {
6151             printf("Leak of %d blocks found in xmlCatalogLocalResolve",
6152 	           xmlMemBlocks() - mem_base);
6153 	    test_ret++;
6154             printf(" %d", n_catalogs);
6155             printf(" %d", n_pubID);
6156             printf(" %d", n_sysID);
6157             printf("\n");
6158         }
6159     }
6160     }
6161     }
6162     function_tests++;
6163 #endif
6164 
6165     return(test_ret);
6166 }
6167 
6168 
6169 static int
test_xmlCatalogLocalResolveURI(void)6170 test_xmlCatalogLocalResolveURI(void) {
6171     int test_ret = 0;
6172 
6173 #if defined(LIBXML_CATALOG_ENABLED)
6174     int mem_base;
6175     xmlChar * ret_val;
6176     void * catalogs; /* a document's list of catalogs */
6177     int n_catalogs;
6178     const xmlChar * URI; /* the URI */
6179     int n_URI;
6180 
6181     for (n_catalogs = 0;n_catalogs < gen_nb_void_ptr;n_catalogs++) {
6182     for (n_URI = 0;n_URI < gen_nb_const_xmlChar_ptr;n_URI++) {
6183         mem_base = xmlMemBlocks();
6184         catalogs = gen_void_ptr(n_catalogs, 0);
6185         URI = gen_const_xmlChar_ptr(n_URI, 1);
6186 
6187         ret_val = xmlCatalogLocalResolveURI(catalogs, URI);
6188         desret_xmlChar_ptr(ret_val);
6189         call_tests++;
6190         des_void_ptr(n_catalogs, catalogs, 0);
6191         des_const_xmlChar_ptr(n_URI, URI, 1);
6192         xmlResetLastError();
6193         if (mem_base != xmlMemBlocks()) {
6194             printf("Leak of %d blocks found in xmlCatalogLocalResolveURI",
6195 	           xmlMemBlocks() - mem_base);
6196 	    test_ret++;
6197             printf(" %d", n_catalogs);
6198             printf(" %d", n_URI);
6199             printf("\n");
6200         }
6201     }
6202     }
6203     function_tests++;
6204 #endif
6205 
6206     return(test_ret);
6207 }
6208 
6209 
6210 static int
test_xmlCatalogRemove(void)6211 test_xmlCatalogRemove(void) {
6212     int test_ret = 0;
6213 
6214 #if defined(LIBXML_CATALOG_ENABLED)
6215     int ret_val;
6216     const xmlChar * value; /* the value to remove */
6217     int n_value;
6218 
6219     for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
6220         value = gen_const_xmlChar_ptr(n_value, 0);
6221 
6222         ret_val = xmlCatalogRemove(value);
6223         desret_int(ret_val);
6224         call_tests++;
6225         des_const_xmlChar_ptr(n_value, value, 0);
6226         xmlResetLastError();
6227     }
6228     function_tests++;
6229 #endif
6230 
6231     return(test_ret);
6232 }
6233 
6234 
6235 static int
test_xmlCatalogResolve(void)6236 test_xmlCatalogResolve(void) {
6237     int test_ret = 0;
6238 
6239 #if defined(LIBXML_CATALOG_ENABLED)
6240     xmlChar * ret_val;
6241     const xmlChar * pubID; /* the public ID string */
6242     int n_pubID;
6243     const xmlChar * sysID; /* the system ID string */
6244     int n_sysID;
6245 
6246     for (n_pubID = 0;n_pubID < gen_nb_const_xmlChar_ptr;n_pubID++) {
6247     for (n_sysID = 0;n_sysID < gen_nb_const_xmlChar_ptr;n_sysID++) {
6248         pubID = gen_const_xmlChar_ptr(n_pubID, 0);
6249         sysID = gen_const_xmlChar_ptr(n_sysID, 1);
6250 
6251         ret_val = xmlCatalogResolve(pubID, sysID);
6252         desret_xmlChar_ptr(ret_val);
6253         call_tests++;
6254         des_const_xmlChar_ptr(n_pubID, pubID, 0);
6255         des_const_xmlChar_ptr(n_sysID, sysID, 1);
6256         xmlResetLastError();
6257     }
6258     }
6259     function_tests++;
6260 #endif
6261 
6262     return(test_ret);
6263 }
6264 
6265 
6266 static int
test_xmlCatalogResolvePublic(void)6267 test_xmlCatalogResolvePublic(void) {
6268     int test_ret = 0;
6269 
6270 #if defined(LIBXML_CATALOG_ENABLED)
6271     int mem_base;
6272     xmlChar * ret_val;
6273     const xmlChar * pubID; /* the public ID string */
6274     int n_pubID;
6275 
6276     for (n_pubID = 0;n_pubID < gen_nb_const_xmlChar_ptr;n_pubID++) {
6277         mem_base = xmlMemBlocks();
6278         pubID = gen_const_xmlChar_ptr(n_pubID, 0);
6279 
6280         ret_val = xmlCatalogResolvePublic(pubID);
6281         desret_xmlChar_ptr(ret_val);
6282         call_tests++;
6283         des_const_xmlChar_ptr(n_pubID, pubID, 0);
6284         xmlResetLastError();
6285         if (mem_base != xmlMemBlocks()) {
6286             printf("Leak of %d blocks found in xmlCatalogResolvePublic",
6287 	           xmlMemBlocks() - mem_base);
6288 	    test_ret++;
6289             printf(" %d", n_pubID);
6290             printf("\n");
6291         }
6292     }
6293     function_tests++;
6294 #endif
6295 
6296     return(test_ret);
6297 }
6298 
6299 
6300 static int
test_xmlCatalogResolveSystem(void)6301 test_xmlCatalogResolveSystem(void) {
6302     int test_ret = 0;
6303 
6304 #if defined(LIBXML_CATALOG_ENABLED)
6305     int mem_base;
6306     xmlChar * ret_val;
6307     const xmlChar * sysID; /* the system ID string */
6308     int n_sysID;
6309 
6310     for (n_sysID = 0;n_sysID < gen_nb_const_xmlChar_ptr;n_sysID++) {
6311         mem_base = xmlMemBlocks();
6312         sysID = gen_const_xmlChar_ptr(n_sysID, 0);
6313 
6314         ret_val = xmlCatalogResolveSystem(sysID);
6315         desret_xmlChar_ptr(ret_val);
6316         call_tests++;
6317         des_const_xmlChar_ptr(n_sysID, sysID, 0);
6318         xmlResetLastError();
6319         if (mem_base != xmlMemBlocks()) {
6320             printf("Leak of %d blocks found in xmlCatalogResolveSystem",
6321 	           xmlMemBlocks() - mem_base);
6322 	    test_ret++;
6323             printf(" %d", n_sysID);
6324             printf("\n");
6325         }
6326     }
6327     function_tests++;
6328 #endif
6329 
6330     return(test_ret);
6331 }
6332 
6333 
6334 static int
test_xmlCatalogResolveURI(void)6335 test_xmlCatalogResolveURI(void) {
6336     int test_ret = 0;
6337 
6338 #if defined(LIBXML_CATALOG_ENABLED)
6339     int mem_base;
6340     xmlChar * ret_val;
6341     const xmlChar * URI; /* the URI */
6342     int n_URI;
6343 
6344     for (n_URI = 0;n_URI < gen_nb_const_xmlChar_ptr;n_URI++) {
6345         mem_base = xmlMemBlocks();
6346         URI = gen_const_xmlChar_ptr(n_URI, 0);
6347 
6348         ret_val = xmlCatalogResolveURI(URI);
6349         desret_xmlChar_ptr(ret_val);
6350         call_tests++;
6351         des_const_xmlChar_ptr(n_URI, URI, 0);
6352         xmlResetLastError();
6353         if (mem_base != xmlMemBlocks()) {
6354             printf("Leak of %d blocks found in xmlCatalogResolveURI",
6355 	           xmlMemBlocks() - mem_base);
6356 	    test_ret++;
6357             printf(" %d", n_URI);
6358             printf("\n");
6359         }
6360     }
6361     function_tests++;
6362 #endif
6363 
6364     return(test_ret);
6365 }
6366 
6367 
6368 static int
test_xmlCatalogSetDefaultPrefer(void)6369 test_xmlCatalogSetDefaultPrefer(void) {
6370     int test_ret = 0;
6371 
6372 #if defined(LIBXML_CATALOG_ENABLED)
6373     int mem_base;
6374     xmlCatalogPrefer ret_val;
6375     xmlCatalogPrefer prefer; /* the default preference for delegation */
6376     int n_prefer;
6377 
6378     for (n_prefer = 0;n_prefer < gen_nb_xmlCatalogPrefer;n_prefer++) {
6379         mem_base = xmlMemBlocks();
6380         prefer = gen_xmlCatalogPrefer(n_prefer, 0);
6381 
6382         ret_val = xmlCatalogSetDefaultPrefer(prefer);
6383         desret_xmlCatalogPrefer(ret_val);
6384         call_tests++;
6385         des_xmlCatalogPrefer(n_prefer, prefer, 0);
6386         xmlResetLastError();
6387         if (mem_base != xmlMemBlocks()) {
6388             printf("Leak of %d blocks found in xmlCatalogSetDefaultPrefer",
6389 	           xmlMemBlocks() - mem_base);
6390 	    test_ret++;
6391             printf(" %d", n_prefer);
6392             printf("\n");
6393         }
6394     }
6395     function_tests++;
6396 #endif
6397 
6398     return(test_ret);
6399 }
6400 
6401 
6402 static int
test_xmlCatalogSetDefaults(void)6403 test_xmlCatalogSetDefaults(void) {
6404     int test_ret = 0;
6405 
6406 #if defined(LIBXML_CATALOG_ENABLED)
6407     int mem_base;
6408     xmlCatalogAllow allow; /* what catalogs should be accepted */
6409     int n_allow;
6410 
6411     for (n_allow = 0;n_allow < gen_nb_xmlCatalogAllow;n_allow++) {
6412         mem_base = xmlMemBlocks();
6413         allow = gen_xmlCatalogAllow(n_allow, 0);
6414 
6415         xmlCatalogSetDefaults(allow);
6416         call_tests++;
6417         des_xmlCatalogAllow(n_allow, allow, 0);
6418         xmlResetLastError();
6419         if (mem_base != xmlMemBlocks()) {
6420             printf("Leak of %d blocks found in xmlCatalogSetDefaults",
6421 	           xmlMemBlocks() - mem_base);
6422 	    test_ret++;
6423             printf(" %d", n_allow);
6424             printf("\n");
6425         }
6426     }
6427     function_tests++;
6428 #endif
6429 
6430     return(test_ret);
6431 }
6432 
6433 
6434 static int
test_xmlConvertSGMLCatalog(void)6435 test_xmlConvertSGMLCatalog(void) {
6436     int test_ret = 0;
6437 
6438 #if defined(LIBXML_CATALOG_ENABLED)
6439     int mem_base;
6440     int ret_val;
6441     xmlCatalogPtr catal; /* the catalog */
6442     int n_catal;
6443 
6444     for (n_catal = 0;n_catal < gen_nb_xmlCatalogPtr;n_catal++) {
6445         mem_base = xmlMemBlocks();
6446         catal = gen_xmlCatalogPtr(n_catal, 0);
6447 
6448         ret_val = xmlConvertSGMLCatalog(catal);
6449         desret_int(ret_val);
6450         call_tests++;
6451         des_xmlCatalogPtr(n_catal, catal, 0);
6452         xmlResetLastError();
6453         if (mem_base != xmlMemBlocks()) {
6454             printf("Leak of %d blocks found in xmlConvertSGMLCatalog",
6455 	           xmlMemBlocks() - mem_base);
6456 	    test_ret++;
6457             printf(" %d", n_catal);
6458             printf("\n");
6459         }
6460     }
6461     function_tests++;
6462 #endif
6463 
6464     return(test_ret);
6465 }
6466 
6467 
6468 static int
test_xmlInitializeCatalog(void)6469 test_xmlInitializeCatalog(void) {
6470     int test_ret = 0;
6471 
6472 #if defined(LIBXML_CATALOG_ENABLED)
6473     int mem_base;
6474 
6475         mem_base = xmlMemBlocks();
6476 
6477         xmlInitializeCatalog();
6478         call_tests++;
6479         xmlResetLastError();
6480         if (mem_base != xmlMemBlocks()) {
6481             printf("Leak of %d blocks found in xmlInitializeCatalog",
6482 	           xmlMemBlocks() - mem_base);
6483 	    test_ret++;
6484             printf("\n");
6485         }
6486     function_tests++;
6487 #endif
6488 
6489     return(test_ret);
6490 }
6491 
6492 
6493 static int
test_xmlLoadACatalog(void)6494 test_xmlLoadACatalog(void) {
6495     int test_ret = 0;
6496 
6497 
6498     /* missing type support */
6499     return(test_ret);
6500 }
6501 
6502 
6503 static int
test_xmlLoadCatalog(void)6504 test_xmlLoadCatalog(void) {
6505     int test_ret = 0;
6506 
6507 #if defined(LIBXML_CATALOG_ENABLED)
6508     int ret_val;
6509     const char * filename; /* a file path */
6510     int n_filename;
6511 
6512     for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
6513         filename = gen_filepath(n_filename, 0);
6514 
6515         ret_val = xmlLoadCatalog(filename);
6516         desret_int(ret_val);
6517         call_tests++;
6518         des_filepath(n_filename, filename, 0);
6519         xmlResetLastError();
6520     }
6521     function_tests++;
6522 #endif
6523 
6524     return(test_ret);
6525 }
6526 
6527 
6528 static int
test_xmlLoadCatalogs(void)6529 test_xmlLoadCatalogs(void) {
6530     int test_ret = 0;
6531 
6532 #if defined(LIBXML_CATALOG_ENABLED)
6533     const char * pathss; /* a list of directories separated by a colon or a space. */
6534     int n_pathss;
6535 
6536     for (n_pathss = 0;n_pathss < gen_nb_const_char_ptr;n_pathss++) {
6537         pathss = gen_const_char_ptr(n_pathss, 0);
6538 
6539         xmlLoadCatalogs(pathss);
6540         call_tests++;
6541         des_const_char_ptr(n_pathss, pathss, 0);
6542         xmlResetLastError();
6543     }
6544     function_tests++;
6545 #endif
6546 
6547     return(test_ret);
6548 }
6549 
6550 
6551 static int
test_xmlLoadSGMLSuperCatalog(void)6552 test_xmlLoadSGMLSuperCatalog(void) {
6553     int test_ret = 0;
6554 
6555 
6556     /* missing type support */
6557     return(test_ret);
6558 }
6559 
6560 
6561 static int
test_xmlNewCatalog(void)6562 test_xmlNewCatalog(void) {
6563     int test_ret = 0;
6564 
6565 
6566     /* missing type support */
6567     return(test_ret);
6568 }
6569 
6570 
6571 static int
test_xmlParseCatalogFile(void)6572 test_xmlParseCatalogFile(void) {
6573     int test_ret = 0;
6574 
6575 #if defined(LIBXML_CATALOG_ENABLED)
6576     int mem_base;
6577     xmlDocPtr ret_val;
6578     const char * filename; /* the filename */
6579     int n_filename;
6580 
6581     for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
6582         mem_base = xmlMemBlocks();
6583         filename = gen_filepath(n_filename, 0);
6584 
6585         ret_val = xmlParseCatalogFile(filename);
6586         desret_xmlDocPtr(ret_val);
6587         call_tests++;
6588         des_filepath(n_filename, filename, 0);
6589         xmlResetLastError();
6590         if (mem_base != xmlMemBlocks()) {
6591             printf("Leak of %d blocks found in xmlParseCatalogFile",
6592 	           xmlMemBlocks() - mem_base);
6593 	    test_ret++;
6594             printf(" %d", n_filename);
6595             printf("\n");
6596         }
6597     }
6598     function_tests++;
6599 #endif
6600 
6601     return(test_ret);
6602 }
6603 
6604 static int
test_catalog(void)6605 test_catalog(void) {
6606     int test_ret = 0;
6607 
6608     if (quiet == 0) printf("Testing catalog : 27 of 36 functions ...\n");
6609     test_ret += test_xmlACatalogAdd();
6610     test_ret += test_xmlACatalogDump();
6611     test_ret += test_xmlACatalogRemove();
6612     test_ret += test_xmlACatalogResolve();
6613     test_ret += test_xmlACatalogResolvePublic();
6614     test_ret += test_xmlACatalogResolveSystem();
6615     test_ret += test_xmlACatalogResolveURI();
6616     test_ret += test_xmlCatalogAdd();
6617     test_ret += test_xmlCatalogCleanup();
6618     test_ret += test_xmlCatalogConvert();
6619     test_ret += test_xmlCatalogDump();
6620     test_ret += test_xmlCatalogGetDefaults();
6621     test_ret += test_xmlCatalogIsEmpty();
6622     test_ret += test_xmlCatalogLocalResolve();
6623     test_ret += test_xmlCatalogLocalResolveURI();
6624     test_ret += test_xmlCatalogRemove();
6625     test_ret += test_xmlCatalogResolve();
6626     test_ret += test_xmlCatalogResolvePublic();
6627     test_ret += test_xmlCatalogResolveSystem();
6628     test_ret += test_xmlCatalogResolveURI();
6629     test_ret += test_xmlCatalogSetDefaultPrefer();
6630     test_ret += test_xmlCatalogSetDefaults();
6631     test_ret += test_xmlConvertSGMLCatalog();
6632     test_ret += test_xmlInitializeCatalog();
6633     test_ret += test_xmlLoadACatalog();
6634     test_ret += test_xmlLoadCatalog();
6635     test_ret += test_xmlLoadCatalogs();
6636     test_ret += test_xmlLoadSGMLSuperCatalog();
6637     test_ret += test_xmlNewCatalog();
6638     test_ret += test_xmlParseCatalogFile();
6639 
6640     if (test_ret != 0)
6641 	printf("Module catalog: %d errors\n", test_ret);
6642     return(test_ret);
6643 }
6644 
6645 #define gen_nb_const_xmlChRangeGroup_ptr 1
6646 #define gen_const_xmlChRangeGroup_ptr(no, nr) NULL
6647 #define des_const_xmlChRangeGroup_ptr(no, val, nr)
6648 
6649 static int
test_xmlCharInRange(void)6650 test_xmlCharInRange(void) {
6651     int test_ret = 0;
6652 
6653     int mem_base;
6654     int ret_val;
6655     unsigned int val; /* character to be validated */
6656     int n_val;
6657     const xmlChRangeGroup * rptr; /* pointer to range to be used to validate */
6658     int n_rptr;
6659 
6660     for (n_val = 0;n_val < gen_nb_unsigned_int;n_val++) {
6661     for (n_rptr = 0;n_rptr < gen_nb_const_xmlChRangeGroup_ptr;n_rptr++) {
6662         mem_base = xmlMemBlocks();
6663         val = gen_unsigned_int(n_val, 0);
6664         rptr = gen_const_xmlChRangeGroup_ptr(n_rptr, 1);
6665 
6666         ret_val = xmlCharInRange(val, rptr);
6667         desret_int(ret_val);
6668         call_tests++;
6669         des_unsigned_int(n_val, val, 0);
6670         des_const_xmlChRangeGroup_ptr(n_rptr, rptr, 1);
6671         xmlResetLastError();
6672         if (mem_base != xmlMemBlocks()) {
6673             printf("Leak of %d blocks found in xmlCharInRange",
6674 	           xmlMemBlocks() - mem_base);
6675 	    test_ret++;
6676             printf(" %d", n_val);
6677             printf(" %d", n_rptr);
6678             printf("\n");
6679         }
6680     }
6681     }
6682     function_tests++;
6683 
6684     return(test_ret);
6685 }
6686 
6687 
6688 static int
test_xmlIsBaseChar(void)6689 test_xmlIsBaseChar(void) {
6690     int test_ret = 0;
6691 
6692     int mem_base;
6693     int ret_val;
6694     unsigned int ch; /* character to validate */
6695     int n_ch;
6696 
6697     for (n_ch = 0;n_ch < gen_nb_unsigned_int;n_ch++) {
6698         mem_base = xmlMemBlocks();
6699         ch = gen_unsigned_int(n_ch, 0);
6700 
6701         ret_val = xmlIsBaseChar(ch);
6702         desret_int(ret_val);
6703         call_tests++;
6704         des_unsigned_int(n_ch, ch, 0);
6705         xmlResetLastError();
6706         if (mem_base != xmlMemBlocks()) {
6707             printf("Leak of %d blocks found in xmlIsBaseChar",
6708 	           xmlMemBlocks() - mem_base);
6709 	    test_ret++;
6710             printf(" %d", n_ch);
6711             printf("\n");
6712         }
6713     }
6714     function_tests++;
6715 
6716     return(test_ret);
6717 }
6718 
6719 
6720 static int
test_xmlIsBlank(void)6721 test_xmlIsBlank(void) {
6722     int test_ret = 0;
6723 
6724     int mem_base;
6725     int ret_val;
6726     unsigned int ch; /* character to validate */
6727     int n_ch;
6728 
6729     for (n_ch = 0;n_ch < gen_nb_unsigned_int;n_ch++) {
6730         mem_base = xmlMemBlocks();
6731         ch = gen_unsigned_int(n_ch, 0);
6732 
6733         ret_val = xmlIsBlank(ch);
6734         desret_int(ret_val);
6735         call_tests++;
6736         des_unsigned_int(n_ch, ch, 0);
6737         xmlResetLastError();
6738         if (mem_base != xmlMemBlocks()) {
6739             printf("Leak of %d blocks found in xmlIsBlank",
6740 	           xmlMemBlocks() - mem_base);
6741 	    test_ret++;
6742             printf(" %d", n_ch);
6743             printf("\n");
6744         }
6745     }
6746     function_tests++;
6747 
6748     return(test_ret);
6749 }
6750 
6751 
6752 static int
test_xmlIsChar(void)6753 test_xmlIsChar(void) {
6754     int test_ret = 0;
6755 
6756     int mem_base;
6757     int ret_val;
6758     unsigned int ch; /* character to validate */
6759     int n_ch;
6760 
6761     for (n_ch = 0;n_ch < gen_nb_unsigned_int;n_ch++) {
6762         mem_base = xmlMemBlocks();
6763         ch = gen_unsigned_int(n_ch, 0);
6764 
6765         ret_val = xmlIsChar(ch);
6766         desret_int(ret_val);
6767         call_tests++;
6768         des_unsigned_int(n_ch, ch, 0);
6769         xmlResetLastError();
6770         if (mem_base != xmlMemBlocks()) {
6771             printf("Leak of %d blocks found in xmlIsChar",
6772 	           xmlMemBlocks() - mem_base);
6773 	    test_ret++;
6774             printf(" %d", n_ch);
6775             printf("\n");
6776         }
6777     }
6778     function_tests++;
6779 
6780     return(test_ret);
6781 }
6782 
6783 
6784 static int
test_xmlIsCombining(void)6785 test_xmlIsCombining(void) {
6786     int test_ret = 0;
6787 
6788     int mem_base;
6789     int ret_val;
6790     unsigned int ch; /* character to validate */
6791     int n_ch;
6792 
6793     for (n_ch = 0;n_ch < gen_nb_unsigned_int;n_ch++) {
6794         mem_base = xmlMemBlocks();
6795         ch = gen_unsigned_int(n_ch, 0);
6796 
6797         ret_val = xmlIsCombining(ch);
6798         desret_int(ret_val);
6799         call_tests++;
6800         des_unsigned_int(n_ch, ch, 0);
6801         xmlResetLastError();
6802         if (mem_base != xmlMemBlocks()) {
6803             printf("Leak of %d blocks found in xmlIsCombining",
6804 	           xmlMemBlocks() - mem_base);
6805 	    test_ret++;
6806             printf(" %d", n_ch);
6807             printf("\n");
6808         }
6809     }
6810     function_tests++;
6811 
6812     return(test_ret);
6813 }
6814 
6815 
6816 static int
test_xmlIsDigit(void)6817 test_xmlIsDigit(void) {
6818     int test_ret = 0;
6819 
6820     int mem_base;
6821     int ret_val;
6822     unsigned int ch; /* character to validate */
6823     int n_ch;
6824 
6825     for (n_ch = 0;n_ch < gen_nb_unsigned_int;n_ch++) {
6826         mem_base = xmlMemBlocks();
6827         ch = gen_unsigned_int(n_ch, 0);
6828 
6829         ret_val = xmlIsDigit(ch);
6830         desret_int(ret_val);
6831         call_tests++;
6832         des_unsigned_int(n_ch, ch, 0);
6833         xmlResetLastError();
6834         if (mem_base != xmlMemBlocks()) {
6835             printf("Leak of %d blocks found in xmlIsDigit",
6836 	           xmlMemBlocks() - mem_base);
6837 	    test_ret++;
6838             printf(" %d", n_ch);
6839             printf("\n");
6840         }
6841     }
6842     function_tests++;
6843 
6844     return(test_ret);
6845 }
6846 
6847 
6848 static int
test_xmlIsExtender(void)6849 test_xmlIsExtender(void) {
6850     int test_ret = 0;
6851 
6852     int mem_base;
6853     int ret_val;
6854     unsigned int ch; /* character to validate */
6855     int n_ch;
6856 
6857     for (n_ch = 0;n_ch < gen_nb_unsigned_int;n_ch++) {
6858         mem_base = xmlMemBlocks();
6859         ch = gen_unsigned_int(n_ch, 0);
6860 
6861         ret_val = xmlIsExtender(ch);
6862         desret_int(ret_val);
6863         call_tests++;
6864         des_unsigned_int(n_ch, ch, 0);
6865         xmlResetLastError();
6866         if (mem_base != xmlMemBlocks()) {
6867             printf("Leak of %d blocks found in xmlIsExtender",
6868 	           xmlMemBlocks() - mem_base);
6869 	    test_ret++;
6870             printf(" %d", n_ch);
6871             printf("\n");
6872         }
6873     }
6874     function_tests++;
6875 
6876     return(test_ret);
6877 }
6878 
6879 
6880 static int
test_xmlIsIdeographic(void)6881 test_xmlIsIdeographic(void) {
6882     int test_ret = 0;
6883 
6884     int mem_base;
6885     int ret_val;
6886     unsigned int ch; /* character to validate */
6887     int n_ch;
6888 
6889     for (n_ch = 0;n_ch < gen_nb_unsigned_int;n_ch++) {
6890         mem_base = xmlMemBlocks();
6891         ch = gen_unsigned_int(n_ch, 0);
6892 
6893         ret_val = xmlIsIdeographic(ch);
6894         desret_int(ret_val);
6895         call_tests++;
6896         des_unsigned_int(n_ch, ch, 0);
6897         xmlResetLastError();
6898         if (mem_base != xmlMemBlocks()) {
6899             printf("Leak of %d blocks found in xmlIsIdeographic",
6900 	           xmlMemBlocks() - mem_base);
6901 	    test_ret++;
6902             printf(" %d", n_ch);
6903             printf("\n");
6904         }
6905     }
6906     function_tests++;
6907 
6908     return(test_ret);
6909 }
6910 
6911 
6912 static int
test_xmlIsPubidChar(void)6913 test_xmlIsPubidChar(void) {
6914     int test_ret = 0;
6915 
6916     int mem_base;
6917     int ret_val;
6918     unsigned int ch; /* character to validate */
6919     int n_ch;
6920 
6921     for (n_ch = 0;n_ch < gen_nb_unsigned_int;n_ch++) {
6922         mem_base = xmlMemBlocks();
6923         ch = gen_unsigned_int(n_ch, 0);
6924 
6925         ret_val = xmlIsPubidChar(ch);
6926         desret_int(ret_val);
6927         call_tests++;
6928         des_unsigned_int(n_ch, ch, 0);
6929         xmlResetLastError();
6930         if (mem_base != xmlMemBlocks()) {
6931             printf("Leak of %d blocks found in xmlIsPubidChar",
6932 	           xmlMemBlocks() - mem_base);
6933 	    test_ret++;
6934             printf(" %d", n_ch);
6935             printf("\n");
6936         }
6937     }
6938     function_tests++;
6939 
6940     return(test_ret);
6941 }
6942 
6943 static int
test_chvalid(void)6944 test_chvalid(void) {
6945     int test_ret = 0;
6946 
6947     if (quiet == 0) printf("Testing chvalid : 9 of 9 functions ...\n");
6948     test_ret += test_xmlCharInRange();
6949     test_ret += test_xmlIsBaseChar();
6950     test_ret += test_xmlIsBlank();
6951     test_ret += test_xmlIsChar();
6952     test_ret += test_xmlIsCombining();
6953     test_ret += test_xmlIsDigit();
6954     test_ret += test_xmlIsExtender();
6955     test_ret += test_xmlIsIdeographic();
6956     test_ret += test_xmlIsPubidChar();
6957 
6958     if (test_ret != 0)
6959 	printf("Module chvalid: %d errors\n", test_ret);
6960     return(test_ret);
6961 }
6962 
6963 static int
test_xmlBoolToText(void)6964 test_xmlBoolToText(void) {
6965     int test_ret = 0;
6966 
6967 #if defined(LIBXML_DEBUG_ENABLED)
6968     int mem_base;
6969     const char * ret_val;
6970     int boolval; /* a bool to turn into text */
6971     int n_boolval;
6972 
6973     for (n_boolval = 0;n_boolval < gen_nb_int;n_boolval++) {
6974         mem_base = xmlMemBlocks();
6975         boolval = gen_int(n_boolval, 0);
6976 
6977         ret_val = xmlBoolToText(boolval);
6978         desret_const_char_ptr(ret_val);
6979         call_tests++;
6980         des_int(n_boolval, boolval, 0);
6981         xmlResetLastError();
6982         if (mem_base != xmlMemBlocks()) {
6983             printf("Leak of %d blocks found in xmlBoolToText",
6984 	           xmlMemBlocks() - mem_base);
6985 	    test_ret++;
6986             printf(" %d", n_boolval);
6987             printf("\n");
6988         }
6989     }
6990     function_tests++;
6991 #endif
6992 
6993     return(test_ret);
6994 }
6995 
6996 
6997 static int
test_xmlDebugCheckDocument(void)6998 test_xmlDebugCheckDocument(void) {
6999     int test_ret = 0;
7000 
7001 #if defined(LIBXML_DEBUG_ENABLED)
7002     int mem_base;
7003     int ret_val;
7004     FILE * output; /* the FILE * for the output */
7005     int n_output;
7006     xmlDocPtr doc; /* the document */
7007     int n_doc;
7008 
7009     for (n_output = 0;n_output < gen_nb_debug_FILE_ptr;n_output++) {
7010     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
7011         mem_base = xmlMemBlocks();
7012         output = gen_debug_FILE_ptr(n_output, 0);
7013         doc = gen_xmlDocPtr(n_doc, 1);
7014 
7015         ret_val = xmlDebugCheckDocument(output, doc);
7016         desret_int(ret_val);
7017         call_tests++;
7018         des_debug_FILE_ptr(n_output, output, 0);
7019         des_xmlDocPtr(n_doc, doc, 1);
7020         xmlResetLastError();
7021         if (mem_base != xmlMemBlocks()) {
7022             printf("Leak of %d blocks found in xmlDebugCheckDocument",
7023 	           xmlMemBlocks() - mem_base);
7024 	    test_ret++;
7025             printf(" %d", n_output);
7026             printf(" %d", n_doc);
7027             printf("\n");
7028         }
7029     }
7030     }
7031     function_tests++;
7032 #endif
7033 
7034     return(test_ret);
7035 }
7036 
7037 
7038 static int
test_xmlDebugDumpAttr(void)7039 test_xmlDebugDumpAttr(void) {
7040     int test_ret = 0;
7041 
7042 #if defined(LIBXML_DEBUG_ENABLED)
7043     int mem_base;
7044     FILE * output; /* the FILE * for the output */
7045     int n_output;
7046     xmlAttrPtr attr; /* the attribute */
7047     int n_attr;
7048     int depth; /* the indentation level. */
7049     int n_depth;
7050 
7051     for (n_output = 0;n_output < gen_nb_debug_FILE_ptr;n_output++) {
7052     for (n_attr = 0;n_attr < gen_nb_xmlAttrPtr;n_attr++) {
7053     for (n_depth = 0;n_depth < gen_nb_int;n_depth++) {
7054         mem_base = xmlMemBlocks();
7055         output = gen_debug_FILE_ptr(n_output, 0);
7056         attr = gen_xmlAttrPtr(n_attr, 1);
7057         depth = gen_int(n_depth, 2);
7058 
7059         xmlDebugDumpAttr(output, attr, depth);
7060         call_tests++;
7061         des_debug_FILE_ptr(n_output, output, 0);
7062         des_xmlAttrPtr(n_attr, attr, 1);
7063         des_int(n_depth, depth, 2);
7064         xmlResetLastError();
7065         if (mem_base != xmlMemBlocks()) {
7066             printf("Leak of %d blocks found in xmlDebugDumpAttr",
7067 	           xmlMemBlocks() - mem_base);
7068 	    test_ret++;
7069             printf(" %d", n_output);
7070             printf(" %d", n_attr);
7071             printf(" %d", n_depth);
7072             printf("\n");
7073         }
7074     }
7075     }
7076     }
7077     function_tests++;
7078 #endif
7079 
7080     return(test_ret);
7081 }
7082 
7083 
7084 static int
test_xmlDebugDumpAttrList(void)7085 test_xmlDebugDumpAttrList(void) {
7086     int test_ret = 0;
7087 
7088 #if defined(LIBXML_DEBUG_ENABLED)
7089     int mem_base;
7090     FILE * output; /* the FILE * for the output */
7091     int n_output;
7092     xmlAttrPtr attr; /* the attribute list */
7093     int n_attr;
7094     int depth; /* the indentation level. */
7095     int n_depth;
7096 
7097     for (n_output = 0;n_output < gen_nb_debug_FILE_ptr;n_output++) {
7098     for (n_attr = 0;n_attr < gen_nb_xmlAttrPtr;n_attr++) {
7099     for (n_depth = 0;n_depth < gen_nb_int;n_depth++) {
7100         mem_base = xmlMemBlocks();
7101         output = gen_debug_FILE_ptr(n_output, 0);
7102         attr = gen_xmlAttrPtr(n_attr, 1);
7103         depth = gen_int(n_depth, 2);
7104 
7105         xmlDebugDumpAttrList(output, attr, depth);
7106         call_tests++;
7107         des_debug_FILE_ptr(n_output, output, 0);
7108         des_xmlAttrPtr(n_attr, attr, 1);
7109         des_int(n_depth, depth, 2);
7110         xmlResetLastError();
7111         if (mem_base != xmlMemBlocks()) {
7112             printf("Leak of %d blocks found in xmlDebugDumpAttrList",
7113 	           xmlMemBlocks() - mem_base);
7114 	    test_ret++;
7115             printf(" %d", n_output);
7116             printf(" %d", n_attr);
7117             printf(" %d", n_depth);
7118             printf("\n");
7119         }
7120     }
7121     }
7122     }
7123     function_tests++;
7124 #endif
7125 
7126     return(test_ret);
7127 }
7128 
7129 
7130 static int
test_xmlDebugDumpDTD(void)7131 test_xmlDebugDumpDTD(void) {
7132     int test_ret = 0;
7133 
7134 #if defined(LIBXML_DEBUG_ENABLED)
7135     int mem_base;
7136     FILE * output; /* the FILE * for the output */
7137     int n_output;
7138     xmlDtdPtr dtd; /* the DTD */
7139     int n_dtd;
7140 
7141     for (n_output = 0;n_output < gen_nb_debug_FILE_ptr;n_output++) {
7142     for (n_dtd = 0;n_dtd < gen_nb_xmlDtdPtr;n_dtd++) {
7143         mem_base = xmlMemBlocks();
7144         output = gen_debug_FILE_ptr(n_output, 0);
7145         dtd = gen_xmlDtdPtr(n_dtd, 1);
7146 
7147         xmlDebugDumpDTD(output, dtd);
7148         call_tests++;
7149         des_debug_FILE_ptr(n_output, output, 0);
7150         des_xmlDtdPtr(n_dtd, dtd, 1);
7151         xmlResetLastError();
7152         if (mem_base != xmlMemBlocks()) {
7153             printf("Leak of %d blocks found in xmlDebugDumpDTD",
7154 	           xmlMemBlocks() - mem_base);
7155 	    test_ret++;
7156             printf(" %d", n_output);
7157             printf(" %d", n_dtd);
7158             printf("\n");
7159         }
7160     }
7161     }
7162     function_tests++;
7163 #endif
7164 
7165     return(test_ret);
7166 }
7167 
7168 
7169 static int
test_xmlDebugDumpDocument(void)7170 test_xmlDebugDumpDocument(void) {
7171     int test_ret = 0;
7172 
7173 #if defined(LIBXML_DEBUG_ENABLED)
7174     int mem_base;
7175     FILE * output; /* the FILE * for the output */
7176     int n_output;
7177     xmlDocPtr doc; /* the document */
7178     int n_doc;
7179 
7180     for (n_output = 0;n_output < gen_nb_debug_FILE_ptr;n_output++) {
7181     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
7182         mem_base = xmlMemBlocks();
7183         output = gen_debug_FILE_ptr(n_output, 0);
7184         doc = gen_xmlDocPtr(n_doc, 1);
7185 
7186         xmlDebugDumpDocument(output, doc);
7187         call_tests++;
7188         des_debug_FILE_ptr(n_output, output, 0);
7189         des_xmlDocPtr(n_doc, doc, 1);
7190         xmlResetLastError();
7191         if (mem_base != xmlMemBlocks()) {
7192             printf("Leak of %d blocks found in xmlDebugDumpDocument",
7193 	           xmlMemBlocks() - mem_base);
7194 	    test_ret++;
7195             printf(" %d", n_output);
7196             printf(" %d", n_doc);
7197             printf("\n");
7198         }
7199     }
7200     }
7201     function_tests++;
7202 #endif
7203 
7204     return(test_ret);
7205 }
7206 
7207 
7208 static int
test_xmlDebugDumpDocumentHead(void)7209 test_xmlDebugDumpDocumentHead(void) {
7210     int test_ret = 0;
7211 
7212 #if defined(LIBXML_DEBUG_ENABLED)
7213     int mem_base;
7214     FILE * output; /* the FILE * for the output */
7215     int n_output;
7216     xmlDocPtr doc; /* the document */
7217     int n_doc;
7218 
7219     for (n_output = 0;n_output < gen_nb_debug_FILE_ptr;n_output++) {
7220     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
7221         mem_base = xmlMemBlocks();
7222         output = gen_debug_FILE_ptr(n_output, 0);
7223         doc = gen_xmlDocPtr(n_doc, 1);
7224 
7225         xmlDebugDumpDocumentHead(output, doc);
7226         call_tests++;
7227         des_debug_FILE_ptr(n_output, output, 0);
7228         des_xmlDocPtr(n_doc, doc, 1);
7229         xmlResetLastError();
7230         if (mem_base != xmlMemBlocks()) {
7231             printf("Leak of %d blocks found in xmlDebugDumpDocumentHead",
7232 	           xmlMemBlocks() - mem_base);
7233 	    test_ret++;
7234             printf(" %d", n_output);
7235             printf(" %d", n_doc);
7236             printf("\n");
7237         }
7238     }
7239     }
7240     function_tests++;
7241 #endif
7242 
7243     return(test_ret);
7244 }
7245 
7246 
7247 static int
test_xmlDebugDumpEntities(void)7248 test_xmlDebugDumpEntities(void) {
7249     int test_ret = 0;
7250 
7251 #if defined(LIBXML_DEBUG_ENABLED)
7252     int mem_base;
7253     FILE * output; /* the FILE * for the output */
7254     int n_output;
7255     xmlDocPtr doc; /* the document */
7256     int n_doc;
7257 
7258     for (n_output = 0;n_output < gen_nb_debug_FILE_ptr;n_output++) {
7259     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
7260         mem_base = xmlMemBlocks();
7261         output = gen_debug_FILE_ptr(n_output, 0);
7262         doc = gen_xmlDocPtr(n_doc, 1);
7263 
7264         xmlDebugDumpEntities(output, doc);
7265         call_tests++;
7266         des_debug_FILE_ptr(n_output, output, 0);
7267         des_xmlDocPtr(n_doc, doc, 1);
7268         xmlResetLastError();
7269         if (mem_base != xmlMemBlocks()) {
7270             printf("Leak of %d blocks found in xmlDebugDumpEntities",
7271 	           xmlMemBlocks() - mem_base);
7272 	    test_ret++;
7273             printf(" %d", n_output);
7274             printf(" %d", n_doc);
7275             printf("\n");
7276         }
7277     }
7278     }
7279     function_tests++;
7280 #endif
7281 
7282     return(test_ret);
7283 }
7284 
7285 
7286 static int
test_xmlDebugDumpNode(void)7287 test_xmlDebugDumpNode(void) {
7288     int test_ret = 0;
7289 
7290 #if defined(LIBXML_DEBUG_ENABLED)
7291     int mem_base;
7292     FILE * output; /* the FILE * for the output */
7293     int n_output;
7294     xmlNodePtr node; /* the node */
7295     int n_node;
7296     int depth; /* the indentation level. */
7297     int n_depth;
7298 
7299     for (n_output = 0;n_output < gen_nb_debug_FILE_ptr;n_output++) {
7300     for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
7301     for (n_depth = 0;n_depth < gen_nb_int;n_depth++) {
7302         mem_base = xmlMemBlocks();
7303         output = gen_debug_FILE_ptr(n_output, 0);
7304         node = gen_xmlNodePtr(n_node, 1);
7305         depth = gen_int(n_depth, 2);
7306 
7307         xmlDebugDumpNode(output, node, depth);
7308         call_tests++;
7309         des_debug_FILE_ptr(n_output, output, 0);
7310         des_xmlNodePtr(n_node, node, 1);
7311         des_int(n_depth, depth, 2);
7312         xmlResetLastError();
7313         if (mem_base != xmlMemBlocks()) {
7314             printf("Leak of %d blocks found in xmlDebugDumpNode",
7315 	           xmlMemBlocks() - mem_base);
7316 	    test_ret++;
7317             printf(" %d", n_output);
7318             printf(" %d", n_node);
7319             printf(" %d", n_depth);
7320             printf("\n");
7321         }
7322     }
7323     }
7324     }
7325     function_tests++;
7326 #endif
7327 
7328     return(test_ret);
7329 }
7330 
7331 
7332 static int
test_xmlDebugDumpNodeList(void)7333 test_xmlDebugDumpNodeList(void) {
7334     int test_ret = 0;
7335 
7336 #if defined(LIBXML_DEBUG_ENABLED)
7337     int mem_base;
7338     FILE * output; /* the FILE * for the output */
7339     int n_output;
7340     xmlNodePtr node; /* the node list */
7341     int n_node;
7342     int depth; /* the indentation level. */
7343     int n_depth;
7344 
7345     for (n_output = 0;n_output < gen_nb_debug_FILE_ptr;n_output++) {
7346     for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
7347     for (n_depth = 0;n_depth < gen_nb_int;n_depth++) {
7348         mem_base = xmlMemBlocks();
7349         output = gen_debug_FILE_ptr(n_output, 0);
7350         node = gen_xmlNodePtr(n_node, 1);
7351         depth = gen_int(n_depth, 2);
7352 
7353         xmlDebugDumpNodeList(output, node, depth);
7354         call_tests++;
7355         des_debug_FILE_ptr(n_output, output, 0);
7356         des_xmlNodePtr(n_node, node, 1);
7357         des_int(n_depth, depth, 2);
7358         xmlResetLastError();
7359         if (mem_base != xmlMemBlocks()) {
7360             printf("Leak of %d blocks found in xmlDebugDumpNodeList",
7361 	           xmlMemBlocks() - mem_base);
7362 	    test_ret++;
7363             printf(" %d", n_output);
7364             printf(" %d", n_node);
7365             printf(" %d", n_depth);
7366             printf("\n");
7367         }
7368     }
7369     }
7370     }
7371     function_tests++;
7372 #endif
7373 
7374     return(test_ret);
7375 }
7376 
7377 
7378 static int
test_xmlDebugDumpOneNode(void)7379 test_xmlDebugDumpOneNode(void) {
7380     int test_ret = 0;
7381 
7382 #if defined(LIBXML_DEBUG_ENABLED)
7383     int mem_base;
7384     FILE * output; /* the FILE * for the output */
7385     int n_output;
7386     xmlNodePtr node; /* the node */
7387     int n_node;
7388     int depth; /* the indentation level. */
7389     int n_depth;
7390 
7391     for (n_output = 0;n_output < gen_nb_debug_FILE_ptr;n_output++) {
7392     for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
7393     for (n_depth = 0;n_depth < gen_nb_int;n_depth++) {
7394         mem_base = xmlMemBlocks();
7395         output = gen_debug_FILE_ptr(n_output, 0);
7396         node = gen_xmlNodePtr(n_node, 1);
7397         depth = gen_int(n_depth, 2);
7398 
7399         xmlDebugDumpOneNode(output, node, depth);
7400         call_tests++;
7401         des_debug_FILE_ptr(n_output, output, 0);
7402         des_xmlNodePtr(n_node, node, 1);
7403         des_int(n_depth, depth, 2);
7404         xmlResetLastError();
7405         if (mem_base != xmlMemBlocks()) {
7406             printf("Leak of %d blocks found in xmlDebugDumpOneNode",
7407 	           xmlMemBlocks() - mem_base);
7408 	    test_ret++;
7409             printf(" %d", n_output);
7410             printf(" %d", n_node);
7411             printf(" %d", n_depth);
7412             printf("\n");
7413         }
7414     }
7415     }
7416     }
7417     function_tests++;
7418 #endif
7419 
7420     return(test_ret);
7421 }
7422 
7423 
7424 static int
test_xmlDebugDumpString(void)7425 test_xmlDebugDumpString(void) {
7426     int test_ret = 0;
7427 
7428 #if defined(LIBXML_DEBUG_ENABLED)
7429     int mem_base;
7430     FILE * output; /* the FILE * for the output */
7431     int n_output;
7432     const xmlChar * str; /* the string */
7433     int n_str;
7434 
7435     for (n_output = 0;n_output < gen_nb_debug_FILE_ptr;n_output++) {
7436     for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) {
7437         mem_base = xmlMemBlocks();
7438         output = gen_debug_FILE_ptr(n_output, 0);
7439         str = gen_const_xmlChar_ptr(n_str, 1);
7440 
7441         xmlDebugDumpString(output, str);
7442         call_tests++;
7443         des_debug_FILE_ptr(n_output, output, 0);
7444         des_const_xmlChar_ptr(n_str, str, 1);
7445         xmlResetLastError();
7446         if (mem_base != xmlMemBlocks()) {
7447             printf("Leak of %d blocks found in xmlDebugDumpString",
7448 	           xmlMemBlocks() - mem_base);
7449 	    test_ret++;
7450             printf(" %d", n_output);
7451             printf(" %d", n_str);
7452             printf("\n");
7453         }
7454     }
7455     }
7456     function_tests++;
7457 #endif
7458 
7459     return(test_ret);
7460 }
7461 
7462 
7463 static int
test_xmlLsCountNode(void)7464 test_xmlLsCountNode(void) {
7465     int test_ret = 0;
7466 
7467 #if defined(LIBXML_DEBUG_ENABLED)
7468     int mem_base;
7469     int ret_val;
7470     xmlNodePtr node; /* the node to count */
7471     int n_node;
7472 
7473     for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
7474         mem_base = xmlMemBlocks();
7475         node = gen_xmlNodePtr(n_node, 0);
7476 
7477         ret_val = xmlLsCountNode(node);
7478         desret_int(ret_val);
7479         call_tests++;
7480         des_xmlNodePtr(n_node, node, 0);
7481         xmlResetLastError();
7482         if (mem_base != xmlMemBlocks()) {
7483             printf("Leak of %d blocks found in xmlLsCountNode",
7484 	           xmlMemBlocks() - mem_base);
7485 	    test_ret++;
7486             printf(" %d", n_node);
7487             printf("\n");
7488         }
7489     }
7490     function_tests++;
7491 #endif
7492 
7493     return(test_ret);
7494 }
7495 
7496 
7497 static int
test_xmlLsOneNode(void)7498 test_xmlLsOneNode(void) {
7499     int test_ret = 0;
7500 
7501 #if defined(LIBXML_DEBUG_ENABLED)
7502     int mem_base;
7503     FILE * output; /* the FILE * for the output */
7504     int n_output;
7505     xmlNodePtr node; /* the node to dump */
7506     int n_node;
7507 
7508     for (n_output = 0;n_output < gen_nb_debug_FILE_ptr;n_output++) {
7509     for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
7510         mem_base = xmlMemBlocks();
7511         output = gen_debug_FILE_ptr(n_output, 0);
7512         node = gen_xmlNodePtr(n_node, 1);
7513 
7514         xmlLsOneNode(output, node);
7515         call_tests++;
7516         des_debug_FILE_ptr(n_output, output, 0);
7517         des_xmlNodePtr(n_node, node, 1);
7518         xmlResetLastError();
7519         if (mem_base != xmlMemBlocks()) {
7520             printf("Leak of %d blocks found in xmlLsOneNode",
7521 	           xmlMemBlocks() - mem_base);
7522 	    test_ret++;
7523             printf(" %d", n_output);
7524             printf(" %d", n_node);
7525             printf("\n");
7526         }
7527     }
7528     }
7529     function_tests++;
7530 #endif
7531 
7532     return(test_ret);
7533 }
7534 
7535 
7536 static int
test_xmlShell(void)7537 test_xmlShell(void) {
7538     int test_ret = 0;
7539 
7540 
7541     /* missing type support */
7542     return(test_ret);
7543 }
7544 
7545 
7546 #define gen_nb_char_ptr 1
7547 #define gen_char_ptr(no, nr) NULL
7548 #define des_char_ptr(no, val, nr)
7549 
7550 static int
test_xmlShellBase(void)7551 test_xmlShellBase(void) {
7552     int test_ret = 0;
7553 
7554 #if defined(LIBXML_DEBUG_ENABLED) && defined(LIBXML_XPATH_ENABLED)
7555     int mem_base;
7556     int ret_val;
7557     xmlShellCtxtPtr ctxt; /* the shell context */
7558     int n_ctxt;
7559     char * arg; /* unused */
7560     int n_arg;
7561     xmlNodePtr node; /* a node */
7562     int n_node;
7563     xmlNodePtr node2; /* unused */
7564     int n_node2;
7565 
7566     for (n_ctxt = 0;n_ctxt < gen_nb_xmlShellCtxtPtr;n_ctxt++) {
7567     for (n_arg = 0;n_arg < gen_nb_char_ptr;n_arg++) {
7568     for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
7569     for (n_node2 = 0;n_node2 < gen_nb_xmlNodePtr;n_node2++) {
7570         mem_base = xmlMemBlocks();
7571         ctxt = gen_xmlShellCtxtPtr(n_ctxt, 0);
7572         arg = gen_char_ptr(n_arg, 1);
7573         node = gen_xmlNodePtr(n_node, 2);
7574         node2 = gen_xmlNodePtr(n_node2, 3);
7575 
7576         ret_val = xmlShellBase(ctxt, arg, node, node2);
7577         desret_int(ret_val);
7578         call_tests++;
7579         des_xmlShellCtxtPtr(n_ctxt, ctxt, 0);
7580         des_char_ptr(n_arg, arg, 1);
7581         des_xmlNodePtr(n_node, node, 2);
7582         des_xmlNodePtr(n_node2, node2, 3);
7583         xmlResetLastError();
7584         if (mem_base != xmlMemBlocks()) {
7585             printf("Leak of %d blocks found in xmlShellBase",
7586 	           xmlMemBlocks() - mem_base);
7587 	    test_ret++;
7588             printf(" %d", n_ctxt);
7589             printf(" %d", n_arg);
7590             printf(" %d", n_node);
7591             printf(" %d", n_node2);
7592             printf("\n");
7593         }
7594     }
7595     }
7596     }
7597     }
7598     function_tests++;
7599 #endif
7600 
7601     return(test_ret);
7602 }
7603 
7604 
7605 static int
test_xmlShellCat(void)7606 test_xmlShellCat(void) {
7607     int test_ret = 0;
7608 
7609 #if defined(LIBXML_DEBUG_ENABLED) && defined(LIBXML_XPATH_ENABLED) && defined(LIBXML_OUTPUT_ENABLED)
7610     int mem_base;
7611     int ret_val;
7612     xmlShellCtxtPtr ctxt; /* the shell context */
7613     int n_ctxt;
7614     char * arg; /* unused */
7615     int n_arg;
7616     xmlNodePtr node; /* a node */
7617     int n_node;
7618     xmlNodePtr node2; /* unused */
7619     int n_node2;
7620 
7621     for (n_ctxt = 0;n_ctxt < gen_nb_xmlShellCtxtPtr;n_ctxt++) {
7622     for (n_arg = 0;n_arg < gen_nb_char_ptr;n_arg++) {
7623     for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
7624     for (n_node2 = 0;n_node2 < gen_nb_xmlNodePtr;n_node2++) {
7625         mem_base = xmlMemBlocks();
7626         ctxt = gen_xmlShellCtxtPtr(n_ctxt, 0);
7627         arg = gen_char_ptr(n_arg, 1);
7628         node = gen_xmlNodePtr(n_node, 2);
7629         node2 = gen_xmlNodePtr(n_node2, 3);
7630 
7631         ret_val = xmlShellCat(ctxt, arg, node, node2);
7632         desret_int(ret_val);
7633         call_tests++;
7634         des_xmlShellCtxtPtr(n_ctxt, ctxt, 0);
7635         des_char_ptr(n_arg, arg, 1);
7636         des_xmlNodePtr(n_node, node, 2);
7637         des_xmlNodePtr(n_node2, node2, 3);
7638         xmlResetLastError();
7639         if (mem_base != xmlMemBlocks()) {
7640             printf("Leak of %d blocks found in xmlShellCat",
7641 	           xmlMemBlocks() - mem_base);
7642 	    test_ret++;
7643             printf(" %d", n_ctxt);
7644             printf(" %d", n_arg);
7645             printf(" %d", n_node);
7646             printf(" %d", n_node2);
7647             printf("\n");
7648         }
7649     }
7650     }
7651     }
7652     }
7653     function_tests++;
7654 #endif
7655 
7656     return(test_ret);
7657 }
7658 
7659 
7660 static int
test_xmlShellDir(void)7661 test_xmlShellDir(void) {
7662     int test_ret = 0;
7663 
7664 #if defined(LIBXML_DEBUG_ENABLED) && defined(LIBXML_XPATH_ENABLED)
7665     int mem_base;
7666     int ret_val;
7667     xmlShellCtxtPtr ctxt; /* the shell context */
7668     int n_ctxt;
7669     char * arg; /* unused */
7670     int n_arg;
7671     xmlNodePtr node; /* a node */
7672     int n_node;
7673     xmlNodePtr node2; /* unused */
7674     int n_node2;
7675 
7676     for (n_ctxt = 0;n_ctxt < gen_nb_xmlShellCtxtPtr;n_ctxt++) {
7677     for (n_arg = 0;n_arg < gen_nb_char_ptr;n_arg++) {
7678     for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
7679     for (n_node2 = 0;n_node2 < gen_nb_xmlNodePtr;n_node2++) {
7680         mem_base = xmlMemBlocks();
7681         ctxt = gen_xmlShellCtxtPtr(n_ctxt, 0);
7682         arg = gen_char_ptr(n_arg, 1);
7683         node = gen_xmlNodePtr(n_node, 2);
7684         node2 = gen_xmlNodePtr(n_node2, 3);
7685 
7686         ret_val = xmlShellDir(ctxt, arg, node, node2);
7687         desret_int(ret_val);
7688         call_tests++;
7689         des_xmlShellCtxtPtr(n_ctxt, ctxt, 0);
7690         des_char_ptr(n_arg, arg, 1);
7691         des_xmlNodePtr(n_node, node, 2);
7692         des_xmlNodePtr(n_node2, node2, 3);
7693         xmlResetLastError();
7694         if (mem_base != xmlMemBlocks()) {
7695             printf("Leak of %d blocks found in xmlShellDir",
7696 	           xmlMemBlocks() - mem_base);
7697 	    test_ret++;
7698             printf(" %d", n_ctxt);
7699             printf(" %d", n_arg);
7700             printf(" %d", n_node);
7701             printf(" %d", n_node2);
7702             printf("\n");
7703         }
7704     }
7705     }
7706     }
7707     }
7708     function_tests++;
7709 #endif
7710 
7711     return(test_ret);
7712 }
7713 
7714 
7715 static int
test_xmlShellDu(void)7716 test_xmlShellDu(void) {
7717     int test_ret = 0;
7718 
7719 #if defined(LIBXML_DEBUG_ENABLED) && defined(LIBXML_XPATH_ENABLED)
7720     int mem_base;
7721     int ret_val;
7722     xmlShellCtxtPtr ctxt; /* the shell context */
7723     int n_ctxt;
7724     char * arg; /* unused */
7725     int n_arg;
7726     xmlNodePtr tree; /* a node defining a subtree */
7727     int n_tree;
7728     xmlNodePtr node2; /* unused */
7729     int n_node2;
7730 
7731     for (n_ctxt = 0;n_ctxt < gen_nb_xmlShellCtxtPtr;n_ctxt++) {
7732     for (n_arg = 0;n_arg < gen_nb_char_ptr;n_arg++) {
7733     for (n_tree = 0;n_tree < gen_nb_xmlNodePtr;n_tree++) {
7734     for (n_node2 = 0;n_node2 < gen_nb_xmlNodePtr;n_node2++) {
7735         mem_base = xmlMemBlocks();
7736         ctxt = gen_xmlShellCtxtPtr(n_ctxt, 0);
7737         arg = gen_char_ptr(n_arg, 1);
7738         tree = gen_xmlNodePtr(n_tree, 2);
7739         node2 = gen_xmlNodePtr(n_node2, 3);
7740 
7741         ret_val = xmlShellDu(ctxt, arg, tree, node2);
7742         desret_int(ret_val);
7743         call_tests++;
7744         des_xmlShellCtxtPtr(n_ctxt, ctxt, 0);
7745         des_char_ptr(n_arg, arg, 1);
7746         des_xmlNodePtr(n_tree, tree, 2);
7747         des_xmlNodePtr(n_node2, node2, 3);
7748         xmlResetLastError();
7749         if (mem_base != xmlMemBlocks()) {
7750             printf("Leak of %d blocks found in xmlShellDu",
7751 	           xmlMemBlocks() - mem_base);
7752 	    test_ret++;
7753             printf(" %d", n_ctxt);
7754             printf(" %d", n_arg);
7755             printf(" %d", n_tree);
7756             printf(" %d", n_node2);
7757             printf("\n");
7758         }
7759     }
7760     }
7761     }
7762     }
7763     function_tests++;
7764 #endif
7765 
7766     return(test_ret);
7767 }
7768 
7769 
7770 static int
test_xmlShellList(void)7771 test_xmlShellList(void) {
7772     int test_ret = 0;
7773 
7774 #if defined(LIBXML_DEBUG_ENABLED) && defined(LIBXML_XPATH_ENABLED)
7775     int mem_base;
7776     int ret_val;
7777     xmlShellCtxtPtr ctxt; /* the shell context */
7778     int n_ctxt;
7779     char * arg; /* unused */
7780     int n_arg;
7781     xmlNodePtr node; /* a node */
7782     int n_node;
7783     xmlNodePtr node2; /* unused */
7784     int n_node2;
7785 
7786     for (n_ctxt = 0;n_ctxt < gen_nb_xmlShellCtxtPtr;n_ctxt++) {
7787     for (n_arg = 0;n_arg < gen_nb_char_ptr;n_arg++) {
7788     for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
7789     for (n_node2 = 0;n_node2 < gen_nb_xmlNodePtr;n_node2++) {
7790         mem_base = xmlMemBlocks();
7791         ctxt = gen_xmlShellCtxtPtr(n_ctxt, 0);
7792         arg = gen_char_ptr(n_arg, 1);
7793         node = gen_xmlNodePtr(n_node, 2);
7794         node2 = gen_xmlNodePtr(n_node2, 3);
7795 
7796         ret_val = xmlShellList(ctxt, arg, node, node2);
7797         desret_int(ret_val);
7798         call_tests++;
7799         des_xmlShellCtxtPtr(n_ctxt, ctxt, 0);
7800         des_char_ptr(n_arg, arg, 1);
7801         des_xmlNodePtr(n_node, node, 2);
7802         des_xmlNodePtr(n_node2, node2, 3);
7803         xmlResetLastError();
7804         if (mem_base != xmlMemBlocks()) {
7805             printf("Leak of %d blocks found in xmlShellList",
7806 	           xmlMemBlocks() - mem_base);
7807 	    test_ret++;
7808             printf(" %d", n_ctxt);
7809             printf(" %d", n_arg);
7810             printf(" %d", n_node);
7811             printf(" %d", n_node2);
7812             printf("\n");
7813         }
7814     }
7815     }
7816     }
7817     }
7818     function_tests++;
7819 #endif
7820 
7821     return(test_ret);
7822 }
7823 
7824 
7825 static int
test_xmlShellLoad(void)7826 test_xmlShellLoad(void) {
7827     int test_ret = 0;
7828 
7829 #if defined(LIBXML_DEBUG_ENABLED) && defined(LIBXML_XPATH_ENABLED)
7830     int mem_base;
7831     int ret_val;
7832     xmlShellCtxtPtr ctxt; /* the shell context */
7833     int n_ctxt;
7834     char * filename; /* the file name */
7835     int n_filename;
7836     xmlNodePtr node; /* unused */
7837     int n_node;
7838     xmlNodePtr node2; /* unused */
7839     int n_node2;
7840 
7841     for (n_ctxt = 0;n_ctxt < gen_nb_xmlShellCtxtPtr;n_ctxt++) {
7842     for (n_filename = 0;n_filename < gen_nb_char_ptr;n_filename++) {
7843     for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
7844     for (n_node2 = 0;n_node2 < gen_nb_xmlNodePtr;n_node2++) {
7845         mem_base = xmlMemBlocks();
7846         ctxt = gen_xmlShellCtxtPtr(n_ctxt, 0);
7847         filename = gen_char_ptr(n_filename, 1);
7848         node = gen_xmlNodePtr(n_node, 2);
7849         node2 = gen_xmlNodePtr(n_node2, 3);
7850 
7851         ret_val = xmlShellLoad(ctxt, filename, node, node2);
7852         desret_int(ret_val);
7853         call_tests++;
7854         des_xmlShellCtxtPtr(n_ctxt, ctxt, 0);
7855         des_char_ptr(n_filename, filename, 1);
7856         des_xmlNodePtr(n_node, node, 2);
7857         des_xmlNodePtr(n_node2, node2, 3);
7858         xmlResetLastError();
7859         if (mem_base != xmlMemBlocks()) {
7860             printf("Leak of %d blocks found in xmlShellLoad",
7861 	           xmlMemBlocks() - mem_base);
7862 	    test_ret++;
7863             printf(" %d", n_ctxt);
7864             printf(" %d", n_filename);
7865             printf(" %d", n_node);
7866             printf(" %d", n_node2);
7867             printf("\n");
7868         }
7869     }
7870     }
7871     }
7872     }
7873     function_tests++;
7874 #endif
7875 
7876     return(test_ret);
7877 }
7878 
7879 
7880 static int
test_xmlShellPrintXPathResult(void)7881 test_xmlShellPrintXPathResult(void) {
7882     int test_ret = 0;
7883 
7884 #if defined(LIBXML_DEBUG_ENABLED) && defined(LIBXML_XPATH_ENABLED)
7885     int mem_base;
7886     xmlXPathObjectPtr list; /* a valid result generated by an xpath evaluation */
7887     int n_list;
7888 
7889     for (n_list = 0;n_list < gen_nb_xmlXPathObjectPtr;n_list++) {
7890         mem_base = xmlMemBlocks();
7891         list = gen_xmlXPathObjectPtr(n_list, 0);
7892 
7893         xmlShellPrintXPathResult(list);
7894         call_tests++;
7895         des_xmlXPathObjectPtr(n_list, list, 0);
7896         xmlResetLastError();
7897         if (mem_base != xmlMemBlocks()) {
7898             printf("Leak of %d blocks found in xmlShellPrintXPathResult",
7899 	           xmlMemBlocks() - mem_base);
7900 	    test_ret++;
7901             printf(" %d", n_list);
7902             printf("\n");
7903         }
7904     }
7905     function_tests++;
7906 #endif
7907 
7908     return(test_ret);
7909 }
7910 
7911 
7912 static int
test_xmlShellPwd(void)7913 test_xmlShellPwd(void) {
7914     int test_ret = 0;
7915 
7916 #if defined(LIBXML_DEBUG_ENABLED) && defined(LIBXML_XPATH_ENABLED)
7917     int mem_base;
7918     int ret_val;
7919     xmlShellCtxtPtr ctxt; /* the shell context */
7920     int n_ctxt;
7921     char * buffer; /* the output buffer */
7922     int n_buffer;
7923     xmlNodePtr node; /* a node */
7924     int n_node;
7925     xmlNodePtr node2; /* unused */
7926     int n_node2;
7927 
7928     for (n_ctxt = 0;n_ctxt < gen_nb_xmlShellCtxtPtr;n_ctxt++) {
7929     for (n_buffer = 0;n_buffer < gen_nb_char_ptr;n_buffer++) {
7930     for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
7931     for (n_node2 = 0;n_node2 < gen_nb_xmlNodePtr;n_node2++) {
7932         mem_base = xmlMemBlocks();
7933         ctxt = gen_xmlShellCtxtPtr(n_ctxt, 0);
7934         buffer = gen_char_ptr(n_buffer, 1);
7935         node = gen_xmlNodePtr(n_node, 2);
7936         node2 = gen_xmlNodePtr(n_node2, 3);
7937 
7938         ret_val = xmlShellPwd(ctxt, buffer, node, node2);
7939         desret_int(ret_val);
7940         call_tests++;
7941         des_xmlShellCtxtPtr(n_ctxt, ctxt, 0);
7942         des_char_ptr(n_buffer, buffer, 1);
7943         des_xmlNodePtr(n_node, node, 2);
7944         des_xmlNodePtr(n_node2, node2, 3);
7945         xmlResetLastError();
7946         if (mem_base != xmlMemBlocks()) {
7947             printf("Leak of %d blocks found in xmlShellPwd",
7948 	           xmlMemBlocks() - mem_base);
7949 	    test_ret++;
7950             printf(" %d", n_ctxt);
7951             printf(" %d", n_buffer);
7952             printf(" %d", n_node);
7953             printf(" %d", n_node2);
7954             printf("\n");
7955         }
7956     }
7957     }
7958     }
7959     }
7960     function_tests++;
7961 #endif
7962 
7963     return(test_ret);
7964 }
7965 
7966 
7967 static int
test_xmlShellSave(void)7968 test_xmlShellSave(void) {
7969     int test_ret = 0;
7970 
7971 #if defined(LIBXML_DEBUG_ENABLED) && defined(LIBXML_XPATH_ENABLED) && defined(LIBXML_OUTPUT_ENABLED)
7972     int mem_base;
7973     int ret_val;
7974     xmlShellCtxtPtr ctxt; /* the shell context */
7975     int n_ctxt;
7976     char * filename; /* the file name (optional) */
7977     int n_filename;
7978     xmlNodePtr node; /* unused */
7979     int n_node;
7980     xmlNodePtr node2; /* unused */
7981     int n_node2;
7982 
7983     for (n_ctxt = 0;n_ctxt < gen_nb_xmlShellCtxtPtr;n_ctxt++) {
7984     for (n_filename = 0;n_filename < gen_nb_char_ptr;n_filename++) {
7985     for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
7986     for (n_node2 = 0;n_node2 < gen_nb_xmlNodePtr;n_node2++) {
7987         mem_base = xmlMemBlocks();
7988         ctxt = gen_xmlShellCtxtPtr(n_ctxt, 0);
7989         filename = gen_char_ptr(n_filename, 1);
7990         node = gen_xmlNodePtr(n_node, 2);
7991         node2 = gen_xmlNodePtr(n_node2, 3);
7992 
7993         ret_val = xmlShellSave(ctxt, filename, node, node2);
7994         desret_int(ret_val);
7995         call_tests++;
7996         des_xmlShellCtxtPtr(n_ctxt, ctxt, 0);
7997         des_char_ptr(n_filename, filename, 1);
7998         des_xmlNodePtr(n_node, node, 2);
7999         des_xmlNodePtr(n_node2, node2, 3);
8000         xmlResetLastError();
8001         if (mem_base != xmlMemBlocks()) {
8002             printf("Leak of %d blocks found in xmlShellSave",
8003 	           xmlMemBlocks() - mem_base);
8004 	    test_ret++;
8005             printf(" %d", n_ctxt);
8006             printf(" %d", n_filename);
8007             printf(" %d", n_node);
8008             printf(" %d", n_node2);
8009             printf("\n");
8010         }
8011     }
8012     }
8013     }
8014     }
8015     function_tests++;
8016 #endif
8017 
8018     return(test_ret);
8019 }
8020 
8021 
8022 static int
test_xmlShellValidate(void)8023 test_xmlShellValidate(void) {
8024     int test_ret = 0;
8025 
8026 #if defined(LIBXML_DEBUG_ENABLED) && defined(LIBXML_XPATH_ENABLED) && defined(LIBXML_VALID_ENABLED)
8027     int mem_base;
8028     int ret_val;
8029     xmlShellCtxtPtr ctxt; /* the shell context */
8030     int n_ctxt;
8031     char * dtd; /* the DTD URI (optional) */
8032     int n_dtd;
8033     xmlNodePtr node; /* unused */
8034     int n_node;
8035     xmlNodePtr node2; /* unused */
8036     int n_node2;
8037 
8038     for (n_ctxt = 0;n_ctxt < gen_nb_xmlShellCtxtPtr;n_ctxt++) {
8039     for (n_dtd = 0;n_dtd < gen_nb_char_ptr;n_dtd++) {
8040     for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
8041     for (n_node2 = 0;n_node2 < gen_nb_xmlNodePtr;n_node2++) {
8042         mem_base = xmlMemBlocks();
8043         ctxt = gen_xmlShellCtxtPtr(n_ctxt, 0);
8044         dtd = gen_char_ptr(n_dtd, 1);
8045         node = gen_xmlNodePtr(n_node, 2);
8046         node2 = gen_xmlNodePtr(n_node2, 3);
8047 
8048         ret_val = xmlShellValidate(ctxt, dtd, node, node2);
8049         desret_int(ret_val);
8050         call_tests++;
8051         des_xmlShellCtxtPtr(n_ctxt, ctxt, 0);
8052         des_char_ptr(n_dtd, dtd, 1);
8053         des_xmlNodePtr(n_node, node, 2);
8054         des_xmlNodePtr(n_node2, node2, 3);
8055         xmlResetLastError();
8056         if (mem_base != xmlMemBlocks()) {
8057             printf("Leak of %d blocks found in xmlShellValidate",
8058 	           xmlMemBlocks() - mem_base);
8059 	    test_ret++;
8060             printf(" %d", n_ctxt);
8061             printf(" %d", n_dtd);
8062             printf(" %d", n_node);
8063             printf(" %d", n_node2);
8064             printf("\n");
8065         }
8066     }
8067     }
8068     }
8069     }
8070     function_tests++;
8071 #endif
8072 
8073     return(test_ret);
8074 }
8075 
8076 
8077 static int
test_xmlShellWrite(void)8078 test_xmlShellWrite(void) {
8079     int test_ret = 0;
8080 
8081 #if defined(LIBXML_DEBUG_ENABLED) && defined(LIBXML_XPATH_ENABLED) && defined(LIBXML_OUTPUT_ENABLED)
8082     int mem_base;
8083     int ret_val;
8084     xmlShellCtxtPtr ctxt; /* the shell context */
8085     int n_ctxt;
8086     char * filename; /* the file name */
8087     int n_filename;
8088     xmlNodePtr node; /* a node in the tree */
8089     int n_node;
8090     xmlNodePtr node2; /* unused */
8091     int n_node2;
8092 
8093     for (n_ctxt = 0;n_ctxt < gen_nb_xmlShellCtxtPtr;n_ctxt++) {
8094     for (n_filename = 0;n_filename < gen_nb_char_ptr;n_filename++) {
8095     for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
8096     for (n_node2 = 0;n_node2 < gen_nb_xmlNodePtr;n_node2++) {
8097         mem_base = xmlMemBlocks();
8098         ctxt = gen_xmlShellCtxtPtr(n_ctxt, 0);
8099         filename = gen_char_ptr(n_filename, 1);
8100         node = gen_xmlNodePtr(n_node, 2);
8101         node2 = gen_xmlNodePtr(n_node2, 3);
8102 
8103         ret_val = xmlShellWrite(ctxt, filename, node, node2);
8104         desret_int(ret_val);
8105         call_tests++;
8106         des_xmlShellCtxtPtr(n_ctxt, ctxt, 0);
8107         des_char_ptr(n_filename, filename, 1);
8108         des_xmlNodePtr(n_node, node, 2);
8109         des_xmlNodePtr(n_node2, node2, 3);
8110         xmlResetLastError();
8111         if (mem_base != xmlMemBlocks()) {
8112             printf("Leak of %d blocks found in xmlShellWrite",
8113 	           xmlMemBlocks() - mem_base);
8114 	    test_ret++;
8115             printf(" %d", n_ctxt);
8116             printf(" %d", n_filename);
8117             printf(" %d", n_node);
8118             printf(" %d", n_node2);
8119             printf("\n");
8120         }
8121     }
8122     }
8123     }
8124     }
8125     function_tests++;
8126 #endif
8127 
8128     return(test_ret);
8129 }
8130 
8131 static int
test_debugXML(void)8132 test_debugXML(void) {
8133     int test_ret = 0;
8134 
8135     if (quiet == 0) printf("Testing debugXML : 25 of 28 functions ...\n");
8136     test_ret += test_xmlBoolToText();
8137     test_ret += test_xmlDebugCheckDocument();
8138     test_ret += test_xmlDebugDumpAttr();
8139     test_ret += test_xmlDebugDumpAttrList();
8140     test_ret += test_xmlDebugDumpDTD();
8141     test_ret += test_xmlDebugDumpDocument();
8142     test_ret += test_xmlDebugDumpDocumentHead();
8143     test_ret += test_xmlDebugDumpEntities();
8144     test_ret += test_xmlDebugDumpNode();
8145     test_ret += test_xmlDebugDumpNodeList();
8146     test_ret += test_xmlDebugDumpOneNode();
8147     test_ret += test_xmlDebugDumpString();
8148     test_ret += test_xmlLsCountNode();
8149     test_ret += test_xmlLsOneNode();
8150     test_ret += test_xmlShell();
8151     test_ret += test_xmlShellBase();
8152     test_ret += test_xmlShellCat();
8153     test_ret += test_xmlShellDir();
8154     test_ret += test_xmlShellDu();
8155     test_ret += test_xmlShellList();
8156     test_ret += test_xmlShellLoad();
8157     test_ret += test_xmlShellPrintXPathResult();
8158     test_ret += test_xmlShellPwd();
8159     test_ret += test_xmlShellSave();
8160     test_ret += test_xmlShellValidate();
8161     test_ret += test_xmlShellWrite();
8162 
8163     if (test_ret != 0)
8164 	printf("Module debugXML: %d errors\n", test_ret);
8165     return(test_ret);
8166 }
8167 
8168 static int
test_xmlDictCleanup(void)8169 test_xmlDictCleanup(void) {
8170     int test_ret = 0;
8171 
8172     int mem_base;
8173 
8174         mem_base = xmlMemBlocks();
8175 
8176         xmlDictCleanup();
8177         call_tests++;
8178         xmlResetLastError();
8179         if (mem_base != xmlMemBlocks()) {
8180             printf("Leak of %d blocks found in xmlDictCleanup",
8181 	           xmlMemBlocks() - mem_base);
8182 	    test_ret++;
8183             printf("\n");
8184         }
8185     function_tests++;
8186 
8187     return(test_ret);
8188 }
8189 
8190 
8191 static int
test_xmlDictCreate(void)8192 test_xmlDictCreate(void) {
8193     int test_ret = 0;
8194 
8195     int mem_base;
8196     xmlDictPtr ret_val;
8197 
8198         mem_base = xmlMemBlocks();
8199 
8200         ret_val = xmlDictCreate();
8201         desret_xmlDictPtr(ret_val);
8202         call_tests++;
8203         xmlResetLastError();
8204         if (mem_base != xmlMemBlocks()) {
8205             printf("Leak of %d blocks found in xmlDictCreate",
8206 	           xmlMemBlocks() - mem_base);
8207 	    test_ret++;
8208             printf("\n");
8209         }
8210     function_tests++;
8211 
8212     return(test_ret);
8213 }
8214 
8215 
8216 static int
test_xmlDictCreateSub(void)8217 test_xmlDictCreateSub(void) {
8218     int test_ret = 0;
8219 
8220     int mem_base;
8221     xmlDictPtr ret_val;
8222     xmlDictPtr sub; /* an existing dictionary */
8223     int n_sub;
8224 
8225     for (n_sub = 0;n_sub < gen_nb_xmlDictPtr;n_sub++) {
8226         mem_base = xmlMemBlocks();
8227         sub = gen_xmlDictPtr(n_sub, 0);
8228 
8229         ret_val = xmlDictCreateSub(sub);
8230         desret_xmlDictPtr(ret_val);
8231         call_tests++;
8232         des_xmlDictPtr(n_sub, sub, 0);
8233         xmlResetLastError();
8234         if (mem_base != xmlMemBlocks()) {
8235             printf("Leak of %d blocks found in xmlDictCreateSub",
8236 	           xmlMemBlocks() - mem_base);
8237 	    test_ret++;
8238             printf(" %d", n_sub);
8239             printf("\n");
8240         }
8241     }
8242     function_tests++;
8243 
8244     return(test_ret);
8245 }
8246 
8247 
8248 static int
test_xmlDictExists(void)8249 test_xmlDictExists(void) {
8250     int test_ret = 0;
8251 
8252     int mem_base;
8253     const xmlChar * ret_val;
8254     xmlDictPtr dict; /* the dictionary */
8255     int n_dict;
8256     const xmlChar * name; /* the name of the userdata */
8257     int n_name;
8258     int len; /* the length of the name, if -1 it is recomputed */
8259     int n_len;
8260 
8261     for (n_dict = 0;n_dict < gen_nb_xmlDictPtr;n_dict++) {
8262     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
8263     for (n_len = 0;n_len < gen_nb_int;n_len++) {
8264         mem_base = xmlMemBlocks();
8265         dict = gen_xmlDictPtr(n_dict, 0);
8266         name = gen_const_xmlChar_ptr(n_name, 1);
8267         len = gen_int(n_len, 2);
8268         if ((name != NULL) &&
8269             (len > xmlStrlen(BAD_CAST name)))
8270             len = 0;
8271 
8272         ret_val = xmlDictExists(dict, name, len);
8273         desret_const_xmlChar_ptr(ret_val);
8274         call_tests++;
8275         des_xmlDictPtr(n_dict, dict, 0);
8276         des_const_xmlChar_ptr(n_name, name, 1);
8277         des_int(n_len, len, 2);
8278         xmlResetLastError();
8279         if (mem_base != xmlMemBlocks()) {
8280             printf("Leak of %d blocks found in xmlDictExists",
8281 	           xmlMemBlocks() - mem_base);
8282 	    test_ret++;
8283             printf(" %d", n_dict);
8284             printf(" %d", n_name);
8285             printf(" %d", n_len);
8286             printf("\n");
8287         }
8288     }
8289     }
8290     }
8291     function_tests++;
8292 
8293     return(test_ret);
8294 }
8295 
8296 
8297 static int
test_xmlDictGetUsage(void)8298 test_xmlDictGetUsage(void) {
8299     int test_ret = 0;
8300 
8301 
8302     /* missing type support */
8303     return(test_ret);
8304 }
8305 
8306 
8307 static int
test_xmlDictLookup(void)8308 test_xmlDictLookup(void) {
8309     int test_ret = 0;
8310 
8311     int mem_base;
8312     const xmlChar * ret_val;
8313     xmlDictPtr dict; /* dictionary */
8314     int n_dict;
8315     const xmlChar * name; /* string key */
8316     int n_name;
8317     int len; /* length of the key, if -1 it is recomputed */
8318     int n_len;
8319 
8320     for (n_dict = 0;n_dict < gen_nb_xmlDictPtr;n_dict++) {
8321     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
8322     for (n_len = 0;n_len < gen_nb_int;n_len++) {
8323         mem_base = xmlMemBlocks();
8324         dict = gen_xmlDictPtr(n_dict, 0);
8325         name = gen_const_xmlChar_ptr(n_name, 1);
8326         len = gen_int(n_len, 2);
8327         if ((name != NULL) &&
8328             (len > xmlStrlen(BAD_CAST name)))
8329             len = 0;
8330 
8331         ret_val = xmlDictLookup(dict, name, len);
8332         desret_const_xmlChar_ptr(ret_val);
8333         call_tests++;
8334         des_xmlDictPtr(n_dict, dict, 0);
8335         des_const_xmlChar_ptr(n_name, name, 1);
8336         des_int(n_len, len, 2);
8337         xmlResetLastError();
8338         if (mem_base != xmlMemBlocks()) {
8339             printf("Leak of %d blocks found in xmlDictLookup",
8340 	           xmlMemBlocks() - mem_base);
8341 	    test_ret++;
8342             printf(" %d", n_dict);
8343             printf(" %d", n_name);
8344             printf(" %d", n_len);
8345             printf("\n");
8346         }
8347     }
8348     }
8349     }
8350     function_tests++;
8351 
8352     return(test_ret);
8353 }
8354 
8355 
8356 static int
test_xmlDictOwns(void)8357 test_xmlDictOwns(void) {
8358     int test_ret = 0;
8359 
8360     int mem_base;
8361     int ret_val;
8362     xmlDictPtr dict; /* the dictionary */
8363     int n_dict;
8364     const xmlChar * str; /* the string */
8365     int n_str;
8366 
8367     for (n_dict = 0;n_dict < gen_nb_xmlDictPtr;n_dict++) {
8368     for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) {
8369         mem_base = xmlMemBlocks();
8370         dict = gen_xmlDictPtr(n_dict, 0);
8371         str = gen_const_xmlChar_ptr(n_str, 1);
8372 
8373         ret_val = xmlDictOwns(dict, str);
8374         desret_int(ret_val);
8375         call_tests++;
8376         des_xmlDictPtr(n_dict, dict, 0);
8377         des_const_xmlChar_ptr(n_str, str, 1);
8378         xmlResetLastError();
8379         if (mem_base != xmlMemBlocks()) {
8380             printf("Leak of %d blocks found in xmlDictOwns",
8381 	           xmlMemBlocks() - mem_base);
8382 	    test_ret++;
8383             printf(" %d", n_dict);
8384             printf(" %d", n_str);
8385             printf("\n");
8386         }
8387     }
8388     }
8389     function_tests++;
8390 
8391     return(test_ret);
8392 }
8393 
8394 
8395 static int
test_xmlDictQLookup(void)8396 test_xmlDictQLookup(void) {
8397     int test_ret = 0;
8398 
8399     int mem_base;
8400     const xmlChar * ret_val;
8401     xmlDictPtr dict; /* the dictionary */
8402     int n_dict;
8403     const xmlChar * prefix; /* the prefix */
8404     int n_prefix;
8405     const xmlChar * name; /* the name */
8406     int n_name;
8407 
8408     for (n_dict = 0;n_dict < gen_nb_xmlDictPtr;n_dict++) {
8409     for (n_prefix = 0;n_prefix < gen_nb_const_xmlChar_ptr;n_prefix++) {
8410     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
8411         mem_base = xmlMemBlocks();
8412         dict = gen_xmlDictPtr(n_dict, 0);
8413         prefix = gen_const_xmlChar_ptr(n_prefix, 1);
8414         name = gen_const_xmlChar_ptr(n_name, 2);
8415 
8416         ret_val = xmlDictQLookup(dict, prefix, name);
8417         desret_const_xmlChar_ptr(ret_val);
8418         call_tests++;
8419         des_xmlDictPtr(n_dict, dict, 0);
8420         des_const_xmlChar_ptr(n_prefix, prefix, 1);
8421         des_const_xmlChar_ptr(n_name, name, 2);
8422         xmlResetLastError();
8423         if (mem_base != xmlMemBlocks()) {
8424             printf("Leak of %d blocks found in xmlDictQLookup",
8425 	           xmlMemBlocks() - mem_base);
8426 	    test_ret++;
8427             printf(" %d", n_dict);
8428             printf(" %d", n_prefix);
8429             printf(" %d", n_name);
8430             printf("\n");
8431         }
8432     }
8433     }
8434     }
8435     function_tests++;
8436 
8437     return(test_ret);
8438 }
8439 
8440 
8441 static int
test_xmlDictReference(void)8442 test_xmlDictReference(void) {
8443     int test_ret = 0;
8444 
8445     int mem_base;
8446     int ret_val;
8447     xmlDictPtr dict; /* the dictionary */
8448     int n_dict;
8449 
8450     for (n_dict = 0;n_dict < gen_nb_xmlDictPtr;n_dict++) {
8451         mem_base = xmlMemBlocks();
8452         dict = gen_xmlDictPtr(n_dict, 0);
8453 
8454         ret_val = xmlDictReference(dict);
8455         xmlDictFree(dict);
8456         desret_int(ret_val);
8457         call_tests++;
8458         des_xmlDictPtr(n_dict, dict, 0);
8459         xmlResetLastError();
8460         if (mem_base != xmlMemBlocks()) {
8461             printf("Leak of %d blocks found in xmlDictReference",
8462 	           xmlMemBlocks() - mem_base);
8463 	    test_ret++;
8464             printf(" %d", n_dict);
8465             printf("\n");
8466         }
8467     }
8468     function_tests++;
8469 
8470     return(test_ret);
8471 }
8472 
8473 
8474 static int
test_xmlDictSetLimit(void)8475 test_xmlDictSetLimit(void) {
8476     int test_ret = 0;
8477 
8478 
8479     /* missing type support */
8480     return(test_ret);
8481 }
8482 
8483 
8484 static int
test_xmlDictSize(void)8485 test_xmlDictSize(void) {
8486     int test_ret = 0;
8487 
8488     int mem_base;
8489     int ret_val;
8490     xmlDictPtr dict; /* the dictionary */
8491     int n_dict;
8492 
8493     for (n_dict = 0;n_dict < gen_nb_xmlDictPtr;n_dict++) {
8494         mem_base = xmlMemBlocks();
8495         dict = gen_xmlDictPtr(n_dict, 0);
8496 
8497         ret_val = xmlDictSize(dict);
8498         desret_int(ret_val);
8499         call_tests++;
8500         des_xmlDictPtr(n_dict, dict, 0);
8501         xmlResetLastError();
8502         if (mem_base != xmlMemBlocks()) {
8503             printf("Leak of %d blocks found in xmlDictSize",
8504 	           xmlMemBlocks() - mem_base);
8505 	    test_ret++;
8506             printf(" %d", n_dict);
8507             printf("\n");
8508         }
8509     }
8510     function_tests++;
8511 
8512     return(test_ret);
8513 }
8514 
8515 
8516 static int
test_xmlInitializeDict(void)8517 test_xmlInitializeDict(void) {
8518     int test_ret = 0;
8519 
8520     int mem_base;
8521     int ret_val;
8522 
8523         mem_base = xmlMemBlocks();
8524 
8525         ret_val = xmlInitializeDict();
8526         desret_int(ret_val);
8527         call_tests++;
8528         xmlResetLastError();
8529         if (mem_base != xmlMemBlocks()) {
8530             printf("Leak of %d blocks found in xmlInitializeDict",
8531 	           xmlMemBlocks() - mem_base);
8532 	    test_ret++;
8533             printf("\n");
8534         }
8535     function_tests++;
8536 
8537     return(test_ret);
8538 }
8539 
8540 static int
test_dict(void)8541 test_dict(void) {
8542     int test_ret = 0;
8543 
8544     if (quiet == 0) printf("Testing dict : 10 of 13 functions ...\n");
8545     test_ret += test_xmlDictCleanup();
8546     test_ret += test_xmlDictCreate();
8547     test_ret += test_xmlDictCreateSub();
8548     test_ret += test_xmlDictExists();
8549     test_ret += test_xmlDictGetUsage();
8550     test_ret += test_xmlDictLookup();
8551     test_ret += test_xmlDictOwns();
8552     test_ret += test_xmlDictQLookup();
8553     test_ret += test_xmlDictReference();
8554     test_ret += test_xmlDictSetLimit();
8555     test_ret += test_xmlDictSize();
8556     test_ret += test_xmlInitializeDict();
8557 
8558     if (test_ret != 0)
8559 	printf("Module dict: %d errors\n", test_ret);
8560     return(test_ret);
8561 }
8562 
8563 static int
test_UTF8Toisolat1(void)8564 test_UTF8Toisolat1(void) {
8565     int test_ret = 0;
8566 
8567 #if defined(LIBXML_OUTPUT_ENABLED)
8568 #ifdef LIBXML_OUTPUT_ENABLED
8569     int mem_base;
8570     int ret_val;
8571     unsigned char * out; /* a pointer to an array of bytes to store the result */
8572     int n_out;
8573     int * outlen; /* the length of @out */
8574     int n_outlen;
8575     const unsigned char * in; /* a pointer to an array of UTF-8 chars */
8576     int n_in;
8577     int * inlen; /* the length of @in */
8578     int n_inlen;
8579 
8580     for (n_out = 0;n_out < gen_nb_unsigned_char_ptr;n_out++) {
8581     for (n_outlen = 0;n_outlen < gen_nb_int_ptr;n_outlen++) {
8582     for (n_in = 0;n_in < gen_nb_const_unsigned_char_ptr;n_in++) {
8583     for (n_inlen = 0;n_inlen < gen_nb_int_ptr;n_inlen++) {
8584         mem_base = xmlMemBlocks();
8585         out = gen_unsigned_char_ptr(n_out, 0);
8586         outlen = gen_int_ptr(n_outlen, 1);
8587         in = gen_const_unsigned_char_ptr(n_in, 2);
8588         inlen = gen_int_ptr(n_inlen, 3);
8589 
8590         ret_val = UTF8Toisolat1(out, outlen, in, inlen);
8591         desret_int(ret_val);
8592         call_tests++;
8593         des_unsigned_char_ptr(n_out, out, 0);
8594         des_int_ptr(n_outlen, outlen, 1);
8595         des_const_unsigned_char_ptr(n_in, in, 2);
8596         des_int_ptr(n_inlen, inlen, 3);
8597         xmlResetLastError();
8598         if (mem_base != xmlMemBlocks()) {
8599             printf("Leak of %d blocks found in UTF8Toisolat1",
8600 	           xmlMemBlocks() - mem_base);
8601 	    test_ret++;
8602             printf(" %d", n_out);
8603             printf(" %d", n_outlen);
8604             printf(" %d", n_in);
8605             printf(" %d", n_inlen);
8606             printf("\n");
8607         }
8608     }
8609     }
8610     }
8611     }
8612     function_tests++;
8613 #endif
8614 #endif
8615 
8616     return(test_ret);
8617 }
8618 
8619 
8620 static int
test_isolat1ToUTF8(void)8621 test_isolat1ToUTF8(void) {
8622     int test_ret = 0;
8623 
8624     int mem_base;
8625     int ret_val;
8626     unsigned char * out; /* a pointer to an array of bytes to store the result */
8627     int n_out;
8628     int * outlen; /* the length of @out */
8629     int n_outlen;
8630     const unsigned char * in; /* a pointer to an array of ISO Latin 1 chars */
8631     int n_in;
8632     int * inlen; /* the length of @in */
8633     int n_inlen;
8634 
8635     for (n_out = 0;n_out < gen_nb_unsigned_char_ptr;n_out++) {
8636     for (n_outlen = 0;n_outlen < gen_nb_int_ptr;n_outlen++) {
8637     for (n_in = 0;n_in < gen_nb_const_unsigned_char_ptr;n_in++) {
8638     for (n_inlen = 0;n_inlen < gen_nb_int_ptr;n_inlen++) {
8639         mem_base = xmlMemBlocks();
8640         out = gen_unsigned_char_ptr(n_out, 0);
8641         outlen = gen_int_ptr(n_outlen, 1);
8642         in = gen_const_unsigned_char_ptr(n_in, 2);
8643         inlen = gen_int_ptr(n_inlen, 3);
8644 
8645         ret_val = isolat1ToUTF8(out, outlen, in, inlen);
8646         desret_int(ret_val);
8647         call_tests++;
8648         des_unsigned_char_ptr(n_out, out, 0);
8649         des_int_ptr(n_outlen, outlen, 1);
8650         des_const_unsigned_char_ptr(n_in, in, 2);
8651         des_int_ptr(n_inlen, inlen, 3);
8652         xmlResetLastError();
8653         if (mem_base != xmlMemBlocks()) {
8654             printf("Leak of %d blocks found in isolat1ToUTF8",
8655 	           xmlMemBlocks() - mem_base);
8656 	    test_ret++;
8657             printf(" %d", n_out);
8658             printf(" %d", n_outlen);
8659             printf(" %d", n_in);
8660             printf(" %d", n_inlen);
8661             printf("\n");
8662         }
8663     }
8664     }
8665     }
8666     }
8667     function_tests++;
8668 
8669     return(test_ret);
8670 }
8671 
8672 
8673 static int
test_xmlAddEncodingAlias(void)8674 test_xmlAddEncodingAlias(void) {
8675     int test_ret = 0;
8676 
8677     int ret_val;
8678     const char * name; /* the encoding name as parsed, in UTF-8 format (ASCII actually) */
8679     int n_name;
8680     const char * alias; /* the alias name as parsed, in UTF-8 format (ASCII actually) */
8681     int n_alias;
8682 
8683     for (n_name = 0;n_name < gen_nb_const_char_ptr;n_name++) {
8684     for (n_alias = 0;n_alias < gen_nb_const_char_ptr;n_alias++) {
8685         name = gen_const_char_ptr(n_name, 0);
8686         alias = gen_const_char_ptr(n_alias, 1);
8687 
8688         ret_val = xmlAddEncodingAlias(name, alias);
8689         desret_int(ret_val);
8690         call_tests++;
8691         des_const_char_ptr(n_name, name, 0);
8692         des_const_char_ptr(n_alias, alias, 1);
8693         xmlResetLastError();
8694     }
8695     }
8696     function_tests++;
8697 
8698     return(test_ret);
8699 }
8700 
8701 
8702 #define gen_nb_xmlCharEncodingHandler_ptr 1
8703 #define gen_xmlCharEncodingHandler_ptr(no, nr) NULL
8704 #define des_xmlCharEncodingHandler_ptr(no, val, nr)
8705 
8706 static int
test_xmlCharEncCloseFunc(void)8707 test_xmlCharEncCloseFunc(void) {
8708     int test_ret = 0;
8709 
8710     int mem_base;
8711     int ret_val;
8712     xmlCharEncodingHandler * handler; /* char encoding transformation data structure */
8713     int n_handler;
8714 
8715     for (n_handler = 0;n_handler < gen_nb_xmlCharEncodingHandler_ptr;n_handler++) {
8716         mem_base = xmlMemBlocks();
8717         handler = gen_xmlCharEncodingHandler_ptr(n_handler, 0);
8718 
8719         ret_val = xmlCharEncCloseFunc(handler);
8720         desret_int(ret_val);
8721         call_tests++;
8722         des_xmlCharEncodingHandler_ptr(n_handler, handler, 0);
8723         xmlResetLastError();
8724         if (mem_base != xmlMemBlocks()) {
8725             printf("Leak of %d blocks found in xmlCharEncCloseFunc",
8726 	           xmlMemBlocks() - mem_base);
8727 	    test_ret++;
8728             printf(" %d", n_handler);
8729             printf("\n");
8730         }
8731     }
8732     function_tests++;
8733 
8734     return(test_ret);
8735 }
8736 
8737 
8738 static int
test_xmlCharEncFirstLine(void)8739 test_xmlCharEncFirstLine(void) {
8740     int test_ret = 0;
8741 
8742     int mem_base;
8743     int ret_val;
8744     xmlCharEncodingHandler * handler; /* char encoding transformation data structure */
8745     int n_handler;
8746     xmlBufferPtr out; /* an xmlBuffer for the output. */
8747     int n_out;
8748     xmlBufferPtr in; /* an xmlBuffer for the input */
8749     int n_in;
8750 
8751     for (n_handler = 0;n_handler < gen_nb_xmlCharEncodingHandler_ptr;n_handler++) {
8752     for (n_out = 0;n_out < gen_nb_xmlBufferPtr;n_out++) {
8753     for (n_in = 0;n_in < gen_nb_xmlBufferPtr;n_in++) {
8754         mem_base = xmlMemBlocks();
8755         handler = gen_xmlCharEncodingHandler_ptr(n_handler, 0);
8756         out = gen_xmlBufferPtr(n_out, 1);
8757         in = gen_xmlBufferPtr(n_in, 2);
8758 
8759         ret_val = xmlCharEncFirstLine(handler, out, in);
8760         desret_int(ret_val);
8761         call_tests++;
8762         des_xmlCharEncodingHandler_ptr(n_handler, handler, 0);
8763         des_xmlBufferPtr(n_out, out, 1);
8764         des_xmlBufferPtr(n_in, in, 2);
8765         xmlResetLastError();
8766         if (mem_base != xmlMemBlocks()) {
8767             printf("Leak of %d blocks found in xmlCharEncFirstLine",
8768 	           xmlMemBlocks() - mem_base);
8769 	    test_ret++;
8770             printf(" %d", n_handler);
8771             printf(" %d", n_out);
8772             printf(" %d", n_in);
8773             printf("\n");
8774         }
8775     }
8776     }
8777     }
8778     function_tests++;
8779 
8780     return(test_ret);
8781 }
8782 
8783 
8784 static int
test_xmlCharEncInFunc(void)8785 test_xmlCharEncInFunc(void) {
8786     int test_ret = 0;
8787 
8788     int mem_base;
8789     int ret_val;
8790     xmlCharEncodingHandler * handler; /* char encoding transformation data structure */
8791     int n_handler;
8792     xmlBufferPtr out; /* an xmlBuffer for the output. */
8793     int n_out;
8794     xmlBufferPtr in; /* an xmlBuffer for the input */
8795     int n_in;
8796 
8797     for (n_handler = 0;n_handler < gen_nb_xmlCharEncodingHandler_ptr;n_handler++) {
8798     for (n_out = 0;n_out < gen_nb_xmlBufferPtr;n_out++) {
8799     for (n_in = 0;n_in < gen_nb_xmlBufferPtr;n_in++) {
8800         mem_base = xmlMemBlocks();
8801         handler = gen_xmlCharEncodingHandler_ptr(n_handler, 0);
8802         out = gen_xmlBufferPtr(n_out, 1);
8803         in = gen_xmlBufferPtr(n_in, 2);
8804 
8805         ret_val = xmlCharEncInFunc(handler, out, in);
8806         desret_int(ret_val);
8807         call_tests++;
8808         des_xmlCharEncodingHandler_ptr(n_handler, handler, 0);
8809         des_xmlBufferPtr(n_out, out, 1);
8810         des_xmlBufferPtr(n_in, in, 2);
8811         xmlResetLastError();
8812         if (mem_base != xmlMemBlocks()) {
8813             printf("Leak of %d blocks found in xmlCharEncInFunc",
8814 	           xmlMemBlocks() - mem_base);
8815 	    test_ret++;
8816             printf(" %d", n_handler);
8817             printf(" %d", n_out);
8818             printf(" %d", n_in);
8819             printf("\n");
8820         }
8821     }
8822     }
8823     }
8824     function_tests++;
8825 
8826     return(test_ret);
8827 }
8828 
8829 
8830 static int
test_xmlCharEncOutFunc(void)8831 test_xmlCharEncOutFunc(void) {
8832     int test_ret = 0;
8833 
8834     int mem_base;
8835     int ret_val;
8836     xmlCharEncodingHandler * handler; /* char encoding transformation data structure */
8837     int n_handler;
8838     xmlBufferPtr out; /* an xmlBuffer for the output. */
8839     int n_out;
8840     xmlBufferPtr in; /* an xmlBuffer for the input */
8841     int n_in;
8842 
8843     for (n_handler = 0;n_handler < gen_nb_xmlCharEncodingHandler_ptr;n_handler++) {
8844     for (n_out = 0;n_out < gen_nb_xmlBufferPtr;n_out++) {
8845     for (n_in = 0;n_in < gen_nb_xmlBufferPtr;n_in++) {
8846         mem_base = xmlMemBlocks();
8847         handler = gen_xmlCharEncodingHandler_ptr(n_handler, 0);
8848         out = gen_xmlBufferPtr(n_out, 1);
8849         in = gen_xmlBufferPtr(n_in, 2);
8850 
8851         ret_val = xmlCharEncOutFunc(handler, out, in);
8852         desret_int(ret_val);
8853         call_tests++;
8854         des_xmlCharEncodingHandler_ptr(n_handler, handler, 0);
8855         des_xmlBufferPtr(n_out, out, 1);
8856         des_xmlBufferPtr(n_in, in, 2);
8857         xmlResetLastError();
8858         if (mem_base != xmlMemBlocks()) {
8859             printf("Leak of %d blocks found in xmlCharEncOutFunc",
8860 	           xmlMemBlocks() - mem_base);
8861 	    test_ret++;
8862             printf(" %d", n_handler);
8863             printf(" %d", n_out);
8864             printf(" %d", n_in);
8865             printf("\n");
8866         }
8867     }
8868     }
8869     }
8870     function_tests++;
8871 
8872     return(test_ret);
8873 }
8874 
8875 
8876 static int
test_xmlCleanupCharEncodingHandlers(void)8877 test_xmlCleanupCharEncodingHandlers(void) {
8878     int test_ret = 0;
8879 
8880 
8881 
8882         xmlCleanupCharEncodingHandlers();
8883         call_tests++;
8884         xmlResetLastError();
8885     function_tests++;
8886 
8887     return(test_ret);
8888 }
8889 
8890 
8891 static int
test_xmlCleanupEncodingAliases(void)8892 test_xmlCleanupEncodingAliases(void) {
8893     int test_ret = 0;
8894 
8895     int mem_base;
8896 
8897         mem_base = xmlMemBlocks();
8898 
8899         xmlCleanupEncodingAliases();
8900         call_tests++;
8901         xmlResetLastError();
8902         if (mem_base != xmlMemBlocks()) {
8903             printf("Leak of %d blocks found in xmlCleanupEncodingAliases",
8904 	           xmlMemBlocks() - mem_base);
8905 	    test_ret++;
8906             printf("\n");
8907         }
8908     function_tests++;
8909 
8910     return(test_ret);
8911 }
8912 
8913 
8914 static int
test_xmlDelEncodingAlias(void)8915 test_xmlDelEncodingAlias(void) {
8916     int test_ret = 0;
8917 
8918     int mem_base;
8919     int ret_val;
8920     const char * alias; /* the alias name as parsed, in UTF-8 format (ASCII actually) */
8921     int n_alias;
8922 
8923     for (n_alias = 0;n_alias < gen_nb_const_char_ptr;n_alias++) {
8924         mem_base = xmlMemBlocks();
8925         alias = gen_const_char_ptr(n_alias, 0);
8926 
8927         ret_val = xmlDelEncodingAlias(alias);
8928         desret_int(ret_val);
8929         call_tests++;
8930         des_const_char_ptr(n_alias, alias, 0);
8931         xmlResetLastError();
8932         if (mem_base != xmlMemBlocks()) {
8933             printf("Leak of %d blocks found in xmlDelEncodingAlias",
8934 	           xmlMemBlocks() - mem_base);
8935 	    test_ret++;
8936             printf(" %d", n_alias);
8937             printf("\n");
8938         }
8939     }
8940     function_tests++;
8941 
8942     return(test_ret);
8943 }
8944 
8945 
8946 static int
test_xmlDetectCharEncoding(void)8947 test_xmlDetectCharEncoding(void) {
8948     int test_ret = 0;
8949 
8950     int mem_base;
8951     xmlCharEncoding ret_val;
8952     const 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). */
8953     int n_in;
8954     int len; /* pointer to the length of the buffer */
8955     int n_len;
8956 
8957     for (n_in = 0;n_in < gen_nb_const_unsigned_char_ptr;n_in++) {
8958     for (n_len = 0;n_len < gen_nb_int;n_len++) {
8959         mem_base = xmlMemBlocks();
8960         in = gen_const_unsigned_char_ptr(n_in, 0);
8961         len = gen_int(n_len, 1);
8962 
8963         ret_val = xmlDetectCharEncoding(in, len);
8964         desret_xmlCharEncoding(ret_val);
8965         call_tests++;
8966         des_const_unsigned_char_ptr(n_in, in, 0);
8967         des_int(n_len, len, 1);
8968         xmlResetLastError();
8969         if (mem_base != xmlMemBlocks()) {
8970             printf("Leak of %d blocks found in xmlDetectCharEncoding",
8971 	           xmlMemBlocks() - mem_base);
8972 	    test_ret++;
8973             printf(" %d", n_in);
8974             printf(" %d", n_len);
8975             printf("\n");
8976         }
8977     }
8978     }
8979     function_tests++;
8980 
8981     return(test_ret);
8982 }
8983 
8984 
8985 static int
test_xmlFindCharEncodingHandler(void)8986 test_xmlFindCharEncodingHandler(void) {
8987     int test_ret = 0;
8988 
8989 
8990     /* missing type support */
8991     return(test_ret);
8992 }
8993 
8994 
8995 static int
test_xmlGetCharEncodingHandler(void)8996 test_xmlGetCharEncodingHandler(void) {
8997     int test_ret = 0;
8998 
8999 
9000     /* missing type support */
9001     return(test_ret);
9002 }
9003 
9004 
9005 static int
test_xmlGetCharEncodingName(void)9006 test_xmlGetCharEncodingName(void) {
9007     int test_ret = 0;
9008 
9009     int mem_base;
9010     const char * ret_val;
9011     xmlCharEncoding enc; /* the encoding */
9012     int n_enc;
9013 
9014     for (n_enc = 0;n_enc < gen_nb_xmlCharEncoding;n_enc++) {
9015         mem_base = xmlMemBlocks();
9016         enc = gen_xmlCharEncoding(n_enc, 0);
9017 
9018         ret_val = xmlGetCharEncodingName(enc);
9019         desret_const_char_ptr(ret_val);
9020         call_tests++;
9021         des_xmlCharEncoding(n_enc, enc, 0);
9022         xmlResetLastError();
9023         if (mem_base != xmlMemBlocks()) {
9024             printf("Leak of %d blocks found in xmlGetCharEncodingName",
9025 	           xmlMemBlocks() - mem_base);
9026 	    test_ret++;
9027             printf(" %d", n_enc);
9028             printf("\n");
9029         }
9030     }
9031     function_tests++;
9032 
9033     return(test_ret);
9034 }
9035 
9036 
9037 static int
test_xmlGetEncodingAlias(void)9038 test_xmlGetEncodingAlias(void) {
9039     int test_ret = 0;
9040 
9041     int mem_base;
9042     const char * ret_val;
9043     const char * alias; /* the alias name as parsed, in UTF-8 format (ASCII actually) */
9044     int n_alias;
9045 
9046     for (n_alias = 0;n_alias < gen_nb_const_char_ptr;n_alias++) {
9047         mem_base = xmlMemBlocks();
9048         alias = gen_const_char_ptr(n_alias, 0);
9049 
9050         ret_val = xmlGetEncodingAlias(alias);
9051         desret_const_char_ptr(ret_val);
9052         call_tests++;
9053         des_const_char_ptr(n_alias, alias, 0);
9054         xmlResetLastError();
9055         if (mem_base != xmlMemBlocks()) {
9056             printf("Leak of %d blocks found in xmlGetEncodingAlias",
9057 	           xmlMemBlocks() - mem_base);
9058 	    test_ret++;
9059             printf(" %d", n_alias);
9060             printf("\n");
9061         }
9062     }
9063     function_tests++;
9064 
9065     return(test_ret);
9066 }
9067 
9068 
9069 static int
test_xmlInitCharEncodingHandlers(void)9070 test_xmlInitCharEncodingHandlers(void) {
9071     int test_ret = 0;
9072 
9073 
9074 
9075         xmlInitCharEncodingHandlers();
9076         call_tests++;
9077         xmlResetLastError();
9078     function_tests++;
9079 
9080     return(test_ret);
9081 }
9082 
9083 
9084 static int
test_xmlNewCharEncodingHandler(void)9085 test_xmlNewCharEncodingHandler(void) {
9086     int test_ret = 0;
9087 
9088 
9089     /* missing type support */
9090     return(test_ret);
9091 }
9092 
9093 
9094 static int
test_xmlParseCharEncoding(void)9095 test_xmlParseCharEncoding(void) {
9096     int test_ret = 0;
9097 
9098     int mem_base;
9099     xmlCharEncoding ret_val;
9100     const char * name; /* the encoding name as parsed, in UTF-8 format (ASCII actually) */
9101     int n_name;
9102 
9103     for (n_name = 0;n_name < gen_nb_const_char_ptr;n_name++) {
9104         mem_base = xmlMemBlocks();
9105         name = gen_const_char_ptr(n_name, 0);
9106 
9107         ret_val = xmlParseCharEncoding(name);
9108         desret_xmlCharEncoding(ret_val);
9109         call_tests++;
9110         des_const_char_ptr(n_name, name, 0);
9111         xmlResetLastError();
9112         if (mem_base != xmlMemBlocks()) {
9113             printf("Leak of %d blocks found in xmlParseCharEncoding",
9114 	           xmlMemBlocks() - mem_base);
9115 	    test_ret++;
9116             printf(" %d", n_name);
9117             printf("\n");
9118         }
9119     }
9120     function_tests++;
9121 
9122     return(test_ret);
9123 }
9124 
9125 
9126 #define gen_nb_xmlCharEncodingHandlerPtr 1
9127 #define gen_xmlCharEncodingHandlerPtr(no, nr) NULL
9128 #define des_xmlCharEncodingHandlerPtr(no, val, nr)
9129 
9130 static int
test_xmlRegisterCharEncodingHandler(void)9131 test_xmlRegisterCharEncodingHandler(void) {
9132     int test_ret = 0;
9133 
9134     int mem_base;
9135     xmlCharEncodingHandlerPtr handler; /* the xmlCharEncodingHandlerPtr handler block */
9136     int n_handler;
9137 
9138     for (n_handler = 0;n_handler < gen_nb_xmlCharEncodingHandlerPtr;n_handler++) {
9139         mem_base = xmlMemBlocks();
9140         handler = gen_xmlCharEncodingHandlerPtr(n_handler, 0);
9141 
9142         xmlRegisterCharEncodingHandler(handler);
9143         call_tests++;
9144         des_xmlCharEncodingHandlerPtr(n_handler, handler, 0);
9145         xmlResetLastError();
9146         if (mem_base != xmlMemBlocks()) {
9147             printf("Leak of %d blocks found in xmlRegisterCharEncodingHandler",
9148 	           xmlMemBlocks() - mem_base);
9149 	    test_ret++;
9150             printf(" %d", n_handler);
9151             printf("\n");
9152         }
9153     }
9154     function_tests++;
9155 
9156     return(test_ret);
9157 }
9158 
9159 static int
test_encoding(void)9160 test_encoding(void) {
9161     int test_ret = 0;
9162 
9163     if (quiet == 0) printf("Testing encoding : 16 of 19 functions ...\n");
9164     test_ret += test_UTF8Toisolat1();
9165     test_ret += test_isolat1ToUTF8();
9166     test_ret += test_xmlAddEncodingAlias();
9167     test_ret += test_xmlCharEncCloseFunc();
9168     test_ret += test_xmlCharEncFirstLine();
9169     test_ret += test_xmlCharEncInFunc();
9170     test_ret += test_xmlCharEncOutFunc();
9171     test_ret += test_xmlCleanupCharEncodingHandlers();
9172     test_ret += test_xmlCleanupEncodingAliases();
9173     test_ret += test_xmlDelEncodingAlias();
9174     test_ret += test_xmlDetectCharEncoding();
9175     test_ret += test_xmlFindCharEncodingHandler();
9176     test_ret += test_xmlGetCharEncodingHandler();
9177     test_ret += test_xmlGetCharEncodingName();
9178     test_ret += test_xmlGetEncodingAlias();
9179     test_ret += test_xmlInitCharEncodingHandlers();
9180     test_ret += test_xmlNewCharEncodingHandler();
9181     test_ret += test_xmlParseCharEncoding();
9182     test_ret += test_xmlRegisterCharEncodingHandler();
9183 
9184     if (test_ret != 0)
9185 	printf("Module encoding: %d errors\n", test_ret);
9186     return(test_ret);
9187 }
9188 
9189 static int
test_xmlAddDocEntity(void)9190 test_xmlAddDocEntity(void) {
9191     int test_ret = 0;
9192 
9193     int mem_base;
9194     xmlEntityPtr ret_val;
9195     xmlDocPtr doc; /* the document */
9196     int n_doc;
9197     const xmlChar * name; /* the entity name */
9198     int n_name;
9199     int type; /* the entity type XML_xxx_yyy_ENTITY */
9200     int n_type;
9201     const xmlChar * ExternalID; /* the entity external ID if available */
9202     int n_ExternalID;
9203     const xmlChar * SystemID; /* the entity system ID if available */
9204     int n_SystemID;
9205     const xmlChar * content; /* the entity content */
9206     int n_content;
9207 
9208     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
9209     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
9210     for (n_type = 0;n_type < gen_nb_int;n_type++) {
9211     for (n_ExternalID = 0;n_ExternalID < gen_nb_const_xmlChar_ptr;n_ExternalID++) {
9212     for (n_SystemID = 0;n_SystemID < gen_nb_const_xmlChar_ptr;n_SystemID++) {
9213     for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
9214         mem_base = xmlMemBlocks();
9215         doc = gen_xmlDocPtr(n_doc, 0);
9216         name = gen_const_xmlChar_ptr(n_name, 1);
9217         type = gen_int(n_type, 2);
9218         ExternalID = gen_const_xmlChar_ptr(n_ExternalID, 3);
9219         SystemID = gen_const_xmlChar_ptr(n_SystemID, 4);
9220         content = gen_const_xmlChar_ptr(n_content, 5);
9221 
9222         ret_val = xmlAddDocEntity(doc, name, type, ExternalID, SystemID, content);
9223         desret_xmlEntityPtr(ret_val);
9224         call_tests++;
9225         des_xmlDocPtr(n_doc, doc, 0);
9226         des_const_xmlChar_ptr(n_name, name, 1);
9227         des_int(n_type, type, 2);
9228         des_const_xmlChar_ptr(n_ExternalID, ExternalID, 3);
9229         des_const_xmlChar_ptr(n_SystemID, SystemID, 4);
9230         des_const_xmlChar_ptr(n_content, content, 5);
9231         xmlResetLastError();
9232         if (mem_base != xmlMemBlocks()) {
9233             printf("Leak of %d blocks found in xmlAddDocEntity",
9234 	           xmlMemBlocks() - mem_base);
9235 	    test_ret++;
9236             printf(" %d", n_doc);
9237             printf(" %d", n_name);
9238             printf(" %d", n_type);
9239             printf(" %d", n_ExternalID);
9240             printf(" %d", n_SystemID);
9241             printf(" %d", n_content);
9242             printf("\n");
9243         }
9244     }
9245     }
9246     }
9247     }
9248     }
9249     }
9250     function_tests++;
9251 
9252     return(test_ret);
9253 }
9254 
9255 
9256 static int
test_xmlAddDtdEntity(void)9257 test_xmlAddDtdEntity(void) {
9258     int test_ret = 0;
9259 
9260     int mem_base;
9261     xmlEntityPtr ret_val;
9262     xmlDocPtr doc; /* the document */
9263     int n_doc;
9264     const xmlChar * name; /* the entity name */
9265     int n_name;
9266     int type; /* the entity type XML_xxx_yyy_ENTITY */
9267     int n_type;
9268     const xmlChar * ExternalID; /* the entity external ID if available */
9269     int n_ExternalID;
9270     const xmlChar * SystemID; /* the entity system ID if available */
9271     int n_SystemID;
9272     const xmlChar * content; /* the entity content */
9273     int n_content;
9274 
9275     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
9276     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
9277     for (n_type = 0;n_type < gen_nb_int;n_type++) {
9278     for (n_ExternalID = 0;n_ExternalID < gen_nb_const_xmlChar_ptr;n_ExternalID++) {
9279     for (n_SystemID = 0;n_SystemID < gen_nb_const_xmlChar_ptr;n_SystemID++) {
9280     for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
9281         mem_base = xmlMemBlocks();
9282         doc = gen_xmlDocPtr(n_doc, 0);
9283         name = gen_const_xmlChar_ptr(n_name, 1);
9284         type = gen_int(n_type, 2);
9285         ExternalID = gen_const_xmlChar_ptr(n_ExternalID, 3);
9286         SystemID = gen_const_xmlChar_ptr(n_SystemID, 4);
9287         content = gen_const_xmlChar_ptr(n_content, 5);
9288 
9289         ret_val = xmlAddDtdEntity(doc, name, type, ExternalID, SystemID, content);
9290         desret_xmlEntityPtr(ret_val);
9291         call_tests++;
9292         des_xmlDocPtr(n_doc, doc, 0);
9293         des_const_xmlChar_ptr(n_name, name, 1);
9294         des_int(n_type, type, 2);
9295         des_const_xmlChar_ptr(n_ExternalID, ExternalID, 3);
9296         des_const_xmlChar_ptr(n_SystemID, SystemID, 4);
9297         des_const_xmlChar_ptr(n_content, content, 5);
9298         xmlResetLastError();
9299         if (mem_base != xmlMemBlocks()) {
9300             printf("Leak of %d blocks found in xmlAddDtdEntity",
9301 	           xmlMemBlocks() - mem_base);
9302 	    test_ret++;
9303             printf(" %d", n_doc);
9304             printf(" %d", n_name);
9305             printf(" %d", n_type);
9306             printf(" %d", n_ExternalID);
9307             printf(" %d", n_SystemID);
9308             printf(" %d", n_content);
9309             printf("\n");
9310         }
9311     }
9312     }
9313     }
9314     }
9315     }
9316     }
9317     function_tests++;
9318 
9319     return(test_ret);
9320 }
9321 
9322 
9323 static int
test_xmlCopyEntitiesTable(void)9324 test_xmlCopyEntitiesTable(void) {
9325     int test_ret = 0;
9326 
9327 
9328     /* missing type support */
9329     return(test_ret);
9330 }
9331 
9332 
9333 static int
test_xmlCreateEntitiesTable(void)9334 test_xmlCreateEntitiesTable(void) {
9335     int test_ret = 0;
9336 
9337 
9338     /* missing type support */
9339     return(test_ret);
9340 }
9341 
9342 
9343 #define gen_nb_xmlEntitiesTablePtr 1
9344 #define gen_xmlEntitiesTablePtr(no, nr) NULL
9345 #define des_xmlEntitiesTablePtr(no, val, nr)
9346 
9347 static int
test_xmlDumpEntitiesTable(void)9348 test_xmlDumpEntitiesTable(void) {
9349     int test_ret = 0;
9350 
9351 #if defined(LIBXML_OUTPUT_ENABLED)
9352     int mem_base;
9353     xmlBufferPtr buf; /* An XML buffer. */
9354     int n_buf;
9355     xmlEntitiesTablePtr table; /* An entity table */
9356     int n_table;
9357 
9358     for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
9359     for (n_table = 0;n_table < gen_nb_xmlEntitiesTablePtr;n_table++) {
9360         mem_base = xmlMemBlocks();
9361         buf = gen_xmlBufferPtr(n_buf, 0);
9362         table = gen_xmlEntitiesTablePtr(n_table, 1);
9363 
9364         xmlDumpEntitiesTable(buf, table);
9365         call_tests++;
9366         des_xmlBufferPtr(n_buf, buf, 0);
9367         des_xmlEntitiesTablePtr(n_table, table, 1);
9368         xmlResetLastError();
9369         if (mem_base != xmlMemBlocks()) {
9370             printf("Leak of %d blocks found in xmlDumpEntitiesTable",
9371 	           xmlMemBlocks() - mem_base);
9372 	    test_ret++;
9373             printf(" %d", n_buf);
9374             printf(" %d", n_table);
9375             printf("\n");
9376         }
9377     }
9378     }
9379     function_tests++;
9380 #endif
9381 
9382     return(test_ret);
9383 }
9384 
9385 
9386 #define gen_nb_xmlEntityPtr 1
9387 #define gen_xmlEntityPtr(no, nr) NULL
9388 #define des_xmlEntityPtr(no, val, nr)
9389 
9390 static int
test_xmlDumpEntityDecl(void)9391 test_xmlDumpEntityDecl(void) {
9392     int test_ret = 0;
9393 
9394 #if defined(LIBXML_OUTPUT_ENABLED)
9395     int mem_base;
9396     xmlBufferPtr buf; /* An XML buffer. */
9397     int n_buf;
9398     xmlEntityPtr ent; /* An entity table */
9399     int n_ent;
9400 
9401     for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
9402     for (n_ent = 0;n_ent < gen_nb_xmlEntityPtr;n_ent++) {
9403         mem_base = xmlMemBlocks();
9404         buf = gen_xmlBufferPtr(n_buf, 0);
9405         ent = gen_xmlEntityPtr(n_ent, 1);
9406 
9407         xmlDumpEntityDecl(buf, ent);
9408         call_tests++;
9409         des_xmlBufferPtr(n_buf, buf, 0);
9410         des_xmlEntityPtr(n_ent, ent, 1);
9411         xmlResetLastError();
9412         if (mem_base != xmlMemBlocks()) {
9413             printf("Leak of %d blocks found in xmlDumpEntityDecl",
9414 	           xmlMemBlocks() - mem_base);
9415 	    test_ret++;
9416             printf(" %d", n_buf);
9417             printf(" %d", n_ent);
9418             printf("\n");
9419         }
9420     }
9421     }
9422     function_tests++;
9423 #endif
9424 
9425     return(test_ret);
9426 }
9427 
9428 
9429 static int
test_xmlEncodeEntitiesReentrant(void)9430 test_xmlEncodeEntitiesReentrant(void) {
9431     int test_ret = 0;
9432 
9433     int mem_base;
9434     xmlChar * ret_val;
9435     xmlDocPtr doc; /* the document containing the string */
9436     int n_doc;
9437     const xmlChar * input; /* A string to convert to XML. */
9438     int n_input;
9439 
9440     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
9441     for (n_input = 0;n_input < gen_nb_const_xmlChar_ptr;n_input++) {
9442         mem_base = xmlMemBlocks();
9443         doc = gen_xmlDocPtr(n_doc, 0);
9444         input = gen_const_xmlChar_ptr(n_input, 1);
9445 
9446         ret_val = xmlEncodeEntitiesReentrant(doc, input);
9447         desret_xmlChar_ptr(ret_val);
9448         call_tests++;
9449         des_xmlDocPtr(n_doc, doc, 0);
9450         des_const_xmlChar_ptr(n_input, input, 1);
9451         xmlResetLastError();
9452         if (mem_base != xmlMemBlocks()) {
9453             printf("Leak of %d blocks found in xmlEncodeEntitiesReentrant",
9454 	           xmlMemBlocks() - mem_base);
9455 	    test_ret++;
9456             printf(" %d", n_doc);
9457             printf(" %d", n_input);
9458             printf("\n");
9459         }
9460     }
9461     }
9462     function_tests++;
9463 
9464     return(test_ret);
9465 }
9466 
9467 
9468 #define gen_nb_const_xmlDoc_ptr 1
9469 #define gen_const_xmlDoc_ptr(no, nr) NULL
9470 #define des_const_xmlDoc_ptr(no, val, nr)
9471 
9472 static int
test_xmlEncodeSpecialChars(void)9473 test_xmlEncodeSpecialChars(void) {
9474     int test_ret = 0;
9475 
9476     int mem_base;
9477     xmlChar * ret_val;
9478     const xmlDoc * doc; /* the document containing the string */
9479     int n_doc;
9480     const xmlChar * input; /* A string to convert to XML. */
9481     int n_input;
9482 
9483     for (n_doc = 0;n_doc < gen_nb_const_xmlDoc_ptr;n_doc++) {
9484     for (n_input = 0;n_input < gen_nb_const_xmlChar_ptr;n_input++) {
9485         mem_base = xmlMemBlocks();
9486         doc = gen_const_xmlDoc_ptr(n_doc, 0);
9487         input = gen_const_xmlChar_ptr(n_input, 1);
9488 
9489         ret_val = xmlEncodeSpecialChars(doc, input);
9490         desret_xmlChar_ptr(ret_val);
9491         call_tests++;
9492         des_const_xmlDoc_ptr(n_doc, doc, 0);
9493         des_const_xmlChar_ptr(n_input, input, 1);
9494         xmlResetLastError();
9495         if (mem_base != xmlMemBlocks()) {
9496             printf("Leak of %d blocks found in xmlEncodeSpecialChars",
9497 	           xmlMemBlocks() - mem_base);
9498 	    test_ret++;
9499             printf(" %d", n_doc);
9500             printf(" %d", n_input);
9501             printf("\n");
9502         }
9503     }
9504     }
9505     function_tests++;
9506 
9507     return(test_ret);
9508 }
9509 
9510 
9511 static int
test_xmlGetDocEntity(void)9512 test_xmlGetDocEntity(void) {
9513     int test_ret = 0;
9514 
9515     int mem_base;
9516     xmlEntityPtr ret_val;
9517     const xmlDoc * doc; /* the document referencing the entity */
9518     int n_doc;
9519     const xmlChar * name; /* the entity name */
9520     int n_name;
9521 
9522     for (n_doc = 0;n_doc < gen_nb_const_xmlDoc_ptr;n_doc++) {
9523     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
9524         mem_base = xmlMemBlocks();
9525         doc = gen_const_xmlDoc_ptr(n_doc, 0);
9526         name = gen_const_xmlChar_ptr(n_name, 1);
9527 
9528         ret_val = xmlGetDocEntity(doc, name);
9529         desret_xmlEntityPtr(ret_val);
9530         call_tests++;
9531         des_const_xmlDoc_ptr(n_doc, doc, 0);
9532         des_const_xmlChar_ptr(n_name, name, 1);
9533         xmlResetLastError();
9534         if (mem_base != xmlMemBlocks()) {
9535             printf("Leak of %d blocks found in xmlGetDocEntity",
9536 	           xmlMemBlocks() - mem_base);
9537 	    test_ret++;
9538             printf(" %d", n_doc);
9539             printf(" %d", n_name);
9540             printf("\n");
9541         }
9542     }
9543     }
9544     function_tests++;
9545 
9546     return(test_ret);
9547 }
9548 
9549 
9550 static int
test_xmlGetDtdEntity(void)9551 test_xmlGetDtdEntity(void) {
9552     int test_ret = 0;
9553 
9554     int mem_base;
9555     xmlEntityPtr ret_val;
9556     xmlDocPtr doc; /* the document referencing the entity */
9557     int n_doc;
9558     const xmlChar * name; /* the entity name */
9559     int n_name;
9560 
9561     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
9562     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
9563         mem_base = xmlMemBlocks();
9564         doc = gen_xmlDocPtr(n_doc, 0);
9565         name = gen_const_xmlChar_ptr(n_name, 1);
9566 
9567         ret_val = xmlGetDtdEntity(doc, name);
9568         desret_xmlEntityPtr(ret_val);
9569         call_tests++;
9570         des_xmlDocPtr(n_doc, doc, 0);
9571         des_const_xmlChar_ptr(n_name, name, 1);
9572         xmlResetLastError();
9573         if (mem_base != xmlMemBlocks()) {
9574             printf("Leak of %d blocks found in xmlGetDtdEntity",
9575 	           xmlMemBlocks() - mem_base);
9576 	    test_ret++;
9577             printf(" %d", n_doc);
9578             printf(" %d", n_name);
9579             printf("\n");
9580         }
9581     }
9582     }
9583     function_tests++;
9584 
9585     return(test_ret);
9586 }
9587 
9588 
9589 static int
test_xmlGetParameterEntity(void)9590 test_xmlGetParameterEntity(void) {
9591     int test_ret = 0;
9592 
9593     int mem_base;
9594     xmlEntityPtr ret_val;
9595     xmlDocPtr doc; /* the document referencing the entity */
9596     int n_doc;
9597     const xmlChar * name; /* the entity name */
9598     int n_name;
9599 
9600     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
9601     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
9602         mem_base = xmlMemBlocks();
9603         doc = gen_xmlDocPtr(n_doc, 0);
9604         name = gen_const_xmlChar_ptr(n_name, 1);
9605 
9606         ret_val = xmlGetParameterEntity(doc, name);
9607         desret_xmlEntityPtr(ret_val);
9608         call_tests++;
9609         des_xmlDocPtr(n_doc, doc, 0);
9610         des_const_xmlChar_ptr(n_name, name, 1);
9611         xmlResetLastError();
9612         if (mem_base != xmlMemBlocks()) {
9613             printf("Leak of %d blocks found in xmlGetParameterEntity",
9614 	           xmlMemBlocks() - mem_base);
9615 	    test_ret++;
9616             printf(" %d", n_doc);
9617             printf(" %d", n_name);
9618             printf("\n");
9619         }
9620     }
9621     }
9622     function_tests++;
9623 
9624     return(test_ret);
9625 }
9626 
9627 
9628 static int
test_xmlGetPredefinedEntity(void)9629 test_xmlGetPredefinedEntity(void) {
9630     int test_ret = 0;
9631 
9632     int mem_base;
9633     xmlEntityPtr ret_val;
9634     const xmlChar * name; /* the entity name */
9635     int n_name;
9636 
9637     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
9638         mem_base = xmlMemBlocks();
9639         name = gen_const_xmlChar_ptr(n_name, 0);
9640 
9641         ret_val = xmlGetPredefinedEntity(name);
9642         desret_xmlEntityPtr(ret_val);
9643         call_tests++;
9644         des_const_xmlChar_ptr(n_name, name, 0);
9645         xmlResetLastError();
9646         if (mem_base != xmlMemBlocks()) {
9647             printf("Leak of %d blocks found in xmlGetPredefinedEntity",
9648 	           xmlMemBlocks() - mem_base);
9649 	    test_ret++;
9650             printf(" %d", n_name);
9651             printf("\n");
9652         }
9653     }
9654     function_tests++;
9655 
9656     return(test_ret);
9657 }
9658 
9659 
9660 static int
test_xmlNewEntity(void)9661 test_xmlNewEntity(void) {
9662     int test_ret = 0;
9663 
9664     int mem_base;
9665     xmlEntityPtr ret_val;
9666     xmlDocPtr doc; /* the document */
9667     int n_doc;
9668     const xmlChar * name; /* the entity name */
9669     int n_name;
9670     int type; /* the entity type XML_xxx_yyy_ENTITY */
9671     int n_type;
9672     const xmlChar * ExternalID; /* the entity external ID if available */
9673     int n_ExternalID;
9674     const xmlChar * SystemID; /* the entity system ID if available */
9675     int n_SystemID;
9676     const xmlChar * content; /* the entity content */
9677     int n_content;
9678 
9679     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
9680     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
9681     for (n_type = 0;n_type < gen_nb_int;n_type++) {
9682     for (n_ExternalID = 0;n_ExternalID < gen_nb_const_xmlChar_ptr;n_ExternalID++) {
9683     for (n_SystemID = 0;n_SystemID < gen_nb_const_xmlChar_ptr;n_SystemID++) {
9684     for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
9685         mem_base = xmlMemBlocks();
9686         doc = gen_xmlDocPtr(n_doc, 0);
9687         name = gen_const_xmlChar_ptr(n_name, 1);
9688         type = gen_int(n_type, 2);
9689         ExternalID = gen_const_xmlChar_ptr(n_ExternalID, 3);
9690         SystemID = gen_const_xmlChar_ptr(n_SystemID, 4);
9691         content = gen_const_xmlChar_ptr(n_content, 5);
9692 
9693         ret_val = xmlNewEntity(doc, name, type, ExternalID, SystemID, content);
9694         desret_xmlEntityPtr(ret_val);
9695         call_tests++;
9696         des_xmlDocPtr(n_doc, doc, 0);
9697         des_const_xmlChar_ptr(n_name, name, 1);
9698         des_int(n_type, type, 2);
9699         des_const_xmlChar_ptr(n_ExternalID, ExternalID, 3);
9700         des_const_xmlChar_ptr(n_SystemID, SystemID, 4);
9701         des_const_xmlChar_ptr(n_content, content, 5);
9702         xmlResetLastError();
9703         if (mem_base != xmlMemBlocks()) {
9704             printf("Leak of %d blocks found in xmlNewEntity",
9705 	           xmlMemBlocks() - mem_base);
9706 	    test_ret++;
9707             printf(" %d", n_doc);
9708             printf(" %d", n_name);
9709             printf(" %d", n_type);
9710             printf(" %d", n_ExternalID);
9711             printf(" %d", n_SystemID);
9712             printf(" %d", n_content);
9713             printf("\n");
9714         }
9715     }
9716     }
9717     }
9718     }
9719     }
9720     }
9721     function_tests++;
9722 
9723     return(test_ret);
9724 }
9725 
9726 static int
test_entities(void)9727 test_entities(void) {
9728     int test_ret = 0;
9729 
9730     if (quiet == 0) printf("Testing entities : 11 of 18 functions ...\n");
9731     test_ret += test_xmlAddDocEntity();
9732     test_ret += test_xmlAddDtdEntity();
9733     test_ret += test_xmlCopyEntitiesTable();
9734     test_ret += test_xmlCreateEntitiesTable();
9735     test_ret += test_xmlDumpEntitiesTable();
9736     test_ret += test_xmlDumpEntityDecl();
9737     test_ret += test_xmlEncodeEntitiesReentrant();
9738     test_ret += test_xmlEncodeSpecialChars();
9739     test_ret += test_xmlGetDocEntity();
9740     test_ret += test_xmlGetDtdEntity();
9741     test_ret += test_xmlGetParameterEntity();
9742     test_ret += test_xmlGetPredefinedEntity();
9743     test_ret += test_xmlNewEntity();
9744 
9745     if (test_ret != 0)
9746 	printf("Module entities: %d errors\n", test_ret);
9747     return(test_ret);
9748 }
9749 
9750 static int
test_xmlHashAddEntry(void)9751 test_xmlHashAddEntry(void) {
9752     int test_ret = 0;
9753 
9754     int mem_base;
9755     int ret_val;
9756     xmlHashTablePtr hash; /* hash table */
9757     int n_hash;
9758     const xmlChar * key; /* string key */
9759     int n_key;
9760     void * payload; /* pointer to the payload */
9761     int n_payload;
9762 
9763     for (n_hash = 0;n_hash < gen_nb_xmlHashTablePtr;n_hash++) {
9764     for (n_key = 0;n_key < gen_nb_const_xmlChar_ptr;n_key++) {
9765     for (n_payload = 0;n_payload < gen_nb_void_ptr;n_payload++) {
9766         mem_base = xmlMemBlocks();
9767         hash = gen_xmlHashTablePtr(n_hash, 0);
9768         key = gen_const_xmlChar_ptr(n_key, 1);
9769         payload = gen_void_ptr(n_payload, 2);
9770 
9771         ret_val = xmlHashAddEntry(hash, key, payload);
9772         desret_int(ret_val);
9773         call_tests++;
9774         des_xmlHashTablePtr(n_hash, hash, 0);
9775         des_const_xmlChar_ptr(n_key, key, 1);
9776         des_void_ptr(n_payload, payload, 2);
9777         xmlResetLastError();
9778         if (mem_base != xmlMemBlocks()) {
9779             printf("Leak of %d blocks found in xmlHashAddEntry",
9780 	           xmlMemBlocks() - mem_base);
9781 	    test_ret++;
9782             printf(" %d", n_hash);
9783             printf(" %d", n_key);
9784             printf(" %d", n_payload);
9785             printf("\n");
9786         }
9787     }
9788     }
9789     }
9790     function_tests++;
9791 
9792     return(test_ret);
9793 }
9794 
9795 
9796 static int
test_xmlHashAddEntry2(void)9797 test_xmlHashAddEntry2(void) {
9798     int test_ret = 0;
9799 
9800     int mem_base;
9801     int ret_val;
9802     xmlHashTablePtr hash; /* hash table */
9803     int n_hash;
9804     const xmlChar * key; /* first string key */
9805     int n_key;
9806     const xmlChar * key2; /* second string key */
9807     int n_key2;
9808     void * payload; /* pointer to the payload */
9809     int n_payload;
9810 
9811     for (n_hash = 0;n_hash < gen_nb_xmlHashTablePtr;n_hash++) {
9812     for (n_key = 0;n_key < gen_nb_const_xmlChar_ptr;n_key++) {
9813     for (n_key2 = 0;n_key2 < gen_nb_const_xmlChar_ptr;n_key2++) {
9814     for (n_payload = 0;n_payload < gen_nb_void_ptr;n_payload++) {
9815         mem_base = xmlMemBlocks();
9816         hash = gen_xmlHashTablePtr(n_hash, 0);
9817         key = gen_const_xmlChar_ptr(n_key, 1);
9818         key2 = gen_const_xmlChar_ptr(n_key2, 2);
9819         payload = gen_void_ptr(n_payload, 3);
9820 
9821         ret_val = xmlHashAddEntry2(hash, key, key2, payload);
9822         desret_int(ret_val);
9823         call_tests++;
9824         des_xmlHashTablePtr(n_hash, hash, 0);
9825         des_const_xmlChar_ptr(n_key, key, 1);
9826         des_const_xmlChar_ptr(n_key2, key2, 2);
9827         des_void_ptr(n_payload, payload, 3);
9828         xmlResetLastError();
9829         if (mem_base != xmlMemBlocks()) {
9830             printf("Leak of %d blocks found in xmlHashAddEntry2",
9831 	           xmlMemBlocks() - mem_base);
9832 	    test_ret++;
9833             printf(" %d", n_hash);
9834             printf(" %d", n_key);
9835             printf(" %d", n_key2);
9836             printf(" %d", n_payload);
9837             printf("\n");
9838         }
9839     }
9840     }
9841     }
9842     }
9843     function_tests++;
9844 
9845     return(test_ret);
9846 }
9847 
9848 
9849 static int
test_xmlHashAddEntry3(void)9850 test_xmlHashAddEntry3(void) {
9851     int test_ret = 0;
9852 
9853     int mem_base;
9854     int ret_val;
9855     xmlHashTablePtr hash; /* hash table */
9856     int n_hash;
9857     const xmlChar * key; /* first string key */
9858     int n_key;
9859     const xmlChar * key2; /* second string key */
9860     int n_key2;
9861     const xmlChar * key3; /* third string key */
9862     int n_key3;
9863     void * payload; /* pointer to the payload */
9864     int n_payload;
9865 
9866     for (n_hash = 0;n_hash < gen_nb_xmlHashTablePtr;n_hash++) {
9867     for (n_key = 0;n_key < gen_nb_const_xmlChar_ptr;n_key++) {
9868     for (n_key2 = 0;n_key2 < gen_nb_const_xmlChar_ptr;n_key2++) {
9869     for (n_key3 = 0;n_key3 < gen_nb_const_xmlChar_ptr;n_key3++) {
9870     for (n_payload = 0;n_payload < gen_nb_void_ptr;n_payload++) {
9871         mem_base = xmlMemBlocks();
9872         hash = gen_xmlHashTablePtr(n_hash, 0);
9873         key = gen_const_xmlChar_ptr(n_key, 1);
9874         key2 = gen_const_xmlChar_ptr(n_key2, 2);
9875         key3 = gen_const_xmlChar_ptr(n_key3, 3);
9876         payload = gen_void_ptr(n_payload, 4);
9877 
9878         ret_val = xmlHashAddEntry3(hash, key, key2, key3, payload);
9879         desret_int(ret_val);
9880         call_tests++;
9881         des_xmlHashTablePtr(n_hash, hash, 0);
9882         des_const_xmlChar_ptr(n_key, key, 1);
9883         des_const_xmlChar_ptr(n_key2, key2, 2);
9884         des_const_xmlChar_ptr(n_key3, key3, 3);
9885         des_void_ptr(n_payload, payload, 4);
9886         xmlResetLastError();
9887         if (mem_base != xmlMemBlocks()) {
9888             printf("Leak of %d blocks found in xmlHashAddEntry3",
9889 	           xmlMemBlocks() - mem_base);
9890 	    test_ret++;
9891             printf(" %d", n_hash);
9892             printf(" %d", n_key);
9893             printf(" %d", n_key2);
9894             printf(" %d", n_key3);
9895             printf(" %d", n_payload);
9896             printf("\n");
9897         }
9898     }
9899     }
9900     }
9901     }
9902     }
9903     function_tests++;
9904 
9905     return(test_ret);
9906 }
9907 
9908 
9909 static int
test_xmlHashCopy(void)9910 test_xmlHashCopy(void) {
9911     int test_ret = 0;
9912 
9913 
9914     /* missing type support */
9915     return(test_ret);
9916 }
9917 
9918 
9919 static int
test_xmlHashCreate(void)9920 test_xmlHashCreate(void) {
9921     int test_ret = 0;
9922 
9923 
9924     /* missing type support */
9925     return(test_ret);
9926 }
9927 
9928 
9929 static int
test_xmlHashCreateDict(void)9930 test_xmlHashCreateDict(void) {
9931     int test_ret = 0;
9932 
9933 
9934     /* missing type support */
9935     return(test_ret);
9936 }
9937 
9938 
9939 static int
test_xmlHashDefaultDeallocator(void)9940 test_xmlHashDefaultDeallocator(void) {
9941     int test_ret = 0;
9942 
9943     int mem_base;
9944     void * entry; /* hash table entry */
9945     int n_entry;
9946     const xmlChar * key; /* the entry's string key */
9947     int n_key;
9948 
9949     for (n_entry = 0;n_entry < gen_nb_void_ptr;n_entry++) {
9950     for (n_key = 0;n_key < gen_nb_const_xmlChar_ptr;n_key++) {
9951         mem_base = xmlMemBlocks();
9952         entry = gen_void_ptr(n_entry, 0);
9953         key = gen_const_xmlChar_ptr(n_key, 1);
9954 
9955         xmlHashDefaultDeallocator(entry, key);
9956         call_tests++;
9957         des_void_ptr(n_entry, entry, 0);
9958         des_const_xmlChar_ptr(n_key, key, 1);
9959         xmlResetLastError();
9960         if (mem_base != xmlMemBlocks()) {
9961             printf("Leak of %d blocks found in xmlHashDefaultDeallocator",
9962 	           xmlMemBlocks() - mem_base);
9963 	    test_ret++;
9964             printf(" %d", n_entry);
9965             printf(" %d", n_key);
9966             printf("\n");
9967         }
9968     }
9969     }
9970     function_tests++;
9971 
9972     return(test_ret);
9973 }
9974 
9975 
9976 static int
test_xmlHashLookup(void)9977 test_xmlHashLookup(void) {
9978     int test_ret = 0;
9979 
9980     int mem_base;
9981     void * ret_val;
9982     xmlHashTablePtr hash; /* hash table */
9983     int n_hash;
9984     const xmlChar * key; /* string key */
9985     int n_key;
9986 
9987     for (n_hash = 0;n_hash < gen_nb_xmlHashTablePtr;n_hash++) {
9988     for (n_key = 0;n_key < gen_nb_const_xmlChar_ptr;n_key++) {
9989         mem_base = xmlMemBlocks();
9990         hash = gen_xmlHashTablePtr(n_hash, 0);
9991         key = gen_const_xmlChar_ptr(n_key, 1);
9992 
9993         ret_val = xmlHashLookup(hash, key);
9994         desret_void_ptr(ret_val);
9995         call_tests++;
9996         des_xmlHashTablePtr(n_hash, hash, 0);
9997         des_const_xmlChar_ptr(n_key, key, 1);
9998         xmlResetLastError();
9999         if (mem_base != xmlMemBlocks()) {
10000             printf("Leak of %d blocks found in xmlHashLookup",
10001 	           xmlMemBlocks() - mem_base);
10002 	    test_ret++;
10003             printf(" %d", n_hash);
10004             printf(" %d", n_key);
10005             printf("\n");
10006         }
10007     }
10008     }
10009     function_tests++;
10010 
10011     return(test_ret);
10012 }
10013 
10014 
10015 static int
test_xmlHashLookup2(void)10016 test_xmlHashLookup2(void) {
10017     int test_ret = 0;
10018 
10019     int mem_base;
10020     void * ret_val;
10021     xmlHashTablePtr hash; /* hash table */
10022     int n_hash;
10023     const xmlChar * key; /* first string key */
10024     int n_key;
10025     const xmlChar * key2; /* second string key */
10026     int n_key2;
10027 
10028     for (n_hash = 0;n_hash < gen_nb_xmlHashTablePtr;n_hash++) {
10029     for (n_key = 0;n_key < gen_nb_const_xmlChar_ptr;n_key++) {
10030     for (n_key2 = 0;n_key2 < gen_nb_const_xmlChar_ptr;n_key2++) {
10031         mem_base = xmlMemBlocks();
10032         hash = gen_xmlHashTablePtr(n_hash, 0);
10033         key = gen_const_xmlChar_ptr(n_key, 1);
10034         key2 = gen_const_xmlChar_ptr(n_key2, 2);
10035 
10036         ret_val = xmlHashLookup2(hash, key, key2);
10037         desret_void_ptr(ret_val);
10038         call_tests++;
10039         des_xmlHashTablePtr(n_hash, hash, 0);
10040         des_const_xmlChar_ptr(n_key, key, 1);
10041         des_const_xmlChar_ptr(n_key2, key2, 2);
10042         xmlResetLastError();
10043         if (mem_base != xmlMemBlocks()) {
10044             printf("Leak of %d blocks found in xmlHashLookup2",
10045 	           xmlMemBlocks() - mem_base);
10046 	    test_ret++;
10047             printf(" %d", n_hash);
10048             printf(" %d", n_key);
10049             printf(" %d", n_key2);
10050             printf("\n");
10051         }
10052     }
10053     }
10054     }
10055     function_tests++;
10056 
10057     return(test_ret);
10058 }
10059 
10060 
10061 static int
test_xmlHashLookup3(void)10062 test_xmlHashLookup3(void) {
10063     int test_ret = 0;
10064 
10065     int mem_base;
10066     void * ret_val;
10067     xmlHashTablePtr hash; /* hash table */
10068     int n_hash;
10069     const xmlChar * key; /* first string key */
10070     int n_key;
10071     const xmlChar * key2; /* second string key */
10072     int n_key2;
10073     const xmlChar * key3; /* third string key */
10074     int n_key3;
10075 
10076     for (n_hash = 0;n_hash < gen_nb_xmlHashTablePtr;n_hash++) {
10077     for (n_key = 0;n_key < gen_nb_const_xmlChar_ptr;n_key++) {
10078     for (n_key2 = 0;n_key2 < gen_nb_const_xmlChar_ptr;n_key2++) {
10079     for (n_key3 = 0;n_key3 < gen_nb_const_xmlChar_ptr;n_key3++) {
10080         mem_base = xmlMemBlocks();
10081         hash = gen_xmlHashTablePtr(n_hash, 0);
10082         key = gen_const_xmlChar_ptr(n_key, 1);
10083         key2 = gen_const_xmlChar_ptr(n_key2, 2);
10084         key3 = gen_const_xmlChar_ptr(n_key3, 3);
10085 
10086         ret_val = xmlHashLookup3(hash, key, key2, key3);
10087         desret_void_ptr(ret_val);
10088         call_tests++;
10089         des_xmlHashTablePtr(n_hash, hash, 0);
10090         des_const_xmlChar_ptr(n_key, key, 1);
10091         des_const_xmlChar_ptr(n_key2, key2, 2);
10092         des_const_xmlChar_ptr(n_key3, key3, 3);
10093         xmlResetLastError();
10094         if (mem_base != xmlMemBlocks()) {
10095             printf("Leak of %d blocks found in xmlHashLookup3",
10096 	           xmlMemBlocks() - mem_base);
10097 	    test_ret++;
10098             printf(" %d", n_hash);
10099             printf(" %d", n_key);
10100             printf(" %d", n_key2);
10101             printf(" %d", n_key3);
10102             printf("\n");
10103         }
10104     }
10105     }
10106     }
10107     }
10108     function_tests++;
10109 
10110     return(test_ret);
10111 }
10112 
10113 
10114 static int
test_xmlHashQLookup(void)10115 test_xmlHashQLookup(void) {
10116     int test_ret = 0;
10117 
10118     int mem_base;
10119     void * ret_val;
10120     xmlHashTablePtr hash; /* hash table */
10121     int n_hash;
10122     const xmlChar * prefix; /* prefix of the string key */
10123     int n_prefix;
10124     const xmlChar * name; /* local name of the string key */
10125     int n_name;
10126 
10127     for (n_hash = 0;n_hash < gen_nb_xmlHashTablePtr;n_hash++) {
10128     for (n_prefix = 0;n_prefix < gen_nb_const_xmlChar_ptr;n_prefix++) {
10129     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
10130         mem_base = xmlMemBlocks();
10131         hash = gen_xmlHashTablePtr(n_hash, 0);
10132         prefix = gen_const_xmlChar_ptr(n_prefix, 1);
10133         name = gen_const_xmlChar_ptr(n_name, 2);
10134 
10135         ret_val = xmlHashQLookup(hash, prefix, name);
10136         desret_void_ptr(ret_val);
10137         call_tests++;
10138         des_xmlHashTablePtr(n_hash, hash, 0);
10139         des_const_xmlChar_ptr(n_prefix, prefix, 1);
10140         des_const_xmlChar_ptr(n_name, name, 2);
10141         xmlResetLastError();
10142         if (mem_base != xmlMemBlocks()) {
10143             printf("Leak of %d blocks found in xmlHashQLookup",
10144 	           xmlMemBlocks() - mem_base);
10145 	    test_ret++;
10146             printf(" %d", n_hash);
10147             printf(" %d", n_prefix);
10148             printf(" %d", n_name);
10149             printf("\n");
10150         }
10151     }
10152     }
10153     }
10154     function_tests++;
10155 
10156     return(test_ret);
10157 }
10158 
10159 
10160 static int
test_xmlHashQLookup2(void)10161 test_xmlHashQLookup2(void) {
10162     int test_ret = 0;
10163 
10164     int mem_base;
10165     void * ret_val;
10166     xmlHashTablePtr hash; /* hash table */
10167     int n_hash;
10168     const xmlChar * prefix; /* first prefix */
10169     int n_prefix;
10170     const xmlChar * name; /* first local name */
10171     int n_name;
10172     const xmlChar * prefix2; /* second prefix */
10173     int n_prefix2;
10174     const xmlChar * name2; /* second local name */
10175     int n_name2;
10176 
10177     for (n_hash = 0;n_hash < gen_nb_xmlHashTablePtr;n_hash++) {
10178     for (n_prefix = 0;n_prefix < gen_nb_const_xmlChar_ptr;n_prefix++) {
10179     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
10180     for (n_prefix2 = 0;n_prefix2 < gen_nb_const_xmlChar_ptr;n_prefix2++) {
10181     for (n_name2 = 0;n_name2 < gen_nb_const_xmlChar_ptr;n_name2++) {
10182         mem_base = xmlMemBlocks();
10183         hash = gen_xmlHashTablePtr(n_hash, 0);
10184         prefix = gen_const_xmlChar_ptr(n_prefix, 1);
10185         name = gen_const_xmlChar_ptr(n_name, 2);
10186         prefix2 = gen_const_xmlChar_ptr(n_prefix2, 3);
10187         name2 = gen_const_xmlChar_ptr(n_name2, 4);
10188 
10189         ret_val = xmlHashQLookup2(hash, prefix, name, prefix2, name2);
10190         desret_void_ptr(ret_val);
10191         call_tests++;
10192         des_xmlHashTablePtr(n_hash, hash, 0);
10193         des_const_xmlChar_ptr(n_prefix, prefix, 1);
10194         des_const_xmlChar_ptr(n_name, name, 2);
10195         des_const_xmlChar_ptr(n_prefix2, prefix2, 3);
10196         des_const_xmlChar_ptr(n_name2, name2, 4);
10197         xmlResetLastError();
10198         if (mem_base != xmlMemBlocks()) {
10199             printf("Leak of %d blocks found in xmlHashQLookup2",
10200 	           xmlMemBlocks() - mem_base);
10201 	    test_ret++;
10202             printf(" %d", n_hash);
10203             printf(" %d", n_prefix);
10204             printf(" %d", n_name);
10205             printf(" %d", n_prefix2);
10206             printf(" %d", n_name2);
10207             printf("\n");
10208         }
10209     }
10210     }
10211     }
10212     }
10213     }
10214     function_tests++;
10215 
10216     return(test_ret);
10217 }
10218 
10219 
10220 static int
test_xmlHashQLookup3(void)10221 test_xmlHashQLookup3(void) {
10222     int test_ret = 0;
10223 
10224     int mem_base;
10225     void * ret_val;
10226     xmlHashTablePtr hash; /* hash table */
10227     int n_hash;
10228     const xmlChar * prefix; /* first prefix */
10229     int n_prefix;
10230     const xmlChar * name; /* first local name */
10231     int n_name;
10232     const xmlChar * prefix2; /* second prefix */
10233     int n_prefix2;
10234     const xmlChar * name2; /* second local name */
10235     int n_name2;
10236     const xmlChar * prefix3; /* third prefix */
10237     int n_prefix3;
10238     const xmlChar * name3; /* third local name */
10239     int n_name3;
10240 
10241     for (n_hash = 0;n_hash < gen_nb_xmlHashTablePtr;n_hash++) {
10242     for (n_prefix = 0;n_prefix < gen_nb_const_xmlChar_ptr;n_prefix++) {
10243     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
10244     for (n_prefix2 = 0;n_prefix2 < gen_nb_const_xmlChar_ptr;n_prefix2++) {
10245     for (n_name2 = 0;n_name2 < gen_nb_const_xmlChar_ptr;n_name2++) {
10246     for (n_prefix3 = 0;n_prefix3 < gen_nb_const_xmlChar_ptr;n_prefix3++) {
10247     for (n_name3 = 0;n_name3 < gen_nb_const_xmlChar_ptr;n_name3++) {
10248         mem_base = xmlMemBlocks();
10249         hash = gen_xmlHashTablePtr(n_hash, 0);
10250         prefix = gen_const_xmlChar_ptr(n_prefix, 1);
10251         name = gen_const_xmlChar_ptr(n_name, 2);
10252         prefix2 = gen_const_xmlChar_ptr(n_prefix2, 3);
10253         name2 = gen_const_xmlChar_ptr(n_name2, 4);
10254         prefix3 = gen_const_xmlChar_ptr(n_prefix3, 5);
10255         name3 = gen_const_xmlChar_ptr(n_name3, 6);
10256 
10257         ret_val = xmlHashQLookup3(hash, prefix, name, prefix2, name2, prefix3, name3);
10258         desret_void_ptr(ret_val);
10259         call_tests++;
10260         des_xmlHashTablePtr(n_hash, hash, 0);
10261         des_const_xmlChar_ptr(n_prefix, prefix, 1);
10262         des_const_xmlChar_ptr(n_name, name, 2);
10263         des_const_xmlChar_ptr(n_prefix2, prefix2, 3);
10264         des_const_xmlChar_ptr(n_name2, name2, 4);
10265         des_const_xmlChar_ptr(n_prefix3, prefix3, 5);
10266         des_const_xmlChar_ptr(n_name3, name3, 6);
10267         xmlResetLastError();
10268         if (mem_base != xmlMemBlocks()) {
10269             printf("Leak of %d blocks found in xmlHashQLookup3",
10270 	           xmlMemBlocks() - mem_base);
10271 	    test_ret++;
10272             printf(" %d", n_hash);
10273             printf(" %d", n_prefix);
10274             printf(" %d", n_name);
10275             printf(" %d", n_prefix2);
10276             printf(" %d", n_name2);
10277             printf(" %d", n_prefix3);
10278             printf(" %d", n_name3);
10279             printf("\n");
10280         }
10281     }
10282     }
10283     }
10284     }
10285     }
10286     }
10287     }
10288     function_tests++;
10289 
10290     return(test_ret);
10291 }
10292 
10293 
10294 static int
test_xmlHashRemoveEntry(void)10295 test_xmlHashRemoveEntry(void) {
10296     int test_ret = 0;
10297 
10298     int mem_base;
10299     int ret_val;
10300     xmlHashTablePtr hash; /* hash table */
10301     int n_hash;
10302     const xmlChar * key; /* string key */
10303     int n_key;
10304     xmlHashDeallocator dealloc; /* deallocator function for removed item or NULL */
10305     int n_dealloc;
10306 
10307     for (n_hash = 0;n_hash < gen_nb_xmlHashTablePtr;n_hash++) {
10308     for (n_key = 0;n_key < gen_nb_const_xmlChar_ptr;n_key++) {
10309     for (n_dealloc = 0;n_dealloc < gen_nb_xmlHashDeallocator;n_dealloc++) {
10310         mem_base = xmlMemBlocks();
10311         hash = gen_xmlHashTablePtr(n_hash, 0);
10312         key = gen_const_xmlChar_ptr(n_key, 1);
10313         dealloc = gen_xmlHashDeallocator(n_dealloc, 2);
10314 
10315         ret_val = xmlHashRemoveEntry(hash, key, dealloc);
10316         desret_int(ret_val);
10317         call_tests++;
10318         des_xmlHashTablePtr(n_hash, hash, 0);
10319         des_const_xmlChar_ptr(n_key, key, 1);
10320         des_xmlHashDeallocator(n_dealloc, dealloc, 2);
10321         xmlResetLastError();
10322         if (mem_base != xmlMemBlocks()) {
10323             printf("Leak of %d blocks found in xmlHashRemoveEntry",
10324 	           xmlMemBlocks() - mem_base);
10325 	    test_ret++;
10326             printf(" %d", n_hash);
10327             printf(" %d", n_key);
10328             printf(" %d", n_dealloc);
10329             printf("\n");
10330         }
10331     }
10332     }
10333     }
10334     function_tests++;
10335 
10336     return(test_ret);
10337 }
10338 
10339 
10340 static int
test_xmlHashRemoveEntry2(void)10341 test_xmlHashRemoveEntry2(void) {
10342     int test_ret = 0;
10343 
10344     int mem_base;
10345     int ret_val;
10346     xmlHashTablePtr hash; /* hash table */
10347     int n_hash;
10348     const xmlChar * key; /* first string key */
10349     int n_key;
10350     const xmlChar * key2; /* second string key */
10351     int n_key2;
10352     xmlHashDeallocator dealloc; /* deallocator function for removed item or NULL */
10353     int n_dealloc;
10354 
10355     for (n_hash = 0;n_hash < gen_nb_xmlHashTablePtr;n_hash++) {
10356     for (n_key = 0;n_key < gen_nb_const_xmlChar_ptr;n_key++) {
10357     for (n_key2 = 0;n_key2 < gen_nb_const_xmlChar_ptr;n_key2++) {
10358     for (n_dealloc = 0;n_dealloc < gen_nb_xmlHashDeallocator;n_dealloc++) {
10359         mem_base = xmlMemBlocks();
10360         hash = gen_xmlHashTablePtr(n_hash, 0);
10361         key = gen_const_xmlChar_ptr(n_key, 1);
10362         key2 = gen_const_xmlChar_ptr(n_key2, 2);
10363         dealloc = gen_xmlHashDeallocator(n_dealloc, 3);
10364 
10365         ret_val = xmlHashRemoveEntry2(hash, key, key2, dealloc);
10366         desret_int(ret_val);
10367         call_tests++;
10368         des_xmlHashTablePtr(n_hash, hash, 0);
10369         des_const_xmlChar_ptr(n_key, key, 1);
10370         des_const_xmlChar_ptr(n_key2, key2, 2);
10371         des_xmlHashDeallocator(n_dealloc, dealloc, 3);
10372         xmlResetLastError();
10373         if (mem_base != xmlMemBlocks()) {
10374             printf("Leak of %d blocks found in xmlHashRemoveEntry2",
10375 	           xmlMemBlocks() - mem_base);
10376 	    test_ret++;
10377             printf(" %d", n_hash);
10378             printf(" %d", n_key);
10379             printf(" %d", n_key2);
10380             printf(" %d", n_dealloc);
10381             printf("\n");
10382         }
10383     }
10384     }
10385     }
10386     }
10387     function_tests++;
10388 
10389     return(test_ret);
10390 }
10391 
10392 
10393 static int
test_xmlHashRemoveEntry3(void)10394 test_xmlHashRemoveEntry3(void) {
10395     int test_ret = 0;
10396 
10397     int mem_base;
10398     int ret_val;
10399     xmlHashTablePtr hash; /* hash table */
10400     int n_hash;
10401     const xmlChar * key; /* first string key */
10402     int n_key;
10403     const xmlChar * key2; /* second string key */
10404     int n_key2;
10405     const xmlChar * key3; /* third string key */
10406     int n_key3;
10407     xmlHashDeallocator dealloc; /* deallocator function for removed item or NULL */
10408     int n_dealloc;
10409 
10410     for (n_hash = 0;n_hash < gen_nb_xmlHashTablePtr;n_hash++) {
10411     for (n_key = 0;n_key < gen_nb_const_xmlChar_ptr;n_key++) {
10412     for (n_key2 = 0;n_key2 < gen_nb_const_xmlChar_ptr;n_key2++) {
10413     for (n_key3 = 0;n_key3 < gen_nb_const_xmlChar_ptr;n_key3++) {
10414     for (n_dealloc = 0;n_dealloc < gen_nb_xmlHashDeallocator;n_dealloc++) {
10415         mem_base = xmlMemBlocks();
10416         hash = gen_xmlHashTablePtr(n_hash, 0);
10417         key = gen_const_xmlChar_ptr(n_key, 1);
10418         key2 = gen_const_xmlChar_ptr(n_key2, 2);
10419         key3 = gen_const_xmlChar_ptr(n_key3, 3);
10420         dealloc = gen_xmlHashDeallocator(n_dealloc, 4);
10421 
10422         ret_val = xmlHashRemoveEntry3(hash, key, key2, key3, dealloc);
10423         desret_int(ret_val);
10424         call_tests++;
10425         des_xmlHashTablePtr(n_hash, hash, 0);
10426         des_const_xmlChar_ptr(n_key, key, 1);
10427         des_const_xmlChar_ptr(n_key2, key2, 2);
10428         des_const_xmlChar_ptr(n_key3, key3, 3);
10429         des_xmlHashDeallocator(n_dealloc, dealloc, 4);
10430         xmlResetLastError();
10431         if (mem_base != xmlMemBlocks()) {
10432             printf("Leak of %d blocks found in xmlHashRemoveEntry3",
10433 	           xmlMemBlocks() - mem_base);
10434 	    test_ret++;
10435             printf(" %d", n_hash);
10436             printf(" %d", n_key);
10437             printf(" %d", n_key2);
10438             printf(" %d", n_key3);
10439             printf(" %d", n_dealloc);
10440             printf("\n");
10441         }
10442     }
10443     }
10444     }
10445     }
10446     }
10447     function_tests++;
10448 
10449     return(test_ret);
10450 }
10451 
10452 
10453 static int
test_xmlHashScan(void)10454 test_xmlHashScan(void) {
10455     int test_ret = 0;
10456 
10457 
10458     /* missing type support */
10459     return(test_ret);
10460 }
10461 
10462 
10463 static int
test_xmlHashScan3(void)10464 test_xmlHashScan3(void) {
10465     int test_ret = 0;
10466 
10467 
10468     /* missing type support */
10469     return(test_ret);
10470 }
10471 
10472 
10473 static int
test_xmlHashScanFull(void)10474 test_xmlHashScanFull(void) {
10475     int test_ret = 0;
10476 
10477 
10478     /* missing type support */
10479     return(test_ret);
10480 }
10481 
10482 
10483 static int
test_xmlHashScanFull3(void)10484 test_xmlHashScanFull3(void) {
10485     int test_ret = 0;
10486 
10487 
10488     /* missing type support */
10489     return(test_ret);
10490 }
10491 
10492 
10493 static int
test_xmlHashSize(void)10494 test_xmlHashSize(void) {
10495     int test_ret = 0;
10496 
10497     int mem_base;
10498     int ret_val;
10499     xmlHashTablePtr hash; /* hash table */
10500     int n_hash;
10501 
10502     for (n_hash = 0;n_hash < gen_nb_xmlHashTablePtr;n_hash++) {
10503         mem_base = xmlMemBlocks();
10504         hash = gen_xmlHashTablePtr(n_hash, 0);
10505 
10506         ret_val = xmlHashSize(hash);
10507         desret_int(ret_val);
10508         call_tests++;
10509         des_xmlHashTablePtr(n_hash, hash, 0);
10510         xmlResetLastError();
10511         if (mem_base != xmlMemBlocks()) {
10512             printf("Leak of %d blocks found in xmlHashSize",
10513 	           xmlMemBlocks() - mem_base);
10514 	    test_ret++;
10515             printf(" %d", n_hash);
10516             printf("\n");
10517         }
10518     }
10519     function_tests++;
10520 
10521     return(test_ret);
10522 }
10523 
10524 
10525 static int
test_xmlHashUpdateEntry(void)10526 test_xmlHashUpdateEntry(void) {
10527     int test_ret = 0;
10528 
10529     int mem_base;
10530     int ret_val;
10531     xmlHashTablePtr hash; /* hash table */
10532     int n_hash;
10533     const xmlChar * key; /* string key */
10534     int n_key;
10535     void * payload; /* pointer to the payload */
10536     int n_payload;
10537     xmlHashDeallocator dealloc; /* deallocator function for replaced item or NULL */
10538     int n_dealloc;
10539 
10540     for (n_hash = 0;n_hash < gen_nb_xmlHashTablePtr;n_hash++) {
10541     for (n_key = 0;n_key < gen_nb_const_xmlChar_ptr;n_key++) {
10542     for (n_payload = 0;n_payload < gen_nb_void_ptr;n_payload++) {
10543     for (n_dealloc = 0;n_dealloc < gen_nb_xmlHashDeallocator;n_dealloc++) {
10544         mem_base = xmlMemBlocks();
10545         hash = gen_xmlHashTablePtr(n_hash, 0);
10546         key = gen_const_xmlChar_ptr(n_key, 1);
10547         payload = gen_void_ptr(n_payload, 2);
10548         dealloc = gen_xmlHashDeallocator(n_dealloc, 3);
10549 
10550         ret_val = xmlHashUpdateEntry(hash, key, payload, dealloc);
10551         desret_int(ret_val);
10552         call_tests++;
10553         des_xmlHashTablePtr(n_hash, hash, 0);
10554         des_const_xmlChar_ptr(n_key, key, 1);
10555         des_void_ptr(n_payload, payload, 2);
10556         des_xmlHashDeallocator(n_dealloc, dealloc, 3);
10557         xmlResetLastError();
10558         if (mem_base != xmlMemBlocks()) {
10559             printf("Leak of %d blocks found in xmlHashUpdateEntry",
10560 	           xmlMemBlocks() - mem_base);
10561 	    test_ret++;
10562             printf(" %d", n_hash);
10563             printf(" %d", n_key);
10564             printf(" %d", n_payload);
10565             printf(" %d", n_dealloc);
10566             printf("\n");
10567         }
10568     }
10569     }
10570     }
10571     }
10572     function_tests++;
10573 
10574     return(test_ret);
10575 }
10576 
10577 
10578 static int
test_xmlHashUpdateEntry2(void)10579 test_xmlHashUpdateEntry2(void) {
10580     int test_ret = 0;
10581 
10582     int mem_base;
10583     int ret_val;
10584     xmlHashTablePtr hash; /* hash table */
10585     int n_hash;
10586     const xmlChar * key; /* first string key */
10587     int n_key;
10588     const xmlChar * key2; /* second string key */
10589     int n_key2;
10590     void * payload; /* pointer to the payload */
10591     int n_payload;
10592     xmlHashDeallocator dealloc; /* deallocator function for replaced item or NULL */
10593     int n_dealloc;
10594 
10595     for (n_hash = 0;n_hash < gen_nb_xmlHashTablePtr;n_hash++) {
10596     for (n_key = 0;n_key < gen_nb_const_xmlChar_ptr;n_key++) {
10597     for (n_key2 = 0;n_key2 < gen_nb_const_xmlChar_ptr;n_key2++) {
10598     for (n_payload = 0;n_payload < gen_nb_void_ptr;n_payload++) {
10599     for (n_dealloc = 0;n_dealloc < gen_nb_xmlHashDeallocator;n_dealloc++) {
10600         mem_base = xmlMemBlocks();
10601         hash = gen_xmlHashTablePtr(n_hash, 0);
10602         key = gen_const_xmlChar_ptr(n_key, 1);
10603         key2 = gen_const_xmlChar_ptr(n_key2, 2);
10604         payload = gen_void_ptr(n_payload, 3);
10605         dealloc = gen_xmlHashDeallocator(n_dealloc, 4);
10606 
10607         ret_val = xmlHashUpdateEntry2(hash, key, key2, payload, dealloc);
10608         desret_int(ret_val);
10609         call_tests++;
10610         des_xmlHashTablePtr(n_hash, hash, 0);
10611         des_const_xmlChar_ptr(n_key, key, 1);
10612         des_const_xmlChar_ptr(n_key2, key2, 2);
10613         des_void_ptr(n_payload, payload, 3);
10614         des_xmlHashDeallocator(n_dealloc, dealloc, 4);
10615         xmlResetLastError();
10616         if (mem_base != xmlMemBlocks()) {
10617             printf("Leak of %d blocks found in xmlHashUpdateEntry2",
10618 	           xmlMemBlocks() - mem_base);
10619 	    test_ret++;
10620             printf(" %d", n_hash);
10621             printf(" %d", n_key);
10622             printf(" %d", n_key2);
10623             printf(" %d", n_payload);
10624             printf(" %d", n_dealloc);
10625             printf("\n");
10626         }
10627     }
10628     }
10629     }
10630     }
10631     }
10632     function_tests++;
10633 
10634     return(test_ret);
10635 }
10636 
10637 
10638 static int
test_xmlHashUpdateEntry3(void)10639 test_xmlHashUpdateEntry3(void) {
10640     int test_ret = 0;
10641 
10642     int mem_base;
10643     int ret_val;
10644     xmlHashTablePtr hash; /* hash table */
10645     int n_hash;
10646     const xmlChar * key; /* first string key */
10647     int n_key;
10648     const xmlChar * key2; /* second string key */
10649     int n_key2;
10650     const xmlChar * key3; /* third string key */
10651     int n_key3;
10652     void * payload; /* pointer to the payload */
10653     int n_payload;
10654     xmlHashDeallocator dealloc; /* deallocator function for replaced item or NULL */
10655     int n_dealloc;
10656 
10657     for (n_hash = 0;n_hash < gen_nb_xmlHashTablePtr;n_hash++) {
10658     for (n_key = 0;n_key < gen_nb_const_xmlChar_ptr;n_key++) {
10659     for (n_key2 = 0;n_key2 < gen_nb_const_xmlChar_ptr;n_key2++) {
10660     for (n_key3 = 0;n_key3 < gen_nb_const_xmlChar_ptr;n_key3++) {
10661     for (n_payload = 0;n_payload < gen_nb_void_ptr;n_payload++) {
10662     for (n_dealloc = 0;n_dealloc < gen_nb_xmlHashDeallocator;n_dealloc++) {
10663         mem_base = xmlMemBlocks();
10664         hash = gen_xmlHashTablePtr(n_hash, 0);
10665         key = gen_const_xmlChar_ptr(n_key, 1);
10666         key2 = gen_const_xmlChar_ptr(n_key2, 2);
10667         key3 = gen_const_xmlChar_ptr(n_key3, 3);
10668         payload = gen_void_ptr(n_payload, 4);
10669         dealloc = gen_xmlHashDeallocator(n_dealloc, 5);
10670 
10671         ret_val = xmlHashUpdateEntry3(hash, key, key2, key3, payload, dealloc);
10672         desret_int(ret_val);
10673         call_tests++;
10674         des_xmlHashTablePtr(n_hash, hash, 0);
10675         des_const_xmlChar_ptr(n_key, key, 1);
10676         des_const_xmlChar_ptr(n_key2, key2, 2);
10677         des_const_xmlChar_ptr(n_key3, key3, 3);
10678         des_void_ptr(n_payload, payload, 4);
10679         des_xmlHashDeallocator(n_dealloc, dealloc, 5);
10680         xmlResetLastError();
10681         if (mem_base != xmlMemBlocks()) {
10682             printf("Leak of %d blocks found in xmlHashUpdateEntry3",
10683 	           xmlMemBlocks() - mem_base);
10684 	    test_ret++;
10685             printf(" %d", n_hash);
10686             printf(" %d", n_key);
10687             printf(" %d", n_key2);
10688             printf(" %d", n_key3);
10689             printf(" %d", n_payload);
10690             printf(" %d", n_dealloc);
10691             printf("\n");
10692         }
10693     }
10694     }
10695     }
10696     }
10697     }
10698     }
10699     function_tests++;
10700 
10701     return(test_ret);
10702 }
10703 
10704 static int
test_hash(void)10705 test_hash(void) {
10706     int test_ret = 0;
10707 
10708     if (quiet == 0) printf("Testing hash : 17 of 25 functions ...\n");
10709     test_ret += test_xmlHashAddEntry();
10710     test_ret += test_xmlHashAddEntry2();
10711     test_ret += test_xmlHashAddEntry3();
10712     test_ret += test_xmlHashCopy();
10713     test_ret += test_xmlHashCreate();
10714     test_ret += test_xmlHashCreateDict();
10715     test_ret += test_xmlHashDefaultDeallocator();
10716     test_ret += test_xmlHashLookup();
10717     test_ret += test_xmlHashLookup2();
10718     test_ret += test_xmlHashLookup3();
10719     test_ret += test_xmlHashQLookup();
10720     test_ret += test_xmlHashQLookup2();
10721     test_ret += test_xmlHashQLookup3();
10722     test_ret += test_xmlHashRemoveEntry();
10723     test_ret += test_xmlHashRemoveEntry2();
10724     test_ret += test_xmlHashRemoveEntry3();
10725     test_ret += test_xmlHashScan();
10726     test_ret += test_xmlHashScan3();
10727     test_ret += test_xmlHashScanFull();
10728     test_ret += test_xmlHashScanFull3();
10729     test_ret += test_xmlHashSize();
10730     test_ret += test_xmlHashUpdateEntry();
10731     test_ret += test_xmlHashUpdateEntry2();
10732     test_ret += test_xmlHashUpdateEntry3();
10733 
10734     if (test_ret != 0)
10735 	printf("Module hash: %d errors\n", test_ret);
10736     return(test_ret);
10737 }
10738 
10739 #define gen_nb_xmlLinkPtr 1
10740 #define gen_xmlLinkPtr(no, nr) NULL
10741 #define des_xmlLinkPtr(no, val, nr)
10742 
10743 static int
test_xmlLinkGetData(void)10744 test_xmlLinkGetData(void) {
10745     int test_ret = 0;
10746 
10747     int mem_base;
10748     void * ret_val;
10749     xmlLinkPtr lk; /* a link */
10750     int n_lk;
10751 
10752     for (n_lk = 0;n_lk < gen_nb_xmlLinkPtr;n_lk++) {
10753         mem_base = xmlMemBlocks();
10754         lk = gen_xmlLinkPtr(n_lk, 0);
10755 
10756         ret_val = xmlLinkGetData(lk);
10757         desret_void_ptr(ret_val);
10758         call_tests++;
10759         des_xmlLinkPtr(n_lk, lk, 0);
10760         xmlResetLastError();
10761         if (mem_base != xmlMemBlocks()) {
10762             printf("Leak of %d blocks found in xmlLinkGetData",
10763 	           xmlMemBlocks() - mem_base);
10764 	    test_ret++;
10765             printf(" %d", n_lk);
10766             printf("\n");
10767         }
10768     }
10769     function_tests++;
10770 
10771     return(test_ret);
10772 }
10773 
10774 
10775 static int
test_xmlListAppend(void)10776 test_xmlListAppend(void) {
10777     int test_ret = 0;
10778 
10779     int mem_base;
10780     int ret_val;
10781     xmlListPtr l; /* a list */
10782     int n_l;
10783     void * data; /* the data */
10784     int n_data;
10785 
10786     for (n_l = 0;n_l < gen_nb_xmlListPtr;n_l++) {
10787     for (n_data = 0;n_data < gen_nb_userdata;n_data++) {
10788         mem_base = xmlMemBlocks();
10789         l = gen_xmlListPtr(n_l, 0);
10790         data = gen_userdata(n_data, 1);
10791 
10792         ret_val = xmlListAppend(l, data);
10793         desret_int(ret_val);
10794         call_tests++;
10795         des_xmlListPtr(n_l, l, 0);
10796         des_userdata(n_data, data, 1);
10797         xmlResetLastError();
10798         if (mem_base != xmlMemBlocks()) {
10799             printf("Leak of %d blocks found in xmlListAppend",
10800 	           xmlMemBlocks() - mem_base);
10801 	    test_ret++;
10802             printf(" %d", n_l);
10803             printf(" %d", n_data);
10804             printf("\n");
10805         }
10806     }
10807     }
10808     function_tests++;
10809 
10810     return(test_ret);
10811 }
10812 
10813 
10814 static int
test_xmlListClear(void)10815 test_xmlListClear(void) {
10816     int test_ret = 0;
10817 
10818     int mem_base;
10819     xmlListPtr l; /* a list */
10820     int n_l;
10821 
10822     for (n_l = 0;n_l < gen_nb_xmlListPtr;n_l++) {
10823         mem_base = xmlMemBlocks();
10824         l = gen_xmlListPtr(n_l, 0);
10825 
10826         xmlListClear(l);
10827         call_tests++;
10828         des_xmlListPtr(n_l, l, 0);
10829         xmlResetLastError();
10830         if (mem_base != xmlMemBlocks()) {
10831             printf("Leak of %d blocks found in xmlListClear",
10832 	           xmlMemBlocks() - mem_base);
10833 	    test_ret++;
10834             printf(" %d", n_l);
10835             printf("\n");
10836         }
10837     }
10838     function_tests++;
10839 
10840     return(test_ret);
10841 }
10842 
10843 
10844 static int
test_xmlListCopy(void)10845 test_xmlListCopy(void) {
10846     int test_ret = 0;
10847 
10848     int mem_base;
10849     int ret_val;
10850     xmlListPtr cur; /* the new list */
10851     int n_cur;
10852     xmlListPtr old; /* the old list */
10853     int n_old;
10854 
10855     for (n_cur = 0;n_cur < gen_nb_xmlListPtr;n_cur++) {
10856     for (n_old = 0;n_old < gen_nb_xmlListPtr;n_old++) {
10857         mem_base = xmlMemBlocks();
10858         cur = gen_xmlListPtr(n_cur, 0);
10859         old = gen_xmlListPtr(n_old, 1);
10860 
10861         ret_val = xmlListCopy(cur, old);
10862         desret_int(ret_val);
10863         call_tests++;
10864         des_xmlListPtr(n_cur, cur, 0);
10865         des_xmlListPtr(n_old, old, 1);
10866         xmlResetLastError();
10867         if (mem_base != xmlMemBlocks()) {
10868             printf("Leak of %d blocks found in xmlListCopy",
10869 	           xmlMemBlocks() - mem_base);
10870 	    test_ret++;
10871             printf(" %d", n_cur);
10872             printf(" %d", n_old);
10873             printf("\n");
10874         }
10875     }
10876     }
10877     function_tests++;
10878 
10879     return(test_ret);
10880 }
10881 
10882 
10883 static int
test_xmlListCreate(void)10884 test_xmlListCreate(void) {
10885     int test_ret = 0;
10886 
10887 
10888     /* missing type support */
10889     return(test_ret);
10890 }
10891 
10892 
10893 static int
test_xmlListDup(void)10894 test_xmlListDup(void) {
10895     int test_ret = 0;
10896 
10897 
10898     /* missing type support */
10899     return(test_ret);
10900 }
10901 
10902 
10903 static int
test_xmlListEmpty(void)10904 test_xmlListEmpty(void) {
10905     int test_ret = 0;
10906 
10907     int mem_base;
10908     int ret_val;
10909     xmlListPtr l; /* a list */
10910     int n_l;
10911 
10912     for (n_l = 0;n_l < gen_nb_xmlListPtr;n_l++) {
10913         mem_base = xmlMemBlocks();
10914         l = gen_xmlListPtr(n_l, 0);
10915 
10916         ret_val = xmlListEmpty(l);
10917         desret_int(ret_val);
10918         call_tests++;
10919         des_xmlListPtr(n_l, l, 0);
10920         xmlResetLastError();
10921         if (mem_base != xmlMemBlocks()) {
10922             printf("Leak of %d blocks found in xmlListEmpty",
10923 	           xmlMemBlocks() - mem_base);
10924 	    test_ret++;
10925             printf(" %d", n_l);
10926             printf("\n");
10927         }
10928     }
10929     function_tests++;
10930 
10931     return(test_ret);
10932 }
10933 
10934 
10935 static int
test_xmlListEnd(void)10936 test_xmlListEnd(void) {
10937     int test_ret = 0;
10938 
10939 
10940     /* missing type support */
10941     return(test_ret);
10942 }
10943 
10944 
10945 static int
test_xmlListFront(void)10946 test_xmlListFront(void) {
10947     int test_ret = 0;
10948 
10949 
10950     /* missing type support */
10951     return(test_ret);
10952 }
10953 
10954 
10955 static int
test_xmlListInsert(void)10956 test_xmlListInsert(void) {
10957     int test_ret = 0;
10958 
10959     int mem_base;
10960     int ret_val;
10961     xmlListPtr l; /* a list */
10962     int n_l;
10963     void * data; /* the data */
10964     int n_data;
10965 
10966     for (n_l = 0;n_l < gen_nb_xmlListPtr;n_l++) {
10967     for (n_data = 0;n_data < gen_nb_userdata;n_data++) {
10968         mem_base = xmlMemBlocks();
10969         l = gen_xmlListPtr(n_l, 0);
10970         data = gen_userdata(n_data, 1);
10971 
10972         ret_val = xmlListInsert(l, data);
10973         desret_int(ret_val);
10974         call_tests++;
10975         des_xmlListPtr(n_l, l, 0);
10976         des_userdata(n_data, data, 1);
10977         xmlResetLastError();
10978         if (mem_base != xmlMemBlocks()) {
10979             printf("Leak of %d blocks found in xmlListInsert",
10980 	           xmlMemBlocks() - mem_base);
10981 	    test_ret++;
10982             printf(" %d", n_l);
10983             printf(" %d", n_data);
10984             printf("\n");
10985         }
10986     }
10987     }
10988     function_tests++;
10989 
10990     return(test_ret);
10991 }
10992 
10993 
10994 static int
test_xmlListMerge(void)10995 test_xmlListMerge(void) {
10996     int test_ret = 0;
10997 
10998     int mem_base;
10999     xmlListPtr l1; /* the original list */
11000     int n_l1;
11001     xmlListPtr l2; /* the new list */
11002     int n_l2;
11003 
11004     for (n_l1 = 0;n_l1 < gen_nb_xmlListPtr;n_l1++) {
11005     for (n_l2 = 0;n_l2 < gen_nb_xmlListPtr;n_l2++) {
11006         mem_base = xmlMemBlocks();
11007         l1 = gen_xmlListPtr(n_l1, 0);
11008         l2 = gen_xmlListPtr(n_l2, 1);
11009 
11010         xmlListMerge(l1, l2);
11011         call_tests++;
11012         des_xmlListPtr(n_l1, l1, 0);
11013         des_xmlListPtr(n_l2, l2, 1);
11014         xmlResetLastError();
11015         if (mem_base != xmlMemBlocks()) {
11016             printf("Leak of %d blocks found in xmlListMerge",
11017 	           xmlMemBlocks() - mem_base);
11018 	    test_ret++;
11019             printf(" %d", n_l1);
11020             printf(" %d", n_l2);
11021             printf("\n");
11022         }
11023     }
11024     }
11025     function_tests++;
11026 
11027     return(test_ret);
11028 }
11029 
11030 
11031 static int
test_xmlListPopBack(void)11032 test_xmlListPopBack(void) {
11033     int test_ret = 0;
11034 
11035     int mem_base;
11036     xmlListPtr l; /* a list */
11037     int n_l;
11038 
11039     for (n_l = 0;n_l < gen_nb_xmlListPtr;n_l++) {
11040         mem_base = xmlMemBlocks();
11041         l = gen_xmlListPtr(n_l, 0);
11042 
11043         xmlListPopBack(l);
11044         call_tests++;
11045         des_xmlListPtr(n_l, l, 0);
11046         xmlResetLastError();
11047         if (mem_base != xmlMemBlocks()) {
11048             printf("Leak of %d blocks found in xmlListPopBack",
11049 	           xmlMemBlocks() - mem_base);
11050 	    test_ret++;
11051             printf(" %d", n_l);
11052             printf("\n");
11053         }
11054     }
11055     function_tests++;
11056 
11057     return(test_ret);
11058 }
11059 
11060 
11061 static int
test_xmlListPopFront(void)11062 test_xmlListPopFront(void) {
11063     int test_ret = 0;
11064 
11065     int mem_base;
11066     xmlListPtr l; /* a list */
11067     int n_l;
11068 
11069     for (n_l = 0;n_l < gen_nb_xmlListPtr;n_l++) {
11070         mem_base = xmlMemBlocks();
11071         l = gen_xmlListPtr(n_l, 0);
11072 
11073         xmlListPopFront(l);
11074         call_tests++;
11075         des_xmlListPtr(n_l, l, 0);
11076         xmlResetLastError();
11077         if (mem_base != xmlMemBlocks()) {
11078             printf("Leak of %d blocks found in xmlListPopFront",
11079 	           xmlMemBlocks() - mem_base);
11080 	    test_ret++;
11081             printf(" %d", n_l);
11082             printf("\n");
11083         }
11084     }
11085     function_tests++;
11086 
11087     return(test_ret);
11088 }
11089 
11090 
11091 static int
test_xmlListPushBack(void)11092 test_xmlListPushBack(void) {
11093     int test_ret = 0;
11094 
11095     int mem_base;
11096     int ret_val;
11097     xmlListPtr l; /* a list */
11098     int n_l;
11099     void * data; /* new data */
11100     int n_data;
11101 
11102     for (n_l = 0;n_l < gen_nb_xmlListPtr;n_l++) {
11103     for (n_data = 0;n_data < gen_nb_userdata;n_data++) {
11104         mem_base = xmlMemBlocks();
11105         l = gen_xmlListPtr(n_l, 0);
11106         data = gen_userdata(n_data, 1);
11107 
11108         ret_val = xmlListPushBack(l, data);
11109         desret_int(ret_val);
11110         call_tests++;
11111         des_xmlListPtr(n_l, l, 0);
11112         des_userdata(n_data, data, 1);
11113         xmlResetLastError();
11114         if (mem_base != xmlMemBlocks()) {
11115             printf("Leak of %d blocks found in xmlListPushBack",
11116 	           xmlMemBlocks() - mem_base);
11117 	    test_ret++;
11118             printf(" %d", n_l);
11119             printf(" %d", n_data);
11120             printf("\n");
11121         }
11122     }
11123     }
11124     function_tests++;
11125 
11126     return(test_ret);
11127 }
11128 
11129 
11130 static int
test_xmlListPushFront(void)11131 test_xmlListPushFront(void) {
11132     int test_ret = 0;
11133 
11134     int mem_base;
11135     int ret_val;
11136     xmlListPtr l; /* a list */
11137     int n_l;
11138     void * data; /* new data */
11139     int n_data;
11140 
11141     for (n_l = 0;n_l < gen_nb_xmlListPtr;n_l++) {
11142     for (n_data = 0;n_data < gen_nb_userdata;n_data++) {
11143         mem_base = xmlMemBlocks();
11144         l = gen_xmlListPtr(n_l, 0);
11145         data = gen_userdata(n_data, 1);
11146 
11147         ret_val = xmlListPushFront(l, data);
11148         desret_int(ret_val);
11149         call_tests++;
11150         des_xmlListPtr(n_l, l, 0);
11151         des_userdata(n_data, data, 1);
11152         xmlResetLastError();
11153         if (mem_base != xmlMemBlocks()) {
11154             printf("Leak of %d blocks found in xmlListPushFront",
11155 	           xmlMemBlocks() - mem_base);
11156 	    test_ret++;
11157             printf(" %d", n_l);
11158             printf(" %d", n_data);
11159             printf("\n");
11160         }
11161     }
11162     }
11163     function_tests++;
11164 
11165     return(test_ret);
11166 }
11167 
11168 
11169 static int
test_xmlListRemoveAll(void)11170 test_xmlListRemoveAll(void) {
11171     int test_ret = 0;
11172 
11173     int mem_base;
11174     int ret_val;
11175     xmlListPtr l; /* a list */
11176     int n_l;
11177     void * data; /* list data */
11178     int n_data;
11179 
11180     for (n_l = 0;n_l < gen_nb_xmlListPtr;n_l++) {
11181     for (n_data = 0;n_data < gen_nb_userdata;n_data++) {
11182         mem_base = xmlMemBlocks();
11183         l = gen_xmlListPtr(n_l, 0);
11184         data = gen_userdata(n_data, 1);
11185 
11186         ret_val = xmlListRemoveAll(l, data);
11187         desret_int(ret_val);
11188         call_tests++;
11189         des_xmlListPtr(n_l, l, 0);
11190         des_userdata(n_data, data, 1);
11191         xmlResetLastError();
11192         if (mem_base != xmlMemBlocks()) {
11193             printf("Leak of %d blocks found in xmlListRemoveAll",
11194 	           xmlMemBlocks() - mem_base);
11195 	    test_ret++;
11196             printf(" %d", n_l);
11197             printf(" %d", n_data);
11198             printf("\n");
11199         }
11200     }
11201     }
11202     function_tests++;
11203 
11204     return(test_ret);
11205 }
11206 
11207 
11208 static int
test_xmlListRemoveFirst(void)11209 test_xmlListRemoveFirst(void) {
11210     int test_ret = 0;
11211 
11212     int mem_base;
11213     int ret_val;
11214     xmlListPtr l; /* a list */
11215     int n_l;
11216     void * data; /* list data */
11217     int n_data;
11218 
11219     for (n_l = 0;n_l < gen_nb_xmlListPtr;n_l++) {
11220     for (n_data = 0;n_data < gen_nb_userdata;n_data++) {
11221         mem_base = xmlMemBlocks();
11222         l = gen_xmlListPtr(n_l, 0);
11223         data = gen_userdata(n_data, 1);
11224 
11225         ret_val = xmlListRemoveFirst(l, data);
11226         desret_int(ret_val);
11227         call_tests++;
11228         des_xmlListPtr(n_l, l, 0);
11229         des_userdata(n_data, data, 1);
11230         xmlResetLastError();
11231         if (mem_base != xmlMemBlocks()) {
11232             printf("Leak of %d blocks found in xmlListRemoveFirst",
11233 	           xmlMemBlocks() - mem_base);
11234 	    test_ret++;
11235             printf(" %d", n_l);
11236             printf(" %d", n_data);
11237             printf("\n");
11238         }
11239     }
11240     }
11241     function_tests++;
11242 
11243     return(test_ret);
11244 }
11245 
11246 
11247 static int
test_xmlListRemoveLast(void)11248 test_xmlListRemoveLast(void) {
11249     int test_ret = 0;
11250 
11251     int mem_base;
11252     int ret_val;
11253     xmlListPtr l; /* a list */
11254     int n_l;
11255     void * data; /* list data */
11256     int n_data;
11257 
11258     for (n_l = 0;n_l < gen_nb_xmlListPtr;n_l++) {
11259     for (n_data = 0;n_data < gen_nb_userdata;n_data++) {
11260         mem_base = xmlMemBlocks();
11261         l = gen_xmlListPtr(n_l, 0);
11262         data = gen_userdata(n_data, 1);
11263 
11264         ret_val = xmlListRemoveLast(l, data);
11265         desret_int(ret_val);
11266         call_tests++;
11267         des_xmlListPtr(n_l, l, 0);
11268         des_userdata(n_data, data, 1);
11269         xmlResetLastError();
11270         if (mem_base != xmlMemBlocks()) {
11271             printf("Leak of %d blocks found in xmlListRemoveLast",
11272 	           xmlMemBlocks() - mem_base);
11273 	    test_ret++;
11274             printf(" %d", n_l);
11275             printf(" %d", n_data);
11276             printf("\n");
11277         }
11278     }
11279     }
11280     function_tests++;
11281 
11282     return(test_ret);
11283 }
11284 
11285 
11286 static int
test_xmlListReverse(void)11287 test_xmlListReverse(void) {
11288     int test_ret = 0;
11289 
11290     int mem_base;
11291     xmlListPtr l; /* a list */
11292     int n_l;
11293 
11294     for (n_l = 0;n_l < gen_nb_xmlListPtr;n_l++) {
11295         mem_base = xmlMemBlocks();
11296         l = gen_xmlListPtr(n_l, 0);
11297 
11298         xmlListReverse(l);
11299         call_tests++;
11300         des_xmlListPtr(n_l, l, 0);
11301         xmlResetLastError();
11302         if (mem_base != xmlMemBlocks()) {
11303             printf("Leak of %d blocks found in xmlListReverse",
11304 	           xmlMemBlocks() - mem_base);
11305 	    test_ret++;
11306             printf(" %d", n_l);
11307             printf("\n");
11308         }
11309     }
11310     function_tests++;
11311 
11312     return(test_ret);
11313 }
11314 
11315 
11316 static int
test_xmlListReverseSearch(void)11317 test_xmlListReverseSearch(void) {
11318     int test_ret = 0;
11319 
11320     int mem_base;
11321     void * ret_val;
11322     xmlListPtr l; /* a list */
11323     int n_l;
11324     void * data; /* a search value */
11325     int n_data;
11326 
11327     for (n_l = 0;n_l < gen_nb_xmlListPtr;n_l++) {
11328     for (n_data = 0;n_data < gen_nb_userdata;n_data++) {
11329         mem_base = xmlMemBlocks();
11330         l = gen_xmlListPtr(n_l, 0);
11331         data = gen_userdata(n_data, 1);
11332 
11333         ret_val = xmlListReverseSearch(l, data);
11334         desret_void_ptr(ret_val);
11335         call_tests++;
11336         des_xmlListPtr(n_l, l, 0);
11337         des_userdata(n_data, data, 1);
11338         xmlResetLastError();
11339         if (mem_base != xmlMemBlocks()) {
11340             printf("Leak of %d blocks found in xmlListReverseSearch",
11341 	           xmlMemBlocks() - mem_base);
11342 	    test_ret++;
11343             printf(" %d", n_l);
11344             printf(" %d", n_data);
11345             printf("\n");
11346         }
11347     }
11348     }
11349     function_tests++;
11350 
11351     return(test_ret);
11352 }
11353 
11354 
11355 static int
test_xmlListReverseWalk(void)11356 test_xmlListReverseWalk(void) {
11357     int test_ret = 0;
11358 
11359 
11360     /* missing type support */
11361     return(test_ret);
11362 }
11363 
11364 
11365 static int
test_xmlListSearch(void)11366 test_xmlListSearch(void) {
11367     int test_ret = 0;
11368 
11369     int mem_base;
11370     void * ret_val;
11371     xmlListPtr l; /* a list */
11372     int n_l;
11373     void * data; /* a search value */
11374     int n_data;
11375 
11376     for (n_l = 0;n_l < gen_nb_xmlListPtr;n_l++) {
11377     for (n_data = 0;n_data < gen_nb_userdata;n_data++) {
11378         mem_base = xmlMemBlocks();
11379         l = gen_xmlListPtr(n_l, 0);
11380         data = gen_userdata(n_data, 1);
11381 
11382         ret_val = xmlListSearch(l, data);
11383         desret_void_ptr(ret_val);
11384         call_tests++;
11385         des_xmlListPtr(n_l, l, 0);
11386         des_userdata(n_data, data, 1);
11387         xmlResetLastError();
11388         if (mem_base != xmlMemBlocks()) {
11389             printf("Leak of %d blocks found in xmlListSearch",
11390 	           xmlMemBlocks() - mem_base);
11391 	    test_ret++;
11392             printf(" %d", n_l);
11393             printf(" %d", n_data);
11394             printf("\n");
11395         }
11396     }
11397     }
11398     function_tests++;
11399 
11400     return(test_ret);
11401 }
11402 
11403 
11404 static int
test_xmlListSize(void)11405 test_xmlListSize(void) {
11406     int test_ret = 0;
11407 
11408     int mem_base;
11409     int ret_val;
11410     xmlListPtr l; /* a list */
11411     int n_l;
11412 
11413     for (n_l = 0;n_l < gen_nb_xmlListPtr;n_l++) {
11414         mem_base = xmlMemBlocks();
11415         l = gen_xmlListPtr(n_l, 0);
11416 
11417         ret_val = xmlListSize(l);
11418         desret_int(ret_val);
11419         call_tests++;
11420         des_xmlListPtr(n_l, l, 0);
11421         xmlResetLastError();
11422         if (mem_base != xmlMemBlocks()) {
11423             printf("Leak of %d blocks found in xmlListSize",
11424 	           xmlMemBlocks() - mem_base);
11425 	    test_ret++;
11426             printf(" %d", n_l);
11427             printf("\n");
11428         }
11429     }
11430     function_tests++;
11431 
11432     return(test_ret);
11433 }
11434 
11435 
11436 static int
test_xmlListSort(void)11437 test_xmlListSort(void) {
11438     int test_ret = 0;
11439 
11440     int mem_base;
11441     xmlListPtr l; /* a list */
11442     int n_l;
11443 
11444     for (n_l = 0;n_l < gen_nb_xmlListPtr;n_l++) {
11445         mem_base = xmlMemBlocks();
11446         l = gen_xmlListPtr(n_l, 0);
11447 
11448         xmlListSort(l);
11449         call_tests++;
11450         des_xmlListPtr(n_l, l, 0);
11451         xmlResetLastError();
11452         if (mem_base != xmlMemBlocks()) {
11453             printf("Leak of %d blocks found in xmlListSort",
11454 	           xmlMemBlocks() - mem_base);
11455 	    test_ret++;
11456             printf(" %d", n_l);
11457             printf("\n");
11458         }
11459     }
11460     function_tests++;
11461 
11462     return(test_ret);
11463 }
11464 
11465 
11466 static int
test_xmlListWalk(void)11467 test_xmlListWalk(void) {
11468     int test_ret = 0;
11469 
11470 
11471     /* missing type support */
11472     return(test_ret);
11473 }
11474 
11475 static int
test_list(void)11476 test_list(void) {
11477     int test_ret = 0;
11478 
11479     if (quiet == 0) printf("Testing list : 19 of 26 functions ...\n");
11480     test_ret += test_xmlLinkGetData();
11481     test_ret += test_xmlListAppend();
11482     test_ret += test_xmlListClear();
11483     test_ret += test_xmlListCopy();
11484     test_ret += test_xmlListCreate();
11485     test_ret += test_xmlListDup();
11486     test_ret += test_xmlListEmpty();
11487     test_ret += test_xmlListEnd();
11488     test_ret += test_xmlListFront();
11489     test_ret += test_xmlListInsert();
11490     test_ret += test_xmlListMerge();
11491     test_ret += test_xmlListPopBack();
11492     test_ret += test_xmlListPopFront();
11493     test_ret += test_xmlListPushBack();
11494     test_ret += test_xmlListPushFront();
11495     test_ret += test_xmlListRemoveAll();
11496     test_ret += test_xmlListRemoveFirst();
11497     test_ret += test_xmlListRemoveLast();
11498     test_ret += test_xmlListReverse();
11499     test_ret += test_xmlListReverseSearch();
11500     test_ret += test_xmlListReverseWalk();
11501     test_ret += test_xmlListSearch();
11502     test_ret += test_xmlListSize();
11503     test_ret += test_xmlListSort();
11504     test_ret += test_xmlListWalk();
11505 
11506     if (test_ret != 0)
11507 	printf("Module list: %d errors\n", test_ret);
11508     return(test_ret);
11509 }
11510 
11511 static int
test_xmlNanoHTTPAuthHeader(void)11512 test_xmlNanoHTTPAuthHeader(void) {
11513     int test_ret = 0;
11514 
11515 #if defined(LIBXML_HTTP_ENABLED)
11516     int mem_base;
11517     const char * ret_val;
11518     void * ctx; /* the HTTP context */
11519     int n_ctx;
11520 
11521     for (n_ctx = 0;n_ctx < gen_nb_xmlNanoHTTPCtxtPtr;n_ctx++) {
11522         mem_base = xmlMemBlocks();
11523         ctx = gen_xmlNanoHTTPCtxtPtr(n_ctx, 0);
11524 
11525         ret_val = xmlNanoHTTPAuthHeader(ctx);
11526         desret_const_char_ptr(ret_val);
11527         call_tests++;
11528         des_xmlNanoHTTPCtxtPtr(n_ctx, ctx, 0);
11529         xmlResetLastError();
11530         if (mem_base != xmlMemBlocks()) {
11531             printf("Leak of %d blocks found in xmlNanoHTTPAuthHeader",
11532 	           xmlMemBlocks() - mem_base);
11533 	    test_ret++;
11534             printf(" %d", n_ctx);
11535             printf("\n");
11536         }
11537     }
11538     function_tests++;
11539 #endif
11540 
11541     return(test_ret);
11542 }
11543 
11544 
11545 static int
test_xmlNanoHTTPCleanup(void)11546 test_xmlNanoHTTPCleanup(void) {
11547     int test_ret = 0;
11548 
11549 #if defined(LIBXML_HTTP_ENABLED)
11550     int mem_base;
11551 
11552         mem_base = xmlMemBlocks();
11553 
11554         xmlNanoHTTPCleanup();
11555         call_tests++;
11556         xmlResetLastError();
11557         if (mem_base != xmlMemBlocks()) {
11558             printf("Leak of %d blocks found in xmlNanoHTTPCleanup",
11559 	           xmlMemBlocks() - mem_base);
11560 	    test_ret++;
11561             printf("\n");
11562         }
11563     function_tests++;
11564 #endif
11565 
11566     return(test_ret);
11567 }
11568 
11569 
11570 static int
test_xmlNanoHTTPContentLength(void)11571 test_xmlNanoHTTPContentLength(void) {
11572     int test_ret = 0;
11573 
11574 #if defined(LIBXML_HTTP_ENABLED)
11575     int mem_base;
11576     int ret_val;
11577     void * ctx; /* the HTTP context */
11578     int n_ctx;
11579 
11580     for (n_ctx = 0;n_ctx < gen_nb_xmlNanoHTTPCtxtPtr;n_ctx++) {
11581         mem_base = xmlMemBlocks();
11582         ctx = gen_xmlNanoHTTPCtxtPtr(n_ctx, 0);
11583 
11584         ret_val = xmlNanoHTTPContentLength(ctx);
11585         desret_int(ret_val);
11586         call_tests++;
11587         des_xmlNanoHTTPCtxtPtr(n_ctx, ctx, 0);
11588         xmlResetLastError();
11589         if (mem_base != xmlMemBlocks()) {
11590             printf("Leak of %d blocks found in xmlNanoHTTPContentLength",
11591 	           xmlMemBlocks() - mem_base);
11592 	    test_ret++;
11593             printf(" %d", n_ctx);
11594             printf("\n");
11595         }
11596     }
11597     function_tests++;
11598 #endif
11599 
11600     return(test_ret);
11601 }
11602 
11603 
11604 static int
test_xmlNanoHTTPEncoding(void)11605 test_xmlNanoHTTPEncoding(void) {
11606     int test_ret = 0;
11607 
11608 #if defined(LIBXML_HTTP_ENABLED)
11609     int mem_base;
11610     const char * ret_val;
11611     void * ctx; /* the HTTP context */
11612     int n_ctx;
11613 
11614     for (n_ctx = 0;n_ctx < gen_nb_xmlNanoHTTPCtxtPtr;n_ctx++) {
11615         mem_base = xmlMemBlocks();
11616         ctx = gen_xmlNanoHTTPCtxtPtr(n_ctx, 0);
11617 
11618         ret_val = xmlNanoHTTPEncoding(ctx);
11619         desret_const_char_ptr(ret_val);
11620         call_tests++;
11621         des_xmlNanoHTTPCtxtPtr(n_ctx, ctx, 0);
11622         xmlResetLastError();
11623         if (mem_base != xmlMemBlocks()) {
11624             printf("Leak of %d blocks found in xmlNanoHTTPEncoding",
11625 	           xmlMemBlocks() - mem_base);
11626 	    test_ret++;
11627             printf(" %d", n_ctx);
11628             printf("\n");
11629         }
11630     }
11631     function_tests++;
11632 #endif
11633 
11634     return(test_ret);
11635 }
11636 
11637 
11638 #define gen_nb_char_ptr_ptr 1
11639 #define gen_char_ptr_ptr(no, nr) NULL
11640 #define des_char_ptr_ptr(no, val, nr)
11641 
11642 static int
test_xmlNanoHTTPFetch(void)11643 test_xmlNanoHTTPFetch(void) {
11644     int test_ret = 0;
11645 
11646 #if defined(LIBXML_HTTP_ENABLED)
11647     int mem_base;
11648     int ret_val;
11649     const char * URL; /* The URL to load */
11650     int n_URL;
11651     const char * filename; /* the filename where the content should be saved */
11652     int n_filename;
11653     char ** contentType; /* if available the Content-Type information will be returned at that location */
11654     int n_contentType;
11655 
11656     for (n_URL = 0;n_URL < gen_nb_fileoutput;n_URL++) {
11657     for (n_filename = 0;n_filename < gen_nb_fileoutput;n_filename++) {
11658     for (n_contentType = 0;n_contentType < gen_nb_char_ptr_ptr;n_contentType++) {
11659         mem_base = xmlMemBlocks();
11660         URL = gen_fileoutput(n_URL, 0);
11661         filename = gen_fileoutput(n_filename, 1);
11662         contentType = gen_char_ptr_ptr(n_contentType, 2);
11663 
11664         ret_val = xmlNanoHTTPFetch(URL, filename, contentType);
11665         desret_int(ret_val);
11666         call_tests++;
11667         des_fileoutput(n_URL, URL, 0);
11668         des_fileoutput(n_filename, filename, 1);
11669         des_char_ptr_ptr(n_contentType, contentType, 2);
11670         xmlResetLastError();
11671         if (mem_base != xmlMemBlocks()) {
11672             printf("Leak of %d blocks found in xmlNanoHTTPFetch",
11673 	           xmlMemBlocks() - mem_base);
11674 	    test_ret++;
11675             printf(" %d", n_URL);
11676             printf(" %d", n_filename);
11677             printf(" %d", n_contentType);
11678             printf("\n");
11679         }
11680     }
11681     }
11682     }
11683     function_tests++;
11684 #endif
11685 
11686     return(test_ret);
11687 }
11688 
11689 
11690 static int
test_xmlNanoHTTPInit(void)11691 test_xmlNanoHTTPInit(void) {
11692     int test_ret = 0;
11693 
11694 #if defined(LIBXML_HTTP_ENABLED)
11695     int mem_base;
11696 
11697         mem_base = xmlMemBlocks();
11698 
11699         xmlNanoHTTPInit();
11700         call_tests++;
11701         xmlResetLastError();
11702         if (mem_base != xmlMemBlocks()) {
11703             printf("Leak of %d blocks found in xmlNanoHTTPInit",
11704 	           xmlMemBlocks() - mem_base);
11705 	    test_ret++;
11706             printf("\n");
11707         }
11708     function_tests++;
11709 #endif
11710 
11711     return(test_ret);
11712 }
11713 
11714 
11715 static int
test_xmlNanoHTTPMimeType(void)11716 test_xmlNanoHTTPMimeType(void) {
11717     int test_ret = 0;
11718 
11719 #if defined(LIBXML_HTTP_ENABLED)
11720     int mem_base;
11721     const char * ret_val;
11722     void * ctx; /* the HTTP context */
11723     int n_ctx;
11724 
11725     for (n_ctx = 0;n_ctx < gen_nb_xmlNanoHTTPCtxtPtr;n_ctx++) {
11726         mem_base = xmlMemBlocks();
11727         ctx = gen_xmlNanoHTTPCtxtPtr(n_ctx, 0);
11728 
11729         ret_val = xmlNanoHTTPMimeType(ctx);
11730         desret_const_char_ptr(ret_val);
11731         call_tests++;
11732         des_xmlNanoHTTPCtxtPtr(n_ctx, ctx, 0);
11733         xmlResetLastError();
11734         if (mem_base != xmlMemBlocks()) {
11735             printf("Leak of %d blocks found in xmlNanoHTTPMimeType",
11736 	           xmlMemBlocks() - mem_base);
11737 	    test_ret++;
11738             printf(" %d", n_ctx);
11739             printf("\n");
11740         }
11741     }
11742     function_tests++;
11743 #endif
11744 
11745     return(test_ret);
11746 }
11747 
11748 
11749 static int
test_xmlNanoHTTPOpen(void)11750 test_xmlNanoHTTPOpen(void) {
11751     int test_ret = 0;
11752 
11753 #if defined(LIBXML_HTTP_ENABLED)
11754     int mem_base;
11755     void * ret_val;
11756     const char * URL; /* The URL to load */
11757     int n_URL;
11758     char ** contentType; /* if available the Content-Type information will be returned at that location */
11759     int n_contentType;
11760 
11761     for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) {
11762     for (n_contentType = 0;n_contentType < gen_nb_char_ptr_ptr;n_contentType++) {
11763         mem_base = xmlMemBlocks();
11764         URL = gen_filepath(n_URL, 0);
11765         contentType = gen_char_ptr_ptr(n_contentType, 1);
11766 
11767         ret_val = xmlNanoHTTPOpen(URL, contentType);
11768         desret_xmlNanoHTTPCtxtPtr(ret_val);
11769         call_tests++;
11770         des_filepath(n_URL, URL, 0);
11771         des_char_ptr_ptr(n_contentType, contentType, 1);
11772         xmlResetLastError();
11773         if (mem_base != xmlMemBlocks()) {
11774             printf("Leak of %d blocks found in xmlNanoHTTPOpen",
11775 	           xmlMemBlocks() - mem_base);
11776 	    test_ret++;
11777             printf(" %d", n_URL);
11778             printf(" %d", n_contentType);
11779             printf("\n");
11780         }
11781     }
11782     }
11783     function_tests++;
11784 #endif
11785 
11786     return(test_ret);
11787 }
11788 
11789 
11790 static int
test_xmlNanoHTTPOpenRedir(void)11791 test_xmlNanoHTTPOpenRedir(void) {
11792     int test_ret = 0;
11793 
11794 #if defined(LIBXML_HTTP_ENABLED)
11795     int mem_base;
11796     void * ret_val;
11797     const char * URL; /* The URL to load */
11798     int n_URL;
11799     char ** contentType; /* if available the Content-Type information will be returned at that location */
11800     int n_contentType;
11801     char ** redir; /* if available the redirected URL will be returned */
11802     int n_redir;
11803 
11804     for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) {
11805     for (n_contentType = 0;n_contentType < gen_nb_char_ptr_ptr;n_contentType++) {
11806     for (n_redir = 0;n_redir < gen_nb_char_ptr_ptr;n_redir++) {
11807         mem_base = xmlMemBlocks();
11808         URL = gen_filepath(n_URL, 0);
11809         contentType = gen_char_ptr_ptr(n_contentType, 1);
11810         redir = gen_char_ptr_ptr(n_redir, 2);
11811 
11812         ret_val = xmlNanoHTTPOpenRedir(URL, contentType, redir);
11813         desret_xmlNanoHTTPCtxtPtr(ret_val);
11814         call_tests++;
11815         des_filepath(n_URL, URL, 0);
11816         des_char_ptr_ptr(n_contentType, contentType, 1);
11817         des_char_ptr_ptr(n_redir, redir, 2);
11818         xmlResetLastError();
11819         if (mem_base != xmlMemBlocks()) {
11820             printf("Leak of %d blocks found in xmlNanoHTTPOpenRedir",
11821 	           xmlMemBlocks() - mem_base);
11822 	    test_ret++;
11823             printf(" %d", n_URL);
11824             printf(" %d", n_contentType);
11825             printf(" %d", n_redir);
11826             printf("\n");
11827         }
11828     }
11829     }
11830     }
11831     function_tests++;
11832 #endif
11833 
11834     return(test_ret);
11835 }
11836 
11837 
11838 static int
test_xmlNanoHTTPRead(void)11839 test_xmlNanoHTTPRead(void) {
11840     int test_ret = 0;
11841 
11842 #if defined(LIBXML_HTTP_ENABLED)
11843     int mem_base;
11844     int ret_val;
11845     void * ctx; /* the HTTP context */
11846     int n_ctx;
11847     void * dest; /* a buffer */
11848     int n_dest;
11849     int len; /* the buffer length */
11850     int n_len;
11851 
11852     for (n_ctx = 0;n_ctx < gen_nb_xmlNanoHTTPCtxtPtr;n_ctx++) {
11853     for (n_dest = 0;n_dest < gen_nb_void_ptr;n_dest++) {
11854     for (n_len = 0;n_len < gen_nb_int;n_len++) {
11855         mem_base = xmlMemBlocks();
11856         ctx = gen_xmlNanoHTTPCtxtPtr(n_ctx, 0);
11857         dest = gen_void_ptr(n_dest, 1);
11858         len = gen_int(n_len, 2);
11859 
11860         ret_val = xmlNanoHTTPRead(ctx, dest, len);
11861         desret_int(ret_val);
11862         call_tests++;
11863         des_xmlNanoHTTPCtxtPtr(n_ctx, ctx, 0);
11864         des_void_ptr(n_dest, dest, 1);
11865         des_int(n_len, len, 2);
11866         xmlResetLastError();
11867         if (mem_base != xmlMemBlocks()) {
11868             printf("Leak of %d blocks found in xmlNanoHTTPRead",
11869 	           xmlMemBlocks() - mem_base);
11870 	    test_ret++;
11871             printf(" %d", n_ctx);
11872             printf(" %d", n_dest);
11873             printf(" %d", n_len);
11874             printf("\n");
11875         }
11876     }
11877     }
11878     }
11879     function_tests++;
11880 #endif
11881 
11882     return(test_ret);
11883 }
11884 
11885 
11886 static int
test_xmlNanoHTTPRedir(void)11887 test_xmlNanoHTTPRedir(void) {
11888     int test_ret = 0;
11889 
11890 
11891     /* missing type support */
11892     return(test_ret);
11893 }
11894 
11895 
11896 static int
test_xmlNanoHTTPReturnCode(void)11897 test_xmlNanoHTTPReturnCode(void) {
11898     int test_ret = 0;
11899 
11900 #if defined(LIBXML_HTTP_ENABLED)
11901     int mem_base;
11902     int ret_val;
11903     void * ctx; /* the HTTP context */
11904     int n_ctx;
11905 
11906     for (n_ctx = 0;n_ctx < gen_nb_xmlNanoHTTPCtxtPtr;n_ctx++) {
11907         mem_base = xmlMemBlocks();
11908         ctx = gen_xmlNanoHTTPCtxtPtr(n_ctx, 0);
11909 
11910         ret_val = xmlNanoHTTPReturnCode(ctx);
11911         desret_int(ret_val);
11912         call_tests++;
11913         des_xmlNanoHTTPCtxtPtr(n_ctx, ctx, 0);
11914         xmlResetLastError();
11915         if (mem_base != xmlMemBlocks()) {
11916             printf("Leak of %d blocks found in xmlNanoHTTPReturnCode",
11917 	           xmlMemBlocks() - mem_base);
11918 	    test_ret++;
11919             printf(" %d", n_ctx);
11920             printf("\n");
11921         }
11922     }
11923     function_tests++;
11924 #endif
11925 
11926     return(test_ret);
11927 }
11928 
11929 
11930 static int
test_xmlNanoHTTPSave(void)11931 test_xmlNanoHTTPSave(void) {
11932     int test_ret = 0;
11933 
11934 #if defined(LIBXML_HTTP_ENABLED) && defined(LIBXML_OUTPUT_ENABLED)
11935     int mem_base;
11936     int ret_val;
11937     void * ctxt; /* the HTTP context */
11938     int n_ctxt;
11939     const char * filename; /* the filename where the content should be saved */
11940     int n_filename;
11941 
11942     for (n_ctxt = 0;n_ctxt < gen_nb_void_ptr;n_ctxt++) {
11943     for (n_filename = 0;n_filename < gen_nb_fileoutput;n_filename++) {
11944         mem_base = xmlMemBlocks();
11945         ctxt = gen_void_ptr(n_ctxt, 0);
11946         filename = gen_fileoutput(n_filename, 1);
11947 
11948         ret_val = xmlNanoHTTPSave(ctxt, filename);
11949         desret_int(ret_val);
11950         call_tests++;
11951         des_void_ptr(n_ctxt, ctxt, 0);
11952         des_fileoutput(n_filename, filename, 1);
11953         xmlResetLastError();
11954         if (mem_base != xmlMemBlocks()) {
11955             printf("Leak of %d blocks found in xmlNanoHTTPSave",
11956 	           xmlMemBlocks() - mem_base);
11957 	    test_ret++;
11958             printf(" %d", n_ctxt);
11959             printf(" %d", n_filename);
11960             printf("\n");
11961         }
11962     }
11963     }
11964     function_tests++;
11965 #endif
11966 
11967     return(test_ret);
11968 }
11969 
11970 
11971 static int
test_xmlNanoHTTPScanProxy(void)11972 test_xmlNanoHTTPScanProxy(void) {
11973     int test_ret = 0;
11974 
11975 #if defined(LIBXML_HTTP_ENABLED)
11976     const char * URL; /* The proxy URL used to initialize the proxy context */
11977     int n_URL;
11978 
11979     for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) {
11980         URL = gen_filepath(n_URL, 0);
11981 
11982         xmlNanoHTTPScanProxy(URL);
11983         call_tests++;
11984         des_filepath(n_URL, URL, 0);
11985         xmlResetLastError();
11986     }
11987     function_tests++;
11988 #endif
11989 
11990     return(test_ret);
11991 }
11992 
11993 static int
test_nanohttp(void)11994 test_nanohttp(void) {
11995     int test_ret = 0;
11996 
11997     if (quiet == 0) printf("Testing nanohttp : 13 of 17 functions ...\n");
11998     test_ret += test_xmlNanoHTTPAuthHeader();
11999     test_ret += test_xmlNanoHTTPCleanup();
12000     test_ret += test_xmlNanoHTTPContentLength();
12001     test_ret += test_xmlNanoHTTPEncoding();
12002     test_ret += test_xmlNanoHTTPFetch();
12003     test_ret += test_xmlNanoHTTPInit();
12004     test_ret += test_xmlNanoHTTPMimeType();
12005     test_ret += test_xmlNanoHTTPOpen();
12006     test_ret += test_xmlNanoHTTPOpenRedir();
12007     test_ret += test_xmlNanoHTTPRead();
12008     test_ret += test_xmlNanoHTTPRedir();
12009     test_ret += test_xmlNanoHTTPReturnCode();
12010     test_ret += test_xmlNanoHTTPSave();
12011     test_ret += test_xmlNanoHTTPScanProxy();
12012 
12013     if (test_ret != 0)
12014 	printf("Module nanohttp: %d errors\n", test_ret);
12015     return(test_ret);
12016 }
12017 
12018 static int
test_xmlByteConsumed(void)12019 test_xmlByteConsumed(void) {
12020     int test_ret = 0;
12021 
12022     int mem_base;
12023     long ret_val;
12024     xmlParserCtxtPtr ctxt; /* an XML parser context */
12025     int n_ctxt;
12026 
12027     for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
12028         mem_base = xmlMemBlocks();
12029         ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
12030 
12031         ret_val = xmlByteConsumed(ctxt);
12032         desret_long(ret_val);
12033         call_tests++;
12034         des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
12035         xmlResetLastError();
12036         if (mem_base != xmlMemBlocks()) {
12037             printf("Leak of %d blocks found in xmlByteConsumed",
12038 	           xmlMemBlocks() - mem_base);
12039 	    test_ret++;
12040             printf(" %d", n_ctxt);
12041             printf("\n");
12042         }
12043     }
12044     function_tests++;
12045 
12046     return(test_ret);
12047 }
12048 
12049 
12050 static int
test_xmlClearNodeInfoSeq(void)12051 test_xmlClearNodeInfoSeq(void) {
12052     int test_ret = 0;
12053 
12054     int mem_base;
12055     xmlParserNodeInfoSeqPtr seq; /* a node info sequence pointer */
12056     int n_seq;
12057 
12058     for (n_seq = 0;n_seq < gen_nb_xmlParserNodeInfoSeqPtr;n_seq++) {
12059         mem_base = xmlMemBlocks();
12060         seq = gen_xmlParserNodeInfoSeqPtr(n_seq, 0);
12061 
12062         xmlClearNodeInfoSeq(seq);
12063         call_tests++;
12064         des_xmlParserNodeInfoSeqPtr(n_seq, seq, 0);
12065         xmlResetLastError();
12066         if (mem_base != xmlMemBlocks()) {
12067             printf("Leak of %d blocks found in xmlClearNodeInfoSeq",
12068 	           xmlMemBlocks() - mem_base);
12069 	    test_ret++;
12070             printf(" %d", n_seq);
12071             printf("\n");
12072         }
12073     }
12074     function_tests++;
12075 
12076     return(test_ret);
12077 }
12078 
12079 
12080 static int
test_xmlClearParserCtxt(void)12081 test_xmlClearParserCtxt(void) {
12082     int test_ret = 0;
12083 
12084     int mem_base;
12085     xmlParserCtxtPtr ctxt; /* an XML parser context */
12086     int n_ctxt;
12087 
12088     for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
12089         mem_base = xmlMemBlocks();
12090         ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
12091 
12092         xmlClearParserCtxt(ctxt);
12093         call_tests++;
12094         des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
12095         xmlResetLastError();
12096         if (mem_base != xmlMemBlocks()) {
12097             printf("Leak of %d blocks found in xmlClearParserCtxt",
12098 	           xmlMemBlocks() - mem_base);
12099 	    test_ret++;
12100             printf(" %d", n_ctxt);
12101             printf("\n");
12102         }
12103     }
12104     function_tests++;
12105 
12106     return(test_ret);
12107 }
12108 
12109 
12110 static int
test_xmlCreateDocParserCtxt(void)12111 test_xmlCreateDocParserCtxt(void) {
12112     int test_ret = 0;
12113 
12114     int mem_base;
12115     xmlParserCtxtPtr ret_val;
12116     const xmlChar * str; /* a pointer to an array of xmlChar */
12117     int n_str;
12118 
12119     for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) {
12120         mem_base = xmlMemBlocks();
12121         str = gen_const_xmlChar_ptr(n_str, 0);
12122 
12123         ret_val = xmlCreateDocParserCtxt(str);
12124         desret_xmlParserCtxtPtr(ret_val);
12125         call_tests++;
12126         des_const_xmlChar_ptr(n_str, str, 0);
12127         xmlResetLastError();
12128         if (mem_base != xmlMemBlocks()) {
12129             printf("Leak of %d blocks found in xmlCreateDocParserCtxt",
12130 	           xmlMemBlocks() - mem_base);
12131 	    test_ret++;
12132             printf(" %d", n_str);
12133             printf("\n");
12134         }
12135     }
12136     function_tests++;
12137 
12138     return(test_ret);
12139 }
12140 
12141 
12142 static int
test_xmlCreatePushParserCtxt(void)12143 test_xmlCreatePushParserCtxt(void) {
12144     int test_ret = 0;
12145 
12146 #if defined(LIBXML_PUSH_ENABLED)
12147     int mem_base;
12148     xmlParserCtxtPtr ret_val;
12149     xmlSAXHandlerPtr sax; /* a SAX handler */
12150     int n_sax;
12151     void * user_data; /* The user data returned on SAX callbacks */
12152     int n_user_data;
12153     const char * chunk; /* a pointer to an array of chars */
12154     int n_chunk;
12155     int size; /* number of chars in the array */
12156     int n_size;
12157     const char * filename; /* an optional file name or URI */
12158     int n_filename;
12159 
12160     for (n_sax = 0;n_sax < gen_nb_xmlSAXHandlerPtr;n_sax++) {
12161     for (n_user_data = 0;n_user_data < gen_nb_userdata;n_user_data++) {
12162     for (n_chunk = 0;n_chunk < gen_nb_const_char_ptr;n_chunk++) {
12163     for (n_size = 0;n_size < gen_nb_int;n_size++) {
12164     for (n_filename = 0;n_filename < gen_nb_fileoutput;n_filename++) {
12165         mem_base = xmlMemBlocks();
12166         sax = gen_xmlSAXHandlerPtr(n_sax, 0);
12167         user_data = gen_userdata(n_user_data, 1);
12168         chunk = gen_const_char_ptr(n_chunk, 2);
12169         size = gen_int(n_size, 3);
12170         filename = gen_fileoutput(n_filename, 4);
12171         if ((chunk != NULL) &&
12172             (size > xmlStrlen(BAD_CAST chunk)))
12173             size = 0;
12174 
12175         ret_val = xmlCreatePushParserCtxt(sax, user_data, chunk, size, filename);
12176         desret_xmlParserCtxtPtr(ret_val);
12177         call_tests++;
12178         des_xmlSAXHandlerPtr(n_sax, sax, 0);
12179         des_userdata(n_user_data, user_data, 1);
12180         des_const_char_ptr(n_chunk, chunk, 2);
12181         des_int(n_size, size, 3);
12182         des_fileoutput(n_filename, filename, 4);
12183         xmlResetLastError();
12184         if (mem_base != xmlMemBlocks()) {
12185             printf("Leak of %d blocks found in xmlCreatePushParserCtxt",
12186 	           xmlMemBlocks() - mem_base);
12187 	    test_ret++;
12188             printf(" %d", n_sax);
12189             printf(" %d", n_user_data);
12190             printf(" %d", n_chunk);
12191             printf(" %d", n_size);
12192             printf(" %d", n_filename);
12193             printf("\n");
12194         }
12195     }
12196     }
12197     }
12198     }
12199     }
12200     function_tests++;
12201 #endif
12202 
12203     return(test_ret);
12204 }
12205 
12206 
12207 static int
test_xmlCtxtReadDoc(void)12208 test_xmlCtxtReadDoc(void) {
12209     int test_ret = 0;
12210 
12211     int mem_base;
12212     xmlDocPtr ret_val;
12213     xmlParserCtxtPtr ctxt; /* an XML parser context */
12214     int n_ctxt;
12215     const xmlChar * str; /* a pointer to a zero terminated string */
12216     int n_str;
12217     const char * URL; /* the base URL to use for the document */
12218     int n_URL;
12219     const char * encoding; /* the document encoding, or NULL */
12220     int n_encoding;
12221     int options; /* a combination of xmlParserOption */
12222     int n_options;
12223 
12224     for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
12225     for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) {
12226     for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) {
12227     for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
12228     for (n_options = 0;n_options < gen_nb_parseroptions;n_options++) {
12229         mem_base = xmlMemBlocks();
12230         ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
12231         str = gen_const_xmlChar_ptr(n_str, 1);
12232         URL = gen_filepath(n_URL, 2);
12233         encoding = gen_const_char_ptr(n_encoding, 3);
12234         options = gen_parseroptions(n_options, 4);
12235 
12236         ret_val = xmlCtxtReadDoc(ctxt, str, URL, encoding, options);
12237         desret_xmlDocPtr(ret_val);
12238         call_tests++;
12239         des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
12240         des_const_xmlChar_ptr(n_str, str, 1);
12241         des_filepath(n_URL, URL, 2);
12242         des_const_char_ptr(n_encoding, encoding, 3);
12243         des_parseroptions(n_options, options, 4);
12244         xmlResetLastError();
12245         if (mem_base != xmlMemBlocks()) {
12246             printf("Leak of %d blocks found in xmlCtxtReadDoc",
12247 	           xmlMemBlocks() - mem_base);
12248 	    test_ret++;
12249             printf(" %d", n_ctxt);
12250             printf(" %d", n_str);
12251             printf(" %d", n_URL);
12252             printf(" %d", n_encoding);
12253             printf(" %d", n_options);
12254             printf("\n");
12255         }
12256     }
12257     }
12258     }
12259     }
12260     }
12261     function_tests++;
12262 
12263     return(test_ret);
12264 }
12265 
12266 
12267 static int
test_xmlCtxtReadFile(void)12268 test_xmlCtxtReadFile(void) {
12269     int test_ret = 0;
12270 
12271     int mem_base;
12272     xmlDocPtr ret_val;
12273     xmlParserCtxtPtr ctxt; /* an XML parser context */
12274     int n_ctxt;
12275     const char * filename; /* a file or URL */
12276     int n_filename;
12277     const char * encoding; /* the document encoding, or NULL */
12278     int n_encoding;
12279     int options; /* a combination of xmlParserOption */
12280     int n_options;
12281 
12282     for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
12283     for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
12284     for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
12285     for (n_options = 0;n_options < gen_nb_parseroptions;n_options++) {
12286         mem_base = xmlMemBlocks();
12287         ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
12288         filename = gen_filepath(n_filename, 1);
12289         encoding = gen_const_char_ptr(n_encoding, 2);
12290         options = gen_parseroptions(n_options, 3);
12291 
12292         ret_val = xmlCtxtReadFile(ctxt, filename, encoding, options);
12293         desret_xmlDocPtr(ret_val);
12294         call_tests++;
12295         des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
12296         des_filepath(n_filename, filename, 1);
12297         des_const_char_ptr(n_encoding, encoding, 2);
12298         des_parseroptions(n_options, options, 3);
12299         xmlResetLastError();
12300         if (mem_base != xmlMemBlocks()) {
12301             printf("Leak of %d blocks found in xmlCtxtReadFile",
12302 	           xmlMemBlocks() - mem_base);
12303 	    test_ret++;
12304             printf(" %d", n_ctxt);
12305             printf(" %d", n_filename);
12306             printf(" %d", n_encoding);
12307             printf(" %d", n_options);
12308             printf("\n");
12309         }
12310     }
12311     }
12312     }
12313     }
12314     function_tests++;
12315 
12316     return(test_ret);
12317 }
12318 
12319 
12320 static int
test_xmlCtxtReadMemory(void)12321 test_xmlCtxtReadMemory(void) {
12322     int test_ret = 0;
12323 
12324     int mem_base;
12325     xmlDocPtr ret_val;
12326     xmlParserCtxtPtr ctxt; /* an XML parser context */
12327     int n_ctxt;
12328     const char * buffer; /* a pointer to a char array */
12329     int n_buffer;
12330     int size; /* the size of the array */
12331     int n_size;
12332     const char * URL; /* the base URL to use for the document */
12333     int n_URL;
12334     const char * encoding; /* the document encoding, or NULL */
12335     int n_encoding;
12336     int options; /* a combination of xmlParserOption */
12337     int n_options;
12338 
12339     for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
12340     for (n_buffer = 0;n_buffer < gen_nb_const_char_ptr;n_buffer++) {
12341     for (n_size = 0;n_size < gen_nb_int;n_size++) {
12342     for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) {
12343     for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
12344     for (n_options = 0;n_options < gen_nb_parseroptions;n_options++) {
12345         mem_base = xmlMemBlocks();
12346         ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
12347         buffer = gen_const_char_ptr(n_buffer, 1);
12348         size = gen_int(n_size, 2);
12349         URL = gen_filepath(n_URL, 3);
12350         encoding = gen_const_char_ptr(n_encoding, 4);
12351         options = gen_parseroptions(n_options, 5);
12352         if ((buffer != NULL) &&
12353             (size > xmlStrlen(BAD_CAST buffer)))
12354             size = 0;
12355 
12356         ret_val = xmlCtxtReadMemory(ctxt, buffer, size, URL, encoding, options);
12357         desret_xmlDocPtr(ret_val);
12358         call_tests++;
12359         des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
12360         des_const_char_ptr(n_buffer, buffer, 1);
12361         des_int(n_size, size, 2);
12362         des_filepath(n_URL, URL, 3);
12363         des_const_char_ptr(n_encoding, encoding, 4);
12364         des_parseroptions(n_options, options, 5);
12365         xmlResetLastError();
12366         if (mem_base != xmlMemBlocks()) {
12367             printf("Leak of %d blocks found in xmlCtxtReadMemory",
12368 	           xmlMemBlocks() - mem_base);
12369 	    test_ret++;
12370             printf(" %d", n_ctxt);
12371             printf(" %d", n_buffer);
12372             printf(" %d", n_size);
12373             printf(" %d", n_URL);
12374             printf(" %d", n_encoding);
12375             printf(" %d", n_options);
12376             printf("\n");
12377         }
12378     }
12379     }
12380     }
12381     }
12382     }
12383     }
12384     function_tests++;
12385 
12386     return(test_ret);
12387 }
12388 
12389 
12390 static int
test_xmlCtxtReset(void)12391 test_xmlCtxtReset(void) {
12392     int test_ret = 0;
12393 
12394     int mem_base;
12395     xmlParserCtxtPtr ctxt; /* an XML parser context */
12396     int n_ctxt;
12397 
12398     for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
12399         mem_base = xmlMemBlocks();
12400         ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
12401 
12402         xmlCtxtReset(ctxt);
12403         call_tests++;
12404         des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
12405         xmlResetLastError();
12406         if (mem_base != xmlMemBlocks()) {
12407             printf("Leak of %d blocks found in xmlCtxtReset",
12408 	           xmlMemBlocks() - mem_base);
12409 	    test_ret++;
12410             printf(" %d", n_ctxt);
12411             printf("\n");
12412         }
12413     }
12414     function_tests++;
12415 
12416     return(test_ret);
12417 }
12418 
12419 
12420 static int
test_xmlCtxtResetPush(void)12421 test_xmlCtxtResetPush(void) {
12422     int test_ret = 0;
12423 
12424     int mem_base;
12425     int ret_val;
12426     xmlParserCtxtPtr ctxt; /* an XML parser context */
12427     int n_ctxt;
12428     const char * chunk; /* a pointer to an array of chars */
12429     int n_chunk;
12430     int size; /* number of chars in the array */
12431     int n_size;
12432     const char * filename; /* an optional file name or URI */
12433     int n_filename;
12434     const char * encoding; /* the document encoding, or NULL */
12435     int n_encoding;
12436 
12437     for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
12438     for (n_chunk = 0;n_chunk < gen_nb_const_char_ptr;n_chunk++) {
12439     for (n_size = 0;n_size < gen_nb_int;n_size++) {
12440     for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
12441     for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
12442         mem_base = xmlMemBlocks();
12443         ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
12444         chunk = gen_const_char_ptr(n_chunk, 1);
12445         size = gen_int(n_size, 2);
12446         filename = gen_filepath(n_filename, 3);
12447         encoding = gen_const_char_ptr(n_encoding, 4);
12448         if ((chunk != NULL) &&
12449             (size > xmlStrlen(BAD_CAST chunk)))
12450             size = 0;
12451 
12452         ret_val = xmlCtxtResetPush(ctxt, chunk, size, filename, encoding);
12453         desret_int(ret_val);
12454         call_tests++;
12455         des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
12456         des_const_char_ptr(n_chunk, chunk, 1);
12457         des_int(n_size, size, 2);
12458         des_filepath(n_filename, filename, 3);
12459         des_const_char_ptr(n_encoding, encoding, 4);
12460         xmlResetLastError();
12461         if (mem_base != xmlMemBlocks()) {
12462             printf("Leak of %d blocks found in xmlCtxtResetPush",
12463 	           xmlMemBlocks() - mem_base);
12464 	    test_ret++;
12465             printf(" %d", n_ctxt);
12466             printf(" %d", n_chunk);
12467             printf(" %d", n_size);
12468             printf(" %d", n_filename);
12469             printf(" %d", n_encoding);
12470             printf("\n");
12471         }
12472     }
12473     }
12474     }
12475     }
12476     }
12477     function_tests++;
12478 
12479     return(test_ret);
12480 }
12481 
12482 
12483 static int
test_xmlCtxtSetMaxAmplification(void)12484 test_xmlCtxtSetMaxAmplification(void) {
12485     int test_ret = 0;
12486 
12487 
12488     /* missing type support */
12489     return(test_ret);
12490 }
12491 
12492 
12493 static int
test_xmlCtxtUseOptions(void)12494 test_xmlCtxtUseOptions(void) {
12495     int test_ret = 0;
12496 
12497     int mem_base;
12498     int ret_val;
12499     xmlParserCtxtPtr ctxt; /* an XML parser context */
12500     int n_ctxt;
12501     int options; /* a combination of xmlParserOption */
12502     int n_options;
12503 
12504     for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
12505     for (n_options = 0;n_options < gen_nb_parseroptions;n_options++) {
12506         mem_base = xmlMemBlocks();
12507         ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
12508         options = gen_parseroptions(n_options, 1);
12509 
12510         ret_val = xmlCtxtUseOptions(ctxt, options);
12511         desret_int(ret_val);
12512         call_tests++;
12513         des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
12514         des_parseroptions(n_options, options, 1);
12515         xmlResetLastError();
12516         if (mem_base != xmlMemBlocks()) {
12517             printf("Leak of %d blocks found in xmlCtxtUseOptions",
12518 	           xmlMemBlocks() - mem_base);
12519 	    test_ret++;
12520             printf(" %d", n_ctxt);
12521             printf(" %d", n_options);
12522             printf("\n");
12523         }
12524     }
12525     }
12526     function_tests++;
12527 
12528     return(test_ret);
12529 }
12530 
12531 
12532 static int
test_xmlGetExternalEntityLoader(void)12533 test_xmlGetExternalEntityLoader(void) {
12534     int test_ret = 0;
12535 
12536 
12537     /* missing type support */
12538     return(test_ret);
12539 }
12540 
12541 
12542 static int
test_xmlHasFeature(void)12543 test_xmlHasFeature(void) {
12544     int test_ret = 0;
12545 
12546     int mem_base;
12547     int ret_val;
12548     xmlFeature feature; /* the feature to be examined */
12549     int n_feature;
12550 
12551     for (n_feature = 0;n_feature < gen_nb_xmlFeature;n_feature++) {
12552         mem_base = xmlMemBlocks();
12553         feature = gen_xmlFeature(n_feature, 0);
12554 
12555         ret_val = xmlHasFeature(feature);
12556         desret_int(ret_val);
12557         call_tests++;
12558         des_xmlFeature(n_feature, feature, 0);
12559         xmlResetLastError();
12560         if (mem_base != xmlMemBlocks()) {
12561             printf("Leak of %d blocks found in xmlHasFeature",
12562 	           xmlMemBlocks() - mem_base);
12563 	    test_ret++;
12564             printf(" %d", n_feature);
12565             printf("\n");
12566         }
12567     }
12568     function_tests++;
12569 
12570     return(test_ret);
12571 }
12572 
12573 
12574 static int
test_xmlIOParseDTD(void)12575 test_xmlIOParseDTD(void) {
12576     int test_ret = 0;
12577 
12578 #if defined(LIBXML_VALID_ENABLED)
12579 #ifdef LIBXML_VALID_ENABLED
12580     xmlDtdPtr ret_val;
12581     xmlSAXHandlerPtr sax; /* the SAX handler block or NULL */
12582     int n_sax;
12583     xmlParserInputBufferPtr input; /* an Input Buffer */
12584     int n_input;
12585     xmlCharEncoding enc; /* the charset encoding if known */
12586     int n_enc;
12587 
12588     for (n_sax = 0;n_sax < gen_nb_xmlSAXHandlerPtr;n_sax++) {
12589     for (n_input = 0;n_input < gen_nb_xmlParserInputBufferPtr;n_input++) {
12590     for (n_enc = 0;n_enc < gen_nb_xmlCharEncoding;n_enc++) {
12591         sax = gen_xmlSAXHandlerPtr(n_sax, 0);
12592         input = gen_xmlParserInputBufferPtr(n_input, 1);
12593         enc = gen_xmlCharEncoding(n_enc, 2);
12594 
12595         ret_val = xmlIOParseDTD(sax, input, enc);
12596         input = NULL;
12597         desret_xmlDtdPtr(ret_val);
12598         call_tests++;
12599         des_xmlSAXHandlerPtr(n_sax, sax, 0);
12600         des_xmlParserInputBufferPtr(n_input, input, 1);
12601         des_xmlCharEncoding(n_enc, enc, 2);
12602         xmlResetLastError();
12603     }
12604     }
12605     }
12606     function_tests++;
12607 #endif
12608 #endif
12609 
12610     return(test_ret);
12611 }
12612 
12613 
12614 static int
test_xmlInitNodeInfoSeq(void)12615 test_xmlInitNodeInfoSeq(void) {
12616     int test_ret = 0;
12617 
12618     int mem_base;
12619     xmlParserNodeInfoSeqPtr seq; /* a node info sequence pointer */
12620     int n_seq;
12621 
12622     for (n_seq = 0;n_seq < gen_nb_xmlParserNodeInfoSeqPtr;n_seq++) {
12623         mem_base = xmlMemBlocks();
12624         seq = gen_xmlParserNodeInfoSeqPtr(n_seq, 0);
12625 
12626         xmlInitNodeInfoSeq(seq);
12627         call_tests++;
12628         des_xmlParserNodeInfoSeqPtr(n_seq, seq, 0);
12629         xmlResetLastError();
12630         if (mem_base != xmlMemBlocks()) {
12631             printf("Leak of %d blocks found in xmlInitNodeInfoSeq",
12632 	           xmlMemBlocks() - mem_base);
12633 	    test_ret++;
12634             printf(" %d", n_seq);
12635             printf("\n");
12636         }
12637     }
12638     function_tests++;
12639 
12640     return(test_ret);
12641 }
12642 
12643 
12644 static int
test_xmlInitParser(void)12645 test_xmlInitParser(void) {
12646     int test_ret = 0;
12647 
12648     int mem_base;
12649 
12650         mem_base = xmlMemBlocks();
12651 
12652         xmlInitParser();
12653         call_tests++;
12654         xmlResetLastError();
12655         if (mem_base != xmlMemBlocks()) {
12656             printf("Leak of %d blocks found in xmlInitParser",
12657 	           xmlMemBlocks() - mem_base);
12658 	    test_ret++;
12659             printf("\n");
12660         }
12661     function_tests++;
12662 
12663     return(test_ret);
12664 }
12665 
12666 
12667 static int
test_xmlInitParserCtxt(void)12668 test_xmlInitParserCtxt(void) {
12669     int test_ret = 0;
12670 
12671     int mem_base;
12672     int ret_val;
12673     xmlParserCtxtPtr ctxt; /* an XML parser context */
12674     int n_ctxt;
12675 
12676     for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
12677         mem_base = xmlMemBlocks();
12678         ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
12679 
12680         ret_val = xmlInitParserCtxt(ctxt);
12681         desret_int(ret_val);
12682         call_tests++;
12683         des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
12684         xmlResetLastError();
12685         if (mem_base != xmlMemBlocks()) {
12686             printf("Leak of %d blocks found in xmlInitParserCtxt",
12687 	           xmlMemBlocks() - mem_base);
12688 	    test_ret++;
12689             printf(" %d", n_ctxt);
12690             printf("\n");
12691         }
12692     }
12693     function_tests++;
12694 
12695     return(test_ret);
12696 }
12697 
12698 
12699 static int
test_xmlKeepBlanksDefault(void)12700 test_xmlKeepBlanksDefault(void) {
12701     int test_ret = 0;
12702 
12703     int mem_base;
12704     int ret_val;
12705     int val; /* int 0 or 1 */
12706     int n_val;
12707 
12708     for (n_val = 0;n_val < gen_nb_int;n_val++) {
12709         mem_base = xmlMemBlocks();
12710         val = gen_int(n_val, 0);
12711 
12712         ret_val = xmlKeepBlanksDefault(val);
12713         desret_int(ret_val);
12714         call_tests++;
12715         des_int(n_val, val, 0);
12716         xmlResetLastError();
12717         if (mem_base != xmlMemBlocks()) {
12718             printf("Leak of %d blocks found in xmlKeepBlanksDefault",
12719 	           xmlMemBlocks() - mem_base);
12720 	    test_ret++;
12721             printf(" %d", n_val);
12722             printf("\n");
12723         }
12724     }
12725     function_tests++;
12726 
12727     return(test_ret);
12728 }
12729 
12730 
12731 static int
test_xmlLineNumbersDefault(void)12732 test_xmlLineNumbersDefault(void) {
12733     int test_ret = 0;
12734 
12735     int mem_base;
12736     int ret_val;
12737     int val; /* int 0 or 1 */
12738     int n_val;
12739 
12740     for (n_val = 0;n_val < gen_nb_int;n_val++) {
12741         mem_base = xmlMemBlocks();
12742         val = gen_int(n_val, 0);
12743 
12744         ret_val = xmlLineNumbersDefault(val);
12745         desret_int(ret_val);
12746         call_tests++;
12747         des_int(n_val, val, 0);
12748         xmlResetLastError();
12749         if (mem_base != xmlMemBlocks()) {
12750             printf("Leak of %d blocks found in xmlLineNumbersDefault",
12751 	           xmlMemBlocks() - mem_base);
12752 	    test_ret++;
12753             printf(" %d", n_val);
12754             printf("\n");
12755         }
12756     }
12757     function_tests++;
12758 
12759     return(test_ret);
12760 }
12761 
12762 
12763 static int
test_xmlLoadExternalEntity(void)12764 test_xmlLoadExternalEntity(void) {
12765     int test_ret = 0;
12766 
12767     int mem_base;
12768     xmlParserInputPtr ret_val;
12769     const char * URL; /* the URL for the entity to load */
12770     int n_URL;
12771     const char * ID; /* the Public ID for the entity to load */
12772     int n_ID;
12773     xmlParserCtxtPtr ctxt; /* the context in which the entity is called or NULL */
12774     int n_ctxt;
12775 
12776     for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) {
12777     for (n_ID = 0;n_ID < gen_nb_const_char_ptr;n_ID++) {
12778     for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
12779         mem_base = xmlMemBlocks();
12780         URL = gen_filepath(n_URL, 0);
12781         ID = gen_const_char_ptr(n_ID, 1);
12782         ctxt = gen_xmlParserCtxtPtr(n_ctxt, 2);
12783 
12784         ret_val = xmlLoadExternalEntity(URL, ID, ctxt);
12785         desret_xmlParserInputPtr(ret_val);
12786         call_tests++;
12787         des_filepath(n_URL, URL, 0);
12788         des_const_char_ptr(n_ID, ID, 1);
12789         des_xmlParserCtxtPtr(n_ctxt, ctxt, 2);
12790         xmlResetLastError();
12791         if (mem_base != xmlMemBlocks()) {
12792             printf("Leak of %d blocks found in xmlLoadExternalEntity",
12793 	           xmlMemBlocks() - mem_base);
12794 	    test_ret++;
12795             printf(" %d", n_URL);
12796             printf(" %d", n_ID);
12797             printf(" %d", n_ctxt);
12798             printf("\n");
12799         }
12800     }
12801     }
12802     }
12803     function_tests++;
12804 
12805     return(test_ret);
12806 }
12807 
12808 
12809 static int
test_xmlNewIOInputStream(void)12810 test_xmlNewIOInputStream(void) {
12811     int test_ret = 0;
12812 
12813     int mem_base;
12814     xmlParserInputPtr ret_val;
12815     xmlParserCtxtPtr ctxt; /* an XML parser context */
12816     int n_ctxt;
12817     xmlParserInputBufferPtr input; /* an I/O Input */
12818     int n_input;
12819     xmlCharEncoding enc; /* the charset encoding if known */
12820     int n_enc;
12821 
12822     for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
12823     for (n_input = 0;n_input < gen_nb_xmlParserInputBufferPtr;n_input++) {
12824     for (n_enc = 0;n_enc < gen_nb_xmlCharEncoding;n_enc++) {
12825         mem_base = xmlMemBlocks();
12826         ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
12827         input = gen_xmlParserInputBufferPtr(n_input, 1);
12828         enc = gen_xmlCharEncoding(n_enc, 2);
12829 
12830         ret_val = xmlNewIOInputStream(ctxt, input, enc);
12831         if (ret_val != NULL) input = NULL;
12832         desret_xmlParserInputPtr(ret_val);
12833         call_tests++;
12834         des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
12835         des_xmlParserInputBufferPtr(n_input, input, 1);
12836         des_xmlCharEncoding(n_enc, enc, 2);
12837         xmlResetLastError();
12838         if (mem_base != xmlMemBlocks()) {
12839             printf("Leak of %d blocks found in xmlNewIOInputStream",
12840 	           xmlMemBlocks() - mem_base);
12841 	    test_ret++;
12842             printf(" %d", n_ctxt);
12843             printf(" %d", n_input);
12844             printf(" %d", n_enc);
12845             printf("\n");
12846         }
12847     }
12848     }
12849     }
12850     function_tests++;
12851 
12852     return(test_ret);
12853 }
12854 
12855 
12856 static int
test_xmlNewParserCtxt(void)12857 test_xmlNewParserCtxt(void) {
12858     int test_ret = 0;
12859 
12860     int mem_base;
12861     xmlParserCtxtPtr ret_val;
12862 
12863         mem_base = xmlMemBlocks();
12864 
12865         ret_val = xmlNewParserCtxt();
12866         desret_xmlParserCtxtPtr(ret_val);
12867         call_tests++;
12868         xmlResetLastError();
12869         if (mem_base != xmlMemBlocks()) {
12870             printf("Leak of %d blocks found in xmlNewParserCtxt",
12871 	           xmlMemBlocks() - mem_base);
12872 	    test_ret++;
12873             printf("\n");
12874         }
12875     function_tests++;
12876 
12877     return(test_ret);
12878 }
12879 
12880 
12881 #define gen_nb_const_xmlSAXHandler_ptr 1
12882 #define gen_const_xmlSAXHandler_ptr(no, nr) NULL
12883 #define des_const_xmlSAXHandler_ptr(no, val, nr)
12884 
12885 static int
test_xmlNewSAXParserCtxt(void)12886 test_xmlNewSAXParserCtxt(void) {
12887     int test_ret = 0;
12888 
12889     int mem_base;
12890     xmlParserCtxtPtr ret_val;
12891     const xmlSAXHandler * sax; /* SAX handler */
12892     int n_sax;
12893     void * userData; /* user data */
12894     int n_userData;
12895 
12896     for (n_sax = 0;n_sax < gen_nb_const_xmlSAXHandler_ptr;n_sax++) {
12897     for (n_userData = 0;n_userData < gen_nb_userdata;n_userData++) {
12898         mem_base = xmlMemBlocks();
12899         sax = gen_const_xmlSAXHandler_ptr(n_sax, 0);
12900         userData = gen_userdata(n_userData, 1);
12901 
12902         ret_val = xmlNewSAXParserCtxt(sax, userData);
12903         desret_xmlParserCtxtPtr(ret_val);
12904         call_tests++;
12905         des_const_xmlSAXHandler_ptr(n_sax, sax, 0);
12906         des_userdata(n_userData, userData, 1);
12907         xmlResetLastError();
12908         if (mem_base != xmlMemBlocks()) {
12909             printf("Leak of %d blocks found in xmlNewSAXParserCtxt",
12910 	           xmlMemBlocks() - mem_base);
12911 	    test_ret++;
12912             printf(" %d", n_sax);
12913             printf(" %d", n_userData);
12914             printf("\n");
12915         }
12916     }
12917     }
12918     function_tests++;
12919 
12920     return(test_ret);
12921 }
12922 
12923 
12924 #define gen_nb_xmlNodePtr_ptr 1
12925 #define gen_xmlNodePtr_ptr(no, nr) NULL
12926 #define des_xmlNodePtr_ptr(no, val, nr)
12927 
12928 static int
test_xmlParseBalancedChunkMemory(void)12929 test_xmlParseBalancedChunkMemory(void) {
12930     int test_ret = 0;
12931 
12932 #if defined(LIBXML_SAX1_ENABLED)
12933 #ifdef LIBXML_SAX1_ENABLED
12934     int mem_base;
12935     int ret_val;
12936     xmlDocPtr doc; /* the document the chunk pertains to (must not be NULL) */
12937     int n_doc;
12938     xmlSAXHandlerPtr sax; /* the SAX handler block (possibly NULL) */
12939     int n_sax;
12940     void * user_data; /* The user data returned on SAX callbacks (possibly NULL) */
12941     int n_user_data;
12942     int depth; /* Used for loop detection, use 0 */
12943     int n_depth;
12944     const xmlChar * string; /* the input string in UTF8 or ISO-Latin (zero terminated) */
12945     int n_string;
12946     xmlNodePtr * lst; /* the return value for the set of parsed nodes */
12947     int n_lst;
12948 
12949     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
12950     for (n_sax = 0;n_sax < gen_nb_xmlSAXHandlerPtr;n_sax++) {
12951     for (n_user_data = 0;n_user_data < gen_nb_userdata;n_user_data++) {
12952     for (n_depth = 0;n_depth < gen_nb_int;n_depth++) {
12953     for (n_string = 0;n_string < gen_nb_const_xmlChar_ptr;n_string++) {
12954     for (n_lst = 0;n_lst < gen_nb_xmlNodePtr_ptr;n_lst++) {
12955         mem_base = xmlMemBlocks();
12956         doc = gen_xmlDocPtr(n_doc, 0);
12957         sax = gen_xmlSAXHandlerPtr(n_sax, 1);
12958         user_data = gen_userdata(n_user_data, 2);
12959         depth = gen_int(n_depth, 3);
12960         string = gen_const_xmlChar_ptr(n_string, 4);
12961         lst = gen_xmlNodePtr_ptr(n_lst, 5);
12962 
12963 #ifdef LIBXML_SAX1_ENABLED
12964         if (sax == (xmlSAXHandlerPtr)&xmlDefaultSAXHandler) user_data = NULL;
12965 #endif
12966 
12967 
12968         ret_val = xmlParseBalancedChunkMemory(doc, sax, user_data, depth, string, lst);
12969         desret_int(ret_val);
12970         call_tests++;
12971         des_xmlDocPtr(n_doc, doc, 0);
12972         des_xmlSAXHandlerPtr(n_sax, sax, 1);
12973         des_userdata(n_user_data, user_data, 2);
12974         des_int(n_depth, depth, 3);
12975         des_const_xmlChar_ptr(n_string, string, 4);
12976         des_xmlNodePtr_ptr(n_lst, lst, 5);
12977         xmlResetLastError();
12978         if (mem_base != xmlMemBlocks()) {
12979             printf("Leak of %d blocks found in xmlParseBalancedChunkMemory",
12980 	           xmlMemBlocks() - mem_base);
12981 	    test_ret++;
12982             printf(" %d", n_doc);
12983             printf(" %d", n_sax);
12984             printf(" %d", n_user_data);
12985             printf(" %d", n_depth);
12986             printf(" %d", n_string);
12987             printf(" %d", n_lst);
12988             printf("\n");
12989         }
12990     }
12991     }
12992     }
12993     }
12994     }
12995     }
12996     function_tests++;
12997 #endif
12998 #endif
12999 
13000     return(test_ret);
13001 }
13002 
13003 
13004 static int
test_xmlParseBalancedChunkMemoryRecover(void)13005 test_xmlParseBalancedChunkMemoryRecover(void) {
13006     int test_ret = 0;
13007 
13008 #if defined(LIBXML_SAX1_ENABLED)
13009 #ifdef LIBXML_SAX1_ENABLED
13010     int mem_base;
13011     int ret_val;
13012     xmlDocPtr doc; /* the document the chunk pertains to (must not be NULL) */
13013     int n_doc;
13014     xmlSAXHandlerPtr sax; /* the SAX handler block (possibly NULL) */
13015     int n_sax;
13016     void * user_data; /* The user data returned on SAX callbacks (possibly NULL) */
13017     int n_user_data;
13018     int depth; /* Used for loop detection, use 0 */
13019     int n_depth;
13020     const xmlChar * string; /* the input string in UTF8 or ISO-Latin (zero terminated) */
13021     int n_string;
13022     xmlNodePtr * lst; /* the return value for the set of parsed nodes */
13023     int n_lst;
13024     int recover; /* return nodes even if the data is broken (use 0) */
13025     int n_recover;
13026 
13027     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
13028     for (n_sax = 0;n_sax < gen_nb_xmlSAXHandlerPtr;n_sax++) {
13029     for (n_user_data = 0;n_user_data < gen_nb_userdata;n_user_data++) {
13030     for (n_depth = 0;n_depth < gen_nb_int;n_depth++) {
13031     for (n_string = 0;n_string < gen_nb_const_xmlChar_ptr;n_string++) {
13032     for (n_lst = 0;n_lst < gen_nb_xmlNodePtr_ptr;n_lst++) {
13033     for (n_recover = 0;n_recover < gen_nb_int;n_recover++) {
13034         mem_base = xmlMemBlocks();
13035         doc = gen_xmlDocPtr(n_doc, 0);
13036         sax = gen_xmlSAXHandlerPtr(n_sax, 1);
13037         user_data = gen_userdata(n_user_data, 2);
13038         depth = gen_int(n_depth, 3);
13039         string = gen_const_xmlChar_ptr(n_string, 4);
13040         lst = gen_xmlNodePtr_ptr(n_lst, 5);
13041         recover = gen_int(n_recover, 6);
13042 
13043 #ifdef LIBXML_SAX1_ENABLED
13044         if (sax == (xmlSAXHandlerPtr)&xmlDefaultSAXHandler) user_data = NULL;
13045 #endif
13046 
13047 
13048         ret_val = xmlParseBalancedChunkMemoryRecover(doc, sax, user_data, depth, string, lst, recover);
13049         desret_int(ret_val);
13050         call_tests++;
13051         des_xmlDocPtr(n_doc, doc, 0);
13052         des_xmlSAXHandlerPtr(n_sax, sax, 1);
13053         des_userdata(n_user_data, user_data, 2);
13054         des_int(n_depth, depth, 3);
13055         des_const_xmlChar_ptr(n_string, string, 4);
13056         des_xmlNodePtr_ptr(n_lst, lst, 5);
13057         des_int(n_recover, recover, 6);
13058         xmlResetLastError();
13059         if (mem_base != xmlMemBlocks()) {
13060             printf("Leak of %d blocks found in xmlParseBalancedChunkMemoryRecover",
13061 	           xmlMemBlocks() - mem_base);
13062 	    test_ret++;
13063             printf(" %d", n_doc);
13064             printf(" %d", n_sax);
13065             printf(" %d", n_user_data);
13066             printf(" %d", n_depth);
13067             printf(" %d", n_string);
13068             printf(" %d", n_lst);
13069             printf(" %d", n_recover);
13070             printf("\n");
13071         }
13072     }
13073     }
13074     }
13075     }
13076     }
13077     }
13078     }
13079     function_tests++;
13080 #endif
13081 #endif
13082 
13083     return(test_ret);
13084 }
13085 
13086 
13087 static int
test_xmlParseChunk(void)13088 test_xmlParseChunk(void) {
13089     int test_ret = 0;
13090 
13091 #if defined(LIBXML_PUSH_ENABLED)
13092     int mem_base;
13093     int ret_val;
13094     xmlParserCtxtPtr ctxt; /* an XML parser context */
13095     int n_ctxt;
13096     const char * chunk; /* an char array */
13097     int n_chunk;
13098     int size; /* the size in byte of the chunk */
13099     int n_size;
13100     int terminate; /* last chunk indicator */
13101     int n_terminate;
13102 
13103     for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
13104     for (n_chunk = 0;n_chunk < gen_nb_const_char_ptr;n_chunk++) {
13105     for (n_size = 0;n_size < gen_nb_int;n_size++) {
13106     for (n_terminate = 0;n_terminate < gen_nb_int;n_terminate++) {
13107         mem_base = xmlMemBlocks();
13108         ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
13109         chunk = gen_const_char_ptr(n_chunk, 1);
13110         size = gen_int(n_size, 2);
13111         terminate = gen_int(n_terminate, 3);
13112         if ((chunk != NULL) &&
13113             (size > xmlStrlen(BAD_CAST chunk)))
13114             size = 0;
13115 
13116         ret_val = xmlParseChunk(ctxt, chunk, size, terminate);
13117         if (ctxt != NULL) {xmlFreeDoc(ctxt->myDoc); ctxt->myDoc = NULL;}
13118         desret_int(ret_val);
13119         call_tests++;
13120         des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
13121         des_const_char_ptr(n_chunk, chunk, 1);
13122         des_int(n_size, size, 2);
13123         des_int(n_terminate, terminate, 3);
13124         xmlResetLastError();
13125         if (mem_base != xmlMemBlocks()) {
13126             printf("Leak of %d blocks found in xmlParseChunk",
13127 	           xmlMemBlocks() - mem_base);
13128 	    test_ret++;
13129             printf(" %d", n_ctxt);
13130             printf(" %d", n_chunk);
13131             printf(" %d", n_size);
13132             printf(" %d", n_terminate);
13133             printf("\n");
13134         }
13135     }
13136     }
13137     }
13138     }
13139     function_tests++;
13140 #endif
13141 
13142     return(test_ret);
13143 }
13144 
13145 
13146 static int
test_xmlParseCtxtExternalEntity(void)13147 test_xmlParseCtxtExternalEntity(void) {
13148     int test_ret = 0;
13149 
13150     int mem_base;
13151     int ret_val;
13152     xmlParserCtxtPtr ctx; /* the existing parsing context */
13153     int n_ctx;
13154     const xmlChar * URL; /* the URL for the entity to load */
13155     int n_URL;
13156     const xmlChar * ID; /* the System ID for the entity to load */
13157     int n_ID;
13158     xmlNodePtr * lst; /* the return value for the set of parsed nodes */
13159     int n_lst;
13160 
13161     for (n_ctx = 0;n_ctx < gen_nb_xmlParserCtxtPtr;n_ctx++) {
13162     for (n_URL = 0;n_URL < gen_nb_const_xmlChar_ptr;n_URL++) {
13163     for (n_ID = 0;n_ID < gen_nb_const_xmlChar_ptr;n_ID++) {
13164     for (n_lst = 0;n_lst < gen_nb_xmlNodePtr_ptr;n_lst++) {
13165         mem_base = xmlMemBlocks();
13166         ctx = gen_xmlParserCtxtPtr(n_ctx, 0);
13167         URL = gen_const_xmlChar_ptr(n_URL, 1);
13168         ID = gen_const_xmlChar_ptr(n_ID, 2);
13169         lst = gen_xmlNodePtr_ptr(n_lst, 3);
13170 
13171         ret_val = xmlParseCtxtExternalEntity(ctx, URL, ID, lst);
13172         desret_int(ret_val);
13173         call_tests++;
13174         des_xmlParserCtxtPtr(n_ctx, ctx, 0);
13175         des_const_xmlChar_ptr(n_URL, URL, 1);
13176         des_const_xmlChar_ptr(n_ID, ID, 2);
13177         des_xmlNodePtr_ptr(n_lst, lst, 3);
13178         xmlResetLastError();
13179         if (mem_base != xmlMemBlocks()) {
13180             printf("Leak of %d blocks found in xmlParseCtxtExternalEntity",
13181 	           xmlMemBlocks() - mem_base);
13182 	    test_ret++;
13183             printf(" %d", n_ctx);
13184             printf(" %d", n_URL);
13185             printf(" %d", n_ID);
13186             printf(" %d", n_lst);
13187             printf("\n");
13188         }
13189     }
13190     }
13191     }
13192     }
13193     function_tests++;
13194 
13195     return(test_ret);
13196 }
13197 
13198 
13199 static int
test_xmlParseDTD(void)13200 test_xmlParseDTD(void) {
13201     int test_ret = 0;
13202 
13203 #if defined(LIBXML_VALID_ENABLED)
13204 #ifdef LIBXML_VALID_ENABLED
13205     int mem_base;
13206     xmlDtdPtr ret_val;
13207     const xmlChar * ExternalID; /* a NAME* containing the External ID of the DTD */
13208     int n_ExternalID;
13209     const xmlChar * SystemID; /* a NAME* containing the URL to the DTD */
13210     int n_SystemID;
13211 
13212     for (n_ExternalID = 0;n_ExternalID < gen_nb_const_xmlChar_ptr;n_ExternalID++) {
13213     for (n_SystemID = 0;n_SystemID < gen_nb_const_xmlChar_ptr;n_SystemID++) {
13214         mem_base = xmlMemBlocks();
13215         ExternalID = gen_const_xmlChar_ptr(n_ExternalID, 0);
13216         SystemID = gen_const_xmlChar_ptr(n_SystemID, 1);
13217 
13218         ret_val = xmlParseDTD(ExternalID, SystemID);
13219         desret_xmlDtdPtr(ret_val);
13220         call_tests++;
13221         des_const_xmlChar_ptr(n_ExternalID, ExternalID, 0);
13222         des_const_xmlChar_ptr(n_SystemID, SystemID, 1);
13223         xmlResetLastError();
13224         if (mem_base != xmlMemBlocks()) {
13225             printf("Leak of %d blocks found in xmlParseDTD",
13226 	           xmlMemBlocks() - mem_base);
13227 	    test_ret++;
13228             printf(" %d", n_ExternalID);
13229             printf(" %d", n_SystemID);
13230             printf("\n");
13231         }
13232     }
13233     }
13234     function_tests++;
13235 #endif
13236 #endif
13237 
13238     return(test_ret);
13239 }
13240 
13241 
13242 static int
test_xmlParseDoc(void)13243 test_xmlParseDoc(void) {
13244     int test_ret = 0;
13245 
13246 #if defined(LIBXML_SAX1_ENABLED)
13247 #ifdef LIBXML_SAX1_ENABLED
13248     int mem_base;
13249     xmlDocPtr ret_val;
13250     const xmlChar * cur; /* a pointer to an array of xmlChar */
13251     int n_cur;
13252 
13253     for (n_cur = 0;n_cur < gen_nb_const_xmlChar_ptr;n_cur++) {
13254         mem_base = xmlMemBlocks();
13255         cur = gen_const_xmlChar_ptr(n_cur, 0);
13256 
13257         ret_val = xmlParseDoc(cur);
13258         desret_xmlDocPtr(ret_val);
13259         call_tests++;
13260         des_const_xmlChar_ptr(n_cur, cur, 0);
13261         xmlResetLastError();
13262         if (mem_base != xmlMemBlocks()) {
13263             printf("Leak of %d blocks found in xmlParseDoc",
13264 	           xmlMemBlocks() - mem_base);
13265 	    test_ret++;
13266             printf(" %d", n_cur);
13267             printf("\n");
13268         }
13269     }
13270     function_tests++;
13271 #endif
13272 #endif
13273 
13274     return(test_ret);
13275 }
13276 
13277 
13278 static int
test_xmlParseDocument(void)13279 test_xmlParseDocument(void) {
13280     int test_ret = 0;
13281 
13282     int mem_base;
13283     int ret_val;
13284     xmlParserCtxtPtr ctxt; /* an XML parser context */
13285     int n_ctxt;
13286 
13287     for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
13288         mem_base = xmlMemBlocks();
13289         ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
13290 
13291         ret_val = xmlParseDocument(ctxt);
13292         if (ctxt != NULL) {xmlFreeDoc(ctxt->myDoc); ctxt->myDoc = NULL;}
13293         desret_int(ret_val);
13294         call_tests++;
13295         des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
13296         xmlResetLastError();
13297         if (mem_base != xmlMemBlocks()) {
13298             printf("Leak of %d blocks found in xmlParseDocument",
13299 	           xmlMemBlocks() - mem_base);
13300 	    test_ret++;
13301             printf(" %d", n_ctxt);
13302             printf("\n");
13303         }
13304     }
13305     function_tests++;
13306 
13307     return(test_ret);
13308 }
13309 
13310 
13311 static int
test_xmlParseEntity(void)13312 test_xmlParseEntity(void) {
13313     int test_ret = 0;
13314 
13315 #if defined(LIBXML_SAX1_ENABLED)
13316 #ifdef LIBXML_SAX1_ENABLED
13317     int mem_base;
13318     xmlDocPtr ret_val;
13319     const char * filename; /* the filename */
13320     int n_filename;
13321 
13322     for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
13323         mem_base = xmlMemBlocks();
13324         filename = gen_filepath(n_filename, 0);
13325 
13326         ret_val = xmlParseEntity(filename);
13327         desret_xmlDocPtr(ret_val);
13328         call_tests++;
13329         des_filepath(n_filename, filename, 0);
13330         xmlResetLastError();
13331         if (mem_base != xmlMemBlocks()) {
13332             printf("Leak of %d blocks found in xmlParseEntity",
13333 	           xmlMemBlocks() - mem_base);
13334 	    test_ret++;
13335             printf(" %d", n_filename);
13336             printf("\n");
13337         }
13338     }
13339     function_tests++;
13340 #endif
13341 #endif
13342 
13343     return(test_ret);
13344 }
13345 
13346 
13347 static int
test_xmlParseExtParsedEnt(void)13348 test_xmlParseExtParsedEnt(void) {
13349     int test_ret = 0;
13350 
13351     int mem_base;
13352     int ret_val;
13353     xmlParserCtxtPtr ctxt; /* an XML parser context */
13354     int n_ctxt;
13355 
13356     for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
13357         mem_base = xmlMemBlocks();
13358         ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
13359 
13360         ret_val = xmlParseExtParsedEnt(ctxt);
13361         if (ctxt != NULL) {xmlFreeDoc(ctxt->myDoc); ctxt->myDoc = NULL;}
13362         desret_int(ret_val);
13363         call_tests++;
13364         des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
13365         xmlResetLastError();
13366         if (mem_base != xmlMemBlocks()) {
13367             printf("Leak of %d blocks found in xmlParseExtParsedEnt",
13368 	           xmlMemBlocks() - mem_base);
13369 	    test_ret++;
13370             printf(" %d", n_ctxt);
13371             printf("\n");
13372         }
13373     }
13374     function_tests++;
13375 
13376     return(test_ret);
13377 }
13378 
13379 
13380 static int
test_xmlParseExternalEntity(void)13381 test_xmlParseExternalEntity(void) {
13382     int test_ret = 0;
13383 
13384 #if defined(LIBXML_SAX1_ENABLED)
13385 #ifdef LIBXML_SAX1_ENABLED
13386     int mem_base;
13387     int ret_val;
13388     xmlDocPtr doc; /* the document the chunk pertains to */
13389     int n_doc;
13390     xmlSAXHandlerPtr sax; /* the SAX handler block (possibly NULL) */
13391     int n_sax;
13392     void * user_data; /* The user data returned on SAX callbacks (possibly NULL) */
13393     int n_user_data;
13394     int depth; /* Used for loop detection, use 0 */
13395     int n_depth;
13396     const xmlChar * URL; /* the URL for the entity to load */
13397     int n_URL;
13398     const xmlChar * ID; /* the System ID for the entity to load */
13399     int n_ID;
13400     xmlNodePtr * lst; /* the return value for the set of parsed nodes */
13401     int n_lst;
13402 
13403     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
13404     for (n_sax = 0;n_sax < gen_nb_xmlSAXHandlerPtr;n_sax++) {
13405     for (n_user_data = 0;n_user_data < gen_nb_userdata;n_user_data++) {
13406     for (n_depth = 0;n_depth < gen_nb_int;n_depth++) {
13407     for (n_URL = 0;n_URL < gen_nb_const_xmlChar_ptr;n_URL++) {
13408     for (n_ID = 0;n_ID < gen_nb_const_xmlChar_ptr;n_ID++) {
13409     for (n_lst = 0;n_lst < gen_nb_xmlNodePtr_ptr;n_lst++) {
13410         mem_base = xmlMemBlocks();
13411         doc = gen_xmlDocPtr(n_doc, 0);
13412         sax = gen_xmlSAXHandlerPtr(n_sax, 1);
13413         user_data = gen_userdata(n_user_data, 2);
13414         depth = gen_int(n_depth, 3);
13415         URL = gen_const_xmlChar_ptr(n_URL, 4);
13416         ID = gen_const_xmlChar_ptr(n_ID, 5);
13417         lst = gen_xmlNodePtr_ptr(n_lst, 6);
13418 
13419         ret_val = xmlParseExternalEntity(doc, sax, user_data, depth, URL, ID, lst);
13420         desret_int(ret_val);
13421         call_tests++;
13422         des_xmlDocPtr(n_doc, doc, 0);
13423         des_xmlSAXHandlerPtr(n_sax, sax, 1);
13424         des_userdata(n_user_data, user_data, 2);
13425         des_int(n_depth, depth, 3);
13426         des_const_xmlChar_ptr(n_URL, URL, 4);
13427         des_const_xmlChar_ptr(n_ID, ID, 5);
13428         des_xmlNodePtr_ptr(n_lst, lst, 6);
13429         xmlResetLastError();
13430         if (mem_base != xmlMemBlocks()) {
13431             printf("Leak of %d blocks found in xmlParseExternalEntity",
13432 	           xmlMemBlocks() - mem_base);
13433 	    test_ret++;
13434             printf(" %d", n_doc);
13435             printf(" %d", n_sax);
13436             printf(" %d", n_user_data);
13437             printf(" %d", n_depth);
13438             printf(" %d", n_URL);
13439             printf(" %d", n_ID);
13440             printf(" %d", n_lst);
13441             printf("\n");
13442         }
13443     }
13444     }
13445     }
13446     }
13447     }
13448     }
13449     }
13450     function_tests++;
13451 #endif
13452 #endif
13453 
13454     return(test_ret);
13455 }
13456 
13457 
13458 static int
test_xmlParseFile(void)13459 test_xmlParseFile(void) {
13460     int test_ret = 0;
13461 
13462 #if defined(LIBXML_SAX1_ENABLED)
13463 #ifdef LIBXML_SAX1_ENABLED
13464     int mem_base;
13465     xmlDocPtr ret_val;
13466     const char * filename; /* the filename */
13467     int n_filename;
13468 
13469     for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
13470         mem_base = xmlMemBlocks();
13471         filename = gen_filepath(n_filename, 0);
13472 
13473         ret_val = xmlParseFile(filename);
13474         desret_xmlDocPtr(ret_val);
13475         call_tests++;
13476         des_filepath(n_filename, filename, 0);
13477         xmlResetLastError();
13478         if (mem_base != xmlMemBlocks()) {
13479             printf("Leak of %d blocks found in xmlParseFile",
13480 	           xmlMemBlocks() - mem_base);
13481 	    test_ret++;
13482             printf(" %d", n_filename);
13483             printf("\n");
13484         }
13485     }
13486     function_tests++;
13487 #endif
13488 #endif
13489 
13490     return(test_ret);
13491 }
13492 
13493 
13494 static int
test_xmlParseInNodeContext(void)13495 test_xmlParseInNodeContext(void) {
13496     int test_ret = 0;
13497 
13498     int mem_base;
13499     xmlParserErrors ret_val;
13500     xmlNodePtr node; /* the context node */
13501     int n_node;
13502     const char * data; /* the input string */
13503     int n_data;
13504     int datalen; /* the input string length in bytes */
13505     int n_datalen;
13506     int options; /* a combination of xmlParserOption */
13507     int n_options;
13508     xmlNodePtr * lst; /* the return value for the set of parsed nodes */
13509     int n_lst;
13510 
13511     for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
13512     for (n_data = 0;n_data < gen_nb_const_char_ptr;n_data++) {
13513     for (n_datalen = 0;n_datalen < gen_nb_int;n_datalen++) {
13514     for (n_options = 0;n_options < gen_nb_parseroptions;n_options++) {
13515     for (n_lst = 0;n_lst < gen_nb_xmlNodePtr_ptr;n_lst++) {
13516         mem_base = xmlMemBlocks();
13517         node = gen_xmlNodePtr(n_node, 0);
13518         data = gen_const_char_ptr(n_data, 1);
13519         datalen = gen_int(n_datalen, 2);
13520         options = gen_parseroptions(n_options, 3);
13521         lst = gen_xmlNodePtr_ptr(n_lst, 4);
13522 
13523         ret_val = xmlParseInNodeContext(node, data, datalen, options, lst);
13524         desret_xmlParserErrors(ret_val);
13525         call_tests++;
13526         des_xmlNodePtr(n_node, node, 0);
13527         des_const_char_ptr(n_data, data, 1);
13528         des_int(n_datalen, datalen, 2);
13529         des_parseroptions(n_options, options, 3);
13530         des_xmlNodePtr_ptr(n_lst, lst, 4);
13531         xmlResetLastError();
13532         if (mem_base != xmlMemBlocks()) {
13533             printf("Leak of %d blocks found in xmlParseInNodeContext",
13534 	           xmlMemBlocks() - mem_base);
13535 	    test_ret++;
13536             printf(" %d", n_node);
13537             printf(" %d", n_data);
13538             printf(" %d", n_datalen);
13539             printf(" %d", n_options);
13540             printf(" %d", n_lst);
13541             printf("\n");
13542         }
13543     }
13544     }
13545     }
13546     }
13547     }
13548     function_tests++;
13549 
13550     return(test_ret);
13551 }
13552 
13553 
13554 static int
test_xmlParseMemory(void)13555 test_xmlParseMemory(void) {
13556     int test_ret = 0;
13557 
13558 #if defined(LIBXML_SAX1_ENABLED)
13559 #ifdef LIBXML_SAX1_ENABLED
13560     int mem_base;
13561     xmlDocPtr ret_val;
13562     const char * buffer; /* an pointer to a char array */
13563     int n_buffer;
13564     int size; /* the size of the array */
13565     int n_size;
13566 
13567     for (n_buffer = 0;n_buffer < gen_nb_const_char_ptr;n_buffer++) {
13568     for (n_size = 0;n_size < gen_nb_int;n_size++) {
13569         mem_base = xmlMemBlocks();
13570         buffer = gen_const_char_ptr(n_buffer, 0);
13571         size = gen_int(n_size, 1);
13572         if ((buffer != NULL) &&
13573             (size > xmlStrlen(BAD_CAST buffer)))
13574             size = 0;
13575 
13576         ret_val = xmlParseMemory(buffer, size);
13577         desret_xmlDocPtr(ret_val);
13578         call_tests++;
13579         des_const_char_ptr(n_buffer, buffer, 0);
13580         des_int(n_size, size, 1);
13581         xmlResetLastError();
13582         if (mem_base != xmlMemBlocks()) {
13583             printf("Leak of %d blocks found in xmlParseMemory",
13584 	           xmlMemBlocks() - mem_base);
13585 	    test_ret++;
13586             printf(" %d", n_buffer);
13587             printf(" %d", n_size);
13588             printf("\n");
13589         }
13590     }
13591     }
13592     function_tests++;
13593 #endif
13594 #endif
13595 
13596     return(test_ret);
13597 }
13598 
13599 
13600 #define gen_nb_xmlParserNodeInfoPtr 1
13601 #define gen_xmlParserNodeInfoPtr(no, nr) NULL
13602 #define des_xmlParserNodeInfoPtr(no, val, nr)
13603 
13604 static int
test_xmlParserAddNodeInfo(void)13605 test_xmlParserAddNodeInfo(void) {
13606     int test_ret = 0;
13607 
13608     int mem_base;
13609     xmlParserCtxtPtr ctxt; /* an XML parser context */
13610     int n_ctxt;
13611     xmlParserNodeInfoPtr info; /* a node info sequence pointer */
13612     int n_info;
13613 
13614     for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
13615     for (n_info = 0;n_info < gen_nb_xmlParserNodeInfoPtr;n_info++) {
13616         mem_base = xmlMemBlocks();
13617         ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
13618         info = gen_xmlParserNodeInfoPtr(n_info, 1);
13619 
13620         xmlParserAddNodeInfo(ctxt, info);
13621         call_tests++;
13622         des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
13623         des_xmlParserNodeInfoPtr(n_info, info, 1);
13624         xmlResetLastError();
13625         if (mem_base != xmlMemBlocks()) {
13626             printf("Leak of %d blocks found in xmlParserAddNodeInfo",
13627 	           xmlMemBlocks() - mem_base);
13628 	    test_ret++;
13629             printf(" %d", n_ctxt);
13630             printf(" %d", n_info);
13631             printf("\n");
13632         }
13633     }
13634     }
13635     function_tests++;
13636 
13637     return(test_ret);
13638 }
13639 
13640 
13641 static int
test_xmlParserFindNodeInfo(void)13642 test_xmlParserFindNodeInfo(void) {
13643     int test_ret = 0;
13644 
13645     int mem_base;
13646     const xmlParserNodeInfo * ret_val;
13647     xmlParserCtxtPtr ctx; /* an XML parser context */
13648     int n_ctx;
13649     xmlNodePtr node; /* an XML node within the tree */
13650     int n_node;
13651 
13652     for (n_ctx = 0;n_ctx < gen_nb_xmlParserCtxtPtr;n_ctx++) {
13653     for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
13654         mem_base = xmlMemBlocks();
13655         ctx = gen_xmlParserCtxtPtr(n_ctx, 0);
13656         node = gen_xmlNodePtr(n_node, 1);
13657 
13658         ret_val = xmlParserFindNodeInfo(ctx, node);
13659         desret_const_xmlParserNodeInfo_ptr(ret_val);
13660         call_tests++;
13661         des_xmlParserCtxtPtr(n_ctx, ctx, 0);
13662         des_xmlNodePtr(n_node, node, 1);
13663         xmlResetLastError();
13664         if (mem_base != xmlMemBlocks()) {
13665             printf("Leak of %d blocks found in xmlParserFindNodeInfo",
13666 	           xmlMemBlocks() - mem_base);
13667 	    test_ret++;
13668             printf(" %d", n_ctx);
13669             printf(" %d", n_node);
13670             printf("\n");
13671         }
13672     }
13673     }
13674     function_tests++;
13675 
13676     return(test_ret);
13677 }
13678 
13679 
13680 static int
test_xmlParserFindNodeInfoIndex(void)13681 test_xmlParserFindNodeInfoIndex(void) {
13682     int test_ret = 0;
13683 
13684     int mem_base;
13685     unsigned long ret_val;
13686     xmlParserNodeInfoSeqPtr seq; /* a node info sequence pointer */
13687     int n_seq;
13688     xmlNodePtr node; /* an XML node pointer */
13689     int n_node;
13690 
13691     for (n_seq = 0;n_seq < gen_nb_xmlParserNodeInfoSeqPtr;n_seq++) {
13692     for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
13693         mem_base = xmlMemBlocks();
13694         seq = gen_xmlParserNodeInfoSeqPtr(n_seq, 0);
13695         node = gen_xmlNodePtr(n_node, 1);
13696 
13697         ret_val = xmlParserFindNodeInfoIndex(seq, node);
13698         desret_unsigned_long(ret_val);
13699         call_tests++;
13700         des_xmlParserNodeInfoSeqPtr(n_seq, seq, 0);
13701         des_xmlNodePtr(n_node, node, 1);
13702         xmlResetLastError();
13703         if (mem_base != xmlMemBlocks()) {
13704             printf("Leak of %d blocks found in xmlParserFindNodeInfoIndex",
13705 	           xmlMemBlocks() - mem_base);
13706 	    test_ret++;
13707             printf(" %d", n_seq);
13708             printf(" %d", n_node);
13709             printf("\n");
13710         }
13711     }
13712     }
13713     function_tests++;
13714 
13715     return(test_ret);
13716 }
13717 
13718 
13719 #define gen_nb_xmlParserInputPtr 1
13720 #define gen_xmlParserInputPtr(no, nr) NULL
13721 #define des_xmlParserInputPtr(no, val, nr)
13722 
13723 static int
test_xmlParserInputGrow(void)13724 test_xmlParserInputGrow(void) {
13725     int test_ret = 0;
13726 
13727     int mem_base;
13728     int ret_val;
13729     xmlParserInputPtr in; /* an XML parser input */
13730     int n_in;
13731     int len; /* an indicative size for the lookahead */
13732     int n_len;
13733 
13734     for (n_in = 0;n_in < gen_nb_xmlParserInputPtr;n_in++) {
13735     for (n_len = 0;n_len < gen_nb_int;n_len++) {
13736         mem_base = xmlMemBlocks();
13737         in = gen_xmlParserInputPtr(n_in, 0);
13738         len = gen_int(n_len, 1);
13739 
13740         ret_val = xmlParserInputGrow(in, len);
13741         desret_int(ret_val);
13742         call_tests++;
13743         des_xmlParserInputPtr(n_in, in, 0);
13744         des_int(n_len, len, 1);
13745         xmlResetLastError();
13746         if (mem_base != xmlMemBlocks()) {
13747             printf("Leak of %d blocks found in xmlParserInputGrow",
13748 	           xmlMemBlocks() - mem_base);
13749 	    test_ret++;
13750             printf(" %d", n_in);
13751             printf(" %d", n_len);
13752             printf("\n");
13753         }
13754     }
13755     }
13756     function_tests++;
13757 
13758     return(test_ret);
13759 }
13760 
13761 
13762 static int
test_xmlParserInputRead(void)13763 test_xmlParserInputRead(void) {
13764     int test_ret = 0;
13765 
13766     int mem_base;
13767     int ret_val;
13768     xmlParserInputPtr in; /* an XML parser input */
13769     int n_in;
13770     int len; /* an indicative size for the lookahead */
13771     int n_len;
13772 
13773     for (n_in = 0;n_in < gen_nb_xmlParserInputPtr;n_in++) {
13774     for (n_len = 0;n_len < gen_nb_int;n_len++) {
13775         mem_base = xmlMemBlocks();
13776         in = gen_xmlParserInputPtr(n_in, 0);
13777         len = gen_int(n_len, 1);
13778 
13779         ret_val = xmlParserInputRead(in, len);
13780         desret_int(ret_val);
13781         call_tests++;
13782         des_xmlParserInputPtr(n_in, in, 0);
13783         des_int(n_len, len, 1);
13784         xmlResetLastError();
13785         if (mem_base != xmlMemBlocks()) {
13786             printf("Leak of %d blocks found in xmlParserInputRead",
13787 	           xmlMemBlocks() - mem_base);
13788 	    test_ret++;
13789             printf(" %d", n_in);
13790             printf(" %d", n_len);
13791             printf("\n");
13792         }
13793     }
13794     }
13795     function_tests++;
13796 
13797     return(test_ret);
13798 }
13799 
13800 
13801 static int
test_xmlPedanticParserDefault(void)13802 test_xmlPedanticParserDefault(void) {
13803     int test_ret = 0;
13804 
13805     int mem_base;
13806     int ret_val;
13807     int val; /* int 0 or 1 */
13808     int n_val;
13809 
13810     for (n_val = 0;n_val < gen_nb_int;n_val++) {
13811         mem_base = xmlMemBlocks();
13812         val = gen_int(n_val, 0);
13813 
13814         ret_val = xmlPedanticParserDefault(val);
13815         desret_int(ret_val);
13816         call_tests++;
13817         des_int(n_val, val, 0);
13818         xmlResetLastError();
13819         if (mem_base != xmlMemBlocks()) {
13820             printf("Leak of %d blocks found in xmlPedanticParserDefault",
13821 	           xmlMemBlocks() - mem_base);
13822 	    test_ret++;
13823             printf(" %d", n_val);
13824             printf("\n");
13825         }
13826     }
13827     function_tests++;
13828 
13829     return(test_ret);
13830 }
13831 
13832 
13833 static int
test_xmlReadDoc(void)13834 test_xmlReadDoc(void) {
13835     int test_ret = 0;
13836 
13837     int mem_base;
13838     xmlDocPtr ret_val;
13839     const xmlChar * cur; /* a pointer to a zero terminated string */
13840     int n_cur;
13841     const char * URL; /* the base URL to use for the document */
13842     int n_URL;
13843     const char * encoding; /* the document encoding, or NULL */
13844     int n_encoding;
13845     int options; /* a combination of xmlParserOption */
13846     int n_options;
13847 
13848     for (n_cur = 0;n_cur < gen_nb_const_xmlChar_ptr;n_cur++) {
13849     for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) {
13850     for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
13851     for (n_options = 0;n_options < gen_nb_parseroptions;n_options++) {
13852         mem_base = xmlMemBlocks();
13853         cur = gen_const_xmlChar_ptr(n_cur, 0);
13854         URL = gen_filepath(n_URL, 1);
13855         encoding = gen_const_char_ptr(n_encoding, 2);
13856         options = gen_parseroptions(n_options, 3);
13857 
13858         ret_val = xmlReadDoc(cur, URL, encoding, options);
13859         desret_xmlDocPtr(ret_val);
13860         call_tests++;
13861         des_const_xmlChar_ptr(n_cur, cur, 0);
13862         des_filepath(n_URL, URL, 1);
13863         des_const_char_ptr(n_encoding, encoding, 2);
13864         des_parseroptions(n_options, options, 3);
13865         xmlResetLastError();
13866         if (mem_base != xmlMemBlocks()) {
13867             printf("Leak of %d blocks found in xmlReadDoc",
13868 	           xmlMemBlocks() - mem_base);
13869 	    test_ret++;
13870             printf(" %d", n_cur);
13871             printf(" %d", n_URL);
13872             printf(" %d", n_encoding);
13873             printf(" %d", n_options);
13874             printf("\n");
13875         }
13876     }
13877     }
13878     }
13879     }
13880     function_tests++;
13881 
13882     return(test_ret);
13883 }
13884 
13885 
13886 static int
test_xmlReadFile(void)13887 test_xmlReadFile(void) {
13888     int test_ret = 0;
13889 
13890     int mem_base;
13891     xmlDocPtr ret_val;
13892     const char * filename; /* a file or URL */
13893     int n_filename;
13894     const char * encoding; /* the document encoding, or NULL */
13895     int n_encoding;
13896     int options; /* a combination of xmlParserOption */
13897     int n_options;
13898 
13899     for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
13900     for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
13901     for (n_options = 0;n_options < gen_nb_parseroptions;n_options++) {
13902         mem_base = xmlMemBlocks();
13903         filename = gen_filepath(n_filename, 0);
13904         encoding = gen_const_char_ptr(n_encoding, 1);
13905         options = gen_parseroptions(n_options, 2);
13906 
13907         ret_val = xmlReadFile(filename, encoding, options);
13908         desret_xmlDocPtr(ret_val);
13909         call_tests++;
13910         des_filepath(n_filename, filename, 0);
13911         des_const_char_ptr(n_encoding, encoding, 1);
13912         des_parseroptions(n_options, options, 2);
13913         xmlResetLastError();
13914         if (mem_base != xmlMemBlocks()) {
13915             printf("Leak of %d blocks found in xmlReadFile",
13916 	           xmlMemBlocks() - mem_base);
13917 	    test_ret++;
13918             printf(" %d", n_filename);
13919             printf(" %d", n_encoding);
13920             printf(" %d", n_options);
13921             printf("\n");
13922         }
13923     }
13924     }
13925     }
13926     function_tests++;
13927 
13928     return(test_ret);
13929 }
13930 
13931 
13932 static int
test_xmlReadMemory(void)13933 test_xmlReadMemory(void) {
13934     int test_ret = 0;
13935 
13936     int mem_base;
13937     xmlDocPtr ret_val;
13938     const char * buffer; /* a pointer to a char array */
13939     int n_buffer;
13940     int size; /* the size of the array */
13941     int n_size;
13942     const char * URL; /* the base URL to use for the document */
13943     int n_URL;
13944     const char * encoding; /* the document encoding, or NULL */
13945     int n_encoding;
13946     int options; /* a combination of xmlParserOption */
13947     int n_options;
13948 
13949     for (n_buffer = 0;n_buffer < gen_nb_const_char_ptr;n_buffer++) {
13950     for (n_size = 0;n_size < gen_nb_int;n_size++) {
13951     for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) {
13952     for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
13953     for (n_options = 0;n_options < gen_nb_parseroptions;n_options++) {
13954         mem_base = xmlMemBlocks();
13955         buffer = gen_const_char_ptr(n_buffer, 0);
13956         size = gen_int(n_size, 1);
13957         URL = gen_filepath(n_URL, 2);
13958         encoding = gen_const_char_ptr(n_encoding, 3);
13959         options = gen_parseroptions(n_options, 4);
13960         if ((buffer != NULL) &&
13961             (size > xmlStrlen(BAD_CAST buffer)))
13962             size = 0;
13963 
13964         ret_val = xmlReadMemory(buffer, size, URL, encoding, options);
13965         desret_xmlDocPtr(ret_val);
13966         call_tests++;
13967         des_const_char_ptr(n_buffer, buffer, 0);
13968         des_int(n_size, size, 1);
13969         des_filepath(n_URL, URL, 2);
13970         des_const_char_ptr(n_encoding, encoding, 3);
13971         des_parseroptions(n_options, options, 4);
13972         xmlResetLastError();
13973         if (mem_base != xmlMemBlocks()) {
13974             printf("Leak of %d blocks found in xmlReadMemory",
13975 	           xmlMemBlocks() - mem_base);
13976 	    test_ret++;
13977             printf(" %d", n_buffer);
13978             printf(" %d", n_size);
13979             printf(" %d", n_URL);
13980             printf(" %d", n_encoding);
13981             printf(" %d", n_options);
13982             printf("\n");
13983         }
13984     }
13985     }
13986     }
13987     }
13988     }
13989     function_tests++;
13990 
13991     return(test_ret);
13992 }
13993 
13994 
13995 static int
test_xmlRecoverDoc(void)13996 test_xmlRecoverDoc(void) {
13997     int test_ret = 0;
13998 
13999 #if defined(LIBXML_SAX1_ENABLED)
14000 #ifdef LIBXML_SAX1_ENABLED
14001     int mem_base;
14002     xmlDocPtr ret_val;
14003     const xmlChar * cur; /* a pointer to an array of xmlChar */
14004     int n_cur;
14005 
14006     for (n_cur = 0;n_cur < gen_nb_const_xmlChar_ptr;n_cur++) {
14007         mem_base = xmlMemBlocks();
14008         cur = gen_const_xmlChar_ptr(n_cur, 0);
14009 
14010         ret_val = xmlRecoverDoc(cur);
14011         desret_xmlDocPtr(ret_val);
14012         call_tests++;
14013         des_const_xmlChar_ptr(n_cur, cur, 0);
14014         xmlResetLastError();
14015         if (mem_base != xmlMemBlocks()) {
14016             printf("Leak of %d blocks found in xmlRecoverDoc",
14017 	           xmlMemBlocks() - mem_base);
14018 	    test_ret++;
14019             printf(" %d", n_cur);
14020             printf("\n");
14021         }
14022     }
14023     function_tests++;
14024 #endif
14025 #endif
14026 
14027     return(test_ret);
14028 }
14029 
14030 
14031 static int
test_xmlRecoverFile(void)14032 test_xmlRecoverFile(void) {
14033     int test_ret = 0;
14034 
14035 #if defined(LIBXML_SAX1_ENABLED)
14036 #ifdef LIBXML_SAX1_ENABLED
14037     int mem_base;
14038     xmlDocPtr ret_val;
14039     const char * filename; /* the filename */
14040     int n_filename;
14041 
14042     for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
14043         mem_base = xmlMemBlocks();
14044         filename = gen_filepath(n_filename, 0);
14045 
14046         ret_val = xmlRecoverFile(filename);
14047         desret_xmlDocPtr(ret_val);
14048         call_tests++;
14049         des_filepath(n_filename, filename, 0);
14050         xmlResetLastError();
14051         if (mem_base != xmlMemBlocks()) {
14052             printf("Leak of %d blocks found in xmlRecoverFile",
14053 	           xmlMemBlocks() - mem_base);
14054 	    test_ret++;
14055             printf(" %d", n_filename);
14056             printf("\n");
14057         }
14058     }
14059     function_tests++;
14060 #endif
14061 #endif
14062 
14063     return(test_ret);
14064 }
14065 
14066 
14067 static int
test_xmlRecoverMemory(void)14068 test_xmlRecoverMemory(void) {
14069     int test_ret = 0;
14070 
14071 #if defined(LIBXML_SAX1_ENABLED)
14072 #ifdef LIBXML_SAX1_ENABLED
14073     int mem_base;
14074     xmlDocPtr ret_val;
14075     const char * buffer; /* an pointer to a char array */
14076     int n_buffer;
14077     int size; /* the size of the array */
14078     int n_size;
14079 
14080     for (n_buffer = 0;n_buffer < gen_nb_const_char_ptr;n_buffer++) {
14081     for (n_size = 0;n_size < gen_nb_int;n_size++) {
14082         mem_base = xmlMemBlocks();
14083         buffer = gen_const_char_ptr(n_buffer, 0);
14084         size = gen_int(n_size, 1);
14085         if ((buffer != NULL) &&
14086             (size > xmlStrlen(BAD_CAST buffer)))
14087             size = 0;
14088 
14089         ret_val = xmlRecoverMemory(buffer, size);
14090         desret_xmlDocPtr(ret_val);
14091         call_tests++;
14092         des_const_char_ptr(n_buffer, buffer, 0);
14093         des_int(n_size, size, 1);
14094         xmlResetLastError();
14095         if (mem_base != xmlMemBlocks()) {
14096             printf("Leak of %d blocks found in xmlRecoverMemory",
14097 	           xmlMemBlocks() - mem_base);
14098 	    test_ret++;
14099             printf(" %d", n_buffer);
14100             printf(" %d", n_size);
14101             printf("\n");
14102         }
14103     }
14104     }
14105     function_tests++;
14106 #endif
14107 #endif
14108 
14109     return(test_ret);
14110 }
14111 
14112 
14113 static int
test_xmlSAXParseDTD(void)14114 test_xmlSAXParseDTD(void) {
14115     int test_ret = 0;
14116 
14117 #if defined(LIBXML_VALID_ENABLED)
14118 #ifdef LIBXML_SAX1_ENABLED
14119     int mem_base;
14120     xmlDtdPtr ret_val;
14121     xmlSAXHandlerPtr sax; /* the SAX handler block */
14122     int n_sax;
14123     const xmlChar * ExternalID; /* a NAME* containing the External ID of the DTD */
14124     int n_ExternalID;
14125     const xmlChar * SystemID; /* a NAME* containing the URL to the DTD */
14126     int n_SystemID;
14127 
14128     for (n_sax = 0;n_sax < gen_nb_xmlSAXHandlerPtr;n_sax++) {
14129     for (n_ExternalID = 0;n_ExternalID < gen_nb_const_xmlChar_ptr;n_ExternalID++) {
14130     for (n_SystemID = 0;n_SystemID < gen_nb_const_xmlChar_ptr;n_SystemID++) {
14131         mem_base = xmlMemBlocks();
14132         sax = gen_xmlSAXHandlerPtr(n_sax, 0);
14133         ExternalID = gen_const_xmlChar_ptr(n_ExternalID, 1);
14134         SystemID = gen_const_xmlChar_ptr(n_SystemID, 2);
14135 
14136         ret_val = xmlSAXParseDTD(sax, ExternalID, SystemID);
14137         desret_xmlDtdPtr(ret_val);
14138         call_tests++;
14139         des_xmlSAXHandlerPtr(n_sax, sax, 0);
14140         des_const_xmlChar_ptr(n_ExternalID, ExternalID, 1);
14141         des_const_xmlChar_ptr(n_SystemID, SystemID, 2);
14142         xmlResetLastError();
14143         if (mem_base != xmlMemBlocks()) {
14144             printf("Leak of %d blocks found in xmlSAXParseDTD",
14145 	           xmlMemBlocks() - mem_base);
14146 	    test_ret++;
14147             printf(" %d", n_sax);
14148             printf(" %d", n_ExternalID);
14149             printf(" %d", n_SystemID);
14150             printf("\n");
14151         }
14152     }
14153     }
14154     }
14155     function_tests++;
14156 #endif
14157 #endif
14158 
14159     return(test_ret);
14160 }
14161 
14162 
14163 static int
test_xmlSAXParseDoc(void)14164 test_xmlSAXParseDoc(void) {
14165     int test_ret = 0;
14166 
14167 #if defined(LIBXML_SAX1_ENABLED)
14168 #ifdef LIBXML_SAX1_ENABLED
14169     int mem_base;
14170     xmlDocPtr ret_val;
14171     xmlSAXHandlerPtr sax; /* the SAX handler block */
14172     int n_sax;
14173     const xmlChar * cur; /* a pointer to an array of xmlChar */
14174     int n_cur;
14175     int recovery; /* work in recovery mode, i.e. tries to read no Well Formed documents */
14176     int n_recovery;
14177 
14178     for (n_sax = 0;n_sax < gen_nb_xmlSAXHandlerPtr;n_sax++) {
14179     for (n_cur = 0;n_cur < gen_nb_const_xmlChar_ptr;n_cur++) {
14180     for (n_recovery = 0;n_recovery < gen_nb_int;n_recovery++) {
14181         mem_base = xmlMemBlocks();
14182         sax = gen_xmlSAXHandlerPtr(n_sax, 0);
14183         cur = gen_const_xmlChar_ptr(n_cur, 1);
14184         recovery = gen_int(n_recovery, 2);
14185 
14186         ret_val = xmlSAXParseDoc(sax, cur, recovery);
14187         desret_xmlDocPtr(ret_val);
14188         call_tests++;
14189         des_xmlSAXHandlerPtr(n_sax, sax, 0);
14190         des_const_xmlChar_ptr(n_cur, cur, 1);
14191         des_int(n_recovery, recovery, 2);
14192         xmlResetLastError();
14193         if (mem_base != xmlMemBlocks()) {
14194             printf("Leak of %d blocks found in xmlSAXParseDoc",
14195 	           xmlMemBlocks() - mem_base);
14196 	    test_ret++;
14197             printf(" %d", n_sax);
14198             printf(" %d", n_cur);
14199             printf(" %d", n_recovery);
14200             printf("\n");
14201         }
14202     }
14203     }
14204     }
14205     function_tests++;
14206 #endif
14207 #endif
14208 
14209     return(test_ret);
14210 }
14211 
14212 
14213 static int
test_xmlSAXParseEntity(void)14214 test_xmlSAXParseEntity(void) {
14215     int test_ret = 0;
14216 
14217 #if defined(LIBXML_SAX1_ENABLED)
14218 #ifdef LIBXML_SAX1_ENABLED
14219     int mem_base;
14220     xmlDocPtr ret_val;
14221     xmlSAXHandlerPtr sax; /* the SAX handler block */
14222     int n_sax;
14223     const char * filename; /* the filename */
14224     int n_filename;
14225 
14226     for (n_sax = 0;n_sax < gen_nb_xmlSAXHandlerPtr;n_sax++) {
14227     for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
14228         mem_base = xmlMemBlocks();
14229         sax = gen_xmlSAXHandlerPtr(n_sax, 0);
14230         filename = gen_filepath(n_filename, 1);
14231 
14232         ret_val = xmlSAXParseEntity(sax, filename);
14233         desret_xmlDocPtr(ret_val);
14234         call_tests++;
14235         des_xmlSAXHandlerPtr(n_sax, sax, 0);
14236         des_filepath(n_filename, filename, 1);
14237         xmlResetLastError();
14238         if (mem_base != xmlMemBlocks()) {
14239             printf("Leak of %d blocks found in xmlSAXParseEntity",
14240 	           xmlMemBlocks() - mem_base);
14241 	    test_ret++;
14242             printf(" %d", n_sax);
14243             printf(" %d", n_filename);
14244             printf("\n");
14245         }
14246     }
14247     }
14248     function_tests++;
14249 #endif
14250 #endif
14251 
14252     return(test_ret);
14253 }
14254 
14255 
14256 static int
test_xmlSAXParseFile(void)14257 test_xmlSAXParseFile(void) {
14258     int test_ret = 0;
14259 
14260 #if defined(LIBXML_SAX1_ENABLED)
14261 #ifdef LIBXML_SAX1_ENABLED
14262     int mem_base;
14263     xmlDocPtr ret_val;
14264     xmlSAXHandlerPtr sax; /* the SAX handler block */
14265     int n_sax;
14266     const char * filename; /* the filename */
14267     int n_filename;
14268     int recovery; /* work in recovery mode, i.e. tries to read no Well Formed documents */
14269     int n_recovery;
14270 
14271     for (n_sax = 0;n_sax < gen_nb_xmlSAXHandlerPtr;n_sax++) {
14272     for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
14273     for (n_recovery = 0;n_recovery < gen_nb_int;n_recovery++) {
14274         mem_base = xmlMemBlocks();
14275         sax = gen_xmlSAXHandlerPtr(n_sax, 0);
14276         filename = gen_filepath(n_filename, 1);
14277         recovery = gen_int(n_recovery, 2);
14278 
14279         ret_val = xmlSAXParseFile(sax, filename, recovery);
14280         desret_xmlDocPtr(ret_val);
14281         call_tests++;
14282         des_xmlSAXHandlerPtr(n_sax, sax, 0);
14283         des_filepath(n_filename, filename, 1);
14284         des_int(n_recovery, recovery, 2);
14285         xmlResetLastError();
14286         if (mem_base != xmlMemBlocks()) {
14287             printf("Leak of %d blocks found in xmlSAXParseFile",
14288 	           xmlMemBlocks() - mem_base);
14289 	    test_ret++;
14290             printf(" %d", n_sax);
14291             printf(" %d", n_filename);
14292             printf(" %d", n_recovery);
14293             printf("\n");
14294         }
14295     }
14296     }
14297     }
14298     function_tests++;
14299 #endif
14300 #endif
14301 
14302     return(test_ret);
14303 }
14304 
14305 
14306 static int
test_xmlSAXParseFileWithData(void)14307 test_xmlSAXParseFileWithData(void) {
14308     int test_ret = 0;
14309 
14310 #if defined(LIBXML_SAX1_ENABLED)
14311 #ifdef LIBXML_SAX1_ENABLED
14312     int mem_base;
14313     xmlDocPtr ret_val;
14314     xmlSAXHandlerPtr sax; /* the SAX handler block */
14315     int n_sax;
14316     const char * filename; /* the filename */
14317     int n_filename;
14318     int recovery; /* work in recovery mode, i.e. tries to read no Well Formed documents */
14319     int n_recovery;
14320     void * data; /* the userdata */
14321     int n_data;
14322 
14323     for (n_sax = 0;n_sax < gen_nb_xmlSAXHandlerPtr;n_sax++) {
14324     for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
14325     for (n_recovery = 0;n_recovery < gen_nb_int;n_recovery++) {
14326     for (n_data = 0;n_data < gen_nb_userdata;n_data++) {
14327         mem_base = xmlMemBlocks();
14328         sax = gen_xmlSAXHandlerPtr(n_sax, 0);
14329         filename = gen_filepath(n_filename, 1);
14330         recovery = gen_int(n_recovery, 2);
14331         data = gen_userdata(n_data, 3);
14332 
14333         ret_val = xmlSAXParseFileWithData(sax, filename, recovery, data);
14334         desret_xmlDocPtr(ret_val);
14335         call_tests++;
14336         des_xmlSAXHandlerPtr(n_sax, sax, 0);
14337         des_filepath(n_filename, filename, 1);
14338         des_int(n_recovery, recovery, 2);
14339         des_userdata(n_data, data, 3);
14340         xmlResetLastError();
14341         if (mem_base != xmlMemBlocks()) {
14342             printf("Leak of %d blocks found in xmlSAXParseFileWithData",
14343 	           xmlMemBlocks() - mem_base);
14344 	    test_ret++;
14345             printf(" %d", n_sax);
14346             printf(" %d", n_filename);
14347             printf(" %d", n_recovery);
14348             printf(" %d", n_data);
14349             printf("\n");
14350         }
14351     }
14352     }
14353     }
14354     }
14355     function_tests++;
14356 #endif
14357 #endif
14358 
14359     return(test_ret);
14360 }
14361 
14362 
14363 static int
test_xmlSAXParseMemory(void)14364 test_xmlSAXParseMemory(void) {
14365     int test_ret = 0;
14366 
14367 #if defined(LIBXML_SAX1_ENABLED)
14368 #ifdef LIBXML_SAX1_ENABLED
14369     int mem_base;
14370     xmlDocPtr ret_val;
14371     xmlSAXHandlerPtr sax; /* the SAX handler block */
14372     int n_sax;
14373     const char * buffer; /* an pointer to a char array */
14374     int n_buffer;
14375     int size; /* the size of the array */
14376     int n_size;
14377     int recovery; /* work in recovery mode, i.e. tries to read not Well Formed documents */
14378     int n_recovery;
14379 
14380     for (n_sax = 0;n_sax < gen_nb_xmlSAXHandlerPtr;n_sax++) {
14381     for (n_buffer = 0;n_buffer < gen_nb_const_char_ptr;n_buffer++) {
14382     for (n_size = 0;n_size < gen_nb_int;n_size++) {
14383     for (n_recovery = 0;n_recovery < gen_nb_int;n_recovery++) {
14384         mem_base = xmlMemBlocks();
14385         sax = gen_xmlSAXHandlerPtr(n_sax, 0);
14386         buffer = gen_const_char_ptr(n_buffer, 1);
14387         size = gen_int(n_size, 2);
14388         recovery = gen_int(n_recovery, 3);
14389         if ((buffer != NULL) &&
14390             (size > xmlStrlen(BAD_CAST buffer)))
14391             size = 0;
14392 
14393         ret_val = xmlSAXParseMemory(sax, buffer, size, recovery);
14394         desret_xmlDocPtr(ret_val);
14395         call_tests++;
14396         des_xmlSAXHandlerPtr(n_sax, sax, 0);
14397         des_const_char_ptr(n_buffer, buffer, 1);
14398         des_int(n_size, size, 2);
14399         des_int(n_recovery, recovery, 3);
14400         xmlResetLastError();
14401         if (mem_base != xmlMemBlocks()) {
14402             printf("Leak of %d blocks found in xmlSAXParseMemory",
14403 	           xmlMemBlocks() - mem_base);
14404 	    test_ret++;
14405             printf(" %d", n_sax);
14406             printf(" %d", n_buffer);
14407             printf(" %d", n_size);
14408             printf(" %d", n_recovery);
14409             printf("\n");
14410         }
14411     }
14412     }
14413     }
14414     }
14415     function_tests++;
14416 #endif
14417 #endif
14418 
14419     return(test_ret);
14420 }
14421 
14422 
14423 static int
test_xmlSAXParseMemoryWithData(void)14424 test_xmlSAXParseMemoryWithData(void) {
14425     int test_ret = 0;
14426 
14427 #if defined(LIBXML_SAX1_ENABLED)
14428 #ifdef LIBXML_SAX1_ENABLED
14429     int mem_base;
14430     xmlDocPtr ret_val;
14431     xmlSAXHandlerPtr sax; /* the SAX handler block */
14432     int n_sax;
14433     const char * buffer; /* an pointer to a char array */
14434     int n_buffer;
14435     int size; /* the size of the array */
14436     int n_size;
14437     int recovery; /* work in recovery mode, i.e. tries to read no Well Formed documents */
14438     int n_recovery;
14439     void * data; /* the userdata */
14440     int n_data;
14441 
14442     for (n_sax = 0;n_sax < gen_nb_xmlSAXHandlerPtr;n_sax++) {
14443     for (n_buffer = 0;n_buffer < gen_nb_const_char_ptr;n_buffer++) {
14444     for (n_size = 0;n_size < gen_nb_int;n_size++) {
14445     for (n_recovery = 0;n_recovery < gen_nb_int;n_recovery++) {
14446     for (n_data = 0;n_data < gen_nb_userdata;n_data++) {
14447         mem_base = xmlMemBlocks();
14448         sax = gen_xmlSAXHandlerPtr(n_sax, 0);
14449         buffer = gen_const_char_ptr(n_buffer, 1);
14450         size = gen_int(n_size, 2);
14451         recovery = gen_int(n_recovery, 3);
14452         data = gen_userdata(n_data, 4);
14453         if ((buffer != NULL) &&
14454             (size > xmlStrlen(BAD_CAST buffer)))
14455             size = 0;
14456 
14457         ret_val = xmlSAXParseMemoryWithData(sax, buffer, size, recovery, data);
14458         desret_xmlDocPtr(ret_val);
14459         call_tests++;
14460         des_xmlSAXHandlerPtr(n_sax, sax, 0);
14461         des_const_char_ptr(n_buffer, buffer, 1);
14462         des_int(n_size, size, 2);
14463         des_int(n_recovery, recovery, 3);
14464         des_userdata(n_data, data, 4);
14465         xmlResetLastError();
14466         if (mem_base != xmlMemBlocks()) {
14467             printf("Leak of %d blocks found in xmlSAXParseMemoryWithData",
14468 	           xmlMemBlocks() - mem_base);
14469 	    test_ret++;
14470             printf(" %d", n_sax);
14471             printf(" %d", n_buffer);
14472             printf(" %d", n_size);
14473             printf(" %d", n_recovery);
14474             printf(" %d", n_data);
14475             printf("\n");
14476         }
14477     }
14478     }
14479     }
14480     }
14481     }
14482     function_tests++;
14483 #endif
14484 #endif
14485 
14486     return(test_ret);
14487 }
14488 
14489 
14490 static int
test_xmlSAXUserParseFile(void)14491 test_xmlSAXUserParseFile(void) {
14492     int test_ret = 0;
14493 
14494 #if defined(LIBXML_SAX1_ENABLED)
14495 #ifdef LIBXML_SAX1_ENABLED
14496     int mem_base;
14497     int ret_val;
14498     xmlSAXHandlerPtr sax; /* a SAX handler */
14499     int n_sax;
14500     void * user_data; /* The user data returned on SAX callbacks */
14501     int n_user_data;
14502     const char * filename; /* a file name */
14503     int n_filename;
14504 
14505     for (n_sax = 0;n_sax < gen_nb_xmlSAXHandlerPtr;n_sax++) {
14506     for (n_user_data = 0;n_user_data < gen_nb_userdata;n_user_data++) {
14507     for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
14508         mem_base = xmlMemBlocks();
14509         sax = gen_xmlSAXHandlerPtr(n_sax, 0);
14510         user_data = gen_userdata(n_user_data, 1);
14511         filename = gen_filepath(n_filename, 2);
14512 
14513 #ifdef LIBXML_SAX1_ENABLED
14514         if (sax == (xmlSAXHandlerPtr)&xmlDefaultSAXHandler) user_data = NULL;
14515 #endif
14516 
14517 
14518         ret_val = xmlSAXUserParseFile(sax, user_data, filename);
14519         desret_int(ret_val);
14520         call_tests++;
14521         des_xmlSAXHandlerPtr(n_sax, sax, 0);
14522         des_userdata(n_user_data, user_data, 1);
14523         des_filepath(n_filename, filename, 2);
14524         xmlResetLastError();
14525         if (mem_base != xmlMemBlocks()) {
14526             printf("Leak of %d blocks found in xmlSAXUserParseFile",
14527 	           xmlMemBlocks() - mem_base);
14528 	    test_ret++;
14529             printf(" %d", n_sax);
14530             printf(" %d", n_user_data);
14531             printf(" %d", n_filename);
14532             printf("\n");
14533         }
14534     }
14535     }
14536     }
14537     function_tests++;
14538 #endif
14539 #endif
14540 
14541     return(test_ret);
14542 }
14543 
14544 
14545 static int
test_xmlSAXUserParseMemory(void)14546 test_xmlSAXUserParseMemory(void) {
14547     int test_ret = 0;
14548 
14549 #if defined(LIBXML_SAX1_ENABLED)
14550 #ifdef LIBXML_SAX1_ENABLED
14551     int mem_base;
14552     int ret_val;
14553     xmlSAXHandlerPtr sax; /* a SAX handler */
14554     int n_sax;
14555     void * user_data; /* The user data returned on SAX callbacks */
14556     int n_user_data;
14557     const char * buffer; /* an in-memory XML document input */
14558     int n_buffer;
14559     int size; /* the length of the XML document in bytes */
14560     int n_size;
14561 
14562     for (n_sax = 0;n_sax < gen_nb_xmlSAXHandlerPtr;n_sax++) {
14563     for (n_user_data = 0;n_user_data < gen_nb_userdata;n_user_data++) {
14564     for (n_buffer = 0;n_buffer < gen_nb_const_char_ptr;n_buffer++) {
14565     for (n_size = 0;n_size < gen_nb_int;n_size++) {
14566         mem_base = xmlMemBlocks();
14567         sax = gen_xmlSAXHandlerPtr(n_sax, 0);
14568         user_data = gen_userdata(n_user_data, 1);
14569         buffer = gen_const_char_ptr(n_buffer, 2);
14570         size = gen_int(n_size, 3);
14571         if ((buffer != NULL) &&
14572             (size > xmlStrlen(BAD_CAST buffer)))
14573             size = 0;
14574 
14575 #ifdef LIBXML_SAX1_ENABLED
14576         if (sax == (xmlSAXHandlerPtr)&xmlDefaultSAXHandler) user_data = NULL;
14577 #endif
14578 
14579 
14580         ret_val = xmlSAXUserParseMemory(sax, user_data, buffer, size);
14581         desret_int(ret_val);
14582         call_tests++;
14583         des_xmlSAXHandlerPtr(n_sax, sax, 0);
14584         des_userdata(n_user_data, user_data, 1);
14585         des_const_char_ptr(n_buffer, buffer, 2);
14586         des_int(n_size, size, 3);
14587         xmlResetLastError();
14588         if (mem_base != xmlMemBlocks()) {
14589             printf("Leak of %d blocks found in xmlSAXUserParseMemory",
14590 	           xmlMemBlocks() - mem_base);
14591 	    test_ret++;
14592             printf(" %d", n_sax);
14593             printf(" %d", n_user_data);
14594             printf(" %d", n_buffer);
14595             printf(" %d", n_size);
14596             printf("\n");
14597         }
14598     }
14599     }
14600     }
14601     }
14602     function_tests++;
14603 #endif
14604 #endif
14605 
14606     return(test_ret);
14607 }
14608 
14609 
14610 static int
test_xmlSetExternalEntityLoader(void)14611 test_xmlSetExternalEntityLoader(void) {
14612     int test_ret = 0;
14613 
14614 
14615     /* missing type support */
14616     return(test_ret);
14617 }
14618 
14619 
14620 static int
test_xmlSetupParserForBuffer(void)14621 test_xmlSetupParserForBuffer(void) {
14622     int test_ret = 0;
14623 
14624 #if defined(LIBXML_SAX1_ENABLED)
14625 #ifdef LIBXML_SAX1_ENABLED
14626     int mem_base;
14627     xmlParserCtxtPtr ctxt; /* an XML parser context */
14628     int n_ctxt;
14629     const xmlChar * buffer; /* a xmlChar * buffer */
14630     int n_buffer;
14631     const char * filename; /* a file name */
14632     int n_filename;
14633 
14634     for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
14635     for (n_buffer = 0;n_buffer < gen_nb_const_xmlChar_ptr;n_buffer++) {
14636     for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
14637         mem_base = xmlMemBlocks();
14638         ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
14639         buffer = gen_const_xmlChar_ptr(n_buffer, 1);
14640         filename = gen_filepath(n_filename, 2);
14641 
14642         xmlSetupParserForBuffer(ctxt, buffer, filename);
14643         call_tests++;
14644         des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
14645         des_const_xmlChar_ptr(n_buffer, buffer, 1);
14646         des_filepath(n_filename, filename, 2);
14647         xmlResetLastError();
14648         if (mem_base != xmlMemBlocks()) {
14649             printf("Leak of %d blocks found in xmlSetupParserForBuffer",
14650 	           xmlMemBlocks() - mem_base);
14651 	    test_ret++;
14652             printf(" %d", n_ctxt);
14653             printf(" %d", n_buffer);
14654             printf(" %d", n_filename);
14655             printf("\n");
14656         }
14657     }
14658     }
14659     }
14660     function_tests++;
14661 #endif
14662 #endif
14663 
14664     return(test_ret);
14665 }
14666 
14667 
14668 static int
test_xmlStopParser(void)14669 test_xmlStopParser(void) {
14670     int test_ret = 0;
14671 
14672 #ifdef LIBXML_PUSH_ENABLED
14673     int mem_base;
14674     xmlParserCtxtPtr ctxt; /* an XML parser context */
14675     int n_ctxt;
14676 
14677     for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
14678         mem_base = xmlMemBlocks();
14679         ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
14680 
14681         xmlStopParser(ctxt);
14682         call_tests++;
14683         des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
14684         xmlResetLastError();
14685         if (mem_base != xmlMemBlocks()) {
14686             printf("Leak of %d blocks found in xmlStopParser",
14687 	           xmlMemBlocks() - mem_base);
14688 	    test_ret++;
14689             printf(" %d", n_ctxt);
14690             printf("\n");
14691         }
14692     }
14693     function_tests++;
14694 #endif
14695 
14696     return(test_ret);
14697 }
14698 
14699 
14700 static int
test_xmlSubstituteEntitiesDefault(void)14701 test_xmlSubstituteEntitiesDefault(void) {
14702     int test_ret = 0;
14703 
14704     int mem_base;
14705     int ret_val;
14706     int val; /* int 0 or 1 */
14707     int n_val;
14708 
14709     for (n_val = 0;n_val < gen_nb_int;n_val++) {
14710         mem_base = xmlMemBlocks();
14711         val = gen_int(n_val, 0);
14712 
14713         ret_val = xmlSubstituteEntitiesDefault(val);
14714         desret_int(ret_val);
14715         call_tests++;
14716         des_int(n_val, val, 0);
14717         xmlResetLastError();
14718         if (mem_base != xmlMemBlocks()) {
14719             printf("Leak of %d blocks found in xmlSubstituteEntitiesDefault",
14720 	           xmlMemBlocks() - mem_base);
14721 	    test_ret++;
14722             printf(" %d", n_val);
14723             printf("\n");
14724         }
14725     }
14726     function_tests++;
14727 
14728     return(test_ret);
14729 }
14730 
14731 
14732 static int
test_xmlThrDefDoValidityCheckingDefaultValue(void)14733 test_xmlThrDefDoValidityCheckingDefaultValue(void) {
14734     int test_ret = 0;
14735 
14736     int mem_base;
14737     int ret_val;
14738     int v; /*  */
14739     int n_v;
14740 
14741     for (n_v = 0;n_v < gen_nb_int;n_v++) {
14742         mem_base = xmlMemBlocks();
14743         v = gen_int(n_v, 0);
14744 
14745         ret_val = xmlThrDefDoValidityCheckingDefaultValue(v);
14746         desret_int(ret_val);
14747         call_tests++;
14748         des_int(n_v, v, 0);
14749         xmlResetLastError();
14750         if (mem_base != xmlMemBlocks()) {
14751             printf("Leak of %d blocks found in xmlThrDefDoValidityCheckingDefaultValue",
14752 	           xmlMemBlocks() - mem_base);
14753 	    test_ret++;
14754             printf(" %d", n_v);
14755             printf("\n");
14756         }
14757     }
14758     function_tests++;
14759 
14760     return(test_ret);
14761 }
14762 
14763 
14764 static int
test_xmlThrDefGetWarningsDefaultValue(void)14765 test_xmlThrDefGetWarningsDefaultValue(void) {
14766     int test_ret = 0;
14767 
14768     int mem_base;
14769     int ret_val;
14770     int v; /*  */
14771     int n_v;
14772 
14773     for (n_v = 0;n_v < gen_nb_int;n_v++) {
14774         mem_base = xmlMemBlocks();
14775         v = gen_int(n_v, 0);
14776 
14777         ret_val = xmlThrDefGetWarningsDefaultValue(v);
14778         desret_int(ret_val);
14779         call_tests++;
14780         des_int(n_v, v, 0);
14781         xmlResetLastError();
14782         if (mem_base != xmlMemBlocks()) {
14783             printf("Leak of %d blocks found in xmlThrDefGetWarningsDefaultValue",
14784 	           xmlMemBlocks() - mem_base);
14785 	    test_ret++;
14786             printf(" %d", n_v);
14787             printf("\n");
14788         }
14789     }
14790     function_tests++;
14791 
14792     return(test_ret);
14793 }
14794 
14795 
14796 static int
test_xmlThrDefKeepBlanksDefaultValue(void)14797 test_xmlThrDefKeepBlanksDefaultValue(void) {
14798     int test_ret = 0;
14799 
14800     int mem_base;
14801     int ret_val;
14802     int v; /*  */
14803     int n_v;
14804 
14805     for (n_v = 0;n_v < gen_nb_int;n_v++) {
14806         mem_base = xmlMemBlocks();
14807         v = gen_int(n_v, 0);
14808 
14809         ret_val = xmlThrDefKeepBlanksDefaultValue(v);
14810         desret_int(ret_val);
14811         call_tests++;
14812         des_int(n_v, v, 0);
14813         xmlResetLastError();
14814         if (mem_base != xmlMemBlocks()) {
14815             printf("Leak of %d blocks found in xmlThrDefKeepBlanksDefaultValue",
14816 	           xmlMemBlocks() - mem_base);
14817 	    test_ret++;
14818             printf(" %d", n_v);
14819             printf("\n");
14820         }
14821     }
14822     function_tests++;
14823 
14824     return(test_ret);
14825 }
14826 
14827 
14828 static int
test_xmlThrDefLineNumbersDefaultValue(void)14829 test_xmlThrDefLineNumbersDefaultValue(void) {
14830     int test_ret = 0;
14831 
14832     int mem_base;
14833     int ret_val;
14834     int v; /*  */
14835     int n_v;
14836 
14837     for (n_v = 0;n_v < gen_nb_int;n_v++) {
14838         mem_base = xmlMemBlocks();
14839         v = gen_int(n_v, 0);
14840 
14841         ret_val = xmlThrDefLineNumbersDefaultValue(v);
14842         desret_int(ret_val);
14843         call_tests++;
14844         des_int(n_v, v, 0);
14845         xmlResetLastError();
14846         if (mem_base != xmlMemBlocks()) {
14847             printf("Leak of %d blocks found in xmlThrDefLineNumbersDefaultValue",
14848 	           xmlMemBlocks() - mem_base);
14849 	    test_ret++;
14850             printf(" %d", n_v);
14851             printf("\n");
14852         }
14853     }
14854     function_tests++;
14855 
14856     return(test_ret);
14857 }
14858 
14859 
14860 static int
test_xmlThrDefLoadExtDtdDefaultValue(void)14861 test_xmlThrDefLoadExtDtdDefaultValue(void) {
14862     int test_ret = 0;
14863 
14864     int mem_base;
14865     int ret_val;
14866     int v; /*  */
14867     int n_v;
14868 
14869     for (n_v = 0;n_v < gen_nb_int;n_v++) {
14870         mem_base = xmlMemBlocks();
14871         v = gen_int(n_v, 0);
14872 
14873         ret_val = xmlThrDefLoadExtDtdDefaultValue(v);
14874         desret_int(ret_val);
14875         call_tests++;
14876         des_int(n_v, v, 0);
14877         xmlResetLastError();
14878         if (mem_base != xmlMemBlocks()) {
14879             printf("Leak of %d blocks found in xmlThrDefLoadExtDtdDefaultValue",
14880 	           xmlMemBlocks() - mem_base);
14881 	    test_ret++;
14882             printf(" %d", n_v);
14883             printf("\n");
14884         }
14885     }
14886     function_tests++;
14887 
14888     return(test_ret);
14889 }
14890 
14891 
14892 static int
test_xmlThrDefParserDebugEntities(void)14893 test_xmlThrDefParserDebugEntities(void) {
14894     int test_ret = 0;
14895 
14896     int mem_base;
14897     int ret_val;
14898     int v; /*  */
14899     int n_v;
14900 
14901     for (n_v = 0;n_v < gen_nb_int;n_v++) {
14902         mem_base = xmlMemBlocks();
14903         v = gen_int(n_v, 0);
14904 
14905         ret_val = xmlThrDefParserDebugEntities(v);
14906         desret_int(ret_val);
14907         call_tests++;
14908         des_int(n_v, v, 0);
14909         xmlResetLastError();
14910         if (mem_base != xmlMemBlocks()) {
14911             printf("Leak of %d blocks found in xmlThrDefParserDebugEntities",
14912 	           xmlMemBlocks() - mem_base);
14913 	    test_ret++;
14914             printf(" %d", n_v);
14915             printf("\n");
14916         }
14917     }
14918     function_tests++;
14919 
14920     return(test_ret);
14921 }
14922 
14923 
14924 static int
test_xmlThrDefPedanticParserDefaultValue(void)14925 test_xmlThrDefPedanticParserDefaultValue(void) {
14926     int test_ret = 0;
14927 
14928     int mem_base;
14929     int ret_val;
14930     int v; /*  */
14931     int n_v;
14932 
14933     for (n_v = 0;n_v < gen_nb_int;n_v++) {
14934         mem_base = xmlMemBlocks();
14935         v = gen_int(n_v, 0);
14936 
14937         ret_val = xmlThrDefPedanticParserDefaultValue(v);
14938         desret_int(ret_val);
14939         call_tests++;
14940         des_int(n_v, v, 0);
14941         xmlResetLastError();
14942         if (mem_base != xmlMemBlocks()) {
14943             printf("Leak of %d blocks found in xmlThrDefPedanticParserDefaultValue",
14944 	           xmlMemBlocks() - mem_base);
14945 	    test_ret++;
14946             printf(" %d", n_v);
14947             printf("\n");
14948         }
14949     }
14950     function_tests++;
14951 
14952     return(test_ret);
14953 }
14954 
14955 
14956 static int
test_xmlThrDefSubstituteEntitiesDefaultValue(void)14957 test_xmlThrDefSubstituteEntitiesDefaultValue(void) {
14958     int test_ret = 0;
14959 
14960     int mem_base;
14961     int ret_val;
14962     int v; /*  */
14963     int n_v;
14964 
14965     for (n_v = 0;n_v < gen_nb_int;n_v++) {
14966         mem_base = xmlMemBlocks();
14967         v = gen_int(n_v, 0);
14968 
14969         ret_val = xmlThrDefSubstituteEntitiesDefaultValue(v);
14970         desret_int(ret_val);
14971         call_tests++;
14972         des_int(n_v, v, 0);
14973         xmlResetLastError();
14974         if (mem_base != xmlMemBlocks()) {
14975             printf("Leak of %d blocks found in xmlThrDefSubstituteEntitiesDefaultValue",
14976 	           xmlMemBlocks() - mem_base);
14977 	    test_ret++;
14978             printf(" %d", n_v);
14979             printf("\n");
14980         }
14981     }
14982     function_tests++;
14983 
14984     return(test_ret);
14985 }
14986 
14987 static int
test_parser(void)14988 test_parser(void) {
14989     int test_ret = 0;
14990 
14991     if (quiet == 0) printf("Testing parser : 67 of 80 functions ...\n");
14992     test_ret += test_xmlByteConsumed();
14993     test_ret += test_xmlClearNodeInfoSeq();
14994     test_ret += test_xmlClearParserCtxt();
14995     test_ret += test_xmlCreateDocParserCtxt();
14996     test_ret += test_xmlCreatePushParserCtxt();
14997     test_ret += test_xmlCtxtReadDoc();
14998     test_ret += test_xmlCtxtReadFile();
14999     test_ret += test_xmlCtxtReadMemory();
15000     test_ret += test_xmlCtxtReset();
15001     test_ret += test_xmlCtxtResetPush();
15002     test_ret += test_xmlCtxtSetMaxAmplification();
15003     test_ret += test_xmlCtxtUseOptions();
15004     test_ret += test_xmlGetExternalEntityLoader();
15005     test_ret += test_xmlHasFeature();
15006     test_ret += test_xmlIOParseDTD();
15007     test_ret += test_xmlInitNodeInfoSeq();
15008     test_ret += test_xmlInitParser();
15009     test_ret += test_xmlInitParserCtxt();
15010     test_ret += test_xmlKeepBlanksDefault();
15011     test_ret += test_xmlLineNumbersDefault();
15012     test_ret += test_xmlLoadExternalEntity();
15013     test_ret += test_xmlNewIOInputStream();
15014     test_ret += test_xmlNewParserCtxt();
15015     test_ret += test_xmlNewSAXParserCtxt();
15016     test_ret += test_xmlParseBalancedChunkMemory();
15017     test_ret += test_xmlParseBalancedChunkMemoryRecover();
15018     test_ret += test_xmlParseChunk();
15019     test_ret += test_xmlParseCtxtExternalEntity();
15020     test_ret += test_xmlParseDTD();
15021     test_ret += test_xmlParseDoc();
15022     test_ret += test_xmlParseDocument();
15023     test_ret += test_xmlParseEntity();
15024     test_ret += test_xmlParseExtParsedEnt();
15025     test_ret += test_xmlParseExternalEntity();
15026     test_ret += test_xmlParseFile();
15027     test_ret += test_xmlParseInNodeContext();
15028     test_ret += test_xmlParseMemory();
15029     test_ret += test_xmlParserAddNodeInfo();
15030     test_ret += test_xmlParserFindNodeInfo();
15031     test_ret += test_xmlParserFindNodeInfoIndex();
15032     test_ret += test_xmlParserInputGrow();
15033     test_ret += test_xmlParserInputRead();
15034     test_ret += test_xmlPedanticParserDefault();
15035     test_ret += test_xmlReadDoc();
15036     test_ret += test_xmlReadFile();
15037     test_ret += test_xmlReadMemory();
15038     test_ret += test_xmlRecoverDoc();
15039     test_ret += test_xmlRecoverFile();
15040     test_ret += test_xmlRecoverMemory();
15041     test_ret += test_xmlSAXParseDTD();
15042     test_ret += test_xmlSAXParseDoc();
15043     test_ret += test_xmlSAXParseEntity();
15044     test_ret += test_xmlSAXParseFile();
15045     test_ret += test_xmlSAXParseFileWithData();
15046     test_ret += test_xmlSAXParseMemory();
15047     test_ret += test_xmlSAXParseMemoryWithData();
15048     test_ret += test_xmlSAXUserParseFile();
15049     test_ret += test_xmlSAXUserParseMemory();
15050     test_ret += test_xmlSetExternalEntityLoader();
15051     test_ret += test_xmlSetupParserForBuffer();
15052     test_ret += test_xmlStopParser();
15053     test_ret += test_xmlSubstituteEntitiesDefault();
15054     test_ret += test_xmlThrDefDoValidityCheckingDefaultValue();
15055     test_ret += test_xmlThrDefGetWarningsDefaultValue();
15056     test_ret += test_xmlThrDefKeepBlanksDefaultValue();
15057     test_ret += test_xmlThrDefLineNumbersDefaultValue();
15058     test_ret += test_xmlThrDefLoadExtDtdDefaultValue();
15059     test_ret += test_xmlThrDefParserDebugEntities();
15060     test_ret += test_xmlThrDefPedanticParserDefaultValue();
15061     test_ret += test_xmlThrDefSubstituteEntitiesDefaultValue();
15062 
15063     if (test_ret != 0)
15064 	printf("Module parser: %d errors\n", test_ret);
15065     return(test_ret);
15066 }
15067 
15068 static int
test_inputPop(void)15069 test_inputPop(void) {
15070     int test_ret = 0;
15071 
15072     int mem_base;
15073     xmlParserInputPtr ret_val;
15074     xmlParserCtxtPtr ctxt; /* an XML parser context */
15075     int n_ctxt;
15076 
15077     for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
15078         mem_base = xmlMemBlocks();
15079         ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
15080 
15081         ret_val = inputPop(ctxt);
15082         desret_xmlParserInputPtr(ret_val);
15083         call_tests++;
15084         des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
15085         xmlResetLastError();
15086         if (mem_base != xmlMemBlocks()) {
15087             printf("Leak of %d blocks found in inputPop",
15088 	           xmlMemBlocks() - mem_base);
15089 	    test_ret++;
15090             printf(" %d", n_ctxt);
15091             printf("\n");
15092         }
15093     }
15094     function_tests++;
15095 
15096     return(test_ret);
15097 }
15098 
15099 
15100 static int
test_inputPush(void)15101 test_inputPush(void) {
15102     int test_ret = 0;
15103 
15104     int mem_base;
15105     int ret_val;
15106     xmlParserCtxtPtr ctxt; /* an XML parser context */
15107     int n_ctxt;
15108     xmlParserInputPtr value; /* the parser input */
15109     int n_value;
15110 
15111     for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
15112     for (n_value = 0;n_value < gen_nb_xmlParserInputPtr;n_value++) {
15113         mem_base = xmlMemBlocks();
15114         ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
15115         value = gen_xmlParserInputPtr(n_value, 1);
15116 
15117         ret_val = inputPush(ctxt, value);
15118         desret_int(ret_val);
15119         call_tests++;
15120         des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
15121         des_xmlParserInputPtr(n_value, value, 1);
15122         xmlResetLastError();
15123         if (mem_base != xmlMemBlocks()) {
15124             printf("Leak of %d blocks found in inputPush",
15125 	           xmlMemBlocks() - mem_base);
15126 	    test_ret++;
15127             printf(" %d", n_ctxt);
15128             printf(" %d", n_value);
15129             printf("\n");
15130         }
15131     }
15132     }
15133     function_tests++;
15134 
15135     return(test_ret);
15136 }
15137 
15138 
15139 static int
test_namePop(void)15140 test_namePop(void) {
15141     int test_ret = 0;
15142 
15143     int mem_base;
15144     const xmlChar * ret_val;
15145     xmlParserCtxtPtr ctxt; /* an XML parser context */
15146     int n_ctxt;
15147 
15148     for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
15149         mem_base = xmlMemBlocks();
15150         ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
15151 
15152         ret_val = namePop(ctxt);
15153         desret_const_xmlChar_ptr(ret_val);
15154         call_tests++;
15155         des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
15156         xmlResetLastError();
15157         if (mem_base != xmlMemBlocks()) {
15158             printf("Leak of %d blocks found in namePop",
15159 	           xmlMemBlocks() - mem_base);
15160 	    test_ret++;
15161             printf(" %d", n_ctxt);
15162             printf("\n");
15163         }
15164     }
15165     function_tests++;
15166 
15167     return(test_ret);
15168 }
15169 
15170 
15171 static int
test_namePush(void)15172 test_namePush(void) {
15173     int test_ret = 0;
15174 
15175     int mem_base;
15176     int ret_val;
15177     xmlParserCtxtPtr ctxt; /* an XML parser context */
15178     int n_ctxt;
15179     const xmlChar * value; /* the element name */
15180     int n_value;
15181 
15182     for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
15183     for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
15184         mem_base = xmlMemBlocks();
15185         ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
15186         value = gen_const_xmlChar_ptr(n_value, 1);
15187 
15188         ret_val = namePush(ctxt, value);
15189         desret_int(ret_val);
15190         call_tests++;
15191         des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
15192         des_const_xmlChar_ptr(n_value, value, 1);
15193         xmlResetLastError();
15194         if (mem_base != xmlMemBlocks()) {
15195             printf("Leak of %d blocks found in namePush",
15196 	           xmlMemBlocks() - mem_base);
15197 	    test_ret++;
15198             printf(" %d", n_ctxt);
15199             printf(" %d", n_value);
15200             printf("\n");
15201         }
15202     }
15203     }
15204     function_tests++;
15205 
15206     return(test_ret);
15207 }
15208 
15209 
15210 static int
test_nodePop(void)15211 test_nodePop(void) {
15212     int test_ret = 0;
15213 
15214     int mem_base;
15215     xmlNodePtr ret_val;
15216     xmlParserCtxtPtr ctxt; /* an XML parser context */
15217     int n_ctxt;
15218 
15219     for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
15220         mem_base = xmlMemBlocks();
15221         ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
15222 
15223         ret_val = nodePop(ctxt);
15224         desret_xmlNodePtr(ret_val);
15225         call_tests++;
15226         des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
15227         xmlResetLastError();
15228         if (mem_base != xmlMemBlocks()) {
15229             printf("Leak of %d blocks found in nodePop",
15230 	           xmlMemBlocks() - mem_base);
15231 	    test_ret++;
15232             printf(" %d", n_ctxt);
15233             printf("\n");
15234         }
15235     }
15236     function_tests++;
15237 
15238     return(test_ret);
15239 }
15240 
15241 
15242 static int
test_nodePush(void)15243 test_nodePush(void) {
15244     int test_ret = 0;
15245 
15246     int mem_base;
15247     int ret_val;
15248     xmlParserCtxtPtr ctxt; /* an XML parser context */
15249     int n_ctxt;
15250     xmlNodePtr value; /* the element node */
15251     int n_value;
15252 
15253     for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
15254     for (n_value = 0;n_value < gen_nb_xmlNodePtr;n_value++) {
15255         mem_base = xmlMemBlocks();
15256         ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
15257         value = gen_xmlNodePtr(n_value, 1);
15258 
15259         ret_val = nodePush(ctxt, value);
15260         desret_int(ret_val);
15261         call_tests++;
15262         des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
15263         des_xmlNodePtr(n_value, value, 1);
15264         xmlResetLastError();
15265         if (mem_base != xmlMemBlocks()) {
15266             printf("Leak of %d blocks found in nodePush",
15267 	           xmlMemBlocks() - mem_base);
15268 	    test_ret++;
15269             printf(" %d", n_ctxt);
15270             printf(" %d", n_value);
15271             printf("\n");
15272         }
15273     }
15274     }
15275     function_tests++;
15276 
15277     return(test_ret);
15278 }
15279 
15280 
15281 static int
test_xmlCheckLanguageID(void)15282 test_xmlCheckLanguageID(void) {
15283     int test_ret = 0;
15284 
15285     int mem_base;
15286     int ret_val;
15287     const xmlChar * lang; /* pointer to the string value */
15288     int n_lang;
15289 
15290     for (n_lang = 0;n_lang < gen_nb_const_xmlChar_ptr;n_lang++) {
15291         mem_base = xmlMemBlocks();
15292         lang = gen_const_xmlChar_ptr(n_lang, 0);
15293 
15294         ret_val = xmlCheckLanguageID(lang);
15295         desret_int(ret_val);
15296         call_tests++;
15297         des_const_xmlChar_ptr(n_lang, lang, 0);
15298         xmlResetLastError();
15299         if (mem_base != xmlMemBlocks()) {
15300             printf("Leak of %d blocks found in xmlCheckLanguageID",
15301 	           xmlMemBlocks() - mem_base);
15302 	    test_ret++;
15303             printf(" %d", n_lang);
15304             printf("\n");
15305         }
15306     }
15307     function_tests++;
15308 
15309     return(test_ret);
15310 }
15311 
15312 
15313 static int
test_xmlCopyChar(void)15314 test_xmlCopyChar(void) {
15315     int test_ret = 0;
15316 
15317     int mem_base;
15318     int ret_val;
15319     int len; /* Ignored, compatibility */
15320     int n_len;
15321     xmlChar * out; /* pointer to an array of xmlChar */
15322     int n_out;
15323     int val; /* the char value */
15324     int n_val;
15325 
15326     for (n_len = 0;n_len < gen_nb_int;n_len++) {
15327     for (n_out = 0;n_out < gen_nb_xmlChar_ptr;n_out++) {
15328     for (n_val = 0;n_val < gen_nb_int;n_val++) {
15329         mem_base = xmlMemBlocks();
15330         len = gen_int(n_len, 0);
15331         out = gen_xmlChar_ptr(n_out, 1);
15332         val = gen_int(n_val, 2);
15333 
15334         ret_val = xmlCopyChar(len, out, val);
15335         desret_int(ret_val);
15336         call_tests++;
15337         des_int(n_len, len, 0);
15338         des_xmlChar_ptr(n_out, out, 1);
15339         des_int(n_val, val, 2);
15340         xmlResetLastError();
15341         if (mem_base != xmlMemBlocks()) {
15342             printf("Leak of %d blocks found in xmlCopyChar",
15343 	           xmlMemBlocks() - mem_base);
15344 	    test_ret++;
15345             printf(" %d", n_len);
15346             printf(" %d", n_out);
15347             printf(" %d", n_val);
15348             printf("\n");
15349         }
15350     }
15351     }
15352     }
15353     function_tests++;
15354 
15355     return(test_ret);
15356 }
15357 
15358 
15359 static int
test_xmlCopyCharMultiByte(void)15360 test_xmlCopyCharMultiByte(void) {
15361     int test_ret = 0;
15362 
15363     int mem_base;
15364     int ret_val;
15365     xmlChar * out; /* pointer to an array of xmlChar */
15366     int n_out;
15367     int val; /* the char value */
15368     int n_val;
15369 
15370     for (n_out = 0;n_out < gen_nb_xmlChar_ptr;n_out++) {
15371     for (n_val = 0;n_val < gen_nb_int;n_val++) {
15372         mem_base = xmlMemBlocks();
15373         out = gen_xmlChar_ptr(n_out, 0);
15374         val = gen_int(n_val, 1);
15375 
15376         ret_val = xmlCopyCharMultiByte(out, val);
15377         desret_int(ret_val);
15378         call_tests++;
15379         des_xmlChar_ptr(n_out, out, 0);
15380         des_int(n_val, val, 1);
15381         xmlResetLastError();
15382         if (mem_base != xmlMemBlocks()) {
15383             printf("Leak of %d blocks found in xmlCopyCharMultiByte",
15384 	           xmlMemBlocks() - mem_base);
15385 	    test_ret++;
15386             printf(" %d", n_out);
15387             printf(" %d", n_val);
15388             printf("\n");
15389         }
15390     }
15391     }
15392     function_tests++;
15393 
15394     return(test_ret);
15395 }
15396 
15397 
15398 static int
test_xmlCreateEntityParserCtxt(void)15399 test_xmlCreateEntityParserCtxt(void) {
15400     int test_ret = 0;
15401 
15402     int mem_base;
15403     xmlParserCtxtPtr ret_val;
15404     const xmlChar * URL; /* the entity URL */
15405     int n_URL;
15406     const xmlChar * ID; /* the entity PUBLIC ID */
15407     int n_ID;
15408     const xmlChar * base; /* a possible base for the target URI */
15409     int n_base;
15410 
15411     for (n_URL = 0;n_URL < gen_nb_const_xmlChar_ptr;n_URL++) {
15412     for (n_ID = 0;n_ID < gen_nb_const_xmlChar_ptr;n_ID++) {
15413     for (n_base = 0;n_base < gen_nb_const_xmlChar_ptr;n_base++) {
15414         mem_base = xmlMemBlocks();
15415         URL = gen_const_xmlChar_ptr(n_URL, 0);
15416         ID = gen_const_xmlChar_ptr(n_ID, 1);
15417         base = gen_const_xmlChar_ptr(n_base, 2);
15418 
15419         ret_val = xmlCreateEntityParserCtxt(URL, ID, base);
15420         desret_xmlParserCtxtPtr(ret_val);
15421         call_tests++;
15422         des_const_xmlChar_ptr(n_URL, URL, 0);
15423         des_const_xmlChar_ptr(n_ID, ID, 1);
15424         des_const_xmlChar_ptr(n_base, base, 2);
15425         xmlResetLastError();
15426         if (mem_base != xmlMemBlocks()) {
15427             printf("Leak of %d blocks found in xmlCreateEntityParserCtxt",
15428 	           xmlMemBlocks() - mem_base);
15429 	    test_ret++;
15430             printf(" %d", n_URL);
15431             printf(" %d", n_ID);
15432             printf(" %d", n_base);
15433             printf("\n");
15434         }
15435     }
15436     }
15437     }
15438     function_tests++;
15439 
15440     return(test_ret);
15441 }
15442 
15443 
15444 static int
test_xmlCreateFileParserCtxt(void)15445 test_xmlCreateFileParserCtxt(void) {
15446     int test_ret = 0;
15447 
15448     int mem_base;
15449     xmlParserCtxtPtr ret_val;
15450     const char * filename; /* the filename */
15451     int n_filename;
15452 
15453     for (n_filename = 0;n_filename < gen_nb_fileoutput;n_filename++) {
15454         mem_base = xmlMemBlocks();
15455         filename = gen_fileoutput(n_filename, 0);
15456 
15457         ret_val = xmlCreateFileParserCtxt(filename);
15458         desret_xmlParserCtxtPtr(ret_val);
15459         call_tests++;
15460         des_fileoutput(n_filename, filename, 0);
15461         xmlResetLastError();
15462         if (mem_base != xmlMemBlocks()) {
15463             printf("Leak of %d blocks found in xmlCreateFileParserCtxt",
15464 	           xmlMemBlocks() - mem_base);
15465 	    test_ret++;
15466             printf(" %d", n_filename);
15467             printf("\n");
15468         }
15469     }
15470     function_tests++;
15471 
15472     return(test_ret);
15473 }
15474 
15475 
15476 static int
test_xmlCreateMemoryParserCtxt(void)15477 test_xmlCreateMemoryParserCtxt(void) {
15478     int test_ret = 0;
15479 
15480     int mem_base;
15481     xmlParserCtxtPtr ret_val;
15482     const char * buffer; /* a pointer to a char array */
15483     int n_buffer;
15484     int size; /* the size of the array */
15485     int n_size;
15486 
15487     for (n_buffer = 0;n_buffer < gen_nb_const_char_ptr;n_buffer++) {
15488     for (n_size = 0;n_size < gen_nb_int;n_size++) {
15489         mem_base = xmlMemBlocks();
15490         buffer = gen_const_char_ptr(n_buffer, 0);
15491         size = gen_int(n_size, 1);
15492         if ((buffer != NULL) &&
15493             (size > xmlStrlen(BAD_CAST buffer)))
15494             size = 0;
15495 
15496         ret_val = xmlCreateMemoryParserCtxt(buffer, size);
15497         desret_xmlParserCtxtPtr(ret_val);
15498         call_tests++;
15499         des_const_char_ptr(n_buffer, buffer, 0);
15500         des_int(n_size, size, 1);
15501         xmlResetLastError();
15502         if (mem_base != xmlMemBlocks()) {
15503             printf("Leak of %d blocks found in xmlCreateMemoryParserCtxt",
15504 	           xmlMemBlocks() - mem_base);
15505 	    test_ret++;
15506             printf(" %d", n_buffer);
15507             printf(" %d", n_size);
15508             printf("\n");
15509         }
15510     }
15511     }
15512     function_tests++;
15513 
15514     return(test_ret);
15515 }
15516 
15517 
15518 static int
test_xmlCreateURLParserCtxt(void)15519 test_xmlCreateURLParserCtxt(void) {
15520     int test_ret = 0;
15521 
15522     int mem_base;
15523     xmlParserCtxtPtr ret_val;
15524     const char * filename; /* the filename or URL */
15525     int n_filename;
15526     int options; /* a combination of xmlParserOption */
15527     int n_options;
15528 
15529     for (n_filename = 0;n_filename < gen_nb_fileoutput;n_filename++) {
15530     for (n_options = 0;n_options < gen_nb_int;n_options++) {
15531         mem_base = xmlMemBlocks();
15532         filename = gen_fileoutput(n_filename, 0);
15533         options = gen_int(n_options, 1);
15534 
15535         ret_val = xmlCreateURLParserCtxt(filename, options);
15536         desret_xmlParserCtxtPtr(ret_val);
15537         call_tests++;
15538         des_fileoutput(n_filename, filename, 0);
15539         des_int(n_options, options, 1);
15540         xmlResetLastError();
15541         if (mem_base != xmlMemBlocks()) {
15542             printf("Leak of %d blocks found in xmlCreateURLParserCtxt",
15543 	           xmlMemBlocks() - mem_base);
15544 	    test_ret++;
15545             printf(" %d", n_filename);
15546             printf(" %d", n_options);
15547             printf("\n");
15548         }
15549     }
15550     }
15551     function_tests++;
15552 
15553     return(test_ret);
15554 }
15555 
15556 
15557 static int
test_xmlCurrentChar(void)15558 test_xmlCurrentChar(void) {
15559     int test_ret = 0;
15560 
15561     int mem_base;
15562     int ret_val;
15563     xmlParserCtxtPtr ctxt; /* the XML parser context */
15564     int n_ctxt;
15565     int * len; /* pointer to the length of the char read */
15566     int n_len;
15567 
15568     for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
15569     for (n_len = 0;n_len < gen_nb_int_ptr;n_len++) {
15570         mem_base = xmlMemBlocks();
15571         ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
15572         len = gen_int_ptr(n_len, 1);
15573 
15574         ret_val = xmlCurrentChar(ctxt, len);
15575         desret_int(ret_val);
15576         call_tests++;
15577         des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
15578         des_int_ptr(n_len, len, 1);
15579         xmlResetLastError();
15580         if (mem_base != xmlMemBlocks()) {
15581             printf("Leak of %d blocks found in xmlCurrentChar",
15582 	           xmlMemBlocks() - mem_base);
15583 	    test_ret++;
15584             printf(" %d", n_ctxt);
15585             printf(" %d", n_len);
15586             printf("\n");
15587         }
15588     }
15589     }
15590     function_tests++;
15591 
15592     return(test_ret);
15593 }
15594 
15595 
15596 static int
test_xmlIsLetter(void)15597 test_xmlIsLetter(void) {
15598     int test_ret = 0;
15599 
15600     int mem_base;
15601     int ret_val;
15602     int c; /* an unicode character (int) */
15603     int n_c;
15604 
15605     for (n_c = 0;n_c < gen_nb_int;n_c++) {
15606         mem_base = xmlMemBlocks();
15607         c = gen_int(n_c, 0);
15608 
15609         ret_val = xmlIsLetter(c);
15610         desret_int(ret_val);
15611         call_tests++;
15612         des_int(n_c, c, 0);
15613         xmlResetLastError();
15614         if (mem_base != xmlMemBlocks()) {
15615             printf("Leak of %d blocks found in xmlIsLetter",
15616 	           xmlMemBlocks() - mem_base);
15617 	    test_ret++;
15618             printf(" %d", n_c);
15619             printf("\n");
15620         }
15621     }
15622     function_tests++;
15623 
15624     return(test_ret);
15625 }
15626 
15627 
15628 static int
test_xmlNewEntityInputStream(void)15629 test_xmlNewEntityInputStream(void) {
15630     int test_ret = 0;
15631 
15632     int mem_base;
15633     xmlParserInputPtr ret_val;
15634     xmlParserCtxtPtr ctxt; /* an XML parser context */
15635     int n_ctxt;
15636     xmlEntityPtr entity; /* an Entity pointer */
15637     int n_entity;
15638 
15639     for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
15640     for (n_entity = 0;n_entity < gen_nb_xmlEntityPtr;n_entity++) {
15641         mem_base = xmlMemBlocks();
15642         ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
15643         entity = gen_xmlEntityPtr(n_entity, 1);
15644 
15645         ret_val = xmlNewEntityInputStream(ctxt, entity);
15646         desret_xmlParserInputPtr(ret_val);
15647         call_tests++;
15648         des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
15649         des_xmlEntityPtr(n_entity, entity, 1);
15650         xmlResetLastError();
15651         if (mem_base != xmlMemBlocks()) {
15652             printf("Leak of %d blocks found in xmlNewEntityInputStream",
15653 	           xmlMemBlocks() - mem_base);
15654 	    test_ret++;
15655             printf(" %d", n_ctxt);
15656             printf(" %d", n_entity);
15657             printf("\n");
15658         }
15659     }
15660     }
15661     function_tests++;
15662 
15663     return(test_ret);
15664 }
15665 
15666 
15667 static int
test_xmlNewInputFromFile(void)15668 test_xmlNewInputFromFile(void) {
15669     int test_ret = 0;
15670 
15671     int mem_base;
15672     xmlParserInputPtr ret_val;
15673     xmlParserCtxtPtr ctxt; /* an XML parser context */
15674     int n_ctxt;
15675     const char * filename; /* the filename to use as entity */
15676     int n_filename;
15677 
15678     for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
15679     for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
15680         mem_base = xmlMemBlocks();
15681         ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
15682         filename = gen_filepath(n_filename, 1);
15683 
15684         ret_val = xmlNewInputFromFile(ctxt, filename);
15685         desret_xmlParserInputPtr(ret_val);
15686         call_tests++;
15687         des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
15688         des_filepath(n_filename, filename, 1);
15689         xmlResetLastError();
15690         if (mem_base != xmlMemBlocks()) {
15691             printf("Leak of %d blocks found in xmlNewInputFromFile",
15692 	           xmlMemBlocks() - mem_base);
15693 	    test_ret++;
15694             printf(" %d", n_ctxt);
15695             printf(" %d", n_filename);
15696             printf("\n");
15697         }
15698     }
15699     }
15700     function_tests++;
15701 
15702     return(test_ret);
15703 }
15704 
15705 
15706 static int
test_xmlNewInputStream(void)15707 test_xmlNewInputStream(void) {
15708     int test_ret = 0;
15709 
15710     int mem_base;
15711     xmlParserInputPtr ret_val;
15712     xmlParserCtxtPtr ctxt; /* an XML parser context */
15713     int n_ctxt;
15714 
15715     for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
15716         mem_base = xmlMemBlocks();
15717         ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
15718 
15719         ret_val = xmlNewInputStream(ctxt);
15720         desret_xmlParserInputPtr(ret_val);
15721         call_tests++;
15722         des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
15723         xmlResetLastError();
15724         if (mem_base != xmlMemBlocks()) {
15725             printf("Leak of %d blocks found in xmlNewInputStream",
15726 	           xmlMemBlocks() - mem_base);
15727 	    test_ret++;
15728             printf(" %d", n_ctxt);
15729             printf("\n");
15730         }
15731     }
15732     function_tests++;
15733 
15734     return(test_ret);
15735 }
15736 
15737 
15738 static int
test_xmlNewStringInputStream(void)15739 test_xmlNewStringInputStream(void) {
15740     int test_ret = 0;
15741 
15742     int mem_base;
15743     xmlParserInputPtr ret_val;
15744     xmlParserCtxtPtr ctxt; /* an XML parser context */
15745     int n_ctxt;
15746     const xmlChar * buffer; /* an memory buffer */
15747     int n_buffer;
15748 
15749     for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
15750     for (n_buffer = 0;n_buffer < gen_nb_const_xmlChar_ptr;n_buffer++) {
15751         mem_base = xmlMemBlocks();
15752         ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
15753         buffer = gen_const_xmlChar_ptr(n_buffer, 1);
15754 
15755         ret_val = xmlNewStringInputStream(ctxt, buffer);
15756         desret_xmlParserInputPtr(ret_val);
15757         call_tests++;
15758         des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
15759         des_const_xmlChar_ptr(n_buffer, buffer, 1);
15760         xmlResetLastError();
15761         if (mem_base != xmlMemBlocks()) {
15762             printf("Leak of %d blocks found in xmlNewStringInputStream",
15763 	           xmlMemBlocks() - mem_base);
15764 	    test_ret++;
15765             printf(" %d", n_ctxt);
15766             printf(" %d", n_buffer);
15767             printf("\n");
15768         }
15769     }
15770     }
15771     function_tests++;
15772 
15773     return(test_ret);
15774 }
15775 
15776 
15777 static int
test_xmlNextChar(void)15778 test_xmlNextChar(void) {
15779     int test_ret = 0;
15780 
15781     int mem_base;
15782     xmlParserCtxtPtr ctxt; /* the XML parser context */
15783     int n_ctxt;
15784 
15785     for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
15786         mem_base = xmlMemBlocks();
15787         ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
15788 
15789         xmlNextChar(ctxt);
15790         call_tests++;
15791         des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
15792         xmlResetLastError();
15793         if (mem_base != xmlMemBlocks()) {
15794             printf("Leak of %d blocks found in xmlNextChar",
15795 	           xmlMemBlocks() - mem_base);
15796 	    test_ret++;
15797             printf(" %d", n_ctxt);
15798             printf("\n");
15799         }
15800     }
15801     function_tests++;
15802 
15803     return(test_ret);
15804 }
15805 
15806 
15807 static int
test_xmlParserInputShrink(void)15808 test_xmlParserInputShrink(void) {
15809     int test_ret = 0;
15810 
15811     int mem_base;
15812     xmlParserInputPtr in; /* an XML parser input */
15813     int n_in;
15814 
15815     for (n_in = 0;n_in < gen_nb_xmlParserInputPtr;n_in++) {
15816         mem_base = xmlMemBlocks();
15817         in = gen_xmlParserInputPtr(n_in, 0);
15818 
15819         xmlParserInputShrink(in);
15820         call_tests++;
15821         des_xmlParserInputPtr(n_in, in, 0);
15822         xmlResetLastError();
15823         if (mem_base != xmlMemBlocks()) {
15824             printf("Leak of %d blocks found in xmlParserInputShrink",
15825 	           xmlMemBlocks() - mem_base);
15826 	    test_ret++;
15827             printf(" %d", n_in);
15828             printf("\n");
15829         }
15830     }
15831     function_tests++;
15832 
15833     return(test_ret);
15834 }
15835 
15836 
15837 static int
test_xmlPopInput(void)15838 test_xmlPopInput(void) {
15839     int test_ret = 0;
15840 
15841     int mem_base;
15842     xmlChar ret_val;
15843     xmlParserCtxtPtr ctxt; /* an XML parser context */
15844     int n_ctxt;
15845 
15846     for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
15847         mem_base = xmlMemBlocks();
15848         ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
15849 
15850         ret_val = xmlPopInput(ctxt);
15851         desret_xmlChar(ret_val);
15852         call_tests++;
15853         des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
15854         xmlResetLastError();
15855         if (mem_base != xmlMemBlocks()) {
15856             printf("Leak of %d blocks found in xmlPopInput",
15857 	           xmlMemBlocks() - mem_base);
15858 	    test_ret++;
15859             printf(" %d", n_ctxt);
15860             printf("\n");
15861         }
15862     }
15863     function_tests++;
15864 
15865     return(test_ret);
15866 }
15867 
15868 
15869 static int
test_xmlPushInput(void)15870 test_xmlPushInput(void) {
15871     int test_ret = 0;
15872 
15873     int mem_base;
15874     int ret_val;
15875     xmlParserCtxtPtr ctxt; /* an XML parser context */
15876     int n_ctxt;
15877     xmlParserInputPtr input; /* an XML parser input fragment (entity, XML fragment ...). */
15878     int n_input;
15879 
15880     for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
15881     for (n_input = 0;n_input < gen_nb_xmlParserInputPtr;n_input++) {
15882         mem_base = xmlMemBlocks();
15883         ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
15884         input = gen_xmlParserInputPtr(n_input, 1);
15885 
15886         ret_val = xmlPushInput(ctxt, input);
15887         desret_int(ret_val);
15888         call_tests++;
15889         des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
15890         des_xmlParserInputPtr(n_input, input, 1);
15891         xmlResetLastError();
15892         if (mem_base != xmlMemBlocks()) {
15893             printf("Leak of %d blocks found in xmlPushInput",
15894 	           xmlMemBlocks() - mem_base);
15895 	    test_ret++;
15896             printf(" %d", n_ctxt);
15897             printf(" %d", n_input);
15898             printf("\n");
15899         }
15900     }
15901     }
15902     function_tests++;
15903 
15904     return(test_ret);
15905 }
15906 
15907 
15908 static int
test_xmlSetEntityReferenceFunc(void)15909 test_xmlSetEntityReferenceFunc(void) {
15910     int test_ret = 0;
15911 
15912 
15913     /* missing type support */
15914     return(test_ret);
15915 }
15916 
15917 
15918 static int
test_xmlSplitQName(void)15919 test_xmlSplitQName(void) {
15920     int test_ret = 0;
15921 
15922     int mem_base;
15923     xmlChar * ret_val;
15924     xmlParserCtxtPtr ctxt; /* an XML parser context */
15925     int n_ctxt;
15926     const xmlChar * name; /* an XML parser context */
15927     int n_name;
15928     xmlChar ** prefix; /* a xmlChar ** */
15929     int n_prefix;
15930 
15931     for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
15932     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
15933     for (n_prefix = 0;n_prefix < gen_nb_xmlChar_ptr_ptr;n_prefix++) {
15934         mem_base = xmlMemBlocks();
15935         ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
15936         name = gen_const_xmlChar_ptr(n_name, 1);
15937         prefix = gen_xmlChar_ptr_ptr(n_prefix, 2);
15938 
15939         ret_val = xmlSplitQName(ctxt, name, prefix);
15940         desret_xmlChar_ptr(ret_val);
15941         call_tests++;
15942         des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
15943         des_const_xmlChar_ptr(n_name, name, 1);
15944         des_xmlChar_ptr_ptr(n_prefix, prefix, 2);
15945         xmlResetLastError();
15946         if (mem_base != xmlMemBlocks()) {
15947             printf("Leak of %d blocks found in xmlSplitQName",
15948 	           xmlMemBlocks() - mem_base);
15949 	    test_ret++;
15950             printf(" %d", n_ctxt);
15951             printf(" %d", n_name);
15952             printf(" %d", n_prefix);
15953             printf("\n");
15954         }
15955     }
15956     }
15957     }
15958     function_tests++;
15959 
15960     return(test_ret);
15961 }
15962 
15963 
15964 static int
test_xmlStringCurrentChar(void)15965 test_xmlStringCurrentChar(void) {
15966     int test_ret = 0;
15967 
15968     int mem_base;
15969     int ret_val;
15970     xmlParserCtxtPtr ctxt; /* the XML parser context */
15971     int n_ctxt;
15972     const xmlChar * cur; /* pointer to the beginning of the char */
15973     int n_cur;
15974     int * len; /* pointer to the length of the char read */
15975     int n_len;
15976 
15977     for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
15978     for (n_cur = 0;n_cur < gen_nb_const_xmlChar_ptr;n_cur++) {
15979     for (n_len = 0;n_len < gen_nb_int_ptr;n_len++) {
15980         mem_base = xmlMemBlocks();
15981         ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
15982         cur = gen_const_xmlChar_ptr(n_cur, 1);
15983         len = gen_int_ptr(n_len, 2);
15984 
15985         ret_val = xmlStringCurrentChar(ctxt, cur, len);
15986         desret_int(ret_val);
15987         call_tests++;
15988         des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
15989         des_const_xmlChar_ptr(n_cur, cur, 1);
15990         des_int_ptr(n_len, len, 2);
15991         xmlResetLastError();
15992         if (mem_base != xmlMemBlocks()) {
15993             printf("Leak of %d blocks found in xmlStringCurrentChar",
15994 	           xmlMemBlocks() - mem_base);
15995 	    test_ret++;
15996             printf(" %d", n_ctxt);
15997             printf(" %d", n_cur);
15998             printf(" %d", n_len);
15999             printf("\n");
16000         }
16001     }
16002     }
16003     }
16004     function_tests++;
16005 
16006     return(test_ret);
16007 }
16008 
16009 
16010 static int
test_xmlStringDecodeEntities(void)16011 test_xmlStringDecodeEntities(void) {
16012     int test_ret = 0;
16013 
16014     int mem_base;
16015     xmlChar * ret_val;
16016     xmlParserCtxtPtr ctxt; /* the parser context */
16017     int n_ctxt;
16018     const xmlChar * str; /* the input string */
16019     int n_str;
16020     int what; /* combination of XML_SUBSTITUTE_REF and XML_SUBSTITUTE_PEREF */
16021     int n_what;
16022     xmlChar end; /* an end marker xmlChar, 0 if none */
16023     int n_end;
16024     xmlChar end2; /* an end marker xmlChar, 0 if none */
16025     int n_end2;
16026     xmlChar end3; /* an end marker xmlChar, 0 if none */
16027     int n_end3;
16028 
16029     for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
16030     for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) {
16031     for (n_what = 0;n_what < gen_nb_int;n_what++) {
16032     for (n_end = 0;n_end < gen_nb_xmlChar;n_end++) {
16033     for (n_end2 = 0;n_end2 < gen_nb_xmlChar;n_end2++) {
16034     for (n_end3 = 0;n_end3 < gen_nb_xmlChar;n_end3++) {
16035         mem_base = xmlMemBlocks();
16036         ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
16037         str = gen_const_xmlChar_ptr(n_str, 1);
16038         what = gen_int(n_what, 2);
16039         end = gen_xmlChar(n_end, 3);
16040         end2 = gen_xmlChar(n_end2, 4);
16041         end3 = gen_xmlChar(n_end3, 5);
16042 
16043         ret_val = xmlStringDecodeEntities(ctxt, str, what, end, end2, end3);
16044         desret_xmlChar_ptr(ret_val);
16045         call_tests++;
16046         des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
16047         des_const_xmlChar_ptr(n_str, str, 1);
16048         des_int(n_what, what, 2);
16049         des_xmlChar(n_end, end, 3);
16050         des_xmlChar(n_end2, end2, 4);
16051         des_xmlChar(n_end3, end3, 5);
16052         xmlResetLastError();
16053         if (mem_base != xmlMemBlocks()) {
16054             printf("Leak of %d blocks found in xmlStringDecodeEntities",
16055 	           xmlMemBlocks() - mem_base);
16056 	    test_ret++;
16057             printf(" %d", n_ctxt);
16058             printf(" %d", n_str);
16059             printf(" %d", n_what);
16060             printf(" %d", n_end);
16061             printf(" %d", n_end2);
16062             printf(" %d", n_end3);
16063             printf("\n");
16064         }
16065     }
16066     }
16067     }
16068     }
16069     }
16070     }
16071     function_tests++;
16072 
16073     return(test_ret);
16074 }
16075 
16076 
16077 static int
test_xmlStringLenDecodeEntities(void)16078 test_xmlStringLenDecodeEntities(void) {
16079     int test_ret = 0;
16080 
16081     int mem_base;
16082     xmlChar * ret_val;
16083     xmlParserCtxtPtr ctxt; /* the parser context */
16084     int n_ctxt;
16085     const xmlChar * str; /* the input string */
16086     int n_str;
16087     int len; /* the string length */
16088     int n_len;
16089     int what; /* combination of XML_SUBSTITUTE_REF and XML_SUBSTITUTE_PEREF */
16090     int n_what;
16091     xmlChar end; /* an end marker xmlChar, 0 if none */
16092     int n_end;
16093     xmlChar end2; /* an end marker xmlChar, 0 if none */
16094     int n_end2;
16095     xmlChar end3; /* an end marker xmlChar, 0 if none */
16096     int n_end3;
16097 
16098     for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
16099     for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) {
16100     for (n_len = 0;n_len < gen_nb_int;n_len++) {
16101     for (n_what = 0;n_what < gen_nb_int;n_what++) {
16102     for (n_end = 0;n_end < gen_nb_xmlChar;n_end++) {
16103     for (n_end2 = 0;n_end2 < gen_nb_xmlChar;n_end2++) {
16104     for (n_end3 = 0;n_end3 < gen_nb_xmlChar;n_end3++) {
16105         mem_base = xmlMemBlocks();
16106         ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
16107         str = gen_const_xmlChar_ptr(n_str, 1);
16108         len = gen_int(n_len, 2);
16109         what = gen_int(n_what, 3);
16110         end = gen_xmlChar(n_end, 4);
16111         end2 = gen_xmlChar(n_end2, 5);
16112         end3 = gen_xmlChar(n_end3, 6);
16113         if ((str != NULL) &&
16114             (len > xmlStrlen(BAD_CAST str)))
16115             len = 0;
16116 
16117         ret_val = xmlStringLenDecodeEntities(ctxt, str, len, what, end, end2, end3);
16118         desret_xmlChar_ptr(ret_val);
16119         call_tests++;
16120         des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
16121         des_const_xmlChar_ptr(n_str, str, 1);
16122         des_int(n_len, len, 2);
16123         des_int(n_what, what, 3);
16124         des_xmlChar(n_end, end, 4);
16125         des_xmlChar(n_end2, end2, 5);
16126         des_xmlChar(n_end3, end3, 6);
16127         xmlResetLastError();
16128         if (mem_base != xmlMemBlocks()) {
16129             printf("Leak of %d blocks found in xmlStringLenDecodeEntities",
16130 	           xmlMemBlocks() - mem_base);
16131 	    test_ret++;
16132             printf(" %d", n_ctxt);
16133             printf(" %d", n_str);
16134             printf(" %d", n_len);
16135             printf(" %d", n_what);
16136             printf(" %d", n_end);
16137             printf(" %d", n_end2);
16138             printf(" %d", n_end3);
16139             printf("\n");
16140         }
16141     }
16142     }
16143     }
16144     }
16145     }
16146     }
16147     }
16148     function_tests++;
16149 
16150     return(test_ret);
16151 }
16152 
16153 
16154 static int
test_xmlSwitchEncoding(void)16155 test_xmlSwitchEncoding(void) {
16156     int test_ret = 0;
16157 
16158     int mem_base;
16159     int ret_val;
16160     xmlParserCtxtPtr ctxt; /* the parser context */
16161     int n_ctxt;
16162     xmlCharEncoding enc; /* the encoding value (number) */
16163     int n_enc;
16164 
16165     for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
16166     for (n_enc = 0;n_enc < gen_nb_xmlCharEncoding;n_enc++) {
16167         mem_base = xmlMemBlocks();
16168         ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
16169         enc = gen_xmlCharEncoding(n_enc, 1);
16170 
16171         ret_val = xmlSwitchEncoding(ctxt, enc);
16172         desret_int(ret_val);
16173         call_tests++;
16174         des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
16175         des_xmlCharEncoding(n_enc, enc, 1);
16176         xmlResetLastError();
16177         if (mem_base != xmlMemBlocks()) {
16178             printf("Leak of %d blocks found in xmlSwitchEncoding",
16179 	           xmlMemBlocks() - mem_base);
16180 	    test_ret++;
16181             printf(" %d", n_ctxt);
16182             printf(" %d", n_enc);
16183             printf("\n");
16184         }
16185     }
16186     }
16187     function_tests++;
16188 
16189     return(test_ret);
16190 }
16191 
16192 
16193 static int
test_xmlSwitchInputEncoding(void)16194 test_xmlSwitchInputEncoding(void) {
16195     int test_ret = 0;
16196 
16197     int mem_base;
16198     int ret_val;
16199     xmlParserCtxtPtr ctxt; /* the parser context */
16200     int n_ctxt;
16201     xmlParserInputPtr input; /* the input stream */
16202     int n_input;
16203     xmlCharEncodingHandlerPtr handler; /* the encoding handler */
16204     int n_handler;
16205 
16206     for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
16207     for (n_input = 0;n_input < gen_nb_xmlParserInputPtr;n_input++) {
16208     for (n_handler = 0;n_handler < gen_nb_xmlCharEncodingHandlerPtr;n_handler++) {
16209         mem_base = xmlMemBlocks();
16210         ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
16211         input = gen_xmlParserInputPtr(n_input, 1);
16212         handler = gen_xmlCharEncodingHandlerPtr(n_handler, 2);
16213 
16214         ret_val = xmlSwitchInputEncoding(ctxt, input, handler);
16215         desret_int(ret_val);
16216         call_tests++;
16217         des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
16218         des_xmlParserInputPtr(n_input, input, 1);
16219         des_xmlCharEncodingHandlerPtr(n_handler, handler, 2);
16220         xmlResetLastError();
16221         if (mem_base != xmlMemBlocks()) {
16222             printf("Leak of %d blocks found in xmlSwitchInputEncoding",
16223 	           xmlMemBlocks() - mem_base);
16224 	    test_ret++;
16225             printf(" %d", n_ctxt);
16226             printf(" %d", n_input);
16227             printf(" %d", n_handler);
16228             printf("\n");
16229         }
16230     }
16231     }
16232     }
16233     function_tests++;
16234 
16235     return(test_ret);
16236 }
16237 
16238 
16239 static int
test_xmlSwitchToEncoding(void)16240 test_xmlSwitchToEncoding(void) {
16241     int test_ret = 0;
16242 
16243     int mem_base;
16244     int ret_val;
16245     xmlParserCtxtPtr ctxt; /* the parser context */
16246     int n_ctxt;
16247     xmlCharEncodingHandlerPtr handler; /* the encoding handler */
16248     int n_handler;
16249 
16250     for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
16251     for (n_handler = 0;n_handler < gen_nb_xmlCharEncodingHandlerPtr;n_handler++) {
16252         mem_base = xmlMemBlocks();
16253         ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
16254         handler = gen_xmlCharEncodingHandlerPtr(n_handler, 1);
16255 
16256         ret_val = xmlSwitchToEncoding(ctxt, handler);
16257         desret_int(ret_val);
16258         call_tests++;
16259         des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
16260         des_xmlCharEncodingHandlerPtr(n_handler, handler, 1);
16261         xmlResetLastError();
16262         if (mem_base != xmlMemBlocks()) {
16263             printf("Leak of %d blocks found in xmlSwitchToEncoding",
16264 	           xmlMemBlocks() - mem_base);
16265 	    test_ret++;
16266             printf(" %d", n_ctxt);
16267             printf(" %d", n_handler);
16268             printf("\n");
16269         }
16270     }
16271     }
16272     function_tests++;
16273 
16274     return(test_ret);
16275 }
16276 
16277 static int
test_parserInternals(void)16278 test_parserInternals(void) {
16279     int test_ret = 0;
16280 
16281     if (quiet == 0) printf("Testing parserInternals : 30 of 87 functions ...\n");
16282     test_ret += test_inputPop();
16283     test_ret += test_inputPush();
16284     test_ret += test_namePop();
16285     test_ret += test_namePush();
16286     test_ret += test_nodePop();
16287     test_ret += test_nodePush();
16288     test_ret += test_xmlCheckLanguageID();
16289     test_ret += test_xmlCopyChar();
16290     test_ret += test_xmlCopyCharMultiByte();
16291     test_ret += test_xmlCreateEntityParserCtxt();
16292     test_ret += test_xmlCreateFileParserCtxt();
16293     test_ret += test_xmlCreateMemoryParserCtxt();
16294     test_ret += test_xmlCreateURLParserCtxt();
16295     test_ret += test_xmlCurrentChar();
16296     test_ret += test_xmlIsLetter();
16297     test_ret += test_xmlNewEntityInputStream();
16298     test_ret += test_xmlNewInputFromFile();
16299     test_ret += test_xmlNewInputStream();
16300     test_ret += test_xmlNewStringInputStream();
16301     test_ret += test_xmlNextChar();
16302     test_ret += test_xmlParserInputShrink();
16303     test_ret += test_xmlPopInput();
16304     test_ret += test_xmlPushInput();
16305     test_ret += test_xmlSetEntityReferenceFunc();
16306     test_ret += test_xmlSplitQName();
16307     test_ret += test_xmlStringCurrentChar();
16308     test_ret += test_xmlStringDecodeEntities();
16309     test_ret += test_xmlStringLenDecodeEntities();
16310     test_ret += test_xmlSwitchEncoding();
16311     test_ret += test_xmlSwitchInputEncoding();
16312     test_ret += test_xmlSwitchToEncoding();
16313 
16314     if (test_ret != 0)
16315 	printf("Module parserInternals: %d errors\n", test_ret);
16316     return(test_ret);
16317 }
16318 
16319 static int
test_xmlPatternFromRoot(void)16320 test_xmlPatternFromRoot(void) {
16321     int test_ret = 0;
16322 
16323 #if defined(LIBXML_PATTERN_ENABLED)
16324     int mem_base;
16325     int ret_val;
16326     xmlPatternPtr comp; /* the precompiled pattern */
16327     int n_comp;
16328 
16329     for (n_comp = 0;n_comp < gen_nb_xmlPatternPtr;n_comp++) {
16330         mem_base = xmlMemBlocks();
16331         comp = gen_xmlPatternPtr(n_comp, 0);
16332 
16333         ret_val = xmlPatternFromRoot(comp);
16334         desret_int(ret_val);
16335         call_tests++;
16336         des_xmlPatternPtr(n_comp, comp, 0);
16337         xmlResetLastError();
16338         if (mem_base != xmlMemBlocks()) {
16339             printf("Leak of %d blocks found in xmlPatternFromRoot",
16340 	           xmlMemBlocks() - mem_base);
16341 	    test_ret++;
16342             printf(" %d", n_comp);
16343             printf("\n");
16344         }
16345     }
16346     function_tests++;
16347 #endif
16348 
16349     return(test_ret);
16350 }
16351 
16352 
16353 static int
test_xmlPatternGetStreamCtxt(void)16354 test_xmlPatternGetStreamCtxt(void) {
16355     int test_ret = 0;
16356 
16357 
16358     /* missing type support */
16359     return(test_ret);
16360 }
16361 
16362 
16363 static int
test_xmlPatternMatch(void)16364 test_xmlPatternMatch(void) {
16365     int test_ret = 0;
16366 
16367 #if defined(LIBXML_PATTERN_ENABLED)
16368     int mem_base;
16369     int ret_val;
16370     xmlPatternPtr comp; /* the precompiled pattern */
16371     int n_comp;
16372     xmlNodePtr node; /* a node */
16373     int n_node;
16374 
16375     for (n_comp = 0;n_comp < gen_nb_xmlPatternPtr;n_comp++) {
16376     for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
16377         mem_base = xmlMemBlocks();
16378         comp = gen_xmlPatternPtr(n_comp, 0);
16379         node = gen_xmlNodePtr(n_node, 1);
16380 
16381         ret_val = xmlPatternMatch(comp, node);
16382         desret_int(ret_val);
16383         call_tests++;
16384         des_xmlPatternPtr(n_comp, comp, 0);
16385         des_xmlNodePtr(n_node, node, 1);
16386         xmlResetLastError();
16387         if (mem_base != xmlMemBlocks()) {
16388             printf("Leak of %d blocks found in xmlPatternMatch",
16389 	           xmlMemBlocks() - mem_base);
16390 	    test_ret++;
16391             printf(" %d", n_comp);
16392             printf(" %d", n_node);
16393             printf("\n");
16394         }
16395     }
16396     }
16397     function_tests++;
16398 #endif
16399 
16400     return(test_ret);
16401 }
16402 
16403 
16404 static int
test_xmlPatternMaxDepth(void)16405 test_xmlPatternMaxDepth(void) {
16406     int test_ret = 0;
16407 
16408 #if defined(LIBXML_PATTERN_ENABLED)
16409     int mem_base;
16410     int ret_val;
16411     xmlPatternPtr comp; /* the precompiled pattern */
16412     int n_comp;
16413 
16414     for (n_comp = 0;n_comp < gen_nb_xmlPatternPtr;n_comp++) {
16415         mem_base = xmlMemBlocks();
16416         comp = gen_xmlPatternPtr(n_comp, 0);
16417 
16418         ret_val = xmlPatternMaxDepth(comp);
16419         desret_int(ret_val);
16420         call_tests++;
16421         des_xmlPatternPtr(n_comp, comp, 0);
16422         xmlResetLastError();
16423         if (mem_base != xmlMemBlocks()) {
16424             printf("Leak of %d blocks found in xmlPatternMaxDepth",
16425 	           xmlMemBlocks() - mem_base);
16426 	    test_ret++;
16427             printf(" %d", n_comp);
16428             printf("\n");
16429         }
16430     }
16431     function_tests++;
16432 #endif
16433 
16434     return(test_ret);
16435 }
16436 
16437 
16438 static int
test_xmlPatternMinDepth(void)16439 test_xmlPatternMinDepth(void) {
16440     int test_ret = 0;
16441 
16442 #if defined(LIBXML_PATTERN_ENABLED)
16443     int mem_base;
16444     int ret_val;
16445     xmlPatternPtr comp; /* the precompiled pattern */
16446     int n_comp;
16447 
16448     for (n_comp = 0;n_comp < gen_nb_xmlPatternPtr;n_comp++) {
16449         mem_base = xmlMemBlocks();
16450         comp = gen_xmlPatternPtr(n_comp, 0);
16451 
16452         ret_val = xmlPatternMinDepth(comp);
16453         desret_int(ret_val);
16454         call_tests++;
16455         des_xmlPatternPtr(n_comp, comp, 0);
16456         xmlResetLastError();
16457         if (mem_base != xmlMemBlocks()) {
16458             printf("Leak of %d blocks found in xmlPatternMinDepth",
16459 	           xmlMemBlocks() - mem_base);
16460 	    test_ret++;
16461             printf(" %d", n_comp);
16462             printf("\n");
16463         }
16464     }
16465     function_tests++;
16466 #endif
16467 
16468     return(test_ret);
16469 }
16470 
16471 
16472 static int
test_xmlPatternStreamable(void)16473 test_xmlPatternStreamable(void) {
16474     int test_ret = 0;
16475 
16476 #if defined(LIBXML_PATTERN_ENABLED)
16477     int mem_base;
16478     int ret_val;
16479     xmlPatternPtr comp; /* the precompiled pattern */
16480     int n_comp;
16481 
16482     for (n_comp = 0;n_comp < gen_nb_xmlPatternPtr;n_comp++) {
16483         mem_base = xmlMemBlocks();
16484         comp = gen_xmlPatternPtr(n_comp, 0);
16485 
16486         ret_val = xmlPatternStreamable(comp);
16487         desret_int(ret_val);
16488         call_tests++;
16489         des_xmlPatternPtr(n_comp, comp, 0);
16490         xmlResetLastError();
16491         if (mem_base != xmlMemBlocks()) {
16492             printf("Leak of %d blocks found in xmlPatternStreamable",
16493 	           xmlMemBlocks() - mem_base);
16494 	    test_ret++;
16495             printf(" %d", n_comp);
16496             printf("\n");
16497         }
16498     }
16499     function_tests++;
16500 #endif
16501 
16502     return(test_ret);
16503 }
16504 
16505 
16506 static int
test_xmlPatterncompile(void)16507 test_xmlPatterncompile(void) {
16508     int test_ret = 0;
16509 
16510 
16511     /* missing type support */
16512     return(test_ret);
16513 }
16514 
16515 #ifdef LIBXML_PATTERN_ENABLED
16516 
16517 #define gen_nb_xmlStreamCtxtPtr 1
16518 #define gen_xmlStreamCtxtPtr(no, nr) NULL
16519 #define des_xmlStreamCtxtPtr(no, val, nr)
16520 #endif
16521 
16522 
16523 static int
test_xmlStreamPop(void)16524 test_xmlStreamPop(void) {
16525     int test_ret = 0;
16526 
16527 #if defined(LIBXML_PATTERN_ENABLED)
16528     int mem_base;
16529     int ret_val;
16530     xmlStreamCtxtPtr stream; /* the stream context */
16531     int n_stream;
16532 
16533     for (n_stream = 0;n_stream < gen_nb_xmlStreamCtxtPtr;n_stream++) {
16534         mem_base = xmlMemBlocks();
16535         stream = gen_xmlStreamCtxtPtr(n_stream, 0);
16536 
16537         ret_val = xmlStreamPop(stream);
16538         desret_int(ret_val);
16539         call_tests++;
16540         des_xmlStreamCtxtPtr(n_stream, stream, 0);
16541         xmlResetLastError();
16542         if (mem_base != xmlMemBlocks()) {
16543             printf("Leak of %d blocks found in xmlStreamPop",
16544 	           xmlMemBlocks() - mem_base);
16545 	    test_ret++;
16546             printf(" %d", n_stream);
16547             printf("\n");
16548         }
16549     }
16550     function_tests++;
16551 #endif
16552 
16553     return(test_ret);
16554 }
16555 
16556 
16557 static int
test_xmlStreamPush(void)16558 test_xmlStreamPush(void) {
16559     int test_ret = 0;
16560 
16561 #if defined(LIBXML_PATTERN_ENABLED)
16562     int mem_base;
16563     int ret_val;
16564     xmlStreamCtxtPtr stream; /* the stream context */
16565     int n_stream;
16566     const xmlChar * name; /* the current name */
16567     int n_name;
16568     const xmlChar * ns; /* the namespace name */
16569     int n_ns;
16570 
16571     for (n_stream = 0;n_stream < gen_nb_xmlStreamCtxtPtr;n_stream++) {
16572     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
16573     for (n_ns = 0;n_ns < gen_nb_const_xmlChar_ptr;n_ns++) {
16574         mem_base = xmlMemBlocks();
16575         stream = gen_xmlStreamCtxtPtr(n_stream, 0);
16576         name = gen_const_xmlChar_ptr(n_name, 1);
16577         ns = gen_const_xmlChar_ptr(n_ns, 2);
16578 
16579         ret_val = xmlStreamPush(stream, name, ns);
16580         desret_int(ret_val);
16581         call_tests++;
16582         des_xmlStreamCtxtPtr(n_stream, stream, 0);
16583         des_const_xmlChar_ptr(n_name, name, 1);
16584         des_const_xmlChar_ptr(n_ns, ns, 2);
16585         xmlResetLastError();
16586         if (mem_base != xmlMemBlocks()) {
16587             printf("Leak of %d blocks found in xmlStreamPush",
16588 	           xmlMemBlocks() - mem_base);
16589 	    test_ret++;
16590             printf(" %d", n_stream);
16591             printf(" %d", n_name);
16592             printf(" %d", n_ns);
16593             printf("\n");
16594         }
16595     }
16596     }
16597     }
16598     function_tests++;
16599 #endif
16600 
16601     return(test_ret);
16602 }
16603 
16604 
16605 static int
test_xmlStreamPushAttr(void)16606 test_xmlStreamPushAttr(void) {
16607     int test_ret = 0;
16608 
16609 #if defined(LIBXML_PATTERN_ENABLED)
16610     int mem_base;
16611     int ret_val;
16612     xmlStreamCtxtPtr stream; /* the stream context */
16613     int n_stream;
16614     const xmlChar * name; /* the current name */
16615     int n_name;
16616     const xmlChar * ns; /* the namespace name */
16617     int n_ns;
16618 
16619     for (n_stream = 0;n_stream < gen_nb_xmlStreamCtxtPtr;n_stream++) {
16620     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
16621     for (n_ns = 0;n_ns < gen_nb_const_xmlChar_ptr;n_ns++) {
16622         mem_base = xmlMemBlocks();
16623         stream = gen_xmlStreamCtxtPtr(n_stream, 0);
16624         name = gen_const_xmlChar_ptr(n_name, 1);
16625         ns = gen_const_xmlChar_ptr(n_ns, 2);
16626 
16627         ret_val = xmlStreamPushAttr(stream, name, ns);
16628         desret_int(ret_val);
16629         call_tests++;
16630         des_xmlStreamCtxtPtr(n_stream, stream, 0);
16631         des_const_xmlChar_ptr(n_name, name, 1);
16632         des_const_xmlChar_ptr(n_ns, ns, 2);
16633         xmlResetLastError();
16634         if (mem_base != xmlMemBlocks()) {
16635             printf("Leak of %d blocks found in xmlStreamPushAttr",
16636 	           xmlMemBlocks() - mem_base);
16637 	    test_ret++;
16638             printf(" %d", n_stream);
16639             printf(" %d", n_name);
16640             printf(" %d", n_ns);
16641             printf("\n");
16642         }
16643     }
16644     }
16645     }
16646     function_tests++;
16647 #endif
16648 
16649     return(test_ret);
16650 }
16651 
16652 
16653 static int
test_xmlStreamPushNode(void)16654 test_xmlStreamPushNode(void) {
16655     int test_ret = 0;
16656 
16657 #if defined(LIBXML_PATTERN_ENABLED)
16658     int mem_base;
16659     int ret_val;
16660     xmlStreamCtxtPtr stream; /* the stream context */
16661     int n_stream;
16662     const xmlChar * name; /* the current name */
16663     int n_name;
16664     const xmlChar * ns; /* the namespace name */
16665     int n_ns;
16666     int nodeType; /* the type of the node being pushed */
16667     int n_nodeType;
16668 
16669     for (n_stream = 0;n_stream < gen_nb_xmlStreamCtxtPtr;n_stream++) {
16670     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
16671     for (n_ns = 0;n_ns < gen_nb_const_xmlChar_ptr;n_ns++) {
16672     for (n_nodeType = 0;n_nodeType < gen_nb_int;n_nodeType++) {
16673         mem_base = xmlMemBlocks();
16674         stream = gen_xmlStreamCtxtPtr(n_stream, 0);
16675         name = gen_const_xmlChar_ptr(n_name, 1);
16676         ns = gen_const_xmlChar_ptr(n_ns, 2);
16677         nodeType = gen_int(n_nodeType, 3);
16678 
16679         ret_val = xmlStreamPushNode(stream, name, ns, nodeType);
16680         desret_int(ret_val);
16681         call_tests++;
16682         des_xmlStreamCtxtPtr(n_stream, stream, 0);
16683         des_const_xmlChar_ptr(n_name, name, 1);
16684         des_const_xmlChar_ptr(n_ns, ns, 2);
16685         des_int(n_nodeType, nodeType, 3);
16686         xmlResetLastError();
16687         if (mem_base != xmlMemBlocks()) {
16688             printf("Leak of %d blocks found in xmlStreamPushNode",
16689 	           xmlMemBlocks() - mem_base);
16690 	    test_ret++;
16691             printf(" %d", n_stream);
16692             printf(" %d", n_name);
16693             printf(" %d", n_ns);
16694             printf(" %d", n_nodeType);
16695             printf("\n");
16696         }
16697     }
16698     }
16699     }
16700     }
16701     function_tests++;
16702 #endif
16703 
16704     return(test_ret);
16705 }
16706 
16707 
16708 static int
test_xmlStreamWantsAnyNode(void)16709 test_xmlStreamWantsAnyNode(void) {
16710     int test_ret = 0;
16711 
16712 #if defined(LIBXML_PATTERN_ENABLED)
16713     int mem_base;
16714     int ret_val;
16715     xmlStreamCtxtPtr streamCtxt; /* the stream context */
16716     int n_streamCtxt;
16717 
16718     for (n_streamCtxt = 0;n_streamCtxt < gen_nb_xmlStreamCtxtPtr;n_streamCtxt++) {
16719         mem_base = xmlMemBlocks();
16720         streamCtxt = gen_xmlStreamCtxtPtr(n_streamCtxt, 0);
16721 
16722         ret_val = xmlStreamWantsAnyNode(streamCtxt);
16723         desret_int(ret_val);
16724         call_tests++;
16725         des_xmlStreamCtxtPtr(n_streamCtxt, streamCtxt, 0);
16726         xmlResetLastError();
16727         if (mem_base != xmlMemBlocks()) {
16728             printf("Leak of %d blocks found in xmlStreamWantsAnyNode",
16729 	           xmlMemBlocks() - mem_base);
16730 	    test_ret++;
16731             printf(" %d", n_streamCtxt);
16732             printf("\n");
16733         }
16734     }
16735     function_tests++;
16736 #endif
16737 
16738     return(test_ret);
16739 }
16740 
16741 static int
test_pattern(void)16742 test_pattern(void) {
16743     int test_ret = 0;
16744 
16745     if (quiet == 0) printf("Testing pattern : 10 of 15 functions ...\n");
16746     test_ret += test_xmlPatternFromRoot();
16747     test_ret += test_xmlPatternGetStreamCtxt();
16748     test_ret += test_xmlPatternMatch();
16749     test_ret += test_xmlPatternMaxDepth();
16750     test_ret += test_xmlPatternMinDepth();
16751     test_ret += test_xmlPatternStreamable();
16752     test_ret += test_xmlPatterncompile();
16753     test_ret += test_xmlStreamPop();
16754     test_ret += test_xmlStreamPush();
16755     test_ret += test_xmlStreamPushAttr();
16756     test_ret += test_xmlStreamPushNode();
16757     test_ret += test_xmlStreamWantsAnyNode();
16758 
16759     if (test_ret != 0)
16760 	printf("Module pattern: %d errors\n", test_ret);
16761     return(test_ret);
16762 }
16763 #ifdef LIBXML_SCHEMAS_ENABLED
16764 
16765 #define gen_nb_xmlRelaxNGPtr 1
16766 #define gen_xmlRelaxNGPtr(no, nr) NULL
16767 #define des_xmlRelaxNGPtr(no, val, nr)
16768 #endif
16769 
16770 
16771 static int
test_xmlRelaxNGDump(void)16772 test_xmlRelaxNGDump(void) {
16773     int test_ret = 0;
16774 
16775 #if defined(LIBXML_SCHEMAS_ENABLED) && defined(LIBXML_OUTPUT_ENABLED)
16776     int mem_base;
16777     FILE * output; /* the file output */
16778     int n_output;
16779     xmlRelaxNGPtr schema; /* a schema structure */
16780     int n_schema;
16781 
16782     for (n_output = 0;n_output < gen_nb_FILE_ptr;n_output++) {
16783     for (n_schema = 0;n_schema < gen_nb_xmlRelaxNGPtr;n_schema++) {
16784         mem_base = xmlMemBlocks();
16785         output = gen_FILE_ptr(n_output, 0);
16786         schema = gen_xmlRelaxNGPtr(n_schema, 1);
16787 
16788         xmlRelaxNGDump(output, schema);
16789         call_tests++;
16790         des_FILE_ptr(n_output, output, 0);
16791         des_xmlRelaxNGPtr(n_schema, schema, 1);
16792         xmlResetLastError();
16793         if (mem_base != xmlMemBlocks()) {
16794             printf("Leak of %d blocks found in xmlRelaxNGDump",
16795 	           xmlMemBlocks() - mem_base);
16796 	    test_ret++;
16797             printf(" %d", n_output);
16798             printf(" %d", n_schema);
16799             printf("\n");
16800         }
16801     }
16802     }
16803     function_tests++;
16804 #endif
16805 
16806     return(test_ret);
16807 }
16808 
16809 
16810 static int
test_xmlRelaxNGDumpTree(void)16811 test_xmlRelaxNGDumpTree(void) {
16812     int test_ret = 0;
16813 
16814 #if defined(LIBXML_SCHEMAS_ENABLED) && defined(LIBXML_OUTPUT_ENABLED)
16815     int mem_base;
16816     FILE * output; /* the file output */
16817     int n_output;
16818     xmlRelaxNGPtr schema; /* a schema structure */
16819     int n_schema;
16820 
16821     for (n_output = 0;n_output < gen_nb_FILE_ptr;n_output++) {
16822     for (n_schema = 0;n_schema < gen_nb_xmlRelaxNGPtr;n_schema++) {
16823         mem_base = xmlMemBlocks();
16824         output = gen_FILE_ptr(n_output, 0);
16825         schema = gen_xmlRelaxNGPtr(n_schema, 1);
16826 
16827         xmlRelaxNGDumpTree(output, schema);
16828         call_tests++;
16829         des_FILE_ptr(n_output, output, 0);
16830         des_xmlRelaxNGPtr(n_schema, schema, 1);
16831         xmlResetLastError();
16832         if (mem_base != xmlMemBlocks()) {
16833             printf("Leak of %d blocks found in xmlRelaxNGDumpTree",
16834 	           xmlMemBlocks() - mem_base);
16835 	    test_ret++;
16836             printf(" %d", n_output);
16837             printf(" %d", n_schema);
16838             printf("\n");
16839         }
16840     }
16841     }
16842     function_tests++;
16843 #endif
16844 
16845     return(test_ret);
16846 }
16847 
16848 #ifdef LIBXML_SCHEMAS_ENABLED
16849 
16850 #define gen_nb_xmlRelaxNGParserCtxtPtr 1
16851 #define gen_xmlRelaxNGParserCtxtPtr(no, nr) NULL
16852 #define des_xmlRelaxNGParserCtxtPtr(no, val, nr)
16853 #endif
16854 
16855 #ifdef LIBXML_SCHEMAS_ENABLED
16856 
16857 #define gen_nb_xmlRelaxNGValidityErrorFunc_ptr 1
16858 #define gen_xmlRelaxNGValidityErrorFunc_ptr(no, nr) NULL
16859 #define des_xmlRelaxNGValidityErrorFunc_ptr(no, val, nr)
16860 #endif
16861 
16862 #ifdef LIBXML_SCHEMAS_ENABLED
16863 
16864 #define gen_nb_xmlRelaxNGValidityWarningFunc_ptr 1
16865 #define gen_xmlRelaxNGValidityWarningFunc_ptr(no, nr) NULL
16866 #define des_xmlRelaxNGValidityWarningFunc_ptr(no, val, nr)
16867 #endif
16868 
16869 
16870 static int
test_xmlRelaxNGGetParserErrors(void)16871 test_xmlRelaxNGGetParserErrors(void) {
16872     int test_ret = 0;
16873 
16874 #if defined(LIBXML_SCHEMAS_ENABLED)
16875     int mem_base;
16876     int ret_val;
16877     xmlRelaxNGParserCtxtPtr ctxt; /* a Relax-NG validation context */
16878     int n_ctxt;
16879     xmlRelaxNGValidityErrorFunc * err; /* the error callback result */
16880     int n_err;
16881     xmlRelaxNGValidityWarningFunc * warn; /* the warning callback result */
16882     int n_warn;
16883     void ** ctx; /* contextual data for the callbacks result */
16884     int n_ctx;
16885 
16886     for (n_ctxt = 0;n_ctxt < gen_nb_xmlRelaxNGParserCtxtPtr;n_ctxt++) {
16887     for (n_err = 0;n_err < gen_nb_xmlRelaxNGValidityErrorFunc_ptr;n_err++) {
16888     for (n_warn = 0;n_warn < gen_nb_xmlRelaxNGValidityWarningFunc_ptr;n_warn++) {
16889     for (n_ctx = 0;n_ctx < gen_nb_void_ptr_ptr;n_ctx++) {
16890         mem_base = xmlMemBlocks();
16891         ctxt = gen_xmlRelaxNGParserCtxtPtr(n_ctxt, 0);
16892         err = gen_xmlRelaxNGValidityErrorFunc_ptr(n_err, 1);
16893         warn = gen_xmlRelaxNGValidityWarningFunc_ptr(n_warn, 2);
16894         ctx = gen_void_ptr_ptr(n_ctx, 3);
16895 
16896         ret_val = xmlRelaxNGGetParserErrors(ctxt, err, warn, ctx);
16897         desret_int(ret_val);
16898         call_tests++;
16899         des_xmlRelaxNGParserCtxtPtr(n_ctxt, ctxt, 0);
16900         des_xmlRelaxNGValidityErrorFunc_ptr(n_err, err, 1);
16901         des_xmlRelaxNGValidityWarningFunc_ptr(n_warn, warn, 2);
16902         des_void_ptr_ptr(n_ctx, ctx, 3);
16903         xmlResetLastError();
16904         if (mem_base != xmlMemBlocks()) {
16905             printf("Leak of %d blocks found in xmlRelaxNGGetParserErrors",
16906 	           xmlMemBlocks() - mem_base);
16907 	    test_ret++;
16908             printf(" %d", n_ctxt);
16909             printf(" %d", n_err);
16910             printf(" %d", n_warn);
16911             printf(" %d", n_ctx);
16912             printf("\n");
16913         }
16914     }
16915     }
16916     }
16917     }
16918     function_tests++;
16919 #endif
16920 
16921     return(test_ret);
16922 }
16923 
16924 #ifdef LIBXML_SCHEMAS_ENABLED
16925 
16926 #define gen_nb_xmlRelaxNGValidCtxtPtr 1
16927 #define gen_xmlRelaxNGValidCtxtPtr(no, nr) NULL
16928 #define des_xmlRelaxNGValidCtxtPtr(no, val, nr)
16929 #endif
16930 
16931 
16932 static int
test_xmlRelaxNGGetValidErrors(void)16933 test_xmlRelaxNGGetValidErrors(void) {
16934     int test_ret = 0;
16935 
16936 #if defined(LIBXML_SCHEMAS_ENABLED)
16937     int mem_base;
16938     int ret_val;
16939     xmlRelaxNGValidCtxtPtr ctxt; /* a Relax-NG validation context */
16940     int n_ctxt;
16941     xmlRelaxNGValidityErrorFunc * err; /* the error function result */
16942     int n_err;
16943     xmlRelaxNGValidityWarningFunc * warn; /* the warning function result */
16944     int n_warn;
16945     void ** ctx; /* the functions context result */
16946     int n_ctx;
16947 
16948     for (n_ctxt = 0;n_ctxt < gen_nb_xmlRelaxNGValidCtxtPtr;n_ctxt++) {
16949     for (n_err = 0;n_err < gen_nb_xmlRelaxNGValidityErrorFunc_ptr;n_err++) {
16950     for (n_warn = 0;n_warn < gen_nb_xmlRelaxNGValidityWarningFunc_ptr;n_warn++) {
16951     for (n_ctx = 0;n_ctx < gen_nb_void_ptr_ptr;n_ctx++) {
16952         mem_base = xmlMemBlocks();
16953         ctxt = gen_xmlRelaxNGValidCtxtPtr(n_ctxt, 0);
16954         err = gen_xmlRelaxNGValidityErrorFunc_ptr(n_err, 1);
16955         warn = gen_xmlRelaxNGValidityWarningFunc_ptr(n_warn, 2);
16956         ctx = gen_void_ptr_ptr(n_ctx, 3);
16957 
16958         ret_val = xmlRelaxNGGetValidErrors(ctxt, err, warn, ctx);
16959         desret_int(ret_val);
16960         call_tests++;
16961         des_xmlRelaxNGValidCtxtPtr(n_ctxt, ctxt, 0);
16962         des_xmlRelaxNGValidityErrorFunc_ptr(n_err, err, 1);
16963         des_xmlRelaxNGValidityWarningFunc_ptr(n_warn, warn, 2);
16964         des_void_ptr_ptr(n_ctx, ctx, 3);
16965         xmlResetLastError();
16966         if (mem_base != xmlMemBlocks()) {
16967             printf("Leak of %d blocks found in xmlRelaxNGGetValidErrors",
16968 	           xmlMemBlocks() - mem_base);
16969 	    test_ret++;
16970             printf(" %d", n_ctxt);
16971             printf(" %d", n_err);
16972             printf(" %d", n_warn);
16973             printf(" %d", n_ctx);
16974             printf("\n");
16975         }
16976     }
16977     }
16978     }
16979     }
16980     function_tests++;
16981 #endif
16982 
16983     return(test_ret);
16984 }
16985 
16986 
16987 static int
test_xmlRelaxNGInitTypes(void)16988 test_xmlRelaxNGInitTypes(void) {
16989     int test_ret = 0;
16990 
16991 #if defined(LIBXML_SCHEMAS_ENABLED)
16992     int mem_base;
16993     int ret_val;
16994 
16995         mem_base = xmlMemBlocks();
16996 
16997         ret_val = xmlRelaxNGInitTypes();
16998         desret_int(ret_val);
16999         call_tests++;
17000         xmlResetLastError();
17001         if (mem_base != xmlMemBlocks()) {
17002             printf("Leak of %d blocks found in xmlRelaxNGInitTypes",
17003 	           xmlMemBlocks() - mem_base);
17004 	    test_ret++;
17005             printf("\n");
17006         }
17007     function_tests++;
17008 #endif
17009 
17010     return(test_ret);
17011 }
17012 
17013 
17014 static int
test_xmlRelaxNGNewDocParserCtxt(void)17015 test_xmlRelaxNGNewDocParserCtxt(void) {
17016     int test_ret = 0;
17017 
17018 #if defined(LIBXML_SCHEMAS_ENABLED)
17019     int mem_base;
17020     xmlRelaxNGParserCtxtPtr ret_val;
17021     xmlDocPtr doc; /* a preparsed document tree */
17022     int n_doc;
17023 
17024     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
17025         mem_base = xmlMemBlocks();
17026         doc = gen_xmlDocPtr(n_doc, 0);
17027 
17028         ret_val = xmlRelaxNGNewDocParserCtxt(doc);
17029         desret_xmlRelaxNGParserCtxtPtr(ret_val);
17030         call_tests++;
17031         des_xmlDocPtr(n_doc, doc, 0);
17032         xmlResetLastError();
17033         if (mem_base != xmlMemBlocks()) {
17034             printf("Leak of %d blocks found in xmlRelaxNGNewDocParserCtxt",
17035 	           xmlMemBlocks() - mem_base);
17036 	    test_ret++;
17037             printf(" %d", n_doc);
17038             printf("\n");
17039         }
17040     }
17041     function_tests++;
17042 #endif
17043 
17044     return(test_ret);
17045 }
17046 
17047 
17048 static int
test_xmlRelaxNGNewMemParserCtxt(void)17049 test_xmlRelaxNGNewMemParserCtxt(void) {
17050     int test_ret = 0;
17051 
17052 #if defined(LIBXML_SCHEMAS_ENABLED)
17053     int mem_base;
17054     xmlRelaxNGParserCtxtPtr ret_val;
17055     const char * buffer; /* a pointer to a char array containing the schemas */
17056     int n_buffer;
17057     int size; /* the size of the array */
17058     int n_size;
17059 
17060     for (n_buffer = 0;n_buffer < gen_nb_const_char_ptr;n_buffer++) {
17061     for (n_size = 0;n_size < gen_nb_int;n_size++) {
17062         mem_base = xmlMemBlocks();
17063         buffer = gen_const_char_ptr(n_buffer, 0);
17064         size = gen_int(n_size, 1);
17065         if ((buffer != NULL) &&
17066             (size > xmlStrlen(BAD_CAST buffer)))
17067             size = 0;
17068 
17069         ret_val = xmlRelaxNGNewMemParserCtxt(buffer, size);
17070         desret_xmlRelaxNGParserCtxtPtr(ret_val);
17071         call_tests++;
17072         des_const_char_ptr(n_buffer, buffer, 0);
17073         des_int(n_size, size, 1);
17074         xmlResetLastError();
17075         if (mem_base != xmlMemBlocks()) {
17076             printf("Leak of %d blocks found in xmlRelaxNGNewMemParserCtxt",
17077 	           xmlMemBlocks() - mem_base);
17078 	    test_ret++;
17079             printf(" %d", n_buffer);
17080             printf(" %d", n_size);
17081             printf("\n");
17082         }
17083     }
17084     }
17085     function_tests++;
17086 #endif
17087 
17088     return(test_ret);
17089 }
17090 
17091 
17092 static int
test_xmlRelaxNGNewParserCtxt(void)17093 test_xmlRelaxNGNewParserCtxt(void) {
17094     int test_ret = 0;
17095 
17096 #if defined(LIBXML_SCHEMAS_ENABLED)
17097     int mem_base;
17098     xmlRelaxNGParserCtxtPtr ret_val;
17099     const char * URL; /* the location of the schema */
17100     int n_URL;
17101 
17102     for (n_URL = 0;n_URL < gen_nb_const_char_ptr;n_URL++) {
17103         mem_base = xmlMemBlocks();
17104         URL = gen_const_char_ptr(n_URL, 0);
17105 
17106         ret_val = xmlRelaxNGNewParserCtxt(URL);
17107         desret_xmlRelaxNGParserCtxtPtr(ret_val);
17108         call_tests++;
17109         des_const_char_ptr(n_URL, URL, 0);
17110         xmlResetLastError();
17111         if (mem_base != xmlMemBlocks()) {
17112             printf("Leak of %d blocks found in xmlRelaxNGNewParserCtxt",
17113 	           xmlMemBlocks() - mem_base);
17114 	    test_ret++;
17115             printf(" %d", n_URL);
17116             printf("\n");
17117         }
17118     }
17119     function_tests++;
17120 #endif
17121 
17122     return(test_ret);
17123 }
17124 
17125 
17126 static int
test_xmlRelaxNGNewValidCtxt(void)17127 test_xmlRelaxNGNewValidCtxt(void) {
17128     int test_ret = 0;
17129 
17130 
17131     /* missing type support */
17132     return(test_ret);
17133 }
17134 
17135 
17136 static int
test_xmlRelaxNGParse(void)17137 test_xmlRelaxNGParse(void) {
17138     int test_ret = 0;
17139 
17140 
17141     /* missing type support */
17142     return(test_ret);
17143 }
17144 
17145 
17146 static int
test_xmlRelaxNGSetParserErrors(void)17147 test_xmlRelaxNGSetParserErrors(void) {
17148     int test_ret = 0;
17149 
17150 
17151     /* missing type support */
17152     return(test_ret);
17153 }
17154 
17155 
17156 static int
test_xmlRelaxNGSetParserStructuredErrors(void)17157 test_xmlRelaxNGSetParserStructuredErrors(void) {
17158     int test_ret = 0;
17159 
17160 
17161     /* missing type support */
17162     return(test_ret);
17163 }
17164 
17165 
17166 static int
test_xmlRelaxNGSetValidErrors(void)17167 test_xmlRelaxNGSetValidErrors(void) {
17168     int test_ret = 0;
17169 
17170 
17171     /* missing type support */
17172     return(test_ret);
17173 }
17174 
17175 
17176 static int
test_xmlRelaxNGSetValidStructuredErrors(void)17177 test_xmlRelaxNGSetValidStructuredErrors(void) {
17178     int test_ret = 0;
17179 
17180 
17181     /* missing type support */
17182     return(test_ret);
17183 }
17184 
17185 
17186 static int
test_xmlRelaxNGValidateDoc(void)17187 test_xmlRelaxNGValidateDoc(void) {
17188     int test_ret = 0;
17189 
17190 #if defined(LIBXML_SCHEMAS_ENABLED)
17191     int mem_base;
17192     int ret_val;
17193     xmlRelaxNGValidCtxtPtr ctxt; /* a Relax-NG validation context */
17194     int n_ctxt;
17195     xmlDocPtr doc; /* a parsed document tree */
17196     int n_doc;
17197 
17198     for (n_ctxt = 0;n_ctxt < gen_nb_xmlRelaxNGValidCtxtPtr;n_ctxt++) {
17199     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
17200         mem_base = xmlMemBlocks();
17201         ctxt = gen_xmlRelaxNGValidCtxtPtr(n_ctxt, 0);
17202         doc = gen_xmlDocPtr(n_doc, 1);
17203 
17204         ret_val = xmlRelaxNGValidateDoc(ctxt, doc);
17205         desret_int(ret_val);
17206         call_tests++;
17207         des_xmlRelaxNGValidCtxtPtr(n_ctxt, ctxt, 0);
17208         des_xmlDocPtr(n_doc, doc, 1);
17209         xmlResetLastError();
17210         if (mem_base != xmlMemBlocks()) {
17211             printf("Leak of %d blocks found in xmlRelaxNGValidateDoc",
17212 	           xmlMemBlocks() - mem_base);
17213 	    test_ret++;
17214             printf(" %d", n_ctxt);
17215             printf(" %d", n_doc);
17216             printf("\n");
17217         }
17218     }
17219     }
17220     function_tests++;
17221 #endif
17222 
17223     return(test_ret);
17224 }
17225 
17226 
17227 static int
test_xmlRelaxNGValidateFullElement(void)17228 test_xmlRelaxNGValidateFullElement(void) {
17229     int test_ret = 0;
17230 
17231 #if defined(LIBXML_SCHEMAS_ENABLED)
17232     int mem_base;
17233     int ret_val;
17234     xmlRelaxNGValidCtxtPtr ctxt; /* the validation context */
17235     int n_ctxt;
17236     xmlDocPtr doc; /* a document instance */
17237     int n_doc;
17238     xmlNodePtr elem; /* an element instance */
17239     int n_elem;
17240 
17241     for (n_ctxt = 0;n_ctxt < gen_nb_xmlRelaxNGValidCtxtPtr;n_ctxt++) {
17242     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
17243     for (n_elem = 0;n_elem < gen_nb_xmlNodePtr;n_elem++) {
17244         mem_base = xmlMemBlocks();
17245         ctxt = gen_xmlRelaxNGValidCtxtPtr(n_ctxt, 0);
17246         doc = gen_xmlDocPtr(n_doc, 1);
17247         elem = gen_xmlNodePtr(n_elem, 2);
17248 
17249         ret_val = xmlRelaxNGValidateFullElement(ctxt, doc, elem);
17250         desret_int(ret_val);
17251         call_tests++;
17252         des_xmlRelaxNGValidCtxtPtr(n_ctxt, ctxt, 0);
17253         des_xmlDocPtr(n_doc, doc, 1);
17254         des_xmlNodePtr(n_elem, elem, 2);
17255         xmlResetLastError();
17256         if (mem_base != xmlMemBlocks()) {
17257             printf("Leak of %d blocks found in xmlRelaxNGValidateFullElement",
17258 	           xmlMemBlocks() - mem_base);
17259 	    test_ret++;
17260             printf(" %d", n_ctxt);
17261             printf(" %d", n_doc);
17262             printf(" %d", n_elem);
17263             printf("\n");
17264         }
17265     }
17266     }
17267     }
17268     function_tests++;
17269 #endif
17270 
17271     return(test_ret);
17272 }
17273 
17274 
17275 static int
test_xmlRelaxNGValidatePopElement(void)17276 test_xmlRelaxNGValidatePopElement(void) {
17277     int test_ret = 0;
17278 
17279 #if defined(LIBXML_SCHEMAS_ENABLED)
17280     int mem_base;
17281     int ret_val;
17282     xmlRelaxNGValidCtxtPtr ctxt; /* the RelaxNG validation context */
17283     int n_ctxt;
17284     xmlDocPtr doc; /* a document instance */
17285     int n_doc;
17286     xmlNodePtr elem; /* an element instance */
17287     int n_elem;
17288 
17289     for (n_ctxt = 0;n_ctxt < gen_nb_xmlRelaxNGValidCtxtPtr;n_ctxt++) {
17290     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
17291     for (n_elem = 0;n_elem < gen_nb_xmlNodePtr;n_elem++) {
17292         mem_base = xmlMemBlocks();
17293         ctxt = gen_xmlRelaxNGValidCtxtPtr(n_ctxt, 0);
17294         doc = gen_xmlDocPtr(n_doc, 1);
17295         elem = gen_xmlNodePtr(n_elem, 2);
17296 
17297         ret_val = xmlRelaxNGValidatePopElement(ctxt, doc, elem);
17298         desret_int(ret_val);
17299         call_tests++;
17300         des_xmlRelaxNGValidCtxtPtr(n_ctxt, ctxt, 0);
17301         des_xmlDocPtr(n_doc, doc, 1);
17302         des_xmlNodePtr(n_elem, elem, 2);
17303         xmlResetLastError();
17304         if (mem_base != xmlMemBlocks()) {
17305             printf("Leak of %d blocks found in xmlRelaxNGValidatePopElement",
17306 	           xmlMemBlocks() - mem_base);
17307 	    test_ret++;
17308             printf(" %d", n_ctxt);
17309             printf(" %d", n_doc);
17310             printf(" %d", n_elem);
17311             printf("\n");
17312         }
17313     }
17314     }
17315     }
17316     function_tests++;
17317 #endif
17318 
17319     return(test_ret);
17320 }
17321 
17322 
17323 static int
test_xmlRelaxNGValidatePushCData(void)17324 test_xmlRelaxNGValidatePushCData(void) {
17325     int test_ret = 0;
17326 
17327 #if defined(LIBXML_SCHEMAS_ENABLED)
17328     int mem_base;
17329     int ret_val;
17330     xmlRelaxNGValidCtxtPtr ctxt; /* the RelaxNG validation context */
17331     int n_ctxt;
17332     const xmlChar * data; /* some character data read */
17333     int n_data;
17334     int len; /* the length of the data */
17335     int n_len;
17336 
17337     for (n_ctxt = 0;n_ctxt < gen_nb_xmlRelaxNGValidCtxtPtr;n_ctxt++) {
17338     for (n_data = 0;n_data < gen_nb_const_xmlChar_ptr;n_data++) {
17339     for (n_len = 0;n_len < gen_nb_int;n_len++) {
17340         mem_base = xmlMemBlocks();
17341         ctxt = gen_xmlRelaxNGValidCtxtPtr(n_ctxt, 0);
17342         data = gen_const_xmlChar_ptr(n_data, 1);
17343         len = gen_int(n_len, 2);
17344         if ((data != NULL) &&
17345             (len > xmlStrlen(BAD_CAST data)))
17346             len = 0;
17347 
17348         ret_val = xmlRelaxNGValidatePushCData(ctxt, data, len);
17349         desret_int(ret_val);
17350         call_tests++;
17351         des_xmlRelaxNGValidCtxtPtr(n_ctxt, ctxt, 0);
17352         des_const_xmlChar_ptr(n_data, data, 1);
17353         des_int(n_len, len, 2);
17354         xmlResetLastError();
17355         if (mem_base != xmlMemBlocks()) {
17356             printf("Leak of %d blocks found in xmlRelaxNGValidatePushCData",
17357 	           xmlMemBlocks() - mem_base);
17358 	    test_ret++;
17359             printf(" %d", n_ctxt);
17360             printf(" %d", n_data);
17361             printf(" %d", n_len);
17362             printf("\n");
17363         }
17364     }
17365     }
17366     }
17367     function_tests++;
17368 #endif
17369 
17370     return(test_ret);
17371 }
17372 
17373 
17374 static int
test_xmlRelaxNGValidatePushElement(void)17375 test_xmlRelaxNGValidatePushElement(void) {
17376     int test_ret = 0;
17377 
17378 #if defined(LIBXML_SCHEMAS_ENABLED)
17379     int mem_base;
17380     int ret_val;
17381     xmlRelaxNGValidCtxtPtr ctxt; /* the validation context */
17382     int n_ctxt;
17383     xmlDocPtr doc; /* a document instance */
17384     int n_doc;
17385     xmlNodePtr elem; /* an element instance */
17386     int n_elem;
17387 
17388     for (n_ctxt = 0;n_ctxt < gen_nb_xmlRelaxNGValidCtxtPtr;n_ctxt++) {
17389     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
17390     for (n_elem = 0;n_elem < gen_nb_xmlNodePtr;n_elem++) {
17391         mem_base = xmlMemBlocks();
17392         ctxt = gen_xmlRelaxNGValidCtxtPtr(n_ctxt, 0);
17393         doc = gen_xmlDocPtr(n_doc, 1);
17394         elem = gen_xmlNodePtr(n_elem, 2);
17395 
17396         ret_val = xmlRelaxNGValidatePushElement(ctxt, doc, elem);
17397         desret_int(ret_val);
17398         call_tests++;
17399         des_xmlRelaxNGValidCtxtPtr(n_ctxt, ctxt, 0);
17400         des_xmlDocPtr(n_doc, doc, 1);
17401         des_xmlNodePtr(n_elem, elem, 2);
17402         xmlResetLastError();
17403         if (mem_base != xmlMemBlocks()) {
17404             printf("Leak of %d blocks found in xmlRelaxNGValidatePushElement",
17405 	           xmlMemBlocks() - mem_base);
17406 	    test_ret++;
17407             printf(" %d", n_ctxt);
17408             printf(" %d", n_doc);
17409             printf(" %d", n_elem);
17410             printf("\n");
17411         }
17412     }
17413     }
17414     }
17415     function_tests++;
17416 #endif
17417 
17418     return(test_ret);
17419 }
17420 
17421 
17422 static int
test_xmlRelaxParserSetFlag(void)17423 test_xmlRelaxParserSetFlag(void) {
17424     int test_ret = 0;
17425 
17426 #if defined(LIBXML_SCHEMAS_ENABLED)
17427     int mem_base;
17428     int ret_val;
17429     xmlRelaxNGParserCtxtPtr ctxt; /* a RelaxNG parser context */
17430     int n_ctxt;
17431     int flags; /* a set of flags values */
17432     int n_flags;
17433 
17434     for (n_ctxt = 0;n_ctxt < gen_nb_xmlRelaxNGParserCtxtPtr;n_ctxt++) {
17435     for (n_flags = 0;n_flags < gen_nb_int;n_flags++) {
17436         mem_base = xmlMemBlocks();
17437         ctxt = gen_xmlRelaxNGParserCtxtPtr(n_ctxt, 0);
17438         flags = gen_int(n_flags, 1);
17439 
17440         ret_val = xmlRelaxParserSetFlag(ctxt, flags);
17441         desret_int(ret_val);
17442         call_tests++;
17443         des_xmlRelaxNGParserCtxtPtr(n_ctxt, ctxt, 0);
17444         des_int(n_flags, flags, 1);
17445         xmlResetLastError();
17446         if (mem_base != xmlMemBlocks()) {
17447             printf("Leak of %d blocks found in xmlRelaxParserSetFlag",
17448 	           xmlMemBlocks() - mem_base);
17449 	    test_ret++;
17450             printf(" %d", n_ctxt);
17451             printf(" %d", n_flags);
17452             printf("\n");
17453         }
17454     }
17455     }
17456     function_tests++;
17457 #endif
17458 
17459     return(test_ret);
17460 }
17461 
17462 static int
test_relaxng(void)17463 test_relaxng(void) {
17464     int test_ret = 0;
17465 
17466     if (quiet == 0) printf("Testing relaxng : 14 of 24 functions ...\n");
17467     test_ret += test_xmlRelaxNGDump();
17468     test_ret += test_xmlRelaxNGDumpTree();
17469     test_ret += test_xmlRelaxNGGetParserErrors();
17470     test_ret += test_xmlRelaxNGGetValidErrors();
17471     test_ret += test_xmlRelaxNGInitTypes();
17472     test_ret += test_xmlRelaxNGNewDocParserCtxt();
17473     test_ret += test_xmlRelaxNGNewMemParserCtxt();
17474     test_ret += test_xmlRelaxNGNewParserCtxt();
17475     test_ret += test_xmlRelaxNGNewValidCtxt();
17476     test_ret += test_xmlRelaxNGParse();
17477     test_ret += test_xmlRelaxNGSetParserErrors();
17478     test_ret += test_xmlRelaxNGSetParserStructuredErrors();
17479     test_ret += test_xmlRelaxNGSetValidErrors();
17480     test_ret += test_xmlRelaxNGSetValidStructuredErrors();
17481     test_ret += test_xmlRelaxNGValidateDoc();
17482     test_ret += test_xmlRelaxNGValidateFullElement();
17483     test_ret += test_xmlRelaxNGValidatePopElement();
17484     test_ret += test_xmlRelaxNGValidatePushCData();
17485     test_ret += test_xmlRelaxNGValidatePushElement();
17486     test_ret += test_xmlRelaxParserSetFlag();
17487 
17488     if (test_ret != 0)
17489 	printf("Module relaxng: %d errors\n", test_ret);
17490     return(test_ret);
17491 }
17492 static int
test_schemasInternals(void)17493 test_schemasInternals(void) {
17494     int test_ret = 0;
17495 
17496     if (quiet == 0) printf("Testing schemasInternals : 0 of 2 functions ...\n");
17497 
17498     if (test_ret != 0)
17499 	printf("Module schemasInternals: %d errors\n", test_ret);
17500     return(test_ret);
17501 }
17502 
17503 static int
test_xmlSchematronNewDocParserCtxt(void)17504 test_xmlSchematronNewDocParserCtxt(void) {
17505     int test_ret = 0;
17506 
17507 
17508     /* missing type support */
17509     return(test_ret);
17510 }
17511 
17512 
17513 static int
test_xmlSchematronNewMemParserCtxt(void)17514 test_xmlSchematronNewMemParserCtxt(void) {
17515     int test_ret = 0;
17516 
17517 
17518     /* missing type support */
17519     return(test_ret);
17520 }
17521 
17522 
17523 static int
test_xmlSchematronNewParserCtxt(void)17524 test_xmlSchematronNewParserCtxt(void) {
17525     int test_ret = 0;
17526 
17527 
17528     /* missing type support */
17529     return(test_ret);
17530 }
17531 
17532 
17533 static int
test_xmlSchematronNewValidCtxt(void)17534 test_xmlSchematronNewValidCtxt(void) {
17535     int test_ret = 0;
17536 
17537 
17538     /* missing type support */
17539     return(test_ret);
17540 }
17541 
17542 
17543 static int
test_xmlSchematronParse(void)17544 test_xmlSchematronParse(void) {
17545     int test_ret = 0;
17546 
17547 
17548     /* missing type support */
17549     return(test_ret);
17550 }
17551 
17552 
17553 static int
test_xmlSchematronSetValidStructuredErrors(void)17554 test_xmlSchematronSetValidStructuredErrors(void) {
17555     int test_ret = 0;
17556 
17557 
17558     /* missing type support */
17559     return(test_ret);
17560 }
17561 
17562 #ifdef LIBXML_SCHEMATRON_ENABLED
17563 
17564 #define gen_nb_xmlSchematronValidCtxtPtr 1
17565 #define gen_xmlSchematronValidCtxtPtr(no, nr) NULL
17566 #define des_xmlSchematronValidCtxtPtr(no, val, nr)
17567 #endif
17568 
17569 
17570 static int
test_xmlSchematronValidateDoc(void)17571 test_xmlSchematronValidateDoc(void) {
17572     int test_ret = 0;
17573 
17574 #if defined(LIBXML_SCHEMATRON_ENABLED)
17575     int mem_base;
17576     int ret_val;
17577     xmlSchematronValidCtxtPtr ctxt; /* the schema validation context */
17578     int n_ctxt;
17579     xmlDocPtr instance; /* the document instance tree */
17580     int n_instance;
17581 
17582     for (n_ctxt = 0;n_ctxt < gen_nb_xmlSchematronValidCtxtPtr;n_ctxt++) {
17583     for (n_instance = 0;n_instance < gen_nb_xmlDocPtr;n_instance++) {
17584         mem_base = xmlMemBlocks();
17585         ctxt = gen_xmlSchematronValidCtxtPtr(n_ctxt, 0);
17586         instance = gen_xmlDocPtr(n_instance, 1);
17587 
17588         ret_val = xmlSchematronValidateDoc(ctxt, instance);
17589         desret_int(ret_val);
17590         call_tests++;
17591         des_xmlSchematronValidCtxtPtr(n_ctxt, ctxt, 0);
17592         des_xmlDocPtr(n_instance, instance, 1);
17593         xmlResetLastError();
17594         if (mem_base != xmlMemBlocks()) {
17595             printf("Leak of %d blocks found in xmlSchematronValidateDoc",
17596 	           xmlMemBlocks() - mem_base);
17597 	    test_ret++;
17598             printf(" %d", n_ctxt);
17599             printf(" %d", n_instance);
17600             printf("\n");
17601         }
17602     }
17603     }
17604     function_tests++;
17605 #endif
17606 
17607     return(test_ret);
17608 }
17609 
17610 static int
test_schematron(void)17611 test_schematron(void) {
17612     int test_ret = 0;
17613 
17614     if (quiet == 0) printf("Testing schematron : 1 of 10 functions ...\n");
17615     test_ret += test_xmlSchematronNewDocParserCtxt();
17616     test_ret += test_xmlSchematronNewMemParserCtxt();
17617     test_ret += test_xmlSchematronNewParserCtxt();
17618     test_ret += test_xmlSchematronNewValidCtxt();
17619     test_ret += test_xmlSchematronParse();
17620     test_ret += test_xmlSchematronSetValidStructuredErrors();
17621     test_ret += test_xmlSchematronValidateDoc();
17622 
17623     if (test_ret != 0)
17624 	printf("Module schematron: %d errors\n", test_ret);
17625     return(test_ret);
17626 }
17627 
17628 static int
test_xmlAddChild(void)17629 test_xmlAddChild(void) {
17630     int test_ret = 0;
17631 
17632     int mem_base;
17633     xmlNodePtr ret_val;
17634     xmlNodePtr parent; /* the parent node */
17635     int n_parent;
17636     xmlNodePtr cur; /* the child node */
17637     int n_cur;
17638 
17639     for (n_parent = 0;n_parent < gen_nb_xmlNodePtr;n_parent++) {
17640     for (n_cur = 0;n_cur < gen_nb_xmlNodePtr_in;n_cur++) {
17641         mem_base = xmlMemBlocks();
17642         parent = gen_xmlNodePtr(n_parent, 0);
17643         cur = gen_xmlNodePtr_in(n_cur, 1);
17644 
17645         ret_val = xmlAddChild(parent, cur);
17646         if (ret_val == NULL) { xmlFreeNode(cur) ; cur = NULL ; }
17647         desret_xmlNodePtr(ret_val);
17648         call_tests++;
17649         des_xmlNodePtr(n_parent, parent, 0);
17650         des_xmlNodePtr_in(n_cur, cur, 1);
17651         xmlResetLastError();
17652         if (mem_base != xmlMemBlocks()) {
17653             printf("Leak of %d blocks found in xmlAddChild",
17654 	           xmlMemBlocks() - mem_base);
17655 	    test_ret++;
17656             printf(" %d", n_parent);
17657             printf(" %d", n_cur);
17658             printf("\n");
17659         }
17660     }
17661     }
17662     function_tests++;
17663 
17664     return(test_ret);
17665 }
17666 
17667 
17668 static int
test_xmlAddChildList(void)17669 test_xmlAddChildList(void) {
17670     int test_ret = 0;
17671 
17672     int mem_base;
17673     xmlNodePtr ret_val;
17674     xmlNodePtr parent; /* the parent node */
17675     int n_parent;
17676     xmlNodePtr cur; /* the first node in the list */
17677     int n_cur;
17678 
17679     for (n_parent = 0;n_parent < gen_nb_xmlNodePtr;n_parent++) {
17680     for (n_cur = 0;n_cur < gen_nb_xmlNodePtr_in;n_cur++) {
17681         mem_base = xmlMemBlocks();
17682         parent = gen_xmlNodePtr(n_parent, 0);
17683         cur = gen_xmlNodePtr_in(n_cur, 1);
17684 
17685         ret_val = xmlAddChildList(parent, cur);
17686         if (ret_val == NULL) { xmlFreeNodeList(cur) ; cur = NULL ; }
17687         desret_xmlNodePtr(ret_val);
17688         call_tests++;
17689         des_xmlNodePtr(n_parent, parent, 0);
17690         des_xmlNodePtr_in(n_cur, cur, 1);
17691         xmlResetLastError();
17692         if (mem_base != xmlMemBlocks()) {
17693             printf("Leak of %d blocks found in xmlAddChildList",
17694 	           xmlMemBlocks() - mem_base);
17695 	    test_ret++;
17696             printf(" %d", n_parent);
17697             printf(" %d", n_cur);
17698             printf("\n");
17699         }
17700     }
17701     }
17702     function_tests++;
17703 
17704     return(test_ret);
17705 }
17706 
17707 
17708 static int
test_xmlAddNextSibling(void)17709 test_xmlAddNextSibling(void) {
17710     int test_ret = 0;
17711 
17712     int mem_base;
17713     xmlNodePtr ret_val;
17714     xmlNodePtr cur; /* the child node */
17715     int n_cur;
17716     xmlNodePtr elem; /* the new node */
17717     int n_elem;
17718 
17719     for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
17720     for (n_elem = 0;n_elem < gen_nb_xmlNodePtr_in;n_elem++) {
17721         mem_base = xmlMemBlocks();
17722         cur = gen_xmlNodePtr(n_cur, 0);
17723         elem = gen_xmlNodePtr_in(n_elem, 1);
17724 
17725         ret_val = xmlAddNextSibling(cur, elem);
17726         if (ret_val == NULL) { xmlFreeNode(elem) ; elem = NULL ; }
17727         desret_xmlNodePtr(ret_val);
17728         call_tests++;
17729         des_xmlNodePtr(n_cur, cur, 0);
17730         des_xmlNodePtr_in(n_elem, elem, 1);
17731         xmlResetLastError();
17732         if (mem_base != xmlMemBlocks()) {
17733             printf("Leak of %d blocks found in xmlAddNextSibling",
17734 	           xmlMemBlocks() - mem_base);
17735 	    test_ret++;
17736             printf(" %d", n_cur);
17737             printf(" %d", n_elem);
17738             printf("\n");
17739         }
17740     }
17741     }
17742     function_tests++;
17743 
17744     return(test_ret);
17745 }
17746 
17747 
17748 static int
test_xmlAddPrevSibling(void)17749 test_xmlAddPrevSibling(void) {
17750     int test_ret = 0;
17751 
17752 #if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_HTML_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED) || defined(LIBXML_XINCLUDE_ENABLED)
17753     int mem_base;
17754     xmlNodePtr ret_val;
17755     xmlNodePtr cur; /* the child node */
17756     int n_cur;
17757     xmlNodePtr elem; /* the new node */
17758     int n_elem;
17759 
17760     for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
17761     for (n_elem = 0;n_elem < gen_nb_xmlNodePtr_in;n_elem++) {
17762         mem_base = xmlMemBlocks();
17763         cur = gen_xmlNodePtr(n_cur, 0);
17764         elem = gen_xmlNodePtr_in(n_elem, 1);
17765 
17766         ret_val = xmlAddPrevSibling(cur, elem);
17767         if (ret_val == NULL) { xmlFreeNode(elem) ; elem = NULL ; }
17768         desret_xmlNodePtr(ret_val);
17769         call_tests++;
17770         des_xmlNodePtr(n_cur, cur, 0);
17771         des_xmlNodePtr_in(n_elem, elem, 1);
17772         xmlResetLastError();
17773         if (mem_base != xmlMemBlocks()) {
17774             printf("Leak of %d blocks found in xmlAddPrevSibling",
17775 	           xmlMemBlocks() - mem_base);
17776 	    test_ret++;
17777             printf(" %d", n_cur);
17778             printf(" %d", n_elem);
17779             printf("\n");
17780         }
17781     }
17782     }
17783     function_tests++;
17784 #endif
17785 
17786     return(test_ret);
17787 }
17788 
17789 
17790 static int
test_xmlAddSibling(void)17791 test_xmlAddSibling(void) {
17792     int test_ret = 0;
17793 
17794     int mem_base;
17795     xmlNodePtr ret_val;
17796     xmlNodePtr cur; /* the child node */
17797     int n_cur;
17798     xmlNodePtr elem; /* the new node */
17799     int n_elem;
17800 
17801     for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
17802     for (n_elem = 0;n_elem < gen_nb_xmlNodePtr_in;n_elem++) {
17803         mem_base = xmlMemBlocks();
17804         cur = gen_xmlNodePtr(n_cur, 0);
17805         elem = gen_xmlNodePtr_in(n_elem, 1);
17806 
17807         ret_val = xmlAddSibling(cur, elem);
17808         if (ret_val == NULL) { xmlFreeNode(elem) ; elem = NULL ; }
17809         desret_xmlNodePtr(ret_val);
17810         call_tests++;
17811         des_xmlNodePtr(n_cur, cur, 0);
17812         des_xmlNodePtr_in(n_elem, elem, 1);
17813         xmlResetLastError();
17814         if (mem_base != xmlMemBlocks()) {
17815             printf("Leak of %d blocks found in xmlAddSibling",
17816 	           xmlMemBlocks() - mem_base);
17817 	    test_ret++;
17818             printf(" %d", n_cur);
17819             printf(" %d", n_elem);
17820             printf("\n");
17821         }
17822     }
17823     }
17824     function_tests++;
17825 
17826     return(test_ret);
17827 }
17828 
17829 
17830 static int
test_xmlAttrSerializeTxtContent(void)17831 test_xmlAttrSerializeTxtContent(void) {
17832     int test_ret = 0;
17833 
17834 #if defined(LIBXML_OUTPUT_ENABLED)
17835 #ifdef LIBXML_OUTPUT_ENABLED
17836     int mem_base;
17837     xmlBufferPtr buf; /* the XML buffer output */
17838     int n_buf;
17839     xmlDocPtr doc; /* the document */
17840     int n_doc;
17841     xmlAttrPtr attr; /* the attribute node */
17842     int n_attr;
17843     const xmlChar * string; /* the text content */
17844     int n_string;
17845 
17846     for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
17847     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
17848     for (n_attr = 0;n_attr < gen_nb_xmlAttrPtr;n_attr++) {
17849     for (n_string = 0;n_string < gen_nb_const_xmlChar_ptr;n_string++) {
17850         mem_base = xmlMemBlocks();
17851         buf = gen_xmlBufferPtr(n_buf, 0);
17852         doc = gen_xmlDocPtr(n_doc, 1);
17853         attr = gen_xmlAttrPtr(n_attr, 2);
17854         string = gen_const_xmlChar_ptr(n_string, 3);
17855 
17856         xmlAttrSerializeTxtContent(buf, doc, attr, string);
17857         call_tests++;
17858         des_xmlBufferPtr(n_buf, buf, 0);
17859         des_xmlDocPtr(n_doc, doc, 1);
17860         des_xmlAttrPtr(n_attr, attr, 2);
17861         des_const_xmlChar_ptr(n_string, string, 3);
17862         xmlResetLastError();
17863         if (mem_base != xmlMemBlocks()) {
17864             printf("Leak of %d blocks found in xmlAttrSerializeTxtContent",
17865 	           xmlMemBlocks() - mem_base);
17866 	    test_ret++;
17867             printf(" %d", n_buf);
17868             printf(" %d", n_doc);
17869             printf(" %d", n_attr);
17870             printf(" %d", n_string);
17871             printf("\n");
17872         }
17873     }
17874     }
17875     }
17876     }
17877     function_tests++;
17878 #endif
17879 #endif
17880 
17881     return(test_ret);
17882 }
17883 
17884 
17885 #define gen_nb_const_xmlBuf_ptr 1
17886 #define gen_const_xmlBuf_ptr(no, nr) NULL
17887 #define des_const_xmlBuf_ptr(no, val, nr)
17888 
17889 static int
test_xmlBufContent(void)17890 test_xmlBufContent(void) {
17891     int test_ret = 0;
17892 
17893     int mem_base;
17894     xmlChar * ret_val;
17895     const xmlBuf * buf; /* the buffer */
17896     int n_buf;
17897 
17898     for (n_buf = 0;n_buf < gen_nb_const_xmlBuf_ptr;n_buf++) {
17899         mem_base = xmlMemBlocks();
17900         buf = gen_const_xmlBuf_ptr(n_buf, 0);
17901 
17902         ret_val = xmlBufContent(buf);
17903         desret_xmlChar_ptr(ret_val);
17904         call_tests++;
17905         des_const_xmlBuf_ptr(n_buf, buf, 0);
17906         xmlResetLastError();
17907         if (mem_base != xmlMemBlocks()) {
17908             printf("Leak of %d blocks found in xmlBufContent",
17909 	           xmlMemBlocks() - mem_base);
17910 	    test_ret++;
17911             printf(" %d", n_buf);
17912             printf("\n");
17913         }
17914     }
17915     function_tests++;
17916 
17917     return(test_ret);
17918 }
17919 
17920 
17921 #define gen_nb_xmlBufPtr 1
17922 #define gen_xmlBufPtr(no, nr) NULL
17923 #define des_xmlBufPtr(no, val, nr)
17924 
17925 static int
test_xmlBufEnd(void)17926 test_xmlBufEnd(void) {
17927     int test_ret = 0;
17928 
17929     int mem_base;
17930     xmlChar * ret_val;
17931     xmlBufPtr buf; /* the buffer */
17932     int n_buf;
17933 
17934     for (n_buf = 0;n_buf < gen_nb_xmlBufPtr;n_buf++) {
17935         mem_base = xmlMemBlocks();
17936         buf = gen_xmlBufPtr(n_buf, 0);
17937 
17938         ret_val = xmlBufEnd(buf);
17939         desret_xmlChar_ptr(ret_val);
17940         call_tests++;
17941         des_xmlBufPtr(n_buf, buf, 0);
17942         xmlResetLastError();
17943         if (mem_base != xmlMemBlocks()) {
17944             printf("Leak of %d blocks found in xmlBufEnd",
17945 	           xmlMemBlocks() - mem_base);
17946 	    test_ret++;
17947             printf(" %d", n_buf);
17948             printf("\n");
17949         }
17950     }
17951     function_tests++;
17952 
17953     return(test_ret);
17954 }
17955 
17956 
17957 #define gen_nb_const_xmlNode_ptr 1
17958 #define gen_const_xmlNode_ptr(no, nr) NULL
17959 #define des_const_xmlNode_ptr(no, val, nr)
17960 
17961 static int
test_xmlBufGetNodeContent(void)17962 test_xmlBufGetNodeContent(void) {
17963     int test_ret = 0;
17964 
17965     int mem_base;
17966     int ret_val;
17967     xmlBufPtr buf; /* a buffer xmlBufPtr */
17968     int n_buf;
17969     const xmlNode * cur; /* the node being read */
17970     int n_cur;
17971 
17972     for (n_buf = 0;n_buf < gen_nb_xmlBufPtr;n_buf++) {
17973     for (n_cur = 0;n_cur < gen_nb_const_xmlNode_ptr;n_cur++) {
17974         mem_base = xmlMemBlocks();
17975         buf = gen_xmlBufPtr(n_buf, 0);
17976         cur = gen_const_xmlNode_ptr(n_cur, 1);
17977 
17978         ret_val = xmlBufGetNodeContent(buf, cur);
17979         desret_int(ret_val);
17980         call_tests++;
17981         des_xmlBufPtr(n_buf, buf, 0);
17982         des_const_xmlNode_ptr(n_cur, cur, 1);
17983         xmlResetLastError();
17984         if (mem_base != xmlMemBlocks()) {
17985             printf("Leak of %d blocks found in xmlBufGetNodeContent",
17986 	           xmlMemBlocks() - mem_base);
17987 	    test_ret++;
17988             printf(" %d", n_buf);
17989             printf(" %d", n_cur);
17990             printf("\n");
17991         }
17992     }
17993     }
17994     function_tests++;
17995 
17996     return(test_ret);
17997 }
17998 
17999 
18000 static int
test_xmlBufNodeDump(void)18001 test_xmlBufNodeDump(void) {
18002     int test_ret = 0;
18003 
18004 
18005     /* missing type support */
18006     return(test_ret);
18007 }
18008 
18009 
18010 static int
test_xmlBufShrink(void)18011 test_xmlBufShrink(void) {
18012     int test_ret = 0;
18013 
18014 
18015     /* missing type support */
18016     return(test_ret);
18017 }
18018 
18019 
18020 static int
test_xmlBufUse(void)18021 test_xmlBufUse(void) {
18022     int test_ret = 0;
18023 
18024 
18025     /* missing type support */
18026     return(test_ret);
18027 }
18028 
18029 
18030 static int
test_xmlBufferAdd(void)18031 test_xmlBufferAdd(void) {
18032     int test_ret = 0;
18033 
18034     int mem_base;
18035     int ret_val;
18036     xmlBufferPtr buf; /* the buffer to dump */
18037     int n_buf;
18038     const xmlChar * str; /* the #xmlChar string */
18039     int n_str;
18040     int len; /* the number of #xmlChar to add */
18041     int n_len;
18042 
18043     for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
18044     for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) {
18045     for (n_len = 0;n_len < gen_nb_int;n_len++) {
18046         mem_base = xmlMemBlocks();
18047         buf = gen_xmlBufferPtr(n_buf, 0);
18048         str = gen_const_xmlChar_ptr(n_str, 1);
18049         len = gen_int(n_len, 2);
18050         if ((str != NULL) &&
18051             (len > xmlStrlen(BAD_CAST str)))
18052             len = 0;
18053 
18054         ret_val = xmlBufferAdd(buf, str, len);
18055         desret_int(ret_val);
18056         call_tests++;
18057         des_xmlBufferPtr(n_buf, buf, 0);
18058         des_const_xmlChar_ptr(n_str, str, 1);
18059         des_int(n_len, len, 2);
18060         xmlResetLastError();
18061         if (mem_base != xmlMemBlocks()) {
18062             printf("Leak of %d blocks found in xmlBufferAdd",
18063 	           xmlMemBlocks() - mem_base);
18064 	    test_ret++;
18065             printf(" %d", n_buf);
18066             printf(" %d", n_str);
18067             printf(" %d", n_len);
18068             printf("\n");
18069         }
18070     }
18071     }
18072     }
18073     function_tests++;
18074 
18075     return(test_ret);
18076 }
18077 
18078 
18079 static int
test_xmlBufferAddHead(void)18080 test_xmlBufferAddHead(void) {
18081     int test_ret = 0;
18082 
18083     int mem_base;
18084     int ret_val;
18085     xmlBufferPtr buf; /* the buffer */
18086     int n_buf;
18087     const xmlChar * str; /* the #xmlChar string */
18088     int n_str;
18089     int len; /* the number of #xmlChar to add */
18090     int n_len;
18091 
18092     for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
18093     for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) {
18094     for (n_len = 0;n_len < gen_nb_int;n_len++) {
18095         mem_base = xmlMemBlocks();
18096         buf = gen_xmlBufferPtr(n_buf, 0);
18097         str = gen_const_xmlChar_ptr(n_str, 1);
18098         len = gen_int(n_len, 2);
18099         if ((str != NULL) &&
18100             (len > xmlStrlen(BAD_CAST str)))
18101             len = 0;
18102 
18103         ret_val = xmlBufferAddHead(buf, str, len);
18104         desret_int(ret_val);
18105         call_tests++;
18106         des_xmlBufferPtr(n_buf, buf, 0);
18107         des_const_xmlChar_ptr(n_str, str, 1);
18108         des_int(n_len, len, 2);
18109         xmlResetLastError();
18110         if (mem_base != xmlMemBlocks()) {
18111             printf("Leak of %d blocks found in xmlBufferAddHead",
18112 	           xmlMemBlocks() - mem_base);
18113 	    test_ret++;
18114             printf(" %d", n_buf);
18115             printf(" %d", n_str);
18116             printf(" %d", n_len);
18117             printf("\n");
18118         }
18119     }
18120     }
18121     }
18122     function_tests++;
18123 
18124     return(test_ret);
18125 }
18126 
18127 
18128 static int
test_xmlBufferCCat(void)18129 test_xmlBufferCCat(void) {
18130     int test_ret = 0;
18131 
18132     int mem_base;
18133     int ret_val;
18134     xmlBufferPtr buf; /* the buffer to dump */
18135     int n_buf;
18136     const char * str; /* the C char string */
18137     int n_str;
18138 
18139     for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
18140     for (n_str = 0;n_str < gen_nb_const_char_ptr;n_str++) {
18141         mem_base = xmlMemBlocks();
18142         buf = gen_xmlBufferPtr(n_buf, 0);
18143         str = gen_const_char_ptr(n_str, 1);
18144 
18145         ret_val = xmlBufferCCat(buf, str);
18146         desret_int(ret_val);
18147         call_tests++;
18148         des_xmlBufferPtr(n_buf, buf, 0);
18149         des_const_char_ptr(n_str, str, 1);
18150         xmlResetLastError();
18151         if (mem_base != xmlMemBlocks()) {
18152             printf("Leak of %d blocks found in xmlBufferCCat",
18153 	           xmlMemBlocks() - mem_base);
18154 	    test_ret++;
18155             printf(" %d", n_buf);
18156             printf(" %d", n_str);
18157             printf("\n");
18158         }
18159     }
18160     }
18161     function_tests++;
18162 
18163     return(test_ret);
18164 }
18165 
18166 
18167 static int
test_xmlBufferCat(void)18168 test_xmlBufferCat(void) {
18169     int test_ret = 0;
18170 
18171     int mem_base;
18172     int ret_val;
18173     xmlBufferPtr buf; /* the buffer to add to */
18174     int n_buf;
18175     const xmlChar * str; /* the #xmlChar string */
18176     int n_str;
18177 
18178     for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
18179     for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) {
18180         mem_base = xmlMemBlocks();
18181         buf = gen_xmlBufferPtr(n_buf, 0);
18182         str = gen_const_xmlChar_ptr(n_str, 1);
18183 
18184         ret_val = xmlBufferCat(buf, str);
18185         desret_int(ret_val);
18186         call_tests++;
18187         des_xmlBufferPtr(n_buf, buf, 0);
18188         des_const_xmlChar_ptr(n_str, str, 1);
18189         xmlResetLastError();
18190         if (mem_base != xmlMemBlocks()) {
18191             printf("Leak of %d blocks found in xmlBufferCat",
18192 	           xmlMemBlocks() - mem_base);
18193 	    test_ret++;
18194             printf(" %d", n_buf);
18195             printf(" %d", n_str);
18196             printf("\n");
18197         }
18198     }
18199     }
18200     function_tests++;
18201 
18202     return(test_ret);
18203 }
18204 
18205 
18206 #define gen_nb_const_xmlBuffer_ptr 1
18207 #define gen_const_xmlBuffer_ptr(no, nr) NULL
18208 #define des_const_xmlBuffer_ptr(no, val, nr)
18209 
18210 static int
test_xmlBufferContent(void)18211 test_xmlBufferContent(void) {
18212     int test_ret = 0;
18213 
18214     int mem_base;
18215     const xmlChar * ret_val;
18216     const xmlBuffer * buf; /* the buffer */
18217     int n_buf;
18218 
18219     for (n_buf = 0;n_buf < gen_nb_const_xmlBuffer_ptr;n_buf++) {
18220         mem_base = xmlMemBlocks();
18221         buf = gen_const_xmlBuffer_ptr(n_buf, 0);
18222 
18223         ret_val = xmlBufferContent(buf);
18224         desret_const_xmlChar_ptr(ret_val);
18225         call_tests++;
18226         des_const_xmlBuffer_ptr(n_buf, buf, 0);
18227         xmlResetLastError();
18228         if (mem_base != xmlMemBlocks()) {
18229             printf("Leak of %d blocks found in xmlBufferContent",
18230 	           xmlMemBlocks() - mem_base);
18231 	    test_ret++;
18232             printf(" %d", n_buf);
18233             printf("\n");
18234         }
18235     }
18236     function_tests++;
18237 
18238     return(test_ret);
18239 }
18240 
18241 
18242 static int
test_xmlBufferCreate(void)18243 test_xmlBufferCreate(void) {
18244     int test_ret = 0;
18245 
18246     int mem_base;
18247     xmlBufferPtr ret_val;
18248 
18249         mem_base = xmlMemBlocks();
18250 
18251         ret_val = xmlBufferCreate();
18252         desret_xmlBufferPtr(ret_val);
18253         call_tests++;
18254         xmlResetLastError();
18255         if (mem_base != xmlMemBlocks()) {
18256             printf("Leak of %d blocks found in xmlBufferCreate",
18257 	           xmlMemBlocks() - mem_base);
18258 	    test_ret++;
18259             printf("\n");
18260         }
18261     function_tests++;
18262 
18263     return(test_ret);
18264 }
18265 
18266 
18267 static int
test_xmlBufferCreateSize(void)18268 test_xmlBufferCreateSize(void) {
18269     int test_ret = 0;
18270 
18271 
18272     /* missing type support */
18273     return(test_ret);
18274 }
18275 
18276 
18277 static int
test_xmlBufferCreateStatic(void)18278 test_xmlBufferCreateStatic(void) {
18279     int test_ret = 0;
18280 
18281 
18282     /* missing type support */
18283     return(test_ret);
18284 }
18285 
18286 
18287 static int
test_xmlBufferDetach(void)18288 test_xmlBufferDetach(void) {
18289     int test_ret = 0;
18290 
18291     int mem_base;
18292     xmlChar * ret_val;
18293     xmlBufferPtr buf; /* the buffer */
18294     int n_buf;
18295 
18296     for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
18297         mem_base = xmlMemBlocks();
18298         buf = gen_xmlBufferPtr(n_buf, 0);
18299 
18300         ret_val = xmlBufferDetach(buf);
18301         desret_xmlChar_ptr(ret_val);
18302         call_tests++;
18303         des_xmlBufferPtr(n_buf, buf, 0);
18304         xmlResetLastError();
18305         if (mem_base != xmlMemBlocks()) {
18306             printf("Leak of %d blocks found in xmlBufferDetach",
18307 	           xmlMemBlocks() - mem_base);
18308 	    test_ret++;
18309             printf(" %d", n_buf);
18310             printf("\n");
18311         }
18312     }
18313     function_tests++;
18314 
18315     return(test_ret);
18316 }
18317 
18318 
18319 static int
test_xmlBufferEmpty(void)18320 test_xmlBufferEmpty(void) {
18321     int test_ret = 0;
18322 
18323     int mem_base;
18324     xmlBufferPtr buf; /* the buffer */
18325     int n_buf;
18326 
18327     for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
18328         mem_base = xmlMemBlocks();
18329         buf = gen_xmlBufferPtr(n_buf, 0);
18330 
18331         xmlBufferEmpty(buf);
18332         call_tests++;
18333         des_xmlBufferPtr(n_buf, buf, 0);
18334         xmlResetLastError();
18335         if (mem_base != xmlMemBlocks()) {
18336             printf("Leak of %d blocks found in xmlBufferEmpty",
18337 	           xmlMemBlocks() - mem_base);
18338 	    test_ret++;
18339             printf(" %d", n_buf);
18340             printf("\n");
18341         }
18342     }
18343     function_tests++;
18344 
18345     return(test_ret);
18346 }
18347 
18348 
18349 static int
test_xmlBufferGrow(void)18350 test_xmlBufferGrow(void) {
18351     int test_ret = 0;
18352 
18353     int mem_base;
18354     int ret_val;
18355     xmlBufferPtr buf; /* the buffer */
18356     int n_buf;
18357     unsigned int len; /* the minimum free size to allocate */
18358     int n_len;
18359 
18360     for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
18361     for (n_len = 0;n_len < gen_nb_unsigned_int;n_len++) {
18362         mem_base = xmlMemBlocks();
18363         buf = gen_xmlBufferPtr(n_buf, 0);
18364         len = gen_unsigned_int(n_len, 1);
18365 
18366         ret_val = xmlBufferGrow(buf, len);
18367         desret_int(ret_val);
18368         call_tests++;
18369         des_xmlBufferPtr(n_buf, buf, 0);
18370         des_unsigned_int(n_len, len, 1);
18371         xmlResetLastError();
18372         if (mem_base != xmlMemBlocks()) {
18373             printf("Leak of %d blocks found in xmlBufferGrow",
18374 	           xmlMemBlocks() - mem_base);
18375 	    test_ret++;
18376             printf(" %d", n_buf);
18377             printf(" %d", n_len);
18378             printf("\n");
18379         }
18380     }
18381     }
18382     function_tests++;
18383 
18384     return(test_ret);
18385 }
18386 
18387 
18388 static int
test_xmlBufferLength(void)18389 test_xmlBufferLength(void) {
18390     int test_ret = 0;
18391 
18392     int mem_base;
18393     int ret_val;
18394     const xmlBuffer * buf; /* the buffer */
18395     int n_buf;
18396 
18397     for (n_buf = 0;n_buf < gen_nb_const_xmlBuffer_ptr;n_buf++) {
18398         mem_base = xmlMemBlocks();
18399         buf = gen_const_xmlBuffer_ptr(n_buf, 0);
18400 
18401         ret_val = xmlBufferLength(buf);
18402         desret_int(ret_val);
18403         call_tests++;
18404         des_const_xmlBuffer_ptr(n_buf, buf, 0);
18405         xmlResetLastError();
18406         if (mem_base != xmlMemBlocks()) {
18407             printf("Leak of %d blocks found in xmlBufferLength",
18408 	           xmlMemBlocks() - mem_base);
18409 	    test_ret++;
18410             printf(" %d", n_buf);
18411             printf("\n");
18412         }
18413     }
18414     function_tests++;
18415 
18416     return(test_ret);
18417 }
18418 
18419 
18420 static int
test_xmlBufferResize(void)18421 test_xmlBufferResize(void) {
18422     int test_ret = 0;
18423 
18424     int mem_base;
18425     int ret_val;
18426     xmlBufferPtr buf; /* the buffer to resize */
18427     int n_buf;
18428     unsigned int size; /* the desired size */
18429     int n_size;
18430 
18431     for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
18432     for (n_size = 0;n_size < gen_nb_unsigned_int;n_size++) {
18433         mem_base = xmlMemBlocks();
18434         buf = gen_xmlBufferPtr(n_buf, 0);
18435         size = gen_unsigned_int(n_size, 1);
18436 
18437         ret_val = xmlBufferResize(buf, size);
18438         desret_int(ret_val);
18439         call_tests++;
18440         des_xmlBufferPtr(n_buf, buf, 0);
18441         des_unsigned_int(n_size, size, 1);
18442         xmlResetLastError();
18443         if (mem_base != xmlMemBlocks()) {
18444             printf("Leak of %d blocks found in xmlBufferResize",
18445 	           xmlMemBlocks() - mem_base);
18446 	    test_ret++;
18447             printf(" %d", n_buf);
18448             printf(" %d", n_size);
18449             printf("\n");
18450         }
18451     }
18452     }
18453     function_tests++;
18454 
18455     return(test_ret);
18456 }
18457 
18458 
18459 static int
test_xmlBufferSetAllocationScheme(void)18460 test_xmlBufferSetAllocationScheme(void) {
18461     int test_ret = 0;
18462 
18463     int mem_base;
18464     xmlBufferPtr buf; /* the buffer to tune */
18465     int n_buf;
18466     xmlBufferAllocationScheme scheme; /* allocation scheme to use */
18467     int n_scheme;
18468 
18469     for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
18470     for (n_scheme = 0;n_scheme < gen_nb_xmlBufferAllocationScheme;n_scheme++) {
18471         mem_base = xmlMemBlocks();
18472         buf = gen_xmlBufferPtr(n_buf, 0);
18473         scheme = gen_xmlBufferAllocationScheme(n_scheme, 1);
18474 
18475         xmlBufferSetAllocationScheme(buf, scheme);
18476         call_tests++;
18477         des_xmlBufferPtr(n_buf, buf, 0);
18478         des_xmlBufferAllocationScheme(n_scheme, scheme, 1);
18479         xmlResetLastError();
18480         if (mem_base != xmlMemBlocks()) {
18481             printf("Leak of %d blocks found in xmlBufferSetAllocationScheme",
18482 	           xmlMemBlocks() - mem_base);
18483 	    test_ret++;
18484             printf(" %d", n_buf);
18485             printf(" %d", n_scheme);
18486             printf("\n");
18487         }
18488     }
18489     }
18490     function_tests++;
18491 
18492     return(test_ret);
18493 }
18494 
18495 
18496 static int
test_xmlBufferShrink(void)18497 test_xmlBufferShrink(void) {
18498     int test_ret = 0;
18499 
18500     int mem_base;
18501     int ret_val;
18502     xmlBufferPtr buf; /* the buffer to dump */
18503     int n_buf;
18504     unsigned int len; /* the number of xmlChar to remove */
18505     int n_len;
18506 
18507     for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
18508     for (n_len = 0;n_len < gen_nb_unsigned_int;n_len++) {
18509         mem_base = xmlMemBlocks();
18510         buf = gen_xmlBufferPtr(n_buf, 0);
18511         len = gen_unsigned_int(n_len, 1);
18512 
18513         ret_val = xmlBufferShrink(buf, len);
18514         desret_int(ret_val);
18515         call_tests++;
18516         des_xmlBufferPtr(n_buf, buf, 0);
18517         des_unsigned_int(n_len, len, 1);
18518         xmlResetLastError();
18519         if (mem_base != xmlMemBlocks()) {
18520             printf("Leak of %d blocks found in xmlBufferShrink",
18521 	           xmlMemBlocks() - mem_base);
18522 	    test_ret++;
18523             printf(" %d", n_buf);
18524             printf(" %d", n_len);
18525             printf("\n");
18526         }
18527     }
18528     }
18529     function_tests++;
18530 
18531     return(test_ret);
18532 }
18533 
18534 
18535 static int
test_xmlBufferWriteCHAR(void)18536 test_xmlBufferWriteCHAR(void) {
18537     int test_ret = 0;
18538 
18539     int mem_base;
18540     xmlBufferPtr buf; /* the XML buffer */
18541     int n_buf;
18542     const xmlChar * string; /* the string to add */
18543     int n_string;
18544 
18545     for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
18546     for (n_string = 0;n_string < gen_nb_const_xmlChar_ptr;n_string++) {
18547         mem_base = xmlMemBlocks();
18548         buf = gen_xmlBufferPtr(n_buf, 0);
18549         string = gen_const_xmlChar_ptr(n_string, 1);
18550 
18551         xmlBufferWriteCHAR(buf, string);
18552         call_tests++;
18553         des_xmlBufferPtr(n_buf, buf, 0);
18554         des_const_xmlChar_ptr(n_string, string, 1);
18555         xmlResetLastError();
18556         if (mem_base != xmlMemBlocks()) {
18557             printf("Leak of %d blocks found in xmlBufferWriteCHAR",
18558 	           xmlMemBlocks() - mem_base);
18559 	    test_ret++;
18560             printf(" %d", n_buf);
18561             printf(" %d", n_string);
18562             printf("\n");
18563         }
18564     }
18565     }
18566     function_tests++;
18567 
18568     return(test_ret);
18569 }
18570 
18571 
18572 static int
test_xmlBufferWriteChar(void)18573 test_xmlBufferWriteChar(void) {
18574     int test_ret = 0;
18575 
18576     int mem_base;
18577     xmlBufferPtr buf; /* the XML buffer output */
18578     int n_buf;
18579     const char * string; /* the string to add */
18580     int n_string;
18581 
18582     for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
18583     for (n_string = 0;n_string < gen_nb_const_char_ptr;n_string++) {
18584         mem_base = xmlMemBlocks();
18585         buf = gen_xmlBufferPtr(n_buf, 0);
18586         string = gen_const_char_ptr(n_string, 1);
18587 
18588         xmlBufferWriteChar(buf, string);
18589         call_tests++;
18590         des_xmlBufferPtr(n_buf, buf, 0);
18591         des_const_char_ptr(n_string, string, 1);
18592         xmlResetLastError();
18593         if (mem_base != xmlMemBlocks()) {
18594             printf("Leak of %d blocks found in xmlBufferWriteChar",
18595 	           xmlMemBlocks() - mem_base);
18596 	    test_ret++;
18597             printf(" %d", n_buf);
18598             printf(" %d", n_string);
18599             printf("\n");
18600         }
18601     }
18602     }
18603     function_tests++;
18604 
18605     return(test_ret);
18606 }
18607 
18608 
18609 static int
test_xmlBufferWriteQuotedString(void)18610 test_xmlBufferWriteQuotedString(void) {
18611     int test_ret = 0;
18612 
18613     int mem_base;
18614     xmlBufferPtr buf; /* the XML buffer output */
18615     int n_buf;
18616     const xmlChar * string; /* the string to add */
18617     int n_string;
18618 
18619     for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
18620     for (n_string = 0;n_string < gen_nb_const_xmlChar_ptr;n_string++) {
18621         mem_base = xmlMemBlocks();
18622         buf = gen_xmlBufferPtr(n_buf, 0);
18623         string = gen_const_xmlChar_ptr(n_string, 1);
18624 
18625         xmlBufferWriteQuotedString(buf, string);
18626         call_tests++;
18627         des_xmlBufferPtr(n_buf, buf, 0);
18628         des_const_xmlChar_ptr(n_string, string, 1);
18629         xmlResetLastError();
18630         if (mem_base != xmlMemBlocks()) {
18631             printf("Leak of %d blocks found in xmlBufferWriteQuotedString",
18632 	           xmlMemBlocks() - mem_base);
18633 	    test_ret++;
18634             printf(" %d", n_buf);
18635             printf(" %d", n_string);
18636             printf("\n");
18637         }
18638     }
18639     }
18640     function_tests++;
18641 
18642     return(test_ret);
18643 }
18644 
18645 
18646 static int
test_xmlBuildQName(void)18647 test_xmlBuildQName(void) {
18648     int test_ret = 0;
18649 
18650     int mem_base;
18651     xmlChar * ret_val;
18652     const xmlChar * ncname; /* the Name */
18653     int n_ncname;
18654     const xmlChar * prefix; /* the prefix */
18655     int n_prefix;
18656     xmlChar * memory; /* preallocated memory */
18657     int n_memory;
18658     int len; /* preallocated memory length */
18659     int n_len;
18660 
18661     for (n_ncname = 0;n_ncname < gen_nb_const_xmlChar_ptr;n_ncname++) {
18662     for (n_prefix = 0;n_prefix < gen_nb_const_xmlChar_ptr;n_prefix++) {
18663     for (n_memory = 0;n_memory < gen_nb_xmlChar_ptr;n_memory++) {
18664     for (n_len = 0;n_len < gen_nb_int;n_len++) {
18665         mem_base = xmlMemBlocks();
18666         ncname = gen_const_xmlChar_ptr(n_ncname, 0);
18667         prefix = gen_const_xmlChar_ptr(n_prefix, 1);
18668         memory = gen_xmlChar_ptr(n_memory, 2);
18669         len = gen_int(n_len, 3);
18670         if ((prefix != NULL) &&
18671             (len > xmlStrlen(BAD_CAST prefix)))
18672             len = 0;
18673 
18674         ret_val = xmlBuildQName(ncname, prefix, memory, len);
18675         if ((ret_val != NULL) && (ret_val != ncname) &&
18676               (ret_val != prefix) && (ret_val != memory))
18677               xmlFree(ret_val);
18678 	  ret_val = NULL;
18679         desret_xmlChar_ptr(ret_val);
18680         call_tests++;
18681         des_const_xmlChar_ptr(n_ncname, ncname, 0);
18682         des_const_xmlChar_ptr(n_prefix, prefix, 1);
18683         des_xmlChar_ptr(n_memory, memory, 2);
18684         des_int(n_len, len, 3);
18685         xmlResetLastError();
18686         if (mem_base != xmlMemBlocks()) {
18687             printf("Leak of %d blocks found in xmlBuildQName",
18688 	           xmlMemBlocks() - mem_base);
18689 	    test_ret++;
18690             printf(" %d", n_ncname);
18691             printf(" %d", n_prefix);
18692             printf(" %d", n_memory);
18693             printf(" %d", n_len);
18694             printf("\n");
18695         }
18696     }
18697     }
18698     }
18699     }
18700     function_tests++;
18701 
18702     return(test_ret);
18703 }
18704 
18705 
18706 static int
test_xmlChildElementCount(void)18707 test_xmlChildElementCount(void) {
18708     int test_ret = 0;
18709 
18710 #if defined(LIBXML_TREE_ENABLED)
18711     int mem_base;
18712     unsigned long ret_val;
18713     xmlNodePtr parent; /* the parent node */
18714     int n_parent;
18715 
18716     for (n_parent = 0;n_parent < gen_nb_xmlNodePtr;n_parent++) {
18717         mem_base = xmlMemBlocks();
18718         parent = gen_xmlNodePtr(n_parent, 0);
18719 
18720         ret_val = xmlChildElementCount(parent);
18721         desret_unsigned_long(ret_val);
18722         call_tests++;
18723         des_xmlNodePtr(n_parent, parent, 0);
18724         xmlResetLastError();
18725         if (mem_base != xmlMemBlocks()) {
18726             printf("Leak of %d blocks found in xmlChildElementCount",
18727 	           xmlMemBlocks() - mem_base);
18728 	    test_ret++;
18729             printf(" %d", n_parent);
18730             printf("\n");
18731         }
18732     }
18733     function_tests++;
18734 #endif
18735 
18736     return(test_ret);
18737 }
18738 
18739 
18740 static int
test_xmlCopyDoc(void)18741 test_xmlCopyDoc(void) {
18742     int test_ret = 0;
18743 
18744 #if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED)
18745     int mem_base;
18746     xmlDocPtr ret_val;
18747     xmlDocPtr doc; /* the document */
18748     int n_doc;
18749     int recursive; /* if not zero do a recursive copy. */
18750     int n_recursive;
18751 
18752     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
18753     for (n_recursive = 0;n_recursive < gen_nb_int;n_recursive++) {
18754         mem_base = xmlMemBlocks();
18755         doc = gen_xmlDocPtr(n_doc, 0);
18756         recursive = gen_int(n_recursive, 1);
18757 
18758         ret_val = xmlCopyDoc(doc, recursive);
18759         desret_xmlDocPtr(ret_val);
18760         call_tests++;
18761         des_xmlDocPtr(n_doc, doc, 0);
18762         des_int(n_recursive, recursive, 1);
18763         xmlResetLastError();
18764         if (mem_base != xmlMemBlocks()) {
18765             printf("Leak of %d blocks found in xmlCopyDoc",
18766 	           xmlMemBlocks() - mem_base);
18767 	    test_ret++;
18768             printf(" %d", n_doc);
18769             printf(" %d", n_recursive);
18770             printf("\n");
18771         }
18772     }
18773     }
18774     function_tests++;
18775 #endif
18776 
18777     return(test_ret);
18778 }
18779 
18780 
18781 static int
test_xmlCopyDtd(void)18782 test_xmlCopyDtd(void) {
18783     int test_ret = 0;
18784 
18785 #if defined(LIBXML_TREE_ENABLED)
18786     int mem_base;
18787     xmlDtdPtr ret_val;
18788     xmlDtdPtr dtd; /* the dtd */
18789     int n_dtd;
18790 
18791     for (n_dtd = 0;n_dtd < gen_nb_xmlDtdPtr;n_dtd++) {
18792         mem_base = xmlMemBlocks();
18793         dtd = gen_xmlDtdPtr(n_dtd, 0);
18794 
18795         ret_val = xmlCopyDtd(dtd);
18796         desret_xmlDtdPtr(ret_val);
18797         call_tests++;
18798         des_xmlDtdPtr(n_dtd, dtd, 0);
18799         xmlResetLastError();
18800         if (mem_base != xmlMemBlocks()) {
18801             printf("Leak of %d blocks found in xmlCopyDtd",
18802 	           xmlMemBlocks() - mem_base);
18803 	    test_ret++;
18804             printf(" %d", n_dtd);
18805             printf("\n");
18806         }
18807     }
18808     function_tests++;
18809 #endif
18810 
18811     return(test_ret);
18812 }
18813 
18814 
18815 static int
test_xmlCopyNamespace(void)18816 test_xmlCopyNamespace(void) {
18817     int test_ret = 0;
18818 
18819     int mem_base;
18820     xmlNsPtr ret_val;
18821     xmlNsPtr cur; /* the namespace */
18822     int n_cur;
18823 
18824     for (n_cur = 0;n_cur < gen_nb_xmlNsPtr;n_cur++) {
18825         mem_base = xmlMemBlocks();
18826         cur = gen_xmlNsPtr(n_cur, 0);
18827 
18828         ret_val = xmlCopyNamespace(cur);
18829         if (ret_val != NULL) xmlFreeNs(ret_val);
18830         desret_xmlNsPtr(ret_val);
18831         call_tests++;
18832         des_xmlNsPtr(n_cur, cur, 0);
18833         xmlResetLastError();
18834         if (mem_base != xmlMemBlocks()) {
18835             printf("Leak of %d blocks found in xmlCopyNamespace",
18836 	           xmlMemBlocks() - mem_base);
18837 	    test_ret++;
18838             printf(" %d", n_cur);
18839             printf("\n");
18840         }
18841     }
18842     function_tests++;
18843 
18844     return(test_ret);
18845 }
18846 
18847 
18848 static int
test_xmlCopyNamespaceList(void)18849 test_xmlCopyNamespaceList(void) {
18850     int test_ret = 0;
18851 
18852     int mem_base;
18853     xmlNsPtr ret_val;
18854     xmlNsPtr cur; /* the first namespace */
18855     int n_cur;
18856 
18857     for (n_cur = 0;n_cur < gen_nb_xmlNsPtr;n_cur++) {
18858         mem_base = xmlMemBlocks();
18859         cur = gen_xmlNsPtr(n_cur, 0);
18860 
18861         ret_val = xmlCopyNamespaceList(cur);
18862         if (ret_val != NULL) xmlFreeNsList(ret_val);
18863         desret_xmlNsPtr(ret_val);
18864         call_tests++;
18865         des_xmlNsPtr(n_cur, cur, 0);
18866         xmlResetLastError();
18867         if (mem_base != xmlMemBlocks()) {
18868             printf("Leak of %d blocks found in xmlCopyNamespaceList",
18869 	           xmlMemBlocks() - mem_base);
18870 	    test_ret++;
18871             printf(" %d", n_cur);
18872             printf("\n");
18873         }
18874     }
18875     function_tests++;
18876 
18877     return(test_ret);
18878 }
18879 
18880 
18881 static int
test_xmlCopyNode(void)18882 test_xmlCopyNode(void) {
18883     int test_ret = 0;
18884 
18885     int mem_base;
18886     xmlNodePtr ret_val;
18887     xmlNodePtr node; /* the node */
18888     int n_node;
18889     int extended; /* if 1 do a recursive copy (properties, namespaces and children when applicable) if 2 copy properties and namespaces (when applicable) */
18890     int n_extended;
18891 
18892     for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
18893     for (n_extended = 0;n_extended < gen_nb_int;n_extended++) {
18894         mem_base = xmlMemBlocks();
18895         node = gen_xmlNodePtr(n_node, 0);
18896         extended = gen_int(n_extended, 1);
18897 
18898         ret_val = xmlCopyNode(node, extended);
18899         desret_xmlNodePtr(ret_val);
18900         call_tests++;
18901         des_xmlNodePtr(n_node, node, 0);
18902         des_int(n_extended, extended, 1);
18903         xmlResetLastError();
18904         if (mem_base != xmlMemBlocks()) {
18905             printf("Leak of %d blocks found in xmlCopyNode",
18906 	           xmlMemBlocks() - mem_base);
18907 	    test_ret++;
18908             printf(" %d", n_node);
18909             printf(" %d", n_extended);
18910             printf("\n");
18911         }
18912     }
18913     }
18914     function_tests++;
18915 
18916     return(test_ret);
18917 }
18918 
18919 
18920 static int
test_xmlCopyNodeList(void)18921 test_xmlCopyNodeList(void) {
18922     int test_ret = 0;
18923 
18924     int mem_base;
18925     xmlNodePtr ret_val;
18926     xmlNodePtr node; /* the first node in the list. */
18927     int n_node;
18928 
18929     for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
18930         mem_base = xmlMemBlocks();
18931         node = gen_xmlNodePtr(n_node, 0);
18932 
18933         ret_val = xmlCopyNodeList(node);
18934         desret_xmlNodePtr(ret_val);
18935         call_tests++;
18936         des_xmlNodePtr(n_node, node, 0);
18937         xmlResetLastError();
18938         if (mem_base != xmlMemBlocks()) {
18939             printf("Leak of %d blocks found in xmlCopyNodeList",
18940 	           xmlMemBlocks() - mem_base);
18941 	    test_ret++;
18942             printf(" %d", n_node);
18943             printf("\n");
18944         }
18945     }
18946     function_tests++;
18947 
18948     return(test_ret);
18949 }
18950 
18951 
18952 static int
test_xmlCopyProp(void)18953 test_xmlCopyProp(void) {
18954     int test_ret = 0;
18955 
18956     int mem_base;
18957     xmlAttrPtr ret_val;
18958     xmlNodePtr target; /* the element where the attribute will be grafted */
18959     int n_target;
18960     xmlAttrPtr cur; /* the attribute */
18961     int n_cur;
18962 
18963     for (n_target = 0;n_target < gen_nb_xmlNodePtr;n_target++) {
18964     for (n_cur = 0;n_cur < gen_nb_xmlAttrPtr;n_cur++) {
18965         mem_base = xmlMemBlocks();
18966         target = gen_xmlNodePtr(n_target, 0);
18967         cur = gen_xmlAttrPtr(n_cur, 1);
18968 
18969         ret_val = xmlCopyProp(target, cur);
18970         desret_xmlAttrPtr(ret_val);
18971         call_tests++;
18972         des_xmlNodePtr(n_target, target, 0);
18973         des_xmlAttrPtr(n_cur, cur, 1);
18974         xmlResetLastError();
18975         if (mem_base != xmlMemBlocks()) {
18976             printf("Leak of %d blocks found in xmlCopyProp",
18977 	           xmlMemBlocks() - mem_base);
18978 	    test_ret++;
18979             printf(" %d", n_target);
18980             printf(" %d", n_cur);
18981             printf("\n");
18982         }
18983     }
18984     }
18985     function_tests++;
18986 
18987     return(test_ret);
18988 }
18989 
18990 
18991 static int
test_xmlCopyPropList(void)18992 test_xmlCopyPropList(void) {
18993     int test_ret = 0;
18994 
18995     int mem_base;
18996     xmlAttrPtr ret_val;
18997     xmlNodePtr target; /* the element where the attributes will be grafted */
18998     int n_target;
18999     xmlAttrPtr cur; /* the first attribute */
19000     int n_cur;
19001 
19002     for (n_target = 0;n_target < gen_nb_xmlNodePtr;n_target++) {
19003     for (n_cur = 0;n_cur < gen_nb_xmlAttrPtr;n_cur++) {
19004         mem_base = xmlMemBlocks();
19005         target = gen_xmlNodePtr(n_target, 0);
19006         cur = gen_xmlAttrPtr(n_cur, 1);
19007 
19008         ret_val = xmlCopyPropList(target, cur);
19009         desret_xmlAttrPtr(ret_val);
19010         call_tests++;
19011         des_xmlNodePtr(n_target, target, 0);
19012         des_xmlAttrPtr(n_cur, cur, 1);
19013         xmlResetLastError();
19014         if (mem_base != xmlMemBlocks()) {
19015             printf("Leak of %d blocks found in xmlCopyPropList",
19016 	           xmlMemBlocks() - mem_base);
19017 	    test_ret++;
19018             printf(" %d", n_target);
19019             printf(" %d", n_cur);
19020             printf("\n");
19021         }
19022     }
19023     }
19024     function_tests++;
19025 
19026     return(test_ret);
19027 }
19028 
19029 
19030 static int
test_xmlCreateIntSubset(void)19031 test_xmlCreateIntSubset(void) {
19032     int test_ret = 0;
19033 
19034     int mem_base;
19035     xmlDtdPtr ret_val;
19036     xmlDocPtr doc; /* the document pointer */
19037     int n_doc;
19038     const xmlChar * name; /* the DTD name */
19039     int n_name;
19040     const xmlChar * ExternalID; /* the external (PUBLIC) ID */
19041     int n_ExternalID;
19042     const xmlChar * SystemID; /* the system ID */
19043     int n_SystemID;
19044 
19045     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
19046     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
19047     for (n_ExternalID = 0;n_ExternalID < gen_nb_const_xmlChar_ptr;n_ExternalID++) {
19048     for (n_SystemID = 0;n_SystemID < gen_nb_const_xmlChar_ptr;n_SystemID++) {
19049         mem_base = xmlMemBlocks();
19050         doc = gen_xmlDocPtr(n_doc, 0);
19051         name = gen_const_xmlChar_ptr(n_name, 1);
19052         ExternalID = gen_const_xmlChar_ptr(n_ExternalID, 2);
19053         SystemID = gen_const_xmlChar_ptr(n_SystemID, 3);
19054 
19055         ret_val = xmlCreateIntSubset(doc, name, ExternalID, SystemID);
19056         desret_xmlDtdPtr(ret_val);
19057         call_tests++;
19058         des_xmlDocPtr(n_doc, doc, 0);
19059         des_const_xmlChar_ptr(n_name, name, 1);
19060         des_const_xmlChar_ptr(n_ExternalID, ExternalID, 2);
19061         des_const_xmlChar_ptr(n_SystemID, SystemID, 3);
19062         xmlResetLastError();
19063         if (mem_base != xmlMemBlocks()) {
19064             printf("Leak of %d blocks found in xmlCreateIntSubset",
19065 	           xmlMemBlocks() - mem_base);
19066 	    test_ret++;
19067             printf(" %d", n_doc);
19068             printf(" %d", n_name);
19069             printf(" %d", n_ExternalID);
19070             printf(" %d", n_SystemID);
19071             printf("\n");
19072         }
19073     }
19074     }
19075     }
19076     }
19077     function_tests++;
19078 
19079     return(test_ret);
19080 }
19081 
19082 
19083 #define gen_nb_xmlDOMWrapCtxtPtr 1
19084 #define gen_xmlDOMWrapCtxtPtr(no, nr) NULL
19085 #define des_xmlDOMWrapCtxtPtr(no, val, nr)
19086 
19087 static int
test_xmlDOMWrapAdoptNode(void)19088 test_xmlDOMWrapAdoptNode(void) {
19089     int test_ret = 0;
19090 
19091     int mem_base;
19092     int ret_val;
19093     xmlDOMWrapCtxtPtr ctxt; /* the optional context for custom processing */
19094     int n_ctxt;
19095     xmlDocPtr sourceDoc; /* the optional sourceDoc */
19096     int n_sourceDoc;
19097     xmlNodePtr node; /* the node to start with */
19098     int n_node;
19099     xmlDocPtr destDoc; /* the destination doc */
19100     int n_destDoc;
19101     xmlNodePtr destParent; /* the optional new parent of @node in @destDoc */
19102     int n_destParent;
19103     int options; /* option flags */
19104     int n_options;
19105 
19106     for (n_ctxt = 0;n_ctxt < gen_nb_xmlDOMWrapCtxtPtr;n_ctxt++) {
19107     for (n_sourceDoc = 0;n_sourceDoc < gen_nb_xmlDocPtr;n_sourceDoc++) {
19108     for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
19109     for (n_destDoc = 0;n_destDoc < gen_nb_xmlDocPtr;n_destDoc++) {
19110     for (n_destParent = 0;n_destParent < gen_nb_xmlNodePtr;n_destParent++) {
19111     for (n_options = 0;n_options < gen_nb_int;n_options++) {
19112         mem_base = xmlMemBlocks();
19113         ctxt = gen_xmlDOMWrapCtxtPtr(n_ctxt, 0);
19114         sourceDoc = gen_xmlDocPtr(n_sourceDoc, 1);
19115         node = gen_xmlNodePtr(n_node, 2);
19116         destDoc = gen_xmlDocPtr(n_destDoc, 3);
19117         destParent = gen_xmlNodePtr(n_destParent, 4);
19118         options = gen_int(n_options, 5);
19119 
19120         ret_val = xmlDOMWrapAdoptNode(ctxt, sourceDoc, node, destDoc, destParent, options);
19121         if ((node != NULL) && (node->parent == NULL)) {xmlUnlinkNode(node);xmlFreeNode(node);node = NULL;}
19122         desret_int(ret_val);
19123         call_tests++;
19124         des_xmlDOMWrapCtxtPtr(n_ctxt, ctxt, 0);
19125         des_xmlDocPtr(n_sourceDoc, sourceDoc, 1);
19126         des_xmlNodePtr(n_node, node, 2);
19127         des_xmlDocPtr(n_destDoc, destDoc, 3);
19128         des_xmlNodePtr(n_destParent, destParent, 4);
19129         des_int(n_options, options, 5);
19130         xmlResetLastError();
19131         if (mem_base != xmlMemBlocks()) {
19132             printf("Leak of %d blocks found in xmlDOMWrapAdoptNode",
19133 	           xmlMemBlocks() - mem_base);
19134 	    test_ret++;
19135             printf(" %d", n_ctxt);
19136             printf(" %d", n_sourceDoc);
19137             printf(" %d", n_node);
19138             printf(" %d", n_destDoc);
19139             printf(" %d", n_destParent);
19140             printf(" %d", n_options);
19141             printf("\n");
19142         }
19143     }
19144     }
19145     }
19146     }
19147     }
19148     }
19149     function_tests++;
19150 
19151     return(test_ret);
19152 }
19153 
19154 
19155 static int
test_xmlDOMWrapCloneNode(void)19156 test_xmlDOMWrapCloneNode(void) {
19157     int test_ret = 0;
19158 
19159     int mem_base;
19160     int ret_val;
19161     xmlDOMWrapCtxtPtr ctxt; /* the optional context for custom processing */
19162     int n_ctxt;
19163     xmlDocPtr sourceDoc; /* the optional sourceDoc */
19164     int n_sourceDoc;
19165     xmlNodePtr node; /* the node to start with */
19166     int n_node;
19167     xmlNodePtr * resNode; /* the clone of the given @node */
19168     int n_resNode;
19169     xmlDocPtr destDoc; /* the destination doc */
19170     int n_destDoc;
19171     xmlNodePtr destParent; /* the optional new parent of @node in @destDoc */
19172     int n_destParent;
19173     int deep; /* descend into child if set */
19174     int n_deep;
19175     int options; /* option flags */
19176     int n_options;
19177 
19178     for (n_ctxt = 0;n_ctxt < gen_nb_xmlDOMWrapCtxtPtr;n_ctxt++) {
19179     for (n_sourceDoc = 0;n_sourceDoc < gen_nb_xmlDocPtr;n_sourceDoc++) {
19180     for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
19181     for (n_resNode = 0;n_resNode < gen_nb_xmlNodePtr_ptr;n_resNode++) {
19182     for (n_destDoc = 0;n_destDoc < gen_nb_xmlDocPtr;n_destDoc++) {
19183     for (n_destParent = 0;n_destParent < gen_nb_xmlNodePtr;n_destParent++) {
19184     for (n_deep = 0;n_deep < gen_nb_int;n_deep++) {
19185     for (n_options = 0;n_options < gen_nb_int;n_options++) {
19186         mem_base = xmlMemBlocks();
19187         ctxt = gen_xmlDOMWrapCtxtPtr(n_ctxt, 0);
19188         sourceDoc = gen_xmlDocPtr(n_sourceDoc, 1);
19189         node = gen_xmlNodePtr(n_node, 2);
19190         resNode = gen_xmlNodePtr_ptr(n_resNode, 3);
19191         destDoc = gen_xmlDocPtr(n_destDoc, 4);
19192         destParent = gen_xmlNodePtr(n_destParent, 5);
19193         deep = gen_int(n_deep, 6);
19194         options = gen_int(n_options, 7);
19195 
19196         ret_val = xmlDOMWrapCloneNode(ctxt, sourceDoc, node, resNode, destDoc, destParent, deep, options);
19197         desret_int(ret_val);
19198         call_tests++;
19199         des_xmlDOMWrapCtxtPtr(n_ctxt, ctxt, 0);
19200         des_xmlDocPtr(n_sourceDoc, sourceDoc, 1);
19201         des_xmlNodePtr(n_node, node, 2);
19202         des_xmlNodePtr_ptr(n_resNode, resNode, 3);
19203         des_xmlDocPtr(n_destDoc, destDoc, 4);
19204         des_xmlNodePtr(n_destParent, destParent, 5);
19205         des_int(n_deep, deep, 6);
19206         des_int(n_options, options, 7);
19207         xmlResetLastError();
19208         if (mem_base != xmlMemBlocks()) {
19209             printf("Leak of %d blocks found in xmlDOMWrapCloneNode",
19210 	           xmlMemBlocks() - mem_base);
19211 	    test_ret++;
19212             printf(" %d", n_ctxt);
19213             printf(" %d", n_sourceDoc);
19214             printf(" %d", n_node);
19215             printf(" %d", n_resNode);
19216             printf(" %d", n_destDoc);
19217             printf(" %d", n_destParent);
19218             printf(" %d", n_deep);
19219             printf(" %d", n_options);
19220             printf("\n");
19221         }
19222     }
19223     }
19224     }
19225     }
19226     }
19227     }
19228     }
19229     }
19230     function_tests++;
19231 
19232     return(test_ret);
19233 }
19234 
19235 
19236 static int
test_xmlDOMWrapNewCtxt(void)19237 test_xmlDOMWrapNewCtxt(void) {
19238     int test_ret = 0;
19239 
19240 
19241     /* missing type support */
19242     return(test_ret);
19243 }
19244 
19245 
19246 static int
test_xmlDOMWrapReconcileNamespaces(void)19247 test_xmlDOMWrapReconcileNamespaces(void) {
19248     int test_ret = 0;
19249 
19250     int mem_base;
19251     int ret_val;
19252     xmlDOMWrapCtxtPtr ctxt; /* DOM wrapper context, unused at the moment */
19253     int n_ctxt;
19254     xmlNodePtr elem; /* the element-node */
19255     int n_elem;
19256     int options; /* option flags */
19257     int n_options;
19258 
19259     for (n_ctxt = 0;n_ctxt < gen_nb_xmlDOMWrapCtxtPtr;n_ctxt++) {
19260     for (n_elem = 0;n_elem < gen_nb_xmlNodePtr;n_elem++) {
19261     for (n_options = 0;n_options < gen_nb_int;n_options++) {
19262         mem_base = xmlMemBlocks();
19263         ctxt = gen_xmlDOMWrapCtxtPtr(n_ctxt, 0);
19264         elem = gen_xmlNodePtr(n_elem, 1);
19265         options = gen_int(n_options, 2);
19266 
19267         ret_val = xmlDOMWrapReconcileNamespaces(ctxt, elem, options);
19268         desret_int(ret_val);
19269         call_tests++;
19270         des_xmlDOMWrapCtxtPtr(n_ctxt, ctxt, 0);
19271         des_xmlNodePtr(n_elem, elem, 1);
19272         des_int(n_options, options, 2);
19273         xmlResetLastError();
19274         if (mem_base != xmlMemBlocks()) {
19275             printf("Leak of %d blocks found in xmlDOMWrapReconcileNamespaces",
19276 	           xmlMemBlocks() - mem_base);
19277 	    test_ret++;
19278             printf(" %d", n_ctxt);
19279             printf(" %d", n_elem);
19280             printf(" %d", n_options);
19281             printf("\n");
19282         }
19283     }
19284     }
19285     }
19286     function_tests++;
19287 
19288     return(test_ret);
19289 }
19290 
19291 
19292 static int
test_xmlDOMWrapRemoveNode(void)19293 test_xmlDOMWrapRemoveNode(void) {
19294     int test_ret = 0;
19295 
19296     int mem_base;
19297     int ret_val;
19298     xmlDOMWrapCtxtPtr ctxt; /* a DOM wrapper context */
19299     int n_ctxt;
19300     xmlDocPtr doc; /* the doc */
19301     int n_doc;
19302     xmlNodePtr node; /* the node to be removed. */
19303     int n_node;
19304     int options; /* set of options, unused at the moment */
19305     int n_options;
19306 
19307     for (n_ctxt = 0;n_ctxt < gen_nb_xmlDOMWrapCtxtPtr;n_ctxt++) {
19308     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
19309     for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
19310     for (n_options = 0;n_options < gen_nb_int;n_options++) {
19311         mem_base = xmlMemBlocks();
19312         ctxt = gen_xmlDOMWrapCtxtPtr(n_ctxt, 0);
19313         doc = gen_xmlDocPtr(n_doc, 1);
19314         node = gen_xmlNodePtr(n_node, 2);
19315         options = gen_int(n_options, 3);
19316 
19317         ret_val = xmlDOMWrapRemoveNode(ctxt, doc, node, options);
19318         desret_int(ret_val);
19319         call_tests++;
19320         des_xmlDOMWrapCtxtPtr(n_ctxt, ctxt, 0);
19321         des_xmlDocPtr(n_doc, doc, 1);
19322         des_xmlNodePtr(n_node, node, 2);
19323         des_int(n_options, options, 3);
19324         xmlResetLastError();
19325         if (mem_base != xmlMemBlocks()) {
19326             printf("Leak of %d blocks found in xmlDOMWrapRemoveNode",
19327 	           xmlMemBlocks() - mem_base);
19328 	    test_ret++;
19329             printf(" %d", n_ctxt);
19330             printf(" %d", n_doc);
19331             printf(" %d", n_node);
19332             printf(" %d", n_options);
19333             printf("\n");
19334         }
19335     }
19336     }
19337     }
19338     }
19339     function_tests++;
19340 
19341     return(test_ret);
19342 }
19343 
19344 
19345 static int
test_xmlDeregisterNodeDefault(void)19346 test_xmlDeregisterNodeDefault(void) {
19347     int test_ret = 0;
19348 
19349 
19350     /* missing type support */
19351     return(test_ret);
19352 }
19353 
19354 
19355 static int
test_xmlDocCopyNode(void)19356 test_xmlDocCopyNode(void) {
19357     int test_ret = 0;
19358 
19359     int mem_base;
19360     xmlNodePtr ret_val;
19361     xmlNodePtr node; /* the node */
19362     int n_node;
19363     xmlDocPtr doc; /* the document */
19364     int n_doc;
19365     int extended; /* if 1 do a recursive copy (properties, namespaces and children when applicable) if 2 copy properties and namespaces (when applicable) */
19366     int n_extended;
19367 
19368     for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
19369     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
19370     for (n_extended = 0;n_extended < gen_nb_int;n_extended++) {
19371         mem_base = xmlMemBlocks();
19372         node = gen_xmlNodePtr(n_node, 0);
19373         doc = gen_xmlDocPtr(n_doc, 1);
19374         extended = gen_int(n_extended, 2);
19375 
19376         ret_val = xmlDocCopyNode(node, doc, extended);
19377         desret_xmlNodePtr(ret_val);
19378         call_tests++;
19379         des_xmlNodePtr(n_node, node, 0);
19380         des_xmlDocPtr(n_doc, doc, 1);
19381         des_int(n_extended, extended, 2);
19382         xmlResetLastError();
19383         if (mem_base != xmlMemBlocks()) {
19384             printf("Leak of %d blocks found in xmlDocCopyNode",
19385 	           xmlMemBlocks() - mem_base);
19386 	    test_ret++;
19387             printf(" %d", n_node);
19388             printf(" %d", n_doc);
19389             printf(" %d", n_extended);
19390             printf("\n");
19391         }
19392     }
19393     }
19394     }
19395     function_tests++;
19396 
19397     return(test_ret);
19398 }
19399 
19400 
19401 static int
test_xmlDocCopyNodeList(void)19402 test_xmlDocCopyNodeList(void) {
19403     int test_ret = 0;
19404 
19405     int mem_base;
19406     xmlNodePtr ret_val;
19407     xmlDocPtr doc; /* the target document */
19408     int n_doc;
19409     xmlNodePtr node; /* the first node in the list. */
19410     int n_node;
19411 
19412     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
19413     for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
19414         mem_base = xmlMemBlocks();
19415         doc = gen_xmlDocPtr(n_doc, 0);
19416         node = gen_xmlNodePtr(n_node, 1);
19417 
19418         ret_val = xmlDocCopyNodeList(doc, node);
19419         desret_xmlNodePtr(ret_val);
19420         call_tests++;
19421         des_xmlDocPtr(n_doc, doc, 0);
19422         des_xmlNodePtr(n_node, node, 1);
19423         xmlResetLastError();
19424         if (mem_base != xmlMemBlocks()) {
19425             printf("Leak of %d blocks found in xmlDocCopyNodeList",
19426 	           xmlMemBlocks() - mem_base);
19427 	    test_ret++;
19428             printf(" %d", n_doc);
19429             printf(" %d", n_node);
19430             printf("\n");
19431         }
19432     }
19433     }
19434     function_tests++;
19435 
19436     return(test_ret);
19437 }
19438 
19439 
19440 static int
test_xmlDocDump(void)19441 test_xmlDocDump(void) {
19442     int test_ret = 0;
19443 
19444 #if defined(LIBXML_OUTPUT_ENABLED)
19445     int mem_base;
19446     int ret_val;
19447     FILE * f; /* the FILE* */
19448     int n_f;
19449     xmlDocPtr cur; /* the document */
19450     int n_cur;
19451 
19452     for (n_f = 0;n_f < gen_nb_FILE_ptr;n_f++) {
19453     for (n_cur = 0;n_cur < gen_nb_xmlDocPtr;n_cur++) {
19454         mem_base = xmlMemBlocks();
19455         f = gen_FILE_ptr(n_f, 0);
19456         cur = gen_xmlDocPtr(n_cur, 1);
19457 
19458         ret_val = xmlDocDump(f, cur);
19459         desret_int(ret_val);
19460         call_tests++;
19461         des_FILE_ptr(n_f, f, 0);
19462         des_xmlDocPtr(n_cur, cur, 1);
19463         xmlResetLastError();
19464         if (mem_base != xmlMemBlocks()) {
19465             printf("Leak of %d blocks found in xmlDocDump",
19466 	           xmlMemBlocks() - mem_base);
19467 	    test_ret++;
19468             printf(" %d", n_f);
19469             printf(" %d", n_cur);
19470             printf("\n");
19471         }
19472     }
19473     }
19474     function_tests++;
19475 #endif
19476 
19477     return(test_ret);
19478 }
19479 
19480 
19481 static int
test_xmlDocDumpFormatMemory(void)19482 test_xmlDocDumpFormatMemory(void) {
19483     int test_ret = 0;
19484 
19485 #if defined(LIBXML_OUTPUT_ENABLED)
19486     int mem_base;
19487     xmlDocPtr cur; /* the document */
19488     int n_cur;
19489     xmlChar ** mem; /* OUT: the memory pointer */
19490     int n_mem;
19491     int * size; /* OUT: the memory length */
19492     int n_size;
19493     int format; /* should formatting spaces been added */
19494     int n_format;
19495 
19496     for (n_cur = 0;n_cur < gen_nb_xmlDocPtr;n_cur++) {
19497     for (n_mem = 0;n_mem < gen_nb_xmlChar_ptr_ptr;n_mem++) {
19498     for (n_size = 0;n_size < gen_nb_int_ptr;n_size++) {
19499     for (n_format = 0;n_format < gen_nb_int;n_format++) {
19500         mem_base = xmlMemBlocks();
19501         cur = gen_xmlDocPtr(n_cur, 0);
19502         mem = gen_xmlChar_ptr_ptr(n_mem, 1);
19503         size = gen_int_ptr(n_size, 2);
19504         format = gen_int(n_format, 3);
19505 
19506         xmlDocDumpFormatMemory(cur, mem, size, format);
19507         call_tests++;
19508         des_xmlDocPtr(n_cur, cur, 0);
19509         des_xmlChar_ptr_ptr(n_mem, mem, 1);
19510         des_int_ptr(n_size, size, 2);
19511         des_int(n_format, format, 3);
19512         xmlResetLastError();
19513         if (mem_base != xmlMemBlocks()) {
19514             printf("Leak of %d blocks found in xmlDocDumpFormatMemory",
19515 	           xmlMemBlocks() - mem_base);
19516 	    test_ret++;
19517             printf(" %d", n_cur);
19518             printf(" %d", n_mem);
19519             printf(" %d", n_size);
19520             printf(" %d", n_format);
19521             printf("\n");
19522         }
19523     }
19524     }
19525     }
19526     }
19527     function_tests++;
19528 #endif
19529 
19530     return(test_ret);
19531 }
19532 
19533 
19534 static int
test_xmlDocDumpFormatMemoryEnc(void)19535 test_xmlDocDumpFormatMemoryEnc(void) {
19536     int test_ret = 0;
19537 
19538 #if defined(LIBXML_OUTPUT_ENABLED)
19539     int mem_base;
19540     xmlDocPtr out_doc; /* Document to generate XML text from */
19541     int n_out_doc;
19542     xmlChar ** doc_txt_ptr; /* Memory pointer for allocated XML text */
19543     int n_doc_txt_ptr;
19544     int * doc_txt_len; /* Length of the generated XML text */
19545     int n_doc_txt_len;
19546     const char * txt_encoding; /* Character encoding to use when generating XML text */
19547     int n_txt_encoding;
19548     int format; /* should formatting spaces been added */
19549     int n_format;
19550 
19551     for (n_out_doc = 0;n_out_doc < gen_nb_xmlDocPtr;n_out_doc++) {
19552     for (n_doc_txt_ptr = 0;n_doc_txt_ptr < gen_nb_xmlChar_ptr_ptr;n_doc_txt_ptr++) {
19553     for (n_doc_txt_len = 0;n_doc_txt_len < gen_nb_int_ptr;n_doc_txt_len++) {
19554     for (n_txt_encoding = 0;n_txt_encoding < gen_nb_const_char_ptr;n_txt_encoding++) {
19555     for (n_format = 0;n_format < gen_nb_int;n_format++) {
19556         mem_base = xmlMemBlocks();
19557         out_doc = gen_xmlDocPtr(n_out_doc, 0);
19558         doc_txt_ptr = gen_xmlChar_ptr_ptr(n_doc_txt_ptr, 1);
19559         doc_txt_len = gen_int_ptr(n_doc_txt_len, 2);
19560         txt_encoding = gen_const_char_ptr(n_txt_encoding, 3);
19561         format = gen_int(n_format, 4);
19562 
19563         xmlDocDumpFormatMemoryEnc(out_doc, doc_txt_ptr, doc_txt_len, txt_encoding, format);
19564         call_tests++;
19565         des_xmlDocPtr(n_out_doc, out_doc, 0);
19566         des_xmlChar_ptr_ptr(n_doc_txt_ptr, doc_txt_ptr, 1);
19567         des_int_ptr(n_doc_txt_len, doc_txt_len, 2);
19568         des_const_char_ptr(n_txt_encoding, txt_encoding, 3);
19569         des_int(n_format, format, 4);
19570         xmlResetLastError();
19571         if (mem_base != xmlMemBlocks()) {
19572             printf("Leak of %d blocks found in xmlDocDumpFormatMemoryEnc",
19573 	           xmlMemBlocks() - mem_base);
19574 	    test_ret++;
19575             printf(" %d", n_out_doc);
19576             printf(" %d", n_doc_txt_ptr);
19577             printf(" %d", n_doc_txt_len);
19578             printf(" %d", n_txt_encoding);
19579             printf(" %d", n_format);
19580             printf("\n");
19581         }
19582     }
19583     }
19584     }
19585     }
19586     }
19587     function_tests++;
19588 #endif
19589 
19590     return(test_ret);
19591 }
19592 
19593 
19594 static int
test_xmlDocDumpMemory(void)19595 test_xmlDocDumpMemory(void) {
19596     int test_ret = 0;
19597 
19598 #if defined(LIBXML_OUTPUT_ENABLED)
19599     int mem_base;
19600     xmlDocPtr cur; /* the document */
19601     int n_cur;
19602     xmlChar ** mem; /* OUT: the memory pointer */
19603     int n_mem;
19604     int * size; /* OUT: the memory length */
19605     int n_size;
19606 
19607     for (n_cur = 0;n_cur < gen_nb_xmlDocPtr;n_cur++) {
19608     for (n_mem = 0;n_mem < gen_nb_xmlChar_ptr_ptr;n_mem++) {
19609     for (n_size = 0;n_size < gen_nb_int_ptr;n_size++) {
19610         mem_base = xmlMemBlocks();
19611         cur = gen_xmlDocPtr(n_cur, 0);
19612         mem = gen_xmlChar_ptr_ptr(n_mem, 1);
19613         size = gen_int_ptr(n_size, 2);
19614 
19615         xmlDocDumpMemory(cur, mem, size);
19616         call_tests++;
19617         des_xmlDocPtr(n_cur, cur, 0);
19618         des_xmlChar_ptr_ptr(n_mem, mem, 1);
19619         des_int_ptr(n_size, size, 2);
19620         xmlResetLastError();
19621         if (mem_base != xmlMemBlocks()) {
19622             printf("Leak of %d blocks found in xmlDocDumpMemory",
19623 	           xmlMemBlocks() - mem_base);
19624 	    test_ret++;
19625             printf(" %d", n_cur);
19626             printf(" %d", n_mem);
19627             printf(" %d", n_size);
19628             printf("\n");
19629         }
19630     }
19631     }
19632     }
19633     function_tests++;
19634 #endif
19635 
19636     return(test_ret);
19637 }
19638 
19639 
19640 static int
test_xmlDocDumpMemoryEnc(void)19641 test_xmlDocDumpMemoryEnc(void) {
19642     int test_ret = 0;
19643 
19644 #if defined(LIBXML_OUTPUT_ENABLED)
19645     int mem_base;
19646     xmlDocPtr out_doc; /* Document to generate XML text from */
19647     int n_out_doc;
19648     xmlChar ** doc_txt_ptr; /* Memory pointer for allocated XML text */
19649     int n_doc_txt_ptr;
19650     int * doc_txt_len; /* Length of the generated XML text */
19651     int n_doc_txt_len;
19652     const char * txt_encoding; /* Character encoding to use when generating XML text */
19653     int n_txt_encoding;
19654 
19655     for (n_out_doc = 0;n_out_doc < gen_nb_xmlDocPtr;n_out_doc++) {
19656     for (n_doc_txt_ptr = 0;n_doc_txt_ptr < gen_nb_xmlChar_ptr_ptr;n_doc_txt_ptr++) {
19657     for (n_doc_txt_len = 0;n_doc_txt_len < gen_nb_int_ptr;n_doc_txt_len++) {
19658     for (n_txt_encoding = 0;n_txt_encoding < gen_nb_const_char_ptr;n_txt_encoding++) {
19659         mem_base = xmlMemBlocks();
19660         out_doc = gen_xmlDocPtr(n_out_doc, 0);
19661         doc_txt_ptr = gen_xmlChar_ptr_ptr(n_doc_txt_ptr, 1);
19662         doc_txt_len = gen_int_ptr(n_doc_txt_len, 2);
19663         txt_encoding = gen_const_char_ptr(n_txt_encoding, 3);
19664 
19665         xmlDocDumpMemoryEnc(out_doc, doc_txt_ptr, doc_txt_len, txt_encoding);
19666         call_tests++;
19667         des_xmlDocPtr(n_out_doc, out_doc, 0);
19668         des_xmlChar_ptr_ptr(n_doc_txt_ptr, doc_txt_ptr, 1);
19669         des_int_ptr(n_doc_txt_len, doc_txt_len, 2);
19670         des_const_char_ptr(n_txt_encoding, txt_encoding, 3);
19671         xmlResetLastError();
19672         if (mem_base != xmlMemBlocks()) {
19673             printf("Leak of %d blocks found in xmlDocDumpMemoryEnc",
19674 	           xmlMemBlocks() - mem_base);
19675 	    test_ret++;
19676             printf(" %d", n_out_doc);
19677             printf(" %d", n_doc_txt_ptr);
19678             printf(" %d", n_doc_txt_len);
19679             printf(" %d", n_txt_encoding);
19680             printf("\n");
19681         }
19682     }
19683     }
19684     }
19685     }
19686     function_tests++;
19687 #endif
19688 
19689     return(test_ret);
19690 }
19691 
19692 
19693 static int
test_xmlDocFormatDump(void)19694 test_xmlDocFormatDump(void) {
19695     int test_ret = 0;
19696 
19697 #if defined(LIBXML_OUTPUT_ENABLED)
19698     int mem_base;
19699     int ret_val;
19700     FILE * f; /* the FILE* */
19701     int n_f;
19702     xmlDocPtr cur; /* the document */
19703     int n_cur;
19704     int format; /* should formatting spaces been added */
19705     int n_format;
19706 
19707     for (n_f = 0;n_f < gen_nb_FILE_ptr;n_f++) {
19708     for (n_cur = 0;n_cur < gen_nb_xmlDocPtr;n_cur++) {
19709     for (n_format = 0;n_format < gen_nb_int;n_format++) {
19710         mem_base = xmlMemBlocks();
19711         f = gen_FILE_ptr(n_f, 0);
19712         cur = gen_xmlDocPtr(n_cur, 1);
19713         format = gen_int(n_format, 2);
19714 
19715         ret_val = xmlDocFormatDump(f, cur, format);
19716         desret_int(ret_val);
19717         call_tests++;
19718         des_FILE_ptr(n_f, f, 0);
19719         des_xmlDocPtr(n_cur, cur, 1);
19720         des_int(n_format, format, 2);
19721         xmlResetLastError();
19722         if (mem_base != xmlMemBlocks()) {
19723             printf("Leak of %d blocks found in xmlDocFormatDump",
19724 	           xmlMemBlocks() - mem_base);
19725 	    test_ret++;
19726             printf(" %d", n_f);
19727             printf(" %d", n_cur);
19728             printf(" %d", n_format);
19729             printf("\n");
19730         }
19731     }
19732     }
19733     }
19734     function_tests++;
19735 #endif
19736 
19737     return(test_ret);
19738 }
19739 
19740 
19741 static int
test_xmlDocGetRootElement(void)19742 test_xmlDocGetRootElement(void) {
19743     int test_ret = 0;
19744 
19745     int mem_base;
19746     xmlNodePtr ret_val;
19747     const xmlDoc * doc; /* the document */
19748     int n_doc;
19749 
19750     for (n_doc = 0;n_doc < gen_nb_const_xmlDoc_ptr;n_doc++) {
19751         mem_base = xmlMemBlocks();
19752         doc = gen_const_xmlDoc_ptr(n_doc, 0);
19753 
19754         ret_val = xmlDocGetRootElement(doc);
19755         desret_xmlNodePtr(ret_val);
19756         call_tests++;
19757         des_const_xmlDoc_ptr(n_doc, doc, 0);
19758         xmlResetLastError();
19759         if (mem_base != xmlMemBlocks()) {
19760             printf("Leak of %d blocks found in xmlDocGetRootElement",
19761 	           xmlMemBlocks() - mem_base);
19762 	    test_ret++;
19763             printf(" %d", n_doc);
19764             printf("\n");
19765         }
19766     }
19767     function_tests++;
19768 
19769     return(test_ret);
19770 }
19771 
19772 
19773 static int
test_xmlDocSetRootElement(void)19774 test_xmlDocSetRootElement(void) {
19775     int test_ret = 0;
19776 
19777 #if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_WRITER_ENABLED)
19778     int mem_base;
19779     xmlNodePtr ret_val;
19780     xmlDocPtr doc; /* the document */
19781     int n_doc;
19782     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. */
19783     int n_root;
19784 
19785     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
19786     for (n_root = 0;n_root < gen_nb_xmlNodePtr_in;n_root++) {
19787         mem_base = xmlMemBlocks();
19788         doc = gen_xmlDocPtr(n_doc, 0);
19789         root = gen_xmlNodePtr_in(n_root, 1);
19790 
19791         ret_val = xmlDocSetRootElement(doc, root);
19792         if (doc == NULL) { xmlFreeNode(root) ; root = NULL ; }
19793         desret_xmlNodePtr(ret_val);
19794         call_tests++;
19795         des_xmlDocPtr(n_doc, doc, 0);
19796         des_xmlNodePtr_in(n_root, root, 1);
19797         xmlResetLastError();
19798         if (mem_base != xmlMemBlocks()) {
19799             printf("Leak of %d blocks found in xmlDocSetRootElement",
19800 	           xmlMemBlocks() - mem_base);
19801 	    test_ret++;
19802             printf(" %d", n_doc);
19803             printf(" %d", n_root);
19804             printf("\n");
19805         }
19806     }
19807     }
19808     function_tests++;
19809 #endif
19810 
19811     return(test_ret);
19812 }
19813 
19814 
19815 static int
test_xmlElemDump(void)19816 test_xmlElemDump(void) {
19817     int test_ret = 0;
19818 
19819 #if defined(LIBXML_OUTPUT_ENABLED)
19820     int mem_base;
19821     FILE * f; /* the FILE * for the output */
19822     int n_f;
19823     xmlDocPtr doc; /* the document */
19824     int n_doc;
19825     xmlNodePtr cur; /* the current node */
19826     int n_cur;
19827 
19828     for (n_f = 0;n_f < gen_nb_FILE_ptr;n_f++) {
19829     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
19830     for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
19831         mem_base = xmlMemBlocks();
19832         f = gen_FILE_ptr(n_f, 0);
19833         doc = gen_xmlDocPtr(n_doc, 1);
19834         cur = gen_xmlNodePtr(n_cur, 2);
19835 
19836         xmlElemDump(f, doc, cur);
19837         call_tests++;
19838         des_FILE_ptr(n_f, f, 0);
19839         des_xmlDocPtr(n_doc, doc, 1);
19840         des_xmlNodePtr(n_cur, cur, 2);
19841         xmlResetLastError();
19842         if (mem_base != xmlMemBlocks()) {
19843             printf("Leak of %d blocks found in xmlElemDump",
19844 	           xmlMemBlocks() - mem_base);
19845 	    test_ret++;
19846             printf(" %d", n_f);
19847             printf(" %d", n_doc);
19848             printf(" %d", n_cur);
19849             printf("\n");
19850         }
19851     }
19852     }
19853     }
19854     function_tests++;
19855 #endif
19856 
19857     return(test_ret);
19858 }
19859 
19860 
19861 static int
test_xmlFirstElementChild(void)19862 test_xmlFirstElementChild(void) {
19863     int test_ret = 0;
19864 
19865 #if defined(LIBXML_TREE_ENABLED)
19866     int mem_base;
19867     xmlNodePtr ret_val;
19868     xmlNodePtr parent; /* the parent node */
19869     int n_parent;
19870 
19871     for (n_parent = 0;n_parent < gen_nb_xmlNodePtr;n_parent++) {
19872         mem_base = xmlMemBlocks();
19873         parent = gen_xmlNodePtr(n_parent, 0);
19874 
19875         ret_val = xmlFirstElementChild(parent);
19876         desret_xmlNodePtr(ret_val);
19877         call_tests++;
19878         des_xmlNodePtr(n_parent, parent, 0);
19879         xmlResetLastError();
19880         if (mem_base != xmlMemBlocks()) {
19881             printf("Leak of %d blocks found in xmlFirstElementChild",
19882 	           xmlMemBlocks() - mem_base);
19883 	    test_ret++;
19884             printf(" %d", n_parent);
19885             printf("\n");
19886         }
19887     }
19888     function_tests++;
19889 #endif
19890 
19891     return(test_ret);
19892 }
19893 
19894 
19895 static int
test_xmlGetBufferAllocationScheme(void)19896 test_xmlGetBufferAllocationScheme(void) {
19897     int test_ret = 0;
19898 
19899     int mem_base;
19900     xmlBufferAllocationScheme ret_val;
19901 
19902         mem_base = xmlMemBlocks();
19903 
19904         ret_val = xmlGetBufferAllocationScheme();
19905         desret_xmlBufferAllocationScheme(ret_val);
19906         call_tests++;
19907         xmlResetLastError();
19908         if (mem_base != xmlMemBlocks()) {
19909             printf("Leak of %d blocks found in xmlGetBufferAllocationScheme",
19910 	           xmlMemBlocks() - mem_base);
19911 	    test_ret++;
19912             printf("\n");
19913         }
19914     function_tests++;
19915 
19916     return(test_ret);
19917 }
19918 
19919 
19920 static int
test_xmlGetCompressMode(void)19921 test_xmlGetCompressMode(void) {
19922     int test_ret = 0;
19923 
19924     int mem_base;
19925     int ret_val;
19926 
19927         mem_base = xmlMemBlocks();
19928 
19929         ret_val = xmlGetCompressMode();
19930         desret_int(ret_val);
19931         call_tests++;
19932         xmlResetLastError();
19933         if (mem_base != xmlMemBlocks()) {
19934             printf("Leak of %d blocks found in xmlGetCompressMode",
19935 	           xmlMemBlocks() - mem_base);
19936 	    test_ret++;
19937             printf("\n");
19938         }
19939     function_tests++;
19940 
19941     return(test_ret);
19942 }
19943 
19944 
19945 static int
test_xmlGetDocCompressMode(void)19946 test_xmlGetDocCompressMode(void) {
19947     int test_ret = 0;
19948 
19949     int mem_base;
19950     int ret_val;
19951     const xmlDoc * doc; /* the document */
19952     int n_doc;
19953 
19954     for (n_doc = 0;n_doc < gen_nb_const_xmlDoc_ptr;n_doc++) {
19955         mem_base = xmlMemBlocks();
19956         doc = gen_const_xmlDoc_ptr(n_doc, 0);
19957 
19958         ret_val = xmlGetDocCompressMode(doc);
19959         desret_int(ret_val);
19960         call_tests++;
19961         des_const_xmlDoc_ptr(n_doc, doc, 0);
19962         xmlResetLastError();
19963         if (mem_base != xmlMemBlocks()) {
19964             printf("Leak of %d blocks found in xmlGetDocCompressMode",
19965 	           xmlMemBlocks() - mem_base);
19966 	    test_ret++;
19967             printf(" %d", n_doc);
19968             printf("\n");
19969         }
19970     }
19971     function_tests++;
19972 
19973     return(test_ret);
19974 }
19975 
19976 
19977 static int
test_xmlGetIntSubset(void)19978 test_xmlGetIntSubset(void) {
19979     int test_ret = 0;
19980 
19981     int mem_base;
19982     xmlDtdPtr ret_val;
19983     const xmlDoc * doc; /* the document pointer */
19984     int n_doc;
19985 
19986     for (n_doc = 0;n_doc < gen_nb_const_xmlDoc_ptr;n_doc++) {
19987         mem_base = xmlMemBlocks();
19988         doc = gen_const_xmlDoc_ptr(n_doc, 0);
19989 
19990         ret_val = xmlGetIntSubset(doc);
19991         desret_xmlDtdPtr(ret_val);
19992         call_tests++;
19993         des_const_xmlDoc_ptr(n_doc, doc, 0);
19994         xmlResetLastError();
19995         if (mem_base != xmlMemBlocks()) {
19996             printf("Leak of %d blocks found in xmlGetIntSubset",
19997 	           xmlMemBlocks() - mem_base);
19998 	    test_ret++;
19999             printf(" %d", n_doc);
20000             printf("\n");
20001         }
20002     }
20003     function_tests++;
20004 
20005     return(test_ret);
20006 }
20007 
20008 
20009 static int
test_xmlGetLastChild(void)20010 test_xmlGetLastChild(void) {
20011     int test_ret = 0;
20012 
20013     int mem_base;
20014     xmlNodePtr ret_val;
20015     const xmlNode * parent; /* the parent node */
20016     int n_parent;
20017 
20018     for (n_parent = 0;n_parent < gen_nb_const_xmlNode_ptr;n_parent++) {
20019         mem_base = xmlMemBlocks();
20020         parent = gen_const_xmlNode_ptr(n_parent, 0);
20021 
20022         ret_val = xmlGetLastChild(parent);
20023         desret_xmlNodePtr(ret_val);
20024         call_tests++;
20025         des_const_xmlNode_ptr(n_parent, parent, 0);
20026         xmlResetLastError();
20027         if (mem_base != xmlMemBlocks()) {
20028             printf("Leak of %d blocks found in xmlGetLastChild",
20029 	           xmlMemBlocks() - mem_base);
20030 	    test_ret++;
20031             printf(" %d", n_parent);
20032             printf("\n");
20033         }
20034     }
20035     function_tests++;
20036 
20037     return(test_ret);
20038 }
20039 
20040 
20041 static int
test_xmlGetLineNo(void)20042 test_xmlGetLineNo(void) {
20043     int test_ret = 0;
20044 
20045     int mem_base;
20046     long ret_val;
20047     const xmlNode * node; /* valid node */
20048     int n_node;
20049 
20050     for (n_node = 0;n_node < gen_nb_const_xmlNode_ptr;n_node++) {
20051         mem_base = xmlMemBlocks();
20052         node = gen_const_xmlNode_ptr(n_node, 0);
20053 
20054         ret_val = xmlGetLineNo(node);
20055         desret_long(ret_val);
20056         call_tests++;
20057         des_const_xmlNode_ptr(n_node, node, 0);
20058         xmlResetLastError();
20059         if (mem_base != xmlMemBlocks()) {
20060             printf("Leak of %d blocks found in xmlGetLineNo",
20061 	           xmlMemBlocks() - mem_base);
20062 	    test_ret++;
20063             printf(" %d", n_node);
20064             printf("\n");
20065         }
20066     }
20067     function_tests++;
20068 
20069     return(test_ret);
20070 }
20071 
20072 
20073 static int
test_xmlGetNoNsProp(void)20074 test_xmlGetNoNsProp(void) {
20075     int test_ret = 0;
20076 
20077     int mem_base;
20078     xmlChar * ret_val;
20079     const xmlNode * node; /* the node */
20080     int n_node;
20081     const xmlChar * name; /* the attribute name */
20082     int n_name;
20083 
20084     for (n_node = 0;n_node < gen_nb_const_xmlNode_ptr;n_node++) {
20085     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
20086         mem_base = xmlMemBlocks();
20087         node = gen_const_xmlNode_ptr(n_node, 0);
20088         name = gen_const_xmlChar_ptr(n_name, 1);
20089 
20090         ret_val = xmlGetNoNsProp(node, name);
20091         desret_xmlChar_ptr(ret_val);
20092         call_tests++;
20093         des_const_xmlNode_ptr(n_node, node, 0);
20094         des_const_xmlChar_ptr(n_name, name, 1);
20095         xmlResetLastError();
20096         if (mem_base != xmlMemBlocks()) {
20097             printf("Leak of %d blocks found in xmlGetNoNsProp",
20098 	           xmlMemBlocks() - mem_base);
20099 	    test_ret++;
20100             printf(" %d", n_node);
20101             printf(" %d", n_name);
20102             printf("\n");
20103         }
20104     }
20105     }
20106     function_tests++;
20107 
20108     return(test_ret);
20109 }
20110 
20111 
20112 static int
test_xmlGetNodePath(void)20113 test_xmlGetNodePath(void) {
20114     int test_ret = 0;
20115 
20116 #if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_DEBUG_ENABLED)
20117     int mem_base;
20118     xmlChar * ret_val;
20119     const xmlNode * node; /* a node */
20120     int n_node;
20121 
20122     for (n_node = 0;n_node < gen_nb_const_xmlNode_ptr;n_node++) {
20123         mem_base = xmlMemBlocks();
20124         node = gen_const_xmlNode_ptr(n_node, 0);
20125 
20126         ret_val = xmlGetNodePath(node);
20127         desret_xmlChar_ptr(ret_val);
20128         call_tests++;
20129         des_const_xmlNode_ptr(n_node, node, 0);
20130         xmlResetLastError();
20131         if (mem_base != xmlMemBlocks()) {
20132             printf("Leak of %d blocks found in xmlGetNodePath",
20133 	           xmlMemBlocks() - mem_base);
20134 	    test_ret++;
20135             printf(" %d", n_node);
20136             printf("\n");
20137         }
20138     }
20139     function_tests++;
20140 #endif
20141 
20142     return(test_ret);
20143 }
20144 
20145 
20146 static int
test_xmlGetNsList(void)20147 test_xmlGetNsList(void) {
20148     int test_ret = 0;
20149 
20150 
20151     /* missing type support */
20152     return(test_ret);
20153 }
20154 
20155 
20156 static int
test_xmlGetNsProp(void)20157 test_xmlGetNsProp(void) {
20158     int test_ret = 0;
20159 
20160     int mem_base;
20161     xmlChar * ret_val;
20162     const xmlNode * node; /* the node */
20163     int n_node;
20164     const xmlChar * name; /* the attribute name */
20165     int n_name;
20166     const xmlChar * nameSpace; /* the URI of the namespace */
20167     int n_nameSpace;
20168 
20169     for (n_node = 0;n_node < gen_nb_const_xmlNode_ptr;n_node++) {
20170     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
20171     for (n_nameSpace = 0;n_nameSpace < gen_nb_const_xmlChar_ptr;n_nameSpace++) {
20172         mem_base = xmlMemBlocks();
20173         node = gen_const_xmlNode_ptr(n_node, 0);
20174         name = gen_const_xmlChar_ptr(n_name, 1);
20175         nameSpace = gen_const_xmlChar_ptr(n_nameSpace, 2);
20176 
20177         ret_val = xmlGetNsProp(node, name, nameSpace);
20178         desret_xmlChar_ptr(ret_val);
20179         call_tests++;
20180         des_const_xmlNode_ptr(n_node, node, 0);
20181         des_const_xmlChar_ptr(n_name, name, 1);
20182         des_const_xmlChar_ptr(n_nameSpace, nameSpace, 2);
20183         xmlResetLastError();
20184         if (mem_base != xmlMemBlocks()) {
20185             printf("Leak of %d blocks found in xmlGetNsProp",
20186 	           xmlMemBlocks() - mem_base);
20187 	    test_ret++;
20188             printf(" %d", n_node);
20189             printf(" %d", n_name);
20190             printf(" %d", n_nameSpace);
20191             printf("\n");
20192         }
20193     }
20194     }
20195     }
20196     function_tests++;
20197 
20198     return(test_ret);
20199 }
20200 
20201 
20202 static int
test_xmlGetProp(void)20203 test_xmlGetProp(void) {
20204     int test_ret = 0;
20205 
20206     int mem_base;
20207     xmlChar * ret_val;
20208     const xmlNode * node; /* the node */
20209     int n_node;
20210     const xmlChar * name; /* the attribute name */
20211     int n_name;
20212 
20213     for (n_node = 0;n_node < gen_nb_const_xmlNode_ptr;n_node++) {
20214     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
20215         mem_base = xmlMemBlocks();
20216         node = gen_const_xmlNode_ptr(n_node, 0);
20217         name = gen_const_xmlChar_ptr(n_name, 1);
20218 
20219         ret_val = xmlGetProp(node, name);
20220         desret_xmlChar_ptr(ret_val);
20221         call_tests++;
20222         des_const_xmlNode_ptr(n_node, node, 0);
20223         des_const_xmlChar_ptr(n_name, name, 1);
20224         xmlResetLastError();
20225         if (mem_base != xmlMemBlocks()) {
20226             printf("Leak of %d blocks found in xmlGetProp",
20227 	           xmlMemBlocks() - mem_base);
20228 	    test_ret++;
20229             printf(" %d", n_node);
20230             printf(" %d", n_name);
20231             printf("\n");
20232         }
20233     }
20234     }
20235     function_tests++;
20236 
20237     return(test_ret);
20238 }
20239 
20240 
20241 static int
test_xmlHasNsProp(void)20242 test_xmlHasNsProp(void) {
20243     int test_ret = 0;
20244 
20245     int mem_base;
20246     xmlAttrPtr ret_val;
20247     const xmlNode * node; /* the node */
20248     int n_node;
20249     const xmlChar * name; /* the attribute name */
20250     int n_name;
20251     const xmlChar * nameSpace; /* the URI of the namespace */
20252     int n_nameSpace;
20253 
20254     for (n_node = 0;n_node < gen_nb_const_xmlNode_ptr;n_node++) {
20255     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
20256     for (n_nameSpace = 0;n_nameSpace < gen_nb_const_xmlChar_ptr;n_nameSpace++) {
20257         mem_base = xmlMemBlocks();
20258         node = gen_const_xmlNode_ptr(n_node, 0);
20259         name = gen_const_xmlChar_ptr(n_name, 1);
20260         nameSpace = gen_const_xmlChar_ptr(n_nameSpace, 2);
20261 
20262         ret_val = xmlHasNsProp(node, name, nameSpace);
20263         desret_xmlAttrPtr(ret_val);
20264         call_tests++;
20265         des_const_xmlNode_ptr(n_node, node, 0);
20266         des_const_xmlChar_ptr(n_name, name, 1);
20267         des_const_xmlChar_ptr(n_nameSpace, nameSpace, 2);
20268         xmlResetLastError();
20269         if (mem_base != xmlMemBlocks()) {
20270             printf("Leak of %d blocks found in xmlHasNsProp",
20271 	           xmlMemBlocks() - mem_base);
20272 	    test_ret++;
20273             printf(" %d", n_node);
20274             printf(" %d", n_name);
20275             printf(" %d", n_nameSpace);
20276             printf("\n");
20277         }
20278     }
20279     }
20280     }
20281     function_tests++;
20282 
20283     return(test_ret);
20284 }
20285 
20286 
20287 static int
test_xmlHasProp(void)20288 test_xmlHasProp(void) {
20289     int test_ret = 0;
20290 
20291     int mem_base;
20292     xmlAttrPtr ret_val;
20293     const xmlNode * node; /* the node */
20294     int n_node;
20295     const xmlChar * name; /* the attribute name */
20296     int n_name;
20297 
20298     for (n_node = 0;n_node < gen_nb_const_xmlNode_ptr;n_node++) {
20299     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
20300         mem_base = xmlMemBlocks();
20301         node = gen_const_xmlNode_ptr(n_node, 0);
20302         name = gen_const_xmlChar_ptr(n_name, 1);
20303 
20304         ret_val = xmlHasProp(node, name);
20305         desret_xmlAttrPtr(ret_val);
20306         call_tests++;
20307         des_const_xmlNode_ptr(n_node, node, 0);
20308         des_const_xmlChar_ptr(n_name, name, 1);
20309         xmlResetLastError();
20310         if (mem_base != xmlMemBlocks()) {
20311             printf("Leak of %d blocks found in xmlHasProp",
20312 	           xmlMemBlocks() - mem_base);
20313 	    test_ret++;
20314             printf(" %d", n_node);
20315             printf(" %d", n_name);
20316             printf("\n");
20317         }
20318     }
20319     }
20320     function_tests++;
20321 
20322     return(test_ret);
20323 }
20324 
20325 
20326 static int
test_xmlIsBlankNode(void)20327 test_xmlIsBlankNode(void) {
20328     int test_ret = 0;
20329 
20330     int mem_base;
20331     int ret_val;
20332     const xmlNode * node; /* the node */
20333     int n_node;
20334 
20335     for (n_node = 0;n_node < gen_nb_const_xmlNode_ptr;n_node++) {
20336         mem_base = xmlMemBlocks();
20337         node = gen_const_xmlNode_ptr(n_node, 0);
20338 
20339         ret_val = xmlIsBlankNode(node);
20340         desret_int(ret_val);
20341         call_tests++;
20342         des_const_xmlNode_ptr(n_node, node, 0);
20343         xmlResetLastError();
20344         if (mem_base != xmlMemBlocks()) {
20345             printf("Leak of %d blocks found in xmlIsBlankNode",
20346 	           xmlMemBlocks() - mem_base);
20347 	    test_ret++;
20348             printf(" %d", n_node);
20349             printf("\n");
20350         }
20351     }
20352     function_tests++;
20353 
20354     return(test_ret);
20355 }
20356 
20357 
20358 static int
test_xmlIsXHTML(void)20359 test_xmlIsXHTML(void) {
20360     int test_ret = 0;
20361 
20362     int mem_base;
20363     int ret_val;
20364     const xmlChar * systemID; /* the system identifier */
20365     int n_systemID;
20366     const xmlChar * publicID; /* the public identifier */
20367     int n_publicID;
20368 
20369     for (n_systemID = 0;n_systemID < gen_nb_const_xmlChar_ptr;n_systemID++) {
20370     for (n_publicID = 0;n_publicID < gen_nb_const_xmlChar_ptr;n_publicID++) {
20371         mem_base = xmlMemBlocks();
20372         systemID = gen_const_xmlChar_ptr(n_systemID, 0);
20373         publicID = gen_const_xmlChar_ptr(n_publicID, 1);
20374 
20375         ret_val = xmlIsXHTML(systemID, publicID);
20376         desret_int(ret_val);
20377         call_tests++;
20378         des_const_xmlChar_ptr(n_systemID, systemID, 0);
20379         des_const_xmlChar_ptr(n_publicID, publicID, 1);
20380         xmlResetLastError();
20381         if (mem_base != xmlMemBlocks()) {
20382             printf("Leak of %d blocks found in xmlIsXHTML",
20383 	           xmlMemBlocks() - mem_base);
20384 	    test_ret++;
20385             printf(" %d", n_systemID);
20386             printf(" %d", n_publicID);
20387             printf("\n");
20388         }
20389     }
20390     }
20391     function_tests++;
20392 
20393     return(test_ret);
20394 }
20395 
20396 
20397 static int
test_xmlLastElementChild(void)20398 test_xmlLastElementChild(void) {
20399     int test_ret = 0;
20400 
20401 #if defined(LIBXML_TREE_ENABLED)
20402     int mem_base;
20403     xmlNodePtr ret_val;
20404     xmlNodePtr parent; /* the parent node */
20405     int n_parent;
20406 
20407     for (n_parent = 0;n_parent < gen_nb_xmlNodePtr;n_parent++) {
20408         mem_base = xmlMemBlocks();
20409         parent = gen_xmlNodePtr(n_parent, 0);
20410 
20411         ret_val = xmlLastElementChild(parent);
20412         desret_xmlNodePtr(ret_val);
20413         call_tests++;
20414         des_xmlNodePtr(n_parent, parent, 0);
20415         xmlResetLastError();
20416         if (mem_base != xmlMemBlocks()) {
20417             printf("Leak of %d blocks found in xmlLastElementChild",
20418 	           xmlMemBlocks() - mem_base);
20419 	    test_ret++;
20420             printf(" %d", n_parent);
20421             printf("\n");
20422         }
20423     }
20424     function_tests++;
20425 #endif
20426 
20427     return(test_ret);
20428 }
20429 
20430 
20431 static int
test_xmlNewCDataBlock(void)20432 test_xmlNewCDataBlock(void) {
20433     int test_ret = 0;
20434 
20435     int mem_base;
20436     xmlNodePtr ret_val;
20437     xmlDocPtr doc; /* the document */
20438     int n_doc;
20439     const xmlChar * content; /* the CDATA block content content */
20440     int n_content;
20441     int len; /* the length of the block */
20442     int n_len;
20443 
20444     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
20445     for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
20446     for (n_len = 0;n_len < gen_nb_int;n_len++) {
20447         mem_base = xmlMemBlocks();
20448         doc = gen_xmlDocPtr(n_doc, 0);
20449         content = gen_const_xmlChar_ptr(n_content, 1);
20450         len = gen_int(n_len, 2);
20451         if ((content != NULL) &&
20452             (len > xmlStrlen(BAD_CAST content)))
20453             len = 0;
20454 
20455         ret_val = xmlNewCDataBlock(doc, content, len);
20456         desret_xmlNodePtr(ret_val);
20457         call_tests++;
20458         des_xmlDocPtr(n_doc, doc, 0);
20459         des_const_xmlChar_ptr(n_content, content, 1);
20460         des_int(n_len, len, 2);
20461         xmlResetLastError();
20462         if (mem_base != xmlMemBlocks()) {
20463             printf("Leak of %d blocks found in xmlNewCDataBlock",
20464 	           xmlMemBlocks() - mem_base);
20465 	    test_ret++;
20466             printf(" %d", n_doc);
20467             printf(" %d", n_content);
20468             printf(" %d", n_len);
20469             printf("\n");
20470         }
20471     }
20472     }
20473     }
20474     function_tests++;
20475 
20476     return(test_ret);
20477 }
20478 
20479 
20480 static int
test_xmlNewCharRef(void)20481 test_xmlNewCharRef(void) {
20482     int test_ret = 0;
20483 
20484     int mem_base;
20485     xmlNodePtr ret_val;
20486     xmlDocPtr doc; /* the document */
20487     int n_doc;
20488     const xmlChar * name; /* the char ref string, starting with # or "&# ... ;" */
20489     int n_name;
20490 
20491     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
20492     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
20493         mem_base = xmlMemBlocks();
20494         doc = gen_xmlDocPtr(n_doc, 0);
20495         name = gen_const_xmlChar_ptr(n_name, 1);
20496 
20497         ret_val = xmlNewCharRef(doc, name);
20498         desret_xmlNodePtr(ret_val);
20499         call_tests++;
20500         des_xmlDocPtr(n_doc, doc, 0);
20501         des_const_xmlChar_ptr(n_name, name, 1);
20502         xmlResetLastError();
20503         if (mem_base != xmlMemBlocks()) {
20504             printf("Leak of %d blocks found in xmlNewCharRef",
20505 	           xmlMemBlocks() - mem_base);
20506 	    test_ret++;
20507             printf(" %d", n_doc);
20508             printf(" %d", n_name);
20509             printf("\n");
20510         }
20511     }
20512     }
20513     function_tests++;
20514 
20515     return(test_ret);
20516 }
20517 
20518 
20519 static int
test_xmlNewChild(void)20520 test_xmlNewChild(void) {
20521     int test_ret = 0;
20522 
20523 #if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED)
20524 #ifdef LIBXML_TREE_ENABLED
20525     int mem_base;
20526     xmlNodePtr ret_val;
20527     xmlNodePtr parent; /* the parent node */
20528     int n_parent;
20529     xmlNsPtr ns; /* a namespace if any */
20530     int n_ns;
20531     const xmlChar * name; /* the name of the child */
20532     int n_name;
20533     const xmlChar * content; /* the XML content of the child if any. */
20534     int n_content;
20535 
20536     for (n_parent = 0;n_parent < gen_nb_xmlNodePtr;n_parent++) {
20537     for (n_ns = 0;n_ns < gen_nb_xmlNsPtr;n_ns++) {
20538     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
20539     for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
20540         mem_base = xmlMemBlocks();
20541         parent = gen_xmlNodePtr(n_parent, 0);
20542         ns = gen_xmlNsPtr(n_ns, 1);
20543         name = gen_const_xmlChar_ptr(n_name, 2);
20544         content = gen_const_xmlChar_ptr(n_content, 3);
20545 
20546         ret_val = xmlNewChild(parent, ns, name, content);
20547         desret_xmlNodePtr(ret_val);
20548         call_tests++;
20549         des_xmlNodePtr(n_parent, parent, 0);
20550         des_xmlNsPtr(n_ns, ns, 1);
20551         des_const_xmlChar_ptr(n_name, name, 2);
20552         des_const_xmlChar_ptr(n_content, content, 3);
20553         xmlResetLastError();
20554         if (mem_base != xmlMemBlocks()) {
20555             printf("Leak of %d blocks found in xmlNewChild",
20556 	           xmlMemBlocks() - mem_base);
20557 	    test_ret++;
20558             printf(" %d", n_parent);
20559             printf(" %d", n_ns);
20560             printf(" %d", n_name);
20561             printf(" %d", n_content);
20562             printf("\n");
20563         }
20564     }
20565     }
20566     }
20567     }
20568     function_tests++;
20569 #endif
20570 #endif
20571 
20572     return(test_ret);
20573 }
20574 
20575 
20576 static int
test_xmlNewComment(void)20577 test_xmlNewComment(void) {
20578     int test_ret = 0;
20579 
20580     int mem_base;
20581     xmlNodePtr ret_val;
20582     const xmlChar * content; /* the comment content */
20583     int n_content;
20584 
20585     for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
20586         mem_base = xmlMemBlocks();
20587         content = gen_const_xmlChar_ptr(n_content, 0);
20588 
20589         ret_val = xmlNewComment(content);
20590         desret_xmlNodePtr(ret_val);
20591         call_tests++;
20592         des_const_xmlChar_ptr(n_content, content, 0);
20593         xmlResetLastError();
20594         if (mem_base != xmlMemBlocks()) {
20595             printf("Leak of %d blocks found in xmlNewComment",
20596 	           xmlMemBlocks() - mem_base);
20597 	    test_ret++;
20598             printf(" %d", n_content);
20599             printf("\n");
20600         }
20601     }
20602     function_tests++;
20603 
20604     return(test_ret);
20605 }
20606 
20607 
20608 static int
test_xmlNewDoc(void)20609 test_xmlNewDoc(void) {
20610     int test_ret = 0;
20611 
20612     int mem_base;
20613     xmlDocPtr ret_val;
20614     const xmlChar * version; /* xmlChar string giving the version of XML "1.0" */
20615     int n_version;
20616 
20617     for (n_version = 0;n_version < gen_nb_const_xmlChar_ptr;n_version++) {
20618         mem_base = xmlMemBlocks();
20619         version = gen_const_xmlChar_ptr(n_version, 0);
20620 
20621         ret_val = xmlNewDoc(version);
20622         desret_xmlDocPtr(ret_val);
20623         call_tests++;
20624         des_const_xmlChar_ptr(n_version, version, 0);
20625         xmlResetLastError();
20626         if (mem_base != xmlMemBlocks()) {
20627             printf("Leak of %d blocks found in xmlNewDoc",
20628 	           xmlMemBlocks() - mem_base);
20629 	    test_ret++;
20630             printf(" %d", n_version);
20631             printf("\n");
20632         }
20633     }
20634     function_tests++;
20635 
20636     return(test_ret);
20637 }
20638 
20639 
20640 static int
test_xmlNewDocComment(void)20641 test_xmlNewDocComment(void) {
20642     int test_ret = 0;
20643 
20644     int mem_base;
20645     xmlNodePtr ret_val;
20646     xmlDocPtr doc; /* the document */
20647     int n_doc;
20648     const xmlChar * content; /* the comment content */
20649     int n_content;
20650 
20651     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
20652     for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
20653         mem_base = xmlMemBlocks();
20654         doc = gen_xmlDocPtr(n_doc, 0);
20655         content = gen_const_xmlChar_ptr(n_content, 1);
20656 
20657         ret_val = xmlNewDocComment(doc, content);
20658         desret_xmlNodePtr(ret_val);
20659         call_tests++;
20660         des_xmlDocPtr(n_doc, doc, 0);
20661         des_const_xmlChar_ptr(n_content, content, 1);
20662         xmlResetLastError();
20663         if (mem_base != xmlMemBlocks()) {
20664             printf("Leak of %d blocks found in xmlNewDocComment",
20665 	           xmlMemBlocks() - mem_base);
20666 	    test_ret++;
20667             printf(" %d", n_doc);
20668             printf(" %d", n_content);
20669             printf("\n");
20670         }
20671     }
20672     }
20673     function_tests++;
20674 
20675     return(test_ret);
20676 }
20677 
20678 
20679 static int
test_xmlNewDocFragment(void)20680 test_xmlNewDocFragment(void) {
20681     int test_ret = 0;
20682 
20683 #if defined(LIBXML_TREE_ENABLED)
20684     int mem_base;
20685     xmlNodePtr ret_val;
20686     xmlDocPtr doc; /* the document owning the fragment */
20687     int n_doc;
20688 
20689     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
20690         mem_base = xmlMemBlocks();
20691         doc = gen_xmlDocPtr(n_doc, 0);
20692 
20693         ret_val = xmlNewDocFragment(doc);
20694         desret_xmlNodePtr(ret_val);
20695         call_tests++;
20696         des_xmlDocPtr(n_doc, doc, 0);
20697         xmlResetLastError();
20698         if (mem_base != xmlMemBlocks()) {
20699             printf("Leak of %d blocks found in xmlNewDocFragment",
20700 	           xmlMemBlocks() - mem_base);
20701 	    test_ret++;
20702             printf(" %d", n_doc);
20703             printf("\n");
20704         }
20705     }
20706     function_tests++;
20707 #endif
20708 
20709     return(test_ret);
20710 }
20711 
20712 
20713 static int
test_xmlNewDocNode(void)20714 test_xmlNewDocNode(void) {
20715     int test_ret = 0;
20716 
20717     int mem_base;
20718     xmlNodePtr ret_val;
20719     xmlDocPtr doc; /* the document */
20720     int n_doc;
20721     xmlNsPtr ns; /* namespace if any */
20722     int n_ns;
20723     const xmlChar * name; /* the node name */
20724     int n_name;
20725     const xmlChar * content; /* the XML text content if any */
20726     int n_content;
20727 
20728     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
20729     for (n_ns = 0;n_ns < gen_nb_xmlNsPtr;n_ns++) {
20730     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
20731     for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
20732         mem_base = xmlMemBlocks();
20733         doc = gen_xmlDocPtr(n_doc, 0);
20734         ns = gen_xmlNsPtr(n_ns, 1);
20735         name = gen_const_xmlChar_ptr(n_name, 2);
20736         content = gen_const_xmlChar_ptr(n_content, 3);
20737 
20738         ret_val = xmlNewDocNode(doc, ns, name, content);
20739         desret_xmlNodePtr(ret_val);
20740         call_tests++;
20741         des_xmlDocPtr(n_doc, doc, 0);
20742         des_xmlNsPtr(n_ns, ns, 1);
20743         des_const_xmlChar_ptr(n_name, name, 2);
20744         des_const_xmlChar_ptr(n_content, content, 3);
20745         xmlResetLastError();
20746         if (mem_base != xmlMemBlocks()) {
20747             printf("Leak of %d blocks found in xmlNewDocNode",
20748 	           xmlMemBlocks() - mem_base);
20749 	    test_ret++;
20750             printf(" %d", n_doc);
20751             printf(" %d", n_ns);
20752             printf(" %d", n_name);
20753             printf(" %d", n_content);
20754             printf("\n");
20755         }
20756     }
20757     }
20758     }
20759     }
20760     function_tests++;
20761 
20762     return(test_ret);
20763 }
20764 
20765 
20766 static int
test_xmlNewDocNodeEatName(void)20767 test_xmlNewDocNodeEatName(void) {
20768     int test_ret = 0;
20769 
20770     int mem_base;
20771     xmlNodePtr ret_val;
20772     xmlDocPtr doc; /* the document */
20773     int n_doc;
20774     xmlNsPtr ns; /* namespace if any */
20775     int n_ns;
20776     xmlChar * name; /* the node name */
20777     int n_name;
20778     const xmlChar * content; /* the XML text content if any */
20779     int n_content;
20780 
20781     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
20782     for (n_ns = 0;n_ns < gen_nb_xmlNsPtr;n_ns++) {
20783     for (n_name = 0;n_name < gen_nb_eaten_name;n_name++) {
20784     for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
20785         mem_base = xmlMemBlocks();
20786         doc = gen_xmlDocPtr(n_doc, 0);
20787         ns = gen_xmlNsPtr(n_ns, 1);
20788         name = gen_eaten_name(n_name, 2);
20789         content = gen_const_xmlChar_ptr(n_content, 3);
20790 
20791         ret_val = xmlNewDocNodeEatName(doc, ns, name, content);
20792         desret_xmlNodePtr(ret_val);
20793         call_tests++;
20794         des_xmlDocPtr(n_doc, doc, 0);
20795         des_xmlNsPtr(n_ns, ns, 1);
20796         des_eaten_name(n_name, name, 2);
20797         des_const_xmlChar_ptr(n_content, content, 3);
20798         xmlResetLastError();
20799         if (mem_base != xmlMemBlocks()) {
20800             printf("Leak of %d blocks found in xmlNewDocNodeEatName",
20801 	           xmlMemBlocks() - mem_base);
20802 	    test_ret++;
20803             printf(" %d", n_doc);
20804             printf(" %d", n_ns);
20805             printf(" %d", n_name);
20806             printf(" %d", n_content);
20807             printf("\n");
20808         }
20809     }
20810     }
20811     }
20812     }
20813     function_tests++;
20814 
20815     return(test_ret);
20816 }
20817 
20818 
20819 static int
test_xmlNewDocPI(void)20820 test_xmlNewDocPI(void) {
20821     int test_ret = 0;
20822 
20823     int mem_base;
20824     xmlNodePtr ret_val;
20825     xmlDocPtr doc; /* the target document */
20826     int n_doc;
20827     const xmlChar * name; /* the processing instruction name */
20828     int n_name;
20829     const xmlChar * content; /* the PI content */
20830     int n_content;
20831 
20832     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
20833     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
20834     for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
20835         mem_base = xmlMemBlocks();
20836         doc = gen_xmlDocPtr(n_doc, 0);
20837         name = gen_const_xmlChar_ptr(n_name, 1);
20838         content = gen_const_xmlChar_ptr(n_content, 2);
20839 
20840         ret_val = xmlNewDocPI(doc, name, content);
20841         desret_xmlNodePtr(ret_val);
20842         call_tests++;
20843         des_xmlDocPtr(n_doc, doc, 0);
20844         des_const_xmlChar_ptr(n_name, name, 1);
20845         des_const_xmlChar_ptr(n_content, content, 2);
20846         xmlResetLastError();
20847         if (mem_base != xmlMemBlocks()) {
20848             printf("Leak of %d blocks found in xmlNewDocPI",
20849 	           xmlMemBlocks() - mem_base);
20850 	    test_ret++;
20851             printf(" %d", n_doc);
20852             printf(" %d", n_name);
20853             printf(" %d", n_content);
20854             printf("\n");
20855         }
20856     }
20857     }
20858     }
20859     function_tests++;
20860 
20861     return(test_ret);
20862 }
20863 
20864 
20865 static int
test_xmlNewDocProp(void)20866 test_xmlNewDocProp(void) {
20867     int test_ret = 0;
20868 
20869     int mem_base;
20870     xmlAttrPtr ret_val;
20871     xmlDocPtr doc; /* the document */
20872     int n_doc;
20873     const xmlChar * name; /* the name of the attribute */
20874     int n_name;
20875     const xmlChar * value; /* the value of the attribute */
20876     int n_value;
20877 
20878     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
20879     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
20880     for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
20881         mem_base = xmlMemBlocks();
20882         doc = gen_xmlDocPtr(n_doc, 0);
20883         name = gen_const_xmlChar_ptr(n_name, 1);
20884         value = gen_const_xmlChar_ptr(n_value, 2);
20885 
20886         ret_val = xmlNewDocProp(doc, name, value);
20887         desret_xmlAttrPtr(ret_val);
20888         call_tests++;
20889         des_xmlDocPtr(n_doc, doc, 0);
20890         des_const_xmlChar_ptr(n_name, name, 1);
20891         des_const_xmlChar_ptr(n_value, value, 2);
20892         xmlResetLastError();
20893         if (mem_base != xmlMemBlocks()) {
20894             printf("Leak of %d blocks found in xmlNewDocProp",
20895 	           xmlMemBlocks() - mem_base);
20896 	    test_ret++;
20897             printf(" %d", n_doc);
20898             printf(" %d", n_name);
20899             printf(" %d", n_value);
20900             printf("\n");
20901         }
20902     }
20903     }
20904     }
20905     function_tests++;
20906 
20907     return(test_ret);
20908 }
20909 
20910 
20911 static int
test_xmlNewDocRawNode(void)20912 test_xmlNewDocRawNode(void) {
20913     int test_ret = 0;
20914 
20915 #if defined(LIBXML_TREE_ENABLED)
20916 #ifdef LIBXML_TREE_ENABLED
20917     int mem_base;
20918     xmlNodePtr ret_val;
20919     xmlDocPtr doc; /* the document */
20920     int n_doc;
20921     xmlNsPtr ns; /* namespace if any */
20922     int n_ns;
20923     const xmlChar * name; /* the node name */
20924     int n_name;
20925     const xmlChar * content; /* the text content if any */
20926     int n_content;
20927 
20928     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
20929     for (n_ns = 0;n_ns < gen_nb_xmlNsPtr;n_ns++) {
20930     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
20931     for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
20932         mem_base = xmlMemBlocks();
20933         doc = gen_xmlDocPtr(n_doc, 0);
20934         ns = gen_xmlNsPtr(n_ns, 1);
20935         name = gen_const_xmlChar_ptr(n_name, 2);
20936         content = gen_const_xmlChar_ptr(n_content, 3);
20937 
20938         ret_val = xmlNewDocRawNode(doc, ns, name, content);
20939         desret_xmlNodePtr(ret_val);
20940         call_tests++;
20941         des_xmlDocPtr(n_doc, doc, 0);
20942         des_xmlNsPtr(n_ns, ns, 1);
20943         des_const_xmlChar_ptr(n_name, name, 2);
20944         des_const_xmlChar_ptr(n_content, content, 3);
20945         xmlResetLastError();
20946         if (mem_base != xmlMemBlocks()) {
20947             printf("Leak of %d blocks found in xmlNewDocRawNode",
20948 	           xmlMemBlocks() - mem_base);
20949 	    test_ret++;
20950             printf(" %d", n_doc);
20951             printf(" %d", n_ns);
20952             printf(" %d", n_name);
20953             printf(" %d", n_content);
20954             printf("\n");
20955         }
20956     }
20957     }
20958     }
20959     }
20960     function_tests++;
20961 #endif
20962 #endif
20963 
20964     return(test_ret);
20965 }
20966 
20967 
20968 static int
test_xmlNewDocText(void)20969 test_xmlNewDocText(void) {
20970     int test_ret = 0;
20971 
20972     int mem_base;
20973     xmlNodePtr ret_val;
20974     const xmlDoc * doc; /* the document */
20975     int n_doc;
20976     const xmlChar * content; /* the text content */
20977     int n_content;
20978 
20979     for (n_doc = 0;n_doc < gen_nb_const_xmlDoc_ptr;n_doc++) {
20980     for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
20981         mem_base = xmlMemBlocks();
20982         doc = gen_const_xmlDoc_ptr(n_doc, 0);
20983         content = gen_const_xmlChar_ptr(n_content, 1);
20984 
20985         ret_val = xmlNewDocText(doc, content);
20986         desret_xmlNodePtr(ret_val);
20987         call_tests++;
20988         des_const_xmlDoc_ptr(n_doc, doc, 0);
20989         des_const_xmlChar_ptr(n_content, content, 1);
20990         xmlResetLastError();
20991         if (mem_base != xmlMemBlocks()) {
20992             printf("Leak of %d blocks found in xmlNewDocText",
20993 	           xmlMemBlocks() - mem_base);
20994 	    test_ret++;
20995             printf(" %d", n_doc);
20996             printf(" %d", n_content);
20997             printf("\n");
20998         }
20999     }
21000     }
21001     function_tests++;
21002 
21003     return(test_ret);
21004 }
21005 
21006 
21007 static int
test_xmlNewDocTextLen(void)21008 test_xmlNewDocTextLen(void) {
21009     int test_ret = 0;
21010 
21011     int mem_base;
21012     xmlNodePtr ret_val;
21013     xmlDocPtr doc; /* the document */
21014     int n_doc;
21015     const xmlChar * content; /* the text content */
21016     int n_content;
21017     int len; /* the text len. */
21018     int n_len;
21019 
21020     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
21021     for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
21022     for (n_len = 0;n_len < gen_nb_int;n_len++) {
21023         mem_base = xmlMemBlocks();
21024         doc = gen_xmlDocPtr(n_doc, 0);
21025         content = gen_const_xmlChar_ptr(n_content, 1);
21026         len = gen_int(n_len, 2);
21027         if ((content != NULL) &&
21028             (len > xmlStrlen(BAD_CAST content)))
21029             len = 0;
21030 
21031         ret_val = xmlNewDocTextLen(doc, content, len);
21032         desret_xmlNodePtr(ret_val);
21033         call_tests++;
21034         des_xmlDocPtr(n_doc, doc, 0);
21035         des_const_xmlChar_ptr(n_content, content, 1);
21036         des_int(n_len, len, 2);
21037         xmlResetLastError();
21038         if (mem_base != xmlMemBlocks()) {
21039             printf("Leak of %d blocks found in xmlNewDocTextLen",
21040 	           xmlMemBlocks() - mem_base);
21041 	    test_ret++;
21042             printf(" %d", n_doc);
21043             printf(" %d", n_content);
21044             printf(" %d", n_len);
21045             printf("\n");
21046         }
21047     }
21048     }
21049     }
21050     function_tests++;
21051 
21052     return(test_ret);
21053 }
21054 
21055 
21056 static int
test_xmlNewDtd(void)21057 test_xmlNewDtd(void) {
21058     int test_ret = 0;
21059 
21060     int mem_base;
21061     xmlDtdPtr ret_val;
21062     xmlDocPtr doc; /* the document pointer */
21063     int n_doc;
21064     const xmlChar * name; /* the DTD name */
21065     int n_name;
21066     const xmlChar * ExternalID; /* the external ID */
21067     int n_ExternalID;
21068     const xmlChar * SystemID; /* the system ID */
21069     int n_SystemID;
21070 
21071     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
21072     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
21073     for (n_ExternalID = 0;n_ExternalID < gen_nb_const_xmlChar_ptr;n_ExternalID++) {
21074     for (n_SystemID = 0;n_SystemID < gen_nb_const_xmlChar_ptr;n_SystemID++) {
21075         mem_base = xmlMemBlocks();
21076         doc = gen_xmlDocPtr(n_doc, 0);
21077         name = gen_const_xmlChar_ptr(n_name, 1);
21078         ExternalID = gen_const_xmlChar_ptr(n_ExternalID, 2);
21079         SystemID = gen_const_xmlChar_ptr(n_SystemID, 3);
21080 
21081         ret_val = xmlNewDtd(doc, name, ExternalID, SystemID);
21082         desret_xmlDtdPtr(ret_val);
21083         call_tests++;
21084         des_xmlDocPtr(n_doc, doc, 0);
21085         des_const_xmlChar_ptr(n_name, name, 1);
21086         des_const_xmlChar_ptr(n_ExternalID, ExternalID, 2);
21087         des_const_xmlChar_ptr(n_SystemID, SystemID, 3);
21088         xmlResetLastError();
21089         if (mem_base != xmlMemBlocks()) {
21090             printf("Leak of %d blocks found in xmlNewDtd",
21091 	           xmlMemBlocks() - mem_base);
21092 	    test_ret++;
21093             printf(" %d", n_doc);
21094             printf(" %d", n_name);
21095             printf(" %d", n_ExternalID);
21096             printf(" %d", n_SystemID);
21097             printf("\n");
21098         }
21099     }
21100     }
21101     }
21102     }
21103     function_tests++;
21104 
21105     return(test_ret);
21106 }
21107 
21108 
21109 static int
test_xmlNewNode(void)21110 test_xmlNewNode(void) {
21111     int test_ret = 0;
21112 
21113     int mem_base;
21114     xmlNodePtr ret_val;
21115     xmlNsPtr ns; /* namespace if any */
21116     int n_ns;
21117     const xmlChar * name; /* the node name */
21118     int n_name;
21119 
21120     for (n_ns = 0;n_ns < gen_nb_xmlNsPtr;n_ns++) {
21121     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
21122         mem_base = xmlMemBlocks();
21123         ns = gen_xmlNsPtr(n_ns, 0);
21124         name = gen_const_xmlChar_ptr(n_name, 1);
21125 
21126         ret_val = xmlNewNode(ns, name);
21127         desret_xmlNodePtr(ret_val);
21128         call_tests++;
21129         des_xmlNsPtr(n_ns, ns, 0);
21130         des_const_xmlChar_ptr(n_name, name, 1);
21131         xmlResetLastError();
21132         if (mem_base != xmlMemBlocks()) {
21133             printf("Leak of %d blocks found in xmlNewNode",
21134 	           xmlMemBlocks() - mem_base);
21135 	    test_ret++;
21136             printf(" %d", n_ns);
21137             printf(" %d", n_name);
21138             printf("\n");
21139         }
21140     }
21141     }
21142     function_tests++;
21143 
21144     return(test_ret);
21145 }
21146 
21147 
21148 static int
test_xmlNewNodeEatName(void)21149 test_xmlNewNodeEatName(void) {
21150     int test_ret = 0;
21151 
21152     int mem_base;
21153     xmlNodePtr ret_val;
21154     xmlNsPtr ns; /* namespace if any */
21155     int n_ns;
21156     xmlChar * name; /* the node name */
21157     int n_name;
21158 
21159     for (n_ns = 0;n_ns < gen_nb_xmlNsPtr;n_ns++) {
21160     for (n_name = 0;n_name < gen_nb_eaten_name;n_name++) {
21161         mem_base = xmlMemBlocks();
21162         ns = gen_xmlNsPtr(n_ns, 0);
21163         name = gen_eaten_name(n_name, 1);
21164 
21165         ret_val = xmlNewNodeEatName(ns, name);
21166         desret_xmlNodePtr(ret_val);
21167         call_tests++;
21168         des_xmlNsPtr(n_ns, ns, 0);
21169         des_eaten_name(n_name, name, 1);
21170         xmlResetLastError();
21171         if (mem_base != xmlMemBlocks()) {
21172             printf("Leak of %d blocks found in xmlNewNodeEatName",
21173 	           xmlMemBlocks() - mem_base);
21174 	    test_ret++;
21175             printf(" %d", n_ns);
21176             printf(" %d", n_name);
21177             printf("\n");
21178         }
21179     }
21180     }
21181     function_tests++;
21182 
21183     return(test_ret);
21184 }
21185 
21186 
21187 static int
test_xmlNewNs(void)21188 test_xmlNewNs(void) {
21189     int test_ret = 0;
21190 
21191     int mem_base;
21192     xmlNsPtr ret_val;
21193     xmlNodePtr node; /* the element carrying the namespace */
21194     int n_node;
21195     const xmlChar * href; /* the URI associated */
21196     int n_href;
21197     const xmlChar * prefix; /* the prefix for the namespace */
21198     int n_prefix;
21199 
21200     for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
21201     for (n_href = 0;n_href < gen_nb_const_xmlChar_ptr;n_href++) {
21202     for (n_prefix = 0;n_prefix < gen_nb_const_xmlChar_ptr;n_prefix++) {
21203         mem_base = xmlMemBlocks();
21204         node = gen_xmlNodePtr(n_node, 0);
21205         href = gen_const_xmlChar_ptr(n_href, 1);
21206         prefix = gen_const_xmlChar_ptr(n_prefix, 2);
21207 
21208         ret_val = xmlNewNs(node, href, prefix);
21209         if ((node == NULL) && (ret_val != NULL)) xmlFreeNs(ret_val);
21210         desret_xmlNsPtr(ret_val);
21211         call_tests++;
21212         des_xmlNodePtr(n_node, node, 0);
21213         des_const_xmlChar_ptr(n_href, href, 1);
21214         des_const_xmlChar_ptr(n_prefix, prefix, 2);
21215         xmlResetLastError();
21216         if (mem_base != xmlMemBlocks()) {
21217             printf("Leak of %d blocks found in xmlNewNs",
21218 	           xmlMemBlocks() - mem_base);
21219 	    test_ret++;
21220             printf(" %d", n_node);
21221             printf(" %d", n_href);
21222             printf(" %d", n_prefix);
21223             printf("\n");
21224         }
21225     }
21226     }
21227     }
21228     function_tests++;
21229 
21230     return(test_ret);
21231 }
21232 
21233 
21234 static int
test_xmlNewNsProp(void)21235 test_xmlNewNsProp(void) {
21236     int test_ret = 0;
21237 
21238     int mem_base;
21239     xmlAttrPtr ret_val;
21240     xmlNodePtr node; /* the holding node */
21241     int n_node;
21242     xmlNsPtr ns; /* the namespace */
21243     int n_ns;
21244     const xmlChar * name; /* the name of the attribute */
21245     int n_name;
21246     const xmlChar * value; /* the value of the attribute */
21247     int n_value;
21248 
21249     for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
21250     for (n_ns = 0;n_ns < gen_nb_xmlNsPtr;n_ns++) {
21251     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
21252     for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
21253         mem_base = xmlMemBlocks();
21254         node = gen_xmlNodePtr(n_node, 0);
21255         ns = gen_xmlNsPtr(n_ns, 1);
21256         name = gen_const_xmlChar_ptr(n_name, 2);
21257         value = gen_const_xmlChar_ptr(n_value, 3);
21258 
21259         ret_val = xmlNewNsProp(node, ns, name, value);
21260         desret_xmlAttrPtr(ret_val);
21261         call_tests++;
21262         des_xmlNodePtr(n_node, node, 0);
21263         des_xmlNsPtr(n_ns, ns, 1);
21264         des_const_xmlChar_ptr(n_name, name, 2);
21265         des_const_xmlChar_ptr(n_value, value, 3);
21266         xmlResetLastError();
21267         if (mem_base != xmlMemBlocks()) {
21268             printf("Leak of %d blocks found in xmlNewNsProp",
21269 	           xmlMemBlocks() - mem_base);
21270 	    test_ret++;
21271             printf(" %d", n_node);
21272             printf(" %d", n_ns);
21273             printf(" %d", n_name);
21274             printf(" %d", n_value);
21275             printf("\n");
21276         }
21277     }
21278     }
21279     }
21280     }
21281     function_tests++;
21282 
21283     return(test_ret);
21284 }
21285 
21286 
21287 static int
test_xmlNewNsPropEatName(void)21288 test_xmlNewNsPropEatName(void) {
21289     int test_ret = 0;
21290 
21291     int mem_base;
21292     xmlAttrPtr ret_val;
21293     xmlNodePtr node; /* the holding node */
21294     int n_node;
21295     xmlNsPtr ns; /* the namespace */
21296     int n_ns;
21297     xmlChar * name; /* the name of the attribute */
21298     int n_name;
21299     const xmlChar * value; /* the value of the attribute */
21300     int n_value;
21301 
21302     for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
21303     for (n_ns = 0;n_ns < gen_nb_xmlNsPtr;n_ns++) {
21304     for (n_name = 0;n_name < gen_nb_eaten_name;n_name++) {
21305     for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
21306         mem_base = xmlMemBlocks();
21307         node = gen_xmlNodePtr(n_node, 0);
21308         ns = gen_xmlNsPtr(n_ns, 1);
21309         name = gen_eaten_name(n_name, 2);
21310         value = gen_const_xmlChar_ptr(n_value, 3);
21311 
21312         ret_val = xmlNewNsPropEatName(node, ns, name, value);
21313         desret_xmlAttrPtr(ret_val);
21314         call_tests++;
21315         des_xmlNodePtr(n_node, node, 0);
21316         des_xmlNsPtr(n_ns, ns, 1);
21317         des_eaten_name(n_name, name, 2);
21318         des_const_xmlChar_ptr(n_value, value, 3);
21319         xmlResetLastError();
21320         if (mem_base != xmlMemBlocks()) {
21321             printf("Leak of %d blocks found in xmlNewNsPropEatName",
21322 	           xmlMemBlocks() - mem_base);
21323 	    test_ret++;
21324             printf(" %d", n_node);
21325             printf(" %d", n_ns);
21326             printf(" %d", n_name);
21327             printf(" %d", n_value);
21328             printf("\n");
21329         }
21330     }
21331     }
21332     }
21333     }
21334     function_tests++;
21335 
21336     return(test_ret);
21337 }
21338 
21339 
21340 static int
test_xmlNewPI(void)21341 test_xmlNewPI(void) {
21342     int test_ret = 0;
21343 
21344     int mem_base;
21345     xmlNodePtr ret_val;
21346     const xmlChar * name; /* the processing instruction name */
21347     int n_name;
21348     const xmlChar * content; /* the PI content */
21349     int n_content;
21350 
21351     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
21352     for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
21353         mem_base = xmlMemBlocks();
21354         name = gen_const_xmlChar_ptr(n_name, 0);
21355         content = gen_const_xmlChar_ptr(n_content, 1);
21356 
21357         ret_val = xmlNewPI(name, content);
21358         desret_xmlNodePtr(ret_val);
21359         call_tests++;
21360         des_const_xmlChar_ptr(n_name, name, 0);
21361         des_const_xmlChar_ptr(n_content, content, 1);
21362         xmlResetLastError();
21363         if (mem_base != xmlMemBlocks()) {
21364             printf("Leak of %d blocks found in xmlNewPI",
21365 	           xmlMemBlocks() - mem_base);
21366 	    test_ret++;
21367             printf(" %d", n_name);
21368             printf(" %d", n_content);
21369             printf("\n");
21370         }
21371     }
21372     }
21373     function_tests++;
21374 
21375     return(test_ret);
21376 }
21377 
21378 
21379 static int
test_xmlNewProp(void)21380 test_xmlNewProp(void) {
21381     int test_ret = 0;
21382 
21383 #if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_HTML_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED)
21384 #ifdef LIBXML_TREE_ENABLED
21385     int mem_base;
21386     xmlAttrPtr ret_val;
21387     xmlNodePtr node; /* the holding node */
21388     int n_node;
21389     const xmlChar * name; /* the name of the attribute */
21390     int n_name;
21391     const xmlChar * value; /* the value of the attribute */
21392     int n_value;
21393 
21394     for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
21395     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
21396     for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
21397         mem_base = xmlMemBlocks();
21398         node = gen_xmlNodePtr(n_node, 0);
21399         name = gen_const_xmlChar_ptr(n_name, 1);
21400         value = gen_const_xmlChar_ptr(n_value, 2);
21401 
21402         ret_val = xmlNewProp(node, name, value);
21403         desret_xmlAttrPtr(ret_val);
21404         call_tests++;
21405         des_xmlNodePtr(n_node, node, 0);
21406         des_const_xmlChar_ptr(n_name, name, 1);
21407         des_const_xmlChar_ptr(n_value, value, 2);
21408         xmlResetLastError();
21409         if (mem_base != xmlMemBlocks()) {
21410             printf("Leak of %d blocks found in xmlNewProp",
21411 	           xmlMemBlocks() - mem_base);
21412 	    test_ret++;
21413             printf(" %d", n_node);
21414             printf(" %d", n_name);
21415             printf(" %d", n_value);
21416             printf("\n");
21417         }
21418     }
21419     }
21420     }
21421     function_tests++;
21422 #endif
21423 #endif
21424 
21425     return(test_ret);
21426 }
21427 
21428 
21429 static int
test_xmlNewReference(void)21430 test_xmlNewReference(void) {
21431     int test_ret = 0;
21432 
21433     int mem_base;
21434     xmlNodePtr ret_val;
21435     const xmlDoc * doc; /* the document */
21436     int n_doc;
21437     const xmlChar * name; /* the reference name, or the reference string with & and ; */
21438     int n_name;
21439 
21440     for (n_doc = 0;n_doc < gen_nb_const_xmlDoc_ptr;n_doc++) {
21441     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
21442         mem_base = xmlMemBlocks();
21443         doc = gen_const_xmlDoc_ptr(n_doc, 0);
21444         name = gen_const_xmlChar_ptr(n_name, 1);
21445 
21446         ret_val = xmlNewReference(doc, name);
21447         desret_xmlNodePtr(ret_val);
21448         call_tests++;
21449         des_const_xmlDoc_ptr(n_doc, doc, 0);
21450         des_const_xmlChar_ptr(n_name, name, 1);
21451         xmlResetLastError();
21452         if (mem_base != xmlMemBlocks()) {
21453             printf("Leak of %d blocks found in xmlNewReference",
21454 	           xmlMemBlocks() - mem_base);
21455 	    test_ret++;
21456             printf(" %d", n_doc);
21457             printf(" %d", n_name);
21458             printf("\n");
21459         }
21460     }
21461     }
21462     function_tests++;
21463 
21464     return(test_ret);
21465 }
21466 
21467 
21468 static int
test_xmlNewText(void)21469 test_xmlNewText(void) {
21470     int test_ret = 0;
21471 
21472     int mem_base;
21473     xmlNodePtr ret_val;
21474     const xmlChar * content; /* the text content */
21475     int n_content;
21476 
21477     for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
21478         mem_base = xmlMemBlocks();
21479         content = gen_const_xmlChar_ptr(n_content, 0);
21480 
21481         ret_val = xmlNewText(content);
21482         desret_xmlNodePtr(ret_val);
21483         call_tests++;
21484         des_const_xmlChar_ptr(n_content, content, 0);
21485         xmlResetLastError();
21486         if (mem_base != xmlMemBlocks()) {
21487             printf("Leak of %d blocks found in xmlNewText",
21488 	           xmlMemBlocks() - mem_base);
21489 	    test_ret++;
21490             printf(" %d", n_content);
21491             printf("\n");
21492         }
21493     }
21494     function_tests++;
21495 
21496     return(test_ret);
21497 }
21498 
21499 
21500 static int
test_xmlNewTextChild(void)21501 test_xmlNewTextChild(void) {
21502     int test_ret = 0;
21503 
21504 #if defined(LIBXML_TREE_ENABLED)
21505 #ifdef LIBXML_TREE_ENABLED
21506     int mem_base;
21507     xmlNodePtr ret_val;
21508     xmlNodePtr parent; /* the parent node */
21509     int n_parent;
21510     xmlNsPtr ns; /* a namespace if any */
21511     int n_ns;
21512     const xmlChar * name; /* the name of the child */
21513     int n_name;
21514     const xmlChar * content; /* the text content of the child if any. */
21515     int n_content;
21516 
21517     for (n_parent = 0;n_parent < gen_nb_xmlNodePtr;n_parent++) {
21518     for (n_ns = 0;n_ns < gen_nb_xmlNsPtr;n_ns++) {
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         parent = gen_xmlNodePtr(n_parent, 0);
21523         ns = gen_xmlNsPtr(n_ns, 1);
21524         name = gen_const_xmlChar_ptr(n_name, 2);
21525         content = gen_const_xmlChar_ptr(n_content, 3);
21526 
21527         ret_val = xmlNewTextChild(parent, ns, name, content);
21528         desret_xmlNodePtr(ret_val);
21529         call_tests++;
21530         des_xmlNodePtr(n_parent, parent, 0);
21531         des_xmlNsPtr(n_ns, ns, 1);
21532         des_const_xmlChar_ptr(n_name, name, 2);
21533         des_const_xmlChar_ptr(n_content, content, 3);
21534         xmlResetLastError();
21535         if (mem_base != xmlMemBlocks()) {
21536             printf("Leak of %d blocks found in xmlNewTextChild",
21537 	           xmlMemBlocks() - mem_base);
21538 	    test_ret++;
21539             printf(" %d", n_parent);
21540             printf(" %d", n_ns);
21541             printf(" %d", n_name);
21542             printf(" %d", n_content);
21543             printf("\n");
21544         }
21545     }
21546     }
21547     }
21548     }
21549     function_tests++;
21550 #endif
21551 #endif
21552 
21553     return(test_ret);
21554 }
21555 
21556 
21557 static int
test_xmlNewTextLen(void)21558 test_xmlNewTextLen(void) {
21559     int test_ret = 0;
21560 
21561     int mem_base;
21562     xmlNodePtr ret_val;
21563     const xmlChar * content; /* the text content */
21564     int n_content;
21565     int len; /* the text len. */
21566     int n_len;
21567 
21568     for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
21569     for (n_len = 0;n_len < gen_nb_int;n_len++) {
21570         mem_base = xmlMemBlocks();
21571         content = gen_const_xmlChar_ptr(n_content, 0);
21572         len = gen_int(n_len, 1);
21573         if ((content != NULL) &&
21574             (len > xmlStrlen(BAD_CAST content)))
21575             len = 0;
21576 
21577         ret_val = xmlNewTextLen(content, len);
21578         desret_xmlNodePtr(ret_val);
21579         call_tests++;
21580         des_const_xmlChar_ptr(n_content, content, 0);
21581         des_int(n_len, len, 1);
21582         xmlResetLastError();
21583         if (mem_base != xmlMemBlocks()) {
21584             printf("Leak of %d blocks found in xmlNewTextLen",
21585 	           xmlMemBlocks() - mem_base);
21586 	    test_ret++;
21587             printf(" %d", n_content);
21588             printf(" %d", n_len);
21589             printf("\n");
21590         }
21591     }
21592     }
21593     function_tests++;
21594 
21595     return(test_ret);
21596 }
21597 
21598 
21599 static int
test_xmlNextElementSibling(void)21600 test_xmlNextElementSibling(void) {
21601     int test_ret = 0;
21602 
21603 #if defined(LIBXML_TREE_ENABLED)
21604     int mem_base;
21605     xmlNodePtr ret_val;
21606     xmlNodePtr node; /* the current node */
21607     int n_node;
21608 
21609     for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
21610         mem_base = xmlMemBlocks();
21611         node = gen_xmlNodePtr(n_node, 0);
21612 
21613         ret_val = xmlNextElementSibling(node);
21614         desret_xmlNodePtr(ret_val);
21615         call_tests++;
21616         des_xmlNodePtr(n_node, node, 0);
21617         xmlResetLastError();
21618         if (mem_base != xmlMemBlocks()) {
21619             printf("Leak of %d blocks found in xmlNextElementSibling",
21620 	           xmlMemBlocks() - mem_base);
21621 	    test_ret++;
21622             printf(" %d", n_node);
21623             printf("\n");
21624         }
21625     }
21626     function_tests++;
21627 #endif
21628 
21629     return(test_ret);
21630 }
21631 
21632 
21633 static int
test_xmlNodeAddContent(void)21634 test_xmlNodeAddContent(void) {
21635     int test_ret = 0;
21636 
21637     int mem_base;
21638     xmlNodePtr cur; /* the node being modified */
21639     int n_cur;
21640     const xmlChar * content; /* extra content */
21641     int n_content;
21642 
21643     for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
21644     for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
21645         mem_base = xmlMemBlocks();
21646         cur = gen_xmlNodePtr(n_cur, 0);
21647         content = gen_const_xmlChar_ptr(n_content, 1);
21648 
21649         xmlNodeAddContent(cur, content);
21650         call_tests++;
21651         des_xmlNodePtr(n_cur, cur, 0);
21652         des_const_xmlChar_ptr(n_content, content, 1);
21653         xmlResetLastError();
21654         if (mem_base != xmlMemBlocks()) {
21655             printf("Leak of %d blocks found in xmlNodeAddContent",
21656 	           xmlMemBlocks() - mem_base);
21657 	    test_ret++;
21658             printf(" %d", n_cur);
21659             printf(" %d", n_content);
21660             printf("\n");
21661         }
21662     }
21663     }
21664     function_tests++;
21665 
21666     return(test_ret);
21667 }
21668 
21669 
21670 static int
test_xmlNodeAddContentLen(void)21671 test_xmlNodeAddContentLen(void) {
21672     int test_ret = 0;
21673 
21674     int mem_base;
21675     xmlNodePtr cur; /* the node being modified */
21676     int n_cur;
21677     const xmlChar * content; /* extra content */
21678     int n_content;
21679     int len; /* the size of @content */
21680     int n_len;
21681 
21682     for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
21683     for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
21684     for (n_len = 0;n_len < gen_nb_int;n_len++) {
21685         mem_base = xmlMemBlocks();
21686         cur = gen_xmlNodePtr(n_cur, 0);
21687         content = gen_const_xmlChar_ptr(n_content, 1);
21688         len = gen_int(n_len, 2);
21689         if ((content != NULL) &&
21690             (len > xmlStrlen(BAD_CAST content)))
21691             len = 0;
21692 
21693         xmlNodeAddContentLen(cur, content, len);
21694         call_tests++;
21695         des_xmlNodePtr(n_cur, cur, 0);
21696         des_const_xmlChar_ptr(n_content, content, 1);
21697         des_int(n_len, len, 2);
21698         xmlResetLastError();
21699         if (mem_base != xmlMemBlocks()) {
21700             printf("Leak of %d blocks found in xmlNodeAddContentLen",
21701 	           xmlMemBlocks() - mem_base);
21702 	    test_ret++;
21703             printf(" %d", n_cur);
21704             printf(" %d", n_content);
21705             printf(" %d", n_len);
21706             printf("\n");
21707         }
21708     }
21709     }
21710     }
21711     function_tests++;
21712 
21713     return(test_ret);
21714 }
21715 
21716 
21717 static int
test_xmlNodeBufGetContent(void)21718 test_xmlNodeBufGetContent(void) {
21719     int test_ret = 0;
21720 
21721     int mem_base;
21722     int ret_val;
21723     xmlBufferPtr buffer; /* a buffer */
21724     int n_buffer;
21725     const xmlNode * cur; /* the node being read */
21726     int n_cur;
21727 
21728     for (n_buffer = 0;n_buffer < gen_nb_xmlBufferPtr;n_buffer++) {
21729     for (n_cur = 0;n_cur < gen_nb_const_xmlNode_ptr;n_cur++) {
21730         mem_base = xmlMemBlocks();
21731         buffer = gen_xmlBufferPtr(n_buffer, 0);
21732         cur = gen_const_xmlNode_ptr(n_cur, 1);
21733 
21734         ret_val = xmlNodeBufGetContent(buffer, cur);
21735         desret_int(ret_val);
21736         call_tests++;
21737         des_xmlBufferPtr(n_buffer, buffer, 0);
21738         des_const_xmlNode_ptr(n_cur, cur, 1);
21739         xmlResetLastError();
21740         if (mem_base != xmlMemBlocks()) {
21741             printf("Leak of %d blocks found in xmlNodeBufGetContent",
21742 	           xmlMemBlocks() - mem_base);
21743 	    test_ret++;
21744             printf(" %d", n_buffer);
21745             printf(" %d", n_cur);
21746             printf("\n");
21747         }
21748     }
21749     }
21750     function_tests++;
21751 
21752     return(test_ret);
21753 }
21754 
21755 
21756 static int
test_xmlNodeDump(void)21757 test_xmlNodeDump(void) {
21758     int test_ret = 0;
21759 
21760 #if defined(LIBXML_OUTPUT_ENABLED)
21761     int mem_base;
21762     int ret_val;
21763     xmlBufferPtr buf; /* the XML buffer output */
21764     int n_buf;
21765     xmlDocPtr doc; /* the document */
21766     int n_doc;
21767     xmlNodePtr cur; /* the current node */
21768     int n_cur;
21769     int level; /* the imbrication level for indenting */
21770     int n_level;
21771     int format; /* is formatting allowed */
21772     int n_format;
21773 
21774     for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
21775     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
21776     for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
21777     for (n_level = 0;n_level < gen_nb_int;n_level++) {
21778     for (n_format = 0;n_format < gen_nb_int;n_format++) {
21779         mem_base = xmlMemBlocks();
21780         buf = gen_xmlBufferPtr(n_buf, 0);
21781         doc = gen_xmlDocPtr(n_doc, 1);
21782         cur = gen_xmlNodePtr(n_cur, 2);
21783         level = gen_int(n_level, 3);
21784         format = gen_int(n_format, 4);
21785 
21786         ret_val = xmlNodeDump(buf, doc, cur, level, format);
21787         desret_int(ret_val);
21788         call_tests++;
21789         des_xmlBufferPtr(n_buf, buf, 0);
21790         des_xmlDocPtr(n_doc, doc, 1);
21791         des_xmlNodePtr(n_cur, cur, 2);
21792         des_int(n_level, level, 3);
21793         des_int(n_format, format, 4);
21794         xmlResetLastError();
21795         if (mem_base != xmlMemBlocks()) {
21796             printf("Leak of %d blocks found in xmlNodeDump",
21797 	           xmlMemBlocks() - mem_base);
21798 	    test_ret++;
21799             printf(" %d", n_buf);
21800             printf(" %d", n_doc);
21801             printf(" %d", n_cur);
21802             printf(" %d", n_level);
21803             printf(" %d", n_format);
21804             printf("\n");
21805         }
21806     }
21807     }
21808     }
21809     }
21810     }
21811     function_tests++;
21812 #endif
21813 
21814     return(test_ret);
21815 }
21816 
21817 
21818 static int
test_xmlNodeDumpOutput(void)21819 test_xmlNodeDumpOutput(void) {
21820     int test_ret = 0;
21821 
21822 #if defined(LIBXML_OUTPUT_ENABLED)
21823     int mem_base;
21824     xmlOutputBufferPtr buf; /* the XML buffer output */
21825     int n_buf;
21826     xmlDocPtr doc; /* the document */
21827     int n_doc;
21828     xmlNodePtr cur; /* the current node */
21829     int n_cur;
21830     int level; /* the imbrication level for indenting */
21831     int n_level;
21832     int format; /* is formatting allowed */
21833     int n_format;
21834     const char * encoding; /* an optional encoding string */
21835     int n_encoding;
21836 
21837     for (n_buf = 0;n_buf < gen_nb_xmlOutputBufferPtr;n_buf++) {
21838     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
21839     for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
21840     for (n_level = 0;n_level < gen_nb_int;n_level++) {
21841     for (n_format = 0;n_format < gen_nb_int;n_format++) {
21842     for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
21843         mem_base = xmlMemBlocks();
21844         buf = gen_xmlOutputBufferPtr(n_buf, 0);
21845         doc = gen_xmlDocPtr(n_doc, 1);
21846         cur = gen_xmlNodePtr(n_cur, 2);
21847         level = gen_int(n_level, 3);
21848         format = gen_int(n_format, 4);
21849         encoding = gen_const_char_ptr(n_encoding, 5);
21850 
21851         xmlNodeDumpOutput(buf, doc, cur, level, format, encoding);
21852         call_tests++;
21853         des_xmlOutputBufferPtr(n_buf, buf, 0);
21854         des_xmlDocPtr(n_doc, doc, 1);
21855         des_xmlNodePtr(n_cur, cur, 2);
21856         des_int(n_level, level, 3);
21857         des_int(n_format, format, 4);
21858         des_const_char_ptr(n_encoding, encoding, 5);
21859         xmlResetLastError();
21860         if (mem_base != xmlMemBlocks()) {
21861             printf("Leak of %d blocks found in xmlNodeDumpOutput",
21862 	           xmlMemBlocks() - mem_base);
21863 	    test_ret++;
21864             printf(" %d", n_buf);
21865             printf(" %d", n_doc);
21866             printf(" %d", n_cur);
21867             printf(" %d", n_level);
21868             printf(" %d", n_format);
21869             printf(" %d", n_encoding);
21870             printf("\n");
21871         }
21872     }
21873     }
21874     }
21875     }
21876     }
21877     }
21878     function_tests++;
21879 #endif
21880 
21881     return(test_ret);
21882 }
21883 
21884 
21885 static int
test_xmlNodeGetBase(void)21886 test_xmlNodeGetBase(void) {
21887     int test_ret = 0;
21888 
21889     int mem_base;
21890     xmlChar * ret_val;
21891     const xmlDoc * doc; /* the document the node pertains to */
21892     int n_doc;
21893     const xmlNode * cur; /* the node being checked */
21894     int n_cur;
21895 
21896     for (n_doc = 0;n_doc < gen_nb_const_xmlDoc_ptr;n_doc++) {
21897     for (n_cur = 0;n_cur < gen_nb_const_xmlNode_ptr;n_cur++) {
21898         mem_base = xmlMemBlocks();
21899         doc = gen_const_xmlDoc_ptr(n_doc, 0);
21900         cur = gen_const_xmlNode_ptr(n_cur, 1);
21901 
21902         ret_val = xmlNodeGetBase(doc, cur);
21903         desret_xmlChar_ptr(ret_val);
21904         call_tests++;
21905         des_const_xmlDoc_ptr(n_doc, doc, 0);
21906         des_const_xmlNode_ptr(n_cur, cur, 1);
21907         xmlResetLastError();
21908         if (mem_base != xmlMemBlocks()) {
21909             printf("Leak of %d blocks found in xmlNodeGetBase",
21910 	           xmlMemBlocks() - mem_base);
21911 	    test_ret++;
21912             printf(" %d", n_doc);
21913             printf(" %d", n_cur);
21914             printf("\n");
21915         }
21916     }
21917     }
21918     function_tests++;
21919 
21920     return(test_ret);
21921 }
21922 
21923 
21924 static int
test_xmlNodeGetContent(void)21925 test_xmlNodeGetContent(void) {
21926     int test_ret = 0;
21927 
21928     int mem_base;
21929     xmlChar * ret_val;
21930     const xmlNode * cur; /* the node being read */
21931     int n_cur;
21932 
21933     for (n_cur = 0;n_cur < gen_nb_const_xmlNode_ptr;n_cur++) {
21934         mem_base = xmlMemBlocks();
21935         cur = gen_const_xmlNode_ptr(n_cur, 0);
21936 
21937         ret_val = xmlNodeGetContent(cur);
21938         desret_xmlChar_ptr(ret_val);
21939         call_tests++;
21940         des_const_xmlNode_ptr(n_cur, cur, 0);
21941         xmlResetLastError();
21942         if (mem_base != xmlMemBlocks()) {
21943             printf("Leak of %d blocks found in xmlNodeGetContent",
21944 	           xmlMemBlocks() - mem_base);
21945 	    test_ret++;
21946             printf(" %d", n_cur);
21947             printf("\n");
21948         }
21949     }
21950     function_tests++;
21951 
21952     return(test_ret);
21953 }
21954 
21955 
21956 static int
test_xmlNodeGetLang(void)21957 test_xmlNodeGetLang(void) {
21958     int test_ret = 0;
21959 
21960     int mem_base;
21961     xmlChar * ret_val;
21962     const xmlNode * cur; /* the node being checked */
21963     int n_cur;
21964 
21965     for (n_cur = 0;n_cur < gen_nb_const_xmlNode_ptr;n_cur++) {
21966         mem_base = xmlMemBlocks();
21967         cur = gen_const_xmlNode_ptr(n_cur, 0);
21968 
21969         ret_val = xmlNodeGetLang(cur);
21970         desret_xmlChar_ptr(ret_val);
21971         call_tests++;
21972         des_const_xmlNode_ptr(n_cur, cur, 0);
21973         xmlResetLastError();
21974         if (mem_base != xmlMemBlocks()) {
21975             printf("Leak of %d blocks found in xmlNodeGetLang",
21976 	           xmlMemBlocks() - mem_base);
21977 	    test_ret++;
21978             printf(" %d", n_cur);
21979             printf("\n");
21980         }
21981     }
21982     function_tests++;
21983 
21984     return(test_ret);
21985 }
21986 
21987 
21988 static int
test_xmlNodeGetSpacePreserve(void)21989 test_xmlNodeGetSpacePreserve(void) {
21990     int test_ret = 0;
21991 
21992     int mem_base;
21993     int ret_val;
21994     const xmlNode * cur; /* the node being checked */
21995     int n_cur;
21996 
21997     for (n_cur = 0;n_cur < gen_nb_const_xmlNode_ptr;n_cur++) {
21998         mem_base = xmlMemBlocks();
21999         cur = gen_const_xmlNode_ptr(n_cur, 0);
22000 
22001         ret_val = xmlNodeGetSpacePreserve(cur);
22002         desret_int(ret_val);
22003         call_tests++;
22004         des_const_xmlNode_ptr(n_cur, cur, 0);
22005         xmlResetLastError();
22006         if (mem_base != xmlMemBlocks()) {
22007             printf("Leak of %d blocks found in xmlNodeGetSpacePreserve",
22008 	           xmlMemBlocks() - mem_base);
22009 	    test_ret++;
22010             printf(" %d", n_cur);
22011             printf("\n");
22012         }
22013     }
22014     function_tests++;
22015 
22016     return(test_ret);
22017 }
22018 
22019 
22020 static int
test_xmlNodeIsText(void)22021 test_xmlNodeIsText(void) {
22022     int test_ret = 0;
22023 
22024     int mem_base;
22025     int ret_val;
22026     const xmlNode * node; /* the node */
22027     int n_node;
22028 
22029     for (n_node = 0;n_node < gen_nb_const_xmlNode_ptr;n_node++) {
22030         mem_base = xmlMemBlocks();
22031         node = gen_const_xmlNode_ptr(n_node, 0);
22032 
22033         ret_val = xmlNodeIsText(node);
22034         desret_int(ret_val);
22035         call_tests++;
22036         des_const_xmlNode_ptr(n_node, node, 0);
22037         xmlResetLastError();
22038         if (mem_base != xmlMemBlocks()) {
22039             printf("Leak of %d blocks found in xmlNodeIsText",
22040 	           xmlMemBlocks() - mem_base);
22041 	    test_ret++;
22042             printf(" %d", n_node);
22043             printf("\n");
22044         }
22045     }
22046     function_tests++;
22047 
22048     return(test_ret);
22049 }
22050 
22051 
22052 static int
test_xmlNodeListGetRawString(void)22053 test_xmlNodeListGetRawString(void) {
22054     int test_ret = 0;
22055 
22056 #if defined(LIBXML_TREE_ENABLED)
22057     int mem_base;
22058     xmlChar * ret_val;
22059     const xmlDoc * doc; /* the document */
22060     int n_doc;
22061     const xmlNode * list; /* a Node list */
22062     int n_list;
22063     int inLine; /* should we replace entity contents or show their external form */
22064     int n_inLine;
22065 
22066     for (n_doc = 0;n_doc < gen_nb_const_xmlDoc_ptr;n_doc++) {
22067     for (n_list = 0;n_list < gen_nb_const_xmlNode_ptr;n_list++) {
22068     for (n_inLine = 0;n_inLine < gen_nb_int;n_inLine++) {
22069         mem_base = xmlMemBlocks();
22070         doc = gen_const_xmlDoc_ptr(n_doc, 0);
22071         list = gen_const_xmlNode_ptr(n_list, 1);
22072         inLine = gen_int(n_inLine, 2);
22073 
22074         ret_val = xmlNodeListGetRawString(doc, list, inLine);
22075         desret_xmlChar_ptr(ret_val);
22076         call_tests++;
22077         des_const_xmlDoc_ptr(n_doc, doc, 0);
22078         des_const_xmlNode_ptr(n_list, list, 1);
22079         des_int(n_inLine, inLine, 2);
22080         xmlResetLastError();
22081         if (mem_base != xmlMemBlocks()) {
22082             printf("Leak of %d blocks found in xmlNodeListGetRawString",
22083 	           xmlMemBlocks() - mem_base);
22084 	    test_ret++;
22085             printf(" %d", n_doc);
22086             printf(" %d", n_list);
22087             printf(" %d", n_inLine);
22088             printf("\n");
22089         }
22090     }
22091     }
22092     }
22093     function_tests++;
22094 #endif
22095 
22096     return(test_ret);
22097 }
22098 
22099 
22100 static int
test_xmlNodeListGetString(void)22101 test_xmlNodeListGetString(void) {
22102     int test_ret = 0;
22103 
22104     int mem_base;
22105     xmlChar * ret_val;
22106     xmlDocPtr doc; /* the document */
22107     int n_doc;
22108     const xmlNode * list; /* a Node list */
22109     int n_list;
22110     int inLine; /* should we replace entity contents or show their external form */
22111     int n_inLine;
22112 
22113     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
22114     for (n_list = 0;n_list < gen_nb_const_xmlNode_ptr;n_list++) {
22115     for (n_inLine = 0;n_inLine < gen_nb_int;n_inLine++) {
22116         mem_base = xmlMemBlocks();
22117         doc = gen_xmlDocPtr(n_doc, 0);
22118         list = gen_const_xmlNode_ptr(n_list, 1);
22119         inLine = gen_int(n_inLine, 2);
22120 
22121         ret_val = xmlNodeListGetString(doc, list, inLine);
22122         desret_xmlChar_ptr(ret_val);
22123         call_tests++;
22124         des_xmlDocPtr(n_doc, doc, 0);
22125         des_const_xmlNode_ptr(n_list, list, 1);
22126         des_int(n_inLine, inLine, 2);
22127         xmlResetLastError();
22128         if (mem_base != xmlMemBlocks()) {
22129             printf("Leak of %d blocks found in xmlNodeListGetString",
22130 	           xmlMemBlocks() - mem_base);
22131 	    test_ret++;
22132             printf(" %d", n_doc);
22133             printf(" %d", n_list);
22134             printf(" %d", n_inLine);
22135             printf("\n");
22136         }
22137     }
22138     }
22139     }
22140     function_tests++;
22141 
22142     return(test_ret);
22143 }
22144 
22145 
22146 static int
test_xmlNodeSetBase(void)22147 test_xmlNodeSetBase(void) {
22148     int test_ret = 0;
22149 
22150 #if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_XINCLUDE_ENABLED)
22151     int mem_base;
22152     xmlNodePtr cur; /* the node being changed */
22153     int n_cur;
22154     const xmlChar * uri; /* the new base URI */
22155     int n_uri;
22156 
22157     for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
22158     for (n_uri = 0;n_uri < gen_nb_const_xmlChar_ptr;n_uri++) {
22159         mem_base = xmlMemBlocks();
22160         cur = gen_xmlNodePtr(n_cur, 0);
22161         uri = gen_const_xmlChar_ptr(n_uri, 1);
22162 
22163         xmlNodeSetBase(cur, uri);
22164         call_tests++;
22165         des_xmlNodePtr(n_cur, cur, 0);
22166         des_const_xmlChar_ptr(n_uri, uri, 1);
22167         xmlResetLastError();
22168         if (mem_base != xmlMemBlocks()) {
22169             printf("Leak of %d blocks found in xmlNodeSetBase",
22170 	           xmlMemBlocks() - mem_base);
22171 	    test_ret++;
22172             printf(" %d", n_cur);
22173             printf(" %d", n_uri);
22174             printf("\n");
22175         }
22176     }
22177     }
22178     function_tests++;
22179 #endif
22180 
22181     return(test_ret);
22182 }
22183 
22184 
22185 static int
test_xmlNodeSetContent(void)22186 test_xmlNodeSetContent(void) {
22187     int test_ret = 0;
22188 
22189     int mem_base;
22190     xmlNodePtr cur; /* the node being modified */
22191     int n_cur;
22192     const xmlChar * content; /* the new value of the content */
22193     int n_content;
22194 
22195     for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
22196     for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
22197         mem_base = xmlMemBlocks();
22198         cur = gen_xmlNodePtr(n_cur, 0);
22199         content = gen_const_xmlChar_ptr(n_content, 1);
22200 
22201         xmlNodeSetContent(cur, content);
22202         call_tests++;
22203         des_xmlNodePtr(n_cur, cur, 0);
22204         des_const_xmlChar_ptr(n_content, content, 1);
22205         xmlResetLastError();
22206         if (mem_base != xmlMemBlocks()) {
22207             printf("Leak of %d blocks found in xmlNodeSetContent",
22208 	           xmlMemBlocks() - mem_base);
22209 	    test_ret++;
22210             printf(" %d", n_cur);
22211             printf(" %d", n_content);
22212             printf("\n");
22213         }
22214     }
22215     }
22216     function_tests++;
22217 
22218     return(test_ret);
22219 }
22220 
22221 
22222 static int
test_xmlNodeSetContentLen(void)22223 test_xmlNodeSetContentLen(void) {
22224     int test_ret = 0;
22225 
22226 #if defined(LIBXML_TREE_ENABLED)
22227     int mem_base;
22228     xmlNodePtr cur; /* the node being modified */
22229     int n_cur;
22230     const xmlChar * content; /* the new value of the content */
22231     int n_content;
22232     int len; /* the size of @content */
22233     int n_len;
22234 
22235     for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
22236     for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
22237     for (n_len = 0;n_len < gen_nb_int;n_len++) {
22238         mem_base = xmlMemBlocks();
22239         cur = gen_xmlNodePtr(n_cur, 0);
22240         content = gen_const_xmlChar_ptr(n_content, 1);
22241         len = gen_int(n_len, 2);
22242         if ((content != NULL) &&
22243             (len > xmlStrlen(BAD_CAST content)))
22244             len = 0;
22245 
22246         xmlNodeSetContentLen(cur, content, len);
22247         call_tests++;
22248         des_xmlNodePtr(n_cur, cur, 0);
22249         des_const_xmlChar_ptr(n_content, content, 1);
22250         des_int(n_len, len, 2);
22251         xmlResetLastError();
22252         if (mem_base != xmlMemBlocks()) {
22253             printf("Leak of %d blocks found in xmlNodeSetContentLen",
22254 	           xmlMemBlocks() - mem_base);
22255 	    test_ret++;
22256             printf(" %d", n_cur);
22257             printf(" %d", n_content);
22258             printf(" %d", n_len);
22259             printf("\n");
22260         }
22261     }
22262     }
22263     }
22264     function_tests++;
22265 #endif
22266 
22267     return(test_ret);
22268 }
22269 
22270 
22271 static int
test_xmlNodeSetLang(void)22272 test_xmlNodeSetLang(void) {
22273     int test_ret = 0;
22274 
22275 #if defined(LIBXML_TREE_ENABLED)
22276     int mem_base;
22277     xmlNodePtr cur; /* the node being changed */
22278     int n_cur;
22279     const xmlChar * lang; /* the language description */
22280     int n_lang;
22281 
22282     for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
22283     for (n_lang = 0;n_lang < gen_nb_const_xmlChar_ptr;n_lang++) {
22284         mem_base = xmlMemBlocks();
22285         cur = gen_xmlNodePtr(n_cur, 0);
22286         lang = gen_const_xmlChar_ptr(n_lang, 1);
22287 
22288         xmlNodeSetLang(cur, lang);
22289         call_tests++;
22290         des_xmlNodePtr(n_cur, cur, 0);
22291         des_const_xmlChar_ptr(n_lang, lang, 1);
22292         xmlResetLastError();
22293         if (mem_base != xmlMemBlocks()) {
22294             printf("Leak of %d blocks found in xmlNodeSetLang",
22295 	           xmlMemBlocks() - mem_base);
22296 	    test_ret++;
22297             printf(" %d", n_cur);
22298             printf(" %d", n_lang);
22299             printf("\n");
22300         }
22301     }
22302     }
22303     function_tests++;
22304 #endif
22305 
22306     return(test_ret);
22307 }
22308 
22309 
22310 static int
test_xmlNodeSetName(void)22311 test_xmlNodeSetName(void) {
22312     int test_ret = 0;
22313 
22314 #if defined(LIBXML_TREE_ENABLED)
22315     int mem_base;
22316     xmlNodePtr cur; /* the node being changed */
22317     int n_cur;
22318     const xmlChar * name; /* the new tag name */
22319     int n_name;
22320 
22321     for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
22322     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
22323         mem_base = xmlMemBlocks();
22324         cur = gen_xmlNodePtr(n_cur, 0);
22325         name = gen_const_xmlChar_ptr(n_name, 1);
22326 
22327         xmlNodeSetName(cur, name);
22328         call_tests++;
22329         des_xmlNodePtr(n_cur, cur, 0);
22330         des_const_xmlChar_ptr(n_name, name, 1);
22331         xmlResetLastError();
22332         if (mem_base != xmlMemBlocks()) {
22333             printf("Leak of %d blocks found in xmlNodeSetName",
22334 	           xmlMemBlocks() - mem_base);
22335 	    test_ret++;
22336             printf(" %d", n_cur);
22337             printf(" %d", n_name);
22338             printf("\n");
22339         }
22340     }
22341     }
22342     function_tests++;
22343 #endif
22344 
22345     return(test_ret);
22346 }
22347 
22348 
22349 static int
test_xmlNodeSetSpacePreserve(void)22350 test_xmlNodeSetSpacePreserve(void) {
22351     int test_ret = 0;
22352 
22353 #if defined(LIBXML_TREE_ENABLED)
22354     int mem_base;
22355     xmlNodePtr cur; /* the node being changed */
22356     int n_cur;
22357     int val; /* the xml:space value ("0": default, 1: "preserve") */
22358     int n_val;
22359 
22360     for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
22361     for (n_val = 0;n_val < gen_nb_int;n_val++) {
22362         mem_base = xmlMemBlocks();
22363         cur = gen_xmlNodePtr(n_cur, 0);
22364         val = gen_int(n_val, 1);
22365 
22366         xmlNodeSetSpacePreserve(cur, val);
22367         call_tests++;
22368         des_xmlNodePtr(n_cur, cur, 0);
22369         des_int(n_val, val, 1);
22370         xmlResetLastError();
22371         if (mem_base != xmlMemBlocks()) {
22372             printf("Leak of %d blocks found in xmlNodeSetSpacePreserve",
22373 	           xmlMemBlocks() - mem_base);
22374 	    test_ret++;
22375             printf(" %d", n_cur);
22376             printf(" %d", n_val);
22377             printf("\n");
22378         }
22379     }
22380     }
22381     function_tests++;
22382 #endif
22383 
22384     return(test_ret);
22385 }
22386 
22387 
22388 static int
test_xmlPreviousElementSibling(void)22389 test_xmlPreviousElementSibling(void) {
22390     int test_ret = 0;
22391 
22392 #if defined(LIBXML_TREE_ENABLED)
22393     int mem_base;
22394     xmlNodePtr ret_val;
22395     xmlNodePtr node; /* the current node */
22396     int n_node;
22397 
22398     for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
22399         mem_base = xmlMemBlocks();
22400         node = gen_xmlNodePtr(n_node, 0);
22401 
22402         ret_val = xmlPreviousElementSibling(node);
22403         desret_xmlNodePtr(ret_val);
22404         call_tests++;
22405         des_xmlNodePtr(n_node, node, 0);
22406         xmlResetLastError();
22407         if (mem_base != xmlMemBlocks()) {
22408             printf("Leak of %d blocks found in xmlPreviousElementSibling",
22409 	           xmlMemBlocks() - mem_base);
22410 	    test_ret++;
22411             printf(" %d", n_node);
22412             printf("\n");
22413         }
22414     }
22415     function_tests++;
22416 #endif
22417 
22418     return(test_ret);
22419 }
22420 
22421 
22422 static int
test_xmlReconciliateNs(void)22423 test_xmlReconciliateNs(void) {
22424     int test_ret = 0;
22425 
22426 #if defined(LIBXML_TREE_ENABLED)
22427 #ifdef LIBXML_TREE_ENABLED
22428     int mem_base;
22429     int ret_val;
22430     xmlDocPtr doc; /* the document */
22431     int n_doc;
22432     xmlNodePtr tree; /* a node defining the subtree to reconciliate */
22433     int n_tree;
22434 
22435     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
22436     for (n_tree = 0;n_tree < gen_nb_xmlNodePtr;n_tree++) {
22437         mem_base = xmlMemBlocks();
22438         doc = gen_xmlDocPtr(n_doc, 0);
22439         tree = gen_xmlNodePtr(n_tree, 1);
22440 
22441         ret_val = xmlReconciliateNs(doc, tree);
22442         desret_int(ret_val);
22443         call_tests++;
22444         des_xmlDocPtr(n_doc, doc, 0);
22445         des_xmlNodePtr(n_tree, tree, 1);
22446         xmlResetLastError();
22447         if (mem_base != xmlMemBlocks()) {
22448             printf("Leak of %d blocks found in xmlReconciliateNs",
22449 	           xmlMemBlocks() - mem_base);
22450 	    test_ret++;
22451             printf(" %d", n_doc);
22452             printf(" %d", n_tree);
22453             printf("\n");
22454         }
22455     }
22456     }
22457     function_tests++;
22458 #endif
22459 #endif
22460 
22461     return(test_ret);
22462 }
22463 
22464 
22465 static int
test_xmlRegisterNodeDefault(void)22466 test_xmlRegisterNodeDefault(void) {
22467     int test_ret = 0;
22468 
22469 
22470     /* missing type support */
22471     return(test_ret);
22472 }
22473 
22474 
22475 static int
test_xmlRemoveProp(void)22476 test_xmlRemoveProp(void) {
22477     int test_ret = 0;
22478 
22479     int mem_base;
22480     int ret_val;
22481     xmlAttrPtr cur; /* an attribute */
22482     int n_cur;
22483 
22484     for (n_cur = 0;n_cur < gen_nb_xmlAttrPtr;n_cur++) {
22485         mem_base = xmlMemBlocks();
22486         cur = gen_xmlAttrPtr(n_cur, 0);
22487 
22488         ret_val = xmlRemoveProp(cur);
22489         cur = NULL;
22490         desret_int(ret_val);
22491         call_tests++;
22492         des_xmlAttrPtr(n_cur, cur, 0);
22493         xmlResetLastError();
22494         if (mem_base != xmlMemBlocks()) {
22495             printf("Leak of %d blocks found in xmlRemoveProp",
22496 	           xmlMemBlocks() - mem_base);
22497 	    test_ret++;
22498             printf(" %d", n_cur);
22499             printf("\n");
22500         }
22501     }
22502     function_tests++;
22503 
22504     return(test_ret);
22505 }
22506 
22507 
22508 static int
test_xmlReplaceNode(void)22509 test_xmlReplaceNode(void) {
22510     int test_ret = 0;
22511 
22512 #if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_WRITER_ENABLED)
22513     int mem_base;
22514     xmlNodePtr ret_val;
22515     xmlNodePtr old; /* the old node */
22516     int n_old;
22517     xmlNodePtr cur; /* the node */
22518     int n_cur;
22519 
22520     for (n_old = 0;n_old < gen_nb_xmlNodePtr;n_old++) {
22521     for (n_cur = 0;n_cur < gen_nb_xmlNodePtr_in;n_cur++) {
22522         mem_base = xmlMemBlocks();
22523         old = gen_xmlNodePtr(n_old, 0);
22524         cur = gen_xmlNodePtr_in(n_cur, 1);
22525 
22526         ret_val = xmlReplaceNode(old, cur);
22527         if (cur != NULL) {
22528               xmlUnlinkNode(cur);
22529               xmlFreeNode(cur) ; cur = NULL ; }
22530           if (old != NULL) {
22531               xmlUnlinkNode(old);
22532               xmlFreeNode(old) ; old = NULL ; }
22533 	  ret_val = NULL;
22534         desret_xmlNodePtr(ret_val);
22535         call_tests++;
22536         des_xmlNodePtr(n_old, old, 0);
22537         des_xmlNodePtr_in(n_cur, cur, 1);
22538         xmlResetLastError();
22539         if (mem_base != xmlMemBlocks()) {
22540             printf("Leak of %d blocks found in xmlReplaceNode",
22541 	           xmlMemBlocks() - mem_base);
22542 	    test_ret++;
22543             printf(" %d", n_old);
22544             printf(" %d", n_cur);
22545             printf("\n");
22546         }
22547     }
22548     }
22549     function_tests++;
22550 #endif
22551 
22552     return(test_ret);
22553 }
22554 
22555 
22556 static int
test_xmlSaveFile(void)22557 test_xmlSaveFile(void) {
22558     int test_ret = 0;
22559 
22560 #if defined(LIBXML_OUTPUT_ENABLED)
22561     int mem_base;
22562     int ret_val;
22563     const char * filename; /* the filename (or URL) */
22564     int n_filename;
22565     xmlDocPtr cur; /* the document */
22566     int n_cur;
22567 
22568     for (n_filename = 0;n_filename < gen_nb_fileoutput;n_filename++) {
22569     for (n_cur = 0;n_cur < gen_nb_xmlDocPtr;n_cur++) {
22570         mem_base = xmlMemBlocks();
22571         filename = gen_fileoutput(n_filename, 0);
22572         cur = gen_xmlDocPtr(n_cur, 1);
22573 
22574         ret_val = xmlSaveFile(filename, cur);
22575         desret_int(ret_val);
22576         call_tests++;
22577         des_fileoutput(n_filename, filename, 0);
22578         des_xmlDocPtr(n_cur, cur, 1);
22579         xmlResetLastError();
22580         if (mem_base != xmlMemBlocks()) {
22581             printf("Leak of %d blocks found in xmlSaveFile",
22582 	           xmlMemBlocks() - mem_base);
22583 	    test_ret++;
22584             printf(" %d", n_filename);
22585             printf(" %d", n_cur);
22586             printf("\n");
22587         }
22588     }
22589     }
22590     function_tests++;
22591 #endif
22592 
22593     return(test_ret);
22594 }
22595 
22596 
22597 static int
test_xmlSaveFileEnc(void)22598 test_xmlSaveFileEnc(void) {
22599     int test_ret = 0;
22600 
22601 #if defined(LIBXML_OUTPUT_ENABLED)
22602     int mem_base;
22603     int ret_val;
22604     const char * filename; /* the filename (or URL) */
22605     int n_filename;
22606     xmlDocPtr cur; /* the document */
22607     int n_cur;
22608     const char * encoding; /* the name of an encoding (or NULL) */
22609     int n_encoding;
22610 
22611     for (n_filename = 0;n_filename < gen_nb_fileoutput;n_filename++) {
22612     for (n_cur = 0;n_cur < gen_nb_xmlDocPtr;n_cur++) {
22613     for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
22614         mem_base = xmlMemBlocks();
22615         filename = gen_fileoutput(n_filename, 0);
22616         cur = gen_xmlDocPtr(n_cur, 1);
22617         encoding = gen_const_char_ptr(n_encoding, 2);
22618 
22619         ret_val = xmlSaveFileEnc(filename, cur, encoding);
22620         desret_int(ret_val);
22621         call_tests++;
22622         des_fileoutput(n_filename, filename, 0);
22623         des_xmlDocPtr(n_cur, cur, 1);
22624         des_const_char_ptr(n_encoding, encoding, 2);
22625         xmlResetLastError();
22626         if (mem_base != xmlMemBlocks()) {
22627             printf("Leak of %d blocks found in xmlSaveFileEnc",
22628 	           xmlMemBlocks() - mem_base);
22629 	    test_ret++;
22630             printf(" %d", n_filename);
22631             printf(" %d", n_cur);
22632             printf(" %d", n_encoding);
22633             printf("\n");
22634         }
22635     }
22636     }
22637     }
22638     function_tests++;
22639 #endif
22640 
22641     return(test_ret);
22642 }
22643 
22644 
22645 static int
test_xmlSaveFileTo(void)22646 test_xmlSaveFileTo(void) {
22647     int test_ret = 0;
22648 
22649 #if defined(LIBXML_OUTPUT_ENABLED)
22650     int mem_base;
22651     int ret_val;
22652     xmlOutputBufferPtr buf; /* an output I/O buffer */
22653     int n_buf;
22654     xmlDocPtr cur; /* the document */
22655     int n_cur;
22656     const char * encoding; /* the encoding if any assuming the I/O layer handles the transcoding */
22657     int n_encoding;
22658 
22659     for (n_buf = 0;n_buf < gen_nb_xmlOutputBufferPtr;n_buf++) {
22660     for (n_cur = 0;n_cur < gen_nb_xmlDocPtr;n_cur++) {
22661     for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
22662         mem_base = xmlMemBlocks();
22663         buf = gen_xmlOutputBufferPtr(n_buf, 0);
22664         cur = gen_xmlDocPtr(n_cur, 1);
22665         encoding = gen_const_char_ptr(n_encoding, 2);
22666 
22667         ret_val = xmlSaveFileTo(buf, cur, encoding);
22668         buf = NULL;
22669         desret_int(ret_val);
22670         call_tests++;
22671         des_xmlOutputBufferPtr(n_buf, buf, 0);
22672         des_xmlDocPtr(n_cur, cur, 1);
22673         des_const_char_ptr(n_encoding, encoding, 2);
22674         xmlResetLastError();
22675         if (mem_base != xmlMemBlocks()) {
22676             printf("Leak of %d blocks found in xmlSaveFileTo",
22677 	           xmlMemBlocks() - mem_base);
22678 	    test_ret++;
22679             printf(" %d", n_buf);
22680             printf(" %d", n_cur);
22681             printf(" %d", n_encoding);
22682             printf("\n");
22683         }
22684     }
22685     }
22686     }
22687     function_tests++;
22688 #endif
22689 
22690     return(test_ret);
22691 }
22692 
22693 
22694 static int
test_xmlSaveFormatFile(void)22695 test_xmlSaveFormatFile(void) {
22696     int test_ret = 0;
22697 
22698 #if defined(LIBXML_OUTPUT_ENABLED)
22699     int mem_base;
22700     int ret_val;
22701     const char * filename; /* the filename (or URL) */
22702     int n_filename;
22703     xmlDocPtr cur; /* the document */
22704     int n_cur;
22705     int format; /* should formatting spaces been added */
22706     int n_format;
22707 
22708     for (n_filename = 0;n_filename < gen_nb_fileoutput;n_filename++) {
22709     for (n_cur = 0;n_cur < gen_nb_xmlDocPtr;n_cur++) {
22710     for (n_format = 0;n_format < gen_nb_int;n_format++) {
22711         mem_base = xmlMemBlocks();
22712         filename = gen_fileoutput(n_filename, 0);
22713         cur = gen_xmlDocPtr(n_cur, 1);
22714         format = gen_int(n_format, 2);
22715 
22716         ret_val = xmlSaveFormatFile(filename, cur, format);
22717         desret_int(ret_val);
22718         call_tests++;
22719         des_fileoutput(n_filename, filename, 0);
22720         des_xmlDocPtr(n_cur, cur, 1);
22721         des_int(n_format, format, 2);
22722         xmlResetLastError();
22723         if (mem_base != xmlMemBlocks()) {
22724             printf("Leak of %d blocks found in xmlSaveFormatFile",
22725 	           xmlMemBlocks() - mem_base);
22726 	    test_ret++;
22727             printf(" %d", n_filename);
22728             printf(" %d", n_cur);
22729             printf(" %d", n_format);
22730             printf("\n");
22731         }
22732     }
22733     }
22734     }
22735     function_tests++;
22736 #endif
22737 
22738     return(test_ret);
22739 }
22740 
22741 
22742 static int
test_xmlSaveFormatFileEnc(void)22743 test_xmlSaveFormatFileEnc(void) {
22744     int test_ret = 0;
22745 
22746 #if defined(LIBXML_OUTPUT_ENABLED)
22747     int mem_base;
22748     int ret_val;
22749     const char * filename; /* the filename or URL to output */
22750     int n_filename;
22751     xmlDocPtr cur; /* the document being saved */
22752     int n_cur;
22753     const char * encoding; /* the name of the encoding to use or NULL. */
22754     int n_encoding;
22755     int format; /* should formatting spaces be added. */
22756     int n_format;
22757 
22758     for (n_filename = 0;n_filename < gen_nb_fileoutput;n_filename++) {
22759     for (n_cur = 0;n_cur < gen_nb_xmlDocPtr;n_cur++) {
22760     for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
22761     for (n_format = 0;n_format < gen_nb_int;n_format++) {
22762         mem_base = xmlMemBlocks();
22763         filename = gen_fileoutput(n_filename, 0);
22764         cur = gen_xmlDocPtr(n_cur, 1);
22765         encoding = gen_const_char_ptr(n_encoding, 2);
22766         format = gen_int(n_format, 3);
22767 
22768         ret_val = xmlSaveFormatFileEnc(filename, cur, encoding, format);
22769         desret_int(ret_val);
22770         call_tests++;
22771         des_fileoutput(n_filename, filename, 0);
22772         des_xmlDocPtr(n_cur, cur, 1);
22773         des_const_char_ptr(n_encoding, encoding, 2);
22774         des_int(n_format, format, 3);
22775         xmlResetLastError();
22776         if (mem_base != xmlMemBlocks()) {
22777             printf("Leak of %d blocks found in xmlSaveFormatFileEnc",
22778 	           xmlMemBlocks() - mem_base);
22779 	    test_ret++;
22780             printf(" %d", n_filename);
22781             printf(" %d", n_cur);
22782             printf(" %d", n_encoding);
22783             printf(" %d", n_format);
22784             printf("\n");
22785         }
22786     }
22787     }
22788     }
22789     }
22790     function_tests++;
22791 #endif
22792 
22793     return(test_ret);
22794 }
22795 
22796 
22797 static int
test_xmlSaveFormatFileTo(void)22798 test_xmlSaveFormatFileTo(void) {
22799     int test_ret = 0;
22800 
22801 #if defined(LIBXML_OUTPUT_ENABLED)
22802     int mem_base;
22803     int ret_val;
22804     xmlOutputBufferPtr buf; /* an output I/O buffer */
22805     int n_buf;
22806     xmlDocPtr cur; /* the document */
22807     int n_cur;
22808     const char * encoding; /* the encoding if any assuming the I/O layer handles the transcoding */
22809     int n_encoding;
22810     int format; /* should formatting spaces been added */
22811     int n_format;
22812 
22813     for (n_buf = 0;n_buf < gen_nb_xmlOutputBufferPtr;n_buf++) {
22814     for (n_cur = 0;n_cur < gen_nb_xmlDocPtr;n_cur++) {
22815     for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
22816     for (n_format = 0;n_format < gen_nb_int;n_format++) {
22817         mem_base = xmlMemBlocks();
22818         buf = gen_xmlOutputBufferPtr(n_buf, 0);
22819         cur = gen_xmlDocPtr(n_cur, 1);
22820         encoding = gen_const_char_ptr(n_encoding, 2);
22821         format = gen_int(n_format, 3);
22822 
22823         ret_val = xmlSaveFormatFileTo(buf, cur, encoding, format);
22824         buf = NULL;
22825         desret_int(ret_val);
22826         call_tests++;
22827         des_xmlOutputBufferPtr(n_buf, buf, 0);
22828         des_xmlDocPtr(n_cur, cur, 1);
22829         des_const_char_ptr(n_encoding, encoding, 2);
22830         des_int(n_format, format, 3);
22831         xmlResetLastError();
22832         if (mem_base != xmlMemBlocks()) {
22833             printf("Leak of %d blocks found in xmlSaveFormatFileTo",
22834 	           xmlMemBlocks() - mem_base);
22835 	    test_ret++;
22836             printf(" %d", n_buf);
22837             printf(" %d", n_cur);
22838             printf(" %d", n_encoding);
22839             printf(" %d", n_format);
22840             printf("\n");
22841         }
22842     }
22843     }
22844     }
22845     }
22846     function_tests++;
22847 #endif
22848 
22849     return(test_ret);
22850 }
22851 
22852 
22853 static int
test_xmlSearchNs(void)22854 test_xmlSearchNs(void) {
22855     int test_ret = 0;
22856 
22857     int mem_base;
22858     xmlNsPtr ret_val;
22859     xmlDocPtr doc; /* the document */
22860     int n_doc;
22861     xmlNodePtr node; /* the current node */
22862     int n_node;
22863     const xmlChar * nameSpace; /* the namespace prefix */
22864     int n_nameSpace;
22865 
22866     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
22867     for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
22868     for (n_nameSpace = 0;n_nameSpace < gen_nb_const_xmlChar_ptr;n_nameSpace++) {
22869         mem_base = xmlMemBlocks();
22870         doc = gen_xmlDocPtr(n_doc, 0);
22871         node = gen_xmlNodePtr(n_node, 1);
22872         nameSpace = gen_const_xmlChar_ptr(n_nameSpace, 2);
22873 
22874         ret_val = xmlSearchNs(doc, node, nameSpace);
22875         desret_xmlNsPtr(ret_val);
22876         call_tests++;
22877         des_xmlDocPtr(n_doc, doc, 0);
22878         des_xmlNodePtr(n_node, node, 1);
22879         des_const_xmlChar_ptr(n_nameSpace, nameSpace, 2);
22880         xmlResetLastError();
22881         if (mem_base != xmlMemBlocks()) {
22882             printf("Leak of %d blocks found in xmlSearchNs",
22883 	           xmlMemBlocks() - mem_base);
22884 	    test_ret++;
22885             printf(" %d", n_doc);
22886             printf(" %d", n_node);
22887             printf(" %d", n_nameSpace);
22888             printf("\n");
22889         }
22890     }
22891     }
22892     }
22893     function_tests++;
22894 
22895     return(test_ret);
22896 }
22897 
22898 
22899 static int
test_xmlSearchNsByHref(void)22900 test_xmlSearchNsByHref(void) {
22901     int test_ret = 0;
22902 
22903     int mem_base;
22904     xmlNsPtr ret_val;
22905     xmlDocPtr doc; /* the document */
22906     int n_doc;
22907     xmlNodePtr node; /* the current node */
22908     int n_node;
22909     const xmlChar * href; /* the namespace value */
22910     int n_href;
22911 
22912     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
22913     for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
22914     for (n_href = 0;n_href < gen_nb_const_xmlChar_ptr;n_href++) {
22915         mem_base = xmlMemBlocks();
22916         doc = gen_xmlDocPtr(n_doc, 0);
22917         node = gen_xmlNodePtr(n_node, 1);
22918         href = gen_const_xmlChar_ptr(n_href, 2);
22919 
22920         ret_val = xmlSearchNsByHref(doc, node, href);
22921         desret_xmlNsPtr(ret_val);
22922         call_tests++;
22923         des_xmlDocPtr(n_doc, doc, 0);
22924         des_xmlNodePtr(n_node, node, 1);
22925         des_const_xmlChar_ptr(n_href, href, 2);
22926         xmlResetLastError();
22927         if (mem_base != xmlMemBlocks()) {
22928             printf("Leak of %d blocks found in xmlSearchNsByHref",
22929 	           xmlMemBlocks() - mem_base);
22930 	    test_ret++;
22931             printf(" %d", n_doc);
22932             printf(" %d", n_node);
22933             printf(" %d", n_href);
22934             printf("\n");
22935         }
22936     }
22937     }
22938     }
22939     function_tests++;
22940 
22941     return(test_ret);
22942 }
22943 
22944 
22945 static int
test_xmlSetBufferAllocationScheme(void)22946 test_xmlSetBufferAllocationScheme(void) {
22947     int test_ret = 0;
22948 
22949     int mem_base;
22950     xmlBufferAllocationScheme scheme; /* allocation method to use */
22951     int n_scheme;
22952 
22953     for (n_scheme = 0;n_scheme < gen_nb_xmlBufferAllocationScheme;n_scheme++) {
22954         mem_base = xmlMemBlocks();
22955         scheme = gen_xmlBufferAllocationScheme(n_scheme, 0);
22956 
22957         xmlSetBufferAllocationScheme(scheme);
22958         call_tests++;
22959         des_xmlBufferAllocationScheme(n_scheme, scheme, 0);
22960         xmlResetLastError();
22961         if (mem_base != xmlMemBlocks()) {
22962             printf("Leak of %d blocks found in xmlSetBufferAllocationScheme",
22963 	           xmlMemBlocks() - mem_base);
22964 	    test_ret++;
22965             printf(" %d", n_scheme);
22966             printf("\n");
22967         }
22968     }
22969     function_tests++;
22970 
22971     return(test_ret);
22972 }
22973 
22974 
22975 static int
test_xmlSetCompressMode(void)22976 test_xmlSetCompressMode(void) {
22977     int test_ret = 0;
22978 
22979     int mem_base;
22980     int mode; /* the compression ratio */
22981     int n_mode;
22982 
22983     for (n_mode = 0;n_mode < gen_nb_int;n_mode++) {
22984         mem_base = xmlMemBlocks();
22985         mode = gen_int(n_mode, 0);
22986 
22987         xmlSetCompressMode(mode);
22988         call_tests++;
22989         des_int(n_mode, mode, 0);
22990         xmlResetLastError();
22991         if (mem_base != xmlMemBlocks()) {
22992             printf("Leak of %d blocks found in xmlSetCompressMode",
22993 	           xmlMemBlocks() - mem_base);
22994 	    test_ret++;
22995             printf(" %d", n_mode);
22996             printf("\n");
22997         }
22998     }
22999     function_tests++;
23000 
23001     return(test_ret);
23002 }
23003 
23004 
23005 static int
test_xmlSetDocCompressMode(void)23006 test_xmlSetDocCompressMode(void) {
23007     int test_ret = 0;
23008 
23009     int mem_base;
23010     xmlDocPtr doc; /* the document */
23011     int n_doc;
23012     int mode; /* the compression ratio */
23013     int n_mode;
23014 
23015     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
23016     for (n_mode = 0;n_mode < gen_nb_int;n_mode++) {
23017         mem_base = xmlMemBlocks();
23018         doc = gen_xmlDocPtr(n_doc, 0);
23019         mode = gen_int(n_mode, 1);
23020 
23021         xmlSetDocCompressMode(doc, mode);
23022         call_tests++;
23023         des_xmlDocPtr(n_doc, doc, 0);
23024         des_int(n_mode, mode, 1);
23025         xmlResetLastError();
23026         if (mem_base != xmlMemBlocks()) {
23027             printf("Leak of %d blocks found in xmlSetDocCompressMode",
23028 	           xmlMemBlocks() - mem_base);
23029 	    test_ret++;
23030             printf(" %d", n_doc);
23031             printf(" %d", n_mode);
23032             printf("\n");
23033         }
23034     }
23035     }
23036     function_tests++;
23037 
23038     return(test_ret);
23039 }
23040 
23041 
23042 static int
test_xmlSetNs(void)23043 test_xmlSetNs(void) {
23044     int test_ret = 0;
23045 
23046     int mem_base;
23047     xmlNodePtr node; /* a node in the document */
23048     int n_node;
23049     xmlNsPtr ns; /* a namespace pointer */
23050     int n_ns;
23051 
23052     for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
23053     for (n_ns = 0;n_ns < gen_nb_xmlNsPtr;n_ns++) {
23054         mem_base = xmlMemBlocks();
23055         node = gen_xmlNodePtr(n_node, 0);
23056         ns = gen_xmlNsPtr(n_ns, 1);
23057 
23058         xmlSetNs(node, ns);
23059         call_tests++;
23060         des_xmlNodePtr(n_node, node, 0);
23061         des_xmlNsPtr(n_ns, ns, 1);
23062         xmlResetLastError();
23063         if (mem_base != xmlMemBlocks()) {
23064             printf("Leak of %d blocks found in xmlSetNs",
23065 	           xmlMemBlocks() - mem_base);
23066 	    test_ret++;
23067             printf(" %d", n_node);
23068             printf(" %d", n_ns);
23069             printf("\n");
23070         }
23071     }
23072     }
23073     function_tests++;
23074 
23075     return(test_ret);
23076 }
23077 
23078 
23079 static int
test_xmlSetNsProp(void)23080 test_xmlSetNsProp(void) {
23081     int test_ret = 0;
23082 
23083 #if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_XINCLUDE_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED) || defined(LIBXML_HTML_ENABLED)
23084     int mem_base;
23085     xmlAttrPtr ret_val;
23086     xmlNodePtr node; /* the node */
23087     int n_node;
23088     xmlNsPtr ns; /* the namespace definition */
23089     int n_ns;
23090     const xmlChar * name; /* the attribute name */
23091     int n_name;
23092     const xmlChar * value; /* the attribute value */
23093     int n_value;
23094 
23095     for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
23096     for (n_ns = 0;n_ns < gen_nb_xmlNsPtr;n_ns++) {
23097     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
23098     for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
23099         mem_base = xmlMemBlocks();
23100         node = gen_xmlNodePtr(n_node, 0);
23101         ns = gen_xmlNsPtr(n_ns, 1);
23102         name = gen_const_xmlChar_ptr(n_name, 2);
23103         value = gen_const_xmlChar_ptr(n_value, 3);
23104 
23105         ret_val = xmlSetNsProp(node, ns, name, value);
23106         desret_xmlAttrPtr(ret_val);
23107         call_tests++;
23108         des_xmlNodePtr(n_node, node, 0);
23109         des_xmlNsPtr(n_ns, ns, 1);
23110         des_const_xmlChar_ptr(n_name, name, 2);
23111         des_const_xmlChar_ptr(n_value, value, 3);
23112         xmlResetLastError();
23113         if (mem_base != xmlMemBlocks()) {
23114             printf("Leak of %d blocks found in xmlSetNsProp",
23115 	           xmlMemBlocks() - mem_base);
23116 	    test_ret++;
23117             printf(" %d", n_node);
23118             printf(" %d", n_ns);
23119             printf(" %d", n_name);
23120             printf(" %d", n_value);
23121             printf("\n");
23122         }
23123     }
23124     }
23125     }
23126     }
23127     function_tests++;
23128 #endif
23129 
23130     return(test_ret);
23131 }
23132 
23133 
23134 static int
test_xmlSetProp(void)23135 test_xmlSetProp(void) {
23136     int test_ret = 0;
23137 
23138 #if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_XINCLUDE_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED) || defined(LIBXML_HTML_ENABLED)
23139     int mem_base;
23140     xmlAttrPtr ret_val;
23141     xmlNodePtr node; /* the node */
23142     int n_node;
23143     const xmlChar * name; /* the attribute name (a QName) */
23144     int n_name;
23145     const xmlChar * value; /* the attribute value */
23146     int n_value;
23147 
23148     for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
23149     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
23150     for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
23151         mem_base = xmlMemBlocks();
23152         node = gen_xmlNodePtr(n_node, 0);
23153         name = gen_const_xmlChar_ptr(n_name, 1);
23154         value = gen_const_xmlChar_ptr(n_value, 2);
23155 
23156         ret_val = xmlSetProp(node, name, value);
23157         desret_xmlAttrPtr(ret_val);
23158         call_tests++;
23159         des_xmlNodePtr(n_node, node, 0);
23160         des_const_xmlChar_ptr(n_name, name, 1);
23161         des_const_xmlChar_ptr(n_value, value, 2);
23162         xmlResetLastError();
23163         if (mem_base != xmlMemBlocks()) {
23164             printf("Leak of %d blocks found in xmlSetProp",
23165 	           xmlMemBlocks() - mem_base);
23166 	    test_ret++;
23167             printf(" %d", n_node);
23168             printf(" %d", n_name);
23169             printf(" %d", n_value);
23170             printf("\n");
23171         }
23172     }
23173     }
23174     }
23175     function_tests++;
23176 #endif
23177 
23178     return(test_ret);
23179 }
23180 
23181 
23182 static int
test_xmlSplitQName2(void)23183 test_xmlSplitQName2(void) {
23184     int test_ret = 0;
23185 
23186     int mem_base;
23187     xmlChar * ret_val;
23188     const xmlChar * name; /* the full QName */
23189     int n_name;
23190     xmlChar ** prefix; /* a xmlChar ** */
23191     int n_prefix;
23192 
23193     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
23194     for (n_prefix = 0;n_prefix < gen_nb_xmlChar_ptr_ptr;n_prefix++) {
23195         mem_base = xmlMemBlocks();
23196         name = gen_const_xmlChar_ptr(n_name, 0);
23197         prefix = gen_xmlChar_ptr_ptr(n_prefix, 1);
23198 
23199         ret_val = xmlSplitQName2(name, prefix);
23200         desret_xmlChar_ptr(ret_val);
23201         call_tests++;
23202         des_const_xmlChar_ptr(n_name, name, 0);
23203         des_xmlChar_ptr_ptr(n_prefix, prefix, 1);
23204         xmlResetLastError();
23205         if (mem_base != xmlMemBlocks()) {
23206             printf("Leak of %d blocks found in xmlSplitQName2",
23207 	           xmlMemBlocks() - mem_base);
23208 	    test_ret++;
23209             printf(" %d", n_name);
23210             printf(" %d", n_prefix);
23211             printf("\n");
23212         }
23213     }
23214     }
23215     function_tests++;
23216 
23217     return(test_ret);
23218 }
23219 
23220 
23221 static int
test_xmlSplitQName3(void)23222 test_xmlSplitQName3(void) {
23223     int test_ret = 0;
23224 
23225     int mem_base;
23226     const xmlChar * ret_val;
23227     const xmlChar * name; /* the full QName */
23228     int n_name;
23229     int * len; /* an int * */
23230     int n_len;
23231 
23232     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
23233     for (n_len = 0;n_len < gen_nb_int_ptr;n_len++) {
23234         mem_base = xmlMemBlocks();
23235         name = gen_const_xmlChar_ptr(n_name, 0);
23236         len = gen_int_ptr(n_len, 1);
23237 
23238         ret_val = xmlSplitQName3(name, len);
23239         desret_const_xmlChar_ptr(ret_val);
23240         call_tests++;
23241         des_const_xmlChar_ptr(n_name, name, 0);
23242         des_int_ptr(n_len, len, 1);
23243         xmlResetLastError();
23244         if (mem_base != xmlMemBlocks()) {
23245             printf("Leak of %d blocks found in xmlSplitQName3",
23246 	           xmlMemBlocks() - mem_base);
23247 	    test_ret++;
23248             printf(" %d", n_name);
23249             printf(" %d", n_len);
23250             printf("\n");
23251         }
23252     }
23253     }
23254     function_tests++;
23255 
23256     return(test_ret);
23257 }
23258 
23259 
23260 static int
test_xmlStringGetNodeList(void)23261 test_xmlStringGetNodeList(void) {
23262     int test_ret = 0;
23263 
23264     int mem_base;
23265     xmlNodePtr ret_val;
23266     const xmlDoc * doc; /* the document */
23267     int n_doc;
23268     const xmlChar * value; /* the value of the attribute */
23269     int n_value;
23270 
23271     for (n_doc = 0;n_doc < gen_nb_const_xmlDoc_ptr;n_doc++) {
23272     for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
23273         mem_base = xmlMemBlocks();
23274         doc = gen_const_xmlDoc_ptr(n_doc, 0);
23275         value = gen_const_xmlChar_ptr(n_value, 1);
23276 
23277         ret_val = xmlStringGetNodeList(doc, value);
23278         desret_xmlNodePtr(ret_val);
23279         call_tests++;
23280         des_const_xmlDoc_ptr(n_doc, doc, 0);
23281         des_const_xmlChar_ptr(n_value, value, 1);
23282         xmlResetLastError();
23283         if (mem_base != xmlMemBlocks()) {
23284             printf("Leak of %d blocks found in xmlStringGetNodeList",
23285 	           xmlMemBlocks() - mem_base);
23286 	    test_ret++;
23287             printf(" %d", n_doc);
23288             printf(" %d", n_value);
23289             printf("\n");
23290         }
23291     }
23292     }
23293     function_tests++;
23294 
23295     return(test_ret);
23296 }
23297 
23298 
23299 static int
test_xmlStringLenGetNodeList(void)23300 test_xmlStringLenGetNodeList(void) {
23301     int test_ret = 0;
23302 
23303     int mem_base;
23304     xmlNodePtr ret_val;
23305     const xmlDoc * doc; /* the document */
23306     int n_doc;
23307     const xmlChar * value; /* the value of the text */
23308     int n_value;
23309     int len; /* the length of the string value */
23310     int n_len;
23311 
23312     for (n_doc = 0;n_doc < gen_nb_const_xmlDoc_ptr;n_doc++) {
23313     for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
23314     for (n_len = 0;n_len < gen_nb_int;n_len++) {
23315         mem_base = xmlMemBlocks();
23316         doc = gen_const_xmlDoc_ptr(n_doc, 0);
23317         value = gen_const_xmlChar_ptr(n_value, 1);
23318         len = gen_int(n_len, 2);
23319         if ((value != NULL) &&
23320             (len > xmlStrlen(BAD_CAST value)))
23321             len = 0;
23322 
23323         ret_val = xmlStringLenGetNodeList(doc, value, len);
23324         desret_xmlNodePtr(ret_val);
23325         call_tests++;
23326         des_const_xmlDoc_ptr(n_doc, doc, 0);
23327         des_const_xmlChar_ptr(n_value, value, 1);
23328         des_int(n_len, len, 2);
23329         xmlResetLastError();
23330         if (mem_base != xmlMemBlocks()) {
23331             printf("Leak of %d blocks found in xmlStringLenGetNodeList",
23332 	           xmlMemBlocks() - mem_base);
23333 	    test_ret++;
23334             printf(" %d", n_doc);
23335             printf(" %d", n_value);
23336             printf(" %d", n_len);
23337             printf("\n");
23338         }
23339     }
23340     }
23341     }
23342     function_tests++;
23343 
23344     return(test_ret);
23345 }
23346 
23347 
23348 static int
test_xmlTextConcat(void)23349 test_xmlTextConcat(void) {
23350     int test_ret = 0;
23351 
23352     int mem_base;
23353     int ret_val;
23354     xmlNodePtr node; /* the node */
23355     int n_node;
23356     const xmlChar * content; /* the content */
23357     int n_content;
23358     int len; /* @content length */
23359     int n_len;
23360 
23361     for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
23362     for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
23363     for (n_len = 0;n_len < gen_nb_int;n_len++) {
23364         mem_base = xmlMemBlocks();
23365         node = gen_xmlNodePtr(n_node, 0);
23366         content = gen_const_xmlChar_ptr(n_content, 1);
23367         len = gen_int(n_len, 2);
23368         if ((content != NULL) &&
23369             (len > xmlStrlen(BAD_CAST content)))
23370             len = 0;
23371 
23372         ret_val = xmlTextConcat(node, content, len);
23373         desret_int(ret_val);
23374         call_tests++;
23375         des_xmlNodePtr(n_node, node, 0);
23376         des_const_xmlChar_ptr(n_content, content, 1);
23377         des_int(n_len, len, 2);
23378         xmlResetLastError();
23379         if (mem_base != xmlMemBlocks()) {
23380             printf("Leak of %d blocks found in xmlTextConcat",
23381 	           xmlMemBlocks() - mem_base);
23382 	    test_ret++;
23383             printf(" %d", n_node);
23384             printf(" %d", n_content);
23385             printf(" %d", n_len);
23386             printf("\n");
23387         }
23388     }
23389     }
23390     }
23391     function_tests++;
23392 
23393     return(test_ret);
23394 }
23395 
23396 
23397 static int
test_xmlTextMerge(void)23398 test_xmlTextMerge(void) {
23399     int test_ret = 0;
23400 
23401     int mem_base;
23402     xmlNodePtr ret_val;
23403     xmlNodePtr first; /* the first text node */
23404     int n_first;
23405     xmlNodePtr second; /* the second text node being merged */
23406     int n_second;
23407 
23408     for (n_first = 0;n_first < gen_nb_xmlNodePtr_in;n_first++) {
23409     for (n_second = 0;n_second < gen_nb_xmlNodePtr_in;n_second++) {
23410         mem_base = xmlMemBlocks();
23411         first = gen_xmlNodePtr_in(n_first, 0);
23412         second = gen_xmlNodePtr_in(n_second, 1);
23413 
23414         ret_val = xmlTextMerge(first, second);
23415         if ((first != NULL) && (first->type != XML_TEXT_NODE)) {
23416               xmlUnlinkNode(second);
23417               xmlFreeNode(second) ; second = NULL ; }
23418         desret_xmlNodePtr(ret_val);
23419         call_tests++;
23420         des_xmlNodePtr_in(n_first, first, 0);
23421         des_xmlNodePtr_in(n_second, second, 1);
23422         xmlResetLastError();
23423         if (mem_base != xmlMemBlocks()) {
23424             printf("Leak of %d blocks found in xmlTextMerge",
23425 	           xmlMemBlocks() - mem_base);
23426 	    test_ret++;
23427             printf(" %d", n_first);
23428             printf(" %d", n_second);
23429             printf("\n");
23430         }
23431     }
23432     }
23433     function_tests++;
23434 
23435     return(test_ret);
23436 }
23437 
23438 
23439 static int
test_xmlThrDefBufferAllocScheme(void)23440 test_xmlThrDefBufferAllocScheme(void) {
23441     int test_ret = 0;
23442 
23443     int mem_base;
23444     xmlBufferAllocationScheme ret_val;
23445     xmlBufferAllocationScheme v; /*  */
23446     int n_v;
23447 
23448     for (n_v = 0;n_v < gen_nb_xmlBufferAllocationScheme;n_v++) {
23449         mem_base = xmlMemBlocks();
23450         v = gen_xmlBufferAllocationScheme(n_v, 0);
23451 
23452         ret_val = xmlThrDefBufferAllocScheme(v);
23453         desret_xmlBufferAllocationScheme(ret_val);
23454         call_tests++;
23455         des_xmlBufferAllocationScheme(n_v, v, 0);
23456         xmlResetLastError();
23457         if (mem_base != xmlMemBlocks()) {
23458             printf("Leak of %d blocks found in xmlThrDefBufferAllocScheme",
23459 	           xmlMemBlocks() - mem_base);
23460 	    test_ret++;
23461             printf(" %d", n_v);
23462             printf("\n");
23463         }
23464     }
23465     function_tests++;
23466 
23467     return(test_ret);
23468 }
23469 
23470 
23471 static int
test_xmlThrDefDefaultBufferSize(void)23472 test_xmlThrDefDefaultBufferSize(void) {
23473     int test_ret = 0;
23474 
23475     int mem_base;
23476     int ret_val;
23477     int v; /*  */
23478     int n_v;
23479 
23480     for (n_v = 0;n_v < gen_nb_int;n_v++) {
23481         mem_base = xmlMemBlocks();
23482         v = gen_int(n_v, 0);
23483 
23484         ret_val = xmlThrDefDefaultBufferSize(v);
23485         desret_int(ret_val);
23486         call_tests++;
23487         des_int(n_v, v, 0);
23488         xmlResetLastError();
23489         if (mem_base != xmlMemBlocks()) {
23490             printf("Leak of %d blocks found in xmlThrDefDefaultBufferSize",
23491 	           xmlMemBlocks() - mem_base);
23492 	    test_ret++;
23493             printf(" %d", n_v);
23494             printf("\n");
23495         }
23496     }
23497     function_tests++;
23498 
23499     return(test_ret);
23500 }
23501 
23502 
23503 static int
test_xmlThrDefDeregisterNodeDefault(void)23504 test_xmlThrDefDeregisterNodeDefault(void) {
23505     int test_ret = 0;
23506 
23507 
23508     /* missing type support */
23509     return(test_ret);
23510 }
23511 
23512 
23513 static int
test_xmlThrDefRegisterNodeDefault(void)23514 test_xmlThrDefRegisterNodeDefault(void) {
23515     int test_ret = 0;
23516 
23517 
23518     /* missing type support */
23519     return(test_ret);
23520 }
23521 
23522 
23523 static int
test_xmlUnsetNsProp(void)23524 test_xmlUnsetNsProp(void) {
23525     int test_ret = 0;
23526 
23527 #if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED)
23528     int mem_base;
23529     int ret_val;
23530     xmlNodePtr node; /* the node */
23531     int n_node;
23532     xmlNsPtr ns; /* the namespace definition */
23533     int n_ns;
23534     const xmlChar * name; /* the attribute name */
23535     int n_name;
23536 
23537     for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
23538     for (n_ns = 0;n_ns < gen_nb_xmlNsPtr;n_ns++) {
23539     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
23540         mem_base = xmlMemBlocks();
23541         node = gen_xmlNodePtr(n_node, 0);
23542         ns = gen_xmlNsPtr(n_ns, 1);
23543         name = gen_const_xmlChar_ptr(n_name, 2);
23544 
23545         ret_val = xmlUnsetNsProp(node, ns, name);
23546         desret_int(ret_val);
23547         call_tests++;
23548         des_xmlNodePtr(n_node, node, 0);
23549         des_xmlNsPtr(n_ns, ns, 1);
23550         des_const_xmlChar_ptr(n_name, name, 2);
23551         xmlResetLastError();
23552         if (mem_base != xmlMemBlocks()) {
23553             printf("Leak of %d blocks found in xmlUnsetNsProp",
23554 	           xmlMemBlocks() - mem_base);
23555 	    test_ret++;
23556             printf(" %d", n_node);
23557             printf(" %d", n_ns);
23558             printf(" %d", n_name);
23559             printf("\n");
23560         }
23561     }
23562     }
23563     }
23564     function_tests++;
23565 #endif
23566 
23567     return(test_ret);
23568 }
23569 
23570 
23571 static int
test_xmlUnsetProp(void)23572 test_xmlUnsetProp(void) {
23573     int test_ret = 0;
23574 
23575 #if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED)
23576     int mem_base;
23577     int ret_val;
23578     xmlNodePtr node; /* the node */
23579     int n_node;
23580     const xmlChar * name; /* the attribute name */
23581     int n_name;
23582 
23583     for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
23584     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
23585         mem_base = xmlMemBlocks();
23586         node = gen_xmlNodePtr(n_node, 0);
23587         name = gen_const_xmlChar_ptr(n_name, 1);
23588 
23589         ret_val = xmlUnsetProp(node, name);
23590         desret_int(ret_val);
23591         call_tests++;
23592         des_xmlNodePtr(n_node, node, 0);
23593         des_const_xmlChar_ptr(n_name, name, 1);
23594         xmlResetLastError();
23595         if (mem_base != xmlMemBlocks()) {
23596             printf("Leak of %d blocks found in xmlUnsetProp",
23597 	           xmlMemBlocks() - mem_base);
23598 	    test_ret++;
23599             printf(" %d", n_node);
23600             printf(" %d", n_name);
23601             printf("\n");
23602         }
23603     }
23604     }
23605     function_tests++;
23606 #endif
23607 
23608     return(test_ret);
23609 }
23610 
23611 
23612 static int
test_xmlValidateNCName(void)23613 test_xmlValidateNCName(void) {
23614     int test_ret = 0;
23615 
23616 #ifdef LIBXML_TREE_ENABLED
23617     int mem_base;
23618     int ret_val;
23619     const xmlChar * value; /* the value to check */
23620     int n_value;
23621     int space; /* allow spaces in front and end of the string */
23622     int n_space;
23623 
23624     for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
23625     for (n_space = 0;n_space < gen_nb_int;n_space++) {
23626         mem_base = xmlMemBlocks();
23627         value = gen_const_xmlChar_ptr(n_value, 0);
23628         space = gen_int(n_space, 1);
23629 
23630         ret_val = xmlValidateNCName(value, space);
23631         desret_int(ret_val);
23632         call_tests++;
23633         des_const_xmlChar_ptr(n_value, value, 0);
23634         des_int(n_space, space, 1);
23635         xmlResetLastError();
23636         if (mem_base != xmlMemBlocks()) {
23637             printf("Leak of %d blocks found in xmlValidateNCName",
23638 	           xmlMemBlocks() - mem_base);
23639 	    test_ret++;
23640             printf(" %d", n_value);
23641             printf(" %d", n_space);
23642             printf("\n");
23643         }
23644     }
23645     }
23646     function_tests++;
23647 #endif
23648 
23649     return(test_ret);
23650 }
23651 
23652 
23653 static int
test_xmlValidateNMToken(void)23654 test_xmlValidateNMToken(void) {
23655     int test_ret = 0;
23656 
23657 #if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED)
23658 #ifdef LIBXML_TREE_ENABLED
23659     int mem_base;
23660     int ret_val;
23661     const xmlChar * value; /* the value to check */
23662     int n_value;
23663     int space; /* allow spaces in front and end of the string */
23664     int n_space;
23665 
23666     for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
23667     for (n_space = 0;n_space < gen_nb_int;n_space++) {
23668         mem_base = xmlMemBlocks();
23669         value = gen_const_xmlChar_ptr(n_value, 0);
23670         space = gen_int(n_space, 1);
23671 
23672         ret_val = xmlValidateNMToken(value, space);
23673         desret_int(ret_val);
23674         call_tests++;
23675         des_const_xmlChar_ptr(n_value, value, 0);
23676         des_int(n_space, space, 1);
23677         xmlResetLastError();
23678         if (mem_base != xmlMemBlocks()) {
23679             printf("Leak of %d blocks found in xmlValidateNMToken",
23680 	           xmlMemBlocks() - mem_base);
23681 	    test_ret++;
23682             printf(" %d", n_value);
23683             printf(" %d", n_space);
23684             printf("\n");
23685         }
23686     }
23687     }
23688     function_tests++;
23689 #endif
23690 #endif
23691 
23692     return(test_ret);
23693 }
23694 
23695 
23696 static int
test_xmlValidateName(void)23697 test_xmlValidateName(void) {
23698     int test_ret = 0;
23699 
23700 #if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED)
23701 #ifdef LIBXML_TREE_ENABLED
23702     int mem_base;
23703     int ret_val;
23704     const xmlChar * value; /* the value to check */
23705     int n_value;
23706     int space; /* allow spaces in front and end of the string */
23707     int n_space;
23708 
23709     for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
23710     for (n_space = 0;n_space < gen_nb_int;n_space++) {
23711         mem_base = xmlMemBlocks();
23712         value = gen_const_xmlChar_ptr(n_value, 0);
23713         space = gen_int(n_space, 1);
23714 
23715         ret_val = xmlValidateName(value, space);
23716         desret_int(ret_val);
23717         call_tests++;
23718         des_const_xmlChar_ptr(n_value, value, 0);
23719         des_int(n_space, space, 1);
23720         xmlResetLastError();
23721         if (mem_base != xmlMemBlocks()) {
23722             printf("Leak of %d blocks found in xmlValidateName",
23723 	           xmlMemBlocks() - mem_base);
23724 	    test_ret++;
23725             printf(" %d", n_value);
23726             printf(" %d", n_space);
23727             printf("\n");
23728         }
23729     }
23730     }
23731     function_tests++;
23732 #endif
23733 #endif
23734 
23735     return(test_ret);
23736 }
23737 
23738 
23739 static int
test_xmlValidateQName(void)23740 test_xmlValidateQName(void) {
23741     int test_ret = 0;
23742 
23743 #if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED)
23744 #ifdef LIBXML_TREE_ENABLED
23745     int mem_base;
23746     int ret_val;
23747     const xmlChar * value; /* the value to check */
23748     int n_value;
23749     int space; /* allow spaces in front and end of the string */
23750     int n_space;
23751 
23752     for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
23753     for (n_space = 0;n_space < gen_nb_int;n_space++) {
23754         mem_base = xmlMemBlocks();
23755         value = gen_const_xmlChar_ptr(n_value, 0);
23756         space = gen_int(n_space, 1);
23757 
23758         ret_val = xmlValidateQName(value, space);
23759         desret_int(ret_val);
23760         call_tests++;
23761         des_const_xmlChar_ptr(n_value, value, 0);
23762         des_int(n_space, space, 1);
23763         xmlResetLastError();
23764         if (mem_base != xmlMemBlocks()) {
23765             printf("Leak of %d blocks found in xmlValidateQName",
23766 	           xmlMemBlocks() - mem_base);
23767 	    test_ret++;
23768             printf(" %d", n_value);
23769             printf(" %d", n_space);
23770             printf("\n");
23771         }
23772     }
23773     }
23774     function_tests++;
23775 #endif
23776 #endif
23777 
23778     return(test_ret);
23779 }
23780 
23781 static int
test_tree(void)23782 test_tree(void) {
23783     int test_ret = 0;
23784 
23785     if (quiet == 0) printf("Testing tree : 144 of 170 functions ...\n");
23786     test_ret += test_xmlAddChild();
23787     test_ret += test_xmlAddChildList();
23788     test_ret += test_xmlAddNextSibling();
23789     test_ret += test_xmlAddPrevSibling();
23790     test_ret += test_xmlAddSibling();
23791     test_ret += test_xmlAttrSerializeTxtContent();
23792     test_ret += test_xmlBufContent();
23793     test_ret += test_xmlBufEnd();
23794     test_ret += test_xmlBufGetNodeContent();
23795     test_ret += test_xmlBufNodeDump();
23796     test_ret += test_xmlBufShrink();
23797     test_ret += test_xmlBufUse();
23798     test_ret += test_xmlBufferAdd();
23799     test_ret += test_xmlBufferAddHead();
23800     test_ret += test_xmlBufferCCat();
23801     test_ret += test_xmlBufferCat();
23802     test_ret += test_xmlBufferContent();
23803     test_ret += test_xmlBufferCreate();
23804     test_ret += test_xmlBufferCreateSize();
23805     test_ret += test_xmlBufferCreateStatic();
23806     test_ret += test_xmlBufferDetach();
23807     test_ret += test_xmlBufferEmpty();
23808     test_ret += test_xmlBufferGrow();
23809     test_ret += test_xmlBufferLength();
23810     test_ret += test_xmlBufferResize();
23811     test_ret += test_xmlBufferSetAllocationScheme();
23812     test_ret += test_xmlBufferShrink();
23813     test_ret += test_xmlBufferWriteCHAR();
23814     test_ret += test_xmlBufferWriteChar();
23815     test_ret += test_xmlBufferWriteQuotedString();
23816     test_ret += test_xmlBuildQName();
23817     test_ret += test_xmlChildElementCount();
23818     test_ret += test_xmlCopyDoc();
23819     test_ret += test_xmlCopyDtd();
23820     test_ret += test_xmlCopyNamespace();
23821     test_ret += test_xmlCopyNamespaceList();
23822     test_ret += test_xmlCopyNode();
23823     test_ret += test_xmlCopyNodeList();
23824     test_ret += test_xmlCopyProp();
23825     test_ret += test_xmlCopyPropList();
23826     test_ret += test_xmlCreateIntSubset();
23827     test_ret += test_xmlDOMWrapAdoptNode();
23828     test_ret += test_xmlDOMWrapCloneNode();
23829     test_ret += test_xmlDOMWrapNewCtxt();
23830     test_ret += test_xmlDOMWrapReconcileNamespaces();
23831     test_ret += test_xmlDOMWrapRemoveNode();
23832     test_ret += test_xmlDeregisterNodeDefault();
23833     test_ret += test_xmlDocCopyNode();
23834     test_ret += test_xmlDocCopyNodeList();
23835     test_ret += test_xmlDocDump();
23836     test_ret += test_xmlDocDumpFormatMemory();
23837     test_ret += test_xmlDocDumpFormatMemoryEnc();
23838     test_ret += test_xmlDocDumpMemory();
23839     test_ret += test_xmlDocDumpMemoryEnc();
23840     test_ret += test_xmlDocFormatDump();
23841     test_ret += test_xmlDocGetRootElement();
23842     test_ret += test_xmlDocSetRootElement();
23843     test_ret += test_xmlElemDump();
23844     test_ret += test_xmlFirstElementChild();
23845     test_ret += test_xmlGetBufferAllocationScheme();
23846     test_ret += test_xmlGetCompressMode();
23847     test_ret += test_xmlGetDocCompressMode();
23848     test_ret += test_xmlGetIntSubset();
23849     test_ret += test_xmlGetLastChild();
23850     test_ret += test_xmlGetLineNo();
23851     test_ret += test_xmlGetNoNsProp();
23852     test_ret += test_xmlGetNodePath();
23853     test_ret += test_xmlGetNsList();
23854     test_ret += test_xmlGetNsProp();
23855     test_ret += test_xmlGetProp();
23856     test_ret += test_xmlHasNsProp();
23857     test_ret += test_xmlHasProp();
23858     test_ret += test_xmlIsBlankNode();
23859     test_ret += test_xmlIsXHTML();
23860     test_ret += test_xmlLastElementChild();
23861     test_ret += test_xmlNewCDataBlock();
23862     test_ret += test_xmlNewCharRef();
23863     test_ret += test_xmlNewChild();
23864     test_ret += test_xmlNewComment();
23865     test_ret += test_xmlNewDoc();
23866     test_ret += test_xmlNewDocComment();
23867     test_ret += test_xmlNewDocFragment();
23868     test_ret += test_xmlNewDocNode();
23869     test_ret += test_xmlNewDocNodeEatName();
23870     test_ret += test_xmlNewDocPI();
23871     test_ret += test_xmlNewDocProp();
23872     test_ret += test_xmlNewDocRawNode();
23873     test_ret += test_xmlNewDocText();
23874     test_ret += test_xmlNewDocTextLen();
23875     test_ret += test_xmlNewDtd();
23876     test_ret += test_xmlNewNode();
23877     test_ret += test_xmlNewNodeEatName();
23878     test_ret += test_xmlNewNs();
23879     test_ret += test_xmlNewNsProp();
23880     test_ret += test_xmlNewNsPropEatName();
23881     test_ret += test_xmlNewPI();
23882     test_ret += test_xmlNewProp();
23883     test_ret += test_xmlNewReference();
23884     test_ret += test_xmlNewText();
23885     test_ret += test_xmlNewTextChild();
23886     test_ret += test_xmlNewTextLen();
23887     test_ret += test_xmlNextElementSibling();
23888     test_ret += test_xmlNodeAddContent();
23889     test_ret += test_xmlNodeAddContentLen();
23890     test_ret += test_xmlNodeBufGetContent();
23891     test_ret += test_xmlNodeDump();
23892     test_ret += test_xmlNodeDumpOutput();
23893     test_ret += test_xmlNodeGetBase();
23894     test_ret += test_xmlNodeGetContent();
23895     test_ret += test_xmlNodeGetLang();
23896     test_ret += test_xmlNodeGetSpacePreserve();
23897     test_ret += test_xmlNodeIsText();
23898     test_ret += test_xmlNodeListGetRawString();
23899     test_ret += test_xmlNodeListGetString();
23900     test_ret += test_xmlNodeSetBase();
23901     test_ret += test_xmlNodeSetContent();
23902     test_ret += test_xmlNodeSetContentLen();
23903     test_ret += test_xmlNodeSetLang();
23904     test_ret += test_xmlNodeSetName();
23905     test_ret += test_xmlNodeSetSpacePreserve();
23906     test_ret += test_xmlPreviousElementSibling();
23907     test_ret += test_xmlReconciliateNs();
23908     test_ret += test_xmlRegisterNodeDefault();
23909     test_ret += test_xmlRemoveProp();
23910     test_ret += test_xmlReplaceNode();
23911     test_ret += test_xmlSaveFile();
23912     test_ret += test_xmlSaveFileEnc();
23913     test_ret += test_xmlSaveFileTo();
23914     test_ret += test_xmlSaveFormatFile();
23915     test_ret += test_xmlSaveFormatFileEnc();
23916     test_ret += test_xmlSaveFormatFileTo();
23917     test_ret += test_xmlSearchNs();
23918     test_ret += test_xmlSearchNsByHref();
23919     test_ret += test_xmlSetBufferAllocationScheme();
23920     test_ret += test_xmlSetCompressMode();
23921     test_ret += test_xmlSetDocCompressMode();
23922     test_ret += test_xmlSetNs();
23923     test_ret += test_xmlSetNsProp();
23924     test_ret += test_xmlSetProp();
23925     test_ret += test_xmlSplitQName2();
23926     test_ret += test_xmlSplitQName3();
23927     test_ret += test_xmlStringGetNodeList();
23928     test_ret += test_xmlStringLenGetNodeList();
23929     test_ret += test_xmlTextConcat();
23930     test_ret += test_xmlTextMerge();
23931     test_ret += test_xmlThrDefBufferAllocScheme();
23932     test_ret += test_xmlThrDefDefaultBufferSize();
23933     test_ret += test_xmlThrDefDeregisterNodeDefault();
23934     test_ret += test_xmlThrDefRegisterNodeDefault();
23935     test_ret += test_xmlUnsetNsProp();
23936     test_ret += test_xmlUnsetProp();
23937     test_ret += test_xmlValidateNCName();
23938     test_ret += test_xmlValidateNMToken();
23939     test_ret += test_xmlValidateName();
23940     test_ret += test_xmlValidateQName();
23941 
23942     if (test_ret != 0)
23943 	printf("Module tree: %d errors\n", test_ret);
23944     return(test_ret);
23945 }
23946 
23947 static int
test_xmlBuildRelativeURI(void)23948 test_xmlBuildRelativeURI(void) {
23949     int test_ret = 0;
23950 
23951     int mem_base;
23952     xmlChar * ret_val;
23953     const xmlChar * URI; /* the URI reference under consideration */
23954     int n_URI;
23955     const xmlChar * base; /* the base value */
23956     int n_base;
23957 
23958     for (n_URI = 0;n_URI < gen_nb_const_xmlChar_ptr;n_URI++) {
23959     for (n_base = 0;n_base < gen_nb_const_xmlChar_ptr;n_base++) {
23960         mem_base = xmlMemBlocks();
23961         URI = gen_const_xmlChar_ptr(n_URI, 0);
23962         base = gen_const_xmlChar_ptr(n_base, 1);
23963 
23964         ret_val = xmlBuildRelativeURI(URI, base);
23965         desret_xmlChar_ptr(ret_val);
23966         call_tests++;
23967         des_const_xmlChar_ptr(n_URI, URI, 0);
23968         des_const_xmlChar_ptr(n_base, base, 1);
23969         xmlResetLastError();
23970         if (mem_base != xmlMemBlocks()) {
23971             printf("Leak of %d blocks found in xmlBuildRelativeURI",
23972 	           xmlMemBlocks() - mem_base);
23973 	    test_ret++;
23974             printf(" %d", n_URI);
23975             printf(" %d", n_base);
23976             printf("\n");
23977         }
23978     }
23979     }
23980     function_tests++;
23981 
23982     return(test_ret);
23983 }
23984 
23985 
23986 static int
test_xmlBuildURI(void)23987 test_xmlBuildURI(void) {
23988     int test_ret = 0;
23989 
23990     int mem_base;
23991     xmlChar * ret_val;
23992     const xmlChar * URI; /* the URI instance found in the document */
23993     int n_URI;
23994     const xmlChar * base; /* the base value */
23995     int n_base;
23996 
23997     for (n_URI = 0;n_URI < gen_nb_const_xmlChar_ptr;n_URI++) {
23998     for (n_base = 0;n_base < gen_nb_const_xmlChar_ptr;n_base++) {
23999         mem_base = xmlMemBlocks();
24000         URI = gen_const_xmlChar_ptr(n_URI, 0);
24001         base = gen_const_xmlChar_ptr(n_base, 1);
24002 
24003         ret_val = xmlBuildURI(URI, base);
24004         desret_xmlChar_ptr(ret_val);
24005         call_tests++;
24006         des_const_xmlChar_ptr(n_URI, URI, 0);
24007         des_const_xmlChar_ptr(n_base, base, 1);
24008         xmlResetLastError();
24009         if (mem_base != xmlMemBlocks()) {
24010             printf("Leak of %d blocks found in xmlBuildURI",
24011 	           xmlMemBlocks() - mem_base);
24012 	    test_ret++;
24013             printf(" %d", n_URI);
24014             printf(" %d", n_base);
24015             printf("\n");
24016         }
24017     }
24018     }
24019     function_tests++;
24020 
24021     return(test_ret);
24022 }
24023 
24024 
24025 static int
test_xmlCanonicPath(void)24026 test_xmlCanonicPath(void) {
24027     int test_ret = 0;
24028 
24029     int mem_base;
24030     xmlChar * ret_val;
24031     const xmlChar * path; /* the resource locator in a filesystem notation */
24032     int n_path;
24033 
24034     for (n_path = 0;n_path < gen_nb_const_xmlChar_ptr;n_path++) {
24035         mem_base = xmlMemBlocks();
24036         path = gen_const_xmlChar_ptr(n_path, 0);
24037 
24038         ret_val = xmlCanonicPath(path);
24039         desret_xmlChar_ptr(ret_val);
24040         call_tests++;
24041         des_const_xmlChar_ptr(n_path, path, 0);
24042         xmlResetLastError();
24043         if (mem_base != xmlMemBlocks()) {
24044             printf("Leak of %d blocks found in xmlCanonicPath",
24045 	           xmlMemBlocks() - mem_base);
24046 	    test_ret++;
24047             printf(" %d", n_path);
24048             printf("\n");
24049         }
24050     }
24051     function_tests++;
24052 
24053     return(test_ret);
24054 }
24055 
24056 
24057 static int
test_xmlCreateURI(void)24058 test_xmlCreateURI(void) {
24059     int test_ret = 0;
24060 
24061 
24062     /* missing type support */
24063     return(test_ret);
24064 }
24065 
24066 
24067 static int
test_xmlNormalizeURIPath(void)24068 test_xmlNormalizeURIPath(void) {
24069     int test_ret = 0;
24070 
24071     int mem_base;
24072     int ret_val;
24073     char * path; /* pointer to the path string */
24074     int n_path;
24075 
24076     for (n_path = 0;n_path < gen_nb_char_ptr;n_path++) {
24077         mem_base = xmlMemBlocks();
24078         path = gen_char_ptr(n_path, 0);
24079 
24080         ret_val = xmlNormalizeURIPath(path);
24081         desret_int(ret_val);
24082         call_tests++;
24083         des_char_ptr(n_path, path, 0);
24084         xmlResetLastError();
24085         if (mem_base != xmlMemBlocks()) {
24086             printf("Leak of %d blocks found in xmlNormalizeURIPath",
24087 	           xmlMemBlocks() - mem_base);
24088 	    test_ret++;
24089             printf(" %d", n_path);
24090             printf("\n");
24091         }
24092     }
24093     function_tests++;
24094 
24095     return(test_ret);
24096 }
24097 
24098 
24099 static int
test_xmlParseURI(void)24100 test_xmlParseURI(void) {
24101     int test_ret = 0;
24102 
24103 
24104     /* missing type support */
24105     return(test_ret);
24106 }
24107 
24108 
24109 static int
test_xmlParseURIRaw(void)24110 test_xmlParseURIRaw(void) {
24111     int test_ret = 0;
24112 
24113 
24114     /* missing type support */
24115     return(test_ret);
24116 }
24117 
24118 
24119 #define gen_nb_xmlURIPtr 1
24120 #define gen_xmlURIPtr(no, nr) NULL
24121 #define des_xmlURIPtr(no, val, nr)
24122 
24123 static int
test_xmlParseURIReference(void)24124 test_xmlParseURIReference(void) {
24125     int test_ret = 0;
24126 
24127     int mem_base;
24128     int ret_val;
24129     xmlURIPtr uri; /* pointer to an URI structure */
24130     int n_uri;
24131     const char * str; /* the string to analyze */
24132     int n_str;
24133 
24134     for (n_uri = 0;n_uri < gen_nb_xmlURIPtr;n_uri++) {
24135     for (n_str = 0;n_str < gen_nb_const_char_ptr;n_str++) {
24136         mem_base = xmlMemBlocks();
24137         uri = gen_xmlURIPtr(n_uri, 0);
24138         str = gen_const_char_ptr(n_str, 1);
24139 
24140         ret_val = xmlParseURIReference(uri, str);
24141         desret_int(ret_val);
24142         call_tests++;
24143         des_xmlURIPtr(n_uri, uri, 0);
24144         des_const_char_ptr(n_str, str, 1);
24145         xmlResetLastError();
24146         if (mem_base != xmlMemBlocks()) {
24147             printf("Leak of %d blocks found in xmlParseURIReference",
24148 	           xmlMemBlocks() - mem_base);
24149 	    test_ret++;
24150             printf(" %d", n_uri);
24151             printf(" %d", n_str);
24152             printf("\n");
24153         }
24154     }
24155     }
24156     function_tests++;
24157 
24158     return(test_ret);
24159 }
24160 
24161 
24162 static int
test_xmlPathToURI(void)24163 test_xmlPathToURI(void) {
24164     int test_ret = 0;
24165 
24166     int mem_base;
24167     xmlChar * ret_val;
24168     const xmlChar * path; /* the resource locator in a filesystem notation */
24169     int n_path;
24170 
24171     for (n_path = 0;n_path < gen_nb_const_xmlChar_ptr;n_path++) {
24172         mem_base = xmlMemBlocks();
24173         path = gen_const_xmlChar_ptr(n_path, 0);
24174 
24175         ret_val = xmlPathToURI(path);
24176         desret_xmlChar_ptr(ret_val);
24177         call_tests++;
24178         des_const_xmlChar_ptr(n_path, path, 0);
24179         xmlResetLastError();
24180         if (mem_base != xmlMemBlocks()) {
24181             printf("Leak of %d blocks found in xmlPathToURI",
24182 	           xmlMemBlocks() - mem_base);
24183 	    test_ret++;
24184             printf(" %d", n_path);
24185             printf("\n");
24186         }
24187     }
24188     function_tests++;
24189 
24190     return(test_ret);
24191 }
24192 
24193 
24194 static int
test_xmlPrintURI(void)24195 test_xmlPrintURI(void) {
24196     int test_ret = 0;
24197 
24198     int mem_base;
24199     FILE * stream; /* a FILE* for the output */
24200     int n_stream;
24201     xmlURIPtr uri; /* pointer to an xmlURI */
24202     int n_uri;
24203 
24204     for (n_stream = 0;n_stream < gen_nb_FILE_ptr;n_stream++) {
24205     for (n_uri = 0;n_uri < gen_nb_xmlURIPtr;n_uri++) {
24206         mem_base = xmlMemBlocks();
24207         stream = gen_FILE_ptr(n_stream, 0);
24208         uri = gen_xmlURIPtr(n_uri, 1);
24209 
24210         xmlPrintURI(stream, uri);
24211         call_tests++;
24212         des_FILE_ptr(n_stream, stream, 0);
24213         des_xmlURIPtr(n_uri, uri, 1);
24214         xmlResetLastError();
24215         if (mem_base != xmlMemBlocks()) {
24216             printf("Leak of %d blocks found in xmlPrintURI",
24217 	           xmlMemBlocks() - mem_base);
24218 	    test_ret++;
24219             printf(" %d", n_stream);
24220             printf(" %d", n_uri);
24221             printf("\n");
24222         }
24223     }
24224     }
24225     function_tests++;
24226 
24227     return(test_ret);
24228 }
24229 
24230 
24231 static int
test_xmlSaveUri(void)24232 test_xmlSaveUri(void) {
24233     int test_ret = 0;
24234 
24235     int mem_base;
24236     xmlChar * ret_val;
24237     xmlURIPtr uri; /* pointer to an xmlURI */
24238     int n_uri;
24239 
24240     for (n_uri = 0;n_uri < gen_nb_xmlURIPtr;n_uri++) {
24241         mem_base = xmlMemBlocks();
24242         uri = gen_xmlURIPtr(n_uri, 0);
24243 
24244         ret_val = xmlSaveUri(uri);
24245         desret_xmlChar_ptr(ret_val);
24246         call_tests++;
24247         des_xmlURIPtr(n_uri, uri, 0);
24248         xmlResetLastError();
24249         if (mem_base != xmlMemBlocks()) {
24250             printf("Leak of %d blocks found in xmlSaveUri",
24251 	           xmlMemBlocks() - mem_base);
24252 	    test_ret++;
24253             printf(" %d", n_uri);
24254             printf("\n");
24255         }
24256     }
24257     function_tests++;
24258 
24259     return(test_ret);
24260 }
24261 
24262 
24263 static int
test_xmlURIEscape(void)24264 test_xmlURIEscape(void) {
24265     int test_ret = 0;
24266 
24267     int mem_base;
24268     xmlChar * ret_val;
24269     const xmlChar * str; /* the string of the URI to escape */
24270     int n_str;
24271 
24272     for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) {
24273         mem_base = xmlMemBlocks();
24274         str = gen_const_xmlChar_ptr(n_str, 0);
24275 
24276         ret_val = xmlURIEscape(str);
24277         desret_xmlChar_ptr(ret_val);
24278         call_tests++;
24279         des_const_xmlChar_ptr(n_str, str, 0);
24280         xmlResetLastError();
24281         if (mem_base != xmlMemBlocks()) {
24282             printf("Leak of %d blocks found in xmlURIEscape",
24283 	           xmlMemBlocks() - mem_base);
24284 	    test_ret++;
24285             printf(" %d", n_str);
24286             printf("\n");
24287         }
24288     }
24289     function_tests++;
24290 
24291     return(test_ret);
24292 }
24293 
24294 
24295 static int
test_xmlURIEscapeStr(void)24296 test_xmlURIEscapeStr(void) {
24297     int test_ret = 0;
24298 
24299     int mem_base;
24300     xmlChar * ret_val;
24301     const xmlChar * str; /* string to escape */
24302     int n_str;
24303     const xmlChar * list; /* exception list string of chars not to escape */
24304     int n_list;
24305 
24306     for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) {
24307     for (n_list = 0;n_list < gen_nb_const_xmlChar_ptr;n_list++) {
24308         mem_base = xmlMemBlocks();
24309         str = gen_const_xmlChar_ptr(n_str, 0);
24310         list = gen_const_xmlChar_ptr(n_list, 1);
24311 
24312         ret_val = xmlURIEscapeStr(str, list);
24313         desret_xmlChar_ptr(ret_val);
24314         call_tests++;
24315         des_const_xmlChar_ptr(n_str, str, 0);
24316         des_const_xmlChar_ptr(n_list, list, 1);
24317         xmlResetLastError();
24318         if (mem_base != xmlMemBlocks()) {
24319             printf("Leak of %d blocks found in xmlURIEscapeStr",
24320 	           xmlMemBlocks() - mem_base);
24321 	    test_ret++;
24322             printf(" %d", n_str);
24323             printf(" %d", n_list);
24324             printf("\n");
24325         }
24326     }
24327     }
24328     function_tests++;
24329 
24330     return(test_ret);
24331 }
24332 
24333 
24334 static int
test_xmlURIUnescapeString(void)24335 test_xmlURIUnescapeString(void) {
24336     int test_ret = 0;
24337 
24338 
24339     /* missing type support */
24340     return(test_ret);
24341 }
24342 
24343 static int
test_uri(void)24344 test_uri(void) {
24345     int test_ret = 0;
24346 
24347     if (quiet == 0) printf("Testing uri : 10 of 15 functions ...\n");
24348     test_ret += test_xmlBuildRelativeURI();
24349     test_ret += test_xmlBuildURI();
24350     test_ret += test_xmlCanonicPath();
24351     test_ret += test_xmlCreateURI();
24352     test_ret += test_xmlNormalizeURIPath();
24353     test_ret += test_xmlParseURI();
24354     test_ret += test_xmlParseURIRaw();
24355     test_ret += test_xmlParseURIReference();
24356     test_ret += test_xmlPathToURI();
24357     test_ret += test_xmlPrintURI();
24358     test_ret += test_xmlSaveUri();
24359     test_ret += test_xmlURIEscape();
24360     test_ret += test_xmlURIEscapeStr();
24361     test_ret += test_xmlURIUnescapeString();
24362 
24363     if (test_ret != 0)
24364 	printf("Module uri: %d errors\n", test_ret);
24365     return(test_ret);
24366 }
24367 
24368 static int
test_xmlAddAttributeDecl(void)24369 test_xmlAddAttributeDecl(void) {
24370     int test_ret = 0;
24371 
24372     int mem_base;
24373     xmlAttributePtr ret_val;
24374     xmlValidCtxtPtr ctxt; /* the validation context */
24375     int n_ctxt;
24376     xmlDtdPtr dtd; /* pointer to the DTD */
24377     int n_dtd;
24378     const xmlChar * elem; /* the element name */
24379     int n_elem;
24380     const xmlChar * name; /* the attribute name */
24381     int n_name;
24382     const xmlChar * ns; /* the attribute namespace prefix */
24383     int n_ns;
24384     xmlAttributeType type; /* the attribute type */
24385     int n_type;
24386     xmlAttributeDefault def; /* the attribute default type */
24387     int n_def;
24388     const xmlChar * defaultValue; /* the attribute default value */
24389     int n_defaultValue;
24390     xmlEnumerationPtr tree; /* if it's an enumeration, the associated list */
24391     int n_tree;
24392 
24393     for (n_ctxt = 0;n_ctxt < gen_nb_xmlValidCtxtPtr;n_ctxt++) {
24394     for (n_dtd = 0;n_dtd < gen_nb_xmlDtdPtr;n_dtd++) {
24395     for (n_elem = 0;n_elem < gen_nb_const_xmlChar_ptr;n_elem++) {
24396     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
24397     for (n_ns = 0;n_ns < gen_nb_const_xmlChar_ptr;n_ns++) {
24398     for (n_type = 0;n_type < gen_nb_xmlAttributeType;n_type++) {
24399     for (n_def = 0;n_def < gen_nb_xmlAttributeDefault;n_def++) {
24400     for (n_defaultValue = 0;n_defaultValue < gen_nb_const_xmlChar_ptr;n_defaultValue++) {
24401     for (n_tree = 0;n_tree < gen_nb_xmlEnumerationPtr;n_tree++) {
24402         mem_base = xmlMemBlocks();
24403         ctxt = gen_xmlValidCtxtPtr(n_ctxt, 0);
24404         dtd = gen_xmlDtdPtr(n_dtd, 1);
24405         elem = gen_const_xmlChar_ptr(n_elem, 2);
24406         name = gen_const_xmlChar_ptr(n_name, 3);
24407         ns = gen_const_xmlChar_ptr(n_ns, 4);
24408         type = gen_xmlAttributeType(n_type, 5);
24409         def = gen_xmlAttributeDefault(n_def, 6);
24410         defaultValue = gen_const_xmlChar_ptr(n_defaultValue, 7);
24411         tree = gen_xmlEnumerationPtr(n_tree, 8);
24412 
24413         ret_val = xmlAddAttributeDecl(ctxt, dtd, elem, name, ns, type, def, defaultValue, tree);
24414         desret_xmlAttributePtr(ret_val);
24415         call_tests++;
24416         des_xmlValidCtxtPtr(n_ctxt, ctxt, 0);
24417         des_xmlDtdPtr(n_dtd, dtd, 1);
24418         des_const_xmlChar_ptr(n_elem, elem, 2);
24419         des_const_xmlChar_ptr(n_name, name, 3);
24420         des_const_xmlChar_ptr(n_ns, ns, 4);
24421         des_xmlAttributeType(n_type, type, 5);
24422         des_xmlAttributeDefault(n_def, def, 6);
24423         des_const_xmlChar_ptr(n_defaultValue, defaultValue, 7);
24424         des_xmlEnumerationPtr(n_tree, tree, 8);
24425         xmlResetLastError();
24426         if (mem_base != xmlMemBlocks()) {
24427             printf("Leak of %d blocks found in xmlAddAttributeDecl",
24428 	           xmlMemBlocks() - mem_base);
24429 	    test_ret++;
24430             printf(" %d", n_ctxt);
24431             printf(" %d", n_dtd);
24432             printf(" %d", n_elem);
24433             printf(" %d", n_name);
24434             printf(" %d", n_ns);
24435             printf(" %d", n_type);
24436             printf(" %d", n_def);
24437             printf(" %d", n_defaultValue);
24438             printf(" %d", n_tree);
24439             printf("\n");
24440         }
24441     }
24442     }
24443     }
24444     }
24445     }
24446     }
24447     }
24448     }
24449     }
24450     function_tests++;
24451 
24452     return(test_ret);
24453 }
24454 
24455 
24456 static int
test_xmlAddElementDecl(void)24457 test_xmlAddElementDecl(void) {
24458     int test_ret = 0;
24459 
24460     int mem_base;
24461     xmlElementPtr ret_val;
24462     xmlValidCtxtPtr ctxt; /* the validation context */
24463     int n_ctxt;
24464     xmlDtdPtr dtd; /* pointer to the DTD */
24465     int n_dtd;
24466     const xmlChar * name; /* the entity name */
24467     int n_name;
24468     xmlElementTypeVal type; /* the element type */
24469     int n_type;
24470     xmlElementContentPtr content; /* the element content tree or NULL */
24471     int n_content;
24472 
24473     for (n_ctxt = 0;n_ctxt < gen_nb_xmlValidCtxtPtr;n_ctxt++) {
24474     for (n_dtd = 0;n_dtd < gen_nb_xmlDtdPtr;n_dtd++) {
24475     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
24476     for (n_type = 0;n_type < gen_nb_xmlElementTypeVal;n_type++) {
24477     for (n_content = 0;n_content < gen_nb_xmlElementContentPtr;n_content++) {
24478         mem_base = xmlMemBlocks();
24479         ctxt = gen_xmlValidCtxtPtr(n_ctxt, 0);
24480         dtd = gen_xmlDtdPtr(n_dtd, 1);
24481         name = gen_const_xmlChar_ptr(n_name, 2);
24482         type = gen_xmlElementTypeVal(n_type, 3);
24483         content = gen_xmlElementContentPtr(n_content, 4);
24484 
24485         ret_val = xmlAddElementDecl(ctxt, dtd, name, type, content);
24486         desret_xmlElementPtr(ret_val);
24487         call_tests++;
24488         des_xmlValidCtxtPtr(n_ctxt, ctxt, 0);
24489         des_xmlDtdPtr(n_dtd, dtd, 1);
24490         des_const_xmlChar_ptr(n_name, name, 2);
24491         des_xmlElementTypeVal(n_type, type, 3);
24492         des_xmlElementContentPtr(n_content, content, 4);
24493         xmlResetLastError();
24494         if (mem_base != xmlMemBlocks()) {
24495             printf("Leak of %d blocks found in xmlAddElementDecl",
24496 	           xmlMemBlocks() - mem_base);
24497 	    test_ret++;
24498             printf(" %d", n_ctxt);
24499             printf(" %d", n_dtd);
24500             printf(" %d", n_name);
24501             printf(" %d", n_type);
24502             printf(" %d", n_content);
24503             printf("\n");
24504         }
24505     }
24506     }
24507     }
24508     }
24509     }
24510     function_tests++;
24511 
24512     return(test_ret);
24513 }
24514 
24515 
24516 static int
test_xmlAddID(void)24517 test_xmlAddID(void) {
24518     int test_ret = 0;
24519 
24520 
24521     /* missing type support */
24522     return(test_ret);
24523 }
24524 
24525 
24526 static int
test_xmlAddNotationDecl(void)24527 test_xmlAddNotationDecl(void) {
24528     int test_ret = 0;
24529 
24530 
24531     /* missing type support */
24532     return(test_ret);
24533 }
24534 
24535 
24536 static int
test_xmlAddRef(void)24537 test_xmlAddRef(void) {
24538     int test_ret = 0;
24539 
24540 
24541     /* missing type support */
24542     return(test_ret);
24543 }
24544 
24545 
24546 static int
test_xmlCopyAttributeTable(void)24547 test_xmlCopyAttributeTable(void) {
24548     int test_ret = 0;
24549 
24550 
24551     /* missing type support */
24552     return(test_ret);
24553 }
24554 
24555 
24556 static int
test_xmlCopyDocElementContent(void)24557 test_xmlCopyDocElementContent(void) {
24558     int test_ret = 0;
24559 
24560     int mem_base;
24561     xmlElementContentPtr ret_val;
24562     xmlDocPtr doc; /* the document owning the element declaration */
24563     int n_doc;
24564     xmlElementContentPtr cur; /* An element content pointer. */
24565     int n_cur;
24566 
24567     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
24568     for (n_cur = 0;n_cur < gen_nb_xmlElementContentPtr;n_cur++) {
24569         mem_base = xmlMemBlocks();
24570         doc = gen_xmlDocPtr(n_doc, 0);
24571         cur = gen_xmlElementContentPtr(n_cur, 1);
24572 
24573         ret_val = xmlCopyDocElementContent(doc, cur);
24574         desret_xmlElementContentPtr(ret_val);
24575         call_tests++;
24576         des_xmlDocPtr(n_doc, doc, 0);
24577         des_xmlElementContentPtr(n_cur, cur, 1);
24578         xmlResetLastError();
24579         if (mem_base != xmlMemBlocks()) {
24580             printf("Leak of %d blocks found in xmlCopyDocElementContent",
24581 	           xmlMemBlocks() - mem_base);
24582 	    test_ret++;
24583             printf(" %d", n_doc);
24584             printf(" %d", n_cur);
24585             printf("\n");
24586         }
24587     }
24588     }
24589     function_tests++;
24590 
24591     return(test_ret);
24592 }
24593 
24594 
24595 static int
test_xmlCopyElementContent(void)24596 test_xmlCopyElementContent(void) {
24597     int test_ret = 0;
24598 
24599     int mem_base;
24600     xmlElementContentPtr ret_val;
24601     xmlElementContentPtr cur; /* An element content pointer. */
24602     int n_cur;
24603 
24604     for (n_cur = 0;n_cur < gen_nb_xmlElementContentPtr;n_cur++) {
24605         mem_base = xmlMemBlocks();
24606         cur = gen_xmlElementContentPtr(n_cur, 0);
24607 
24608         ret_val = xmlCopyElementContent(cur);
24609         desret_xmlElementContentPtr(ret_val);
24610         call_tests++;
24611         des_xmlElementContentPtr(n_cur, cur, 0);
24612         xmlResetLastError();
24613         if (mem_base != xmlMemBlocks()) {
24614             printf("Leak of %d blocks found in xmlCopyElementContent",
24615 	           xmlMemBlocks() - mem_base);
24616 	    test_ret++;
24617             printf(" %d", n_cur);
24618             printf("\n");
24619         }
24620     }
24621     function_tests++;
24622 
24623     return(test_ret);
24624 }
24625 
24626 
24627 static int
test_xmlCopyElementTable(void)24628 test_xmlCopyElementTable(void) {
24629     int test_ret = 0;
24630 
24631 
24632     /* missing type support */
24633     return(test_ret);
24634 }
24635 
24636 
24637 static int
test_xmlCopyEnumeration(void)24638 test_xmlCopyEnumeration(void) {
24639     int test_ret = 0;
24640 
24641 
24642     /* missing type support */
24643     return(test_ret);
24644 }
24645 
24646 
24647 static int
test_xmlCopyNotationTable(void)24648 test_xmlCopyNotationTable(void) {
24649     int test_ret = 0;
24650 
24651 
24652     /* missing type support */
24653     return(test_ret);
24654 }
24655 
24656 
24657 static int
test_xmlCreateEnumeration(void)24658 test_xmlCreateEnumeration(void) {
24659     int test_ret = 0;
24660 
24661 
24662     /* missing type support */
24663     return(test_ret);
24664 }
24665 
24666 
24667 #define gen_nb_xmlAttributePtr 1
24668 #define gen_xmlAttributePtr(no, nr) NULL
24669 #define des_xmlAttributePtr(no, val, nr)
24670 
24671 static int
test_xmlDumpAttributeDecl(void)24672 test_xmlDumpAttributeDecl(void) {
24673     int test_ret = 0;
24674 
24675 #if defined(LIBXML_OUTPUT_ENABLED)
24676     int mem_base;
24677     xmlBufferPtr buf; /* the XML buffer output */
24678     int n_buf;
24679     xmlAttributePtr attr; /* An attribute declaration */
24680     int n_attr;
24681 
24682     for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
24683     for (n_attr = 0;n_attr < gen_nb_xmlAttributePtr;n_attr++) {
24684         mem_base = xmlMemBlocks();
24685         buf = gen_xmlBufferPtr(n_buf, 0);
24686         attr = gen_xmlAttributePtr(n_attr, 1);
24687 
24688         xmlDumpAttributeDecl(buf, attr);
24689         call_tests++;
24690         des_xmlBufferPtr(n_buf, buf, 0);
24691         des_xmlAttributePtr(n_attr, attr, 1);
24692         xmlResetLastError();
24693         if (mem_base != xmlMemBlocks()) {
24694             printf("Leak of %d blocks found in xmlDumpAttributeDecl",
24695 	           xmlMemBlocks() - mem_base);
24696 	    test_ret++;
24697             printf(" %d", n_buf);
24698             printf(" %d", n_attr);
24699             printf("\n");
24700         }
24701     }
24702     }
24703     function_tests++;
24704 #endif
24705 
24706     return(test_ret);
24707 }
24708 
24709 
24710 #define gen_nb_xmlAttributeTablePtr 1
24711 #define gen_xmlAttributeTablePtr(no, nr) NULL
24712 #define des_xmlAttributeTablePtr(no, val, nr)
24713 
24714 static int
test_xmlDumpAttributeTable(void)24715 test_xmlDumpAttributeTable(void) {
24716     int test_ret = 0;
24717 
24718 #if defined(LIBXML_OUTPUT_ENABLED)
24719     int mem_base;
24720     xmlBufferPtr buf; /* the XML buffer output */
24721     int n_buf;
24722     xmlAttributeTablePtr table; /* An attribute table */
24723     int n_table;
24724 
24725     for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
24726     for (n_table = 0;n_table < gen_nb_xmlAttributeTablePtr;n_table++) {
24727         mem_base = xmlMemBlocks();
24728         buf = gen_xmlBufferPtr(n_buf, 0);
24729         table = gen_xmlAttributeTablePtr(n_table, 1);
24730 
24731         xmlDumpAttributeTable(buf, table);
24732         call_tests++;
24733         des_xmlBufferPtr(n_buf, buf, 0);
24734         des_xmlAttributeTablePtr(n_table, table, 1);
24735         xmlResetLastError();
24736         if (mem_base != xmlMemBlocks()) {
24737             printf("Leak of %d blocks found in xmlDumpAttributeTable",
24738 	           xmlMemBlocks() - mem_base);
24739 	    test_ret++;
24740             printf(" %d", n_buf);
24741             printf(" %d", n_table);
24742             printf("\n");
24743         }
24744     }
24745     }
24746     function_tests++;
24747 #endif
24748 
24749     return(test_ret);
24750 }
24751 
24752 
24753 #define gen_nb_xmlElementPtr 1
24754 #define gen_xmlElementPtr(no, nr) NULL
24755 #define des_xmlElementPtr(no, val, nr)
24756 
24757 static int
test_xmlDumpElementDecl(void)24758 test_xmlDumpElementDecl(void) {
24759     int test_ret = 0;
24760 
24761 #if defined(LIBXML_OUTPUT_ENABLED)
24762     int mem_base;
24763     xmlBufferPtr buf; /* the XML buffer output */
24764     int n_buf;
24765     xmlElementPtr elem; /* An element table */
24766     int n_elem;
24767 
24768     for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
24769     for (n_elem = 0;n_elem < gen_nb_xmlElementPtr;n_elem++) {
24770         mem_base = xmlMemBlocks();
24771         buf = gen_xmlBufferPtr(n_buf, 0);
24772         elem = gen_xmlElementPtr(n_elem, 1);
24773 
24774         xmlDumpElementDecl(buf, elem);
24775         call_tests++;
24776         des_xmlBufferPtr(n_buf, buf, 0);
24777         des_xmlElementPtr(n_elem, elem, 1);
24778         xmlResetLastError();
24779         if (mem_base != xmlMemBlocks()) {
24780             printf("Leak of %d blocks found in xmlDumpElementDecl",
24781 	           xmlMemBlocks() - mem_base);
24782 	    test_ret++;
24783             printf(" %d", n_buf);
24784             printf(" %d", n_elem);
24785             printf("\n");
24786         }
24787     }
24788     }
24789     function_tests++;
24790 #endif
24791 
24792     return(test_ret);
24793 }
24794 
24795 
24796 #define gen_nb_xmlElementTablePtr 1
24797 #define gen_xmlElementTablePtr(no, nr) NULL
24798 #define des_xmlElementTablePtr(no, val, nr)
24799 
24800 static int
test_xmlDumpElementTable(void)24801 test_xmlDumpElementTable(void) {
24802     int test_ret = 0;
24803 
24804 #if defined(LIBXML_OUTPUT_ENABLED)
24805     int mem_base;
24806     xmlBufferPtr buf; /* the XML buffer output */
24807     int n_buf;
24808     xmlElementTablePtr table; /* An element table */
24809     int n_table;
24810 
24811     for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
24812     for (n_table = 0;n_table < gen_nb_xmlElementTablePtr;n_table++) {
24813         mem_base = xmlMemBlocks();
24814         buf = gen_xmlBufferPtr(n_buf, 0);
24815         table = gen_xmlElementTablePtr(n_table, 1);
24816 
24817         xmlDumpElementTable(buf, table);
24818         call_tests++;
24819         des_xmlBufferPtr(n_buf, buf, 0);
24820         des_xmlElementTablePtr(n_table, table, 1);
24821         xmlResetLastError();
24822         if (mem_base != xmlMemBlocks()) {
24823             printf("Leak of %d blocks found in xmlDumpElementTable",
24824 	           xmlMemBlocks() - mem_base);
24825 	    test_ret++;
24826             printf(" %d", n_buf);
24827             printf(" %d", n_table);
24828             printf("\n");
24829         }
24830     }
24831     }
24832     function_tests++;
24833 #endif
24834 
24835     return(test_ret);
24836 }
24837 
24838 
24839 #define gen_nb_xmlNotationPtr 1
24840 #define gen_xmlNotationPtr(no, nr) NULL
24841 #define des_xmlNotationPtr(no, val, nr)
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 #define gen_nb_xmlNotationTablePtr 1
24883 #define gen_xmlNotationTablePtr(no, nr) NULL
24884 #define des_xmlNotationTablePtr(no, val, nr)
24885 
24886 static int
test_xmlDumpNotationTable(void)24887 test_xmlDumpNotationTable(void) {
24888     int test_ret = 0;
24889 
24890 #if defined(LIBXML_OUTPUT_ENABLED)
24891     int mem_base;
24892     xmlBufferPtr buf; /* the XML buffer output */
24893     int n_buf;
24894     xmlNotationTablePtr table; /* A notation table */
24895     int n_table;
24896 
24897     for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
24898     for (n_table = 0;n_table < gen_nb_xmlNotationTablePtr;n_table++) {
24899         mem_base = xmlMemBlocks();
24900         buf = gen_xmlBufferPtr(n_buf, 0);
24901         table = gen_xmlNotationTablePtr(n_table, 1);
24902 
24903         xmlDumpNotationTable(buf, table);
24904         call_tests++;
24905         des_xmlBufferPtr(n_buf, buf, 0);
24906         des_xmlNotationTablePtr(n_table, table, 1);
24907         xmlResetLastError();
24908         if (mem_base != xmlMemBlocks()) {
24909             printf("Leak of %d blocks found in xmlDumpNotationTable",
24910 	           xmlMemBlocks() - mem_base);
24911 	    test_ret++;
24912             printf(" %d", n_buf);
24913             printf(" %d", n_table);
24914             printf("\n");
24915         }
24916     }
24917     }
24918     function_tests++;
24919 #endif
24920 
24921     return(test_ret);
24922 }
24923 
24924 
24925 static int
test_xmlGetDtdAttrDesc(void)24926 test_xmlGetDtdAttrDesc(void) {
24927     int test_ret = 0;
24928 
24929     int mem_base;
24930     xmlAttributePtr ret_val;
24931     xmlDtdPtr dtd; /* a pointer to the DtD to search */
24932     int n_dtd;
24933     const xmlChar * elem; /* the element name */
24934     int n_elem;
24935     const xmlChar * name; /* the attribute name */
24936     int n_name;
24937 
24938     for (n_dtd = 0;n_dtd < gen_nb_xmlDtdPtr;n_dtd++) {
24939     for (n_elem = 0;n_elem < gen_nb_const_xmlChar_ptr;n_elem++) {
24940     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
24941         mem_base = xmlMemBlocks();
24942         dtd = gen_xmlDtdPtr(n_dtd, 0);
24943         elem = gen_const_xmlChar_ptr(n_elem, 1);
24944         name = gen_const_xmlChar_ptr(n_name, 2);
24945 
24946         ret_val = xmlGetDtdAttrDesc(dtd, elem, name);
24947         desret_xmlAttributePtr(ret_val);
24948         call_tests++;
24949         des_xmlDtdPtr(n_dtd, dtd, 0);
24950         des_const_xmlChar_ptr(n_elem, elem, 1);
24951         des_const_xmlChar_ptr(n_name, name, 2);
24952         xmlResetLastError();
24953         if (mem_base != xmlMemBlocks()) {
24954             printf("Leak of %d blocks found in xmlGetDtdAttrDesc",
24955 	           xmlMemBlocks() - mem_base);
24956 	    test_ret++;
24957             printf(" %d", n_dtd);
24958             printf(" %d", n_elem);
24959             printf(" %d", n_name);
24960             printf("\n");
24961         }
24962     }
24963     }
24964     }
24965     function_tests++;
24966 
24967     return(test_ret);
24968 }
24969 
24970 
24971 static int
test_xmlGetDtdElementDesc(void)24972 test_xmlGetDtdElementDesc(void) {
24973     int test_ret = 0;
24974 
24975     int mem_base;
24976     xmlElementPtr ret_val;
24977     xmlDtdPtr dtd; /* a pointer to the DtD to search */
24978     int n_dtd;
24979     const xmlChar * name; /* the element name */
24980     int n_name;
24981 
24982     for (n_dtd = 0;n_dtd < gen_nb_xmlDtdPtr;n_dtd++) {
24983     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
24984         mem_base = xmlMemBlocks();
24985         dtd = gen_xmlDtdPtr(n_dtd, 0);
24986         name = gen_const_xmlChar_ptr(n_name, 1);
24987 
24988         ret_val = xmlGetDtdElementDesc(dtd, name);
24989         desret_xmlElementPtr(ret_val);
24990         call_tests++;
24991         des_xmlDtdPtr(n_dtd, dtd, 0);
24992         des_const_xmlChar_ptr(n_name, name, 1);
24993         xmlResetLastError();
24994         if (mem_base != xmlMemBlocks()) {
24995             printf("Leak of %d blocks found in xmlGetDtdElementDesc",
24996 	           xmlMemBlocks() - mem_base);
24997 	    test_ret++;
24998             printf(" %d", n_dtd);
24999             printf(" %d", n_name);
25000             printf("\n");
25001         }
25002     }
25003     }
25004     function_tests++;
25005 
25006     return(test_ret);
25007 }
25008 
25009 
25010 static int
test_xmlGetDtdNotationDesc(void)25011 test_xmlGetDtdNotationDesc(void) {
25012     int test_ret = 0;
25013 
25014 
25015     /* missing type support */
25016     return(test_ret);
25017 }
25018 
25019 
25020 static int
test_xmlGetDtdQAttrDesc(void)25021 test_xmlGetDtdQAttrDesc(void) {
25022     int test_ret = 0;
25023 
25024     int mem_base;
25025     xmlAttributePtr ret_val;
25026     xmlDtdPtr dtd; /* a pointer to the DtD to search */
25027     int n_dtd;
25028     const xmlChar * elem; /* the element name */
25029     int n_elem;
25030     const xmlChar * name; /* the attribute name */
25031     int n_name;
25032     const xmlChar * prefix; /* the attribute namespace prefix */
25033     int n_prefix;
25034 
25035     for (n_dtd = 0;n_dtd < gen_nb_xmlDtdPtr;n_dtd++) {
25036     for (n_elem = 0;n_elem < gen_nb_const_xmlChar_ptr;n_elem++) {
25037     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
25038     for (n_prefix = 0;n_prefix < gen_nb_const_xmlChar_ptr;n_prefix++) {
25039         mem_base = xmlMemBlocks();
25040         dtd = gen_xmlDtdPtr(n_dtd, 0);
25041         elem = gen_const_xmlChar_ptr(n_elem, 1);
25042         name = gen_const_xmlChar_ptr(n_name, 2);
25043         prefix = gen_const_xmlChar_ptr(n_prefix, 3);
25044 
25045         ret_val = xmlGetDtdQAttrDesc(dtd, elem, name, prefix);
25046         desret_xmlAttributePtr(ret_val);
25047         call_tests++;
25048         des_xmlDtdPtr(n_dtd, dtd, 0);
25049         des_const_xmlChar_ptr(n_elem, elem, 1);
25050         des_const_xmlChar_ptr(n_name, name, 2);
25051         des_const_xmlChar_ptr(n_prefix, prefix, 3);
25052         xmlResetLastError();
25053         if (mem_base != xmlMemBlocks()) {
25054             printf("Leak of %d blocks found in xmlGetDtdQAttrDesc",
25055 	           xmlMemBlocks() - mem_base);
25056 	    test_ret++;
25057             printf(" %d", n_dtd);
25058             printf(" %d", n_elem);
25059             printf(" %d", n_name);
25060             printf(" %d", n_prefix);
25061             printf("\n");
25062         }
25063     }
25064     }
25065     }
25066     }
25067     function_tests++;
25068 
25069     return(test_ret);
25070 }
25071 
25072 
25073 static int
test_xmlGetDtdQElementDesc(void)25074 test_xmlGetDtdQElementDesc(void) {
25075     int test_ret = 0;
25076 
25077     int mem_base;
25078     xmlElementPtr ret_val;
25079     xmlDtdPtr dtd; /* a pointer to the DtD to search */
25080     int n_dtd;
25081     const xmlChar * name; /* the element name */
25082     int n_name;
25083     const xmlChar * prefix; /* the element namespace prefix */
25084     int n_prefix;
25085 
25086     for (n_dtd = 0;n_dtd < gen_nb_xmlDtdPtr;n_dtd++) {
25087     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
25088     for (n_prefix = 0;n_prefix < gen_nb_const_xmlChar_ptr;n_prefix++) {
25089         mem_base = xmlMemBlocks();
25090         dtd = gen_xmlDtdPtr(n_dtd, 0);
25091         name = gen_const_xmlChar_ptr(n_name, 1);
25092         prefix = gen_const_xmlChar_ptr(n_prefix, 2);
25093 
25094         ret_val = xmlGetDtdQElementDesc(dtd, name, prefix);
25095         desret_xmlElementPtr(ret_val);
25096         call_tests++;
25097         des_xmlDtdPtr(n_dtd, dtd, 0);
25098         des_const_xmlChar_ptr(n_name, name, 1);
25099         des_const_xmlChar_ptr(n_prefix, prefix, 2);
25100         xmlResetLastError();
25101         if (mem_base != xmlMemBlocks()) {
25102             printf("Leak of %d blocks found in xmlGetDtdQElementDesc",
25103 	           xmlMemBlocks() - mem_base);
25104 	    test_ret++;
25105             printf(" %d", n_dtd);
25106             printf(" %d", n_name);
25107             printf(" %d", n_prefix);
25108             printf("\n");
25109         }
25110     }
25111     }
25112     }
25113     function_tests++;
25114 
25115     return(test_ret);
25116 }
25117 
25118 
25119 static int
test_xmlGetID(void)25120 test_xmlGetID(void) {
25121     int test_ret = 0;
25122 
25123     int mem_base;
25124     xmlAttrPtr ret_val;
25125     xmlDocPtr doc; /* pointer to the document */
25126     int n_doc;
25127     const xmlChar * ID; /* the ID value */
25128     int n_ID;
25129 
25130     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
25131     for (n_ID = 0;n_ID < gen_nb_const_xmlChar_ptr;n_ID++) {
25132         mem_base = xmlMemBlocks();
25133         doc = gen_xmlDocPtr(n_doc, 0);
25134         ID = gen_const_xmlChar_ptr(n_ID, 1);
25135 
25136         ret_val = xmlGetID(doc, ID);
25137         desret_xmlAttrPtr(ret_val);
25138         call_tests++;
25139         des_xmlDocPtr(n_doc, doc, 0);
25140         des_const_xmlChar_ptr(n_ID, ID, 1);
25141         xmlResetLastError();
25142         if (mem_base != xmlMemBlocks()) {
25143             printf("Leak of %d blocks found in xmlGetID",
25144 	           xmlMemBlocks() - mem_base);
25145 	    test_ret++;
25146             printf(" %d", n_doc);
25147             printf(" %d", n_ID);
25148             printf("\n");
25149         }
25150     }
25151     }
25152     function_tests++;
25153 
25154     return(test_ret);
25155 }
25156 
25157 
25158 static int
test_xmlGetRefs(void)25159 test_xmlGetRefs(void) {
25160     int test_ret = 0;
25161 
25162 
25163     /* missing type support */
25164     return(test_ret);
25165 }
25166 
25167 
25168 static int
test_xmlIsID(void)25169 test_xmlIsID(void) {
25170     int test_ret = 0;
25171 
25172     int mem_base;
25173     int ret_val;
25174     xmlDocPtr doc; /* the document */
25175     int n_doc;
25176     xmlNodePtr elem; /* the element carrying the attribute */
25177     int n_elem;
25178     xmlAttrPtr attr; /* the attribute */
25179     int n_attr;
25180 
25181     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
25182     for (n_elem = 0;n_elem < gen_nb_xmlNodePtr;n_elem++) {
25183     for (n_attr = 0;n_attr < gen_nb_xmlAttrPtr;n_attr++) {
25184         mem_base = xmlMemBlocks();
25185         doc = gen_xmlDocPtr(n_doc, 0);
25186         elem = gen_xmlNodePtr(n_elem, 1);
25187         attr = gen_xmlAttrPtr(n_attr, 2);
25188 
25189         ret_val = xmlIsID(doc, elem, attr);
25190         desret_int(ret_val);
25191         call_tests++;
25192         des_xmlDocPtr(n_doc, doc, 0);
25193         des_xmlNodePtr(n_elem, elem, 1);
25194         des_xmlAttrPtr(n_attr, attr, 2);
25195         xmlResetLastError();
25196         if (mem_base != xmlMemBlocks()) {
25197             printf("Leak of %d blocks found in xmlIsID",
25198 	           xmlMemBlocks() - mem_base);
25199 	    test_ret++;
25200             printf(" %d", n_doc);
25201             printf(" %d", n_elem);
25202             printf(" %d", n_attr);
25203             printf("\n");
25204         }
25205     }
25206     }
25207     }
25208     function_tests++;
25209 
25210     return(test_ret);
25211 }
25212 
25213 
25214 static int
test_xmlIsMixedElement(void)25215 test_xmlIsMixedElement(void) {
25216     int test_ret = 0;
25217 
25218     int mem_base;
25219     int ret_val;
25220     xmlDocPtr doc; /* the document */
25221     int n_doc;
25222     const xmlChar * name; /* the element name */
25223     int n_name;
25224 
25225     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
25226     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
25227         mem_base = xmlMemBlocks();
25228         doc = gen_xmlDocPtr(n_doc, 0);
25229         name = gen_const_xmlChar_ptr(n_name, 1);
25230 
25231         ret_val = xmlIsMixedElement(doc, name);
25232         desret_int(ret_val);
25233         call_tests++;
25234         des_xmlDocPtr(n_doc, doc, 0);
25235         des_const_xmlChar_ptr(n_name, name, 1);
25236         xmlResetLastError();
25237         if (mem_base != xmlMemBlocks()) {
25238             printf("Leak of %d blocks found in xmlIsMixedElement",
25239 	           xmlMemBlocks() - mem_base);
25240 	    test_ret++;
25241             printf(" %d", n_doc);
25242             printf(" %d", n_name);
25243             printf("\n");
25244         }
25245     }
25246     }
25247     function_tests++;
25248 
25249     return(test_ret);
25250 }
25251 
25252 
25253 static int
test_xmlIsRef(void)25254 test_xmlIsRef(void) {
25255     int test_ret = 0;
25256 
25257     int mem_base;
25258     int ret_val;
25259     xmlDocPtr doc; /* the document */
25260     int n_doc;
25261     xmlNodePtr elem; /* the element carrying the attribute */
25262     int n_elem;
25263     xmlAttrPtr attr; /* the attribute */
25264     int n_attr;
25265 
25266     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
25267     for (n_elem = 0;n_elem < gen_nb_xmlNodePtr;n_elem++) {
25268     for (n_attr = 0;n_attr < gen_nb_xmlAttrPtr;n_attr++) {
25269         mem_base = xmlMemBlocks();
25270         doc = gen_xmlDocPtr(n_doc, 0);
25271         elem = gen_xmlNodePtr(n_elem, 1);
25272         attr = gen_xmlAttrPtr(n_attr, 2);
25273 
25274         ret_val = xmlIsRef(doc, elem, attr);
25275         desret_int(ret_val);
25276         call_tests++;
25277         des_xmlDocPtr(n_doc, doc, 0);
25278         des_xmlNodePtr(n_elem, elem, 1);
25279         des_xmlAttrPtr(n_attr, attr, 2);
25280         xmlResetLastError();
25281         if (mem_base != xmlMemBlocks()) {
25282             printf("Leak of %d blocks found in xmlIsRef",
25283 	           xmlMemBlocks() - mem_base);
25284 	    test_ret++;
25285             printf(" %d", n_doc);
25286             printf(" %d", n_elem);
25287             printf(" %d", n_attr);
25288             printf("\n");
25289         }
25290     }
25291     }
25292     }
25293     function_tests++;
25294 
25295     return(test_ret);
25296 }
25297 
25298 
25299 static int
test_xmlNewDocElementContent(void)25300 test_xmlNewDocElementContent(void) {
25301     int test_ret = 0;
25302 
25303     int mem_base;
25304     xmlElementContentPtr ret_val;
25305     xmlDocPtr doc; /* the document */
25306     int n_doc;
25307     const xmlChar * name; /* the subelement name or NULL */
25308     int n_name;
25309     xmlElementContentType type; /* the type of element content decl */
25310     int n_type;
25311 
25312     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
25313     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
25314     for (n_type = 0;n_type < gen_nb_xmlElementContentType;n_type++) {
25315         mem_base = xmlMemBlocks();
25316         doc = gen_xmlDocPtr(n_doc, 0);
25317         name = gen_const_xmlChar_ptr(n_name, 1);
25318         type = gen_xmlElementContentType(n_type, 2);
25319 
25320         ret_val = xmlNewDocElementContent(doc, name, type);
25321         xmlFreeDocElementContent(doc, ret_val); ret_val = NULL;
25322         desret_xmlElementContentPtr(ret_val);
25323         call_tests++;
25324         des_xmlDocPtr(n_doc, doc, 0);
25325         des_const_xmlChar_ptr(n_name, name, 1);
25326         des_xmlElementContentType(n_type, type, 2);
25327         xmlResetLastError();
25328         if (mem_base != xmlMemBlocks()) {
25329             printf("Leak of %d blocks found in xmlNewDocElementContent",
25330 	           xmlMemBlocks() - mem_base);
25331 	    test_ret++;
25332             printf(" %d", n_doc);
25333             printf(" %d", n_name);
25334             printf(" %d", n_type);
25335             printf("\n");
25336         }
25337     }
25338     }
25339     }
25340     function_tests++;
25341 
25342     return(test_ret);
25343 }
25344 
25345 
25346 static int
test_xmlNewElementContent(void)25347 test_xmlNewElementContent(void) {
25348     int test_ret = 0;
25349 
25350     int mem_base;
25351     xmlElementContentPtr ret_val;
25352     const xmlChar * name; /* the subelement name or NULL */
25353     int n_name;
25354     xmlElementContentType type; /* the type of element content decl */
25355     int n_type;
25356 
25357     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
25358     for (n_type = 0;n_type < gen_nb_xmlElementContentType;n_type++) {
25359         mem_base = xmlMemBlocks();
25360         name = gen_const_xmlChar_ptr(n_name, 0);
25361         type = gen_xmlElementContentType(n_type, 1);
25362 
25363         ret_val = xmlNewElementContent(name, type);
25364         desret_xmlElementContentPtr(ret_val);
25365         call_tests++;
25366         des_const_xmlChar_ptr(n_name, name, 0);
25367         des_xmlElementContentType(n_type, type, 1);
25368         xmlResetLastError();
25369         if (mem_base != xmlMemBlocks()) {
25370             printf("Leak of %d blocks found in xmlNewElementContent",
25371 	           xmlMemBlocks() - mem_base);
25372 	    test_ret++;
25373             printf(" %d", n_name);
25374             printf(" %d", n_type);
25375             printf("\n");
25376         }
25377     }
25378     }
25379     function_tests++;
25380 
25381     return(test_ret);
25382 }
25383 
25384 
25385 static int
test_xmlNewValidCtxt(void)25386 test_xmlNewValidCtxt(void) {
25387     int test_ret = 0;
25388 
25389 
25390     /* missing type support */
25391     return(test_ret);
25392 }
25393 
25394 
25395 static int
test_xmlRemoveID(void)25396 test_xmlRemoveID(void) {
25397     int test_ret = 0;
25398 
25399     int mem_base;
25400     int ret_val;
25401     xmlDocPtr doc; /* the document */
25402     int n_doc;
25403     xmlAttrPtr attr; /* the attribute */
25404     int n_attr;
25405 
25406     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
25407     for (n_attr = 0;n_attr < gen_nb_xmlAttrPtr;n_attr++) {
25408         mem_base = xmlMemBlocks();
25409         doc = gen_xmlDocPtr(n_doc, 0);
25410         attr = gen_xmlAttrPtr(n_attr, 1);
25411 
25412         ret_val = xmlRemoveID(doc, attr);
25413         desret_int(ret_val);
25414         call_tests++;
25415         des_xmlDocPtr(n_doc, doc, 0);
25416         des_xmlAttrPtr(n_attr, attr, 1);
25417         xmlResetLastError();
25418         if (mem_base != xmlMemBlocks()) {
25419             printf("Leak of %d blocks found in xmlRemoveID",
25420 	           xmlMemBlocks() - mem_base);
25421 	    test_ret++;
25422             printf(" %d", n_doc);
25423             printf(" %d", n_attr);
25424             printf("\n");
25425         }
25426     }
25427     }
25428     function_tests++;
25429 
25430     return(test_ret);
25431 }
25432 
25433 
25434 static int
test_xmlRemoveRef(void)25435 test_xmlRemoveRef(void) {
25436     int test_ret = 0;
25437 
25438     int mem_base;
25439     int ret_val;
25440     xmlDocPtr doc; /* the document */
25441     int n_doc;
25442     xmlAttrPtr attr; /* the attribute */
25443     int n_attr;
25444 
25445     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
25446     for (n_attr = 0;n_attr < gen_nb_xmlAttrPtr;n_attr++) {
25447         mem_base = xmlMemBlocks();
25448         doc = gen_xmlDocPtr(n_doc, 0);
25449         attr = gen_xmlAttrPtr(n_attr, 1);
25450 
25451         ret_val = xmlRemoveRef(doc, attr);
25452         desret_int(ret_val);
25453         call_tests++;
25454         des_xmlDocPtr(n_doc, doc, 0);
25455         des_xmlAttrPtr(n_attr, attr, 1);
25456         xmlResetLastError();
25457         if (mem_base != xmlMemBlocks()) {
25458             printf("Leak of %d blocks found in xmlRemoveRef",
25459 	           xmlMemBlocks() - mem_base);
25460 	    test_ret++;
25461             printf(" %d", n_doc);
25462             printf(" %d", n_attr);
25463             printf("\n");
25464         }
25465     }
25466     }
25467     function_tests++;
25468 
25469     return(test_ret);
25470 }
25471 
25472 
25473 static int
test_xmlSnprintfElementContent(void)25474 test_xmlSnprintfElementContent(void) {
25475     int test_ret = 0;
25476 
25477     int mem_base;
25478     char * buf; /* an output buffer */
25479     int n_buf;
25480     int size; /* the buffer size */
25481     int n_size;
25482     xmlElementContentPtr content; /* An element table */
25483     int n_content;
25484     int englob; /* 1 if one must print the englobing parenthesis, 0 otherwise */
25485     int n_englob;
25486 
25487     for (n_buf = 0;n_buf < gen_nb_char_ptr;n_buf++) {
25488     for (n_size = 0;n_size < gen_nb_int;n_size++) {
25489     for (n_content = 0;n_content < gen_nb_xmlElementContentPtr;n_content++) {
25490     for (n_englob = 0;n_englob < gen_nb_int;n_englob++) {
25491         mem_base = xmlMemBlocks();
25492         buf = gen_char_ptr(n_buf, 0);
25493         size = gen_int(n_size, 1);
25494         content = gen_xmlElementContentPtr(n_content, 2);
25495         englob = gen_int(n_englob, 3);
25496 
25497         xmlSnprintfElementContent(buf, size, content, englob);
25498         call_tests++;
25499         des_char_ptr(n_buf, buf, 0);
25500         des_int(n_size, size, 1);
25501         des_xmlElementContentPtr(n_content, content, 2);
25502         des_int(n_englob, englob, 3);
25503         xmlResetLastError();
25504         if (mem_base != xmlMemBlocks()) {
25505             printf("Leak of %d blocks found in xmlSnprintfElementContent",
25506 	           xmlMemBlocks() - mem_base);
25507 	    test_ret++;
25508             printf(" %d", n_buf);
25509             printf(" %d", n_size);
25510             printf(" %d", n_content);
25511             printf(" %d", n_englob);
25512             printf("\n");
25513         }
25514     }
25515     }
25516     }
25517     }
25518     function_tests++;
25519 
25520     return(test_ret);
25521 }
25522 
25523 
25524 static int
test_xmlSprintfElementContent(void)25525 test_xmlSprintfElementContent(void) {
25526     int test_ret = 0;
25527 
25528 #if defined(LIBXML_OUTPUT_ENABLED)
25529 #ifdef LIBXML_OUTPUT_ENABLED
25530     int mem_base;
25531     char * buf; /* an output buffer */
25532     int n_buf;
25533     xmlElementContentPtr content; /* An element table */
25534     int n_content;
25535     int englob; /* 1 if one must print the englobing parenthesis, 0 otherwise */
25536     int n_englob;
25537 
25538     for (n_buf = 0;n_buf < gen_nb_char_ptr;n_buf++) {
25539     for (n_content = 0;n_content < gen_nb_xmlElementContentPtr;n_content++) {
25540     for (n_englob = 0;n_englob < gen_nb_int;n_englob++) {
25541         mem_base = xmlMemBlocks();
25542         buf = gen_char_ptr(n_buf, 0);
25543         content = gen_xmlElementContentPtr(n_content, 1);
25544         englob = gen_int(n_englob, 2);
25545 
25546         xmlSprintfElementContent(buf, content, englob);
25547         call_tests++;
25548         des_char_ptr(n_buf, buf, 0);
25549         des_xmlElementContentPtr(n_content, content, 1);
25550         des_int(n_englob, englob, 2);
25551         xmlResetLastError();
25552         if (mem_base != xmlMemBlocks()) {
25553             printf("Leak of %d blocks found in xmlSprintfElementContent",
25554 	           xmlMemBlocks() - mem_base);
25555 	    test_ret++;
25556             printf(" %d", n_buf);
25557             printf(" %d", n_content);
25558             printf(" %d", n_englob);
25559             printf("\n");
25560         }
25561     }
25562     }
25563     }
25564     function_tests++;
25565 #endif
25566 #endif
25567 
25568     return(test_ret);
25569 }
25570 
25571 
25572 static int
test_xmlValidBuildContentModel(void)25573 test_xmlValidBuildContentModel(void) {
25574     int test_ret = 0;
25575 
25576 #if defined(LIBXML_VALID_ENABLED) && defined(LIBXML_REGEXP_ENABLED)
25577     int mem_base;
25578     int ret_val;
25579     xmlValidCtxtPtr ctxt; /* a validation context */
25580     int n_ctxt;
25581     xmlElementPtr elem; /* an element declaration node */
25582     int n_elem;
25583 
25584     for (n_ctxt = 0;n_ctxt < gen_nb_xmlValidCtxtPtr;n_ctxt++) {
25585     for (n_elem = 0;n_elem < gen_nb_xmlElementPtr;n_elem++) {
25586         mem_base = xmlMemBlocks();
25587         ctxt = gen_xmlValidCtxtPtr(n_ctxt, 0);
25588         elem = gen_xmlElementPtr(n_elem, 1);
25589 
25590         ret_val = xmlValidBuildContentModel(ctxt, elem);
25591         desret_int(ret_val);
25592         call_tests++;
25593         des_xmlValidCtxtPtr(n_ctxt, ctxt, 0);
25594         des_xmlElementPtr(n_elem, elem, 1);
25595         xmlResetLastError();
25596         if (mem_base != xmlMemBlocks()) {
25597             printf("Leak of %d blocks found in xmlValidBuildContentModel",
25598 	           xmlMemBlocks() - mem_base);
25599 	    test_ret++;
25600             printf(" %d", n_ctxt);
25601             printf(" %d", n_elem);
25602             printf("\n");
25603         }
25604     }
25605     }
25606     function_tests++;
25607 #endif
25608 
25609     return(test_ret);
25610 }
25611 
25612 
25613 static int
test_xmlValidCtxtNormalizeAttributeValue(void)25614 test_xmlValidCtxtNormalizeAttributeValue(void) {
25615     int test_ret = 0;
25616 
25617 #if defined(LIBXML_VALID_ENABLED)
25618     int mem_base;
25619     xmlChar * ret_val;
25620     xmlValidCtxtPtr ctxt; /* the validation context or NULL */
25621     int n_ctxt;
25622     xmlDocPtr doc; /* the document */
25623     int n_doc;
25624     xmlNodePtr elem; /* the parent */
25625     int n_elem;
25626     const xmlChar * name; /* the attribute name */
25627     int n_name;
25628     const xmlChar * value; /* the attribute value */
25629     int n_value;
25630 
25631     for (n_ctxt = 0;n_ctxt < gen_nb_xmlValidCtxtPtr;n_ctxt++) {
25632     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
25633     for (n_elem = 0;n_elem < gen_nb_xmlNodePtr;n_elem++) {
25634     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
25635     for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
25636         mem_base = xmlMemBlocks();
25637         ctxt = gen_xmlValidCtxtPtr(n_ctxt, 0);
25638         doc = gen_xmlDocPtr(n_doc, 1);
25639         elem = gen_xmlNodePtr(n_elem, 2);
25640         name = gen_const_xmlChar_ptr(n_name, 3);
25641         value = gen_const_xmlChar_ptr(n_value, 4);
25642 
25643         ret_val = xmlValidCtxtNormalizeAttributeValue(ctxt, doc, elem, name, value);
25644         desret_xmlChar_ptr(ret_val);
25645         call_tests++;
25646         des_xmlValidCtxtPtr(n_ctxt, ctxt, 0);
25647         des_xmlDocPtr(n_doc, doc, 1);
25648         des_xmlNodePtr(n_elem, elem, 2);
25649         des_const_xmlChar_ptr(n_name, name, 3);
25650         des_const_xmlChar_ptr(n_value, value, 4);
25651         xmlResetLastError();
25652         if (mem_base != xmlMemBlocks()) {
25653             printf("Leak of %d blocks found in xmlValidCtxtNormalizeAttributeValue",
25654 	           xmlMemBlocks() - mem_base);
25655 	    test_ret++;
25656             printf(" %d", n_ctxt);
25657             printf(" %d", n_doc);
25658             printf(" %d", n_elem);
25659             printf(" %d", n_name);
25660             printf(" %d", n_value);
25661             printf("\n");
25662         }
25663     }
25664     }
25665     }
25666     }
25667     }
25668     function_tests++;
25669 #endif
25670 
25671     return(test_ret);
25672 }
25673 
25674 
25675 #define gen_nb_xmlElementContent_ptr 1
25676 #define gen_xmlElementContent_ptr(no, nr) NULL
25677 #define des_xmlElementContent_ptr(no, val, nr)
25678 
25679 static int
test_xmlValidGetPotentialChildren(void)25680 test_xmlValidGetPotentialChildren(void) {
25681     int test_ret = 0;
25682 
25683 #if defined(LIBXML_VALID_ENABLED)
25684 #ifdef LIBXML_VALID_ENABLED
25685     int mem_base;
25686     int ret_val;
25687     xmlElementContent * ctree; /* an element content tree */
25688     int n_ctree;
25689     const xmlChar ** names; /* an array to store the list of child names */
25690     int n_names;
25691     int * len; /* a pointer to the number of element in the list */
25692     int n_len;
25693     int max; /* the size of the array */
25694     int n_max;
25695 
25696     for (n_ctree = 0;n_ctree < gen_nb_xmlElementContent_ptr;n_ctree++) {
25697     for (n_names = 0;n_names < gen_nb_const_xmlChar_ptr_ptr;n_names++) {
25698     for (n_len = 0;n_len < gen_nb_int_ptr;n_len++) {
25699     for (n_max = 0;n_max < gen_nb_int;n_max++) {
25700         mem_base = xmlMemBlocks();
25701         ctree = gen_xmlElementContent_ptr(n_ctree, 0);
25702         names = gen_const_xmlChar_ptr_ptr(n_names, 1);
25703         len = gen_int_ptr(n_len, 2);
25704         max = gen_int(n_max, 3);
25705 
25706         ret_val = xmlValidGetPotentialChildren(ctree, names, len, max);
25707         desret_int(ret_val);
25708         call_tests++;
25709         des_xmlElementContent_ptr(n_ctree, ctree, 0);
25710         des_const_xmlChar_ptr_ptr(n_names, names, 1);
25711         des_int_ptr(n_len, len, 2);
25712         des_int(n_max, max, 3);
25713         xmlResetLastError();
25714         if (mem_base != xmlMemBlocks()) {
25715             printf("Leak of %d blocks found in xmlValidGetPotentialChildren",
25716 	           xmlMemBlocks() - mem_base);
25717 	    test_ret++;
25718             printf(" %d", n_ctree);
25719             printf(" %d", n_names);
25720             printf(" %d", n_len);
25721             printf(" %d", n_max);
25722             printf("\n");
25723         }
25724     }
25725     }
25726     }
25727     }
25728     function_tests++;
25729 #endif
25730 #endif
25731 
25732     return(test_ret);
25733 }
25734 
25735 
25736 static int
test_xmlValidGetValidElements(void)25737 test_xmlValidGetValidElements(void) {
25738     int test_ret = 0;
25739 
25740 #if defined(LIBXML_VALID_ENABLED)
25741 #ifdef LIBXML_VALID_ENABLED
25742     int mem_base;
25743     int ret_val;
25744     xmlNode * prev; /* an element to insert after */
25745     int n_prev;
25746     xmlNode * next; /* an element to insert next */
25747     int n_next;
25748     const xmlChar ** names; /* an array to store the list of child names */
25749     int n_names;
25750     int max; /* the size of the array */
25751     int n_max;
25752 
25753     for (n_prev = 0;n_prev < gen_nb_xmlNodePtr;n_prev++) {
25754     for (n_next = 0;n_next < gen_nb_xmlNodePtr;n_next++) {
25755     for (n_names = 0;n_names < gen_nb_const_xmlChar_ptr_ptr;n_names++) {
25756     for (n_max = 0;n_max < gen_nb_int;n_max++) {
25757         mem_base = xmlMemBlocks();
25758         prev = gen_xmlNodePtr(n_prev, 0);
25759         next = gen_xmlNodePtr(n_next, 1);
25760         names = gen_const_xmlChar_ptr_ptr(n_names, 2);
25761         max = gen_int(n_max, 3);
25762 
25763         ret_val = xmlValidGetValidElements(prev, next, names, max);
25764         desret_int(ret_val);
25765         call_tests++;
25766         des_xmlNodePtr(n_prev, prev, 0);
25767         des_xmlNodePtr(n_next, next, 1);
25768         des_const_xmlChar_ptr_ptr(n_names, names, 2);
25769         des_int(n_max, max, 3);
25770         xmlResetLastError();
25771         if (mem_base != xmlMemBlocks()) {
25772             printf("Leak of %d blocks found in xmlValidGetValidElements",
25773 	           xmlMemBlocks() - mem_base);
25774 	    test_ret++;
25775             printf(" %d", n_prev);
25776             printf(" %d", n_next);
25777             printf(" %d", n_names);
25778             printf(" %d", n_max);
25779             printf("\n");
25780         }
25781     }
25782     }
25783     }
25784     }
25785     function_tests++;
25786 #endif
25787 #endif
25788 
25789     return(test_ret);
25790 }
25791 
25792 
25793 static int
test_xmlValidNormalizeAttributeValue(void)25794 test_xmlValidNormalizeAttributeValue(void) {
25795     int test_ret = 0;
25796 
25797 #if defined(LIBXML_VALID_ENABLED)
25798     int mem_base;
25799     xmlChar * ret_val;
25800     xmlDocPtr doc; /* the document */
25801     int n_doc;
25802     xmlNodePtr elem; /* the parent */
25803     int n_elem;
25804     const xmlChar * name; /* the attribute name */
25805     int n_name;
25806     const xmlChar * value; /* the attribute value */
25807     int n_value;
25808 
25809     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
25810     for (n_elem = 0;n_elem < gen_nb_xmlNodePtr;n_elem++) {
25811     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
25812     for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
25813         mem_base = xmlMemBlocks();
25814         doc = gen_xmlDocPtr(n_doc, 0);
25815         elem = gen_xmlNodePtr(n_elem, 1);
25816         name = gen_const_xmlChar_ptr(n_name, 2);
25817         value = gen_const_xmlChar_ptr(n_value, 3);
25818 
25819         ret_val = xmlValidNormalizeAttributeValue(doc, elem, name, value);
25820         desret_xmlChar_ptr(ret_val);
25821         call_tests++;
25822         des_xmlDocPtr(n_doc, doc, 0);
25823         des_xmlNodePtr(n_elem, elem, 1);
25824         des_const_xmlChar_ptr(n_name, name, 2);
25825         des_const_xmlChar_ptr(n_value, value, 3);
25826         xmlResetLastError();
25827         if (mem_base != xmlMemBlocks()) {
25828             printf("Leak of %d blocks found in xmlValidNormalizeAttributeValue",
25829 	           xmlMemBlocks() - mem_base);
25830 	    test_ret++;
25831             printf(" %d", n_doc);
25832             printf(" %d", n_elem);
25833             printf(" %d", n_name);
25834             printf(" %d", n_value);
25835             printf("\n");
25836         }
25837     }
25838     }
25839     }
25840     }
25841     function_tests++;
25842 #endif
25843 
25844     return(test_ret);
25845 }
25846 
25847 
25848 static int
test_xmlValidateAttributeDecl(void)25849 test_xmlValidateAttributeDecl(void) {
25850     int test_ret = 0;
25851 
25852 #if defined(LIBXML_VALID_ENABLED)
25853     int mem_base;
25854     int ret_val;
25855     xmlValidCtxtPtr ctxt; /* the validation context */
25856     int n_ctxt;
25857     xmlDocPtr doc; /* a document instance */
25858     int n_doc;
25859     xmlAttributePtr attr; /* an attribute definition */
25860     int n_attr;
25861 
25862     for (n_ctxt = 0;n_ctxt < gen_nb_xmlValidCtxtPtr;n_ctxt++) {
25863     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
25864     for (n_attr = 0;n_attr < gen_nb_xmlAttributePtr;n_attr++) {
25865         mem_base = xmlMemBlocks();
25866         ctxt = gen_xmlValidCtxtPtr(n_ctxt, 0);
25867         doc = gen_xmlDocPtr(n_doc, 1);
25868         attr = gen_xmlAttributePtr(n_attr, 2);
25869 
25870         ret_val = xmlValidateAttributeDecl(ctxt, doc, attr);
25871         desret_int(ret_val);
25872         call_tests++;
25873         des_xmlValidCtxtPtr(n_ctxt, ctxt, 0);
25874         des_xmlDocPtr(n_doc, doc, 1);
25875         des_xmlAttributePtr(n_attr, attr, 2);
25876         xmlResetLastError();
25877         if (mem_base != xmlMemBlocks()) {
25878             printf("Leak of %d blocks found in xmlValidateAttributeDecl",
25879 	           xmlMemBlocks() - mem_base);
25880 	    test_ret++;
25881             printf(" %d", n_ctxt);
25882             printf(" %d", n_doc);
25883             printf(" %d", n_attr);
25884             printf("\n");
25885         }
25886     }
25887     }
25888     }
25889     function_tests++;
25890 #endif
25891 
25892     return(test_ret);
25893 }
25894 
25895 
25896 static int
test_xmlValidateAttributeValue(void)25897 test_xmlValidateAttributeValue(void) {
25898     int test_ret = 0;
25899 
25900 #if defined(LIBXML_VALID_ENABLED)
25901     int mem_base;
25902     int ret_val;
25903     xmlAttributeType type; /* an attribute type */
25904     int n_type;
25905     const xmlChar * value; /* an attribute value */
25906     int n_value;
25907 
25908     for (n_type = 0;n_type < gen_nb_xmlAttributeType;n_type++) {
25909     for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
25910         mem_base = xmlMemBlocks();
25911         type = gen_xmlAttributeType(n_type, 0);
25912         value = gen_const_xmlChar_ptr(n_value, 1);
25913 
25914         ret_val = xmlValidateAttributeValue(type, value);
25915         desret_int(ret_val);
25916         call_tests++;
25917         des_xmlAttributeType(n_type, type, 0);
25918         des_const_xmlChar_ptr(n_value, value, 1);
25919         xmlResetLastError();
25920         if (mem_base != xmlMemBlocks()) {
25921             printf("Leak of %d blocks found in xmlValidateAttributeValue",
25922 	           xmlMemBlocks() - mem_base);
25923 	    test_ret++;
25924             printf(" %d", n_type);
25925             printf(" %d", n_value);
25926             printf("\n");
25927         }
25928     }
25929     }
25930     function_tests++;
25931 #endif
25932 
25933     return(test_ret);
25934 }
25935 
25936 
25937 static int
test_xmlValidateDocument(void)25938 test_xmlValidateDocument(void) {
25939     int test_ret = 0;
25940 
25941 #if defined(LIBXML_VALID_ENABLED)
25942     int mem_base;
25943     int ret_val;
25944     xmlValidCtxtPtr ctxt; /* the validation context */
25945     int n_ctxt;
25946     xmlDocPtr doc; /* a document instance */
25947     int n_doc;
25948 
25949     for (n_ctxt = 0;n_ctxt < gen_nb_xmlValidCtxtPtr;n_ctxt++) {
25950     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
25951         mem_base = xmlMemBlocks();
25952         ctxt = gen_xmlValidCtxtPtr(n_ctxt, 0);
25953         doc = gen_xmlDocPtr(n_doc, 1);
25954 
25955         ret_val = xmlValidateDocument(ctxt, doc);
25956         desret_int(ret_val);
25957         call_tests++;
25958         des_xmlValidCtxtPtr(n_ctxt, ctxt, 0);
25959         des_xmlDocPtr(n_doc, doc, 1);
25960         xmlResetLastError();
25961         if (mem_base != xmlMemBlocks()) {
25962             printf("Leak of %d blocks found in xmlValidateDocument",
25963 	           xmlMemBlocks() - mem_base);
25964 	    test_ret++;
25965             printf(" %d", n_ctxt);
25966             printf(" %d", n_doc);
25967             printf("\n");
25968         }
25969     }
25970     }
25971     function_tests++;
25972 #endif
25973 
25974     return(test_ret);
25975 }
25976 
25977 
25978 static int
test_xmlValidateDocumentFinal(void)25979 test_xmlValidateDocumentFinal(void) {
25980     int test_ret = 0;
25981 
25982 #if defined(LIBXML_VALID_ENABLED)
25983     int mem_base;
25984     int ret_val;
25985     xmlValidCtxtPtr ctxt; /* the validation context */
25986     int n_ctxt;
25987     xmlDocPtr doc; /* a document instance */
25988     int n_doc;
25989 
25990     for (n_ctxt = 0;n_ctxt < gen_nb_xmlValidCtxtPtr;n_ctxt++) {
25991     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
25992         mem_base = xmlMemBlocks();
25993         ctxt = gen_xmlValidCtxtPtr(n_ctxt, 0);
25994         doc = gen_xmlDocPtr(n_doc, 1);
25995 
25996         ret_val = xmlValidateDocumentFinal(ctxt, doc);
25997         desret_int(ret_val);
25998         call_tests++;
25999         des_xmlValidCtxtPtr(n_ctxt, ctxt, 0);
26000         des_xmlDocPtr(n_doc, doc, 1);
26001         xmlResetLastError();
26002         if (mem_base != xmlMemBlocks()) {
26003             printf("Leak of %d blocks found in xmlValidateDocumentFinal",
26004 	           xmlMemBlocks() - mem_base);
26005 	    test_ret++;
26006             printf(" %d", n_ctxt);
26007             printf(" %d", n_doc);
26008             printf("\n");
26009         }
26010     }
26011     }
26012     function_tests++;
26013 #endif
26014 
26015     return(test_ret);
26016 }
26017 
26018 
26019 static int
test_xmlValidateDtd(void)26020 test_xmlValidateDtd(void) {
26021     int test_ret = 0;
26022 
26023 #if defined(LIBXML_VALID_ENABLED)
26024     int mem_base;
26025     int ret_val;
26026     xmlValidCtxtPtr ctxt; /* the validation context */
26027     int n_ctxt;
26028     xmlDocPtr doc; /* a document instance */
26029     int n_doc;
26030     xmlDtdPtr dtd; /* a dtd instance */
26031     int n_dtd;
26032 
26033     for (n_ctxt = 0;n_ctxt < gen_nb_xmlValidCtxtPtr;n_ctxt++) {
26034     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
26035     for (n_dtd = 0;n_dtd < gen_nb_xmlDtdPtr;n_dtd++) {
26036         mem_base = xmlMemBlocks();
26037         ctxt = gen_xmlValidCtxtPtr(n_ctxt, 0);
26038         doc = gen_xmlDocPtr(n_doc, 1);
26039         dtd = gen_xmlDtdPtr(n_dtd, 2);
26040 
26041         ret_val = xmlValidateDtd(ctxt, doc, dtd);
26042         desret_int(ret_val);
26043         call_tests++;
26044         des_xmlValidCtxtPtr(n_ctxt, ctxt, 0);
26045         des_xmlDocPtr(n_doc, doc, 1);
26046         des_xmlDtdPtr(n_dtd, dtd, 2);
26047         xmlResetLastError();
26048         if (mem_base != xmlMemBlocks()) {
26049             printf("Leak of %d blocks found in xmlValidateDtd",
26050 	           xmlMemBlocks() - mem_base);
26051 	    test_ret++;
26052             printf(" %d", n_ctxt);
26053             printf(" %d", n_doc);
26054             printf(" %d", n_dtd);
26055             printf("\n");
26056         }
26057     }
26058     }
26059     }
26060     function_tests++;
26061 #endif
26062 
26063     return(test_ret);
26064 }
26065 
26066 
26067 static int
test_xmlValidateDtdFinal(void)26068 test_xmlValidateDtdFinal(void) {
26069     int test_ret = 0;
26070 
26071 #if defined(LIBXML_VALID_ENABLED)
26072     int mem_base;
26073     int ret_val;
26074     xmlValidCtxtPtr ctxt; /* the validation context */
26075     int n_ctxt;
26076     xmlDocPtr doc; /* a document instance */
26077     int n_doc;
26078 
26079     for (n_ctxt = 0;n_ctxt < gen_nb_xmlValidCtxtPtr;n_ctxt++) {
26080     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
26081         mem_base = xmlMemBlocks();
26082         ctxt = gen_xmlValidCtxtPtr(n_ctxt, 0);
26083         doc = gen_xmlDocPtr(n_doc, 1);
26084 
26085         ret_val = xmlValidateDtdFinal(ctxt, doc);
26086         desret_int(ret_val);
26087         call_tests++;
26088         des_xmlValidCtxtPtr(n_ctxt, ctxt, 0);
26089         des_xmlDocPtr(n_doc, doc, 1);
26090         xmlResetLastError();
26091         if (mem_base != xmlMemBlocks()) {
26092             printf("Leak of %d blocks found in xmlValidateDtdFinal",
26093 	           xmlMemBlocks() - mem_base);
26094 	    test_ret++;
26095             printf(" %d", n_ctxt);
26096             printf(" %d", n_doc);
26097             printf("\n");
26098         }
26099     }
26100     }
26101     function_tests++;
26102 #endif
26103 
26104     return(test_ret);
26105 }
26106 
26107 
26108 static int
test_xmlValidateElement(void)26109 test_xmlValidateElement(void) {
26110     int test_ret = 0;
26111 
26112 #if defined(LIBXML_VALID_ENABLED)
26113     int mem_base;
26114     int ret_val;
26115     xmlValidCtxtPtr ctxt; /* the validation context */
26116     int n_ctxt;
26117     xmlDocPtr doc; /* a document instance */
26118     int n_doc;
26119     xmlNodePtr root; /* an element instance */
26120     int n_root;
26121 
26122     for (n_ctxt = 0;n_ctxt < gen_nb_xmlValidCtxtPtr;n_ctxt++) {
26123     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
26124     for (n_root = 0;n_root < gen_nb_xmlNodePtr;n_root++) {
26125         mem_base = xmlMemBlocks();
26126         ctxt = gen_xmlValidCtxtPtr(n_ctxt, 0);
26127         doc = gen_xmlDocPtr(n_doc, 1);
26128         root = gen_xmlNodePtr(n_root, 2);
26129 
26130         ret_val = xmlValidateElement(ctxt, doc, root);
26131         desret_int(ret_val);
26132         call_tests++;
26133         des_xmlValidCtxtPtr(n_ctxt, ctxt, 0);
26134         des_xmlDocPtr(n_doc, doc, 1);
26135         des_xmlNodePtr(n_root, root, 2);
26136         xmlResetLastError();
26137         if (mem_base != xmlMemBlocks()) {
26138             printf("Leak of %d blocks found in xmlValidateElement",
26139 	           xmlMemBlocks() - mem_base);
26140 	    test_ret++;
26141             printf(" %d", n_ctxt);
26142             printf(" %d", n_doc);
26143             printf(" %d", n_root);
26144             printf("\n");
26145         }
26146     }
26147     }
26148     }
26149     function_tests++;
26150 #endif
26151 
26152     return(test_ret);
26153 }
26154 
26155 
26156 static int
test_xmlValidateElementDecl(void)26157 test_xmlValidateElementDecl(void) {
26158     int test_ret = 0;
26159 
26160 #if defined(LIBXML_VALID_ENABLED)
26161     int mem_base;
26162     int ret_val;
26163     xmlValidCtxtPtr ctxt; /* the validation context */
26164     int n_ctxt;
26165     xmlDocPtr doc; /* a document instance */
26166     int n_doc;
26167     xmlElementPtr elem; /* an element definition */
26168     int n_elem;
26169 
26170     for (n_ctxt = 0;n_ctxt < gen_nb_xmlValidCtxtPtr;n_ctxt++) {
26171     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
26172     for (n_elem = 0;n_elem < gen_nb_xmlElementPtr;n_elem++) {
26173         mem_base = xmlMemBlocks();
26174         ctxt = gen_xmlValidCtxtPtr(n_ctxt, 0);
26175         doc = gen_xmlDocPtr(n_doc, 1);
26176         elem = gen_xmlElementPtr(n_elem, 2);
26177 
26178         ret_val = xmlValidateElementDecl(ctxt, doc, elem);
26179         desret_int(ret_val);
26180         call_tests++;
26181         des_xmlValidCtxtPtr(n_ctxt, ctxt, 0);
26182         des_xmlDocPtr(n_doc, doc, 1);
26183         des_xmlElementPtr(n_elem, elem, 2);
26184         xmlResetLastError();
26185         if (mem_base != xmlMemBlocks()) {
26186             printf("Leak of %d blocks found in xmlValidateElementDecl",
26187 	           xmlMemBlocks() - mem_base);
26188 	    test_ret++;
26189             printf(" %d", n_ctxt);
26190             printf(" %d", n_doc);
26191             printf(" %d", n_elem);
26192             printf("\n");
26193         }
26194     }
26195     }
26196     }
26197     function_tests++;
26198 #endif
26199 
26200     return(test_ret);
26201 }
26202 
26203 
26204 static int
test_xmlValidateNameValue(void)26205 test_xmlValidateNameValue(void) {
26206     int test_ret = 0;
26207 
26208 #if defined(LIBXML_VALID_ENABLED)
26209     int mem_base;
26210     int ret_val;
26211     const xmlChar * value; /* an Name value */
26212     int n_value;
26213 
26214     for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
26215         mem_base = xmlMemBlocks();
26216         value = gen_const_xmlChar_ptr(n_value, 0);
26217 
26218         ret_val = xmlValidateNameValue(value);
26219         desret_int(ret_val);
26220         call_tests++;
26221         des_const_xmlChar_ptr(n_value, value, 0);
26222         xmlResetLastError();
26223         if (mem_base != xmlMemBlocks()) {
26224             printf("Leak of %d blocks found in xmlValidateNameValue",
26225 	           xmlMemBlocks() - mem_base);
26226 	    test_ret++;
26227             printf(" %d", n_value);
26228             printf("\n");
26229         }
26230     }
26231     function_tests++;
26232 #endif
26233 
26234     return(test_ret);
26235 }
26236 
26237 
26238 static int
test_xmlValidateNamesValue(void)26239 test_xmlValidateNamesValue(void) {
26240     int test_ret = 0;
26241 
26242 #if defined(LIBXML_VALID_ENABLED)
26243     int mem_base;
26244     int ret_val;
26245     const xmlChar * value; /* an Names value */
26246     int n_value;
26247 
26248     for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
26249         mem_base = xmlMemBlocks();
26250         value = gen_const_xmlChar_ptr(n_value, 0);
26251 
26252         ret_val = xmlValidateNamesValue(value);
26253         desret_int(ret_val);
26254         call_tests++;
26255         des_const_xmlChar_ptr(n_value, value, 0);
26256         xmlResetLastError();
26257         if (mem_base != xmlMemBlocks()) {
26258             printf("Leak of %d blocks found in xmlValidateNamesValue",
26259 	           xmlMemBlocks() - mem_base);
26260 	    test_ret++;
26261             printf(" %d", n_value);
26262             printf("\n");
26263         }
26264     }
26265     function_tests++;
26266 #endif
26267 
26268     return(test_ret);
26269 }
26270 
26271 
26272 static int
test_xmlValidateNmtokenValue(void)26273 test_xmlValidateNmtokenValue(void) {
26274     int test_ret = 0;
26275 
26276 #if defined(LIBXML_VALID_ENABLED)
26277     int mem_base;
26278     int ret_val;
26279     const xmlChar * value; /* an Nmtoken value */
26280     int n_value;
26281 
26282     for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
26283         mem_base = xmlMemBlocks();
26284         value = gen_const_xmlChar_ptr(n_value, 0);
26285 
26286         ret_val = xmlValidateNmtokenValue(value);
26287         desret_int(ret_val);
26288         call_tests++;
26289         des_const_xmlChar_ptr(n_value, value, 0);
26290         xmlResetLastError();
26291         if (mem_base != xmlMemBlocks()) {
26292             printf("Leak of %d blocks found in xmlValidateNmtokenValue",
26293 	           xmlMemBlocks() - mem_base);
26294 	    test_ret++;
26295             printf(" %d", n_value);
26296             printf("\n");
26297         }
26298     }
26299     function_tests++;
26300 #endif
26301 
26302     return(test_ret);
26303 }
26304 
26305 
26306 static int
test_xmlValidateNmtokensValue(void)26307 test_xmlValidateNmtokensValue(void) {
26308     int test_ret = 0;
26309 
26310 #if defined(LIBXML_VALID_ENABLED)
26311     int mem_base;
26312     int ret_val;
26313     const xmlChar * value; /* an Nmtokens value */
26314     int n_value;
26315 
26316     for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
26317         mem_base = xmlMemBlocks();
26318         value = gen_const_xmlChar_ptr(n_value, 0);
26319 
26320         ret_val = xmlValidateNmtokensValue(value);
26321         desret_int(ret_val);
26322         call_tests++;
26323         des_const_xmlChar_ptr(n_value, value, 0);
26324         xmlResetLastError();
26325         if (mem_base != xmlMemBlocks()) {
26326             printf("Leak of %d blocks found in xmlValidateNmtokensValue",
26327 	           xmlMemBlocks() - mem_base);
26328 	    test_ret++;
26329             printf(" %d", n_value);
26330             printf("\n");
26331         }
26332     }
26333     function_tests++;
26334 #endif
26335 
26336     return(test_ret);
26337 }
26338 
26339 
26340 static int
test_xmlValidateNotationDecl(void)26341 test_xmlValidateNotationDecl(void) {
26342     int test_ret = 0;
26343 
26344 #if defined(LIBXML_VALID_ENABLED)
26345     int mem_base;
26346     int ret_val;
26347     xmlValidCtxtPtr ctxt; /* the validation context */
26348     int n_ctxt;
26349     xmlDocPtr doc; /* a document instance */
26350     int n_doc;
26351     xmlNotationPtr nota; /* a notation definition */
26352     int n_nota;
26353 
26354     for (n_ctxt = 0;n_ctxt < gen_nb_xmlValidCtxtPtr;n_ctxt++) {
26355     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
26356     for (n_nota = 0;n_nota < gen_nb_xmlNotationPtr;n_nota++) {
26357         mem_base = xmlMemBlocks();
26358         ctxt = gen_xmlValidCtxtPtr(n_ctxt, 0);
26359         doc = gen_xmlDocPtr(n_doc, 1);
26360         nota = gen_xmlNotationPtr(n_nota, 2);
26361 
26362         ret_val = xmlValidateNotationDecl(ctxt, doc, nota);
26363         desret_int(ret_val);
26364         call_tests++;
26365         des_xmlValidCtxtPtr(n_ctxt, ctxt, 0);
26366         des_xmlDocPtr(n_doc, doc, 1);
26367         des_xmlNotationPtr(n_nota, nota, 2);
26368         xmlResetLastError();
26369         if (mem_base != xmlMemBlocks()) {
26370             printf("Leak of %d blocks found in xmlValidateNotationDecl",
26371 	           xmlMemBlocks() - mem_base);
26372 	    test_ret++;
26373             printf(" %d", n_ctxt);
26374             printf(" %d", n_doc);
26375             printf(" %d", n_nota);
26376             printf("\n");
26377         }
26378     }
26379     }
26380     }
26381     function_tests++;
26382 #endif
26383 
26384     return(test_ret);
26385 }
26386 
26387 
26388 static int
test_xmlValidateNotationUse(void)26389 test_xmlValidateNotationUse(void) {
26390     int test_ret = 0;
26391 
26392 #if defined(LIBXML_VALID_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED)
26393     int mem_base;
26394     int ret_val;
26395     xmlValidCtxtPtr ctxt; /* the validation context */
26396     int n_ctxt;
26397     xmlDocPtr doc; /* the document */
26398     int n_doc;
26399     const xmlChar * notationName; /* the notation name to check */
26400     int n_notationName;
26401 
26402     for (n_ctxt = 0;n_ctxt < gen_nb_xmlValidCtxtPtr;n_ctxt++) {
26403     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
26404     for (n_notationName = 0;n_notationName < gen_nb_const_xmlChar_ptr;n_notationName++) {
26405         mem_base = xmlMemBlocks();
26406         ctxt = gen_xmlValidCtxtPtr(n_ctxt, 0);
26407         doc = gen_xmlDocPtr(n_doc, 1);
26408         notationName = gen_const_xmlChar_ptr(n_notationName, 2);
26409 
26410         ret_val = xmlValidateNotationUse(ctxt, doc, notationName);
26411         desret_int(ret_val);
26412         call_tests++;
26413         des_xmlValidCtxtPtr(n_ctxt, ctxt, 0);
26414         des_xmlDocPtr(n_doc, doc, 1);
26415         des_const_xmlChar_ptr(n_notationName, notationName, 2);
26416         xmlResetLastError();
26417         if (mem_base != xmlMemBlocks()) {
26418             printf("Leak of %d blocks found in xmlValidateNotationUse",
26419 	           xmlMemBlocks() - mem_base);
26420 	    test_ret++;
26421             printf(" %d", n_ctxt);
26422             printf(" %d", n_doc);
26423             printf(" %d", n_notationName);
26424             printf("\n");
26425         }
26426     }
26427     }
26428     }
26429     function_tests++;
26430 #endif
26431 
26432     return(test_ret);
26433 }
26434 
26435 
26436 static int
test_xmlValidateOneAttribute(void)26437 test_xmlValidateOneAttribute(void) {
26438     int test_ret = 0;
26439 
26440 #if defined(LIBXML_VALID_ENABLED)
26441     int mem_base;
26442     int ret_val;
26443     xmlValidCtxtPtr ctxt; /* the validation context */
26444     int n_ctxt;
26445     xmlDocPtr doc; /* a document instance */
26446     int n_doc;
26447     xmlNodePtr elem; /* an element instance */
26448     int n_elem;
26449     xmlAttrPtr attr; /* an attribute instance */
26450     int n_attr;
26451     const xmlChar * value; /* the attribute value (without entities processing) */
26452     int n_value;
26453 
26454     for (n_ctxt = 0;n_ctxt < gen_nb_xmlValidCtxtPtr;n_ctxt++) {
26455     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
26456     for (n_elem = 0;n_elem < gen_nb_xmlNodePtr;n_elem++) {
26457     for (n_attr = 0;n_attr < gen_nb_xmlAttrPtr;n_attr++) {
26458     for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
26459         mem_base = xmlMemBlocks();
26460         ctxt = gen_xmlValidCtxtPtr(n_ctxt, 0);
26461         doc = gen_xmlDocPtr(n_doc, 1);
26462         elem = gen_xmlNodePtr(n_elem, 2);
26463         attr = gen_xmlAttrPtr(n_attr, 3);
26464         value = gen_const_xmlChar_ptr(n_value, 4);
26465 
26466         ret_val = xmlValidateOneAttribute(ctxt, doc, elem, attr, value);
26467         desret_int(ret_val);
26468         call_tests++;
26469         des_xmlValidCtxtPtr(n_ctxt, ctxt, 0);
26470         des_xmlDocPtr(n_doc, doc, 1);
26471         des_xmlNodePtr(n_elem, elem, 2);
26472         des_xmlAttrPtr(n_attr, attr, 3);
26473         des_const_xmlChar_ptr(n_value, value, 4);
26474         xmlResetLastError();
26475         if (mem_base != xmlMemBlocks()) {
26476             printf("Leak of %d blocks found in xmlValidateOneAttribute",
26477 	           xmlMemBlocks() - mem_base);
26478 	    test_ret++;
26479             printf(" %d", n_ctxt);
26480             printf(" %d", n_doc);
26481             printf(" %d", n_elem);
26482             printf(" %d", n_attr);
26483             printf(" %d", n_value);
26484             printf("\n");
26485         }
26486     }
26487     }
26488     }
26489     }
26490     }
26491     function_tests++;
26492 #endif
26493 
26494     return(test_ret);
26495 }
26496 
26497 
26498 static int
test_xmlValidateOneElement(void)26499 test_xmlValidateOneElement(void) {
26500     int test_ret = 0;
26501 
26502 #if defined(LIBXML_VALID_ENABLED)
26503     int mem_base;
26504     int ret_val;
26505     xmlValidCtxtPtr ctxt; /* the validation context */
26506     int n_ctxt;
26507     xmlDocPtr doc; /* a document instance */
26508     int n_doc;
26509     xmlNodePtr elem; /* an element instance */
26510     int n_elem;
26511 
26512     for (n_ctxt = 0;n_ctxt < gen_nb_xmlValidCtxtPtr;n_ctxt++) {
26513     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
26514     for (n_elem = 0;n_elem < gen_nb_xmlNodePtr;n_elem++) {
26515         mem_base = xmlMemBlocks();
26516         ctxt = gen_xmlValidCtxtPtr(n_ctxt, 0);
26517         doc = gen_xmlDocPtr(n_doc, 1);
26518         elem = gen_xmlNodePtr(n_elem, 2);
26519 
26520         ret_val = xmlValidateOneElement(ctxt, doc, elem);
26521         desret_int(ret_val);
26522         call_tests++;
26523         des_xmlValidCtxtPtr(n_ctxt, ctxt, 0);
26524         des_xmlDocPtr(n_doc, doc, 1);
26525         des_xmlNodePtr(n_elem, elem, 2);
26526         xmlResetLastError();
26527         if (mem_base != xmlMemBlocks()) {
26528             printf("Leak of %d blocks found in xmlValidateOneElement",
26529 	           xmlMemBlocks() - mem_base);
26530 	    test_ret++;
26531             printf(" %d", n_ctxt);
26532             printf(" %d", n_doc);
26533             printf(" %d", n_elem);
26534             printf("\n");
26535         }
26536     }
26537     }
26538     }
26539     function_tests++;
26540 #endif
26541 
26542     return(test_ret);
26543 }
26544 
26545 
26546 static int
test_xmlValidateOneNamespace(void)26547 test_xmlValidateOneNamespace(void) {
26548     int test_ret = 0;
26549 
26550 #if defined(LIBXML_VALID_ENABLED)
26551     int mem_base;
26552     int ret_val;
26553     xmlValidCtxtPtr ctxt; /* the validation context */
26554     int n_ctxt;
26555     xmlDocPtr doc; /* a document instance */
26556     int n_doc;
26557     xmlNodePtr elem; /* an element instance */
26558     int n_elem;
26559     const xmlChar * prefix; /* the namespace prefix */
26560     int n_prefix;
26561     xmlNsPtr ns; /* an namespace declaration instance */
26562     int n_ns;
26563     const xmlChar * value; /* the attribute value (without entities processing) */
26564     int n_value;
26565 
26566     for (n_ctxt = 0;n_ctxt < gen_nb_xmlValidCtxtPtr;n_ctxt++) {
26567     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
26568     for (n_elem = 0;n_elem < gen_nb_xmlNodePtr;n_elem++) {
26569     for (n_prefix = 0;n_prefix < gen_nb_const_xmlChar_ptr;n_prefix++) {
26570     for (n_ns = 0;n_ns < gen_nb_xmlNsPtr;n_ns++) {
26571     for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
26572         mem_base = xmlMemBlocks();
26573         ctxt = gen_xmlValidCtxtPtr(n_ctxt, 0);
26574         doc = gen_xmlDocPtr(n_doc, 1);
26575         elem = gen_xmlNodePtr(n_elem, 2);
26576         prefix = gen_const_xmlChar_ptr(n_prefix, 3);
26577         ns = gen_xmlNsPtr(n_ns, 4);
26578         value = gen_const_xmlChar_ptr(n_value, 5);
26579 
26580         ret_val = xmlValidateOneNamespace(ctxt, doc, elem, prefix, ns, value);
26581         desret_int(ret_val);
26582         call_tests++;
26583         des_xmlValidCtxtPtr(n_ctxt, ctxt, 0);
26584         des_xmlDocPtr(n_doc, doc, 1);
26585         des_xmlNodePtr(n_elem, elem, 2);
26586         des_const_xmlChar_ptr(n_prefix, prefix, 3);
26587         des_xmlNsPtr(n_ns, ns, 4);
26588         des_const_xmlChar_ptr(n_value, value, 5);
26589         xmlResetLastError();
26590         if (mem_base != xmlMemBlocks()) {
26591             printf("Leak of %d blocks found in xmlValidateOneNamespace",
26592 	           xmlMemBlocks() - mem_base);
26593 	    test_ret++;
26594             printf(" %d", n_ctxt);
26595             printf(" %d", n_doc);
26596             printf(" %d", n_elem);
26597             printf(" %d", n_prefix);
26598             printf(" %d", n_ns);
26599             printf(" %d", n_value);
26600             printf("\n");
26601         }
26602     }
26603     }
26604     }
26605     }
26606     }
26607     }
26608     function_tests++;
26609 #endif
26610 
26611     return(test_ret);
26612 }
26613 
26614 
26615 static int
test_xmlValidatePopElement(void)26616 test_xmlValidatePopElement(void) {
26617     int test_ret = 0;
26618 
26619 #if defined(LIBXML_VALID_ENABLED) && defined(LIBXML_REGEXP_ENABLED)
26620     int mem_base;
26621     int ret_val;
26622     xmlValidCtxtPtr ctxt; /* the validation context */
26623     int n_ctxt;
26624     xmlDocPtr doc; /* a document instance */
26625     int n_doc;
26626     xmlNodePtr elem; /* an element instance */
26627     int n_elem;
26628     const xmlChar * qname; /* the qualified name as appearing in the serialization */
26629     int n_qname;
26630 
26631     for (n_ctxt = 0;n_ctxt < gen_nb_xmlValidCtxtPtr;n_ctxt++) {
26632     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
26633     for (n_elem = 0;n_elem < gen_nb_xmlNodePtr;n_elem++) {
26634     for (n_qname = 0;n_qname < gen_nb_const_xmlChar_ptr;n_qname++) {
26635         mem_base = xmlMemBlocks();
26636         ctxt = gen_xmlValidCtxtPtr(n_ctxt, 0);
26637         doc = gen_xmlDocPtr(n_doc, 1);
26638         elem = gen_xmlNodePtr(n_elem, 2);
26639         qname = gen_const_xmlChar_ptr(n_qname, 3);
26640 
26641         ret_val = xmlValidatePopElement(ctxt, doc, elem, qname);
26642         desret_int(ret_val);
26643         call_tests++;
26644         des_xmlValidCtxtPtr(n_ctxt, ctxt, 0);
26645         des_xmlDocPtr(n_doc, doc, 1);
26646         des_xmlNodePtr(n_elem, elem, 2);
26647         des_const_xmlChar_ptr(n_qname, qname, 3);
26648         xmlResetLastError();
26649         if (mem_base != xmlMemBlocks()) {
26650             printf("Leak of %d blocks found in xmlValidatePopElement",
26651 	           xmlMemBlocks() - mem_base);
26652 	    test_ret++;
26653             printf(" %d", n_ctxt);
26654             printf(" %d", n_doc);
26655             printf(" %d", n_elem);
26656             printf(" %d", n_qname);
26657             printf("\n");
26658         }
26659     }
26660     }
26661     }
26662     }
26663     function_tests++;
26664 #endif
26665 
26666     return(test_ret);
26667 }
26668 
26669 
26670 static int
test_xmlValidatePushCData(void)26671 test_xmlValidatePushCData(void) {
26672     int test_ret = 0;
26673 
26674 #if defined(LIBXML_VALID_ENABLED) && defined(LIBXML_REGEXP_ENABLED)
26675     int mem_base;
26676     int ret_val;
26677     xmlValidCtxtPtr ctxt; /* the validation context */
26678     int n_ctxt;
26679     const xmlChar * data; /* some character data read */
26680     int n_data;
26681     int len; /* the length of the data */
26682     int n_len;
26683 
26684     for (n_ctxt = 0;n_ctxt < gen_nb_xmlValidCtxtPtr;n_ctxt++) {
26685     for (n_data = 0;n_data < gen_nb_const_xmlChar_ptr;n_data++) {
26686     for (n_len = 0;n_len < gen_nb_int;n_len++) {
26687         mem_base = xmlMemBlocks();
26688         ctxt = gen_xmlValidCtxtPtr(n_ctxt, 0);
26689         data = gen_const_xmlChar_ptr(n_data, 1);
26690         len = gen_int(n_len, 2);
26691         if ((data != NULL) &&
26692             (len > xmlStrlen(BAD_CAST data)))
26693             len = 0;
26694 
26695         ret_val = xmlValidatePushCData(ctxt, data, len);
26696         desret_int(ret_val);
26697         call_tests++;
26698         des_xmlValidCtxtPtr(n_ctxt, ctxt, 0);
26699         des_const_xmlChar_ptr(n_data, data, 1);
26700         des_int(n_len, len, 2);
26701         xmlResetLastError();
26702         if (mem_base != xmlMemBlocks()) {
26703             printf("Leak of %d blocks found in xmlValidatePushCData",
26704 	           xmlMemBlocks() - mem_base);
26705 	    test_ret++;
26706             printf(" %d", n_ctxt);
26707             printf(" %d", n_data);
26708             printf(" %d", n_len);
26709             printf("\n");
26710         }
26711     }
26712     }
26713     }
26714     function_tests++;
26715 #endif
26716 
26717     return(test_ret);
26718 }
26719 
26720 
26721 static int
test_xmlValidatePushElement(void)26722 test_xmlValidatePushElement(void) {
26723     int test_ret = 0;
26724 
26725 #if defined(LIBXML_VALID_ENABLED) && defined(LIBXML_REGEXP_ENABLED)
26726     int mem_base;
26727     int ret_val;
26728     xmlValidCtxtPtr ctxt; /* the validation context */
26729     int n_ctxt;
26730     xmlDocPtr doc; /* a document instance */
26731     int n_doc;
26732     xmlNodePtr elem; /* an element instance */
26733     int n_elem;
26734     const xmlChar * qname; /* the qualified name as appearing in the serialization */
26735     int n_qname;
26736 
26737     for (n_ctxt = 0;n_ctxt < gen_nb_xmlValidCtxtPtr;n_ctxt++) {
26738     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
26739     for (n_elem = 0;n_elem < gen_nb_xmlNodePtr;n_elem++) {
26740     for (n_qname = 0;n_qname < gen_nb_const_xmlChar_ptr;n_qname++) {
26741         mem_base = xmlMemBlocks();
26742         ctxt = gen_xmlValidCtxtPtr(n_ctxt, 0);
26743         doc = gen_xmlDocPtr(n_doc, 1);
26744         elem = gen_xmlNodePtr(n_elem, 2);
26745         qname = gen_const_xmlChar_ptr(n_qname, 3);
26746 
26747         ret_val = xmlValidatePushElement(ctxt, doc, elem, qname);
26748         desret_int(ret_val);
26749         call_tests++;
26750         des_xmlValidCtxtPtr(n_ctxt, ctxt, 0);
26751         des_xmlDocPtr(n_doc, doc, 1);
26752         des_xmlNodePtr(n_elem, elem, 2);
26753         des_const_xmlChar_ptr(n_qname, qname, 3);
26754         xmlResetLastError();
26755         if (mem_base != xmlMemBlocks()) {
26756             printf("Leak of %d blocks found in xmlValidatePushElement",
26757 	           xmlMemBlocks() - mem_base);
26758 	    test_ret++;
26759             printf(" %d", n_ctxt);
26760             printf(" %d", n_doc);
26761             printf(" %d", n_elem);
26762             printf(" %d", n_qname);
26763             printf("\n");
26764         }
26765     }
26766     }
26767     }
26768     }
26769     function_tests++;
26770 #endif
26771 
26772     return(test_ret);
26773 }
26774 
26775 
26776 static int
test_xmlValidateRoot(void)26777 test_xmlValidateRoot(void) {
26778     int test_ret = 0;
26779 
26780 #if defined(LIBXML_VALID_ENABLED)
26781     int mem_base;
26782     int ret_val;
26783     xmlValidCtxtPtr ctxt; /* the validation context */
26784     int n_ctxt;
26785     xmlDocPtr doc; /* a document instance */
26786     int n_doc;
26787 
26788     for (n_ctxt = 0;n_ctxt < gen_nb_xmlValidCtxtPtr;n_ctxt++) {
26789     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
26790         mem_base = xmlMemBlocks();
26791         ctxt = gen_xmlValidCtxtPtr(n_ctxt, 0);
26792         doc = gen_xmlDocPtr(n_doc, 1);
26793 
26794         ret_val = xmlValidateRoot(ctxt, doc);
26795         desret_int(ret_val);
26796         call_tests++;
26797         des_xmlValidCtxtPtr(n_ctxt, ctxt, 0);
26798         des_xmlDocPtr(n_doc, doc, 1);
26799         xmlResetLastError();
26800         if (mem_base != xmlMemBlocks()) {
26801             printf("Leak of %d blocks found in xmlValidateRoot",
26802 	           xmlMemBlocks() - mem_base);
26803 	    test_ret++;
26804             printf(" %d", n_ctxt);
26805             printf(" %d", n_doc);
26806             printf("\n");
26807         }
26808     }
26809     }
26810     function_tests++;
26811 #endif
26812 
26813     return(test_ret);
26814 }
26815 
26816 static int
test_valid(void)26817 test_valid(void) {
26818     int test_ret = 0;
26819 
26820     if (quiet == 0) printf("Testing valid : 50 of 70 functions ...\n");
26821     test_ret += test_xmlAddAttributeDecl();
26822     test_ret += test_xmlAddElementDecl();
26823     test_ret += test_xmlAddID();
26824     test_ret += test_xmlAddNotationDecl();
26825     test_ret += test_xmlAddRef();
26826     test_ret += test_xmlCopyAttributeTable();
26827     test_ret += test_xmlCopyDocElementContent();
26828     test_ret += test_xmlCopyElementContent();
26829     test_ret += test_xmlCopyElementTable();
26830     test_ret += test_xmlCopyEnumeration();
26831     test_ret += test_xmlCopyNotationTable();
26832     test_ret += test_xmlCreateEnumeration();
26833     test_ret += test_xmlDumpAttributeDecl();
26834     test_ret += test_xmlDumpAttributeTable();
26835     test_ret += test_xmlDumpElementDecl();
26836     test_ret += test_xmlDumpElementTable();
26837     test_ret += test_xmlDumpNotationDecl();
26838     test_ret += test_xmlDumpNotationTable();
26839     test_ret += test_xmlGetDtdAttrDesc();
26840     test_ret += test_xmlGetDtdElementDesc();
26841     test_ret += test_xmlGetDtdNotationDesc();
26842     test_ret += test_xmlGetDtdQAttrDesc();
26843     test_ret += test_xmlGetDtdQElementDesc();
26844     test_ret += test_xmlGetID();
26845     test_ret += test_xmlGetRefs();
26846     test_ret += test_xmlIsID();
26847     test_ret += test_xmlIsMixedElement();
26848     test_ret += test_xmlIsRef();
26849     test_ret += test_xmlNewDocElementContent();
26850     test_ret += test_xmlNewElementContent();
26851     test_ret += test_xmlNewValidCtxt();
26852     test_ret += test_xmlRemoveID();
26853     test_ret += test_xmlRemoveRef();
26854     test_ret += test_xmlSnprintfElementContent();
26855     test_ret += test_xmlSprintfElementContent();
26856     test_ret += test_xmlValidBuildContentModel();
26857     test_ret += test_xmlValidCtxtNormalizeAttributeValue();
26858     test_ret += test_xmlValidGetPotentialChildren();
26859     test_ret += test_xmlValidGetValidElements();
26860     test_ret += test_xmlValidNormalizeAttributeValue();
26861     test_ret += test_xmlValidateAttributeDecl();
26862     test_ret += test_xmlValidateAttributeValue();
26863     test_ret += test_xmlValidateDocument();
26864     test_ret += test_xmlValidateDocumentFinal();
26865     test_ret += test_xmlValidateDtd();
26866     test_ret += test_xmlValidateDtdFinal();
26867     test_ret += test_xmlValidateElement();
26868     test_ret += test_xmlValidateElementDecl();
26869     test_ret += test_xmlValidateNameValue();
26870     test_ret += test_xmlValidateNamesValue();
26871     test_ret += test_xmlValidateNmtokenValue();
26872     test_ret += test_xmlValidateNmtokensValue();
26873     test_ret += test_xmlValidateNotationDecl();
26874     test_ret += test_xmlValidateNotationUse();
26875     test_ret += test_xmlValidateOneAttribute();
26876     test_ret += test_xmlValidateOneElement();
26877     test_ret += test_xmlValidateOneNamespace();
26878     test_ret += test_xmlValidatePopElement();
26879     test_ret += test_xmlValidatePushCData();
26880     test_ret += test_xmlValidatePushElement();
26881     test_ret += test_xmlValidateRoot();
26882 
26883     if (test_ret != 0)
26884 	printf("Module valid: %d errors\n", test_ret);
26885     return(test_ret);
26886 }
26887 
26888 static int
test_xmlXIncludeNewContext(void)26889 test_xmlXIncludeNewContext(void) {
26890     int test_ret = 0;
26891 
26892 
26893     /* missing type support */
26894     return(test_ret);
26895 }
26896 
26897 
26898 static int
test_xmlXIncludeProcess(void)26899 test_xmlXIncludeProcess(void) {
26900     int test_ret = 0;
26901 
26902 #if defined(LIBXML_XINCLUDE_ENABLED)
26903     int mem_base;
26904     int ret_val;
26905     xmlDocPtr doc; /* an XML document */
26906     int n_doc;
26907 
26908     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
26909         mem_base = xmlMemBlocks();
26910         doc = gen_xmlDocPtr(n_doc, 0);
26911 
26912         ret_val = xmlXIncludeProcess(doc);
26913         desret_int(ret_val);
26914         call_tests++;
26915         des_xmlDocPtr(n_doc, doc, 0);
26916         xmlResetLastError();
26917         if (mem_base != xmlMemBlocks()) {
26918             printf("Leak of %d blocks found in xmlXIncludeProcess",
26919 	           xmlMemBlocks() - mem_base);
26920 	    test_ret++;
26921             printf(" %d", n_doc);
26922             printf("\n");
26923         }
26924     }
26925     function_tests++;
26926 #endif
26927 
26928     return(test_ret);
26929 }
26930 
26931 
26932 static int
test_xmlXIncludeProcessFlags(void)26933 test_xmlXIncludeProcessFlags(void) {
26934     int test_ret = 0;
26935 
26936 #if defined(LIBXML_XINCLUDE_ENABLED)
26937     int mem_base;
26938     int ret_val;
26939     xmlDocPtr doc; /* an XML document */
26940     int n_doc;
26941     int flags; /* a set of xmlParserOption used for parsing XML includes */
26942     int n_flags;
26943 
26944     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
26945     for (n_flags = 0;n_flags < gen_nb_int;n_flags++) {
26946         mem_base = xmlMemBlocks();
26947         doc = gen_xmlDocPtr(n_doc, 0);
26948         flags = gen_int(n_flags, 1);
26949 
26950         ret_val = xmlXIncludeProcessFlags(doc, flags);
26951         desret_int(ret_val);
26952         call_tests++;
26953         des_xmlDocPtr(n_doc, doc, 0);
26954         des_int(n_flags, flags, 1);
26955         xmlResetLastError();
26956         if (mem_base != xmlMemBlocks()) {
26957             printf("Leak of %d blocks found in xmlXIncludeProcessFlags",
26958 	           xmlMemBlocks() - mem_base);
26959 	    test_ret++;
26960             printf(" %d", n_doc);
26961             printf(" %d", n_flags);
26962             printf("\n");
26963         }
26964     }
26965     }
26966     function_tests++;
26967 #endif
26968 
26969     return(test_ret);
26970 }
26971 
26972 
26973 static int
test_xmlXIncludeProcessFlagsData(void)26974 test_xmlXIncludeProcessFlagsData(void) {
26975     int test_ret = 0;
26976 
26977 #if defined(LIBXML_XINCLUDE_ENABLED)
26978     int mem_base;
26979     int ret_val;
26980     xmlDocPtr doc; /* an XML document */
26981     int n_doc;
26982     int flags; /* a set of xmlParserOption used for parsing XML includes */
26983     int n_flags;
26984     void * data; /* application data that will be passed to the parser context in the _private field of the parser context(s) */
26985     int n_data;
26986 
26987     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
26988     for (n_flags = 0;n_flags < gen_nb_int;n_flags++) {
26989     for (n_data = 0;n_data < gen_nb_userdata;n_data++) {
26990         mem_base = xmlMemBlocks();
26991         doc = gen_xmlDocPtr(n_doc, 0);
26992         flags = gen_int(n_flags, 1);
26993         data = gen_userdata(n_data, 2);
26994 
26995         ret_val = xmlXIncludeProcessFlagsData(doc, flags, data);
26996         desret_int(ret_val);
26997         call_tests++;
26998         des_xmlDocPtr(n_doc, doc, 0);
26999         des_int(n_flags, flags, 1);
27000         des_userdata(n_data, data, 2);
27001         xmlResetLastError();
27002         if (mem_base != xmlMemBlocks()) {
27003             printf("Leak of %d blocks found in xmlXIncludeProcessFlagsData",
27004 	           xmlMemBlocks() - mem_base);
27005 	    test_ret++;
27006             printf(" %d", n_doc);
27007             printf(" %d", n_flags);
27008             printf(" %d", n_data);
27009             printf("\n");
27010         }
27011     }
27012     }
27013     }
27014     function_tests++;
27015 #endif
27016 
27017     return(test_ret);
27018 }
27019 
27020 #ifdef LIBXML_XINCLUDE_ENABLED
27021 
27022 #define gen_nb_xmlXIncludeCtxtPtr 1
27023 #define gen_xmlXIncludeCtxtPtr(no, nr) NULL
27024 #define des_xmlXIncludeCtxtPtr(no, val, nr)
27025 #endif
27026 
27027 
27028 static int
test_xmlXIncludeProcessNode(void)27029 test_xmlXIncludeProcessNode(void) {
27030     int test_ret = 0;
27031 
27032 #if defined(LIBXML_XINCLUDE_ENABLED)
27033     int mem_base;
27034     int ret_val;
27035     xmlXIncludeCtxtPtr ctxt; /* an existing XInclude context */
27036     int n_ctxt;
27037     xmlNodePtr node; /* a node in an XML document */
27038     int n_node;
27039 
27040     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXIncludeCtxtPtr;n_ctxt++) {
27041     for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
27042         mem_base = xmlMemBlocks();
27043         ctxt = gen_xmlXIncludeCtxtPtr(n_ctxt, 0);
27044         node = gen_xmlNodePtr(n_node, 1);
27045 
27046         ret_val = xmlXIncludeProcessNode(ctxt, node);
27047         desret_int(ret_val);
27048         call_tests++;
27049         des_xmlXIncludeCtxtPtr(n_ctxt, ctxt, 0);
27050         des_xmlNodePtr(n_node, node, 1);
27051         xmlResetLastError();
27052         if (mem_base != xmlMemBlocks()) {
27053             printf("Leak of %d blocks found in xmlXIncludeProcessNode",
27054 	           xmlMemBlocks() - mem_base);
27055 	    test_ret++;
27056             printf(" %d", n_ctxt);
27057             printf(" %d", n_node);
27058             printf("\n");
27059         }
27060     }
27061     }
27062     function_tests++;
27063 #endif
27064 
27065     return(test_ret);
27066 }
27067 
27068 
27069 static int
test_xmlXIncludeProcessTree(void)27070 test_xmlXIncludeProcessTree(void) {
27071     int test_ret = 0;
27072 
27073 #if defined(LIBXML_XINCLUDE_ENABLED)
27074     int mem_base;
27075     int ret_val;
27076     xmlNodePtr tree; /* a node in an XML document */
27077     int n_tree;
27078 
27079     for (n_tree = 0;n_tree < gen_nb_xmlNodePtr;n_tree++) {
27080         mem_base = xmlMemBlocks();
27081         tree = gen_xmlNodePtr(n_tree, 0);
27082 
27083         ret_val = xmlXIncludeProcessTree(tree);
27084         desret_int(ret_val);
27085         call_tests++;
27086         des_xmlNodePtr(n_tree, tree, 0);
27087         xmlResetLastError();
27088         if (mem_base != xmlMemBlocks()) {
27089             printf("Leak of %d blocks found in xmlXIncludeProcessTree",
27090 	           xmlMemBlocks() - mem_base);
27091 	    test_ret++;
27092             printf(" %d", n_tree);
27093             printf("\n");
27094         }
27095     }
27096     function_tests++;
27097 #endif
27098 
27099     return(test_ret);
27100 }
27101 
27102 
27103 static int
test_xmlXIncludeProcessTreeFlags(void)27104 test_xmlXIncludeProcessTreeFlags(void) {
27105     int test_ret = 0;
27106 
27107 #if defined(LIBXML_XINCLUDE_ENABLED)
27108     int mem_base;
27109     int ret_val;
27110     xmlNodePtr tree; /* a node in an XML document */
27111     int n_tree;
27112     int flags; /* a set of xmlParserOption used for parsing XML includes */
27113     int n_flags;
27114 
27115     for (n_tree = 0;n_tree < gen_nb_xmlNodePtr;n_tree++) {
27116     for (n_flags = 0;n_flags < gen_nb_int;n_flags++) {
27117         mem_base = xmlMemBlocks();
27118         tree = gen_xmlNodePtr(n_tree, 0);
27119         flags = gen_int(n_flags, 1);
27120 
27121         ret_val = xmlXIncludeProcessTreeFlags(tree, flags);
27122         desret_int(ret_val);
27123         call_tests++;
27124         des_xmlNodePtr(n_tree, tree, 0);
27125         des_int(n_flags, flags, 1);
27126         xmlResetLastError();
27127         if (mem_base != xmlMemBlocks()) {
27128             printf("Leak of %d blocks found in xmlXIncludeProcessTreeFlags",
27129 	           xmlMemBlocks() - mem_base);
27130 	    test_ret++;
27131             printf(" %d", n_tree);
27132             printf(" %d", n_flags);
27133             printf("\n");
27134         }
27135     }
27136     }
27137     function_tests++;
27138 #endif
27139 
27140     return(test_ret);
27141 }
27142 
27143 
27144 static int
test_xmlXIncludeProcessTreeFlagsData(void)27145 test_xmlXIncludeProcessTreeFlagsData(void) {
27146     int test_ret = 0;
27147 
27148 #if defined(LIBXML_XINCLUDE_ENABLED)
27149     int mem_base;
27150     int ret_val;
27151     xmlNodePtr tree; /* an XML node */
27152     int n_tree;
27153     int flags; /* a set of xmlParserOption used for parsing XML includes */
27154     int n_flags;
27155     void * data; /* application data that will be passed to the parser context in the _private field of the parser context(s) */
27156     int n_data;
27157 
27158     for (n_tree = 0;n_tree < gen_nb_xmlNodePtr;n_tree++) {
27159     for (n_flags = 0;n_flags < gen_nb_int;n_flags++) {
27160     for (n_data = 0;n_data < gen_nb_userdata;n_data++) {
27161         mem_base = xmlMemBlocks();
27162         tree = gen_xmlNodePtr(n_tree, 0);
27163         flags = gen_int(n_flags, 1);
27164         data = gen_userdata(n_data, 2);
27165 
27166         ret_val = xmlXIncludeProcessTreeFlagsData(tree, flags, data);
27167         desret_int(ret_val);
27168         call_tests++;
27169         des_xmlNodePtr(n_tree, tree, 0);
27170         des_int(n_flags, flags, 1);
27171         des_userdata(n_data, data, 2);
27172         xmlResetLastError();
27173         if (mem_base != xmlMemBlocks()) {
27174             printf("Leak of %d blocks found in xmlXIncludeProcessTreeFlagsData",
27175 	           xmlMemBlocks() - mem_base);
27176 	    test_ret++;
27177             printf(" %d", n_tree);
27178             printf(" %d", n_flags);
27179             printf(" %d", n_data);
27180             printf("\n");
27181         }
27182     }
27183     }
27184     }
27185     function_tests++;
27186 #endif
27187 
27188     return(test_ret);
27189 }
27190 
27191 
27192 static int
test_xmlXIncludeSetFlags(void)27193 test_xmlXIncludeSetFlags(void) {
27194     int test_ret = 0;
27195 
27196 #if defined(LIBXML_XINCLUDE_ENABLED)
27197     int mem_base;
27198     int ret_val;
27199     xmlXIncludeCtxtPtr ctxt; /* an XInclude processing context */
27200     int n_ctxt;
27201     int flags; /* a set of xmlParserOption used for parsing XML includes */
27202     int n_flags;
27203 
27204     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXIncludeCtxtPtr;n_ctxt++) {
27205     for (n_flags = 0;n_flags < gen_nb_int;n_flags++) {
27206         mem_base = xmlMemBlocks();
27207         ctxt = gen_xmlXIncludeCtxtPtr(n_ctxt, 0);
27208         flags = gen_int(n_flags, 1);
27209 
27210         ret_val = xmlXIncludeSetFlags(ctxt, flags);
27211         desret_int(ret_val);
27212         call_tests++;
27213         des_xmlXIncludeCtxtPtr(n_ctxt, ctxt, 0);
27214         des_int(n_flags, flags, 1);
27215         xmlResetLastError();
27216         if (mem_base != xmlMemBlocks()) {
27217             printf("Leak of %d blocks found in xmlXIncludeSetFlags",
27218 	           xmlMemBlocks() - mem_base);
27219 	    test_ret++;
27220             printf(" %d", n_ctxt);
27221             printf(" %d", n_flags);
27222             printf("\n");
27223         }
27224     }
27225     }
27226     function_tests++;
27227 #endif
27228 
27229     return(test_ret);
27230 }
27231 
27232 static int
test_xinclude(void)27233 test_xinclude(void) {
27234     int test_ret = 0;
27235 
27236     if (quiet == 0) printf("Testing xinclude : 8 of 10 functions ...\n");
27237     test_ret += test_xmlXIncludeNewContext();
27238     test_ret += test_xmlXIncludeProcess();
27239     test_ret += test_xmlXIncludeProcessFlags();
27240     test_ret += test_xmlXIncludeProcessFlagsData();
27241     test_ret += test_xmlXIncludeProcessNode();
27242     test_ret += test_xmlXIncludeProcessTree();
27243     test_ret += test_xmlXIncludeProcessTreeFlags();
27244     test_ret += test_xmlXIncludeProcessTreeFlagsData();
27245     test_ret += test_xmlXIncludeSetFlags();
27246 
27247     if (test_ret != 0)
27248 	printf("Module xinclude: %d errors\n", test_ret);
27249     return(test_ret);
27250 }
27251 
27252 static int
test_xmlAllocOutputBuffer(void)27253 test_xmlAllocOutputBuffer(void) {
27254     int test_ret = 0;
27255 
27256 #if defined(LIBXML_OUTPUT_ENABLED)
27257     int mem_base;
27258     xmlOutputBufferPtr ret_val;
27259     xmlCharEncodingHandlerPtr encoder; /* the encoding converter or NULL */
27260     int n_encoder;
27261 
27262     for (n_encoder = 0;n_encoder < gen_nb_xmlCharEncodingHandlerPtr;n_encoder++) {
27263         mem_base = xmlMemBlocks();
27264         encoder = gen_xmlCharEncodingHandlerPtr(n_encoder, 0);
27265 
27266         ret_val = xmlAllocOutputBuffer(encoder);
27267         desret_xmlOutputBufferPtr(ret_val);
27268         call_tests++;
27269         des_xmlCharEncodingHandlerPtr(n_encoder, encoder, 0);
27270         xmlResetLastError();
27271         if (mem_base != xmlMemBlocks()) {
27272             printf("Leak of %d blocks found in xmlAllocOutputBuffer",
27273 	           xmlMemBlocks() - mem_base);
27274 	    test_ret++;
27275             printf(" %d", n_encoder);
27276             printf("\n");
27277         }
27278     }
27279     function_tests++;
27280 #endif
27281 
27282     return(test_ret);
27283 }
27284 
27285 
27286 static int
test_xmlAllocParserInputBuffer(void)27287 test_xmlAllocParserInputBuffer(void) {
27288     int test_ret = 0;
27289 
27290     int mem_base;
27291     xmlParserInputBufferPtr ret_val;
27292     xmlCharEncoding enc; /* the charset encoding if known */
27293     int n_enc;
27294 
27295     for (n_enc = 0;n_enc < gen_nb_xmlCharEncoding;n_enc++) {
27296         mem_base = xmlMemBlocks();
27297         enc = gen_xmlCharEncoding(n_enc, 0);
27298 
27299         ret_val = xmlAllocParserInputBuffer(enc);
27300         desret_xmlParserInputBufferPtr(ret_val);
27301         call_tests++;
27302         des_xmlCharEncoding(n_enc, enc, 0);
27303         xmlResetLastError();
27304         if (mem_base != xmlMemBlocks()) {
27305             printf("Leak of %d blocks found in xmlAllocParserInputBuffer",
27306 	           xmlMemBlocks() - mem_base);
27307 	    test_ret++;
27308             printf(" %d", n_enc);
27309             printf("\n");
27310         }
27311     }
27312     function_tests++;
27313 
27314     return(test_ret);
27315 }
27316 
27317 
27318 static int
test_xmlCheckFilename(void)27319 test_xmlCheckFilename(void) {
27320     int test_ret = 0;
27321 
27322     int mem_base;
27323     int ret_val;
27324     const char * path; /* the path to check */
27325     int n_path;
27326 
27327     for (n_path = 0;n_path < gen_nb_const_char_ptr;n_path++) {
27328         mem_base = xmlMemBlocks();
27329         path = gen_const_char_ptr(n_path, 0);
27330 
27331         ret_val = xmlCheckFilename(path);
27332         desret_int(ret_val);
27333         call_tests++;
27334         des_const_char_ptr(n_path, path, 0);
27335         xmlResetLastError();
27336         if (mem_base != xmlMemBlocks()) {
27337             printf("Leak of %d blocks found in xmlCheckFilename",
27338 	           xmlMemBlocks() - mem_base);
27339 	    test_ret++;
27340             printf(" %d", n_path);
27341             printf("\n");
27342         }
27343     }
27344     function_tests++;
27345 
27346     return(test_ret);
27347 }
27348 
27349 
27350 static int
test_xmlCheckHTTPInput(void)27351 test_xmlCheckHTTPInput(void) {
27352     int test_ret = 0;
27353 
27354     int mem_base;
27355     xmlParserInputPtr ret_val;
27356     xmlParserCtxtPtr ctxt; /* an XML parser context */
27357     int n_ctxt;
27358     xmlParserInputPtr ret; /* an XML parser input */
27359     int n_ret;
27360 
27361     for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
27362     for (n_ret = 0;n_ret < gen_nb_xmlParserInputPtr;n_ret++) {
27363         mem_base = xmlMemBlocks();
27364         ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
27365         ret = gen_xmlParserInputPtr(n_ret, 1);
27366 
27367         ret_val = xmlCheckHTTPInput(ctxt, ret);
27368         desret_xmlParserInputPtr(ret_val);
27369         call_tests++;
27370         des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
27371         des_xmlParserInputPtr(n_ret, ret, 1);
27372         xmlResetLastError();
27373         if (mem_base != xmlMemBlocks()) {
27374             printf("Leak of %d blocks found in xmlCheckHTTPInput",
27375 	           xmlMemBlocks() - mem_base);
27376 	    test_ret++;
27377             printf(" %d", n_ctxt);
27378             printf(" %d", n_ret);
27379             printf("\n");
27380         }
27381     }
27382     }
27383     function_tests++;
27384 
27385     return(test_ret);
27386 }
27387 
27388 
27389 static int
test_xmlCleanupInputCallbacks(void)27390 test_xmlCleanupInputCallbacks(void) {
27391     int test_ret = 0;
27392 
27393     int mem_base;
27394 
27395         mem_base = xmlMemBlocks();
27396 
27397         xmlCleanupInputCallbacks();
27398         call_tests++;
27399         xmlResetLastError();
27400         if (mem_base != xmlMemBlocks()) {
27401             printf("Leak of %d blocks found in xmlCleanupInputCallbacks",
27402 	           xmlMemBlocks() - mem_base);
27403 	    test_ret++;
27404             printf("\n");
27405         }
27406     function_tests++;
27407 
27408     return(test_ret);
27409 }
27410 
27411 
27412 static int
test_xmlCleanupOutputCallbacks(void)27413 test_xmlCleanupOutputCallbacks(void) {
27414     int test_ret = 0;
27415 
27416 #if defined(LIBXML_OUTPUT_ENABLED)
27417     int mem_base;
27418 
27419         mem_base = xmlMemBlocks();
27420 
27421         xmlCleanupOutputCallbacks();
27422         call_tests++;
27423         xmlResetLastError();
27424         if (mem_base != xmlMemBlocks()) {
27425             printf("Leak of %d blocks found in xmlCleanupOutputCallbacks",
27426 	           xmlMemBlocks() - mem_base);
27427 	    test_ret++;
27428             printf("\n");
27429         }
27430     function_tests++;
27431 #endif
27432 
27433     return(test_ret);
27434 }
27435 
27436 
27437 static int
test_xmlFileClose(void)27438 test_xmlFileClose(void) {
27439     int test_ret = 0;
27440 
27441     int mem_base;
27442     int ret_val;
27443     void * context; /* the I/O context */
27444     int n_context;
27445 
27446     for (n_context = 0;n_context < gen_nb_void_ptr;n_context++) {
27447         mem_base = xmlMemBlocks();
27448         context = gen_void_ptr(n_context, 0);
27449 
27450         ret_val = xmlFileClose(context);
27451         desret_int(ret_val);
27452         call_tests++;
27453         des_void_ptr(n_context, context, 0);
27454         xmlResetLastError();
27455         if (mem_base != xmlMemBlocks()) {
27456             printf("Leak of %d blocks found in xmlFileClose",
27457 	           xmlMemBlocks() - mem_base);
27458 	    test_ret++;
27459             printf(" %d", n_context);
27460             printf("\n");
27461         }
27462     }
27463     function_tests++;
27464 
27465     return(test_ret);
27466 }
27467 
27468 
27469 static int
test_xmlFileMatch(void)27470 test_xmlFileMatch(void) {
27471     int test_ret = 0;
27472 
27473     int mem_base;
27474     int ret_val;
27475     const char * filename; /* the URI for matching */
27476     int n_filename;
27477 
27478     for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
27479         mem_base = xmlMemBlocks();
27480         filename = gen_filepath(n_filename, 0);
27481 
27482         ret_val = xmlFileMatch(filename);
27483         desret_int(ret_val);
27484         call_tests++;
27485         des_filepath(n_filename, filename, 0);
27486         xmlResetLastError();
27487         if (mem_base != xmlMemBlocks()) {
27488             printf("Leak of %d blocks found in xmlFileMatch",
27489 	           xmlMemBlocks() - mem_base);
27490 	    test_ret++;
27491             printf(" %d", n_filename);
27492             printf("\n");
27493         }
27494     }
27495     function_tests++;
27496 
27497     return(test_ret);
27498 }
27499 
27500 
27501 static int
test_xmlFileOpen(void)27502 test_xmlFileOpen(void) {
27503     int test_ret = 0;
27504 
27505     int mem_base;
27506     void * ret_val;
27507     const char * filename; /* the URI for matching */
27508     int n_filename;
27509 
27510     for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
27511         mem_base = xmlMemBlocks();
27512         filename = gen_filepath(n_filename, 0);
27513 
27514         ret_val = xmlFileOpen(filename);
27515         desret_void_ptr(ret_val);
27516         call_tests++;
27517         des_filepath(n_filename, filename, 0);
27518         xmlResetLastError();
27519         if (mem_base != xmlMemBlocks()) {
27520             printf("Leak of %d blocks found in xmlFileOpen",
27521 	           xmlMemBlocks() - mem_base);
27522 	    test_ret++;
27523             printf(" %d", n_filename);
27524             printf("\n");
27525         }
27526     }
27527     function_tests++;
27528 
27529     return(test_ret);
27530 }
27531 
27532 
27533 static int
test_xmlFileRead(void)27534 test_xmlFileRead(void) {
27535     int test_ret = 0;
27536 
27537     int mem_base;
27538     int ret_val;
27539     void * context; /* the I/O context */
27540     int n_context;
27541     char * buffer; /* where to drop data */
27542     int n_buffer;
27543     int len; /* number of bytes to write */
27544     int n_len;
27545 
27546     for (n_context = 0;n_context < gen_nb_void_ptr;n_context++) {
27547     for (n_buffer = 0;n_buffer < gen_nb_char_ptr;n_buffer++) {
27548     for (n_len = 0;n_len < gen_nb_int;n_len++) {
27549         mem_base = xmlMemBlocks();
27550         context = gen_void_ptr(n_context, 0);
27551         buffer = gen_char_ptr(n_buffer, 1);
27552         len = gen_int(n_len, 2);
27553 
27554         ret_val = xmlFileRead(context, buffer, len);
27555         desret_int(ret_val);
27556         call_tests++;
27557         des_void_ptr(n_context, context, 0);
27558         des_char_ptr(n_buffer, buffer, 1);
27559         des_int(n_len, len, 2);
27560         xmlResetLastError();
27561         if (mem_base != xmlMemBlocks()) {
27562             printf("Leak of %d blocks found in xmlFileRead",
27563 	           xmlMemBlocks() - mem_base);
27564 	    test_ret++;
27565             printf(" %d", n_context);
27566             printf(" %d", n_buffer);
27567             printf(" %d", n_len);
27568             printf("\n");
27569         }
27570     }
27571     }
27572     }
27573     function_tests++;
27574 
27575     return(test_ret);
27576 }
27577 
27578 
27579 static int
test_xmlIOFTPClose(void)27580 test_xmlIOFTPClose(void) {
27581     int test_ret = 0;
27582 
27583 #if defined(LIBXML_FTP_ENABLED)
27584     int mem_base;
27585     int ret_val;
27586     void * context; /* the I/O context */
27587     int n_context;
27588 
27589     for (n_context = 0;n_context < gen_nb_void_ptr;n_context++) {
27590         mem_base = xmlMemBlocks();
27591         context = gen_void_ptr(n_context, 0);
27592 
27593         ret_val = xmlIOFTPClose(context);
27594         desret_int(ret_val);
27595         call_tests++;
27596         des_void_ptr(n_context, context, 0);
27597         xmlResetLastError();
27598         if (mem_base != xmlMemBlocks()) {
27599             printf("Leak of %d blocks found in xmlIOFTPClose",
27600 	           xmlMemBlocks() - mem_base);
27601 	    test_ret++;
27602             printf(" %d", n_context);
27603             printf("\n");
27604         }
27605     }
27606     function_tests++;
27607 #endif
27608 
27609     return(test_ret);
27610 }
27611 
27612 
27613 static int
test_xmlIOFTPMatch(void)27614 test_xmlIOFTPMatch(void) {
27615     int test_ret = 0;
27616 
27617 #if defined(LIBXML_FTP_ENABLED)
27618     int mem_base;
27619     int ret_val;
27620     const char * filename; /* the URI for matching */
27621     int n_filename;
27622 
27623     for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
27624         mem_base = xmlMemBlocks();
27625         filename = gen_filepath(n_filename, 0);
27626 
27627         ret_val = xmlIOFTPMatch(filename);
27628         desret_int(ret_val);
27629         call_tests++;
27630         des_filepath(n_filename, filename, 0);
27631         xmlResetLastError();
27632         if (mem_base != xmlMemBlocks()) {
27633             printf("Leak of %d blocks found in xmlIOFTPMatch",
27634 	           xmlMemBlocks() - mem_base);
27635 	    test_ret++;
27636             printf(" %d", n_filename);
27637             printf("\n");
27638         }
27639     }
27640     function_tests++;
27641 #endif
27642 
27643     return(test_ret);
27644 }
27645 
27646 
27647 static int
test_xmlIOFTPOpen(void)27648 test_xmlIOFTPOpen(void) {
27649     int test_ret = 0;
27650 
27651 #if defined(LIBXML_FTP_ENABLED)
27652     int mem_base;
27653     void * ret_val;
27654     const char * filename; /* the URI for matching */
27655     int n_filename;
27656 
27657     for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
27658         mem_base = xmlMemBlocks();
27659         filename = gen_filepath(n_filename, 0);
27660 
27661         ret_val = xmlIOFTPOpen(filename);
27662         desret_void_ptr(ret_val);
27663         call_tests++;
27664         des_filepath(n_filename, filename, 0);
27665         xmlResetLastError();
27666         if (mem_base != xmlMemBlocks()) {
27667             printf("Leak of %d blocks found in xmlIOFTPOpen",
27668 	           xmlMemBlocks() - mem_base);
27669 	    test_ret++;
27670             printf(" %d", n_filename);
27671             printf("\n");
27672         }
27673     }
27674     function_tests++;
27675 #endif
27676 
27677     return(test_ret);
27678 }
27679 
27680 
27681 static int
test_xmlIOFTPRead(void)27682 test_xmlIOFTPRead(void) {
27683     int test_ret = 0;
27684 
27685 #if defined(LIBXML_FTP_ENABLED)
27686     int mem_base;
27687     int ret_val;
27688     void * context; /* the I/O context */
27689     int n_context;
27690     char * buffer; /* where to drop data */
27691     int n_buffer;
27692     int len; /* number of bytes to write */
27693     int n_len;
27694 
27695     for (n_context = 0;n_context < gen_nb_void_ptr;n_context++) {
27696     for (n_buffer = 0;n_buffer < gen_nb_char_ptr;n_buffer++) {
27697     for (n_len = 0;n_len < gen_nb_int;n_len++) {
27698         mem_base = xmlMemBlocks();
27699         context = gen_void_ptr(n_context, 0);
27700         buffer = gen_char_ptr(n_buffer, 1);
27701         len = gen_int(n_len, 2);
27702 
27703         ret_val = xmlIOFTPRead(context, buffer, len);
27704         desret_int(ret_val);
27705         call_tests++;
27706         des_void_ptr(n_context, context, 0);
27707         des_char_ptr(n_buffer, buffer, 1);
27708         des_int(n_len, len, 2);
27709         xmlResetLastError();
27710         if (mem_base != xmlMemBlocks()) {
27711             printf("Leak of %d blocks found in xmlIOFTPRead",
27712 	           xmlMemBlocks() - mem_base);
27713 	    test_ret++;
27714             printf(" %d", n_context);
27715             printf(" %d", n_buffer);
27716             printf(" %d", n_len);
27717             printf("\n");
27718         }
27719     }
27720     }
27721     }
27722     function_tests++;
27723 #endif
27724 
27725     return(test_ret);
27726 }
27727 
27728 
27729 static int
test_xmlIOHTTPClose(void)27730 test_xmlIOHTTPClose(void) {
27731     int test_ret = 0;
27732 
27733 #if defined(LIBXML_HTTP_ENABLED)
27734     int mem_base;
27735     int ret_val;
27736     void * context; /* the I/O context */
27737     int n_context;
27738 
27739     for (n_context = 0;n_context < gen_nb_void_ptr;n_context++) {
27740         mem_base = xmlMemBlocks();
27741         context = gen_void_ptr(n_context, 0);
27742 
27743         ret_val = xmlIOHTTPClose(context);
27744         desret_int(ret_val);
27745         call_tests++;
27746         des_void_ptr(n_context, context, 0);
27747         xmlResetLastError();
27748         if (mem_base != xmlMemBlocks()) {
27749             printf("Leak of %d blocks found in xmlIOHTTPClose",
27750 	           xmlMemBlocks() - mem_base);
27751 	    test_ret++;
27752             printf(" %d", n_context);
27753             printf("\n");
27754         }
27755     }
27756     function_tests++;
27757 #endif
27758 
27759     return(test_ret);
27760 }
27761 
27762 
27763 static int
test_xmlIOHTTPMatch(void)27764 test_xmlIOHTTPMatch(void) {
27765     int test_ret = 0;
27766 
27767 #if defined(LIBXML_HTTP_ENABLED)
27768     int mem_base;
27769     int ret_val;
27770     const char * filename; /* the URI for matching */
27771     int n_filename;
27772 
27773     for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
27774         mem_base = xmlMemBlocks();
27775         filename = gen_filepath(n_filename, 0);
27776 
27777         ret_val = xmlIOHTTPMatch(filename);
27778         desret_int(ret_val);
27779         call_tests++;
27780         des_filepath(n_filename, filename, 0);
27781         xmlResetLastError();
27782         if (mem_base != xmlMemBlocks()) {
27783             printf("Leak of %d blocks found in xmlIOHTTPMatch",
27784 	           xmlMemBlocks() - mem_base);
27785 	    test_ret++;
27786             printf(" %d", n_filename);
27787             printf("\n");
27788         }
27789     }
27790     function_tests++;
27791 #endif
27792 
27793     return(test_ret);
27794 }
27795 
27796 
27797 static int
test_xmlIOHTTPOpen(void)27798 test_xmlIOHTTPOpen(void) {
27799     int test_ret = 0;
27800 
27801 #if defined(LIBXML_HTTP_ENABLED)
27802     int mem_base;
27803     void * ret_val;
27804     const char * filename; /* the URI for matching */
27805     int n_filename;
27806 
27807     for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
27808         mem_base = xmlMemBlocks();
27809         filename = gen_filepath(n_filename, 0);
27810 
27811         ret_val = xmlIOHTTPOpen(filename);
27812         desret_xmlNanoHTTPCtxtPtr(ret_val);
27813         call_tests++;
27814         des_filepath(n_filename, filename, 0);
27815         xmlResetLastError();
27816         if (mem_base != xmlMemBlocks()) {
27817             printf("Leak of %d blocks found in xmlIOHTTPOpen",
27818 	           xmlMemBlocks() - mem_base);
27819 	    test_ret++;
27820             printf(" %d", n_filename);
27821             printf("\n");
27822         }
27823     }
27824     function_tests++;
27825 #endif
27826 
27827     return(test_ret);
27828 }
27829 
27830 
27831 static int
test_xmlIOHTTPRead(void)27832 test_xmlIOHTTPRead(void) {
27833     int test_ret = 0;
27834 
27835 #if defined(LIBXML_HTTP_ENABLED)
27836     int mem_base;
27837     int ret_val;
27838     void * context; /* the I/O context */
27839     int n_context;
27840     char * buffer; /* where to drop data */
27841     int n_buffer;
27842     int len; /* number of bytes to write */
27843     int n_len;
27844 
27845     for (n_context = 0;n_context < gen_nb_void_ptr;n_context++) {
27846     for (n_buffer = 0;n_buffer < gen_nb_char_ptr;n_buffer++) {
27847     for (n_len = 0;n_len < gen_nb_int;n_len++) {
27848         mem_base = xmlMemBlocks();
27849         context = gen_void_ptr(n_context, 0);
27850         buffer = gen_char_ptr(n_buffer, 1);
27851         len = gen_int(n_len, 2);
27852 
27853         ret_val = xmlIOHTTPRead(context, buffer, len);
27854         desret_int(ret_val);
27855         call_tests++;
27856         des_void_ptr(n_context, context, 0);
27857         des_char_ptr(n_buffer, buffer, 1);
27858         des_int(n_len, len, 2);
27859         xmlResetLastError();
27860         if (mem_base != xmlMemBlocks()) {
27861             printf("Leak of %d blocks found in xmlIOHTTPRead",
27862 	           xmlMemBlocks() - mem_base);
27863 	    test_ret++;
27864             printf(" %d", n_context);
27865             printf(" %d", n_buffer);
27866             printf(" %d", n_len);
27867             printf("\n");
27868         }
27869     }
27870     }
27871     }
27872     function_tests++;
27873 #endif
27874 
27875     return(test_ret);
27876 }
27877 
27878 
27879 static int
test_xmlNoNetExternalEntityLoader(void)27880 test_xmlNoNetExternalEntityLoader(void) {
27881     int test_ret = 0;
27882 
27883     int mem_base;
27884     xmlParserInputPtr ret_val;
27885     const char * URL; /* the URL for the entity to load */
27886     int n_URL;
27887     const char * ID; /* the System ID for the entity to load */
27888     int n_ID;
27889     xmlParserCtxtPtr ctxt; /* the context in which the entity is called or NULL */
27890     int n_ctxt;
27891 
27892     for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) {
27893     for (n_ID = 0;n_ID < gen_nb_const_char_ptr;n_ID++) {
27894     for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
27895         mem_base = xmlMemBlocks();
27896         URL = gen_filepath(n_URL, 0);
27897         ID = gen_const_char_ptr(n_ID, 1);
27898         ctxt = gen_xmlParserCtxtPtr(n_ctxt, 2);
27899 
27900         ret_val = xmlNoNetExternalEntityLoader(URL, ID, ctxt);
27901         desret_xmlParserInputPtr(ret_val);
27902         call_tests++;
27903         des_filepath(n_URL, URL, 0);
27904         des_const_char_ptr(n_ID, ID, 1);
27905         des_xmlParserCtxtPtr(n_ctxt, ctxt, 2);
27906         xmlResetLastError();
27907         if (mem_base != xmlMemBlocks()) {
27908             printf("Leak of %d blocks found in xmlNoNetExternalEntityLoader",
27909 	           xmlMemBlocks() - mem_base);
27910 	    test_ret++;
27911             printf(" %d", n_URL);
27912             printf(" %d", n_ID);
27913             printf(" %d", n_ctxt);
27914             printf("\n");
27915         }
27916     }
27917     }
27918     }
27919     function_tests++;
27920 
27921     return(test_ret);
27922 }
27923 
27924 
27925 static int
test_xmlNormalizeWindowsPath(void)27926 test_xmlNormalizeWindowsPath(void) {
27927     int test_ret = 0;
27928 
27929     int mem_base;
27930     xmlChar * ret_val;
27931     const xmlChar * path; /* the input file path */
27932     int n_path;
27933 
27934     for (n_path = 0;n_path < gen_nb_const_xmlChar_ptr;n_path++) {
27935         mem_base = xmlMemBlocks();
27936         path = gen_const_xmlChar_ptr(n_path, 0);
27937 
27938         ret_val = xmlNormalizeWindowsPath(path);
27939         desret_xmlChar_ptr(ret_val);
27940         call_tests++;
27941         des_const_xmlChar_ptr(n_path, path, 0);
27942         xmlResetLastError();
27943         if (mem_base != xmlMemBlocks()) {
27944             printf("Leak of %d blocks found in xmlNormalizeWindowsPath",
27945 	           xmlMemBlocks() - mem_base);
27946 	    test_ret++;
27947             printf(" %d", n_path);
27948             printf("\n");
27949         }
27950     }
27951     function_tests++;
27952 
27953     return(test_ret);
27954 }
27955 
27956 
27957 static int
test_xmlOutputBufferCreateBuffer(void)27958 test_xmlOutputBufferCreateBuffer(void) {
27959     int test_ret = 0;
27960 
27961 #if defined(LIBXML_OUTPUT_ENABLED)
27962     int mem_base;
27963     xmlOutputBufferPtr ret_val;
27964     xmlBufferPtr buffer; /* a xmlBufferPtr */
27965     int n_buffer;
27966     xmlCharEncodingHandlerPtr encoder; /* the encoding converter or NULL */
27967     int n_encoder;
27968 
27969     for (n_buffer = 0;n_buffer < gen_nb_xmlBufferPtr;n_buffer++) {
27970     for (n_encoder = 0;n_encoder < gen_nb_xmlCharEncodingHandlerPtr;n_encoder++) {
27971         mem_base = xmlMemBlocks();
27972         buffer = gen_xmlBufferPtr(n_buffer, 0);
27973         encoder = gen_xmlCharEncodingHandlerPtr(n_encoder, 1);
27974 
27975         ret_val = xmlOutputBufferCreateBuffer(buffer, encoder);
27976         desret_xmlOutputBufferPtr(ret_val);
27977         call_tests++;
27978         des_xmlBufferPtr(n_buffer, buffer, 0);
27979         des_xmlCharEncodingHandlerPtr(n_encoder, encoder, 1);
27980         xmlResetLastError();
27981         if (mem_base != xmlMemBlocks()) {
27982             printf("Leak of %d blocks found in xmlOutputBufferCreateBuffer",
27983 	           xmlMemBlocks() - mem_base);
27984 	    test_ret++;
27985             printf(" %d", n_buffer);
27986             printf(" %d", n_encoder);
27987             printf("\n");
27988         }
27989     }
27990     }
27991     function_tests++;
27992 #endif
27993 
27994     return(test_ret);
27995 }
27996 
27997 
27998 static int
test_xmlOutputBufferCreateFd(void)27999 test_xmlOutputBufferCreateFd(void) {
28000     int test_ret = 0;
28001 
28002 #if defined(LIBXML_OUTPUT_ENABLED)
28003     int mem_base;
28004     xmlOutputBufferPtr ret_val;
28005     int fd; /* a file descriptor number */
28006     int n_fd;
28007     xmlCharEncodingHandlerPtr encoder; /* the encoding converter or NULL */
28008     int n_encoder;
28009 
28010     for (n_fd = 0;n_fd < gen_nb_int;n_fd++) {
28011     for (n_encoder = 0;n_encoder < gen_nb_xmlCharEncodingHandlerPtr;n_encoder++) {
28012         mem_base = xmlMemBlocks();
28013         fd = gen_int(n_fd, 0);
28014         encoder = gen_xmlCharEncodingHandlerPtr(n_encoder, 1);
28015 
28016         ret_val = xmlOutputBufferCreateFd(fd, encoder);
28017         desret_xmlOutputBufferPtr(ret_val);
28018         call_tests++;
28019         des_int(n_fd, fd, 0);
28020         des_xmlCharEncodingHandlerPtr(n_encoder, encoder, 1);
28021         xmlResetLastError();
28022         if (mem_base != xmlMemBlocks()) {
28023             printf("Leak of %d blocks found in xmlOutputBufferCreateFd",
28024 	           xmlMemBlocks() - mem_base);
28025 	    test_ret++;
28026             printf(" %d", n_fd);
28027             printf(" %d", n_encoder);
28028             printf("\n");
28029         }
28030     }
28031     }
28032     function_tests++;
28033 #endif
28034 
28035     return(test_ret);
28036 }
28037 
28038 
28039 static int
test_xmlOutputBufferCreateFile(void)28040 test_xmlOutputBufferCreateFile(void) {
28041     int test_ret = 0;
28042 
28043 #if defined(LIBXML_OUTPUT_ENABLED)
28044     int mem_base;
28045     xmlOutputBufferPtr ret_val;
28046     FILE * file; /* a FILE* */
28047     int n_file;
28048     xmlCharEncodingHandlerPtr encoder; /* the encoding converter or NULL */
28049     int n_encoder;
28050 
28051     for (n_file = 0;n_file < gen_nb_FILE_ptr;n_file++) {
28052     for (n_encoder = 0;n_encoder < gen_nb_xmlCharEncodingHandlerPtr;n_encoder++) {
28053         mem_base = xmlMemBlocks();
28054         file = gen_FILE_ptr(n_file, 0);
28055         encoder = gen_xmlCharEncodingHandlerPtr(n_encoder, 1);
28056 
28057         ret_val = xmlOutputBufferCreateFile(file, encoder);
28058         desret_xmlOutputBufferPtr(ret_val);
28059         call_tests++;
28060         des_FILE_ptr(n_file, file, 0);
28061         des_xmlCharEncodingHandlerPtr(n_encoder, encoder, 1);
28062         xmlResetLastError();
28063         if (mem_base != xmlMemBlocks()) {
28064             printf("Leak of %d blocks found in xmlOutputBufferCreateFile",
28065 	           xmlMemBlocks() - mem_base);
28066 	    test_ret++;
28067             printf(" %d", n_file);
28068             printf(" %d", n_encoder);
28069             printf("\n");
28070         }
28071     }
28072     }
28073     function_tests++;
28074 #endif
28075 
28076     return(test_ret);
28077 }
28078 
28079 
28080 static int
test_xmlOutputBufferCreateFilename(void)28081 test_xmlOutputBufferCreateFilename(void) {
28082     int test_ret = 0;
28083 
28084 #if defined(LIBXML_OUTPUT_ENABLED)
28085     int mem_base;
28086     xmlOutputBufferPtr ret_val;
28087     const char * URI; /* a C string containing the URI or filename */
28088     int n_URI;
28089     xmlCharEncodingHandlerPtr encoder; /* the encoding converter or NULL */
28090     int n_encoder;
28091     int compression; /* the compression ration (0 none, 9 max). */
28092     int n_compression;
28093 
28094     for (n_URI = 0;n_URI < gen_nb_fileoutput;n_URI++) {
28095     for (n_encoder = 0;n_encoder < gen_nb_xmlCharEncodingHandlerPtr;n_encoder++) {
28096     for (n_compression = 0;n_compression < gen_nb_int;n_compression++) {
28097         mem_base = xmlMemBlocks();
28098         URI = gen_fileoutput(n_URI, 0);
28099         encoder = gen_xmlCharEncodingHandlerPtr(n_encoder, 1);
28100         compression = gen_int(n_compression, 2);
28101 
28102         ret_val = xmlOutputBufferCreateFilename(URI, encoder, compression);
28103         desret_xmlOutputBufferPtr(ret_val);
28104         call_tests++;
28105         des_fileoutput(n_URI, URI, 0);
28106         des_xmlCharEncodingHandlerPtr(n_encoder, encoder, 1);
28107         des_int(n_compression, compression, 2);
28108         xmlResetLastError();
28109         if (mem_base != xmlMemBlocks()) {
28110             printf("Leak of %d blocks found in xmlOutputBufferCreateFilename",
28111 	           xmlMemBlocks() - mem_base);
28112 	    test_ret++;
28113             printf(" %d", n_URI);
28114             printf(" %d", n_encoder);
28115             printf(" %d", n_compression);
28116             printf("\n");
28117         }
28118     }
28119     }
28120     }
28121     function_tests++;
28122 #endif
28123 
28124     return(test_ret);
28125 }
28126 
28127 
28128 static int
test_xmlOutputBufferCreateFilenameDefault(void)28129 test_xmlOutputBufferCreateFilenameDefault(void) {
28130     int test_ret = 0;
28131 
28132 
28133     /* missing type support */
28134     return(test_ret);
28135 }
28136 
28137 
28138 static int
test_xmlOutputBufferFlush(void)28139 test_xmlOutputBufferFlush(void) {
28140     int test_ret = 0;
28141 
28142 #if defined(LIBXML_OUTPUT_ENABLED)
28143     int mem_base;
28144     int ret_val;
28145     xmlOutputBufferPtr out; /* a buffered output */
28146     int n_out;
28147 
28148     for (n_out = 0;n_out < gen_nb_xmlOutputBufferPtr;n_out++) {
28149         mem_base = xmlMemBlocks();
28150         out = gen_xmlOutputBufferPtr(n_out, 0);
28151 
28152         ret_val = xmlOutputBufferFlush(out);
28153         desret_int(ret_val);
28154         call_tests++;
28155         des_xmlOutputBufferPtr(n_out, out, 0);
28156         xmlResetLastError();
28157         if (mem_base != xmlMemBlocks()) {
28158             printf("Leak of %d blocks found in xmlOutputBufferFlush",
28159 	           xmlMemBlocks() - mem_base);
28160 	    test_ret++;
28161             printf(" %d", n_out);
28162             printf("\n");
28163         }
28164     }
28165     function_tests++;
28166 #endif
28167 
28168     return(test_ret);
28169 }
28170 
28171 
28172 static int
test_xmlOutputBufferGetContent(void)28173 test_xmlOutputBufferGetContent(void) {
28174     int test_ret = 0;
28175 
28176 #if defined(LIBXML_OUTPUT_ENABLED)
28177     int mem_base;
28178     const xmlChar * ret_val;
28179     xmlOutputBufferPtr out; /* an xmlOutputBufferPtr */
28180     int n_out;
28181 
28182     for (n_out = 0;n_out < gen_nb_xmlOutputBufferPtr;n_out++) {
28183         mem_base = xmlMemBlocks();
28184         out = gen_xmlOutputBufferPtr(n_out, 0);
28185 
28186         ret_val = xmlOutputBufferGetContent(out);
28187         desret_const_xmlChar_ptr(ret_val);
28188         call_tests++;
28189         des_xmlOutputBufferPtr(n_out, out, 0);
28190         xmlResetLastError();
28191         if (mem_base != xmlMemBlocks()) {
28192             printf("Leak of %d blocks found in xmlOutputBufferGetContent",
28193 	           xmlMemBlocks() - mem_base);
28194 	    test_ret++;
28195             printf(" %d", n_out);
28196             printf("\n");
28197         }
28198     }
28199     function_tests++;
28200 #endif
28201 
28202     return(test_ret);
28203 }
28204 
28205 
28206 static int
test_xmlOutputBufferGetSize(void)28207 test_xmlOutputBufferGetSize(void) {
28208     int test_ret = 0;
28209 
28210 
28211     /* missing type support */
28212     return(test_ret);
28213 }
28214 
28215 
28216 static int
test_xmlOutputBufferWrite(void)28217 test_xmlOutputBufferWrite(void) {
28218     int test_ret = 0;
28219 
28220 #if defined(LIBXML_OUTPUT_ENABLED)
28221     int mem_base;
28222     int ret_val;
28223     xmlOutputBufferPtr out; /* a buffered parser output */
28224     int n_out;
28225     int len; /* the size in bytes of the array. */
28226     int n_len;
28227     const char * buf; /* an char array */
28228     int n_buf;
28229 
28230     for (n_out = 0;n_out < gen_nb_xmlOutputBufferPtr;n_out++) {
28231     for (n_len = 0;n_len < gen_nb_int;n_len++) {
28232     for (n_buf = 0;n_buf < gen_nb_const_char_ptr;n_buf++) {
28233         mem_base = xmlMemBlocks();
28234         out = gen_xmlOutputBufferPtr(n_out, 0);
28235         len = gen_int(n_len, 1);
28236         buf = gen_const_char_ptr(n_buf, 2);
28237         if ((buf != NULL) &&
28238             (len > xmlStrlen(BAD_CAST buf)))
28239             len = 0;
28240 
28241         ret_val = xmlOutputBufferWrite(out, len, buf);
28242         desret_int(ret_val);
28243         call_tests++;
28244         des_xmlOutputBufferPtr(n_out, out, 0);
28245         des_int(n_len, len, 1);
28246         des_const_char_ptr(n_buf, buf, 2);
28247         xmlResetLastError();
28248         if (mem_base != xmlMemBlocks()) {
28249             printf("Leak of %d blocks found in xmlOutputBufferWrite",
28250 	           xmlMemBlocks() - mem_base);
28251 	    test_ret++;
28252             printf(" %d", n_out);
28253             printf(" %d", n_len);
28254             printf(" %d", n_buf);
28255             printf("\n");
28256         }
28257     }
28258     }
28259     }
28260     function_tests++;
28261 #endif
28262 
28263     return(test_ret);
28264 }
28265 
28266 
28267 static int
test_xmlOutputBufferWriteEscape(void)28268 test_xmlOutputBufferWriteEscape(void) {
28269     int test_ret = 0;
28270 
28271 
28272     /* missing type support */
28273     return(test_ret);
28274 }
28275 
28276 
28277 static int
test_xmlOutputBufferWriteString(void)28278 test_xmlOutputBufferWriteString(void) {
28279     int test_ret = 0;
28280 
28281 #if defined(LIBXML_OUTPUT_ENABLED)
28282     int mem_base;
28283     int ret_val;
28284     xmlOutputBufferPtr out; /* a buffered parser output */
28285     int n_out;
28286     const char * str; /* a zero terminated C string */
28287     int n_str;
28288 
28289     for (n_out = 0;n_out < gen_nb_xmlOutputBufferPtr;n_out++) {
28290     for (n_str = 0;n_str < gen_nb_const_char_ptr;n_str++) {
28291         mem_base = xmlMemBlocks();
28292         out = gen_xmlOutputBufferPtr(n_out, 0);
28293         str = gen_const_char_ptr(n_str, 1);
28294 
28295         ret_val = xmlOutputBufferWriteString(out, str);
28296         desret_int(ret_val);
28297         call_tests++;
28298         des_xmlOutputBufferPtr(n_out, out, 0);
28299         des_const_char_ptr(n_str, str, 1);
28300         xmlResetLastError();
28301         if (mem_base != xmlMemBlocks()) {
28302             printf("Leak of %d blocks found in xmlOutputBufferWriteString",
28303 	           xmlMemBlocks() - mem_base);
28304 	    test_ret++;
28305             printf(" %d", n_out);
28306             printf(" %d", n_str);
28307             printf("\n");
28308         }
28309     }
28310     }
28311     function_tests++;
28312 #endif
28313 
28314     return(test_ret);
28315 }
28316 
28317 
28318 static int
test_xmlParserGetDirectory(void)28319 test_xmlParserGetDirectory(void) {
28320     int test_ret = 0;
28321 
28322 
28323     /* missing type support */
28324     return(test_ret);
28325 }
28326 
28327 
28328 static int
test_xmlParserInputBufferCreateFd(void)28329 test_xmlParserInputBufferCreateFd(void) {
28330     int test_ret = 0;
28331 
28332     int mem_base;
28333     xmlParserInputBufferPtr ret_val;
28334     int fd; /* a file descriptor number */
28335     int n_fd;
28336     xmlCharEncoding enc; /* the charset encoding if known */
28337     int n_enc;
28338 
28339     for (n_fd = 0;n_fd < gen_nb_int;n_fd++) {
28340     for (n_enc = 0;n_enc < gen_nb_xmlCharEncoding;n_enc++) {
28341         mem_base = xmlMemBlocks();
28342         fd = gen_int(n_fd, 0);
28343         enc = gen_xmlCharEncoding(n_enc, 1);
28344         if (fd >= 0) fd = -1;
28345 
28346         ret_val = xmlParserInputBufferCreateFd(fd, enc);
28347         desret_xmlParserInputBufferPtr(ret_val);
28348         call_tests++;
28349         des_int(n_fd, fd, 0);
28350         des_xmlCharEncoding(n_enc, enc, 1);
28351         xmlResetLastError();
28352         if (mem_base != xmlMemBlocks()) {
28353             printf("Leak of %d blocks found in xmlParserInputBufferCreateFd",
28354 	           xmlMemBlocks() - mem_base);
28355 	    test_ret++;
28356             printf(" %d", n_fd);
28357             printf(" %d", n_enc);
28358             printf("\n");
28359         }
28360     }
28361     }
28362     function_tests++;
28363 
28364     return(test_ret);
28365 }
28366 
28367 
28368 static int
test_xmlParserInputBufferCreateFile(void)28369 test_xmlParserInputBufferCreateFile(void) {
28370     int test_ret = 0;
28371 
28372     int mem_base;
28373     xmlParserInputBufferPtr ret_val;
28374     FILE * file; /* a FILE* */
28375     int n_file;
28376     xmlCharEncoding enc; /* the charset encoding if known */
28377     int n_enc;
28378 
28379     for (n_file = 0;n_file < gen_nb_FILE_ptr;n_file++) {
28380     for (n_enc = 0;n_enc < gen_nb_xmlCharEncoding;n_enc++) {
28381         mem_base = xmlMemBlocks();
28382         file = gen_FILE_ptr(n_file, 0);
28383         enc = gen_xmlCharEncoding(n_enc, 1);
28384 
28385         ret_val = xmlParserInputBufferCreateFile(file, enc);
28386         desret_xmlParserInputBufferPtr(ret_val);
28387         call_tests++;
28388         des_FILE_ptr(n_file, file, 0);
28389         des_xmlCharEncoding(n_enc, enc, 1);
28390         xmlResetLastError();
28391         if (mem_base != xmlMemBlocks()) {
28392             printf("Leak of %d blocks found in xmlParserInputBufferCreateFile",
28393 	           xmlMemBlocks() - mem_base);
28394 	    test_ret++;
28395             printf(" %d", n_file);
28396             printf(" %d", n_enc);
28397             printf("\n");
28398         }
28399     }
28400     }
28401     function_tests++;
28402 
28403     return(test_ret);
28404 }
28405 
28406 
28407 static int
test_xmlParserInputBufferCreateFilename(void)28408 test_xmlParserInputBufferCreateFilename(void) {
28409     int test_ret = 0;
28410 
28411     int mem_base;
28412     xmlParserInputBufferPtr ret_val;
28413     const char * URI; /* a C string containing the URI or filename */
28414     int n_URI;
28415     xmlCharEncoding enc; /* the charset encoding if known */
28416     int n_enc;
28417 
28418     for (n_URI = 0;n_URI < gen_nb_fileoutput;n_URI++) {
28419     for (n_enc = 0;n_enc < gen_nb_xmlCharEncoding;n_enc++) {
28420         mem_base = xmlMemBlocks();
28421         URI = gen_fileoutput(n_URI, 0);
28422         enc = gen_xmlCharEncoding(n_enc, 1);
28423 
28424         ret_val = xmlParserInputBufferCreateFilename(URI, enc);
28425         desret_xmlParserInputBufferPtr(ret_val);
28426         call_tests++;
28427         des_fileoutput(n_URI, URI, 0);
28428         des_xmlCharEncoding(n_enc, enc, 1);
28429         xmlResetLastError();
28430         if (mem_base != xmlMemBlocks()) {
28431             printf("Leak of %d blocks found in xmlParserInputBufferCreateFilename",
28432 	           xmlMemBlocks() - mem_base);
28433 	    test_ret++;
28434             printf(" %d", n_URI);
28435             printf(" %d", n_enc);
28436             printf("\n");
28437         }
28438     }
28439     }
28440     function_tests++;
28441 
28442     return(test_ret);
28443 }
28444 
28445 
28446 static int
test_xmlParserInputBufferCreateFilenameDefault(void)28447 test_xmlParserInputBufferCreateFilenameDefault(void) {
28448     int test_ret = 0;
28449 
28450 
28451     /* missing type support */
28452     return(test_ret);
28453 }
28454 
28455 
28456 static int
test_xmlParserInputBufferCreateMem(void)28457 test_xmlParserInputBufferCreateMem(void) {
28458     int test_ret = 0;
28459 
28460     int mem_base;
28461     xmlParserInputBufferPtr ret_val;
28462     const char * mem; /* the memory input */
28463     int n_mem;
28464     int size; /* the length of the memory block */
28465     int n_size;
28466     xmlCharEncoding enc; /* the charset encoding if known */
28467     int n_enc;
28468 
28469     for (n_mem = 0;n_mem < gen_nb_const_char_ptr;n_mem++) {
28470     for (n_size = 0;n_size < gen_nb_int;n_size++) {
28471     for (n_enc = 0;n_enc < gen_nb_xmlCharEncoding;n_enc++) {
28472         mem_base = xmlMemBlocks();
28473         mem = gen_const_char_ptr(n_mem, 0);
28474         size = gen_int(n_size, 1);
28475         enc = gen_xmlCharEncoding(n_enc, 2);
28476         if ((mem != NULL) &&
28477             (size > xmlStrlen(BAD_CAST mem)))
28478             size = 0;
28479 
28480         ret_val = xmlParserInputBufferCreateMem(mem, size, enc);
28481         desret_xmlParserInputBufferPtr(ret_val);
28482         call_tests++;
28483         des_const_char_ptr(n_mem, mem, 0);
28484         des_int(n_size, size, 1);
28485         des_xmlCharEncoding(n_enc, enc, 2);
28486         xmlResetLastError();
28487         if (mem_base != xmlMemBlocks()) {
28488             printf("Leak of %d blocks found in xmlParserInputBufferCreateMem",
28489 	           xmlMemBlocks() - mem_base);
28490 	    test_ret++;
28491             printf(" %d", n_mem);
28492             printf(" %d", n_size);
28493             printf(" %d", n_enc);
28494             printf("\n");
28495         }
28496     }
28497     }
28498     }
28499     function_tests++;
28500 
28501     return(test_ret);
28502 }
28503 
28504 
28505 static int
test_xmlParserInputBufferCreateStatic(void)28506 test_xmlParserInputBufferCreateStatic(void) {
28507     int test_ret = 0;
28508 
28509     int mem_base;
28510     xmlParserInputBufferPtr ret_val;
28511     const char * mem; /* the memory input */
28512     int n_mem;
28513     int size; /* the length of the memory block */
28514     int n_size;
28515     xmlCharEncoding enc; /* the charset encoding if known */
28516     int n_enc;
28517 
28518     for (n_mem = 0;n_mem < gen_nb_const_char_ptr;n_mem++) {
28519     for (n_size = 0;n_size < gen_nb_int;n_size++) {
28520     for (n_enc = 0;n_enc < gen_nb_xmlCharEncoding;n_enc++) {
28521         mem_base = xmlMemBlocks();
28522         mem = gen_const_char_ptr(n_mem, 0);
28523         size = gen_int(n_size, 1);
28524         enc = gen_xmlCharEncoding(n_enc, 2);
28525         if ((mem != NULL) &&
28526             (size > xmlStrlen(BAD_CAST mem)))
28527             size = 0;
28528 
28529         ret_val = xmlParserInputBufferCreateStatic(mem, size, enc);
28530         desret_xmlParserInputBufferPtr(ret_val);
28531         call_tests++;
28532         des_const_char_ptr(n_mem, mem, 0);
28533         des_int(n_size, size, 1);
28534         des_xmlCharEncoding(n_enc, enc, 2);
28535         xmlResetLastError();
28536         if (mem_base != xmlMemBlocks()) {
28537             printf("Leak of %d blocks found in xmlParserInputBufferCreateStatic",
28538 	           xmlMemBlocks() - mem_base);
28539 	    test_ret++;
28540             printf(" %d", n_mem);
28541             printf(" %d", n_size);
28542             printf(" %d", n_enc);
28543             printf("\n");
28544         }
28545     }
28546     }
28547     }
28548     function_tests++;
28549 
28550     return(test_ret);
28551 }
28552 
28553 
28554 static int
test_xmlParserInputBufferGrow(void)28555 test_xmlParserInputBufferGrow(void) {
28556     int test_ret = 0;
28557 
28558     int mem_base;
28559     int ret_val;
28560     xmlParserInputBufferPtr in; /* a buffered parser input */
28561     int n_in;
28562     int len; /* indicative value of the amount of chars to read */
28563     int n_len;
28564 
28565     for (n_in = 0;n_in < gen_nb_xmlParserInputBufferPtr;n_in++) {
28566     for (n_len = 0;n_len < gen_nb_int;n_len++) {
28567         mem_base = xmlMemBlocks();
28568         in = gen_xmlParserInputBufferPtr(n_in, 0);
28569         len = gen_int(n_len, 1);
28570 
28571         ret_val = xmlParserInputBufferGrow(in, len);
28572         desret_int(ret_val);
28573         call_tests++;
28574         des_xmlParserInputBufferPtr(n_in, in, 0);
28575         des_int(n_len, len, 1);
28576         xmlResetLastError();
28577         if (mem_base != xmlMemBlocks()) {
28578             printf("Leak of %d blocks found in xmlParserInputBufferGrow",
28579 	           xmlMemBlocks() - mem_base);
28580 	    test_ret++;
28581             printf(" %d", n_in);
28582             printf(" %d", n_len);
28583             printf("\n");
28584         }
28585     }
28586     }
28587     function_tests++;
28588 
28589     return(test_ret);
28590 }
28591 
28592 
28593 static int
test_xmlParserInputBufferPush(void)28594 test_xmlParserInputBufferPush(void) {
28595     int test_ret = 0;
28596 
28597     int mem_base;
28598     int ret_val;
28599     xmlParserInputBufferPtr in; /* a buffered parser input */
28600     int n_in;
28601     int len; /* the size in bytes of the array. */
28602     int n_len;
28603     const char * buf; /* an char array */
28604     int n_buf;
28605 
28606     for (n_in = 0;n_in < gen_nb_xmlParserInputBufferPtr;n_in++) {
28607     for (n_len = 0;n_len < gen_nb_int;n_len++) {
28608     for (n_buf = 0;n_buf < gen_nb_const_char_ptr;n_buf++) {
28609         mem_base = xmlMemBlocks();
28610         in = gen_xmlParserInputBufferPtr(n_in, 0);
28611         len = gen_int(n_len, 1);
28612         buf = gen_const_char_ptr(n_buf, 2);
28613         if ((buf != NULL) &&
28614             (len > xmlStrlen(BAD_CAST buf)))
28615             len = 0;
28616 
28617         ret_val = xmlParserInputBufferPush(in, len, buf);
28618         desret_int(ret_val);
28619         call_tests++;
28620         des_xmlParserInputBufferPtr(n_in, in, 0);
28621         des_int(n_len, len, 1);
28622         des_const_char_ptr(n_buf, buf, 2);
28623         xmlResetLastError();
28624         if (mem_base != xmlMemBlocks()) {
28625             printf("Leak of %d blocks found in xmlParserInputBufferPush",
28626 	           xmlMemBlocks() - mem_base);
28627 	    test_ret++;
28628             printf(" %d", n_in);
28629             printf(" %d", n_len);
28630             printf(" %d", n_buf);
28631             printf("\n");
28632         }
28633     }
28634     }
28635     }
28636     function_tests++;
28637 
28638     return(test_ret);
28639 }
28640 
28641 
28642 static int
test_xmlParserInputBufferRead(void)28643 test_xmlParserInputBufferRead(void) {
28644     int test_ret = 0;
28645 
28646     int mem_base;
28647     int ret_val;
28648     xmlParserInputBufferPtr in; /* a buffered parser input */
28649     int n_in;
28650     int len; /* indicative value of the amount of chars to read */
28651     int n_len;
28652 
28653     for (n_in = 0;n_in < gen_nb_xmlParserInputBufferPtr;n_in++) {
28654     for (n_len = 0;n_len < gen_nb_int;n_len++) {
28655         mem_base = xmlMemBlocks();
28656         in = gen_xmlParserInputBufferPtr(n_in, 0);
28657         len = gen_int(n_len, 1);
28658 
28659         ret_val = xmlParserInputBufferRead(in, len);
28660         desret_int(ret_val);
28661         call_tests++;
28662         des_xmlParserInputBufferPtr(n_in, in, 0);
28663         des_int(n_len, len, 1);
28664         xmlResetLastError();
28665         if (mem_base != xmlMemBlocks()) {
28666             printf("Leak of %d blocks found in xmlParserInputBufferRead",
28667 	           xmlMemBlocks() - mem_base);
28668 	    test_ret++;
28669             printf(" %d", n_in);
28670             printf(" %d", n_len);
28671             printf("\n");
28672         }
28673     }
28674     }
28675     function_tests++;
28676 
28677     return(test_ret);
28678 }
28679 
28680 
28681 static int
test_xmlPopInputCallbacks(void)28682 test_xmlPopInputCallbacks(void) {
28683     int test_ret = 0;
28684 
28685     int mem_base;
28686     int ret_val;
28687 
28688         mem_base = xmlMemBlocks();
28689 
28690         ret_val = xmlPopInputCallbacks();
28691         desret_int(ret_val);
28692         call_tests++;
28693         xmlResetLastError();
28694         if (mem_base != xmlMemBlocks()) {
28695             printf("Leak of %d blocks found in xmlPopInputCallbacks",
28696 	           xmlMemBlocks() - mem_base);
28697 	    test_ret++;
28698             printf("\n");
28699         }
28700     function_tests++;
28701 
28702     return(test_ret);
28703 }
28704 
28705 
28706 static int
test_xmlPopOutputCallbacks(void)28707 test_xmlPopOutputCallbacks(void) {
28708     int test_ret = 0;
28709 
28710 #if defined(LIBXML_OUTPUT_ENABLED)
28711     int mem_base;
28712     int ret_val;
28713 
28714         mem_base = xmlMemBlocks();
28715 
28716         ret_val = xmlPopOutputCallbacks();
28717         desret_int(ret_val);
28718         call_tests++;
28719         xmlResetLastError();
28720         if (mem_base != xmlMemBlocks()) {
28721             printf("Leak of %d blocks found in xmlPopOutputCallbacks",
28722 	           xmlMemBlocks() - mem_base);
28723 	    test_ret++;
28724             printf("\n");
28725         }
28726     function_tests++;
28727 #endif
28728 
28729     return(test_ret);
28730 }
28731 
28732 
28733 static int
test_xmlRegisterDefaultInputCallbacks(void)28734 test_xmlRegisterDefaultInputCallbacks(void) {
28735     int test_ret = 0;
28736 
28737     int mem_base;
28738 
28739         mem_base = xmlMemBlocks();
28740 
28741         xmlRegisterDefaultInputCallbacks();
28742         call_tests++;
28743         xmlResetLastError();
28744         if (mem_base != xmlMemBlocks()) {
28745             printf("Leak of %d blocks found in xmlRegisterDefaultInputCallbacks",
28746 	           xmlMemBlocks() - mem_base);
28747 	    test_ret++;
28748             printf("\n");
28749         }
28750     function_tests++;
28751 
28752     return(test_ret);
28753 }
28754 
28755 
28756 static int
test_xmlRegisterDefaultOutputCallbacks(void)28757 test_xmlRegisterDefaultOutputCallbacks(void) {
28758     int test_ret = 0;
28759 
28760 #if defined(LIBXML_OUTPUT_ENABLED)
28761     int mem_base;
28762 
28763         mem_base = xmlMemBlocks();
28764 
28765         xmlRegisterDefaultOutputCallbacks();
28766         call_tests++;
28767         xmlResetLastError();
28768         if (mem_base != xmlMemBlocks()) {
28769             printf("Leak of %d blocks found in xmlRegisterDefaultOutputCallbacks",
28770 	           xmlMemBlocks() - mem_base);
28771 	    test_ret++;
28772             printf("\n");
28773         }
28774     function_tests++;
28775 #endif
28776 
28777     return(test_ret);
28778 }
28779 
28780 
28781 static int
test_xmlRegisterHTTPPostCallbacks(void)28782 test_xmlRegisterHTTPPostCallbacks(void) {
28783     int test_ret = 0;
28784 
28785 #if defined(LIBXML_OUTPUT_ENABLED) && defined(LIBXML_HTTP_ENABLED)
28786     int mem_base;
28787 
28788         mem_base = xmlMemBlocks();
28789 
28790         xmlRegisterHTTPPostCallbacks();
28791         call_tests++;
28792         xmlResetLastError();
28793         if (mem_base != xmlMemBlocks()) {
28794             printf("Leak of %d blocks found in xmlRegisterHTTPPostCallbacks",
28795 	           xmlMemBlocks() - mem_base);
28796 	    test_ret++;
28797             printf("\n");
28798         }
28799     function_tests++;
28800 #endif
28801 
28802     return(test_ret);
28803 }
28804 
28805 
28806 static int
test_xmlThrDefOutputBufferCreateFilenameDefault(void)28807 test_xmlThrDefOutputBufferCreateFilenameDefault(void) {
28808     int test_ret = 0;
28809 
28810 
28811     /* missing type support */
28812     return(test_ret);
28813 }
28814 
28815 
28816 static int
test_xmlThrDefParserInputBufferCreateFilenameDefault(void)28817 test_xmlThrDefParserInputBufferCreateFilenameDefault(void) {
28818     int test_ret = 0;
28819 
28820 
28821     /* missing type support */
28822     return(test_ret);
28823 }
28824 
28825 static int
test_xmlIO(void)28826 test_xmlIO(void) {
28827     int test_ret = 0;
28828 
28829     if (quiet == 0) printf("Testing xmlIO : 41 of 55 functions ...\n");
28830     test_ret += test_xmlAllocOutputBuffer();
28831     test_ret += test_xmlAllocParserInputBuffer();
28832     test_ret += test_xmlCheckFilename();
28833     test_ret += test_xmlCheckHTTPInput();
28834     test_ret += test_xmlCleanupInputCallbacks();
28835     test_ret += test_xmlCleanupOutputCallbacks();
28836     test_ret += test_xmlFileClose();
28837     test_ret += test_xmlFileMatch();
28838     test_ret += test_xmlFileOpen();
28839     test_ret += test_xmlFileRead();
28840     test_ret += test_xmlIOFTPClose();
28841     test_ret += test_xmlIOFTPMatch();
28842     test_ret += test_xmlIOFTPOpen();
28843     test_ret += test_xmlIOFTPRead();
28844     test_ret += test_xmlIOHTTPClose();
28845     test_ret += test_xmlIOHTTPMatch();
28846     test_ret += test_xmlIOHTTPOpen();
28847     test_ret += test_xmlIOHTTPRead();
28848     test_ret += test_xmlNoNetExternalEntityLoader();
28849     test_ret += test_xmlNormalizeWindowsPath();
28850     test_ret += test_xmlOutputBufferCreateBuffer();
28851     test_ret += test_xmlOutputBufferCreateFd();
28852     test_ret += test_xmlOutputBufferCreateFile();
28853     test_ret += test_xmlOutputBufferCreateFilename();
28854     test_ret += test_xmlOutputBufferCreateFilenameDefault();
28855     test_ret += test_xmlOutputBufferFlush();
28856     test_ret += test_xmlOutputBufferGetContent();
28857     test_ret += test_xmlOutputBufferGetSize();
28858     test_ret += test_xmlOutputBufferWrite();
28859     test_ret += test_xmlOutputBufferWriteEscape();
28860     test_ret += test_xmlOutputBufferWriteString();
28861     test_ret += test_xmlParserGetDirectory();
28862     test_ret += test_xmlParserInputBufferCreateFd();
28863     test_ret += test_xmlParserInputBufferCreateFile();
28864     test_ret += test_xmlParserInputBufferCreateFilename();
28865     test_ret += test_xmlParserInputBufferCreateFilenameDefault();
28866     test_ret += test_xmlParserInputBufferCreateMem();
28867     test_ret += test_xmlParserInputBufferCreateStatic();
28868     test_ret += test_xmlParserInputBufferGrow();
28869     test_ret += test_xmlParserInputBufferPush();
28870     test_ret += test_xmlParserInputBufferRead();
28871     test_ret += test_xmlPopInputCallbacks();
28872     test_ret += test_xmlPopOutputCallbacks();
28873     test_ret += test_xmlRegisterDefaultInputCallbacks();
28874     test_ret += test_xmlRegisterDefaultOutputCallbacks();
28875     test_ret += test_xmlRegisterHTTPPostCallbacks();
28876     test_ret += test_xmlThrDefOutputBufferCreateFilenameDefault();
28877     test_ret += test_xmlThrDefParserInputBufferCreateFilenameDefault();
28878 
28879     if (test_ret != 0)
28880 	printf("Module xmlIO: %d errors\n", test_ret);
28881     return(test_ret);
28882 }
28883 
28884 static int
test_xmlAutomataCompile(void)28885 test_xmlAutomataCompile(void) {
28886     int test_ret = 0;
28887 
28888 
28889     /* missing type support */
28890     return(test_ret);
28891 }
28892 
28893 
28894 static int
test_xmlAutomataGetInitState(void)28895 test_xmlAutomataGetInitState(void) {
28896     int test_ret = 0;
28897 
28898 
28899     /* missing type support */
28900     return(test_ret);
28901 }
28902 
28903 #ifdef LIBXML_AUTOMATA_ENABLED
28904 
28905 #define gen_nb_xmlAutomataPtr 1
28906 #define gen_xmlAutomataPtr(no, nr) NULL
28907 #define des_xmlAutomataPtr(no, val, nr)
28908 #endif
28909 
28910 
28911 static int
test_xmlAutomataIsDeterminist(void)28912 test_xmlAutomataIsDeterminist(void) {
28913     int test_ret = 0;
28914 
28915 #if defined(LIBXML_REGEXP_ENABLED) && defined(LIBXML_AUTOMATA_ENABLED)
28916     int mem_base;
28917     int ret_val;
28918     xmlAutomataPtr am; /* an automata */
28919     int n_am;
28920 
28921     for (n_am = 0;n_am < gen_nb_xmlAutomataPtr;n_am++) {
28922         mem_base = xmlMemBlocks();
28923         am = gen_xmlAutomataPtr(n_am, 0);
28924 
28925         ret_val = xmlAutomataIsDeterminist(am);
28926         desret_int(ret_val);
28927         call_tests++;
28928         des_xmlAutomataPtr(n_am, am, 0);
28929         xmlResetLastError();
28930         if (mem_base != xmlMemBlocks()) {
28931             printf("Leak of %d blocks found in xmlAutomataIsDeterminist",
28932 	           xmlMemBlocks() - mem_base);
28933 	    test_ret++;
28934             printf(" %d", n_am);
28935             printf("\n");
28936         }
28937     }
28938     function_tests++;
28939 #endif
28940 
28941     return(test_ret);
28942 }
28943 
28944 
28945 static int
test_xmlAutomataNewAllTrans(void)28946 test_xmlAutomataNewAllTrans(void) {
28947     int test_ret = 0;
28948 
28949 
28950     /* missing type support */
28951     return(test_ret);
28952 }
28953 
28954 
28955 static int
test_xmlAutomataNewCountTrans(void)28956 test_xmlAutomataNewCountTrans(void) {
28957     int test_ret = 0;
28958 
28959 
28960     /* missing type support */
28961     return(test_ret);
28962 }
28963 
28964 
28965 static int
test_xmlAutomataNewCountTrans2(void)28966 test_xmlAutomataNewCountTrans2(void) {
28967     int test_ret = 0;
28968 
28969 
28970     /* missing type support */
28971     return(test_ret);
28972 }
28973 
28974 
28975 static int
test_xmlAutomataNewCountedTrans(void)28976 test_xmlAutomataNewCountedTrans(void) {
28977     int test_ret = 0;
28978 
28979 
28980     /* missing type support */
28981     return(test_ret);
28982 }
28983 
28984 
28985 static int
test_xmlAutomataNewCounter(void)28986 test_xmlAutomataNewCounter(void) {
28987     int test_ret = 0;
28988 
28989 #if defined(LIBXML_REGEXP_ENABLED) && defined(LIBXML_AUTOMATA_ENABLED)
28990     int mem_base;
28991     int ret_val;
28992     xmlAutomataPtr am; /* an automata */
28993     int n_am;
28994     int min; /* the minimal value on the counter */
28995     int n_min;
28996     int max; /* the maximal value on the counter */
28997     int n_max;
28998 
28999     for (n_am = 0;n_am < gen_nb_xmlAutomataPtr;n_am++) {
29000     for (n_min = 0;n_min < gen_nb_int;n_min++) {
29001     for (n_max = 0;n_max < gen_nb_int;n_max++) {
29002         mem_base = xmlMemBlocks();
29003         am = gen_xmlAutomataPtr(n_am, 0);
29004         min = gen_int(n_min, 1);
29005         max = gen_int(n_max, 2);
29006 
29007         ret_val = xmlAutomataNewCounter(am, min, max);
29008         desret_int(ret_val);
29009         call_tests++;
29010         des_xmlAutomataPtr(n_am, am, 0);
29011         des_int(n_min, min, 1);
29012         des_int(n_max, max, 2);
29013         xmlResetLastError();
29014         if (mem_base != xmlMemBlocks()) {
29015             printf("Leak of %d blocks found in xmlAutomataNewCounter",
29016 	           xmlMemBlocks() - mem_base);
29017 	    test_ret++;
29018             printf(" %d", n_am);
29019             printf(" %d", n_min);
29020             printf(" %d", n_max);
29021             printf("\n");
29022         }
29023     }
29024     }
29025     }
29026     function_tests++;
29027 #endif
29028 
29029     return(test_ret);
29030 }
29031 
29032 
29033 static int
test_xmlAutomataNewCounterTrans(void)29034 test_xmlAutomataNewCounterTrans(void) {
29035     int test_ret = 0;
29036 
29037 
29038     /* missing type support */
29039     return(test_ret);
29040 }
29041 
29042 
29043 static int
test_xmlAutomataNewEpsilon(void)29044 test_xmlAutomataNewEpsilon(void) {
29045     int test_ret = 0;
29046 
29047 
29048     /* missing type support */
29049     return(test_ret);
29050 }
29051 
29052 
29053 static int
test_xmlAutomataNewNegTrans(void)29054 test_xmlAutomataNewNegTrans(void) {
29055     int test_ret = 0;
29056 
29057 
29058     /* missing type support */
29059     return(test_ret);
29060 }
29061 
29062 
29063 static int
test_xmlAutomataNewOnceTrans(void)29064 test_xmlAutomataNewOnceTrans(void) {
29065     int test_ret = 0;
29066 
29067 
29068     /* missing type support */
29069     return(test_ret);
29070 }
29071 
29072 
29073 static int
test_xmlAutomataNewOnceTrans2(void)29074 test_xmlAutomataNewOnceTrans2(void) {
29075     int test_ret = 0;
29076 
29077 
29078     /* missing type support */
29079     return(test_ret);
29080 }
29081 
29082 
29083 static int
test_xmlAutomataNewState(void)29084 test_xmlAutomataNewState(void) {
29085     int test_ret = 0;
29086 
29087 
29088     /* missing type support */
29089     return(test_ret);
29090 }
29091 
29092 
29093 static int
test_xmlAutomataNewTransition(void)29094 test_xmlAutomataNewTransition(void) {
29095     int test_ret = 0;
29096 
29097 
29098     /* missing type support */
29099     return(test_ret);
29100 }
29101 
29102 
29103 static int
test_xmlAutomataNewTransition2(void)29104 test_xmlAutomataNewTransition2(void) {
29105     int test_ret = 0;
29106 
29107 
29108     /* missing type support */
29109     return(test_ret);
29110 }
29111 
29112 #ifdef LIBXML_AUTOMATA_ENABLED
29113 
29114 #define gen_nb_xmlAutomataStatePtr 1
29115 #define gen_xmlAutomataStatePtr(no, nr) NULL
29116 #define des_xmlAutomataStatePtr(no, val, nr)
29117 #endif
29118 
29119 
29120 static int
test_xmlAutomataSetFinalState(void)29121 test_xmlAutomataSetFinalState(void) {
29122     int test_ret = 0;
29123 
29124 #if defined(LIBXML_REGEXP_ENABLED) && defined(LIBXML_AUTOMATA_ENABLED)
29125     int mem_base;
29126     int ret_val;
29127     xmlAutomataPtr am; /* an automata */
29128     int n_am;
29129     xmlAutomataStatePtr state; /* a state in this automata */
29130     int n_state;
29131 
29132     for (n_am = 0;n_am < gen_nb_xmlAutomataPtr;n_am++) {
29133     for (n_state = 0;n_state < gen_nb_xmlAutomataStatePtr;n_state++) {
29134         mem_base = xmlMemBlocks();
29135         am = gen_xmlAutomataPtr(n_am, 0);
29136         state = gen_xmlAutomataStatePtr(n_state, 1);
29137 
29138         ret_val = xmlAutomataSetFinalState(am, state);
29139         desret_int(ret_val);
29140         call_tests++;
29141         des_xmlAutomataPtr(n_am, am, 0);
29142         des_xmlAutomataStatePtr(n_state, state, 1);
29143         xmlResetLastError();
29144         if (mem_base != xmlMemBlocks()) {
29145             printf("Leak of %d blocks found in xmlAutomataSetFinalState",
29146 	           xmlMemBlocks() - mem_base);
29147 	    test_ret++;
29148             printf(" %d", n_am);
29149             printf(" %d", n_state);
29150             printf("\n");
29151         }
29152     }
29153     }
29154     function_tests++;
29155 #endif
29156 
29157     return(test_ret);
29158 }
29159 
29160 
29161 static int
test_xmlNewAutomata(void)29162 test_xmlNewAutomata(void) {
29163     int test_ret = 0;
29164 
29165 
29166     /* missing type support */
29167     return(test_ret);
29168 }
29169 
29170 static int
test_xmlautomata(void)29171 test_xmlautomata(void) {
29172     int test_ret = 0;
29173 
29174     if (quiet == 0) printf("Testing xmlautomata : 3 of 19 functions ...\n");
29175     test_ret += test_xmlAutomataCompile();
29176     test_ret += test_xmlAutomataGetInitState();
29177     test_ret += test_xmlAutomataIsDeterminist();
29178     test_ret += test_xmlAutomataNewAllTrans();
29179     test_ret += test_xmlAutomataNewCountTrans();
29180     test_ret += test_xmlAutomataNewCountTrans2();
29181     test_ret += test_xmlAutomataNewCountedTrans();
29182     test_ret += test_xmlAutomataNewCounter();
29183     test_ret += test_xmlAutomataNewCounterTrans();
29184     test_ret += test_xmlAutomataNewEpsilon();
29185     test_ret += test_xmlAutomataNewNegTrans();
29186     test_ret += test_xmlAutomataNewOnceTrans();
29187     test_ret += test_xmlAutomataNewOnceTrans2();
29188     test_ret += test_xmlAutomataNewState();
29189     test_ret += test_xmlAutomataNewTransition();
29190     test_ret += test_xmlAutomataNewTransition2();
29191     test_ret += test_xmlAutomataSetFinalState();
29192     test_ret += test_xmlNewAutomata();
29193 
29194     if (test_ret != 0)
29195 	printf("Module xmlautomata: %d errors\n", test_ret);
29196     return(test_ret);
29197 }
29198 
29199 #define gen_nb_xmlGenericErrorFunc_ptr 1
29200 #define gen_xmlGenericErrorFunc_ptr(no, nr) NULL
29201 #define des_xmlGenericErrorFunc_ptr(no, val, nr)
29202 
29203 static int
test_initGenericErrorDefaultFunc(void)29204 test_initGenericErrorDefaultFunc(void) {
29205     int test_ret = 0;
29206 
29207     int mem_base;
29208     xmlGenericErrorFunc * handler; /* the handler */
29209     int n_handler;
29210 
29211     for (n_handler = 0;n_handler < gen_nb_xmlGenericErrorFunc_ptr;n_handler++) {
29212         mem_base = xmlMemBlocks();
29213         handler = gen_xmlGenericErrorFunc_ptr(n_handler, 0);
29214 
29215         initGenericErrorDefaultFunc(handler);
29216         call_tests++;
29217         des_xmlGenericErrorFunc_ptr(n_handler, handler, 0);
29218         xmlResetLastError();
29219         if (mem_base != xmlMemBlocks()) {
29220             printf("Leak of %d blocks found in initGenericErrorDefaultFunc",
29221 	           xmlMemBlocks() - mem_base);
29222 	    test_ret++;
29223             printf(" %d", n_handler);
29224             printf("\n");
29225         }
29226     }
29227     function_tests++;
29228 
29229     return(test_ret);
29230 }
29231 
29232 
29233 #define gen_nb_const_xmlError_ptr 1
29234 #define gen_const_xmlError_ptr(no, nr) NULL
29235 #define des_const_xmlError_ptr(no, val, nr)
29236 
29237 #define gen_nb_xmlErrorPtr 1
29238 #define gen_xmlErrorPtr(no, nr) NULL
29239 #define des_xmlErrorPtr(no, val, nr)
29240 
29241 static int
test_xmlCopyError(void)29242 test_xmlCopyError(void) {
29243     int test_ret = 0;
29244 
29245     int mem_base;
29246     int ret_val;
29247     const xmlError * from; /* a source error */
29248     int n_from;
29249     xmlErrorPtr to; /* a target error */
29250     int n_to;
29251 
29252     for (n_from = 0;n_from < gen_nb_const_xmlError_ptr;n_from++) {
29253     for (n_to = 0;n_to < gen_nb_xmlErrorPtr;n_to++) {
29254         mem_base = xmlMemBlocks();
29255         from = gen_const_xmlError_ptr(n_from, 0);
29256         to = gen_xmlErrorPtr(n_to, 1);
29257 
29258         ret_val = xmlCopyError(from, to);
29259         desret_int(ret_val);
29260         call_tests++;
29261         des_const_xmlError_ptr(n_from, from, 0);
29262         des_xmlErrorPtr(n_to, to, 1);
29263         xmlResetLastError();
29264         if (mem_base != xmlMemBlocks()) {
29265             printf("Leak of %d blocks found in xmlCopyError",
29266 	           xmlMemBlocks() - mem_base);
29267 	    test_ret++;
29268             printf(" %d", n_from);
29269             printf(" %d", n_to);
29270             printf("\n");
29271         }
29272     }
29273     }
29274     function_tests++;
29275 
29276     return(test_ret);
29277 }
29278 
29279 
29280 static int
test_xmlCtxtGetLastError(void)29281 test_xmlCtxtGetLastError(void) {
29282     int test_ret = 0;
29283 
29284 
29285     /* missing type support */
29286     return(test_ret);
29287 }
29288 
29289 
29290 static int
test_xmlCtxtResetLastError(void)29291 test_xmlCtxtResetLastError(void) {
29292     int test_ret = 0;
29293 
29294     int mem_base;
29295     void * ctx; /* an XML parser context */
29296     int n_ctx;
29297 
29298     for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
29299         mem_base = xmlMemBlocks();
29300         ctx = gen_void_ptr(n_ctx, 0);
29301 
29302         xmlCtxtResetLastError(ctx);
29303         call_tests++;
29304         des_void_ptr(n_ctx, ctx, 0);
29305         xmlResetLastError();
29306         if (mem_base != xmlMemBlocks()) {
29307             printf("Leak of %d blocks found in xmlCtxtResetLastError",
29308 	           xmlMemBlocks() - mem_base);
29309 	    test_ret++;
29310             printf(" %d", n_ctx);
29311             printf("\n");
29312         }
29313     }
29314     function_tests++;
29315 
29316     return(test_ret);
29317 }
29318 
29319 
29320 static int
test_xmlGetLastError(void)29321 test_xmlGetLastError(void) {
29322     int test_ret = 0;
29323 
29324 
29325     /* missing type support */
29326     return(test_ret);
29327 }
29328 
29329 
29330 static int
test_xmlParserError(void)29331 test_xmlParserError(void) {
29332     int test_ret = 0;
29333 
29334 
29335     /* missing type support */
29336     return(test_ret);
29337 }
29338 
29339 
29340 static int
test_xmlParserPrintFileContext(void)29341 test_xmlParserPrintFileContext(void) {
29342     int test_ret = 0;
29343 
29344     int mem_base;
29345     xmlParserInputPtr input; /* an xmlParserInputPtr input */
29346     int n_input;
29347 
29348     for (n_input = 0;n_input < gen_nb_xmlParserInputPtr;n_input++) {
29349         mem_base = xmlMemBlocks();
29350         input = gen_xmlParserInputPtr(n_input, 0);
29351 
29352         xmlParserPrintFileContext(input);
29353         call_tests++;
29354         des_xmlParserInputPtr(n_input, input, 0);
29355         xmlResetLastError();
29356         if (mem_base != xmlMemBlocks()) {
29357             printf("Leak of %d blocks found in xmlParserPrintFileContext",
29358 	           xmlMemBlocks() - mem_base);
29359 	    test_ret++;
29360             printf(" %d", n_input);
29361             printf("\n");
29362         }
29363     }
29364     function_tests++;
29365 
29366     return(test_ret);
29367 }
29368 
29369 
29370 static int
test_xmlParserPrintFileInfo(void)29371 test_xmlParserPrintFileInfo(void) {
29372     int test_ret = 0;
29373 
29374     int mem_base;
29375     xmlParserInputPtr input; /* an xmlParserInputPtr input */
29376     int n_input;
29377 
29378     for (n_input = 0;n_input < gen_nb_xmlParserInputPtr;n_input++) {
29379         mem_base = xmlMemBlocks();
29380         input = gen_xmlParserInputPtr(n_input, 0);
29381 
29382         xmlParserPrintFileInfo(input);
29383         call_tests++;
29384         des_xmlParserInputPtr(n_input, input, 0);
29385         xmlResetLastError();
29386         if (mem_base != xmlMemBlocks()) {
29387             printf("Leak of %d blocks found in xmlParserPrintFileInfo",
29388 	           xmlMemBlocks() - mem_base);
29389 	    test_ret++;
29390             printf(" %d", n_input);
29391             printf("\n");
29392         }
29393     }
29394     function_tests++;
29395 
29396     return(test_ret);
29397 }
29398 
29399 
29400 static int
test_xmlParserValidityError(void)29401 test_xmlParserValidityError(void) {
29402     int test_ret = 0;
29403 
29404 
29405     /* missing type support */
29406     return(test_ret);
29407 }
29408 
29409 
29410 static int
test_xmlParserValidityWarning(void)29411 test_xmlParserValidityWarning(void) {
29412     int test_ret = 0;
29413 
29414 
29415     /* missing type support */
29416     return(test_ret);
29417 }
29418 
29419 
29420 static int
test_xmlParserWarning(void)29421 test_xmlParserWarning(void) {
29422     int test_ret = 0;
29423 
29424 
29425     /* missing type support */
29426     return(test_ret);
29427 }
29428 
29429 
29430 static int
test_xmlResetError(void)29431 test_xmlResetError(void) {
29432     int test_ret = 0;
29433 
29434     int mem_base;
29435     xmlErrorPtr err; /* pointer to the error. */
29436     int n_err;
29437 
29438     for (n_err = 0;n_err < gen_nb_xmlErrorPtr;n_err++) {
29439         mem_base = xmlMemBlocks();
29440         err = gen_xmlErrorPtr(n_err, 0);
29441 
29442         xmlResetError(err);
29443         call_tests++;
29444         des_xmlErrorPtr(n_err, err, 0);
29445         xmlResetLastError();
29446         if (mem_base != xmlMemBlocks()) {
29447             printf("Leak of %d blocks found in xmlResetError",
29448 	           xmlMemBlocks() - mem_base);
29449 	    test_ret++;
29450             printf(" %d", n_err);
29451             printf("\n");
29452         }
29453     }
29454     function_tests++;
29455 
29456     return(test_ret);
29457 }
29458 
29459 
29460 static int
test_xmlResetLastError(void)29461 test_xmlResetLastError(void) {
29462     int test_ret = 0;
29463 
29464 
29465 
29466         xmlResetLastError();
29467         call_tests++;
29468         xmlResetLastError();
29469     function_tests++;
29470 
29471     return(test_ret);
29472 }
29473 
29474 
29475 static int
test_xmlSetGenericErrorFunc(void)29476 test_xmlSetGenericErrorFunc(void) {
29477     int test_ret = 0;
29478 
29479 
29480     /* missing type support */
29481     return(test_ret);
29482 }
29483 
29484 
29485 static int
test_xmlSetStructuredErrorFunc(void)29486 test_xmlSetStructuredErrorFunc(void) {
29487     int test_ret = 0;
29488 
29489 
29490     /* missing type support */
29491     return(test_ret);
29492 }
29493 
29494 
29495 static int
test_xmlThrDefSetGenericErrorFunc(void)29496 test_xmlThrDefSetGenericErrorFunc(void) {
29497     int test_ret = 0;
29498 
29499 
29500     /* missing type support */
29501     return(test_ret);
29502 }
29503 
29504 
29505 static int
test_xmlThrDefSetStructuredErrorFunc(void)29506 test_xmlThrDefSetStructuredErrorFunc(void) {
29507     int test_ret = 0;
29508 
29509 
29510     /* missing type support */
29511     return(test_ret);
29512 }
29513 
29514 static int
test_xmlerror(void)29515 test_xmlerror(void) {
29516     int test_ret = 0;
29517 
29518     if (quiet == 0) printf("Testing xmlerror : 7 of 17 functions ...\n");
29519     test_ret += test_initGenericErrorDefaultFunc();
29520     test_ret += test_xmlCopyError();
29521     test_ret += test_xmlCtxtGetLastError();
29522     test_ret += test_xmlCtxtResetLastError();
29523     test_ret += test_xmlGetLastError();
29524     test_ret += test_xmlParserError();
29525     test_ret += test_xmlParserPrintFileContext();
29526     test_ret += test_xmlParserPrintFileInfo();
29527     test_ret += test_xmlParserValidityError();
29528     test_ret += test_xmlParserValidityWarning();
29529     test_ret += test_xmlParserWarning();
29530     test_ret += test_xmlResetError();
29531     test_ret += test_xmlResetLastError();
29532     test_ret += test_xmlSetGenericErrorFunc();
29533     test_ret += test_xmlSetStructuredErrorFunc();
29534     test_ret += test_xmlThrDefSetGenericErrorFunc();
29535     test_ret += test_xmlThrDefSetStructuredErrorFunc();
29536 
29537     if (test_ret != 0)
29538 	printf("Module xmlerror: %d errors\n", test_ret);
29539     return(test_ret);
29540 }
29541 #ifdef LIBXML_MODULES_ENABLED
29542 
29543 #define gen_nb_xmlModulePtr 1
29544 #define gen_xmlModulePtr(no, nr) NULL
29545 #define des_xmlModulePtr(no, val, nr)
29546 #endif
29547 
29548 
29549 static int
test_xmlModuleClose(void)29550 test_xmlModuleClose(void) {
29551     int test_ret = 0;
29552 
29553 #if defined(LIBXML_MODULES_ENABLED)
29554     int mem_base;
29555     int ret_val;
29556     xmlModulePtr module; /* the module handle */
29557     int n_module;
29558 
29559     for (n_module = 0;n_module < gen_nb_xmlModulePtr;n_module++) {
29560         mem_base = xmlMemBlocks();
29561         module = gen_xmlModulePtr(n_module, 0);
29562 
29563         ret_val = xmlModuleClose(module);
29564         desret_int(ret_val);
29565         call_tests++;
29566         des_xmlModulePtr(n_module, module, 0);
29567         xmlResetLastError();
29568         if (mem_base != xmlMemBlocks()) {
29569             printf("Leak of %d blocks found in xmlModuleClose",
29570 	           xmlMemBlocks() - mem_base);
29571 	    test_ret++;
29572             printf(" %d", n_module);
29573             printf("\n");
29574         }
29575     }
29576     function_tests++;
29577 #endif
29578 
29579     return(test_ret);
29580 }
29581 
29582 
29583 static int
test_xmlModuleOpen(void)29584 test_xmlModuleOpen(void) {
29585     int test_ret = 0;
29586 
29587 
29588     /* missing type support */
29589     return(test_ret);
29590 }
29591 
29592 
29593 static int
test_xmlModuleSymbol(void)29594 test_xmlModuleSymbol(void) {
29595     int test_ret = 0;
29596 
29597 #if defined(LIBXML_MODULES_ENABLED)
29598     int mem_base;
29599     int ret_val;
29600     xmlModulePtr module; /* the module */
29601     int n_module;
29602     const char * name; /* the name of the symbol */
29603     int n_name;
29604     void ** symbol; /* the resulting symbol address */
29605     int n_symbol;
29606 
29607     for (n_module = 0;n_module < gen_nb_xmlModulePtr;n_module++) {
29608     for (n_name = 0;n_name < gen_nb_const_char_ptr;n_name++) {
29609     for (n_symbol = 0;n_symbol < gen_nb_void_ptr_ptr;n_symbol++) {
29610         mem_base = xmlMemBlocks();
29611         module = gen_xmlModulePtr(n_module, 0);
29612         name = gen_const_char_ptr(n_name, 1);
29613         symbol = gen_void_ptr_ptr(n_symbol, 2);
29614 
29615         ret_val = xmlModuleSymbol(module, name, symbol);
29616         desret_int(ret_val);
29617         call_tests++;
29618         des_xmlModulePtr(n_module, module, 0);
29619         des_const_char_ptr(n_name, name, 1);
29620         des_void_ptr_ptr(n_symbol, symbol, 2);
29621         xmlResetLastError();
29622         if (mem_base != xmlMemBlocks()) {
29623             printf("Leak of %d blocks found in xmlModuleSymbol",
29624 	           xmlMemBlocks() - mem_base);
29625 	    test_ret++;
29626             printf(" %d", n_module);
29627             printf(" %d", n_name);
29628             printf(" %d", n_symbol);
29629             printf("\n");
29630         }
29631     }
29632     }
29633     }
29634     function_tests++;
29635 #endif
29636 
29637     return(test_ret);
29638 }
29639 
29640 static int
test_xmlmodule(void)29641 test_xmlmodule(void) {
29642     int test_ret = 0;
29643 
29644     if (quiet == 0) printf("Testing xmlmodule : 2 of 4 functions ...\n");
29645     test_ret += test_xmlModuleClose();
29646     test_ret += test_xmlModuleOpen();
29647     test_ret += test_xmlModuleSymbol();
29648 
29649     if (test_ret != 0)
29650 	printf("Module xmlmodule: %d errors\n", test_ret);
29651     return(test_ret);
29652 }
29653 
29654 static int
test_xmlNewTextReader(void)29655 test_xmlNewTextReader(void) {
29656     int test_ret = 0;
29657 
29658 #if defined(LIBXML_READER_ENABLED)
29659     int mem_base;
29660     xmlTextReaderPtr ret_val;
29661     xmlParserInputBufferPtr input; /* the xmlParserInputBufferPtr used to read data */
29662     int n_input;
29663     const char * URI; /* the URI information for the source if available */
29664     int n_URI;
29665 
29666     for (n_input = 0;n_input < gen_nb_xmlParserInputBufferPtr;n_input++) {
29667     for (n_URI = 0;n_URI < gen_nb_filepath;n_URI++) {
29668         mem_base = xmlMemBlocks();
29669         input = gen_xmlParserInputBufferPtr(n_input, 0);
29670         URI = gen_filepath(n_URI, 1);
29671 
29672         ret_val = xmlNewTextReader(input, URI);
29673         desret_xmlTextReaderPtr(ret_val);
29674         call_tests++;
29675         des_xmlParserInputBufferPtr(n_input, input, 0);
29676         des_filepath(n_URI, URI, 1);
29677         xmlResetLastError();
29678         if (mem_base != xmlMemBlocks()) {
29679             printf("Leak of %d blocks found in xmlNewTextReader",
29680 	           xmlMemBlocks() - mem_base);
29681 	    test_ret++;
29682             printf(" %d", n_input);
29683             printf(" %d", n_URI);
29684             printf("\n");
29685         }
29686     }
29687     }
29688     function_tests++;
29689 #endif
29690 
29691     return(test_ret);
29692 }
29693 
29694 
29695 static int
test_xmlNewTextReaderFilename(void)29696 test_xmlNewTextReaderFilename(void) {
29697     int test_ret = 0;
29698 
29699 #if defined(LIBXML_READER_ENABLED)
29700     int mem_base;
29701     xmlTextReaderPtr ret_val;
29702     const char * URI; /* the URI of the resource to process */
29703     int n_URI;
29704 
29705     for (n_URI = 0;n_URI < gen_nb_filepath;n_URI++) {
29706         mem_base = xmlMemBlocks();
29707         URI = gen_filepath(n_URI, 0);
29708 
29709         ret_val = xmlNewTextReaderFilename(URI);
29710         desret_xmlTextReaderPtr(ret_val);
29711         call_tests++;
29712         des_filepath(n_URI, URI, 0);
29713         xmlResetLastError();
29714         if (mem_base != xmlMemBlocks()) {
29715             printf("Leak of %d blocks found in xmlNewTextReaderFilename",
29716 	           xmlMemBlocks() - mem_base);
29717 	    test_ret++;
29718             printf(" %d", n_URI);
29719             printf("\n");
29720         }
29721     }
29722     function_tests++;
29723 #endif
29724 
29725     return(test_ret);
29726 }
29727 
29728 
29729 static int
test_xmlReaderForDoc(void)29730 test_xmlReaderForDoc(void) {
29731     int test_ret = 0;
29732 
29733 #if defined(LIBXML_READER_ENABLED)
29734     int mem_base;
29735     xmlTextReaderPtr ret_val;
29736     const xmlChar * cur; /* a pointer to a zero terminated string */
29737     int n_cur;
29738     const char * URL; /* the base URL to use for the document */
29739     int n_URL;
29740     const char * encoding; /* the document encoding, or NULL */
29741     int n_encoding;
29742     int options; /* a combination of xmlParserOption */
29743     int n_options;
29744 
29745     for (n_cur = 0;n_cur < gen_nb_const_xmlChar_ptr;n_cur++) {
29746     for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) {
29747     for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
29748     for (n_options = 0;n_options < gen_nb_parseroptions;n_options++) {
29749         mem_base = xmlMemBlocks();
29750         cur = gen_const_xmlChar_ptr(n_cur, 0);
29751         URL = gen_filepath(n_URL, 1);
29752         encoding = gen_const_char_ptr(n_encoding, 2);
29753         options = gen_parseroptions(n_options, 3);
29754 
29755         ret_val = xmlReaderForDoc(cur, URL, encoding, options);
29756         desret_xmlTextReaderPtr(ret_val);
29757         call_tests++;
29758         des_const_xmlChar_ptr(n_cur, cur, 0);
29759         des_filepath(n_URL, URL, 1);
29760         des_const_char_ptr(n_encoding, encoding, 2);
29761         des_parseroptions(n_options, options, 3);
29762         xmlResetLastError();
29763         if (mem_base != xmlMemBlocks()) {
29764             printf("Leak of %d blocks found in xmlReaderForDoc",
29765 	           xmlMemBlocks() - mem_base);
29766 	    test_ret++;
29767             printf(" %d", n_cur);
29768             printf(" %d", n_URL);
29769             printf(" %d", n_encoding);
29770             printf(" %d", n_options);
29771             printf("\n");
29772         }
29773     }
29774     }
29775     }
29776     }
29777     function_tests++;
29778 #endif
29779 
29780     return(test_ret);
29781 }
29782 
29783 
29784 static int
test_xmlReaderForFile(void)29785 test_xmlReaderForFile(void) {
29786     int test_ret = 0;
29787 
29788 #if defined(LIBXML_READER_ENABLED)
29789     int mem_base;
29790     xmlTextReaderPtr ret_val;
29791     const char * filename; /* a file or URL */
29792     int n_filename;
29793     const char * encoding; /* the document encoding, or NULL */
29794     int n_encoding;
29795     int options; /* a combination of xmlParserOption */
29796     int n_options;
29797 
29798     for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
29799     for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
29800     for (n_options = 0;n_options < gen_nb_parseroptions;n_options++) {
29801         mem_base = xmlMemBlocks();
29802         filename = gen_filepath(n_filename, 0);
29803         encoding = gen_const_char_ptr(n_encoding, 1);
29804         options = gen_parseroptions(n_options, 2);
29805 
29806         ret_val = xmlReaderForFile(filename, encoding, options);
29807         desret_xmlTextReaderPtr(ret_val);
29808         call_tests++;
29809         des_filepath(n_filename, filename, 0);
29810         des_const_char_ptr(n_encoding, encoding, 1);
29811         des_parseroptions(n_options, options, 2);
29812         xmlResetLastError();
29813         if (mem_base != xmlMemBlocks()) {
29814             printf("Leak of %d blocks found in xmlReaderForFile",
29815 	           xmlMemBlocks() - mem_base);
29816 	    test_ret++;
29817             printf(" %d", n_filename);
29818             printf(" %d", n_encoding);
29819             printf(" %d", n_options);
29820             printf("\n");
29821         }
29822     }
29823     }
29824     }
29825     function_tests++;
29826 #endif
29827 
29828     return(test_ret);
29829 }
29830 
29831 
29832 static int
test_xmlReaderForMemory(void)29833 test_xmlReaderForMemory(void) {
29834     int test_ret = 0;
29835 
29836 #if defined(LIBXML_READER_ENABLED)
29837     int mem_base;
29838     xmlTextReaderPtr ret_val;
29839     const char * buffer; /* a pointer to a char array */
29840     int n_buffer;
29841     int size; /* the size of the array */
29842     int n_size;
29843     const char * URL; /* the base URL to use for the document */
29844     int n_URL;
29845     const char * encoding; /* the document encoding, or NULL */
29846     int n_encoding;
29847     int options; /* a combination of xmlParserOption */
29848     int n_options;
29849 
29850     for (n_buffer = 0;n_buffer < gen_nb_const_char_ptr;n_buffer++) {
29851     for (n_size = 0;n_size < gen_nb_int;n_size++) {
29852     for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) {
29853     for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
29854     for (n_options = 0;n_options < gen_nb_parseroptions;n_options++) {
29855         mem_base = xmlMemBlocks();
29856         buffer = gen_const_char_ptr(n_buffer, 0);
29857         size = gen_int(n_size, 1);
29858         URL = gen_filepath(n_URL, 2);
29859         encoding = gen_const_char_ptr(n_encoding, 3);
29860         options = gen_parseroptions(n_options, 4);
29861         if ((buffer != NULL) &&
29862             (size > xmlStrlen(BAD_CAST buffer)))
29863             size = 0;
29864 
29865         ret_val = xmlReaderForMemory(buffer, size, URL, encoding, options);
29866         desret_xmlTextReaderPtr(ret_val);
29867         call_tests++;
29868         des_const_char_ptr(n_buffer, buffer, 0);
29869         des_int(n_size, size, 1);
29870         des_filepath(n_URL, URL, 2);
29871         des_const_char_ptr(n_encoding, encoding, 3);
29872         des_parseroptions(n_options, options, 4);
29873         xmlResetLastError();
29874         if (mem_base != xmlMemBlocks()) {
29875             printf("Leak of %d blocks found in xmlReaderForMemory",
29876 	           xmlMemBlocks() - mem_base);
29877 	    test_ret++;
29878             printf(" %d", n_buffer);
29879             printf(" %d", n_size);
29880             printf(" %d", n_URL);
29881             printf(" %d", n_encoding);
29882             printf(" %d", n_options);
29883             printf("\n");
29884         }
29885     }
29886     }
29887     }
29888     }
29889     }
29890     function_tests++;
29891 #endif
29892 
29893     return(test_ret);
29894 }
29895 
29896 
29897 static int
test_xmlReaderNewDoc(void)29898 test_xmlReaderNewDoc(void) {
29899     int test_ret = 0;
29900 
29901 #if defined(LIBXML_READER_ENABLED)
29902     int mem_base;
29903     int ret_val;
29904     xmlTextReaderPtr reader; /* an XML reader */
29905     int n_reader;
29906     const xmlChar * cur; /* a pointer to a zero terminated string */
29907     int n_cur;
29908     const char * URL; /* the base URL to use for the document */
29909     int n_URL;
29910     const char * encoding; /* the document encoding, or NULL */
29911     int n_encoding;
29912     int options; /* a combination of xmlParserOption */
29913     int n_options;
29914 
29915     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
29916     for (n_cur = 0;n_cur < gen_nb_const_xmlChar_ptr;n_cur++) {
29917     for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) {
29918     for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
29919     for (n_options = 0;n_options < gen_nb_parseroptions;n_options++) {
29920         mem_base = xmlMemBlocks();
29921         reader = gen_xmlTextReaderPtr(n_reader, 0);
29922         cur = gen_const_xmlChar_ptr(n_cur, 1);
29923         URL = gen_filepath(n_URL, 2);
29924         encoding = gen_const_char_ptr(n_encoding, 3);
29925         options = gen_parseroptions(n_options, 4);
29926 
29927         ret_val = xmlReaderNewDoc(reader, cur, URL, encoding, options);
29928         desret_int(ret_val);
29929         call_tests++;
29930         des_xmlTextReaderPtr(n_reader, reader, 0);
29931         des_const_xmlChar_ptr(n_cur, cur, 1);
29932         des_filepath(n_URL, URL, 2);
29933         des_const_char_ptr(n_encoding, encoding, 3);
29934         des_parseroptions(n_options, options, 4);
29935         xmlResetLastError();
29936         if (mem_base != xmlMemBlocks()) {
29937             printf("Leak of %d blocks found in xmlReaderNewDoc",
29938 	           xmlMemBlocks() - mem_base);
29939 	    test_ret++;
29940             printf(" %d", n_reader);
29941             printf(" %d", n_cur);
29942             printf(" %d", n_URL);
29943             printf(" %d", n_encoding);
29944             printf(" %d", n_options);
29945             printf("\n");
29946         }
29947     }
29948     }
29949     }
29950     }
29951     }
29952     function_tests++;
29953 #endif
29954 
29955     return(test_ret);
29956 }
29957 
29958 
29959 static int
test_xmlReaderNewFile(void)29960 test_xmlReaderNewFile(void) {
29961     int test_ret = 0;
29962 
29963 #if defined(LIBXML_READER_ENABLED)
29964     int mem_base;
29965     int ret_val;
29966     xmlTextReaderPtr reader; /* an XML reader */
29967     int n_reader;
29968     const char * filename; /* a file or URL */
29969     int n_filename;
29970     const char * encoding; /* the document encoding, or NULL */
29971     int n_encoding;
29972     int options; /* a combination of xmlParserOption */
29973     int n_options;
29974 
29975     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
29976     for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
29977     for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
29978     for (n_options = 0;n_options < gen_nb_parseroptions;n_options++) {
29979         mem_base = xmlMemBlocks();
29980         reader = gen_xmlTextReaderPtr(n_reader, 0);
29981         filename = gen_filepath(n_filename, 1);
29982         encoding = gen_const_char_ptr(n_encoding, 2);
29983         options = gen_parseroptions(n_options, 3);
29984 
29985         ret_val = xmlReaderNewFile(reader, filename, encoding, options);
29986         desret_int(ret_val);
29987         call_tests++;
29988         des_xmlTextReaderPtr(n_reader, reader, 0);
29989         des_filepath(n_filename, filename, 1);
29990         des_const_char_ptr(n_encoding, encoding, 2);
29991         des_parseroptions(n_options, options, 3);
29992         xmlResetLastError();
29993         if (mem_base != xmlMemBlocks()) {
29994             printf("Leak of %d blocks found in xmlReaderNewFile",
29995 	           xmlMemBlocks() - mem_base);
29996 	    test_ret++;
29997             printf(" %d", n_reader);
29998             printf(" %d", n_filename);
29999             printf(" %d", n_encoding);
30000             printf(" %d", n_options);
30001             printf("\n");
30002         }
30003     }
30004     }
30005     }
30006     }
30007     function_tests++;
30008 #endif
30009 
30010     return(test_ret);
30011 }
30012 
30013 
30014 static int
test_xmlReaderNewMemory(void)30015 test_xmlReaderNewMemory(void) {
30016     int test_ret = 0;
30017 
30018 #if defined(LIBXML_READER_ENABLED)
30019     int mem_base;
30020     int ret_val;
30021     xmlTextReaderPtr reader; /* an XML reader */
30022     int n_reader;
30023     const char * buffer; /* a pointer to a char array */
30024     int n_buffer;
30025     int size; /* the size of the array */
30026     int n_size;
30027     const char * URL; /* the base URL to use for the document */
30028     int n_URL;
30029     const char * encoding; /* the document encoding, or NULL */
30030     int n_encoding;
30031     int options; /* a combination of xmlParserOption */
30032     int n_options;
30033 
30034     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
30035     for (n_buffer = 0;n_buffer < gen_nb_const_char_ptr;n_buffer++) {
30036     for (n_size = 0;n_size < gen_nb_int;n_size++) {
30037     for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) {
30038     for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
30039     for (n_options = 0;n_options < gen_nb_parseroptions;n_options++) {
30040         mem_base = xmlMemBlocks();
30041         reader = gen_xmlTextReaderPtr(n_reader, 0);
30042         buffer = gen_const_char_ptr(n_buffer, 1);
30043         size = gen_int(n_size, 2);
30044         URL = gen_filepath(n_URL, 3);
30045         encoding = gen_const_char_ptr(n_encoding, 4);
30046         options = gen_parseroptions(n_options, 5);
30047         if ((buffer != NULL) &&
30048             (size > xmlStrlen(BAD_CAST buffer)))
30049             size = 0;
30050 
30051         ret_val = xmlReaderNewMemory(reader, buffer, size, URL, encoding, options);
30052         desret_int(ret_val);
30053         call_tests++;
30054         des_xmlTextReaderPtr(n_reader, reader, 0);
30055         des_const_char_ptr(n_buffer, buffer, 1);
30056         des_int(n_size, size, 2);
30057         des_filepath(n_URL, URL, 3);
30058         des_const_char_ptr(n_encoding, encoding, 4);
30059         des_parseroptions(n_options, options, 5);
30060         xmlResetLastError();
30061         if (mem_base != xmlMemBlocks()) {
30062             printf("Leak of %d blocks found in xmlReaderNewMemory",
30063 	           xmlMemBlocks() - mem_base);
30064 	    test_ret++;
30065             printf(" %d", n_reader);
30066             printf(" %d", n_buffer);
30067             printf(" %d", n_size);
30068             printf(" %d", n_URL);
30069             printf(" %d", n_encoding);
30070             printf(" %d", n_options);
30071             printf("\n");
30072         }
30073     }
30074     }
30075     }
30076     }
30077     }
30078     }
30079     function_tests++;
30080 #endif
30081 
30082     return(test_ret);
30083 }
30084 
30085 
30086 static int
test_xmlReaderNewWalker(void)30087 test_xmlReaderNewWalker(void) {
30088     int test_ret = 0;
30089 
30090 #if defined(LIBXML_READER_ENABLED)
30091     int mem_base;
30092     int ret_val;
30093     xmlTextReaderPtr reader; /* an XML reader */
30094     int n_reader;
30095     xmlDocPtr doc; /* a preparsed document */
30096     int n_doc;
30097 
30098     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
30099     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
30100         mem_base = xmlMemBlocks();
30101         reader = gen_xmlTextReaderPtr(n_reader, 0);
30102         doc = gen_xmlDocPtr(n_doc, 1);
30103 
30104         ret_val = xmlReaderNewWalker(reader, doc);
30105         desret_int(ret_val);
30106         call_tests++;
30107         des_xmlTextReaderPtr(n_reader, reader, 0);
30108         des_xmlDocPtr(n_doc, doc, 1);
30109         xmlResetLastError();
30110         if (mem_base != xmlMemBlocks()) {
30111             printf("Leak of %d blocks found in xmlReaderNewWalker",
30112 	           xmlMemBlocks() - mem_base);
30113 	    test_ret++;
30114             printf(" %d", n_reader);
30115             printf(" %d", n_doc);
30116             printf("\n");
30117         }
30118     }
30119     }
30120     function_tests++;
30121 #endif
30122 
30123     return(test_ret);
30124 }
30125 
30126 
30127 static int
test_xmlReaderWalker(void)30128 test_xmlReaderWalker(void) {
30129     int test_ret = 0;
30130 
30131 #if defined(LIBXML_READER_ENABLED)
30132     int mem_base;
30133     xmlTextReaderPtr ret_val;
30134     xmlDocPtr doc; /* a preparsed document */
30135     int n_doc;
30136 
30137     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
30138         mem_base = xmlMemBlocks();
30139         doc = gen_xmlDocPtr(n_doc, 0);
30140 
30141         ret_val = xmlReaderWalker(doc);
30142         desret_xmlTextReaderPtr(ret_val);
30143         call_tests++;
30144         des_xmlDocPtr(n_doc, doc, 0);
30145         xmlResetLastError();
30146         if (mem_base != xmlMemBlocks()) {
30147             printf("Leak of %d blocks found in xmlReaderWalker",
30148 	           xmlMemBlocks() - mem_base);
30149 	    test_ret++;
30150             printf(" %d", n_doc);
30151             printf("\n");
30152         }
30153     }
30154     function_tests++;
30155 #endif
30156 
30157     return(test_ret);
30158 }
30159 
30160 
30161 static int
test_xmlTextReaderAttributeCount(void)30162 test_xmlTextReaderAttributeCount(void) {
30163     int test_ret = 0;
30164 
30165 #if defined(LIBXML_READER_ENABLED)
30166     int mem_base;
30167     int ret_val;
30168     xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
30169     int n_reader;
30170 
30171     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
30172         mem_base = xmlMemBlocks();
30173         reader = gen_xmlTextReaderPtr(n_reader, 0);
30174 
30175         ret_val = xmlTextReaderAttributeCount(reader);
30176         desret_int(ret_val);
30177         call_tests++;
30178         des_xmlTextReaderPtr(n_reader, reader, 0);
30179         xmlResetLastError();
30180         if (mem_base != xmlMemBlocks()) {
30181             printf("Leak of %d blocks found in xmlTextReaderAttributeCount",
30182 	           xmlMemBlocks() - mem_base);
30183 	    test_ret++;
30184             printf(" %d", n_reader);
30185             printf("\n");
30186         }
30187     }
30188     function_tests++;
30189 #endif
30190 
30191     return(test_ret);
30192 }
30193 
30194 
30195 static int
test_xmlTextReaderBaseUri(void)30196 test_xmlTextReaderBaseUri(void) {
30197     int test_ret = 0;
30198 
30199 #if defined(LIBXML_READER_ENABLED)
30200     int mem_base;
30201     xmlChar * ret_val;
30202     xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
30203     int n_reader;
30204 
30205     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
30206         mem_base = xmlMemBlocks();
30207         reader = gen_xmlTextReaderPtr(n_reader, 0);
30208 
30209         ret_val = xmlTextReaderBaseUri(reader);
30210         desret_xmlChar_ptr(ret_val);
30211         call_tests++;
30212         des_xmlTextReaderPtr(n_reader, reader, 0);
30213         xmlResetLastError();
30214         if (mem_base != xmlMemBlocks()) {
30215             printf("Leak of %d blocks found in xmlTextReaderBaseUri",
30216 	           xmlMemBlocks() - mem_base);
30217 	    test_ret++;
30218             printf(" %d", n_reader);
30219             printf("\n");
30220         }
30221     }
30222     function_tests++;
30223 #endif
30224 
30225     return(test_ret);
30226 }
30227 
30228 
30229 static int
test_xmlTextReaderByteConsumed(void)30230 test_xmlTextReaderByteConsumed(void) {
30231     int test_ret = 0;
30232 
30233 #if defined(LIBXML_READER_ENABLED)
30234     int mem_base;
30235     long ret_val;
30236     xmlTextReaderPtr reader; /* an XML reader */
30237     int n_reader;
30238 
30239     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
30240         mem_base = xmlMemBlocks();
30241         reader = gen_xmlTextReaderPtr(n_reader, 0);
30242 
30243         ret_val = xmlTextReaderByteConsumed(reader);
30244         desret_long(ret_val);
30245         call_tests++;
30246         des_xmlTextReaderPtr(n_reader, reader, 0);
30247         xmlResetLastError();
30248         if (mem_base != xmlMemBlocks()) {
30249             printf("Leak of %d blocks found in xmlTextReaderByteConsumed",
30250 	           xmlMemBlocks() - mem_base);
30251 	    test_ret++;
30252             printf(" %d", n_reader);
30253             printf("\n");
30254         }
30255     }
30256     function_tests++;
30257 #endif
30258 
30259     return(test_ret);
30260 }
30261 
30262 
30263 static int
test_xmlTextReaderClose(void)30264 test_xmlTextReaderClose(void) {
30265     int test_ret = 0;
30266 
30267 #if defined(LIBXML_READER_ENABLED)
30268     int mem_base;
30269     int ret_val;
30270     xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
30271     int n_reader;
30272 
30273     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
30274         mem_base = xmlMemBlocks();
30275         reader = gen_xmlTextReaderPtr(n_reader, 0);
30276 
30277         ret_val = xmlTextReaderClose(reader);
30278         desret_int(ret_val);
30279         call_tests++;
30280         des_xmlTextReaderPtr(n_reader, reader, 0);
30281         xmlResetLastError();
30282         if (mem_base != xmlMemBlocks()) {
30283             printf("Leak of %d blocks found in xmlTextReaderClose",
30284 	           xmlMemBlocks() - mem_base);
30285 	    test_ret++;
30286             printf(" %d", n_reader);
30287             printf("\n");
30288         }
30289     }
30290     function_tests++;
30291 #endif
30292 
30293     return(test_ret);
30294 }
30295 
30296 
30297 static int
test_xmlTextReaderConstBaseUri(void)30298 test_xmlTextReaderConstBaseUri(void) {
30299     int test_ret = 0;
30300 
30301 #if defined(LIBXML_READER_ENABLED)
30302     int mem_base;
30303     const xmlChar * ret_val;
30304     xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
30305     int n_reader;
30306 
30307     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
30308         mem_base = xmlMemBlocks();
30309         reader = gen_xmlTextReaderPtr(n_reader, 0);
30310 
30311         ret_val = xmlTextReaderConstBaseUri(reader);
30312         desret_const_xmlChar_ptr(ret_val);
30313         call_tests++;
30314         des_xmlTextReaderPtr(n_reader, reader, 0);
30315         xmlResetLastError();
30316         if (mem_base != xmlMemBlocks()) {
30317             printf("Leak of %d blocks found in xmlTextReaderConstBaseUri",
30318 	           xmlMemBlocks() - mem_base);
30319 	    test_ret++;
30320             printf(" %d", n_reader);
30321             printf("\n");
30322         }
30323     }
30324     function_tests++;
30325 #endif
30326 
30327     return(test_ret);
30328 }
30329 
30330 
30331 static int
test_xmlTextReaderConstEncoding(void)30332 test_xmlTextReaderConstEncoding(void) {
30333     int test_ret = 0;
30334 
30335 #if defined(LIBXML_READER_ENABLED)
30336     int mem_base;
30337     const xmlChar * ret_val;
30338     xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
30339     int n_reader;
30340 
30341     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
30342         mem_base = xmlMemBlocks();
30343         reader = gen_xmlTextReaderPtr(n_reader, 0);
30344 
30345         ret_val = xmlTextReaderConstEncoding(reader);
30346         desret_const_xmlChar_ptr(ret_val);
30347         call_tests++;
30348         des_xmlTextReaderPtr(n_reader, reader, 0);
30349         xmlResetLastError();
30350         if (mem_base != xmlMemBlocks()) {
30351             printf("Leak of %d blocks found in xmlTextReaderConstEncoding",
30352 	           xmlMemBlocks() - mem_base);
30353 	    test_ret++;
30354             printf(" %d", n_reader);
30355             printf("\n");
30356         }
30357     }
30358     function_tests++;
30359 #endif
30360 
30361     return(test_ret);
30362 }
30363 
30364 
30365 static int
test_xmlTextReaderConstLocalName(void)30366 test_xmlTextReaderConstLocalName(void) {
30367     int test_ret = 0;
30368 
30369 #if defined(LIBXML_READER_ENABLED)
30370     int mem_base;
30371     const xmlChar * ret_val;
30372     xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
30373     int n_reader;
30374 
30375     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
30376         mem_base = xmlMemBlocks();
30377         reader = gen_xmlTextReaderPtr(n_reader, 0);
30378 
30379         ret_val = xmlTextReaderConstLocalName(reader);
30380         desret_const_xmlChar_ptr(ret_val);
30381         call_tests++;
30382         des_xmlTextReaderPtr(n_reader, reader, 0);
30383         xmlResetLastError();
30384         if (mem_base != xmlMemBlocks()) {
30385             printf("Leak of %d blocks found in xmlTextReaderConstLocalName",
30386 	           xmlMemBlocks() - mem_base);
30387 	    test_ret++;
30388             printf(" %d", n_reader);
30389             printf("\n");
30390         }
30391     }
30392     function_tests++;
30393 #endif
30394 
30395     return(test_ret);
30396 }
30397 
30398 
30399 static int
test_xmlTextReaderConstName(void)30400 test_xmlTextReaderConstName(void) {
30401     int test_ret = 0;
30402 
30403 #if defined(LIBXML_READER_ENABLED)
30404     int mem_base;
30405     const xmlChar * ret_val;
30406     xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
30407     int n_reader;
30408 
30409     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
30410         mem_base = xmlMemBlocks();
30411         reader = gen_xmlTextReaderPtr(n_reader, 0);
30412 
30413         ret_val = xmlTextReaderConstName(reader);
30414         desret_const_xmlChar_ptr(ret_val);
30415         call_tests++;
30416         des_xmlTextReaderPtr(n_reader, reader, 0);
30417         xmlResetLastError();
30418         if (mem_base != xmlMemBlocks()) {
30419             printf("Leak of %d blocks found in xmlTextReaderConstName",
30420 	           xmlMemBlocks() - mem_base);
30421 	    test_ret++;
30422             printf(" %d", n_reader);
30423             printf("\n");
30424         }
30425     }
30426     function_tests++;
30427 #endif
30428 
30429     return(test_ret);
30430 }
30431 
30432 
30433 static int
test_xmlTextReaderConstNamespaceUri(void)30434 test_xmlTextReaderConstNamespaceUri(void) {
30435     int test_ret = 0;
30436 
30437 #if defined(LIBXML_READER_ENABLED)
30438     int mem_base;
30439     const xmlChar * ret_val;
30440     xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
30441     int n_reader;
30442 
30443     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
30444         mem_base = xmlMemBlocks();
30445         reader = gen_xmlTextReaderPtr(n_reader, 0);
30446 
30447         ret_val = xmlTextReaderConstNamespaceUri(reader);
30448         desret_const_xmlChar_ptr(ret_val);
30449         call_tests++;
30450         des_xmlTextReaderPtr(n_reader, reader, 0);
30451         xmlResetLastError();
30452         if (mem_base != xmlMemBlocks()) {
30453             printf("Leak of %d blocks found in xmlTextReaderConstNamespaceUri",
30454 	           xmlMemBlocks() - mem_base);
30455 	    test_ret++;
30456             printf(" %d", n_reader);
30457             printf("\n");
30458         }
30459     }
30460     function_tests++;
30461 #endif
30462 
30463     return(test_ret);
30464 }
30465 
30466 
30467 static int
test_xmlTextReaderConstPrefix(void)30468 test_xmlTextReaderConstPrefix(void) {
30469     int test_ret = 0;
30470 
30471 #if defined(LIBXML_READER_ENABLED)
30472     int mem_base;
30473     const xmlChar * ret_val;
30474     xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
30475     int n_reader;
30476 
30477     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
30478         mem_base = xmlMemBlocks();
30479         reader = gen_xmlTextReaderPtr(n_reader, 0);
30480 
30481         ret_val = xmlTextReaderConstPrefix(reader);
30482         desret_const_xmlChar_ptr(ret_val);
30483         call_tests++;
30484         des_xmlTextReaderPtr(n_reader, reader, 0);
30485         xmlResetLastError();
30486         if (mem_base != xmlMemBlocks()) {
30487             printf("Leak of %d blocks found in xmlTextReaderConstPrefix",
30488 	           xmlMemBlocks() - mem_base);
30489 	    test_ret++;
30490             printf(" %d", n_reader);
30491             printf("\n");
30492         }
30493     }
30494     function_tests++;
30495 #endif
30496 
30497     return(test_ret);
30498 }
30499 
30500 
30501 static int
test_xmlTextReaderConstString(void)30502 test_xmlTextReaderConstString(void) {
30503     int test_ret = 0;
30504 
30505 #if defined(LIBXML_READER_ENABLED)
30506     int mem_base;
30507     const xmlChar * ret_val;
30508     xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
30509     int n_reader;
30510     const xmlChar * str; /* the string to intern. */
30511     int n_str;
30512 
30513     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
30514     for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) {
30515         mem_base = xmlMemBlocks();
30516         reader = gen_xmlTextReaderPtr(n_reader, 0);
30517         str = gen_const_xmlChar_ptr(n_str, 1);
30518 
30519         ret_val = xmlTextReaderConstString(reader, str);
30520         desret_const_xmlChar_ptr(ret_val);
30521         call_tests++;
30522         des_xmlTextReaderPtr(n_reader, reader, 0);
30523         des_const_xmlChar_ptr(n_str, str, 1);
30524         xmlResetLastError();
30525         if (mem_base != xmlMemBlocks()) {
30526             printf("Leak of %d blocks found in xmlTextReaderConstString",
30527 	           xmlMemBlocks() - mem_base);
30528 	    test_ret++;
30529             printf(" %d", n_reader);
30530             printf(" %d", n_str);
30531             printf("\n");
30532         }
30533     }
30534     }
30535     function_tests++;
30536 #endif
30537 
30538     return(test_ret);
30539 }
30540 
30541 
30542 static int
test_xmlTextReaderConstValue(void)30543 test_xmlTextReaderConstValue(void) {
30544     int test_ret = 0;
30545 
30546 #if defined(LIBXML_READER_ENABLED)
30547     int mem_base;
30548     const xmlChar * ret_val;
30549     xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
30550     int n_reader;
30551 
30552     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
30553         mem_base = xmlMemBlocks();
30554         reader = gen_xmlTextReaderPtr(n_reader, 0);
30555 
30556         ret_val = xmlTextReaderConstValue(reader);
30557         desret_const_xmlChar_ptr(ret_val);
30558         call_tests++;
30559         des_xmlTextReaderPtr(n_reader, reader, 0);
30560         xmlResetLastError();
30561         if (mem_base != xmlMemBlocks()) {
30562             printf("Leak of %d blocks found in xmlTextReaderConstValue",
30563 	           xmlMemBlocks() - mem_base);
30564 	    test_ret++;
30565             printf(" %d", n_reader);
30566             printf("\n");
30567         }
30568     }
30569     function_tests++;
30570 #endif
30571 
30572     return(test_ret);
30573 }
30574 
30575 
30576 static int
test_xmlTextReaderConstXmlLang(void)30577 test_xmlTextReaderConstXmlLang(void) {
30578     int test_ret = 0;
30579 
30580 #if defined(LIBXML_READER_ENABLED)
30581     int mem_base;
30582     const xmlChar * ret_val;
30583     xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
30584     int n_reader;
30585 
30586     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
30587         mem_base = xmlMemBlocks();
30588         reader = gen_xmlTextReaderPtr(n_reader, 0);
30589 
30590         ret_val = xmlTextReaderConstXmlLang(reader);
30591         desret_const_xmlChar_ptr(ret_val);
30592         call_tests++;
30593         des_xmlTextReaderPtr(n_reader, reader, 0);
30594         xmlResetLastError();
30595         if (mem_base != xmlMemBlocks()) {
30596             printf("Leak of %d blocks found in xmlTextReaderConstXmlLang",
30597 	           xmlMemBlocks() - mem_base);
30598 	    test_ret++;
30599             printf(" %d", n_reader);
30600             printf("\n");
30601         }
30602     }
30603     function_tests++;
30604 #endif
30605 
30606     return(test_ret);
30607 }
30608 
30609 
30610 static int
test_xmlTextReaderConstXmlVersion(void)30611 test_xmlTextReaderConstXmlVersion(void) {
30612     int test_ret = 0;
30613 
30614 #if defined(LIBXML_READER_ENABLED)
30615     int mem_base;
30616     const xmlChar * ret_val;
30617     xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
30618     int n_reader;
30619 
30620     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
30621         mem_base = xmlMemBlocks();
30622         reader = gen_xmlTextReaderPtr(n_reader, 0);
30623 
30624         ret_val = xmlTextReaderConstXmlVersion(reader);
30625         desret_const_xmlChar_ptr(ret_val);
30626         call_tests++;
30627         des_xmlTextReaderPtr(n_reader, reader, 0);
30628         xmlResetLastError();
30629         if (mem_base != xmlMemBlocks()) {
30630             printf("Leak of %d blocks found in xmlTextReaderConstXmlVersion",
30631 	           xmlMemBlocks() - mem_base);
30632 	    test_ret++;
30633             printf(" %d", n_reader);
30634             printf("\n");
30635         }
30636     }
30637     function_tests++;
30638 #endif
30639 
30640     return(test_ret);
30641 }
30642 
30643 
30644 static int
test_xmlTextReaderCurrentDoc(void)30645 test_xmlTextReaderCurrentDoc(void) {
30646     int test_ret = 0;
30647 
30648 #if defined(LIBXML_READER_ENABLED)
30649     int mem_base;
30650     xmlDocPtr ret_val;
30651     xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
30652     int n_reader;
30653 
30654     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
30655         mem_base = xmlMemBlocks();
30656         reader = gen_xmlTextReaderPtr(n_reader, 0);
30657 
30658         ret_val = xmlTextReaderCurrentDoc(reader);
30659         desret_xmlDocPtr(ret_val);
30660         call_tests++;
30661         des_xmlTextReaderPtr(n_reader, reader, 0);
30662         xmlResetLastError();
30663         if (mem_base != xmlMemBlocks()) {
30664             printf("Leak of %d blocks found in xmlTextReaderCurrentDoc",
30665 	           xmlMemBlocks() - mem_base);
30666 	    test_ret++;
30667             printf(" %d", n_reader);
30668             printf("\n");
30669         }
30670     }
30671     function_tests++;
30672 #endif
30673 
30674     return(test_ret);
30675 }
30676 
30677 
30678 static int
test_xmlTextReaderCurrentNode(void)30679 test_xmlTextReaderCurrentNode(void) {
30680     int test_ret = 0;
30681 
30682 #if defined(LIBXML_READER_ENABLED)
30683     int mem_base;
30684     xmlNodePtr ret_val;
30685     xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
30686     int n_reader;
30687 
30688     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
30689         mem_base = xmlMemBlocks();
30690         reader = gen_xmlTextReaderPtr(n_reader, 0);
30691 
30692         ret_val = xmlTextReaderCurrentNode(reader);
30693         desret_xmlNodePtr(ret_val);
30694         call_tests++;
30695         des_xmlTextReaderPtr(n_reader, reader, 0);
30696         xmlResetLastError();
30697         if (mem_base != xmlMemBlocks()) {
30698             printf("Leak of %d blocks found in xmlTextReaderCurrentNode",
30699 	           xmlMemBlocks() - mem_base);
30700 	    test_ret++;
30701             printf(" %d", n_reader);
30702             printf("\n");
30703         }
30704     }
30705     function_tests++;
30706 #endif
30707 
30708     return(test_ret);
30709 }
30710 
30711 
30712 static int
test_xmlTextReaderDepth(void)30713 test_xmlTextReaderDepth(void) {
30714     int test_ret = 0;
30715 
30716 #if defined(LIBXML_READER_ENABLED)
30717     int mem_base;
30718     int ret_val;
30719     xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
30720     int n_reader;
30721 
30722     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
30723         mem_base = xmlMemBlocks();
30724         reader = gen_xmlTextReaderPtr(n_reader, 0);
30725 
30726         ret_val = xmlTextReaderDepth(reader);
30727         desret_int(ret_val);
30728         call_tests++;
30729         des_xmlTextReaderPtr(n_reader, reader, 0);
30730         xmlResetLastError();
30731         if (mem_base != xmlMemBlocks()) {
30732             printf("Leak of %d blocks found in xmlTextReaderDepth",
30733 	           xmlMemBlocks() - mem_base);
30734 	    test_ret++;
30735             printf(" %d", n_reader);
30736             printf("\n");
30737         }
30738     }
30739     function_tests++;
30740 #endif
30741 
30742     return(test_ret);
30743 }
30744 
30745 
30746 static int
test_xmlTextReaderExpand(void)30747 test_xmlTextReaderExpand(void) {
30748     int test_ret = 0;
30749 
30750 #if defined(LIBXML_READER_ENABLED)
30751     int mem_base;
30752     xmlNodePtr ret_val;
30753     xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
30754     int n_reader;
30755 
30756     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
30757         mem_base = xmlMemBlocks();
30758         reader = gen_xmlTextReaderPtr(n_reader, 0);
30759 
30760         ret_val = xmlTextReaderExpand(reader);
30761         desret_xmlNodePtr(ret_val);
30762         call_tests++;
30763         des_xmlTextReaderPtr(n_reader, reader, 0);
30764         xmlResetLastError();
30765         if (mem_base != xmlMemBlocks()) {
30766             printf("Leak of %d blocks found in xmlTextReaderExpand",
30767 	           xmlMemBlocks() - mem_base);
30768 	    test_ret++;
30769             printf(" %d", n_reader);
30770             printf("\n");
30771         }
30772     }
30773     function_tests++;
30774 #endif
30775 
30776     return(test_ret);
30777 }
30778 
30779 
30780 static int
test_xmlTextReaderGetAttribute(void)30781 test_xmlTextReaderGetAttribute(void) {
30782     int test_ret = 0;
30783 
30784 #if defined(LIBXML_READER_ENABLED)
30785     int mem_base;
30786     xmlChar * ret_val;
30787     xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
30788     int n_reader;
30789     const xmlChar * name; /* the qualified name of the attribute. */
30790     int n_name;
30791 
30792     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
30793     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
30794         mem_base = xmlMemBlocks();
30795         reader = gen_xmlTextReaderPtr(n_reader, 0);
30796         name = gen_const_xmlChar_ptr(n_name, 1);
30797 
30798         ret_val = xmlTextReaderGetAttribute(reader, name);
30799         desret_xmlChar_ptr(ret_val);
30800         call_tests++;
30801         des_xmlTextReaderPtr(n_reader, reader, 0);
30802         des_const_xmlChar_ptr(n_name, name, 1);
30803         xmlResetLastError();
30804         if (mem_base != xmlMemBlocks()) {
30805             printf("Leak of %d blocks found in xmlTextReaderGetAttribute",
30806 	           xmlMemBlocks() - mem_base);
30807 	    test_ret++;
30808             printf(" %d", n_reader);
30809             printf(" %d", n_name);
30810             printf("\n");
30811         }
30812     }
30813     }
30814     function_tests++;
30815 #endif
30816 
30817     return(test_ret);
30818 }
30819 
30820 
30821 static int
test_xmlTextReaderGetAttributeNo(void)30822 test_xmlTextReaderGetAttributeNo(void) {
30823     int test_ret = 0;
30824 
30825 #if defined(LIBXML_READER_ENABLED)
30826     int mem_base;
30827     xmlChar * ret_val;
30828     xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
30829     int n_reader;
30830     int no; /* the zero-based index of the attribute relative to the containing element */
30831     int n_no;
30832 
30833     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
30834     for (n_no = 0;n_no < gen_nb_int;n_no++) {
30835         mem_base = xmlMemBlocks();
30836         reader = gen_xmlTextReaderPtr(n_reader, 0);
30837         no = gen_int(n_no, 1);
30838 
30839         ret_val = xmlTextReaderGetAttributeNo(reader, no);
30840         desret_xmlChar_ptr(ret_val);
30841         call_tests++;
30842         des_xmlTextReaderPtr(n_reader, reader, 0);
30843         des_int(n_no, no, 1);
30844         xmlResetLastError();
30845         if (mem_base != xmlMemBlocks()) {
30846             printf("Leak of %d blocks found in xmlTextReaderGetAttributeNo",
30847 	           xmlMemBlocks() - mem_base);
30848 	    test_ret++;
30849             printf(" %d", n_reader);
30850             printf(" %d", n_no);
30851             printf("\n");
30852         }
30853     }
30854     }
30855     function_tests++;
30856 #endif
30857 
30858     return(test_ret);
30859 }
30860 
30861 
30862 static int
test_xmlTextReaderGetAttributeNs(void)30863 test_xmlTextReaderGetAttributeNs(void) {
30864     int test_ret = 0;
30865 
30866 #if defined(LIBXML_READER_ENABLED)
30867     int mem_base;
30868     xmlChar * ret_val;
30869     xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
30870     int n_reader;
30871     const xmlChar * localName; /* the local name of the attribute. */
30872     int n_localName;
30873     const xmlChar * namespaceURI; /* the namespace URI of the attribute. */
30874     int n_namespaceURI;
30875 
30876     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
30877     for (n_localName = 0;n_localName < gen_nb_const_xmlChar_ptr;n_localName++) {
30878     for (n_namespaceURI = 0;n_namespaceURI < gen_nb_const_xmlChar_ptr;n_namespaceURI++) {
30879         mem_base = xmlMemBlocks();
30880         reader = gen_xmlTextReaderPtr(n_reader, 0);
30881         localName = gen_const_xmlChar_ptr(n_localName, 1);
30882         namespaceURI = gen_const_xmlChar_ptr(n_namespaceURI, 2);
30883 
30884         ret_val = xmlTextReaderGetAttributeNs(reader, localName, namespaceURI);
30885         desret_xmlChar_ptr(ret_val);
30886         call_tests++;
30887         des_xmlTextReaderPtr(n_reader, reader, 0);
30888         des_const_xmlChar_ptr(n_localName, localName, 1);
30889         des_const_xmlChar_ptr(n_namespaceURI, namespaceURI, 2);
30890         xmlResetLastError();
30891         if (mem_base != xmlMemBlocks()) {
30892             printf("Leak of %d blocks found in xmlTextReaderGetAttributeNs",
30893 	           xmlMemBlocks() - mem_base);
30894 	    test_ret++;
30895             printf(" %d", n_reader);
30896             printf(" %d", n_localName);
30897             printf(" %d", n_namespaceURI);
30898             printf("\n");
30899         }
30900     }
30901     }
30902     }
30903     function_tests++;
30904 #endif
30905 
30906     return(test_ret);
30907 }
30908 
30909 #ifdef LIBXML_READER_ENABLED
30910 
30911 #define gen_nb_xmlTextReaderErrorFunc_ptr 1
30912 #define gen_xmlTextReaderErrorFunc_ptr(no, nr) NULL
30913 #define des_xmlTextReaderErrorFunc_ptr(no, val, nr)
30914 #endif
30915 
30916 
30917 static int
test_xmlTextReaderGetErrorHandler(void)30918 test_xmlTextReaderGetErrorHandler(void) {
30919     int test_ret = 0;
30920 
30921 #if defined(LIBXML_READER_ENABLED)
30922     int mem_base;
30923     xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
30924     int n_reader;
30925     xmlTextReaderErrorFunc * f; /* the callback function or NULL is no callback has been registered */
30926     int n_f;
30927     void ** arg; /* a user argument */
30928     int n_arg;
30929 
30930     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
30931     for (n_f = 0;n_f < gen_nb_xmlTextReaderErrorFunc_ptr;n_f++) {
30932     for (n_arg = 0;n_arg < gen_nb_void_ptr_ptr;n_arg++) {
30933         mem_base = xmlMemBlocks();
30934         reader = gen_xmlTextReaderPtr(n_reader, 0);
30935         f = gen_xmlTextReaderErrorFunc_ptr(n_f, 1);
30936         arg = gen_void_ptr_ptr(n_arg, 2);
30937 
30938         xmlTextReaderGetErrorHandler(reader, f, arg);
30939         call_tests++;
30940         des_xmlTextReaderPtr(n_reader, reader, 0);
30941         des_xmlTextReaderErrorFunc_ptr(n_f, f, 1);
30942         des_void_ptr_ptr(n_arg, arg, 2);
30943         xmlResetLastError();
30944         if (mem_base != xmlMemBlocks()) {
30945             printf("Leak of %d blocks found in xmlTextReaderGetErrorHandler",
30946 	           xmlMemBlocks() - mem_base);
30947 	    test_ret++;
30948             printf(" %d", n_reader);
30949             printf(" %d", n_f);
30950             printf(" %d", n_arg);
30951             printf("\n");
30952         }
30953     }
30954     }
30955     }
30956     function_tests++;
30957 #endif
30958 
30959     return(test_ret);
30960 }
30961 
30962 
30963 static int
test_xmlTextReaderGetParserColumnNumber(void)30964 test_xmlTextReaderGetParserColumnNumber(void) {
30965     int test_ret = 0;
30966 
30967 #if defined(LIBXML_READER_ENABLED)
30968     int mem_base;
30969     int ret_val;
30970     xmlTextReaderPtr reader; /* the user data (XML reader context) */
30971     int n_reader;
30972 
30973     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
30974         mem_base = xmlMemBlocks();
30975         reader = gen_xmlTextReaderPtr(n_reader, 0);
30976 
30977         ret_val = xmlTextReaderGetParserColumnNumber(reader);
30978         desret_int(ret_val);
30979         call_tests++;
30980         des_xmlTextReaderPtr(n_reader, reader, 0);
30981         xmlResetLastError();
30982         if (mem_base != xmlMemBlocks()) {
30983             printf("Leak of %d blocks found in xmlTextReaderGetParserColumnNumber",
30984 	           xmlMemBlocks() - mem_base);
30985 	    test_ret++;
30986             printf(" %d", n_reader);
30987             printf("\n");
30988         }
30989     }
30990     function_tests++;
30991 #endif
30992 
30993     return(test_ret);
30994 }
30995 
30996 
30997 static int
test_xmlTextReaderGetParserLineNumber(void)30998 test_xmlTextReaderGetParserLineNumber(void) {
30999     int test_ret = 0;
31000 
31001 #if defined(LIBXML_READER_ENABLED)
31002     int mem_base;
31003     int ret_val;
31004     xmlTextReaderPtr reader; /* the user data (XML reader context) */
31005     int n_reader;
31006 
31007     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
31008         mem_base = xmlMemBlocks();
31009         reader = gen_xmlTextReaderPtr(n_reader, 0);
31010 
31011         ret_val = xmlTextReaderGetParserLineNumber(reader);
31012         desret_int(ret_val);
31013         call_tests++;
31014         des_xmlTextReaderPtr(n_reader, reader, 0);
31015         xmlResetLastError();
31016         if (mem_base != xmlMemBlocks()) {
31017             printf("Leak of %d blocks found in xmlTextReaderGetParserLineNumber",
31018 	           xmlMemBlocks() - mem_base);
31019 	    test_ret++;
31020             printf(" %d", n_reader);
31021             printf("\n");
31022         }
31023     }
31024     function_tests++;
31025 #endif
31026 
31027     return(test_ret);
31028 }
31029 
31030 
31031 static int
test_xmlTextReaderGetParserProp(void)31032 test_xmlTextReaderGetParserProp(void) {
31033     int test_ret = 0;
31034 
31035 #if defined(LIBXML_READER_ENABLED)
31036     int mem_base;
31037     int ret_val;
31038     xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
31039     int n_reader;
31040     int prop; /* the xmlParserProperties to get */
31041     int n_prop;
31042 
31043     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
31044     for (n_prop = 0;n_prop < gen_nb_int;n_prop++) {
31045         mem_base = xmlMemBlocks();
31046         reader = gen_xmlTextReaderPtr(n_reader, 0);
31047         prop = gen_int(n_prop, 1);
31048 
31049         ret_val = xmlTextReaderGetParserProp(reader, prop);
31050         desret_int(ret_val);
31051         call_tests++;
31052         des_xmlTextReaderPtr(n_reader, reader, 0);
31053         des_int(n_prop, prop, 1);
31054         xmlResetLastError();
31055         if (mem_base != xmlMemBlocks()) {
31056             printf("Leak of %d blocks found in xmlTextReaderGetParserProp",
31057 	           xmlMemBlocks() - mem_base);
31058 	    test_ret++;
31059             printf(" %d", n_reader);
31060             printf(" %d", n_prop);
31061             printf("\n");
31062         }
31063     }
31064     }
31065     function_tests++;
31066 #endif
31067 
31068     return(test_ret);
31069 }
31070 
31071 
31072 static int
test_xmlTextReaderGetRemainder(void)31073 test_xmlTextReaderGetRemainder(void) {
31074     int test_ret = 0;
31075 
31076 #if defined(LIBXML_READER_ENABLED)
31077     int mem_base;
31078     xmlParserInputBufferPtr ret_val;
31079     xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
31080     int n_reader;
31081 
31082     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
31083         mem_base = xmlMemBlocks();
31084         reader = gen_xmlTextReaderPtr(n_reader, 0);
31085 
31086         ret_val = xmlTextReaderGetRemainder(reader);
31087         desret_xmlParserInputBufferPtr(ret_val);
31088         call_tests++;
31089         des_xmlTextReaderPtr(n_reader, reader, 0);
31090         xmlResetLastError();
31091         if (mem_base != xmlMemBlocks()) {
31092             printf("Leak of %d blocks found in xmlTextReaderGetRemainder",
31093 	           xmlMemBlocks() - mem_base);
31094 	    test_ret++;
31095             printf(" %d", n_reader);
31096             printf("\n");
31097         }
31098     }
31099     function_tests++;
31100 #endif
31101 
31102     return(test_ret);
31103 }
31104 
31105 
31106 static int
test_xmlTextReaderHasAttributes(void)31107 test_xmlTextReaderHasAttributes(void) {
31108     int test_ret = 0;
31109 
31110 #if defined(LIBXML_READER_ENABLED)
31111     int mem_base;
31112     int ret_val;
31113     xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
31114     int n_reader;
31115 
31116     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
31117         mem_base = xmlMemBlocks();
31118         reader = gen_xmlTextReaderPtr(n_reader, 0);
31119 
31120         ret_val = xmlTextReaderHasAttributes(reader);
31121         desret_int(ret_val);
31122         call_tests++;
31123         des_xmlTextReaderPtr(n_reader, reader, 0);
31124         xmlResetLastError();
31125         if (mem_base != xmlMemBlocks()) {
31126             printf("Leak of %d blocks found in xmlTextReaderHasAttributes",
31127 	           xmlMemBlocks() - mem_base);
31128 	    test_ret++;
31129             printf(" %d", n_reader);
31130             printf("\n");
31131         }
31132     }
31133     function_tests++;
31134 #endif
31135 
31136     return(test_ret);
31137 }
31138 
31139 
31140 static int
test_xmlTextReaderHasValue(void)31141 test_xmlTextReaderHasValue(void) {
31142     int test_ret = 0;
31143 
31144 #if defined(LIBXML_READER_ENABLED)
31145     int mem_base;
31146     int ret_val;
31147     xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
31148     int n_reader;
31149 
31150     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
31151         mem_base = xmlMemBlocks();
31152         reader = gen_xmlTextReaderPtr(n_reader, 0);
31153 
31154         ret_val = xmlTextReaderHasValue(reader);
31155         desret_int(ret_val);
31156         call_tests++;
31157         des_xmlTextReaderPtr(n_reader, reader, 0);
31158         xmlResetLastError();
31159         if (mem_base != xmlMemBlocks()) {
31160             printf("Leak of %d blocks found in xmlTextReaderHasValue",
31161 	           xmlMemBlocks() - mem_base);
31162 	    test_ret++;
31163             printf(" %d", n_reader);
31164             printf("\n");
31165         }
31166     }
31167     function_tests++;
31168 #endif
31169 
31170     return(test_ret);
31171 }
31172 
31173 
31174 static int
test_xmlTextReaderIsDefault(void)31175 test_xmlTextReaderIsDefault(void) {
31176     int test_ret = 0;
31177 
31178 #if defined(LIBXML_READER_ENABLED)
31179     int mem_base;
31180     int ret_val;
31181     xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
31182     int n_reader;
31183 
31184     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
31185         mem_base = xmlMemBlocks();
31186         reader = gen_xmlTextReaderPtr(n_reader, 0);
31187 
31188         ret_val = xmlTextReaderIsDefault(reader);
31189         desret_int(ret_val);
31190         call_tests++;
31191         des_xmlTextReaderPtr(n_reader, reader, 0);
31192         xmlResetLastError();
31193         if (mem_base != xmlMemBlocks()) {
31194             printf("Leak of %d blocks found in xmlTextReaderIsDefault",
31195 	           xmlMemBlocks() - mem_base);
31196 	    test_ret++;
31197             printf(" %d", n_reader);
31198             printf("\n");
31199         }
31200     }
31201     function_tests++;
31202 #endif
31203 
31204     return(test_ret);
31205 }
31206 
31207 
31208 static int
test_xmlTextReaderIsEmptyElement(void)31209 test_xmlTextReaderIsEmptyElement(void) {
31210     int test_ret = 0;
31211 
31212 #if defined(LIBXML_READER_ENABLED)
31213     int mem_base;
31214     int ret_val;
31215     xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
31216     int n_reader;
31217 
31218     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
31219         mem_base = xmlMemBlocks();
31220         reader = gen_xmlTextReaderPtr(n_reader, 0);
31221 
31222         ret_val = xmlTextReaderIsEmptyElement(reader);
31223         desret_int(ret_val);
31224         call_tests++;
31225         des_xmlTextReaderPtr(n_reader, reader, 0);
31226         xmlResetLastError();
31227         if (mem_base != xmlMemBlocks()) {
31228             printf("Leak of %d blocks found in xmlTextReaderIsEmptyElement",
31229 	           xmlMemBlocks() - mem_base);
31230 	    test_ret++;
31231             printf(" %d", n_reader);
31232             printf("\n");
31233         }
31234     }
31235     function_tests++;
31236 #endif
31237 
31238     return(test_ret);
31239 }
31240 
31241 
31242 static int
test_xmlTextReaderIsNamespaceDecl(void)31243 test_xmlTextReaderIsNamespaceDecl(void) {
31244     int test_ret = 0;
31245 
31246 #if defined(LIBXML_READER_ENABLED)
31247     int mem_base;
31248     int ret_val;
31249     xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
31250     int n_reader;
31251 
31252     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
31253         mem_base = xmlMemBlocks();
31254         reader = gen_xmlTextReaderPtr(n_reader, 0);
31255 
31256         ret_val = xmlTextReaderIsNamespaceDecl(reader);
31257         desret_int(ret_val);
31258         call_tests++;
31259         des_xmlTextReaderPtr(n_reader, reader, 0);
31260         xmlResetLastError();
31261         if (mem_base != xmlMemBlocks()) {
31262             printf("Leak of %d blocks found in xmlTextReaderIsNamespaceDecl",
31263 	           xmlMemBlocks() - mem_base);
31264 	    test_ret++;
31265             printf(" %d", n_reader);
31266             printf("\n");
31267         }
31268     }
31269     function_tests++;
31270 #endif
31271 
31272     return(test_ret);
31273 }
31274 
31275 
31276 static int
test_xmlTextReaderIsValid(void)31277 test_xmlTextReaderIsValid(void) {
31278     int test_ret = 0;
31279 
31280 #if defined(LIBXML_READER_ENABLED)
31281     int mem_base;
31282     int ret_val;
31283     xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
31284     int n_reader;
31285 
31286     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
31287         mem_base = xmlMemBlocks();
31288         reader = gen_xmlTextReaderPtr(n_reader, 0);
31289 
31290         ret_val = xmlTextReaderIsValid(reader);
31291         desret_int(ret_val);
31292         call_tests++;
31293         des_xmlTextReaderPtr(n_reader, reader, 0);
31294         xmlResetLastError();
31295         if (mem_base != xmlMemBlocks()) {
31296             printf("Leak of %d blocks found in xmlTextReaderIsValid",
31297 	           xmlMemBlocks() - mem_base);
31298 	    test_ret++;
31299             printf(" %d", n_reader);
31300             printf("\n");
31301         }
31302     }
31303     function_tests++;
31304 #endif
31305 
31306     return(test_ret);
31307 }
31308 
31309 
31310 static int
test_xmlTextReaderLocalName(void)31311 test_xmlTextReaderLocalName(void) {
31312     int test_ret = 0;
31313 
31314 #if defined(LIBXML_READER_ENABLED)
31315     int mem_base;
31316     xmlChar * ret_val;
31317     xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
31318     int n_reader;
31319 
31320     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
31321         mem_base = xmlMemBlocks();
31322         reader = gen_xmlTextReaderPtr(n_reader, 0);
31323 
31324         ret_val = xmlTextReaderLocalName(reader);
31325         desret_xmlChar_ptr(ret_val);
31326         call_tests++;
31327         des_xmlTextReaderPtr(n_reader, reader, 0);
31328         xmlResetLastError();
31329         if (mem_base != xmlMemBlocks()) {
31330             printf("Leak of %d blocks found in xmlTextReaderLocalName",
31331 	           xmlMemBlocks() - mem_base);
31332 	    test_ret++;
31333             printf(" %d", n_reader);
31334             printf("\n");
31335         }
31336     }
31337     function_tests++;
31338 #endif
31339 
31340     return(test_ret);
31341 }
31342 
31343 #ifdef LIBXML_READER_ENABLED
31344 
31345 #define gen_nb_xmlTextReaderLocatorPtr 1
31346 #define gen_xmlTextReaderLocatorPtr(no, nr) NULL
31347 #define des_xmlTextReaderLocatorPtr(no, val, nr)
31348 #endif
31349 
31350 
31351 static int
test_xmlTextReaderLocatorBaseURI(void)31352 test_xmlTextReaderLocatorBaseURI(void) {
31353     int test_ret = 0;
31354 
31355 #if defined(LIBXML_READER_ENABLED)
31356     int mem_base;
31357     xmlChar * ret_val;
31358     xmlTextReaderLocatorPtr locator; /* the xmlTextReaderLocatorPtr used */
31359     int n_locator;
31360 
31361     for (n_locator = 0;n_locator < gen_nb_xmlTextReaderLocatorPtr;n_locator++) {
31362         mem_base = xmlMemBlocks();
31363         locator = gen_xmlTextReaderLocatorPtr(n_locator, 0);
31364 
31365         ret_val = xmlTextReaderLocatorBaseURI(locator);
31366         desret_xmlChar_ptr(ret_val);
31367         call_tests++;
31368         des_xmlTextReaderLocatorPtr(n_locator, locator, 0);
31369         xmlResetLastError();
31370         if (mem_base != xmlMemBlocks()) {
31371             printf("Leak of %d blocks found in xmlTextReaderLocatorBaseURI",
31372 	           xmlMemBlocks() - mem_base);
31373 	    test_ret++;
31374             printf(" %d", n_locator);
31375             printf("\n");
31376         }
31377     }
31378     function_tests++;
31379 #endif
31380 
31381     return(test_ret);
31382 }
31383 
31384 
31385 static int
test_xmlTextReaderLocatorLineNumber(void)31386 test_xmlTextReaderLocatorLineNumber(void) {
31387     int test_ret = 0;
31388 
31389 #if defined(LIBXML_READER_ENABLED)
31390     int mem_base;
31391     int ret_val;
31392     xmlTextReaderLocatorPtr locator; /* the xmlTextReaderLocatorPtr used */
31393     int n_locator;
31394 
31395     for (n_locator = 0;n_locator < gen_nb_xmlTextReaderLocatorPtr;n_locator++) {
31396         mem_base = xmlMemBlocks();
31397         locator = gen_xmlTextReaderLocatorPtr(n_locator, 0);
31398 
31399         ret_val = xmlTextReaderLocatorLineNumber(locator);
31400         desret_int(ret_val);
31401         call_tests++;
31402         des_xmlTextReaderLocatorPtr(n_locator, locator, 0);
31403         xmlResetLastError();
31404         if (mem_base != xmlMemBlocks()) {
31405             printf("Leak of %d blocks found in xmlTextReaderLocatorLineNumber",
31406 	           xmlMemBlocks() - mem_base);
31407 	    test_ret++;
31408             printf(" %d", n_locator);
31409             printf("\n");
31410         }
31411     }
31412     function_tests++;
31413 #endif
31414 
31415     return(test_ret);
31416 }
31417 
31418 
31419 static int
test_xmlTextReaderLookupNamespace(void)31420 test_xmlTextReaderLookupNamespace(void) {
31421     int test_ret = 0;
31422 
31423 #if defined(LIBXML_READER_ENABLED)
31424     int mem_base;
31425     xmlChar * ret_val;
31426     xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
31427     int n_reader;
31428     const xmlChar * prefix; /* the prefix whose namespace URI is to be resolved. To return the default namespace, specify NULL */
31429     int n_prefix;
31430 
31431     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
31432     for (n_prefix = 0;n_prefix < gen_nb_const_xmlChar_ptr;n_prefix++) {
31433         mem_base = xmlMemBlocks();
31434         reader = gen_xmlTextReaderPtr(n_reader, 0);
31435         prefix = gen_const_xmlChar_ptr(n_prefix, 1);
31436 
31437         ret_val = xmlTextReaderLookupNamespace(reader, prefix);
31438         desret_xmlChar_ptr(ret_val);
31439         call_tests++;
31440         des_xmlTextReaderPtr(n_reader, reader, 0);
31441         des_const_xmlChar_ptr(n_prefix, prefix, 1);
31442         xmlResetLastError();
31443         if (mem_base != xmlMemBlocks()) {
31444             printf("Leak of %d blocks found in xmlTextReaderLookupNamespace",
31445 	           xmlMemBlocks() - mem_base);
31446 	    test_ret++;
31447             printf(" %d", n_reader);
31448             printf(" %d", n_prefix);
31449             printf("\n");
31450         }
31451     }
31452     }
31453     function_tests++;
31454 #endif
31455 
31456     return(test_ret);
31457 }
31458 
31459 
31460 static int
test_xmlTextReaderMoveToAttribute(void)31461 test_xmlTextReaderMoveToAttribute(void) {
31462     int test_ret = 0;
31463 
31464 #if defined(LIBXML_READER_ENABLED)
31465     int mem_base;
31466     int ret_val;
31467     xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
31468     int n_reader;
31469     const xmlChar * name; /* the qualified name of the attribute. */
31470     int n_name;
31471 
31472     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
31473     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
31474         mem_base = xmlMemBlocks();
31475         reader = gen_xmlTextReaderPtr(n_reader, 0);
31476         name = gen_const_xmlChar_ptr(n_name, 1);
31477 
31478         ret_val = xmlTextReaderMoveToAttribute(reader, name);
31479         desret_int(ret_val);
31480         call_tests++;
31481         des_xmlTextReaderPtr(n_reader, reader, 0);
31482         des_const_xmlChar_ptr(n_name, name, 1);
31483         xmlResetLastError();
31484         if (mem_base != xmlMemBlocks()) {
31485             printf("Leak of %d blocks found in xmlTextReaderMoveToAttribute",
31486 	           xmlMemBlocks() - mem_base);
31487 	    test_ret++;
31488             printf(" %d", n_reader);
31489             printf(" %d", n_name);
31490             printf("\n");
31491         }
31492     }
31493     }
31494     function_tests++;
31495 #endif
31496 
31497     return(test_ret);
31498 }
31499 
31500 
31501 static int
test_xmlTextReaderMoveToAttributeNo(void)31502 test_xmlTextReaderMoveToAttributeNo(void) {
31503     int test_ret = 0;
31504 
31505 #if defined(LIBXML_READER_ENABLED)
31506     int mem_base;
31507     int ret_val;
31508     xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
31509     int n_reader;
31510     int no; /* the zero-based index of the attribute relative to the containing element. */
31511     int n_no;
31512 
31513     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
31514     for (n_no = 0;n_no < gen_nb_int;n_no++) {
31515         mem_base = xmlMemBlocks();
31516         reader = gen_xmlTextReaderPtr(n_reader, 0);
31517         no = gen_int(n_no, 1);
31518 
31519         ret_val = xmlTextReaderMoveToAttributeNo(reader, no);
31520         desret_int(ret_val);
31521         call_tests++;
31522         des_xmlTextReaderPtr(n_reader, reader, 0);
31523         des_int(n_no, no, 1);
31524         xmlResetLastError();
31525         if (mem_base != xmlMemBlocks()) {
31526             printf("Leak of %d blocks found in xmlTextReaderMoveToAttributeNo",
31527 	           xmlMemBlocks() - mem_base);
31528 	    test_ret++;
31529             printf(" %d", n_reader);
31530             printf(" %d", n_no);
31531             printf("\n");
31532         }
31533     }
31534     }
31535     function_tests++;
31536 #endif
31537 
31538     return(test_ret);
31539 }
31540 
31541 
31542 static int
test_xmlTextReaderMoveToAttributeNs(void)31543 test_xmlTextReaderMoveToAttributeNs(void) {
31544     int test_ret = 0;
31545 
31546 #if defined(LIBXML_READER_ENABLED)
31547     int mem_base;
31548     int ret_val;
31549     xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
31550     int n_reader;
31551     const xmlChar * localName; /* the local name of the attribute. */
31552     int n_localName;
31553     const xmlChar * namespaceURI; /* the namespace URI of the attribute. */
31554     int n_namespaceURI;
31555 
31556     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
31557     for (n_localName = 0;n_localName < gen_nb_const_xmlChar_ptr;n_localName++) {
31558     for (n_namespaceURI = 0;n_namespaceURI < gen_nb_const_xmlChar_ptr;n_namespaceURI++) {
31559         mem_base = xmlMemBlocks();
31560         reader = gen_xmlTextReaderPtr(n_reader, 0);
31561         localName = gen_const_xmlChar_ptr(n_localName, 1);
31562         namespaceURI = gen_const_xmlChar_ptr(n_namespaceURI, 2);
31563 
31564         ret_val = xmlTextReaderMoveToAttributeNs(reader, localName, namespaceURI);
31565         desret_int(ret_val);
31566         call_tests++;
31567         des_xmlTextReaderPtr(n_reader, reader, 0);
31568         des_const_xmlChar_ptr(n_localName, localName, 1);
31569         des_const_xmlChar_ptr(n_namespaceURI, namespaceURI, 2);
31570         xmlResetLastError();
31571         if (mem_base != xmlMemBlocks()) {
31572             printf("Leak of %d blocks found in xmlTextReaderMoveToAttributeNs",
31573 	           xmlMemBlocks() - mem_base);
31574 	    test_ret++;
31575             printf(" %d", n_reader);
31576             printf(" %d", n_localName);
31577             printf(" %d", n_namespaceURI);
31578             printf("\n");
31579         }
31580     }
31581     }
31582     }
31583     function_tests++;
31584 #endif
31585 
31586     return(test_ret);
31587 }
31588 
31589 
31590 static int
test_xmlTextReaderMoveToElement(void)31591 test_xmlTextReaderMoveToElement(void) {
31592     int test_ret = 0;
31593 
31594 #if defined(LIBXML_READER_ENABLED)
31595     int mem_base;
31596     int ret_val;
31597     xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
31598     int n_reader;
31599 
31600     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
31601         mem_base = xmlMemBlocks();
31602         reader = gen_xmlTextReaderPtr(n_reader, 0);
31603 
31604         ret_val = xmlTextReaderMoveToElement(reader);
31605         desret_int(ret_val);
31606         call_tests++;
31607         des_xmlTextReaderPtr(n_reader, reader, 0);
31608         xmlResetLastError();
31609         if (mem_base != xmlMemBlocks()) {
31610             printf("Leak of %d blocks found in xmlTextReaderMoveToElement",
31611 	           xmlMemBlocks() - mem_base);
31612 	    test_ret++;
31613             printf(" %d", n_reader);
31614             printf("\n");
31615         }
31616     }
31617     function_tests++;
31618 #endif
31619 
31620     return(test_ret);
31621 }
31622 
31623 
31624 static int
test_xmlTextReaderMoveToFirstAttribute(void)31625 test_xmlTextReaderMoveToFirstAttribute(void) {
31626     int test_ret = 0;
31627 
31628 #if defined(LIBXML_READER_ENABLED)
31629     int mem_base;
31630     int ret_val;
31631     xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
31632     int n_reader;
31633 
31634     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
31635         mem_base = xmlMemBlocks();
31636         reader = gen_xmlTextReaderPtr(n_reader, 0);
31637 
31638         ret_val = xmlTextReaderMoveToFirstAttribute(reader);
31639         desret_int(ret_val);
31640         call_tests++;
31641         des_xmlTextReaderPtr(n_reader, reader, 0);
31642         xmlResetLastError();
31643         if (mem_base != xmlMemBlocks()) {
31644             printf("Leak of %d blocks found in xmlTextReaderMoveToFirstAttribute",
31645 	           xmlMemBlocks() - mem_base);
31646 	    test_ret++;
31647             printf(" %d", n_reader);
31648             printf("\n");
31649         }
31650     }
31651     function_tests++;
31652 #endif
31653 
31654     return(test_ret);
31655 }
31656 
31657 
31658 static int
test_xmlTextReaderMoveToNextAttribute(void)31659 test_xmlTextReaderMoveToNextAttribute(void) {
31660     int test_ret = 0;
31661 
31662 #if defined(LIBXML_READER_ENABLED)
31663     int mem_base;
31664     int ret_val;
31665     xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
31666     int n_reader;
31667 
31668     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
31669         mem_base = xmlMemBlocks();
31670         reader = gen_xmlTextReaderPtr(n_reader, 0);
31671 
31672         ret_val = xmlTextReaderMoveToNextAttribute(reader);
31673         desret_int(ret_val);
31674         call_tests++;
31675         des_xmlTextReaderPtr(n_reader, reader, 0);
31676         xmlResetLastError();
31677         if (mem_base != xmlMemBlocks()) {
31678             printf("Leak of %d blocks found in xmlTextReaderMoveToNextAttribute",
31679 	           xmlMemBlocks() - mem_base);
31680 	    test_ret++;
31681             printf(" %d", n_reader);
31682             printf("\n");
31683         }
31684     }
31685     function_tests++;
31686 #endif
31687 
31688     return(test_ret);
31689 }
31690 
31691 
31692 static int
test_xmlTextReaderName(void)31693 test_xmlTextReaderName(void) {
31694     int test_ret = 0;
31695 
31696 #if defined(LIBXML_READER_ENABLED)
31697     int mem_base;
31698     xmlChar * ret_val;
31699     xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
31700     int n_reader;
31701 
31702     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
31703         mem_base = xmlMemBlocks();
31704         reader = gen_xmlTextReaderPtr(n_reader, 0);
31705 
31706         ret_val = xmlTextReaderName(reader);
31707         desret_xmlChar_ptr(ret_val);
31708         call_tests++;
31709         des_xmlTextReaderPtr(n_reader, reader, 0);
31710         xmlResetLastError();
31711         if (mem_base != xmlMemBlocks()) {
31712             printf("Leak of %d blocks found in xmlTextReaderName",
31713 	           xmlMemBlocks() - mem_base);
31714 	    test_ret++;
31715             printf(" %d", n_reader);
31716             printf("\n");
31717         }
31718     }
31719     function_tests++;
31720 #endif
31721 
31722     return(test_ret);
31723 }
31724 
31725 
31726 static int
test_xmlTextReaderNamespaceUri(void)31727 test_xmlTextReaderNamespaceUri(void) {
31728     int test_ret = 0;
31729 
31730 #if defined(LIBXML_READER_ENABLED)
31731     int mem_base;
31732     xmlChar * ret_val;
31733     xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
31734     int n_reader;
31735 
31736     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
31737         mem_base = xmlMemBlocks();
31738         reader = gen_xmlTextReaderPtr(n_reader, 0);
31739 
31740         ret_val = xmlTextReaderNamespaceUri(reader);
31741         desret_xmlChar_ptr(ret_val);
31742         call_tests++;
31743         des_xmlTextReaderPtr(n_reader, reader, 0);
31744         xmlResetLastError();
31745         if (mem_base != xmlMemBlocks()) {
31746             printf("Leak of %d blocks found in xmlTextReaderNamespaceUri",
31747 	           xmlMemBlocks() - mem_base);
31748 	    test_ret++;
31749             printf(" %d", n_reader);
31750             printf("\n");
31751         }
31752     }
31753     function_tests++;
31754 #endif
31755 
31756     return(test_ret);
31757 }
31758 
31759 
31760 static int
test_xmlTextReaderNext(void)31761 test_xmlTextReaderNext(void) {
31762     int test_ret = 0;
31763 
31764 #if defined(LIBXML_READER_ENABLED)
31765     int mem_base;
31766     int ret_val;
31767     xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
31768     int n_reader;
31769 
31770     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
31771         mem_base = xmlMemBlocks();
31772         reader = gen_xmlTextReaderPtr(n_reader, 0);
31773 
31774         ret_val = xmlTextReaderNext(reader);
31775         desret_int(ret_val);
31776         call_tests++;
31777         des_xmlTextReaderPtr(n_reader, reader, 0);
31778         xmlResetLastError();
31779         if (mem_base != xmlMemBlocks()) {
31780             printf("Leak of %d blocks found in xmlTextReaderNext",
31781 	           xmlMemBlocks() - mem_base);
31782 	    test_ret++;
31783             printf(" %d", n_reader);
31784             printf("\n");
31785         }
31786     }
31787     function_tests++;
31788 #endif
31789 
31790     return(test_ret);
31791 }
31792 
31793 
31794 static int
test_xmlTextReaderNextSibling(void)31795 test_xmlTextReaderNextSibling(void) {
31796     int test_ret = 0;
31797 
31798 #if defined(LIBXML_READER_ENABLED)
31799     int mem_base;
31800     int ret_val;
31801     xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
31802     int n_reader;
31803 
31804     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
31805         mem_base = xmlMemBlocks();
31806         reader = gen_xmlTextReaderPtr(n_reader, 0);
31807 
31808         ret_val = xmlTextReaderNextSibling(reader);
31809         desret_int(ret_val);
31810         call_tests++;
31811         des_xmlTextReaderPtr(n_reader, reader, 0);
31812         xmlResetLastError();
31813         if (mem_base != xmlMemBlocks()) {
31814             printf("Leak of %d blocks found in xmlTextReaderNextSibling",
31815 	           xmlMemBlocks() - mem_base);
31816 	    test_ret++;
31817             printf(" %d", n_reader);
31818             printf("\n");
31819         }
31820     }
31821     function_tests++;
31822 #endif
31823 
31824     return(test_ret);
31825 }
31826 
31827 
31828 static int
test_xmlTextReaderNodeType(void)31829 test_xmlTextReaderNodeType(void) {
31830     int test_ret = 0;
31831 
31832 #if defined(LIBXML_READER_ENABLED)
31833     int mem_base;
31834     int ret_val;
31835     xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
31836     int n_reader;
31837 
31838     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
31839         mem_base = xmlMemBlocks();
31840         reader = gen_xmlTextReaderPtr(n_reader, 0);
31841 
31842         ret_val = xmlTextReaderNodeType(reader);
31843         desret_int(ret_val);
31844         call_tests++;
31845         des_xmlTextReaderPtr(n_reader, reader, 0);
31846         xmlResetLastError();
31847         if (mem_base != xmlMemBlocks()) {
31848             printf("Leak of %d blocks found in xmlTextReaderNodeType",
31849 	           xmlMemBlocks() - mem_base);
31850 	    test_ret++;
31851             printf(" %d", n_reader);
31852             printf("\n");
31853         }
31854     }
31855     function_tests++;
31856 #endif
31857 
31858     return(test_ret);
31859 }
31860 
31861 
31862 static int
test_xmlTextReaderNormalization(void)31863 test_xmlTextReaderNormalization(void) {
31864     int test_ret = 0;
31865 
31866 #if defined(LIBXML_READER_ENABLED)
31867     int mem_base;
31868     int ret_val;
31869     xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
31870     int n_reader;
31871 
31872     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
31873         mem_base = xmlMemBlocks();
31874         reader = gen_xmlTextReaderPtr(n_reader, 0);
31875 
31876         ret_val = xmlTextReaderNormalization(reader);
31877         desret_int(ret_val);
31878         call_tests++;
31879         des_xmlTextReaderPtr(n_reader, reader, 0);
31880         xmlResetLastError();
31881         if (mem_base != xmlMemBlocks()) {
31882             printf("Leak of %d blocks found in xmlTextReaderNormalization",
31883 	           xmlMemBlocks() - mem_base);
31884 	    test_ret++;
31885             printf(" %d", n_reader);
31886             printf("\n");
31887         }
31888     }
31889     function_tests++;
31890 #endif
31891 
31892     return(test_ret);
31893 }
31894 
31895 
31896 static int
test_xmlTextReaderPrefix(void)31897 test_xmlTextReaderPrefix(void) {
31898     int test_ret = 0;
31899 
31900 #if defined(LIBXML_READER_ENABLED)
31901     int mem_base;
31902     xmlChar * ret_val;
31903     xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
31904     int n_reader;
31905 
31906     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
31907         mem_base = xmlMemBlocks();
31908         reader = gen_xmlTextReaderPtr(n_reader, 0);
31909 
31910         ret_val = xmlTextReaderPrefix(reader);
31911         desret_xmlChar_ptr(ret_val);
31912         call_tests++;
31913         des_xmlTextReaderPtr(n_reader, reader, 0);
31914         xmlResetLastError();
31915         if (mem_base != xmlMemBlocks()) {
31916             printf("Leak of %d blocks found in xmlTextReaderPrefix",
31917 	           xmlMemBlocks() - mem_base);
31918 	    test_ret++;
31919             printf(" %d", n_reader);
31920             printf("\n");
31921         }
31922     }
31923     function_tests++;
31924 #endif
31925 
31926     return(test_ret);
31927 }
31928 
31929 
31930 static int
test_xmlTextReaderPreserve(void)31931 test_xmlTextReaderPreserve(void) {
31932     int test_ret = 0;
31933 
31934 #if defined(LIBXML_READER_ENABLED)
31935     int mem_base;
31936     xmlNodePtr ret_val;
31937     xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
31938     int n_reader;
31939 
31940     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
31941         mem_base = xmlMemBlocks();
31942         reader = gen_xmlTextReaderPtr(n_reader, 0);
31943 
31944         ret_val = xmlTextReaderPreserve(reader);
31945         desret_xmlNodePtr(ret_val);
31946         call_tests++;
31947         des_xmlTextReaderPtr(n_reader, reader, 0);
31948         xmlResetLastError();
31949         if (mem_base != xmlMemBlocks()) {
31950             printf("Leak of %d blocks found in xmlTextReaderPreserve",
31951 	           xmlMemBlocks() - mem_base);
31952 	    test_ret++;
31953             printf(" %d", n_reader);
31954             printf("\n");
31955         }
31956     }
31957     function_tests++;
31958 #endif
31959 
31960     return(test_ret);
31961 }
31962 
31963 
31964 static int
test_xmlTextReaderPreservePattern(void)31965 test_xmlTextReaderPreservePattern(void) {
31966     int test_ret = 0;
31967 
31968 #if defined(LIBXML_READER_ENABLED) && defined(LIBXML_PATTERN_ENABLED)
31969 #ifdef LIBXML_PATTERN_ENABLED
31970     int mem_base;
31971     int ret_val;
31972     xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
31973     int n_reader;
31974     const xmlChar * pattern; /* an XPath subset pattern */
31975     int n_pattern;
31976     const xmlChar ** namespaces; /* the prefix definitions, array of [URI, prefix] or NULL */
31977     int n_namespaces;
31978 
31979     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
31980     for (n_pattern = 0;n_pattern < gen_nb_const_xmlChar_ptr;n_pattern++) {
31981     for (n_namespaces = 0;n_namespaces < gen_nb_const_xmlChar_ptr_ptr;n_namespaces++) {
31982         mem_base = xmlMemBlocks();
31983         reader = gen_xmlTextReaderPtr(n_reader, 0);
31984         pattern = gen_const_xmlChar_ptr(n_pattern, 1);
31985         namespaces = gen_const_xmlChar_ptr_ptr(n_namespaces, 2);
31986 
31987         ret_val = xmlTextReaderPreservePattern(reader, pattern, namespaces);
31988         desret_int(ret_val);
31989         call_tests++;
31990         des_xmlTextReaderPtr(n_reader, reader, 0);
31991         des_const_xmlChar_ptr(n_pattern, pattern, 1);
31992         des_const_xmlChar_ptr_ptr(n_namespaces, namespaces, 2);
31993         xmlResetLastError();
31994         if (mem_base != xmlMemBlocks()) {
31995             printf("Leak of %d blocks found in xmlTextReaderPreservePattern",
31996 	           xmlMemBlocks() - mem_base);
31997 	    test_ret++;
31998             printf(" %d", n_reader);
31999             printf(" %d", n_pattern);
32000             printf(" %d", n_namespaces);
32001             printf("\n");
32002         }
32003     }
32004     }
32005     }
32006     function_tests++;
32007 #endif
32008 #endif
32009 
32010     return(test_ret);
32011 }
32012 
32013 
32014 static int
test_xmlTextReaderQuoteChar(void)32015 test_xmlTextReaderQuoteChar(void) {
32016     int test_ret = 0;
32017 
32018 #if defined(LIBXML_READER_ENABLED)
32019     int mem_base;
32020     int ret_val;
32021     xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
32022     int n_reader;
32023 
32024     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
32025         mem_base = xmlMemBlocks();
32026         reader = gen_xmlTextReaderPtr(n_reader, 0);
32027 
32028         ret_val = xmlTextReaderQuoteChar(reader);
32029         desret_int(ret_val);
32030         call_tests++;
32031         des_xmlTextReaderPtr(n_reader, reader, 0);
32032         xmlResetLastError();
32033         if (mem_base != xmlMemBlocks()) {
32034             printf("Leak of %d blocks found in xmlTextReaderQuoteChar",
32035 	           xmlMemBlocks() - mem_base);
32036 	    test_ret++;
32037             printf(" %d", n_reader);
32038             printf("\n");
32039         }
32040     }
32041     function_tests++;
32042 #endif
32043 
32044     return(test_ret);
32045 }
32046 
32047 
32048 static int
test_xmlTextReaderRead(void)32049 test_xmlTextReaderRead(void) {
32050     int test_ret = 0;
32051 
32052 #if defined(LIBXML_READER_ENABLED)
32053     int mem_base;
32054     int ret_val;
32055     xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
32056     int n_reader;
32057 
32058     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
32059         mem_base = xmlMemBlocks();
32060         reader = gen_xmlTextReaderPtr(n_reader, 0);
32061 
32062         ret_val = xmlTextReaderRead(reader);
32063         desret_int(ret_val);
32064         call_tests++;
32065         des_xmlTextReaderPtr(n_reader, reader, 0);
32066         xmlResetLastError();
32067         if (mem_base != xmlMemBlocks()) {
32068             printf("Leak of %d blocks found in xmlTextReaderRead",
32069 	           xmlMemBlocks() - mem_base);
32070 	    test_ret++;
32071             printf(" %d", n_reader);
32072             printf("\n");
32073         }
32074     }
32075     function_tests++;
32076 #endif
32077 
32078     return(test_ret);
32079 }
32080 
32081 
32082 static int
test_xmlTextReaderReadAttributeValue(void)32083 test_xmlTextReaderReadAttributeValue(void) {
32084     int test_ret = 0;
32085 
32086 #if defined(LIBXML_READER_ENABLED)
32087     int mem_base;
32088     int ret_val;
32089     xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
32090     int n_reader;
32091 
32092     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
32093         mem_base = xmlMemBlocks();
32094         reader = gen_xmlTextReaderPtr(n_reader, 0);
32095 
32096         ret_val = xmlTextReaderReadAttributeValue(reader);
32097         desret_int(ret_val);
32098         call_tests++;
32099         des_xmlTextReaderPtr(n_reader, reader, 0);
32100         xmlResetLastError();
32101         if (mem_base != xmlMemBlocks()) {
32102             printf("Leak of %d blocks found in xmlTextReaderReadAttributeValue",
32103 	           xmlMemBlocks() - mem_base);
32104 	    test_ret++;
32105             printf(" %d", n_reader);
32106             printf("\n");
32107         }
32108     }
32109     function_tests++;
32110 #endif
32111 
32112     return(test_ret);
32113 }
32114 
32115 
32116 static int
test_xmlTextReaderReadState(void)32117 test_xmlTextReaderReadState(void) {
32118     int test_ret = 0;
32119 
32120 #if defined(LIBXML_READER_ENABLED)
32121     int mem_base;
32122     int ret_val;
32123     xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
32124     int n_reader;
32125 
32126     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
32127         mem_base = xmlMemBlocks();
32128         reader = gen_xmlTextReaderPtr(n_reader, 0);
32129 
32130         ret_val = xmlTextReaderReadState(reader);
32131         desret_int(ret_val);
32132         call_tests++;
32133         des_xmlTextReaderPtr(n_reader, reader, 0);
32134         xmlResetLastError();
32135         if (mem_base != xmlMemBlocks()) {
32136             printf("Leak of %d blocks found in xmlTextReaderReadState",
32137 	           xmlMemBlocks() - mem_base);
32138 	    test_ret++;
32139             printf(" %d", n_reader);
32140             printf("\n");
32141         }
32142     }
32143     function_tests++;
32144 #endif
32145 
32146     return(test_ret);
32147 }
32148 
32149 
32150 static int
test_xmlTextReaderRelaxNGSetSchema(void)32151 test_xmlTextReaderRelaxNGSetSchema(void) {
32152     int test_ret = 0;
32153 
32154 #if defined(LIBXML_READER_ENABLED) && defined(LIBXML_SCHEMAS_ENABLED)
32155     int mem_base;
32156     int ret_val;
32157     xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
32158     int n_reader;
32159     xmlRelaxNGPtr schema; /* a precompiled RelaxNG schema */
32160     int n_schema;
32161 
32162     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
32163     for (n_schema = 0;n_schema < gen_nb_xmlRelaxNGPtr;n_schema++) {
32164         mem_base = xmlMemBlocks();
32165         reader = gen_xmlTextReaderPtr(n_reader, 0);
32166         schema = gen_xmlRelaxNGPtr(n_schema, 1);
32167 
32168         ret_val = xmlTextReaderRelaxNGSetSchema(reader, schema);
32169         desret_int(ret_val);
32170         call_tests++;
32171         des_xmlTextReaderPtr(n_reader, reader, 0);
32172         des_xmlRelaxNGPtr(n_schema, schema, 1);
32173         xmlResetLastError();
32174         if (mem_base != xmlMemBlocks()) {
32175             printf("Leak of %d blocks found in xmlTextReaderRelaxNGSetSchema",
32176 	           xmlMemBlocks() - mem_base);
32177 	    test_ret++;
32178             printf(" %d", n_reader);
32179             printf(" %d", n_schema);
32180             printf("\n");
32181         }
32182     }
32183     }
32184     function_tests++;
32185 #endif
32186 
32187     return(test_ret);
32188 }
32189 
32190 
32191 static int
test_xmlTextReaderRelaxNGValidate(void)32192 test_xmlTextReaderRelaxNGValidate(void) {
32193     int test_ret = 0;
32194 
32195 #if defined(LIBXML_READER_ENABLED) && defined(LIBXML_SCHEMAS_ENABLED)
32196     int mem_base;
32197     int ret_val;
32198     xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
32199     int n_reader;
32200     const char * rng; /* the path to a RelaxNG schema or NULL */
32201     int n_rng;
32202 
32203     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
32204     for (n_rng = 0;n_rng < gen_nb_const_char_ptr;n_rng++) {
32205         mem_base = xmlMemBlocks();
32206         reader = gen_xmlTextReaderPtr(n_reader, 0);
32207         rng = gen_const_char_ptr(n_rng, 1);
32208 
32209         ret_val = xmlTextReaderRelaxNGValidate(reader, rng);
32210         desret_int(ret_val);
32211         call_tests++;
32212         des_xmlTextReaderPtr(n_reader, reader, 0);
32213         des_const_char_ptr(n_rng, rng, 1);
32214         xmlResetLastError();
32215         if (mem_base != xmlMemBlocks()) {
32216             printf("Leak of %d blocks found in xmlTextReaderRelaxNGValidate",
32217 	           xmlMemBlocks() - mem_base);
32218 	    test_ret++;
32219             printf(" %d", n_reader);
32220             printf(" %d", n_rng);
32221             printf("\n");
32222         }
32223     }
32224     }
32225     function_tests++;
32226 #endif
32227 
32228     return(test_ret);
32229 }
32230 
32231 
32232 static int
test_xmlTextReaderRelaxNGValidateCtxt(void)32233 test_xmlTextReaderRelaxNGValidateCtxt(void) {
32234     int test_ret = 0;
32235 
32236 #if defined(LIBXML_READER_ENABLED) && defined(LIBXML_SCHEMAS_ENABLED)
32237     int mem_base;
32238     int ret_val;
32239     xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
32240     int n_reader;
32241     xmlRelaxNGValidCtxtPtr ctxt; /* the RelaxNG schema validation context or NULL */
32242     int n_ctxt;
32243     int options; /* options (not used yet) */
32244     int n_options;
32245 
32246     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
32247     for (n_ctxt = 0;n_ctxt < gen_nb_xmlRelaxNGValidCtxtPtr;n_ctxt++) {
32248     for (n_options = 0;n_options < gen_nb_parseroptions;n_options++) {
32249         mem_base = xmlMemBlocks();
32250         reader = gen_xmlTextReaderPtr(n_reader, 0);
32251         ctxt = gen_xmlRelaxNGValidCtxtPtr(n_ctxt, 1);
32252         options = gen_parseroptions(n_options, 2);
32253 
32254         ret_val = xmlTextReaderRelaxNGValidateCtxt(reader, ctxt, options);
32255         desret_int(ret_val);
32256         call_tests++;
32257         des_xmlTextReaderPtr(n_reader, reader, 0);
32258         des_xmlRelaxNGValidCtxtPtr(n_ctxt, ctxt, 1);
32259         des_parseroptions(n_options, options, 2);
32260         xmlResetLastError();
32261         if (mem_base != xmlMemBlocks()) {
32262             printf("Leak of %d blocks found in xmlTextReaderRelaxNGValidateCtxt",
32263 	           xmlMemBlocks() - mem_base);
32264 	    test_ret++;
32265             printf(" %d", n_reader);
32266             printf(" %d", n_ctxt);
32267             printf(" %d", n_options);
32268             printf("\n");
32269         }
32270     }
32271     }
32272     }
32273     function_tests++;
32274 #endif
32275 
32276     return(test_ret);
32277 }
32278 
32279 
32280 static int
test_xmlTextReaderSchemaValidate(void)32281 test_xmlTextReaderSchemaValidate(void) {
32282     int test_ret = 0;
32283 
32284 #if defined(LIBXML_READER_ENABLED) && defined(LIBXML_SCHEMAS_ENABLED)
32285     int ret_val;
32286     xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
32287     int n_reader;
32288     const char * xsd; /* the path to a W3C XSD schema or NULL */
32289     int n_xsd;
32290 
32291     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
32292     for (n_xsd = 0;n_xsd < gen_nb_const_char_ptr;n_xsd++) {
32293         reader = gen_xmlTextReaderPtr(n_reader, 0);
32294         xsd = gen_const_char_ptr(n_xsd, 1);
32295 
32296         ret_val = xmlTextReaderSchemaValidate(reader, xsd);
32297         desret_int(ret_val);
32298         call_tests++;
32299         des_xmlTextReaderPtr(n_reader, reader, 0);
32300         des_const_char_ptr(n_xsd, xsd, 1);
32301         xmlResetLastError();
32302     }
32303     }
32304     function_tests++;
32305 #endif
32306 
32307     return(test_ret);
32308 }
32309 
32310 
32311 static int
test_xmlTextReaderSchemaValidateCtxt(void)32312 test_xmlTextReaderSchemaValidateCtxt(void) {
32313     int test_ret = 0;
32314 
32315 #if defined(LIBXML_READER_ENABLED) && defined(LIBXML_SCHEMAS_ENABLED)
32316     int mem_base;
32317     int ret_val;
32318     xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
32319     int n_reader;
32320     xmlSchemaValidCtxtPtr ctxt; /* the XML Schema validation context or NULL */
32321     int n_ctxt;
32322     int options; /* options (not used yet) */
32323     int n_options;
32324 
32325     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
32326     for (n_ctxt = 0;n_ctxt < gen_nb_xmlSchemaValidCtxtPtr;n_ctxt++) {
32327     for (n_options = 0;n_options < gen_nb_parseroptions;n_options++) {
32328         mem_base = xmlMemBlocks();
32329         reader = gen_xmlTextReaderPtr(n_reader, 0);
32330         ctxt = gen_xmlSchemaValidCtxtPtr(n_ctxt, 1);
32331         options = gen_parseroptions(n_options, 2);
32332 
32333         ret_val = xmlTextReaderSchemaValidateCtxt(reader, ctxt, options);
32334         desret_int(ret_val);
32335         call_tests++;
32336         des_xmlTextReaderPtr(n_reader, reader, 0);
32337         des_xmlSchemaValidCtxtPtr(n_ctxt, ctxt, 1);
32338         des_parseroptions(n_options, options, 2);
32339         xmlResetLastError();
32340         if (mem_base != xmlMemBlocks()) {
32341             printf("Leak of %d blocks found in xmlTextReaderSchemaValidateCtxt",
32342 	           xmlMemBlocks() - mem_base);
32343 	    test_ret++;
32344             printf(" %d", n_reader);
32345             printf(" %d", n_ctxt);
32346             printf(" %d", n_options);
32347             printf("\n");
32348         }
32349     }
32350     }
32351     }
32352     function_tests++;
32353 #endif
32354 
32355     return(test_ret);
32356 }
32357 
32358 
32359 static int
test_xmlTextReaderSetErrorHandler(void)32360 test_xmlTextReaderSetErrorHandler(void) {
32361     int test_ret = 0;
32362 
32363 
32364     /* missing type support */
32365     return(test_ret);
32366 }
32367 
32368 
32369 static int
test_xmlTextReaderSetMaxAmplification(void)32370 test_xmlTextReaderSetMaxAmplification(void) {
32371     int test_ret = 0;
32372 
32373 
32374     /* missing type support */
32375     return(test_ret);
32376 }
32377 
32378 
32379 static int
test_xmlTextReaderSetParserProp(void)32380 test_xmlTextReaderSetParserProp(void) {
32381     int test_ret = 0;
32382 
32383 #if defined(LIBXML_READER_ENABLED)
32384     int mem_base;
32385     int ret_val;
32386     xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
32387     int n_reader;
32388     int prop; /* the xmlParserProperties to set */
32389     int n_prop;
32390     int value; /* usually 0 or 1 to (de)activate it */
32391     int n_value;
32392 
32393     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
32394     for (n_prop = 0;n_prop < gen_nb_int;n_prop++) {
32395     for (n_value = 0;n_value < gen_nb_int;n_value++) {
32396         mem_base = xmlMemBlocks();
32397         reader = gen_xmlTextReaderPtr(n_reader, 0);
32398         prop = gen_int(n_prop, 1);
32399         value = gen_int(n_value, 2);
32400 
32401         ret_val = xmlTextReaderSetParserProp(reader, prop, value);
32402         desret_int(ret_val);
32403         call_tests++;
32404         des_xmlTextReaderPtr(n_reader, reader, 0);
32405         des_int(n_prop, prop, 1);
32406         des_int(n_value, value, 2);
32407         xmlResetLastError();
32408         if (mem_base != xmlMemBlocks()) {
32409             printf("Leak of %d blocks found in xmlTextReaderSetParserProp",
32410 	           xmlMemBlocks() - mem_base);
32411 	    test_ret++;
32412             printf(" %d", n_reader);
32413             printf(" %d", n_prop);
32414             printf(" %d", n_value);
32415             printf("\n");
32416         }
32417     }
32418     }
32419     }
32420     function_tests++;
32421 #endif
32422 
32423     return(test_ret);
32424 }
32425 
32426 
32427 static int
test_xmlTextReaderSetSchema(void)32428 test_xmlTextReaderSetSchema(void) {
32429     int test_ret = 0;
32430 
32431 #if defined(LIBXML_READER_ENABLED) && defined(LIBXML_SCHEMAS_ENABLED)
32432     int mem_base;
32433     int ret_val;
32434     xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
32435     int n_reader;
32436     xmlSchemaPtr schema; /* a precompiled Schema schema */
32437     int n_schema;
32438 
32439     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
32440     for (n_schema = 0;n_schema < gen_nb_xmlSchemaPtr;n_schema++) {
32441         mem_base = xmlMemBlocks();
32442         reader = gen_xmlTextReaderPtr(n_reader, 0);
32443         schema = gen_xmlSchemaPtr(n_schema, 1);
32444 
32445         ret_val = xmlTextReaderSetSchema(reader, schema);
32446         desret_int(ret_val);
32447         call_tests++;
32448         des_xmlTextReaderPtr(n_reader, reader, 0);
32449         des_xmlSchemaPtr(n_schema, schema, 1);
32450         xmlResetLastError();
32451         if (mem_base != xmlMemBlocks()) {
32452             printf("Leak of %d blocks found in xmlTextReaderSetSchema",
32453 	           xmlMemBlocks() - mem_base);
32454 	    test_ret++;
32455             printf(" %d", n_reader);
32456             printf(" %d", n_schema);
32457             printf("\n");
32458         }
32459     }
32460     }
32461     function_tests++;
32462 #endif
32463 
32464     return(test_ret);
32465 }
32466 
32467 
32468 static int
test_xmlTextReaderSetStructuredErrorHandler(void)32469 test_xmlTextReaderSetStructuredErrorHandler(void) {
32470     int test_ret = 0;
32471 
32472 
32473     /* missing type support */
32474     return(test_ret);
32475 }
32476 
32477 
32478 static int
test_xmlTextReaderSetup(void)32479 test_xmlTextReaderSetup(void) {
32480     int test_ret = 0;
32481 
32482 #if defined(LIBXML_READER_ENABLED)
32483     int mem_base;
32484     int ret_val;
32485     xmlTextReaderPtr reader; /* an XML reader */
32486     int n_reader;
32487     xmlParserInputBufferPtr input; /* xmlParserInputBufferPtr used to feed the reader, will be destroyed with it. */
32488     int n_input;
32489     const char * URL; /* the base URL to use for the document */
32490     int n_URL;
32491     const char * encoding; /* the document encoding, or NULL */
32492     int n_encoding;
32493     int options; /* a combination of xmlParserOption */
32494     int n_options;
32495 
32496     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
32497     for (n_input = 0;n_input < gen_nb_xmlParserInputBufferPtr;n_input++) {
32498     for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) {
32499     for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
32500     for (n_options = 0;n_options < gen_nb_parseroptions;n_options++) {
32501         mem_base = xmlMemBlocks();
32502         reader = gen_xmlTextReaderPtr(n_reader, 0);
32503         input = gen_xmlParserInputBufferPtr(n_input, 1);
32504         URL = gen_filepath(n_URL, 2);
32505         encoding = gen_const_char_ptr(n_encoding, 3);
32506         options = gen_parseroptions(n_options, 4);
32507 
32508         ret_val = xmlTextReaderSetup(reader, input, URL, encoding, options);
32509         desret_int(ret_val);
32510         call_tests++;
32511         des_xmlTextReaderPtr(n_reader, reader, 0);
32512         des_filepath(n_URL, URL, 2);
32513         des_const_char_ptr(n_encoding, encoding, 3);
32514         des_parseroptions(n_options, options, 4);
32515         xmlResetLastError();
32516         if (mem_base != xmlMemBlocks()) {
32517             printf("Leak of %d blocks found in xmlTextReaderSetup",
32518 	           xmlMemBlocks() - mem_base);
32519 	    test_ret++;
32520             printf(" %d", n_reader);
32521             printf(" %d", n_input);
32522             printf(" %d", n_URL);
32523             printf(" %d", n_encoding);
32524             printf(" %d", n_options);
32525             printf("\n");
32526         }
32527     }
32528     }
32529     }
32530     }
32531     }
32532     function_tests++;
32533 #endif
32534 
32535     return(test_ret);
32536 }
32537 
32538 
32539 static int
test_xmlTextReaderStandalone(void)32540 test_xmlTextReaderStandalone(void) {
32541     int test_ret = 0;
32542 
32543 #if defined(LIBXML_READER_ENABLED)
32544     int mem_base;
32545     int ret_val;
32546     xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
32547     int n_reader;
32548 
32549     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
32550         mem_base = xmlMemBlocks();
32551         reader = gen_xmlTextReaderPtr(n_reader, 0);
32552 
32553         ret_val = xmlTextReaderStandalone(reader);
32554         desret_int(ret_val);
32555         call_tests++;
32556         des_xmlTextReaderPtr(n_reader, reader, 0);
32557         xmlResetLastError();
32558         if (mem_base != xmlMemBlocks()) {
32559             printf("Leak of %d blocks found in xmlTextReaderStandalone",
32560 	           xmlMemBlocks() - mem_base);
32561 	    test_ret++;
32562             printf(" %d", n_reader);
32563             printf("\n");
32564         }
32565     }
32566     function_tests++;
32567 #endif
32568 
32569     return(test_ret);
32570 }
32571 
32572 
32573 static int
test_xmlTextReaderValue(void)32574 test_xmlTextReaderValue(void) {
32575     int test_ret = 0;
32576 
32577 #if defined(LIBXML_READER_ENABLED)
32578     int mem_base;
32579     xmlChar * ret_val;
32580     xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
32581     int n_reader;
32582 
32583     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
32584         mem_base = xmlMemBlocks();
32585         reader = gen_xmlTextReaderPtr(n_reader, 0);
32586 
32587         ret_val = xmlTextReaderValue(reader);
32588         desret_xmlChar_ptr(ret_val);
32589         call_tests++;
32590         des_xmlTextReaderPtr(n_reader, reader, 0);
32591         xmlResetLastError();
32592         if (mem_base != xmlMemBlocks()) {
32593             printf("Leak of %d blocks found in xmlTextReaderValue",
32594 	           xmlMemBlocks() - mem_base);
32595 	    test_ret++;
32596             printf(" %d", n_reader);
32597             printf("\n");
32598         }
32599     }
32600     function_tests++;
32601 #endif
32602 
32603     return(test_ret);
32604 }
32605 
32606 
32607 static int
test_xmlTextReaderXmlLang(void)32608 test_xmlTextReaderXmlLang(void) {
32609     int test_ret = 0;
32610 
32611 #if defined(LIBXML_READER_ENABLED)
32612     int mem_base;
32613     xmlChar * ret_val;
32614     xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
32615     int n_reader;
32616 
32617     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
32618         mem_base = xmlMemBlocks();
32619         reader = gen_xmlTextReaderPtr(n_reader, 0);
32620 
32621         ret_val = xmlTextReaderXmlLang(reader);
32622         desret_xmlChar_ptr(ret_val);
32623         call_tests++;
32624         des_xmlTextReaderPtr(n_reader, reader, 0);
32625         xmlResetLastError();
32626         if (mem_base != xmlMemBlocks()) {
32627             printf("Leak of %d blocks found in xmlTextReaderXmlLang",
32628 	           xmlMemBlocks() - mem_base);
32629 	    test_ret++;
32630             printf(" %d", n_reader);
32631             printf("\n");
32632         }
32633     }
32634     function_tests++;
32635 #endif
32636 
32637     return(test_ret);
32638 }
32639 
32640 static int
test_xmlreader(void)32641 test_xmlreader(void) {
32642     int test_ret = 0;
32643 
32644     if (quiet == 0) printf("Testing xmlreader : 76 of 87 functions ...\n");
32645     test_ret += test_xmlNewTextReader();
32646     test_ret += test_xmlNewTextReaderFilename();
32647     test_ret += test_xmlReaderForDoc();
32648     test_ret += test_xmlReaderForFile();
32649     test_ret += test_xmlReaderForMemory();
32650     test_ret += test_xmlReaderNewDoc();
32651     test_ret += test_xmlReaderNewFile();
32652     test_ret += test_xmlReaderNewMemory();
32653     test_ret += test_xmlReaderNewWalker();
32654     test_ret += test_xmlReaderWalker();
32655     test_ret += test_xmlTextReaderAttributeCount();
32656     test_ret += test_xmlTextReaderBaseUri();
32657     test_ret += test_xmlTextReaderByteConsumed();
32658     test_ret += test_xmlTextReaderClose();
32659     test_ret += test_xmlTextReaderConstBaseUri();
32660     test_ret += test_xmlTextReaderConstEncoding();
32661     test_ret += test_xmlTextReaderConstLocalName();
32662     test_ret += test_xmlTextReaderConstName();
32663     test_ret += test_xmlTextReaderConstNamespaceUri();
32664     test_ret += test_xmlTextReaderConstPrefix();
32665     test_ret += test_xmlTextReaderConstString();
32666     test_ret += test_xmlTextReaderConstValue();
32667     test_ret += test_xmlTextReaderConstXmlLang();
32668     test_ret += test_xmlTextReaderConstXmlVersion();
32669     test_ret += test_xmlTextReaderCurrentDoc();
32670     test_ret += test_xmlTextReaderCurrentNode();
32671     test_ret += test_xmlTextReaderDepth();
32672     test_ret += test_xmlTextReaderExpand();
32673     test_ret += test_xmlTextReaderGetAttribute();
32674     test_ret += test_xmlTextReaderGetAttributeNo();
32675     test_ret += test_xmlTextReaderGetAttributeNs();
32676     test_ret += test_xmlTextReaderGetErrorHandler();
32677     test_ret += test_xmlTextReaderGetParserColumnNumber();
32678     test_ret += test_xmlTextReaderGetParserLineNumber();
32679     test_ret += test_xmlTextReaderGetParserProp();
32680     test_ret += test_xmlTextReaderGetRemainder();
32681     test_ret += test_xmlTextReaderHasAttributes();
32682     test_ret += test_xmlTextReaderHasValue();
32683     test_ret += test_xmlTextReaderIsDefault();
32684     test_ret += test_xmlTextReaderIsEmptyElement();
32685     test_ret += test_xmlTextReaderIsNamespaceDecl();
32686     test_ret += test_xmlTextReaderIsValid();
32687     test_ret += test_xmlTextReaderLocalName();
32688     test_ret += test_xmlTextReaderLocatorBaseURI();
32689     test_ret += test_xmlTextReaderLocatorLineNumber();
32690     test_ret += test_xmlTextReaderLookupNamespace();
32691     test_ret += test_xmlTextReaderMoveToAttribute();
32692     test_ret += test_xmlTextReaderMoveToAttributeNo();
32693     test_ret += test_xmlTextReaderMoveToAttributeNs();
32694     test_ret += test_xmlTextReaderMoveToElement();
32695     test_ret += test_xmlTextReaderMoveToFirstAttribute();
32696     test_ret += test_xmlTextReaderMoveToNextAttribute();
32697     test_ret += test_xmlTextReaderName();
32698     test_ret += test_xmlTextReaderNamespaceUri();
32699     test_ret += test_xmlTextReaderNext();
32700     test_ret += test_xmlTextReaderNextSibling();
32701     test_ret += test_xmlTextReaderNodeType();
32702     test_ret += test_xmlTextReaderNormalization();
32703     test_ret += test_xmlTextReaderPrefix();
32704     test_ret += test_xmlTextReaderPreserve();
32705     test_ret += test_xmlTextReaderPreservePattern();
32706     test_ret += test_xmlTextReaderQuoteChar();
32707     test_ret += test_xmlTextReaderRead();
32708     test_ret += test_xmlTextReaderReadAttributeValue();
32709     test_ret += test_xmlTextReaderReadState();
32710     test_ret += test_xmlTextReaderRelaxNGSetSchema();
32711     test_ret += test_xmlTextReaderRelaxNGValidate();
32712     test_ret += test_xmlTextReaderRelaxNGValidateCtxt();
32713     test_ret += test_xmlTextReaderSchemaValidate();
32714     test_ret += test_xmlTextReaderSchemaValidateCtxt();
32715     test_ret += test_xmlTextReaderSetErrorHandler();
32716     test_ret += test_xmlTextReaderSetMaxAmplification();
32717     test_ret += test_xmlTextReaderSetParserProp();
32718     test_ret += test_xmlTextReaderSetSchema();
32719     test_ret += test_xmlTextReaderSetStructuredErrorHandler();
32720     test_ret += test_xmlTextReaderSetup();
32721     test_ret += test_xmlTextReaderStandalone();
32722     test_ret += test_xmlTextReaderValue();
32723     test_ret += test_xmlTextReaderXmlLang();
32724 
32725     if (test_ret != 0)
32726 	printf("Module xmlreader: %d errors\n", test_ret);
32727     return(test_ret);
32728 }
32729 
32730 static int
test_xmlExpCtxtNbCons(void)32731 test_xmlExpCtxtNbCons(void) {
32732     int test_ret = 0;
32733 
32734 #if defined(LIBXML_REGEXP_ENABLED) && defined(LIBXML_EXPR_ENABLED)
32735     int mem_base;
32736     int ret_val;
32737     xmlExpCtxtPtr ctxt; /* an expression context */
32738     int n_ctxt;
32739 
32740     for (n_ctxt = 0;n_ctxt < gen_nb_xmlExpCtxtPtr;n_ctxt++) {
32741         mem_base = xmlMemBlocks();
32742         ctxt = gen_xmlExpCtxtPtr(n_ctxt, 0);
32743 
32744         ret_val = xmlExpCtxtNbCons(ctxt);
32745         desret_int(ret_val);
32746         call_tests++;
32747         des_xmlExpCtxtPtr(n_ctxt, ctxt, 0);
32748         xmlResetLastError();
32749         if (mem_base != xmlMemBlocks()) {
32750             printf("Leak of %d blocks found in xmlExpCtxtNbCons",
32751 	           xmlMemBlocks() - mem_base);
32752 	    test_ret++;
32753             printf(" %d", n_ctxt);
32754             printf("\n");
32755         }
32756     }
32757     function_tests++;
32758 #endif
32759 
32760     return(test_ret);
32761 }
32762 
32763 
32764 static int
test_xmlExpCtxtNbNodes(void)32765 test_xmlExpCtxtNbNodes(void) {
32766     int test_ret = 0;
32767 
32768 #if defined(LIBXML_REGEXP_ENABLED) && defined(LIBXML_EXPR_ENABLED)
32769     int mem_base;
32770     int ret_val;
32771     xmlExpCtxtPtr ctxt; /* an expression context */
32772     int n_ctxt;
32773 
32774     for (n_ctxt = 0;n_ctxt < gen_nb_xmlExpCtxtPtr;n_ctxt++) {
32775         mem_base = xmlMemBlocks();
32776         ctxt = gen_xmlExpCtxtPtr(n_ctxt, 0);
32777 
32778         ret_val = xmlExpCtxtNbNodes(ctxt);
32779         desret_int(ret_val);
32780         call_tests++;
32781         des_xmlExpCtxtPtr(n_ctxt, ctxt, 0);
32782         xmlResetLastError();
32783         if (mem_base != xmlMemBlocks()) {
32784             printf("Leak of %d blocks found in xmlExpCtxtNbNodes",
32785 	           xmlMemBlocks() - mem_base);
32786 	    test_ret++;
32787             printf(" %d", n_ctxt);
32788             printf("\n");
32789         }
32790     }
32791     function_tests++;
32792 #endif
32793 
32794     return(test_ret);
32795 }
32796 
32797 
32798 static int
test_xmlExpDump(void)32799 test_xmlExpDump(void) {
32800     int test_ret = 0;
32801 
32802 #if defined(LIBXML_REGEXP_ENABLED) && defined(LIBXML_EXPR_ENABLED)
32803     int mem_base;
32804     xmlBufferPtr buf; /* a buffer to receive the output */
32805     int n_buf;
32806     xmlExpNodePtr expr; /* the compiled expression */
32807     int n_expr;
32808 
32809     for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
32810     for (n_expr = 0;n_expr < gen_nb_xmlExpNodePtr;n_expr++) {
32811         mem_base = xmlMemBlocks();
32812         buf = gen_xmlBufferPtr(n_buf, 0);
32813         expr = gen_xmlExpNodePtr(n_expr, 1);
32814 
32815         xmlExpDump(buf, expr);
32816         call_tests++;
32817         des_xmlBufferPtr(n_buf, buf, 0);
32818         des_xmlExpNodePtr(n_expr, expr, 1);
32819         xmlResetLastError();
32820         if (mem_base != xmlMemBlocks()) {
32821             printf("Leak of %d blocks found in xmlExpDump",
32822 	           xmlMemBlocks() - mem_base);
32823 	    test_ret++;
32824             printf(" %d", n_buf);
32825             printf(" %d", n_expr);
32826             printf("\n");
32827         }
32828     }
32829     }
32830     function_tests++;
32831 #endif
32832 
32833     return(test_ret);
32834 }
32835 
32836 
32837 static int
test_xmlExpExpDerive(void)32838 test_xmlExpExpDerive(void) {
32839     int test_ret = 0;
32840 
32841 
32842     /* missing type support */
32843     return(test_ret);
32844 }
32845 
32846 
32847 static int
test_xmlExpGetLanguage(void)32848 test_xmlExpGetLanguage(void) {
32849     int test_ret = 0;
32850 
32851 #if defined(LIBXML_REGEXP_ENABLED) && defined(LIBXML_EXPR_ENABLED)
32852     int mem_base;
32853     int ret_val;
32854     xmlExpCtxtPtr ctxt; /* the expression context */
32855     int n_ctxt;
32856     xmlExpNodePtr exp; /* the expression */
32857     int n_exp;
32858     const xmlChar ** langList; /* where to store the tokens */
32859     int n_langList;
32860     int len; /* the allocated length of @list */
32861     int n_len;
32862 
32863     for (n_ctxt = 0;n_ctxt < gen_nb_xmlExpCtxtPtr;n_ctxt++) {
32864     for (n_exp = 0;n_exp < gen_nb_xmlExpNodePtr;n_exp++) {
32865     for (n_langList = 0;n_langList < gen_nb_const_xmlChar_ptr_ptr;n_langList++) {
32866     for (n_len = 0;n_len < gen_nb_int;n_len++) {
32867         mem_base = xmlMemBlocks();
32868         ctxt = gen_xmlExpCtxtPtr(n_ctxt, 0);
32869         exp = gen_xmlExpNodePtr(n_exp, 1);
32870         langList = gen_const_xmlChar_ptr_ptr(n_langList, 2);
32871         len = gen_int(n_len, 3);
32872 
32873         ret_val = xmlExpGetLanguage(ctxt, exp, langList, len);
32874         desret_int(ret_val);
32875         call_tests++;
32876         des_xmlExpCtxtPtr(n_ctxt, ctxt, 0);
32877         des_xmlExpNodePtr(n_exp, exp, 1);
32878         des_const_xmlChar_ptr_ptr(n_langList, langList, 2);
32879         des_int(n_len, len, 3);
32880         xmlResetLastError();
32881         if (mem_base != xmlMemBlocks()) {
32882             printf("Leak of %d blocks found in xmlExpGetLanguage",
32883 	           xmlMemBlocks() - mem_base);
32884 	    test_ret++;
32885             printf(" %d", n_ctxt);
32886             printf(" %d", n_exp);
32887             printf(" %d", n_langList);
32888             printf(" %d", n_len);
32889             printf("\n");
32890         }
32891     }
32892     }
32893     }
32894     }
32895     function_tests++;
32896 #endif
32897 
32898     return(test_ret);
32899 }
32900 
32901 
32902 static int
test_xmlExpGetStart(void)32903 test_xmlExpGetStart(void) {
32904     int test_ret = 0;
32905 
32906 #if defined(LIBXML_REGEXP_ENABLED) && defined(LIBXML_EXPR_ENABLED)
32907     int mem_base;
32908     int ret_val;
32909     xmlExpCtxtPtr ctxt; /* the expression context */
32910     int n_ctxt;
32911     xmlExpNodePtr exp; /* the expression */
32912     int n_exp;
32913     const xmlChar ** tokList; /* where to store the tokens */
32914     int n_tokList;
32915     int len; /* the allocated length of @list */
32916     int n_len;
32917 
32918     for (n_ctxt = 0;n_ctxt < gen_nb_xmlExpCtxtPtr;n_ctxt++) {
32919     for (n_exp = 0;n_exp < gen_nb_xmlExpNodePtr;n_exp++) {
32920     for (n_tokList = 0;n_tokList < gen_nb_const_xmlChar_ptr_ptr;n_tokList++) {
32921     for (n_len = 0;n_len < gen_nb_int;n_len++) {
32922         mem_base = xmlMemBlocks();
32923         ctxt = gen_xmlExpCtxtPtr(n_ctxt, 0);
32924         exp = gen_xmlExpNodePtr(n_exp, 1);
32925         tokList = gen_const_xmlChar_ptr_ptr(n_tokList, 2);
32926         len = gen_int(n_len, 3);
32927 
32928         ret_val = xmlExpGetStart(ctxt, exp, tokList, len);
32929         desret_int(ret_val);
32930         call_tests++;
32931         des_xmlExpCtxtPtr(n_ctxt, ctxt, 0);
32932         des_xmlExpNodePtr(n_exp, exp, 1);
32933         des_const_xmlChar_ptr_ptr(n_tokList, tokList, 2);
32934         des_int(n_len, len, 3);
32935         xmlResetLastError();
32936         if (mem_base != xmlMemBlocks()) {
32937             printf("Leak of %d blocks found in xmlExpGetStart",
32938 	           xmlMemBlocks() - mem_base);
32939 	    test_ret++;
32940             printf(" %d", n_ctxt);
32941             printf(" %d", n_exp);
32942             printf(" %d", n_tokList);
32943             printf(" %d", n_len);
32944             printf("\n");
32945         }
32946     }
32947     }
32948     }
32949     }
32950     function_tests++;
32951 #endif
32952 
32953     return(test_ret);
32954 }
32955 
32956 
32957 static int
test_xmlExpIsNillable(void)32958 test_xmlExpIsNillable(void) {
32959     int test_ret = 0;
32960 
32961 #if defined(LIBXML_REGEXP_ENABLED) && defined(LIBXML_EXPR_ENABLED)
32962     int mem_base;
32963     int ret_val;
32964     xmlExpNodePtr exp; /* the expression */
32965     int n_exp;
32966 
32967     for (n_exp = 0;n_exp < gen_nb_xmlExpNodePtr;n_exp++) {
32968         mem_base = xmlMemBlocks();
32969         exp = gen_xmlExpNodePtr(n_exp, 0);
32970 
32971         ret_val = xmlExpIsNillable(exp);
32972         desret_int(ret_val);
32973         call_tests++;
32974         des_xmlExpNodePtr(n_exp, exp, 0);
32975         xmlResetLastError();
32976         if (mem_base != xmlMemBlocks()) {
32977             printf("Leak of %d blocks found in xmlExpIsNillable",
32978 	           xmlMemBlocks() - mem_base);
32979 	    test_ret++;
32980             printf(" %d", n_exp);
32981             printf("\n");
32982         }
32983     }
32984     function_tests++;
32985 #endif
32986 
32987     return(test_ret);
32988 }
32989 
32990 
32991 static int
test_xmlExpMaxToken(void)32992 test_xmlExpMaxToken(void) {
32993     int test_ret = 0;
32994 
32995 #if defined(LIBXML_REGEXP_ENABLED) && defined(LIBXML_EXPR_ENABLED)
32996     int mem_base;
32997     int ret_val;
32998     xmlExpNodePtr expr; /* a compiled expression */
32999     int n_expr;
33000 
33001     for (n_expr = 0;n_expr < gen_nb_xmlExpNodePtr;n_expr++) {
33002         mem_base = xmlMemBlocks();
33003         expr = gen_xmlExpNodePtr(n_expr, 0);
33004 
33005         ret_val = xmlExpMaxToken(expr);
33006         desret_int(ret_val);
33007         call_tests++;
33008         des_xmlExpNodePtr(n_expr, expr, 0);
33009         xmlResetLastError();
33010         if (mem_base != xmlMemBlocks()) {
33011             printf("Leak of %d blocks found in xmlExpMaxToken",
33012 	           xmlMemBlocks() - mem_base);
33013 	    test_ret++;
33014             printf(" %d", n_expr);
33015             printf("\n");
33016         }
33017     }
33018     function_tests++;
33019 #endif
33020 
33021     return(test_ret);
33022 }
33023 
33024 
33025 static int
test_xmlExpNewAtom(void)33026 test_xmlExpNewAtom(void) {
33027     int test_ret = 0;
33028 
33029 
33030     /* missing type support */
33031     return(test_ret);
33032 }
33033 
33034 
33035 static int
test_xmlExpNewCtxt(void)33036 test_xmlExpNewCtxt(void) {
33037     int test_ret = 0;
33038 
33039 
33040     /* missing type support */
33041     return(test_ret);
33042 }
33043 
33044 
33045 static int
test_xmlExpNewOr(void)33046 test_xmlExpNewOr(void) {
33047     int test_ret = 0;
33048 
33049 
33050     /* missing type support */
33051     return(test_ret);
33052 }
33053 
33054 
33055 static int
test_xmlExpNewRange(void)33056 test_xmlExpNewRange(void) {
33057     int test_ret = 0;
33058 
33059 
33060     /* missing type support */
33061     return(test_ret);
33062 }
33063 
33064 
33065 static int
test_xmlExpNewSeq(void)33066 test_xmlExpNewSeq(void) {
33067     int test_ret = 0;
33068 
33069 
33070     /* missing type support */
33071     return(test_ret);
33072 }
33073 
33074 
33075 static int
test_xmlExpParse(void)33076 test_xmlExpParse(void) {
33077     int test_ret = 0;
33078 
33079 
33080     /* missing type support */
33081     return(test_ret);
33082 }
33083 
33084 
33085 static int
test_xmlExpRef(void)33086 test_xmlExpRef(void) {
33087     int test_ret = 0;
33088 
33089 #if defined(LIBXML_REGEXP_ENABLED) && defined(LIBXML_EXPR_ENABLED)
33090     int mem_base;
33091     xmlExpNodePtr exp; /* the expression */
33092     int n_exp;
33093 
33094     for (n_exp = 0;n_exp < gen_nb_xmlExpNodePtr;n_exp++) {
33095         mem_base = xmlMemBlocks();
33096         exp = gen_xmlExpNodePtr(n_exp, 0);
33097 
33098         xmlExpRef(exp);
33099         call_tests++;
33100         des_xmlExpNodePtr(n_exp, exp, 0);
33101         xmlResetLastError();
33102         if (mem_base != xmlMemBlocks()) {
33103             printf("Leak of %d blocks found in xmlExpRef",
33104 	           xmlMemBlocks() - mem_base);
33105 	    test_ret++;
33106             printf(" %d", n_exp);
33107             printf("\n");
33108         }
33109     }
33110     function_tests++;
33111 #endif
33112 
33113     return(test_ret);
33114 }
33115 
33116 
33117 static int
test_xmlExpStringDerive(void)33118 test_xmlExpStringDerive(void) {
33119     int test_ret = 0;
33120 
33121 
33122     /* missing type support */
33123     return(test_ret);
33124 }
33125 
33126 
33127 static int
test_xmlExpSubsume(void)33128 test_xmlExpSubsume(void) {
33129     int test_ret = 0;
33130 
33131 #if defined(LIBXML_REGEXP_ENABLED) && defined(LIBXML_EXPR_ENABLED)
33132     int mem_base;
33133     int ret_val;
33134     xmlExpCtxtPtr ctxt; /* the expressions context */
33135     int n_ctxt;
33136     xmlExpNodePtr exp; /* the englobing expression */
33137     int n_exp;
33138     xmlExpNodePtr sub; /* the subexpression */
33139     int n_sub;
33140 
33141     for (n_ctxt = 0;n_ctxt < gen_nb_xmlExpCtxtPtr;n_ctxt++) {
33142     for (n_exp = 0;n_exp < gen_nb_xmlExpNodePtr;n_exp++) {
33143     for (n_sub = 0;n_sub < gen_nb_xmlExpNodePtr;n_sub++) {
33144         mem_base = xmlMemBlocks();
33145         ctxt = gen_xmlExpCtxtPtr(n_ctxt, 0);
33146         exp = gen_xmlExpNodePtr(n_exp, 1);
33147         sub = gen_xmlExpNodePtr(n_sub, 2);
33148 
33149         ret_val = xmlExpSubsume(ctxt, exp, sub);
33150         desret_int(ret_val);
33151         call_tests++;
33152         des_xmlExpCtxtPtr(n_ctxt, ctxt, 0);
33153         des_xmlExpNodePtr(n_exp, exp, 1);
33154         des_xmlExpNodePtr(n_sub, sub, 2);
33155         xmlResetLastError();
33156         if (mem_base != xmlMemBlocks()) {
33157             printf("Leak of %d blocks found in xmlExpSubsume",
33158 	           xmlMemBlocks() - mem_base);
33159 	    test_ret++;
33160             printf(" %d", n_ctxt);
33161             printf(" %d", n_exp);
33162             printf(" %d", n_sub);
33163             printf("\n");
33164         }
33165     }
33166     }
33167     }
33168     function_tests++;
33169 #endif
33170 
33171     return(test_ret);
33172 }
33173 
33174 #ifdef LIBXML_REGEXP_ENABLED
33175 
33176 #define gen_nb_xmlRegExecCtxtPtr 1
33177 #define gen_xmlRegExecCtxtPtr(no, nr) NULL
33178 #define des_xmlRegExecCtxtPtr(no, val, nr)
33179 #endif
33180 
33181 
33182 static int
test_xmlRegExecErrInfo(void)33183 test_xmlRegExecErrInfo(void) {
33184     int test_ret = 0;
33185 
33186 #if defined(LIBXML_REGEXP_ENABLED)
33187     int mem_base;
33188     int ret_val;
33189     xmlRegExecCtxtPtr exec; /* a regexp execution context generating an error */
33190     int n_exec;
33191     const xmlChar ** string; /* return value for the error string */
33192     int n_string;
33193     int * nbval; /* pointer to the number of accepted values IN/OUT */
33194     int n_nbval;
33195     int * nbneg; /* return number of negative transitions */
33196     int n_nbneg;
33197     xmlChar ** values; /* pointer to the array of acceptable values */
33198     int n_values;
33199     int * terminal; /* return value if this was a terminal state */
33200     int n_terminal;
33201 
33202     for (n_exec = 0;n_exec < gen_nb_xmlRegExecCtxtPtr;n_exec++) {
33203     for (n_string = 0;n_string < gen_nb_const_xmlChar_ptr_ptr;n_string++) {
33204     for (n_nbval = 0;n_nbval < gen_nb_int_ptr;n_nbval++) {
33205     for (n_nbneg = 0;n_nbneg < gen_nb_int_ptr;n_nbneg++) {
33206     for (n_values = 0;n_values < gen_nb_xmlChar_ptr_ptr;n_values++) {
33207     for (n_terminal = 0;n_terminal < gen_nb_int_ptr;n_terminal++) {
33208         mem_base = xmlMemBlocks();
33209         exec = gen_xmlRegExecCtxtPtr(n_exec, 0);
33210         string = gen_const_xmlChar_ptr_ptr(n_string, 1);
33211         nbval = gen_int_ptr(n_nbval, 2);
33212         nbneg = gen_int_ptr(n_nbneg, 3);
33213         values = gen_xmlChar_ptr_ptr(n_values, 4);
33214         terminal = gen_int_ptr(n_terminal, 5);
33215 
33216         ret_val = xmlRegExecErrInfo(exec, string, nbval, nbneg, values, terminal);
33217         desret_int(ret_val);
33218         call_tests++;
33219         des_xmlRegExecCtxtPtr(n_exec, exec, 0);
33220         des_const_xmlChar_ptr_ptr(n_string, string, 1);
33221         des_int_ptr(n_nbval, nbval, 2);
33222         des_int_ptr(n_nbneg, nbneg, 3);
33223         des_xmlChar_ptr_ptr(n_values, values, 4);
33224         des_int_ptr(n_terminal, terminal, 5);
33225         xmlResetLastError();
33226         if (mem_base != xmlMemBlocks()) {
33227             printf("Leak of %d blocks found in xmlRegExecErrInfo",
33228 	           xmlMemBlocks() - mem_base);
33229 	    test_ret++;
33230             printf(" %d", n_exec);
33231             printf(" %d", n_string);
33232             printf(" %d", n_nbval);
33233             printf(" %d", n_nbneg);
33234             printf(" %d", n_values);
33235             printf(" %d", n_terminal);
33236             printf("\n");
33237         }
33238     }
33239     }
33240     }
33241     }
33242     }
33243     }
33244     function_tests++;
33245 #endif
33246 
33247     return(test_ret);
33248 }
33249 
33250 
33251 static int
test_xmlRegExecNextValues(void)33252 test_xmlRegExecNextValues(void) {
33253     int test_ret = 0;
33254 
33255 #if defined(LIBXML_REGEXP_ENABLED)
33256     int mem_base;
33257     int ret_val;
33258     xmlRegExecCtxtPtr exec; /* a regexp execution context */
33259     int n_exec;
33260     int * nbval; /* pointer to the number of accepted values IN/OUT */
33261     int n_nbval;
33262     int * nbneg; /* return number of negative transitions */
33263     int n_nbneg;
33264     xmlChar ** values; /* pointer to the array of acceptable values */
33265     int n_values;
33266     int * terminal; /* return value if this was a terminal state */
33267     int n_terminal;
33268 
33269     for (n_exec = 0;n_exec < gen_nb_xmlRegExecCtxtPtr;n_exec++) {
33270     for (n_nbval = 0;n_nbval < gen_nb_int_ptr;n_nbval++) {
33271     for (n_nbneg = 0;n_nbneg < gen_nb_int_ptr;n_nbneg++) {
33272     for (n_values = 0;n_values < gen_nb_xmlChar_ptr_ptr;n_values++) {
33273     for (n_terminal = 0;n_terminal < gen_nb_int_ptr;n_terminal++) {
33274         mem_base = xmlMemBlocks();
33275         exec = gen_xmlRegExecCtxtPtr(n_exec, 0);
33276         nbval = gen_int_ptr(n_nbval, 1);
33277         nbneg = gen_int_ptr(n_nbneg, 2);
33278         values = gen_xmlChar_ptr_ptr(n_values, 3);
33279         terminal = gen_int_ptr(n_terminal, 4);
33280 
33281         ret_val = xmlRegExecNextValues(exec, nbval, nbneg, values, terminal);
33282         desret_int(ret_val);
33283         call_tests++;
33284         des_xmlRegExecCtxtPtr(n_exec, exec, 0);
33285         des_int_ptr(n_nbval, nbval, 1);
33286         des_int_ptr(n_nbneg, nbneg, 2);
33287         des_xmlChar_ptr_ptr(n_values, values, 3);
33288         des_int_ptr(n_terminal, terminal, 4);
33289         xmlResetLastError();
33290         if (mem_base != xmlMemBlocks()) {
33291             printf("Leak of %d blocks found in xmlRegExecNextValues",
33292 	           xmlMemBlocks() - mem_base);
33293 	    test_ret++;
33294             printf(" %d", n_exec);
33295             printf(" %d", n_nbval);
33296             printf(" %d", n_nbneg);
33297             printf(" %d", n_values);
33298             printf(" %d", n_terminal);
33299             printf("\n");
33300         }
33301     }
33302     }
33303     }
33304     }
33305     }
33306     function_tests++;
33307 #endif
33308 
33309     return(test_ret);
33310 }
33311 
33312 
33313 static int
test_xmlRegExecPushString(void)33314 test_xmlRegExecPushString(void) {
33315     int test_ret = 0;
33316 
33317 #if defined(LIBXML_REGEXP_ENABLED)
33318     int mem_base;
33319     int ret_val;
33320     xmlRegExecCtxtPtr exec; /* a regexp execution context or NULL to indicate the end */
33321     int n_exec;
33322     const xmlChar * value; /* a string token input */
33323     int n_value;
33324     void * data; /* data associated to the token to reuse in callbacks */
33325     int n_data;
33326 
33327     for (n_exec = 0;n_exec < gen_nb_xmlRegExecCtxtPtr;n_exec++) {
33328     for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
33329     for (n_data = 0;n_data < gen_nb_userdata;n_data++) {
33330         mem_base = xmlMemBlocks();
33331         exec = gen_xmlRegExecCtxtPtr(n_exec, 0);
33332         value = gen_const_xmlChar_ptr(n_value, 1);
33333         data = gen_userdata(n_data, 2);
33334 
33335         ret_val = xmlRegExecPushString(exec, value, data);
33336         desret_int(ret_val);
33337         call_tests++;
33338         des_xmlRegExecCtxtPtr(n_exec, exec, 0);
33339         des_const_xmlChar_ptr(n_value, value, 1);
33340         des_userdata(n_data, data, 2);
33341         xmlResetLastError();
33342         if (mem_base != xmlMemBlocks()) {
33343             printf("Leak of %d blocks found in xmlRegExecPushString",
33344 	           xmlMemBlocks() - mem_base);
33345 	    test_ret++;
33346             printf(" %d", n_exec);
33347             printf(" %d", n_value);
33348             printf(" %d", n_data);
33349             printf("\n");
33350         }
33351     }
33352     }
33353     }
33354     function_tests++;
33355 #endif
33356 
33357     return(test_ret);
33358 }
33359 
33360 
33361 static int
test_xmlRegExecPushString2(void)33362 test_xmlRegExecPushString2(void) {
33363     int test_ret = 0;
33364 
33365 #if defined(LIBXML_REGEXP_ENABLED)
33366     int mem_base;
33367     int ret_val;
33368     xmlRegExecCtxtPtr exec; /* a regexp execution context or NULL to indicate the end */
33369     int n_exec;
33370     const xmlChar * value; /* the first string token input */
33371     int n_value;
33372     const xmlChar * value2; /* the second string token input */
33373     int n_value2;
33374     void * data; /* data associated to the token to reuse in callbacks */
33375     int n_data;
33376 
33377     for (n_exec = 0;n_exec < gen_nb_xmlRegExecCtxtPtr;n_exec++) {
33378     for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
33379     for (n_value2 = 0;n_value2 < gen_nb_const_xmlChar_ptr;n_value2++) {
33380     for (n_data = 0;n_data < gen_nb_userdata;n_data++) {
33381         mem_base = xmlMemBlocks();
33382         exec = gen_xmlRegExecCtxtPtr(n_exec, 0);
33383         value = gen_const_xmlChar_ptr(n_value, 1);
33384         value2 = gen_const_xmlChar_ptr(n_value2, 2);
33385         data = gen_userdata(n_data, 3);
33386 
33387         ret_val = xmlRegExecPushString2(exec, value, value2, data);
33388         desret_int(ret_val);
33389         call_tests++;
33390         des_xmlRegExecCtxtPtr(n_exec, exec, 0);
33391         des_const_xmlChar_ptr(n_value, value, 1);
33392         des_const_xmlChar_ptr(n_value2, value2, 2);
33393         des_userdata(n_data, data, 3);
33394         xmlResetLastError();
33395         if (mem_base != xmlMemBlocks()) {
33396             printf("Leak of %d blocks found in xmlRegExecPushString2",
33397 	           xmlMemBlocks() - mem_base);
33398 	    test_ret++;
33399             printf(" %d", n_exec);
33400             printf(" %d", n_value);
33401             printf(" %d", n_value2);
33402             printf(" %d", n_data);
33403             printf("\n");
33404         }
33405     }
33406     }
33407     }
33408     }
33409     function_tests++;
33410 #endif
33411 
33412     return(test_ret);
33413 }
33414 
33415 
33416 static int
test_xmlRegNewExecCtxt(void)33417 test_xmlRegNewExecCtxt(void) {
33418     int test_ret = 0;
33419 
33420 
33421     /* missing type support */
33422     return(test_ret);
33423 }
33424 
33425 
33426 static int
test_xmlRegexpCompile(void)33427 test_xmlRegexpCompile(void) {
33428     int test_ret = 0;
33429 
33430 
33431     /* missing type support */
33432     return(test_ret);
33433 }
33434 
33435 #ifdef LIBXML_REGEXP_ENABLED
33436 
33437 #define gen_nb_xmlRegexpPtr 1
33438 #define gen_xmlRegexpPtr(no, nr) NULL
33439 #define des_xmlRegexpPtr(no, val, nr)
33440 #endif
33441 
33442 
33443 static int
test_xmlRegexpExec(void)33444 test_xmlRegexpExec(void) {
33445     int test_ret = 0;
33446 
33447 #if defined(LIBXML_REGEXP_ENABLED)
33448     int mem_base;
33449     int ret_val;
33450     xmlRegexpPtr comp; /* the compiled regular expression */
33451     int n_comp;
33452     const xmlChar * content; /* the value to check against the regular expression */
33453     int n_content;
33454 
33455     for (n_comp = 0;n_comp < gen_nb_xmlRegexpPtr;n_comp++) {
33456     for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
33457         mem_base = xmlMemBlocks();
33458         comp = gen_xmlRegexpPtr(n_comp, 0);
33459         content = gen_const_xmlChar_ptr(n_content, 1);
33460 
33461         ret_val = xmlRegexpExec(comp, content);
33462         desret_int(ret_val);
33463         call_tests++;
33464         des_xmlRegexpPtr(n_comp, comp, 0);
33465         des_const_xmlChar_ptr(n_content, content, 1);
33466         xmlResetLastError();
33467         if (mem_base != xmlMemBlocks()) {
33468             printf("Leak of %d blocks found in xmlRegexpExec",
33469 	           xmlMemBlocks() - mem_base);
33470 	    test_ret++;
33471             printf(" %d", n_comp);
33472             printf(" %d", n_content);
33473             printf("\n");
33474         }
33475     }
33476     }
33477     function_tests++;
33478 #endif
33479 
33480     return(test_ret);
33481 }
33482 
33483 
33484 static int
test_xmlRegexpIsDeterminist(void)33485 test_xmlRegexpIsDeterminist(void) {
33486     int test_ret = 0;
33487 
33488 #if defined(LIBXML_REGEXP_ENABLED)
33489     int mem_base;
33490     int ret_val;
33491     xmlRegexpPtr comp; /* the compiled regular expression */
33492     int n_comp;
33493 
33494     for (n_comp = 0;n_comp < gen_nb_xmlRegexpPtr;n_comp++) {
33495         mem_base = xmlMemBlocks();
33496         comp = gen_xmlRegexpPtr(n_comp, 0);
33497 
33498         ret_val = xmlRegexpIsDeterminist(comp);
33499         desret_int(ret_val);
33500         call_tests++;
33501         des_xmlRegexpPtr(n_comp, comp, 0);
33502         xmlResetLastError();
33503         if (mem_base != xmlMemBlocks()) {
33504             printf("Leak of %d blocks found in xmlRegexpIsDeterminist",
33505 	           xmlMemBlocks() - mem_base);
33506 	    test_ret++;
33507             printf(" %d", n_comp);
33508             printf("\n");
33509         }
33510     }
33511     function_tests++;
33512 #endif
33513 
33514     return(test_ret);
33515 }
33516 
33517 
33518 static int
test_xmlRegexpPrint(void)33519 test_xmlRegexpPrint(void) {
33520     int test_ret = 0;
33521 
33522 #if defined(LIBXML_REGEXP_ENABLED)
33523     int mem_base;
33524     FILE * output; /* the file for the output debug */
33525     int n_output;
33526     xmlRegexpPtr regexp; /* the compiled regexp */
33527     int n_regexp;
33528 
33529     for (n_output = 0;n_output < gen_nb_FILE_ptr;n_output++) {
33530     for (n_regexp = 0;n_regexp < gen_nb_xmlRegexpPtr;n_regexp++) {
33531         mem_base = xmlMemBlocks();
33532         output = gen_FILE_ptr(n_output, 0);
33533         regexp = gen_xmlRegexpPtr(n_regexp, 1);
33534 
33535         xmlRegexpPrint(output, regexp);
33536         call_tests++;
33537         des_FILE_ptr(n_output, output, 0);
33538         des_xmlRegexpPtr(n_regexp, regexp, 1);
33539         xmlResetLastError();
33540         if (mem_base != xmlMemBlocks()) {
33541             printf("Leak of %d blocks found in xmlRegexpPrint",
33542 	           xmlMemBlocks() - mem_base);
33543 	    test_ret++;
33544             printf(" %d", n_output);
33545             printf(" %d", n_regexp);
33546             printf("\n");
33547         }
33548     }
33549     }
33550     function_tests++;
33551 #endif
33552 
33553     return(test_ret);
33554 }
33555 
33556 static int
test_xmlregexp(void)33557 test_xmlregexp(void) {
33558     int test_ret = 0;
33559 
33560     if (quiet == 0) printf("Testing xmlregexp : 16 of 30 functions ...\n");
33561     test_ret += test_xmlExpCtxtNbCons();
33562     test_ret += test_xmlExpCtxtNbNodes();
33563     test_ret += test_xmlExpDump();
33564     test_ret += test_xmlExpExpDerive();
33565     test_ret += test_xmlExpGetLanguage();
33566     test_ret += test_xmlExpGetStart();
33567     test_ret += test_xmlExpIsNillable();
33568     test_ret += test_xmlExpMaxToken();
33569     test_ret += test_xmlExpNewAtom();
33570     test_ret += test_xmlExpNewCtxt();
33571     test_ret += test_xmlExpNewOr();
33572     test_ret += test_xmlExpNewRange();
33573     test_ret += test_xmlExpNewSeq();
33574     test_ret += test_xmlExpParse();
33575     test_ret += test_xmlExpRef();
33576     test_ret += test_xmlExpStringDerive();
33577     test_ret += test_xmlExpSubsume();
33578     test_ret += test_xmlRegExecErrInfo();
33579     test_ret += test_xmlRegExecNextValues();
33580     test_ret += test_xmlRegExecPushString();
33581     test_ret += test_xmlRegExecPushString2();
33582     test_ret += test_xmlRegNewExecCtxt();
33583     test_ret += test_xmlRegexpCompile();
33584     test_ret += test_xmlRegexpExec();
33585     test_ret += test_xmlRegexpIsDeterminist();
33586     test_ret += test_xmlRegexpPrint();
33587 
33588     if (test_ret != 0)
33589 	printf("Module xmlregexp: %d errors\n", test_ret);
33590     return(test_ret);
33591 }
33592 #ifdef LIBXML_OUTPUT_ENABLED
33593 
33594 #define gen_nb_xmlSaveCtxtPtr 1
33595 #define gen_xmlSaveCtxtPtr(no, nr) NULL
33596 #define des_xmlSaveCtxtPtr(no, val, nr)
33597 #endif
33598 
33599 
33600 static int
test_xmlSaveClose(void)33601 test_xmlSaveClose(void) {
33602     int test_ret = 0;
33603 
33604 #if defined(LIBXML_OUTPUT_ENABLED)
33605     int mem_base;
33606     int ret_val;
33607     xmlSaveCtxtPtr ctxt; /* a document saving context */
33608     int n_ctxt;
33609 
33610     for (n_ctxt = 0;n_ctxt < gen_nb_xmlSaveCtxtPtr;n_ctxt++) {
33611         mem_base = xmlMemBlocks();
33612         ctxt = gen_xmlSaveCtxtPtr(n_ctxt, 0);
33613 
33614         ret_val = xmlSaveClose(ctxt);
33615         desret_int(ret_val);
33616         call_tests++;
33617         des_xmlSaveCtxtPtr(n_ctxt, ctxt, 0);
33618         xmlResetLastError();
33619         if (mem_base != xmlMemBlocks()) {
33620             printf("Leak of %d blocks found in xmlSaveClose",
33621 	           xmlMemBlocks() - mem_base);
33622 	    test_ret++;
33623             printf(" %d", n_ctxt);
33624             printf("\n");
33625         }
33626     }
33627     function_tests++;
33628 #endif
33629 
33630     return(test_ret);
33631 }
33632 
33633 
33634 static int
test_xmlSaveDoc(void)33635 test_xmlSaveDoc(void) {
33636     int test_ret = 0;
33637 
33638 #if defined(LIBXML_OUTPUT_ENABLED)
33639     int mem_base;
33640     long ret_val;
33641     xmlSaveCtxtPtr ctxt; /* a document saving context */
33642     int n_ctxt;
33643     xmlDocPtr doc; /* a document */
33644     int n_doc;
33645 
33646     for (n_ctxt = 0;n_ctxt < gen_nb_xmlSaveCtxtPtr;n_ctxt++) {
33647     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
33648         mem_base = xmlMemBlocks();
33649         ctxt = gen_xmlSaveCtxtPtr(n_ctxt, 0);
33650         doc = gen_xmlDocPtr(n_doc, 1);
33651 
33652         ret_val = xmlSaveDoc(ctxt, doc);
33653         desret_long(ret_val);
33654         call_tests++;
33655         des_xmlSaveCtxtPtr(n_ctxt, ctxt, 0);
33656         des_xmlDocPtr(n_doc, doc, 1);
33657         xmlResetLastError();
33658         if (mem_base != xmlMemBlocks()) {
33659             printf("Leak of %d blocks found in xmlSaveDoc",
33660 	           xmlMemBlocks() - mem_base);
33661 	    test_ret++;
33662             printf(" %d", n_ctxt);
33663             printf(" %d", n_doc);
33664             printf("\n");
33665         }
33666     }
33667     }
33668     function_tests++;
33669 #endif
33670 
33671     return(test_ret);
33672 }
33673 
33674 
33675 static int
test_xmlSaveFlush(void)33676 test_xmlSaveFlush(void) {
33677     int test_ret = 0;
33678 
33679 #if defined(LIBXML_OUTPUT_ENABLED)
33680     int mem_base;
33681     int ret_val;
33682     xmlSaveCtxtPtr ctxt; /* a document saving context */
33683     int n_ctxt;
33684 
33685     for (n_ctxt = 0;n_ctxt < gen_nb_xmlSaveCtxtPtr;n_ctxt++) {
33686         mem_base = xmlMemBlocks();
33687         ctxt = gen_xmlSaveCtxtPtr(n_ctxt, 0);
33688 
33689         ret_val = xmlSaveFlush(ctxt);
33690         desret_int(ret_val);
33691         call_tests++;
33692         des_xmlSaveCtxtPtr(n_ctxt, ctxt, 0);
33693         xmlResetLastError();
33694         if (mem_base != xmlMemBlocks()) {
33695             printf("Leak of %d blocks found in xmlSaveFlush",
33696 	           xmlMemBlocks() - mem_base);
33697 	    test_ret++;
33698             printf(" %d", n_ctxt);
33699             printf("\n");
33700         }
33701     }
33702     function_tests++;
33703 #endif
33704 
33705     return(test_ret);
33706 }
33707 
33708 
33709 static int
test_xmlSaveSetAttrEscape(void)33710 test_xmlSaveSetAttrEscape(void) {
33711     int test_ret = 0;
33712 
33713 
33714     /* missing type support */
33715     return(test_ret);
33716 }
33717 
33718 
33719 static int
test_xmlSaveSetEscape(void)33720 test_xmlSaveSetEscape(void) {
33721     int test_ret = 0;
33722 
33723 
33724     /* missing type support */
33725     return(test_ret);
33726 }
33727 
33728 
33729 static int
test_xmlSaveToBuffer(void)33730 test_xmlSaveToBuffer(void) {
33731     int test_ret = 0;
33732 
33733 
33734     /* missing type support */
33735     return(test_ret);
33736 }
33737 
33738 
33739 static int
test_xmlSaveToFd(void)33740 test_xmlSaveToFd(void) {
33741     int test_ret = 0;
33742 
33743 
33744     /* missing type support */
33745     return(test_ret);
33746 }
33747 
33748 
33749 static int
test_xmlSaveToFilename(void)33750 test_xmlSaveToFilename(void) {
33751     int test_ret = 0;
33752 
33753 
33754     /* missing type support */
33755     return(test_ret);
33756 }
33757 
33758 
33759 static int
test_xmlSaveTree(void)33760 test_xmlSaveTree(void) {
33761     int test_ret = 0;
33762 
33763 #if defined(LIBXML_OUTPUT_ENABLED)
33764     int mem_base;
33765     long ret_val;
33766     xmlSaveCtxtPtr ctxt; /* a document saving context */
33767     int n_ctxt;
33768     xmlNodePtr cur; /* the top node of the subtree to save */
33769     int n_cur;
33770 
33771     for (n_ctxt = 0;n_ctxt < gen_nb_xmlSaveCtxtPtr;n_ctxt++) {
33772     for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
33773         mem_base = xmlMemBlocks();
33774         ctxt = gen_xmlSaveCtxtPtr(n_ctxt, 0);
33775         cur = gen_xmlNodePtr(n_cur, 1);
33776 
33777         ret_val = xmlSaveTree(ctxt, cur);
33778         desret_long(ret_val);
33779         call_tests++;
33780         des_xmlSaveCtxtPtr(n_ctxt, ctxt, 0);
33781         des_xmlNodePtr(n_cur, cur, 1);
33782         xmlResetLastError();
33783         if (mem_base != xmlMemBlocks()) {
33784             printf("Leak of %d blocks found in xmlSaveTree",
33785 	           xmlMemBlocks() - mem_base);
33786 	    test_ret++;
33787             printf(" %d", n_ctxt);
33788             printf(" %d", n_cur);
33789             printf("\n");
33790         }
33791     }
33792     }
33793     function_tests++;
33794 #endif
33795 
33796     return(test_ret);
33797 }
33798 
33799 
33800 static int
test_xmlThrDefIndentTreeOutput(void)33801 test_xmlThrDefIndentTreeOutput(void) {
33802     int test_ret = 0;
33803 
33804 #if defined(LIBXML_OUTPUT_ENABLED)
33805     int mem_base;
33806     int ret_val;
33807     int v; /*  */
33808     int n_v;
33809 
33810     for (n_v = 0;n_v < gen_nb_int;n_v++) {
33811         mem_base = xmlMemBlocks();
33812         v = gen_int(n_v, 0);
33813 
33814         ret_val = xmlThrDefIndentTreeOutput(v);
33815         desret_int(ret_val);
33816         call_tests++;
33817         des_int(n_v, v, 0);
33818         xmlResetLastError();
33819         if (mem_base != xmlMemBlocks()) {
33820             printf("Leak of %d blocks found in xmlThrDefIndentTreeOutput",
33821 	           xmlMemBlocks() - mem_base);
33822 	    test_ret++;
33823             printf(" %d", n_v);
33824             printf("\n");
33825         }
33826     }
33827     function_tests++;
33828 #endif
33829 
33830     return(test_ret);
33831 }
33832 
33833 
33834 static int
test_xmlThrDefSaveNoEmptyTags(void)33835 test_xmlThrDefSaveNoEmptyTags(void) {
33836     int test_ret = 0;
33837 
33838 #if defined(LIBXML_OUTPUT_ENABLED)
33839     int mem_base;
33840     int ret_val;
33841     int v; /*  */
33842     int n_v;
33843 
33844     for (n_v = 0;n_v < gen_nb_int;n_v++) {
33845         mem_base = xmlMemBlocks();
33846         v = gen_int(n_v, 0);
33847 
33848         ret_val = xmlThrDefSaveNoEmptyTags(v);
33849         desret_int(ret_val);
33850         call_tests++;
33851         des_int(n_v, v, 0);
33852         xmlResetLastError();
33853         if (mem_base != xmlMemBlocks()) {
33854             printf("Leak of %d blocks found in xmlThrDefSaveNoEmptyTags",
33855 	           xmlMemBlocks() - mem_base);
33856 	    test_ret++;
33857             printf(" %d", n_v);
33858             printf("\n");
33859         }
33860     }
33861     function_tests++;
33862 #endif
33863 
33864     return(test_ret);
33865 }
33866 
33867 
33868 static int
test_xmlThrDefTreeIndentString(void)33869 test_xmlThrDefTreeIndentString(void) {
33870     int test_ret = 0;
33871 
33872 #if defined(LIBXML_OUTPUT_ENABLED)
33873     int mem_base;
33874     const char * ret_val;
33875     const char * v; /*  */
33876     int n_v;
33877 
33878     for (n_v = 0;n_v < gen_nb_const_char_ptr;n_v++) {
33879         mem_base = xmlMemBlocks();
33880         v = gen_const_char_ptr(n_v, 0);
33881 
33882         ret_val = xmlThrDefTreeIndentString(v);
33883         desret_const_char_ptr(ret_val);
33884         call_tests++;
33885         des_const_char_ptr(n_v, v, 0);
33886         xmlResetLastError();
33887         if (mem_base != xmlMemBlocks()) {
33888             printf("Leak of %d blocks found in xmlThrDefTreeIndentString",
33889 	           xmlMemBlocks() - mem_base);
33890 	    test_ret++;
33891             printf(" %d", n_v);
33892             printf("\n");
33893         }
33894     }
33895     function_tests++;
33896 #endif
33897 
33898     return(test_ret);
33899 }
33900 
33901 static int
test_xmlsave(void)33902 test_xmlsave(void) {
33903     int test_ret = 0;
33904 
33905     if (quiet == 0) printf("Testing xmlsave : 7 of 13 functions ...\n");
33906     test_ret += test_xmlSaveClose();
33907     test_ret += test_xmlSaveDoc();
33908     test_ret += test_xmlSaveFlush();
33909     test_ret += test_xmlSaveSetAttrEscape();
33910     test_ret += test_xmlSaveSetEscape();
33911     test_ret += test_xmlSaveToBuffer();
33912     test_ret += test_xmlSaveToFd();
33913     test_ret += test_xmlSaveToFilename();
33914     test_ret += test_xmlSaveTree();
33915     test_ret += test_xmlThrDefIndentTreeOutput();
33916     test_ret += test_xmlThrDefSaveNoEmptyTags();
33917     test_ret += test_xmlThrDefTreeIndentString();
33918 
33919     if (test_ret != 0)
33920 	printf("Module xmlsave: %d errors\n", test_ret);
33921     return(test_ret);
33922 }
33923 
33924 static int
test_xmlSchemaDump(void)33925 test_xmlSchemaDump(void) {
33926     int test_ret = 0;
33927 
33928 #if defined(LIBXML_SCHEMAS_ENABLED) && defined(LIBXML_OUTPUT_ENABLED)
33929     int mem_base;
33930     FILE * output; /* the file output */
33931     int n_output;
33932     xmlSchemaPtr schema; /* a schema structure */
33933     int n_schema;
33934 
33935     for (n_output = 0;n_output < gen_nb_FILE_ptr;n_output++) {
33936     for (n_schema = 0;n_schema < gen_nb_xmlSchemaPtr;n_schema++) {
33937         mem_base = xmlMemBlocks();
33938         output = gen_FILE_ptr(n_output, 0);
33939         schema = gen_xmlSchemaPtr(n_schema, 1);
33940 
33941         xmlSchemaDump(output, schema);
33942         call_tests++;
33943         des_FILE_ptr(n_output, output, 0);
33944         des_xmlSchemaPtr(n_schema, schema, 1);
33945         xmlResetLastError();
33946         if (mem_base != xmlMemBlocks()) {
33947             printf("Leak of %d blocks found in xmlSchemaDump",
33948 	           xmlMemBlocks() - mem_base);
33949 	    test_ret++;
33950             printf(" %d", n_output);
33951             printf(" %d", n_schema);
33952             printf("\n");
33953         }
33954     }
33955     }
33956     function_tests++;
33957 #endif
33958 
33959     return(test_ret);
33960 }
33961 
33962 #ifdef LIBXML_SCHEMAS_ENABLED
33963 
33964 #define gen_nb_xmlSchemaParserCtxtPtr 1
33965 #define gen_xmlSchemaParserCtxtPtr(no, nr) NULL
33966 #define des_xmlSchemaParserCtxtPtr(no, val, nr)
33967 #endif
33968 
33969 #ifdef LIBXML_SCHEMAS_ENABLED
33970 
33971 #define gen_nb_xmlSchemaValidityErrorFunc_ptr 1
33972 #define gen_xmlSchemaValidityErrorFunc_ptr(no, nr) NULL
33973 #define des_xmlSchemaValidityErrorFunc_ptr(no, val, nr)
33974 #endif
33975 
33976 #ifdef LIBXML_SCHEMAS_ENABLED
33977 
33978 #define gen_nb_xmlSchemaValidityWarningFunc_ptr 1
33979 #define gen_xmlSchemaValidityWarningFunc_ptr(no, nr) NULL
33980 #define des_xmlSchemaValidityWarningFunc_ptr(no, val, nr)
33981 #endif
33982 
33983 
33984 static int
test_xmlSchemaGetParserErrors(void)33985 test_xmlSchemaGetParserErrors(void) {
33986     int test_ret = 0;
33987 
33988 #if defined(LIBXML_SCHEMAS_ENABLED)
33989     int mem_base;
33990     int ret_val;
33991     xmlSchemaParserCtxtPtr ctxt; /* a XMl-Schema parser context */
33992     int n_ctxt;
33993     xmlSchemaValidityErrorFunc * err; /* the error callback result */
33994     int n_err;
33995     xmlSchemaValidityWarningFunc * warn; /* the warning callback result */
33996     int n_warn;
33997     void ** ctx; /* contextual data for the callbacks result */
33998     int n_ctx;
33999 
34000     for (n_ctxt = 0;n_ctxt < gen_nb_xmlSchemaParserCtxtPtr;n_ctxt++) {
34001     for (n_err = 0;n_err < gen_nb_xmlSchemaValidityErrorFunc_ptr;n_err++) {
34002     for (n_warn = 0;n_warn < gen_nb_xmlSchemaValidityWarningFunc_ptr;n_warn++) {
34003     for (n_ctx = 0;n_ctx < gen_nb_void_ptr_ptr;n_ctx++) {
34004         mem_base = xmlMemBlocks();
34005         ctxt = gen_xmlSchemaParserCtxtPtr(n_ctxt, 0);
34006         err = gen_xmlSchemaValidityErrorFunc_ptr(n_err, 1);
34007         warn = gen_xmlSchemaValidityWarningFunc_ptr(n_warn, 2);
34008         ctx = gen_void_ptr_ptr(n_ctx, 3);
34009 
34010         ret_val = xmlSchemaGetParserErrors(ctxt, err, warn, ctx);
34011         desret_int(ret_val);
34012         call_tests++;
34013         des_xmlSchemaParserCtxtPtr(n_ctxt, ctxt, 0);
34014         des_xmlSchemaValidityErrorFunc_ptr(n_err, err, 1);
34015         des_xmlSchemaValidityWarningFunc_ptr(n_warn, warn, 2);
34016         des_void_ptr_ptr(n_ctx, ctx, 3);
34017         xmlResetLastError();
34018         if (mem_base != xmlMemBlocks()) {
34019             printf("Leak of %d blocks found in xmlSchemaGetParserErrors",
34020 	           xmlMemBlocks() - mem_base);
34021 	    test_ret++;
34022             printf(" %d", n_ctxt);
34023             printf(" %d", n_err);
34024             printf(" %d", n_warn);
34025             printf(" %d", n_ctx);
34026             printf("\n");
34027         }
34028     }
34029     }
34030     }
34031     }
34032     function_tests++;
34033 #endif
34034 
34035     return(test_ret);
34036 }
34037 
34038 
34039 static int
test_xmlSchemaGetValidErrors(void)34040 test_xmlSchemaGetValidErrors(void) {
34041     int test_ret = 0;
34042 
34043 #if defined(LIBXML_SCHEMAS_ENABLED)
34044     int mem_base;
34045     int ret_val;
34046     xmlSchemaValidCtxtPtr ctxt; /* a XML-Schema validation context */
34047     int n_ctxt;
34048     xmlSchemaValidityErrorFunc * err; /* the error function result */
34049     int n_err;
34050     xmlSchemaValidityWarningFunc * warn; /* the warning function result */
34051     int n_warn;
34052     void ** ctx; /* the functions context result */
34053     int n_ctx;
34054 
34055     for (n_ctxt = 0;n_ctxt < gen_nb_xmlSchemaValidCtxtPtr;n_ctxt++) {
34056     for (n_err = 0;n_err < gen_nb_xmlSchemaValidityErrorFunc_ptr;n_err++) {
34057     for (n_warn = 0;n_warn < gen_nb_xmlSchemaValidityWarningFunc_ptr;n_warn++) {
34058     for (n_ctx = 0;n_ctx < gen_nb_void_ptr_ptr;n_ctx++) {
34059         mem_base = xmlMemBlocks();
34060         ctxt = gen_xmlSchemaValidCtxtPtr(n_ctxt, 0);
34061         err = gen_xmlSchemaValidityErrorFunc_ptr(n_err, 1);
34062         warn = gen_xmlSchemaValidityWarningFunc_ptr(n_warn, 2);
34063         ctx = gen_void_ptr_ptr(n_ctx, 3);
34064 
34065         ret_val = xmlSchemaGetValidErrors(ctxt, err, warn, ctx);
34066         desret_int(ret_val);
34067         call_tests++;
34068         des_xmlSchemaValidCtxtPtr(n_ctxt, ctxt, 0);
34069         des_xmlSchemaValidityErrorFunc_ptr(n_err, err, 1);
34070         des_xmlSchemaValidityWarningFunc_ptr(n_warn, warn, 2);
34071         des_void_ptr_ptr(n_ctx, ctx, 3);
34072         xmlResetLastError();
34073         if (mem_base != xmlMemBlocks()) {
34074             printf("Leak of %d blocks found in xmlSchemaGetValidErrors",
34075 	           xmlMemBlocks() - mem_base);
34076 	    test_ret++;
34077             printf(" %d", n_ctxt);
34078             printf(" %d", n_err);
34079             printf(" %d", n_warn);
34080             printf(" %d", n_ctx);
34081             printf("\n");
34082         }
34083     }
34084     }
34085     }
34086     }
34087     function_tests++;
34088 #endif
34089 
34090     return(test_ret);
34091 }
34092 
34093 
34094 static int
test_xmlSchemaIsValid(void)34095 test_xmlSchemaIsValid(void) {
34096     int test_ret = 0;
34097 
34098 #if defined(LIBXML_SCHEMAS_ENABLED)
34099     int mem_base;
34100     int ret_val;
34101     xmlSchemaValidCtxtPtr ctxt; /* the schema validation context */
34102     int n_ctxt;
34103 
34104     for (n_ctxt = 0;n_ctxt < gen_nb_xmlSchemaValidCtxtPtr;n_ctxt++) {
34105         mem_base = xmlMemBlocks();
34106         ctxt = gen_xmlSchemaValidCtxtPtr(n_ctxt, 0);
34107 
34108         ret_val = xmlSchemaIsValid(ctxt);
34109         desret_int(ret_val);
34110         call_tests++;
34111         des_xmlSchemaValidCtxtPtr(n_ctxt, ctxt, 0);
34112         xmlResetLastError();
34113         if (mem_base != xmlMemBlocks()) {
34114             printf("Leak of %d blocks found in xmlSchemaIsValid",
34115 	           xmlMemBlocks() - mem_base);
34116 	    test_ret++;
34117             printf(" %d", n_ctxt);
34118             printf("\n");
34119         }
34120     }
34121     function_tests++;
34122 #endif
34123 
34124     return(test_ret);
34125 }
34126 
34127 
34128 static int
test_xmlSchemaNewDocParserCtxt(void)34129 test_xmlSchemaNewDocParserCtxt(void) {
34130     int test_ret = 0;
34131 
34132 #if defined(LIBXML_SCHEMAS_ENABLED)
34133     int mem_base;
34134     xmlSchemaParserCtxtPtr ret_val;
34135     xmlDocPtr doc; /* a preparsed document tree */
34136     int n_doc;
34137 
34138     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
34139         mem_base = xmlMemBlocks();
34140         doc = gen_xmlDocPtr(n_doc, 0);
34141 
34142         ret_val = xmlSchemaNewDocParserCtxt(doc);
34143         desret_xmlSchemaParserCtxtPtr(ret_val);
34144         call_tests++;
34145         des_xmlDocPtr(n_doc, doc, 0);
34146         xmlResetLastError();
34147         if (mem_base != xmlMemBlocks()) {
34148             printf("Leak of %d blocks found in xmlSchemaNewDocParserCtxt",
34149 	           xmlMemBlocks() - mem_base);
34150 	    test_ret++;
34151             printf(" %d", n_doc);
34152             printf("\n");
34153         }
34154     }
34155     function_tests++;
34156 #endif
34157 
34158     return(test_ret);
34159 }
34160 
34161 
34162 static int
test_xmlSchemaNewMemParserCtxt(void)34163 test_xmlSchemaNewMemParserCtxt(void) {
34164     int test_ret = 0;
34165 
34166 #if defined(LIBXML_SCHEMAS_ENABLED)
34167     int mem_base;
34168     xmlSchemaParserCtxtPtr ret_val;
34169     const char * buffer; /* a pointer to a char array containing the schemas */
34170     int n_buffer;
34171     int size; /* the size of the array */
34172     int n_size;
34173 
34174     for (n_buffer = 0;n_buffer < gen_nb_const_char_ptr;n_buffer++) {
34175     for (n_size = 0;n_size < gen_nb_int;n_size++) {
34176         mem_base = xmlMemBlocks();
34177         buffer = gen_const_char_ptr(n_buffer, 0);
34178         size = gen_int(n_size, 1);
34179         if ((buffer != NULL) &&
34180             (size > xmlStrlen(BAD_CAST buffer)))
34181             size = 0;
34182 
34183         ret_val = xmlSchemaNewMemParserCtxt(buffer, size);
34184         desret_xmlSchemaParserCtxtPtr(ret_val);
34185         call_tests++;
34186         des_const_char_ptr(n_buffer, buffer, 0);
34187         des_int(n_size, size, 1);
34188         xmlResetLastError();
34189         if (mem_base != xmlMemBlocks()) {
34190             printf("Leak of %d blocks found in xmlSchemaNewMemParserCtxt",
34191 	           xmlMemBlocks() - mem_base);
34192 	    test_ret++;
34193             printf(" %d", n_buffer);
34194             printf(" %d", n_size);
34195             printf("\n");
34196         }
34197     }
34198     }
34199     function_tests++;
34200 #endif
34201 
34202     return(test_ret);
34203 }
34204 
34205 
34206 static int
test_xmlSchemaNewParserCtxt(void)34207 test_xmlSchemaNewParserCtxt(void) {
34208     int test_ret = 0;
34209 
34210 #if defined(LIBXML_SCHEMAS_ENABLED)
34211     int mem_base;
34212     xmlSchemaParserCtxtPtr ret_val;
34213     const char * URL; /* the location of the schema */
34214     int n_URL;
34215 
34216     for (n_URL = 0;n_URL < gen_nb_const_char_ptr;n_URL++) {
34217         mem_base = xmlMemBlocks();
34218         URL = gen_const_char_ptr(n_URL, 0);
34219 
34220         ret_val = xmlSchemaNewParserCtxt(URL);
34221         desret_xmlSchemaParserCtxtPtr(ret_val);
34222         call_tests++;
34223         des_const_char_ptr(n_URL, URL, 0);
34224         xmlResetLastError();
34225         if (mem_base != xmlMemBlocks()) {
34226             printf("Leak of %d blocks found in xmlSchemaNewParserCtxt",
34227 	           xmlMemBlocks() - mem_base);
34228 	    test_ret++;
34229             printf(" %d", n_URL);
34230             printf("\n");
34231         }
34232     }
34233     function_tests++;
34234 #endif
34235 
34236     return(test_ret);
34237 }
34238 
34239 
34240 static int
test_xmlSchemaNewValidCtxt(void)34241 test_xmlSchemaNewValidCtxt(void) {
34242     int test_ret = 0;
34243 
34244 
34245     /* missing type support */
34246     return(test_ret);
34247 }
34248 
34249 
34250 static int
test_xmlSchemaParse(void)34251 test_xmlSchemaParse(void) {
34252     int test_ret = 0;
34253 
34254 
34255     /* missing type support */
34256     return(test_ret);
34257 }
34258 
34259 
34260 static int
test_xmlSchemaSAXPlug(void)34261 test_xmlSchemaSAXPlug(void) {
34262     int test_ret = 0;
34263 
34264 
34265     /* missing type support */
34266     return(test_ret);
34267 }
34268 
34269 #ifdef LIBXML_SCHEMAS_ENABLED
34270 
34271 #define gen_nb_xmlSchemaSAXPlugPtr 1
34272 #define gen_xmlSchemaSAXPlugPtr(no, nr) NULL
34273 #define des_xmlSchemaSAXPlugPtr(no, val, nr)
34274 #endif
34275 
34276 
34277 static int
test_xmlSchemaSAXUnplug(void)34278 test_xmlSchemaSAXUnplug(void) {
34279     int test_ret = 0;
34280 
34281 #if defined(LIBXML_SCHEMAS_ENABLED)
34282     int mem_base;
34283     int ret_val;
34284     xmlSchemaSAXPlugPtr plug; /* a data structure returned by xmlSchemaSAXPlug */
34285     int n_plug;
34286 
34287     for (n_plug = 0;n_plug < gen_nb_xmlSchemaSAXPlugPtr;n_plug++) {
34288         mem_base = xmlMemBlocks();
34289         plug = gen_xmlSchemaSAXPlugPtr(n_plug, 0);
34290 
34291         ret_val = xmlSchemaSAXUnplug(plug);
34292         desret_int(ret_val);
34293         call_tests++;
34294         des_xmlSchemaSAXPlugPtr(n_plug, plug, 0);
34295         xmlResetLastError();
34296         if (mem_base != xmlMemBlocks()) {
34297             printf("Leak of %d blocks found in xmlSchemaSAXUnplug",
34298 	           xmlMemBlocks() - mem_base);
34299 	    test_ret++;
34300             printf(" %d", n_plug);
34301             printf("\n");
34302         }
34303     }
34304     function_tests++;
34305 #endif
34306 
34307     return(test_ret);
34308 }
34309 
34310 
34311 static int
test_xmlSchemaSetParserErrors(void)34312 test_xmlSchemaSetParserErrors(void) {
34313     int test_ret = 0;
34314 
34315 
34316     /* missing type support */
34317     return(test_ret);
34318 }
34319 
34320 
34321 static int
test_xmlSchemaSetParserStructuredErrors(void)34322 test_xmlSchemaSetParserStructuredErrors(void) {
34323     int test_ret = 0;
34324 
34325 
34326     /* missing type support */
34327     return(test_ret);
34328 }
34329 
34330 
34331 static int
test_xmlSchemaSetValidErrors(void)34332 test_xmlSchemaSetValidErrors(void) {
34333     int test_ret = 0;
34334 
34335 
34336     /* missing type support */
34337     return(test_ret);
34338 }
34339 
34340 
34341 static int
test_xmlSchemaSetValidOptions(void)34342 test_xmlSchemaSetValidOptions(void) {
34343     int test_ret = 0;
34344 
34345 #if defined(LIBXML_SCHEMAS_ENABLED)
34346     int mem_base;
34347     int ret_val;
34348     xmlSchemaValidCtxtPtr ctxt; /* a schema validation context */
34349     int n_ctxt;
34350     int options; /* a combination of xmlSchemaValidOption */
34351     int n_options;
34352 
34353     for (n_ctxt = 0;n_ctxt < gen_nb_xmlSchemaValidCtxtPtr;n_ctxt++) {
34354     for (n_options = 0;n_options < gen_nb_int;n_options++) {
34355         mem_base = xmlMemBlocks();
34356         ctxt = gen_xmlSchemaValidCtxtPtr(n_ctxt, 0);
34357         options = gen_int(n_options, 1);
34358 
34359         ret_val = xmlSchemaSetValidOptions(ctxt, options);
34360         desret_int(ret_val);
34361         call_tests++;
34362         des_xmlSchemaValidCtxtPtr(n_ctxt, ctxt, 0);
34363         des_int(n_options, options, 1);
34364         xmlResetLastError();
34365         if (mem_base != xmlMemBlocks()) {
34366             printf("Leak of %d blocks found in xmlSchemaSetValidOptions",
34367 	           xmlMemBlocks() - mem_base);
34368 	    test_ret++;
34369             printf(" %d", n_ctxt);
34370             printf(" %d", n_options);
34371             printf("\n");
34372         }
34373     }
34374     }
34375     function_tests++;
34376 #endif
34377 
34378     return(test_ret);
34379 }
34380 
34381 
34382 static int
test_xmlSchemaSetValidStructuredErrors(void)34383 test_xmlSchemaSetValidStructuredErrors(void) {
34384     int test_ret = 0;
34385 
34386 
34387     /* missing type support */
34388     return(test_ret);
34389 }
34390 
34391 
34392 static int
test_xmlSchemaValidCtxtGetOptions(void)34393 test_xmlSchemaValidCtxtGetOptions(void) {
34394     int test_ret = 0;
34395 
34396 #if defined(LIBXML_SCHEMAS_ENABLED)
34397     int mem_base;
34398     int ret_val;
34399     xmlSchemaValidCtxtPtr ctxt; /* a schema validation context */
34400     int n_ctxt;
34401 
34402     for (n_ctxt = 0;n_ctxt < gen_nb_xmlSchemaValidCtxtPtr;n_ctxt++) {
34403         mem_base = xmlMemBlocks();
34404         ctxt = gen_xmlSchemaValidCtxtPtr(n_ctxt, 0);
34405 
34406         ret_val = xmlSchemaValidCtxtGetOptions(ctxt);
34407         desret_int(ret_val);
34408         call_tests++;
34409         des_xmlSchemaValidCtxtPtr(n_ctxt, ctxt, 0);
34410         xmlResetLastError();
34411         if (mem_base != xmlMemBlocks()) {
34412             printf("Leak of %d blocks found in xmlSchemaValidCtxtGetOptions",
34413 	           xmlMemBlocks() - mem_base);
34414 	    test_ret++;
34415             printf(" %d", n_ctxt);
34416             printf("\n");
34417         }
34418     }
34419     function_tests++;
34420 #endif
34421 
34422     return(test_ret);
34423 }
34424 
34425 
34426 static int
test_xmlSchemaValidCtxtGetParserCtxt(void)34427 test_xmlSchemaValidCtxtGetParserCtxt(void) {
34428     int test_ret = 0;
34429 
34430 #if defined(LIBXML_SCHEMAS_ENABLED)
34431     int mem_base;
34432     xmlParserCtxtPtr ret_val;
34433     xmlSchemaValidCtxtPtr ctxt; /* a schema validation context */
34434     int n_ctxt;
34435 
34436     for (n_ctxt = 0;n_ctxt < gen_nb_xmlSchemaValidCtxtPtr;n_ctxt++) {
34437         mem_base = xmlMemBlocks();
34438         ctxt = gen_xmlSchemaValidCtxtPtr(n_ctxt, 0);
34439 
34440         ret_val = xmlSchemaValidCtxtGetParserCtxt(ctxt);
34441         desret_xmlParserCtxtPtr(ret_val);
34442         call_tests++;
34443         des_xmlSchemaValidCtxtPtr(n_ctxt, ctxt, 0);
34444         xmlResetLastError();
34445         if (mem_base != xmlMemBlocks()) {
34446             printf("Leak of %d blocks found in xmlSchemaValidCtxtGetParserCtxt",
34447 	           xmlMemBlocks() - mem_base);
34448 	    test_ret++;
34449             printf(" %d", n_ctxt);
34450             printf("\n");
34451         }
34452     }
34453     function_tests++;
34454 #endif
34455 
34456     return(test_ret);
34457 }
34458 
34459 
34460 static int
test_xmlSchemaValidateDoc(void)34461 test_xmlSchemaValidateDoc(void) {
34462     int test_ret = 0;
34463 
34464 #if defined(LIBXML_SCHEMAS_ENABLED)
34465     int mem_base;
34466     int ret_val;
34467     xmlSchemaValidCtxtPtr ctxt; /* a schema validation context */
34468     int n_ctxt;
34469     xmlDocPtr doc; /* a parsed document tree */
34470     int n_doc;
34471 
34472     for (n_ctxt = 0;n_ctxt < gen_nb_xmlSchemaValidCtxtPtr;n_ctxt++) {
34473     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
34474         mem_base = xmlMemBlocks();
34475         ctxt = gen_xmlSchemaValidCtxtPtr(n_ctxt, 0);
34476         doc = gen_xmlDocPtr(n_doc, 1);
34477 
34478         ret_val = xmlSchemaValidateDoc(ctxt, doc);
34479         desret_int(ret_val);
34480         call_tests++;
34481         des_xmlSchemaValidCtxtPtr(n_ctxt, ctxt, 0);
34482         des_xmlDocPtr(n_doc, doc, 1);
34483         xmlResetLastError();
34484         if (mem_base != xmlMemBlocks()) {
34485             printf("Leak of %d blocks found in xmlSchemaValidateDoc",
34486 	           xmlMemBlocks() - mem_base);
34487 	    test_ret++;
34488             printf(" %d", n_ctxt);
34489             printf(" %d", n_doc);
34490             printf("\n");
34491         }
34492     }
34493     }
34494     function_tests++;
34495 #endif
34496 
34497     return(test_ret);
34498 }
34499 
34500 
34501 static int
test_xmlSchemaValidateFile(void)34502 test_xmlSchemaValidateFile(void) {
34503     int test_ret = 0;
34504 
34505 #if defined(LIBXML_SCHEMAS_ENABLED)
34506     int mem_base;
34507     int ret_val;
34508     xmlSchemaValidCtxtPtr ctxt; /* a schema validation context */
34509     int n_ctxt;
34510     const char * filename; /* the URI of the instance */
34511     int n_filename;
34512     int options; /* a future set of options, currently unused */
34513     int n_options;
34514 
34515     for (n_ctxt = 0;n_ctxt < gen_nb_xmlSchemaValidCtxtPtr;n_ctxt++) {
34516     for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
34517     for (n_options = 0;n_options < gen_nb_int;n_options++) {
34518         mem_base = xmlMemBlocks();
34519         ctxt = gen_xmlSchemaValidCtxtPtr(n_ctxt, 0);
34520         filename = gen_filepath(n_filename, 1);
34521         options = gen_int(n_options, 2);
34522 
34523         ret_val = xmlSchemaValidateFile(ctxt, filename, options);
34524         desret_int(ret_val);
34525         call_tests++;
34526         des_xmlSchemaValidCtxtPtr(n_ctxt, ctxt, 0);
34527         des_filepath(n_filename, filename, 1);
34528         des_int(n_options, options, 2);
34529         xmlResetLastError();
34530         if (mem_base != xmlMemBlocks()) {
34531             printf("Leak of %d blocks found in xmlSchemaValidateFile",
34532 	           xmlMemBlocks() - mem_base);
34533 	    test_ret++;
34534             printf(" %d", n_ctxt);
34535             printf(" %d", n_filename);
34536             printf(" %d", n_options);
34537             printf("\n");
34538         }
34539     }
34540     }
34541     }
34542     function_tests++;
34543 #endif
34544 
34545     return(test_ret);
34546 }
34547 
34548 
34549 static int
test_xmlSchemaValidateOneElement(void)34550 test_xmlSchemaValidateOneElement(void) {
34551     int test_ret = 0;
34552 
34553 #if defined(LIBXML_SCHEMAS_ENABLED)
34554     int mem_base;
34555     int ret_val;
34556     xmlSchemaValidCtxtPtr ctxt; /* a schema validation context */
34557     int n_ctxt;
34558     xmlNodePtr elem; /* an element node */
34559     int n_elem;
34560 
34561     for (n_ctxt = 0;n_ctxt < gen_nb_xmlSchemaValidCtxtPtr;n_ctxt++) {
34562     for (n_elem = 0;n_elem < gen_nb_xmlNodePtr;n_elem++) {
34563         mem_base = xmlMemBlocks();
34564         ctxt = gen_xmlSchemaValidCtxtPtr(n_ctxt, 0);
34565         elem = gen_xmlNodePtr(n_elem, 1);
34566 
34567         ret_val = xmlSchemaValidateOneElement(ctxt, elem);
34568         desret_int(ret_val);
34569         call_tests++;
34570         des_xmlSchemaValidCtxtPtr(n_ctxt, ctxt, 0);
34571         des_xmlNodePtr(n_elem, elem, 1);
34572         xmlResetLastError();
34573         if (mem_base != xmlMemBlocks()) {
34574             printf("Leak of %d blocks found in xmlSchemaValidateOneElement",
34575 	           xmlMemBlocks() - mem_base);
34576 	    test_ret++;
34577             printf(" %d", n_ctxt);
34578             printf(" %d", n_elem);
34579             printf("\n");
34580         }
34581     }
34582     }
34583     function_tests++;
34584 #endif
34585 
34586     return(test_ret);
34587 }
34588 
34589 
34590 static int
test_xmlSchemaValidateSetFilename(void)34591 test_xmlSchemaValidateSetFilename(void) {
34592     int test_ret = 0;
34593 
34594 #if defined(LIBXML_SCHEMAS_ENABLED)
34595     int mem_base;
34596     xmlSchemaValidCtxtPtr vctxt; /* the schema validation context */
34597     int n_vctxt;
34598     const char * filename; /* the file name */
34599     int n_filename;
34600 
34601     for (n_vctxt = 0;n_vctxt < gen_nb_xmlSchemaValidCtxtPtr;n_vctxt++) {
34602     for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
34603         mem_base = xmlMemBlocks();
34604         vctxt = gen_xmlSchemaValidCtxtPtr(n_vctxt, 0);
34605         filename = gen_filepath(n_filename, 1);
34606 
34607         xmlSchemaValidateSetFilename(vctxt, filename);
34608         call_tests++;
34609         des_xmlSchemaValidCtxtPtr(n_vctxt, vctxt, 0);
34610         des_filepath(n_filename, filename, 1);
34611         xmlResetLastError();
34612         if (mem_base != xmlMemBlocks()) {
34613             printf("Leak of %d blocks found in xmlSchemaValidateSetFilename",
34614 	           xmlMemBlocks() - mem_base);
34615 	    test_ret++;
34616             printf(" %d", n_vctxt);
34617             printf(" %d", n_filename);
34618             printf("\n");
34619         }
34620     }
34621     }
34622     function_tests++;
34623 #endif
34624 
34625     return(test_ret);
34626 }
34627 
34628 
34629 static int
test_xmlSchemaValidateSetLocator(void)34630 test_xmlSchemaValidateSetLocator(void) {
34631     int test_ret = 0;
34632 
34633 
34634     /* missing type support */
34635     return(test_ret);
34636 }
34637 
34638 
34639 static int
test_xmlSchemaValidateStream(void)34640 test_xmlSchemaValidateStream(void) {
34641     int test_ret = 0;
34642 
34643 #if defined(LIBXML_SCHEMAS_ENABLED)
34644     int mem_base;
34645     int ret_val;
34646     xmlSchemaValidCtxtPtr ctxt; /* a schema validation context */
34647     int n_ctxt;
34648     xmlParserInputBufferPtr input; /* the input to use for reading the data */
34649     int n_input;
34650     xmlCharEncoding enc; /* an optional encoding information */
34651     int n_enc;
34652     xmlSAXHandlerPtr sax; /* a SAX handler for the resulting events */
34653     int n_sax;
34654     void * user_data; /* the context to provide to the SAX handler. */
34655     int n_user_data;
34656 
34657     for (n_ctxt = 0;n_ctxt < gen_nb_xmlSchemaValidCtxtPtr;n_ctxt++) {
34658     for (n_input = 0;n_input < gen_nb_xmlParserInputBufferPtr;n_input++) {
34659     for (n_enc = 0;n_enc < gen_nb_xmlCharEncoding;n_enc++) {
34660     for (n_sax = 0;n_sax < gen_nb_xmlSAXHandlerPtr;n_sax++) {
34661     for (n_user_data = 0;n_user_data < gen_nb_userdata;n_user_data++) {
34662         mem_base = xmlMemBlocks();
34663         ctxt = gen_xmlSchemaValidCtxtPtr(n_ctxt, 0);
34664         input = gen_xmlParserInputBufferPtr(n_input, 1);
34665         enc = gen_xmlCharEncoding(n_enc, 2);
34666         sax = gen_xmlSAXHandlerPtr(n_sax, 3);
34667         user_data = gen_userdata(n_user_data, 4);
34668 
34669         ret_val = xmlSchemaValidateStream(ctxt, input, enc, sax, user_data);
34670         desret_int(ret_val);
34671         call_tests++;
34672         des_xmlSchemaValidCtxtPtr(n_ctxt, ctxt, 0);
34673         des_xmlParserInputBufferPtr(n_input, input, 1);
34674         des_xmlCharEncoding(n_enc, enc, 2);
34675         des_xmlSAXHandlerPtr(n_sax, sax, 3);
34676         des_userdata(n_user_data, user_data, 4);
34677         xmlResetLastError();
34678         if (mem_base != xmlMemBlocks()) {
34679             printf("Leak of %d blocks found in xmlSchemaValidateStream",
34680 	           xmlMemBlocks() - mem_base);
34681 	    test_ret++;
34682             printf(" %d", n_ctxt);
34683             printf(" %d", n_input);
34684             printf(" %d", n_enc);
34685             printf(" %d", n_sax);
34686             printf(" %d", n_user_data);
34687             printf("\n");
34688         }
34689     }
34690     }
34691     }
34692     }
34693     }
34694     function_tests++;
34695 #endif
34696 
34697     return(test_ret);
34698 }
34699 
34700 static int
test_xmlschemas(void)34701 test_xmlschemas(void) {
34702     int test_ret = 0;
34703 
34704     if (quiet == 0) printf("Testing xmlschemas : 16 of 27 functions ...\n");
34705     test_ret += test_xmlSchemaDump();
34706     test_ret += test_xmlSchemaGetParserErrors();
34707     test_ret += test_xmlSchemaGetValidErrors();
34708     test_ret += test_xmlSchemaIsValid();
34709     test_ret += test_xmlSchemaNewDocParserCtxt();
34710     test_ret += test_xmlSchemaNewMemParserCtxt();
34711     test_ret += test_xmlSchemaNewParserCtxt();
34712     test_ret += test_xmlSchemaNewValidCtxt();
34713     test_ret += test_xmlSchemaParse();
34714     test_ret += test_xmlSchemaSAXPlug();
34715     test_ret += test_xmlSchemaSAXUnplug();
34716     test_ret += test_xmlSchemaSetParserErrors();
34717     test_ret += test_xmlSchemaSetParserStructuredErrors();
34718     test_ret += test_xmlSchemaSetValidErrors();
34719     test_ret += test_xmlSchemaSetValidOptions();
34720     test_ret += test_xmlSchemaSetValidStructuredErrors();
34721     test_ret += test_xmlSchemaValidCtxtGetOptions();
34722     test_ret += test_xmlSchemaValidCtxtGetParserCtxt();
34723     test_ret += test_xmlSchemaValidateDoc();
34724     test_ret += test_xmlSchemaValidateFile();
34725     test_ret += test_xmlSchemaValidateOneElement();
34726     test_ret += test_xmlSchemaValidateSetFilename();
34727     test_ret += test_xmlSchemaValidateSetLocator();
34728     test_ret += test_xmlSchemaValidateStream();
34729 
34730     if (test_ret != 0)
34731 	printf("Module xmlschemas: %d errors\n", test_ret);
34732     return(test_ret);
34733 }
34734 #ifdef LIBXML_SCHEMAS_ENABLED
34735 
34736 #define gen_nb_xmlSchemaFacetPtr 1
34737 #define gen_xmlSchemaFacetPtr(no, nr) NULL
34738 #define des_xmlSchemaFacetPtr(no, val, nr)
34739 #endif
34740 
34741 #ifdef LIBXML_SCHEMAS_ENABLED
34742 
34743 #define gen_nb_xmlSchemaTypePtr 1
34744 #define gen_xmlSchemaTypePtr(no, nr) NULL
34745 #define des_xmlSchemaTypePtr(no, val, nr)
34746 #endif
34747 
34748 
34749 static int
test_xmlSchemaCheckFacet(void)34750 test_xmlSchemaCheckFacet(void) {
34751     int test_ret = 0;
34752 
34753 #if defined(LIBXML_SCHEMAS_ENABLED)
34754     int mem_base;
34755     int ret_val;
34756     xmlSchemaFacetPtr facet; /* the facet */
34757     int n_facet;
34758     xmlSchemaTypePtr typeDecl; /* the schema type definition */
34759     int n_typeDecl;
34760     xmlSchemaParserCtxtPtr pctxt; /* the schema parser context or NULL */
34761     int n_pctxt;
34762     const xmlChar * name; /* the optional name of the type */
34763     int n_name;
34764 
34765     for (n_facet = 0;n_facet < gen_nb_xmlSchemaFacetPtr;n_facet++) {
34766     for (n_typeDecl = 0;n_typeDecl < gen_nb_xmlSchemaTypePtr;n_typeDecl++) {
34767     for (n_pctxt = 0;n_pctxt < gen_nb_xmlSchemaParserCtxtPtr;n_pctxt++) {
34768     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
34769         mem_base = xmlMemBlocks();
34770         facet = gen_xmlSchemaFacetPtr(n_facet, 0);
34771         typeDecl = gen_xmlSchemaTypePtr(n_typeDecl, 1);
34772         pctxt = gen_xmlSchemaParserCtxtPtr(n_pctxt, 2);
34773         name = gen_const_xmlChar_ptr(n_name, 3);
34774 
34775         ret_val = xmlSchemaCheckFacet(facet, typeDecl, pctxt, name);
34776         desret_int(ret_val);
34777         call_tests++;
34778         des_xmlSchemaFacetPtr(n_facet, facet, 0);
34779         des_xmlSchemaTypePtr(n_typeDecl, typeDecl, 1);
34780         des_xmlSchemaParserCtxtPtr(n_pctxt, pctxt, 2);
34781         des_const_xmlChar_ptr(n_name, name, 3);
34782         xmlResetLastError();
34783         if (mem_base != xmlMemBlocks()) {
34784             printf("Leak of %d blocks found in xmlSchemaCheckFacet",
34785 	           xmlMemBlocks() - mem_base);
34786 	    test_ret++;
34787             printf(" %d", n_facet);
34788             printf(" %d", n_typeDecl);
34789             printf(" %d", n_pctxt);
34790             printf(" %d", n_name);
34791             printf("\n");
34792         }
34793     }
34794     }
34795     }
34796     }
34797     function_tests++;
34798 #endif
34799 
34800     return(test_ret);
34801 }
34802 
34803 
34804 static int
test_xmlSchemaCleanupTypes(void)34805 test_xmlSchemaCleanupTypes(void) {
34806     int test_ret = 0;
34807 
34808 #if defined(LIBXML_SCHEMAS_ENABLED)
34809 
34810 
34811         xmlSchemaCleanupTypes();
34812         call_tests++;
34813         xmlResetLastError();
34814     function_tests++;
34815 #endif
34816 
34817     return(test_ret);
34818 }
34819 
34820 
34821 static int
test_xmlSchemaCollapseString(void)34822 test_xmlSchemaCollapseString(void) {
34823     int test_ret = 0;
34824 
34825 #if defined(LIBXML_SCHEMAS_ENABLED)
34826     int mem_base;
34827     xmlChar * ret_val;
34828     const xmlChar * value; /* a value */
34829     int n_value;
34830 
34831     for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
34832         mem_base = xmlMemBlocks();
34833         value = gen_const_xmlChar_ptr(n_value, 0);
34834 
34835         ret_val = xmlSchemaCollapseString(value);
34836         desret_xmlChar_ptr(ret_val);
34837         call_tests++;
34838         des_const_xmlChar_ptr(n_value, value, 0);
34839         xmlResetLastError();
34840         if (mem_base != xmlMemBlocks()) {
34841             printf("Leak of %d blocks found in xmlSchemaCollapseString",
34842 	           xmlMemBlocks() - mem_base);
34843 	    test_ret++;
34844             printf(" %d", n_value);
34845             printf("\n");
34846         }
34847     }
34848     function_tests++;
34849 #endif
34850 
34851     return(test_ret);
34852 }
34853 
34854 #ifdef LIBXML_SCHEMAS_ENABLED
34855 
34856 #define gen_nb_xmlSchemaValPtr 1
34857 #define gen_xmlSchemaValPtr(no, nr) NULL
34858 #define des_xmlSchemaValPtr(no, val, nr)
34859 #endif
34860 
34861 
34862 static int
test_xmlSchemaCompareValues(void)34863 test_xmlSchemaCompareValues(void) {
34864     int test_ret = 0;
34865 
34866 #if defined(LIBXML_SCHEMAS_ENABLED)
34867     int mem_base;
34868     int ret_val;
34869     xmlSchemaValPtr x; /* a first value */
34870     int n_x;
34871     xmlSchemaValPtr y; /* a second value */
34872     int n_y;
34873 
34874     for (n_x = 0;n_x < gen_nb_xmlSchemaValPtr;n_x++) {
34875     for (n_y = 0;n_y < gen_nb_xmlSchemaValPtr;n_y++) {
34876         mem_base = xmlMemBlocks();
34877         x = gen_xmlSchemaValPtr(n_x, 0);
34878         y = gen_xmlSchemaValPtr(n_y, 1);
34879 
34880         ret_val = xmlSchemaCompareValues(x, y);
34881         desret_int(ret_val);
34882         call_tests++;
34883         des_xmlSchemaValPtr(n_x, x, 0);
34884         des_xmlSchemaValPtr(n_y, y, 1);
34885         xmlResetLastError();
34886         if (mem_base != xmlMemBlocks()) {
34887             printf("Leak of %d blocks found in xmlSchemaCompareValues",
34888 	           xmlMemBlocks() - mem_base);
34889 	    test_ret++;
34890             printf(" %d", n_x);
34891             printf(" %d", n_y);
34892             printf("\n");
34893         }
34894     }
34895     }
34896     function_tests++;
34897 #endif
34898 
34899     return(test_ret);
34900 }
34901 
34902 
34903 static int
test_xmlSchemaCompareValuesWhtsp(void)34904 test_xmlSchemaCompareValuesWhtsp(void) {
34905     int test_ret = 0;
34906 
34907 #if defined(LIBXML_SCHEMAS_ENABLED)
34908     int mem_base;
34909     int ret_val;
34910     xmlSchemaValPtr x; /* a first value */
34911     int n_x;
34912     xmlSchemaWhitespaceValueType xws; /* the whitespace value of x */
34913     int n_xws;
34914     xmlSchemaValPtr y; /* a second value */
34915     int n_y;
34916     xmlSchemaWhitespaceValueType yws; /* the whitespace value of y */
34917     int n_yws;
34918 
34919     for (n_x = 0;n_x < gen_nb_xmlSchemaValPtr;n_x++) {
34920     for (n_xws = 0;n_xws < gen_nb_xmlSchemaWhitespaceValueType;n_xws++) {
34921     for (n_y = 0;n_y < gen_nb_xmlSchemaValPtr;n_y++) {
34922     for (n_yws = 0;n_yws < gen_nb_xmlSchemaWhitespaceValueType;n_yws++) {
34923         mem_base = xmlMemBlocks();
34924         x = gen_xmlSchemaValPtr(n_x, 0);
34925         xws = gen_xmlSchemaWhitespaceValueType(n_xws, 1);
34926         y = gen_xmlSchemaValPtr(n_y, 2);
34927         yws = gen_xmlSchemaWhitespaceValueType(n_yws, 3);
34928 
34929         ret_val = xmlSchemaCompareValuesWhtsp(x, xws, y, yws);
34930         desret_int(ret_val);
34931         call_tests++;
34932         des_xmlSchemaValPtr(n_x, x, 0);
34933         des_xmlSchemaWhitespaceValueType(n_xws, xws, 1);
34934         des_xmlSchemaValPtr(n_y, y, 2);
34935         des_xmlSchemaWhitespaceValueType(n_yws, yws, 3);
34936         xmlResetLastError();
34937         if (mem_base != xmlMemBlocks()) {
34938             printf("Leak of %d blocks found in xmlSchemaCompareValuesWhtsp",
34939 	           xmlMemBlocks() - mem_base);
34940 	    test_ret++;
34941             printf(" %d", n_x);
34942             printf(" %d", n_xws);
34943             printf(" %d", n_y);
34944             printf(" %d", n_yws);
34945             printf("\n");
34946         }
34947     }
34948     }
34949     }
34950     }
34951     function_tests++;
34952 #endif
34953 
34954     return(test_ret);
34955 }
34956 
34957 
34958 static int
test_xmlSchemaCopyValue(void)34959 test_xmlSchemaCopyValue(void) {
34960     int test_ret = 0;
34961 
34962 
34963     /* missing type support */
34964     return(test_ret);
34965 }
34966 
34967 
34968 static int
test_xmlSchemaGetBuiltInListSimpleTypeItemType(void)34969 test_xmlSchemaGetBuiltInListSimpleTypeItemType(void) {
34970     int test_ret = 0;
34971 
34972 #if defined(LIBXML_SCHEMAS_ENABLED)
34973     int mem_base;
34974     xmlSchemaTypePtr ret_val;
34975     xmlSchemaTypePtr type; /* the built-in simple type. */
34976     int n_type;
34977 
34978     for (n_type = 0;n_type < gen_nb_xmlSchemaTypePtr;n_type++) {
34979         mem_base = xmlMemBlocks();
34980         type = gen_xmlSchemaTypePtr(n_type, 0);
34981 
34982         ret_val = xmlSchemaGetBuiltInListSimpleTypeItemType(type);
34983         desret_xmlSchemaTypePtr(ret_val);
34984         call_tests++;
34985         des_xmlSchemaTypePtr(n_type, type, 0);
34986         xmlResetLastError();
34987         if (mem_base != xmlMemBlocks()) {
34988             printf("Leak of %d blocks found in xmlSchemaGetBuiltInListSimpleTypeItemType",
34989 	           xmlMemBlocks() - mem_base);
34990 	    test_ret++;
34991             printf(" %d", n_type);
34992             printf("\n");
34993         }
34994     }
34995     function_tests++;
34996 #endif
34997 
34998     return(test_ret);
34999 }
35000 
35001 
35002 static int
test_xmlSchemaGetBuiltInType(void)35003 test_xmlSchemaGetBuiltInType(void) {
35004     int test_ret = 0;
35005 
35006 #if defined(LIBXML_SCHEMAS_ENABLED)
35007     xmlSchemaTypePtr ret_val;
35008     xmlSchemaValType type; /* the type of the built in type */
35009     int n_type;
35010 
35011     for (n_type = 0;n_type < gen_nb_xmlSchemaValType;n_type++) {
35012         type = gen_xmlSchemaValType(n_type, 0);
35013 
35014         ret_val = xmlSchemaGetBuiltInType(type);
35015         desret_xmlSchemaTypePtr(ret_val);
35016         call_tests++;
35017         des_xmlSchemaValType(n_type, type, 0);
35018         xmlResetLastError();
35019     }
35020     function_tests++;
35021 #endif
35022 
35023     return(test_ret);
35024 }
35025 
35026 
35027 static int
test_xmlSchemaGetCanonValue(void)35028 test_xmlSchemaGetCanonValue(void) {
35029     int test_ret = 0;
35030 
35031 #if defined(LIBXML_SCHEMAS_ENABLED)
35032     int mem_base;
35033     int ret_val;
35034     xmlSchemaValPtr val; /* the precomputed value */
35035     int n_val;
35036     const xmlChar ** retValue; /* the returned value */
35037     int n_retValue;
35038 
35039     for (n_val = 0;n_val < gen_nb_xmlSchemaValPtr;n_val++) {
35040     for (n_retValue = 0;n_retValue < gen_nb_const_xmlChar_ptr_ptr;n_retValue++) {
35041         mem_base = xmlMemBlocks();
35042         val = gen_xmlSchemaValPtr(n_val, 0);
35043         retValue = gen_const_xmlChar_ptr_ptr(n_retValue, 1);
35044 
35045         ret_val = xmlSchemaGetCanonValue(val, retValue);
35046         desret_int(ret_val);
35047         call_tests++;
35048         des_xmlSchemaValPtr(n_val, val, 0);
35049         des_const_xmlChar_ptr_ptr(n_retValue, retValue, 1);
35050         xmlResetLastError();
35051         if (mem_base != xmlMemBlocks()) {
35052             printf("Leak of %d blocks found in xmlSchemaGetCanonValue",
35053 	           xmlMemBlocks() - mem_base);
35054 	    test_ret++;
35055             printf(" %d", n_val);
35056             printf(" %d", n_retValue);
35057             printf("\n");
35058         }
35059     }
35060     }
35061     function_tests++;
35062 #endif
35063 
35064     return(test_ret);
35065 }
35066 
35067 
35068 static int
test_xmlSchemaGetCanonValueWhtsp(void)35069 test_xmlSchemaGetCanonValueWhtsp(void) {
35070     int test_ret = 0;
35071 
35072 #if defined(LIBXML_SCHEMAS_ENABLED)
35073     int mem_base;
35074     int ret_val;
35075     xmlSchemaValPtr val; /* the precomputed value */
35076     int n_val;
35077     const xmlChar ** retValue; /* the returned value */
35078     int n_retValue;
35079     xmlSchemaWhitespaceValueType ws; /* the whitespace type of the value */
35080     int n_ws;
35081 
35082     for (n_val = 0;n_val < gen_nb_xmlSchemaValPtr;n_val++) {
35083     for (n_retValue = 0;n_retValue < gen_nb_const_xmlChar_ptr_ptr;n_retValue++) {
35084     for (n_ws = 0;n_ws < gen_nb_xmlSchemaWhitespaceValueType;n_ws++) {
35085         mem_base = xmlMemBlocks();
35086         val = gen_xmlSchemaValPtr(n_val, 0);
35087         retValue = gen_const_xmlChar_ptr_ptr(n_retValue, 1);
35088         ws = gen_xmlSchemaWhitespaceValueType(n_ws, 2);
35089 
35090         ret_val = xmlSchemaGetCanonValueWhtsp(val, retValue, ws);
35091         desret_int(ret_val);
35092         call_tests++;
35093         des_xmlSchemaValPtr(n_val, val, 0);
35094         des_const_xmlChar_ptr_ptr(n_retValue, retValue, 1);
35095         des_xmlSchemaWhitespaceValueType(n_ws, ws, 2);
35096         xmlResetLastError();
35097         if (mem_base != xmlMemBlocks()) {
35098             printf("Leak of %d blocks found in xmlSchemaGetCanonValueWhtsp",
35099 	           xmlMemBlocks() - mem_base);
35100 	    test_ret++;
35101             printf(" %d", n_val);
35102             printf(" %d", n_retValue);
35103             printf(" %d", n_ws);
35104             printf("\n");
35105         }
35106     }
35107     }
35108     }
35109     function_tests++;
35110 #endif
35111 
35112     return(test_ret);
35113 }
35114 
35115 
35116 static int
test_xmlSchemaGetFacetValueAsULong(void)35117 test_xmlSchemaGetFacetValueAsULong(void) {
35118     int test_ret = 0;
35119 
35120 #if defined(LIBXML_SCHEMAS_ENABLED)
35121     int mem_base;
35122     unsigned long ret_val;
35123     xmlSchemaFacetPtr facet; /* an schemas type facet */
35124     int n_facet;
35125 
35126     for (n_facet = 0;n_facet < gen_nb_xmlSchemaFacetPtr;n_facet++) {
35127         mem_base = xmlMemBlocks();
35128         facet = gen_xmlSchemaFacetPtr(n_facet, 0);
35129 
35130         ret_val = xmlSchemaGetFacetValueAsULong(facet);
35131         desret_unsigned_long(ret_val);
35132         call_tests++;
35133         des_xmlSchemaFacetPtr(n_facet, facet, 0);
35134         xmlResetLastError();
35135         if (mem_base != xmlMemBlocks()) {
35136             printf("Leak of %d blocks found in xmlSchemaGetFacetValueAsULong",
35137 	           xmlMemBlocks() - mem_base);
35138 	    test_ret++;
35139             printf(" %d", n_facet);
35140             printf("\n");
35141         }
35142     }
35143     function_tests++;
35144 #endif
35145 
35146     return(test_ret);
35147 }
35148 
35149 
35150 static int
test_xmlSchemaGetPredefinedType(void)35151 test_xmlSchemaGetPredefinedType(void) {
35152     int test_ret = 0;
35153 
35154 #if defined(LIBXML_SCHEMAS_ENABLED)
35155     int mem_base;
35156     xmlSchemaTypePtr ret_val;
35157     const xmlChar * name; /* the type name */
35158     int n_name;
35159     const xmlChar * ns; /* the URI of the namespace usually "http://www.w3.org/2001/XMLSchema" */
35160     int n_ns;
35161 
35162     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
35163     for (n_ns = 0;n_ns < gen_nb_const_xmlChar_ptr;n_ns++) {
35164         mem_base = xmlMemBlocks();
35165         name = gen_const_xmlChar_ptr(n_name, 0);
35166         ns = gen_const_xmlChar_ptr(n_ns, 1);
35167 
35168         ret_val = xmlSchemaGetPredefinedType(name, ns);
35169         desret_xmlSchemaTypePtr(ret_val);
35170         call_tests++;
35171         des_const_xmlChar_ptr(n_name, name, 0);
35172         des_const_xmlChar_ptr(n_ns, ns, 1);
35173         xmlResetLastError();
35174         if (mem_base != xmlMemBlocks()) {
35175             printf("Leak of %d blocks found in xmlSchemaGetPredefinedType",
35176 	           xmlMemBlocks() - mem_base);
35177 	    test_ret++;
35178             printf(" %d", n_name);
35179             printf(" %d", n_ns);
35180             printf("\n");
35181         }
35182     }
35183     }
35184     function_tests++;
35185 #endif
35186 
35187     return(test_ret);
35188 }
35189 
35190 
35191 static int
test_xmlSchemaGetValType(void)35192 test_xmlSchemaGetValType(void) {
35193     int test_ret = 0;
35194 
35195 #if defined(LIBXML_SCHEMAS_ENABLED)
35196     int mem_base;
35197     xmlSchemaValType ret_val;
35198     xmlSchemaValPtr val; /* a schemas value */
35199     int n_val;
35200 
35201     for (n_val = 0;n_val < gen_nb_xmlSchemaValPtr;n_val++) {
35202         mem_base = xmlMemBlocks();
35203         val = gen_xmlSchemaValPtr(n_val, 0);
35204 
35205         ret_val = xmlSchemaGetValType(val);
35206         desret_xmlSchemaValType(ret_val);
35207         call_tests++;
35208         des_xmlSchemaValPtr(n_val, val, 0);
35209         xmlResetLastError();
35210         if (mem_base != xmlMemBlocks()) {
35211             printf("Leak of %d blocks found in xmlSchemaGetValType",
35212 	           xmlMemBlocks() - mem_base);
35213 	    test_ret++;
35214             printf(" %d", n_val);
35215             printf("\n");
35216         }
35217     }
35218     function_tests++;
35219 #endif
35220 
35221     return(test_ret);
35222 }
35223 
35224 
35225 static int
test_xmlSchemaInitTypes(void)35226 test_xmlSchemaInitTypes(void) {
35227     int test_ret = 0;
35228 
35229 #if defined(LIBXML_SCHEMAS_ENABLED)
35230     int ret_val;
35231 
35232 
35233         ret_val = xmlSchemaInitTypes();
35234         desret_int(ret_val);
35235         call_tests++;
35236         xmlResetLastError();
35237     function_tests++;
35238 #endif
35239 
35240     return(test_ret);
35241 }
35242 
35243 
35244 static int
test_xmlSchemaIsBuiltInTypeFacet(void)35245 test_xmlSchemaIsBuiltInTypeFacet(void) {
35246     int test_ret = 0;
35247 
35248 #if defined(LIBXML_SCHEMAS_ENABLED)
35249     int mem_base;
35250     int ret_val;
35251     xmlSchemaTypePtr type; /* the built-in type */
35252     int n_type;
35253     int facetType; /* the facet type */
35254     int n_facetType;
35255 
35256     for (n_type = 0;n_type < gen_nb_xmlSchemaTypePtr;n_type++) {
35257     for (n_facetType = 0;n_facetType < gen_nb_int;n_facetType++) {
35258         mem_base = xmlMemBlocks();
35259         type = gen_xmlSchemaTypePtr(n_type, 0);
35260         facetType = gen_int(n_facetType, 1);
35261 
35262         ret_val = xmlSchemaIsBuiltInTypeFacet(type, facetType);
35263         desret_int(ret_val);
35264         call_tests++;
35265         des_xmlSchemaTypePtr(n_type, type, 0);
35266         des_int(n_facetType, facetType, 1);
35267         xmlResetLastError();
35268         if (mem_base != xmlMemBlocks()) {
35269             printf("Leak of %d blocks found in xmlSchemaIsBuiltInTypeFacet",
35270 	           xmlMemBlocks() - mem_base);
35271 	    test_ret++;
35272             printf(" %d", n_type);
35273             printf(" %d", n_facetType);
35274             printf("\n");
35275         }
35276     }
35277     }
35278     function_tests++;
35279 #endif
35280 
35281     return(test_ret);
35282 }
35283 
35284 
35285 static int
test_xmlSchemaNewFacet(void)35286 test_xmlSchemaNewFacet(void) {
35287     int test_ret = 0;
35288 
35289 
35290     /* missing type support */
35291     return(test_ret);
35292 }
35293 
35294 
35295 static int
test_xmlSchemaNewNOTATIONValue(void)35296 test_xmlSchemaNewNOTATIONValue(void) {
35297     int test_ret = 0;
35298 
35299 
35300     /* missing type support */
35301     return(test_ret);
35302 }
35303 
35304 
35305 static int
test_xmlSchemaNewQNameValue(void)35306 test_xmlSchemaNewQNameValue(void) {
35307     int test_ret = 0;
35308 
35309 
35310     /* missing type support */
35311     return(test_ret);
35312 }
35313 
35314 
35315 static int
test_xmlSchemaNewStringValue(void)35316 test_xmlSchemaNewStringValue(void) {
35317     int test_ret = 0;
35318 
35319 
35320     /* missing type support */
35321     return(test_ret);
35322 }
35323 
35324 #ifdef LIBXML_SCHEMAS_ENABLED
35325 
35326 #define gen_nb_xmlSchemaValPtr_ptr 1
35327 #define gen_xmlSchemaValPtr_ptr(no, nr) NULL
35328 #define des_xmlSchemaValPtr_ptr(no, val, nr)
35329 #endif
35330 
35331 
35332 static int
test_xmlSchemaValPredefTypeNode(void)35333 test_xmlSchemaValPredefTypeNode(void) {
35334     int test_ret = 0;
35335 
35336 #if defined(LIBXML_SCHEMAS_ENABLED)
35337     int mem_base;
35338     int ret_val;
35339     xmlSchemaTypePtr type; /* the predefined type */
35340     int n_type;
35341     const xmlChar * value; /* the value to check */
35342     int n_value;
35343     xmlSchemaValPtr * val; /* the return computed value */
35344     int n_val;
35345     xmlNodePtr node; /* the node containing the value */
35346     int n_node;
35347 
35348     for (n_type = 0;n_type < gen_nb_xmlSchemaTypePtr;n_type++) {
35349     for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
35350     for (n_val = 0;n_val < gen_nb_xmlSchemaValPtr_ptr;n_val++) {
35351     for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
35352         mem_base = xmlMemBlocks();
35353         type = gen_xmlSchemaTypePtr(n_type, 0);
35354         value = gen_const_xmlChar_ptr(n_value, 1);
35355         val = gen_xmlSchemaValPtr_ptr(n_val, 2);
35356         node = gen_xmlNodePtr(n_node, 3);
35357 
35358         ret_val = xmlSchemaValPredefTypeNode(type, value, val, node);
35359         desret_int(ret_val);
35360         call_tests++;
35361         des_xmlSchemaTypePtr(n_type, type, 0);
35362         des_const_xmlChar_ptr(n_value, value, 1);
35363         des_xmlSchemaValPtr_ptr(n_val, val, 2);
35364         des_xmlNodePtr(n_node, node, 3);
35365         xmlResetLastError();
35366         if (mem_base != xmlMemBlocks()) {
35367             printf("Leak of %d blocks found in xmlSchemaValPredefTypeNode",
35368 	           xmlMemBlocks() - mem_base);
35369 	    test_ret++;
35370             printf(" %d", n_type);
35371             printf(" %d", n_value);
35372             printf(" %d", n_val);
35373             printf(" %d", n_node);
35374             printf("\n");
35375         }
35376     }
35377     }
35378     }
35379     }
35380     function_tests++;
35381 #endif
35382 
35383     return(test_ret);
35384 }
35385 
35386 
35387 static int
test_xmlSchemaValPredefTypeNodeNoNorm(void)35388 test_xmlSchemaValPredefTypeNodeNoNorm(void) {
35389     int test_ret = 0;
35390 
35391 #if defined(LIBXML_SCHEMAS_ENABLED)
35392     int mem_base;
35393     int ret_val;
35394     xmlSchemaTypePtr type; /* the predefined type */
35395     int n_type;
35396     const xmlChar * value; /* the value to check */
35397     int n_value;
35398     xmlSchemaValPtr * val; /* the return computed value */
35399     int n_val;
35400     xmlNodePtr node; /* the node containing the value */
35401     int n_node;
35402 
35403     for (n_type = 0;n_type < gen_nb_xmlSchemaTypePtr;n_type++) {
35404     for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
35405     for (n_val = 0;n_val < gen_nb_xmlSchemaValPtr_ptr;n_val++) {
35406     for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
35407         mem_base = xmlMemBlocks();
35408         type = gen_xmlSchemaTypePtr(n_type, 0);
35409         value = gen_const_xmlChar_ptr(n_value, 1);
35410         val = gen_xmlSchemaValPtr_ptr(n_val, 2);
35411         node = gen_xmlNodePtr(n_node, 3);
35412 
35413         ret_val = xmlSchemaValPredefTypeNodeNoNorm(type, value, val, node);
35414         desret_int(ret_val);
35415         call_tests++;
35416         des_xmlSchemaTypePtr(n_type, type, 0);
35417         des_const_xmlChar_ptr(n_value, value, 1);
35418         des_xmlSchemaValPtr_ptr(n_val, val, 2);
35419         des_xmlNodePtr(n_node, node, 3);
35420         xmlResetLastError();
35421         if (mem_base != xmlMemBlocks()) {
35422             printf("Leak of %d blocks found in xmlSchemaValPredefTypeNodeNoNorm",
35423 	           xmlMemBlocks() - mem_base);
35424 	    test_ret++;
35425             printf(" %d", n_type);
35426             printf(" %d", n_value);
35427             printf(" %d", n_val);
35428             printf(" %d", n_node);
35429             printf("\n");
35430         }
35431     }
35432     }
35433     }
35434     }
35435     function_tests++;
35436 #endif
35437 
35438     return(test_ret);
35439 }
35440 
35441 
35442 static int
test_xmlSchemaValidateFacet(void)35443 test_xmlSchemaValidateFacet(void) {
35444     int test_ret = 0;
35445 
35446 #if defined(LIBXML_SCHEMAS_ENABLED)
35447     int mem_base;
35448     int ret_val;
35449     xmlSchemaTypePtr base; /* the base type */
35450     int n_base;
35451     xmlSchemaFacetPtr facet; /* the facet to check */
35452     int n_facet;
35453     const xmlChar * value; /* the lexical repr of the value to validate */
35454     int n_value;
35455     xmlSchemaValPtr val; /* the precomputed value */
35456     int n_val;
35457 
35458     for (n_base = 0;n_base < gen_nb_xmlSchemaTypePtr;n_base++) {
35459     for (n_facet = 0;n_facet < gen_nb_xmlSchemaFacetPtr;n_facet++) {
35460     for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
35461     for (n_val = 0;n_val < gen_nb_xmlSchemaValPtr;n_val++) {
35462         mem_base = xmlMemBlocks();
35463         base = gen_xmlSchemaTypePtr(n_base, 0);
35464         facet = gen_xmlSchemaFacetPtr(n_facet, 1);
35465         value = gen_const_xmlChar_ptr(n_value, 2);
35466         val = gen_xmlSchemaValPtr(n_val, 3);
35467 
35468         ret_val = xmlSchemaValidateFacet(base, facet, value, val);
35469         desret_int(ret_val);
35470         call_tests++;
35471         des_xmlSchemaTypePtr(n_base, base, 0);
35472         des_xmlSchemaFacetPtr(n_facet, facet, 1);
35473         des_const_xmlChar_ptr(n_value, value, 2);
35474         des_xmlSchemaValPtr(n_val, val, 3);
35475         xmlResetLastError();
35476         if (mem_base != xmlMemBlocks()) {
35477             printf("Leak of %d blocks found in xmlSchemaValidateFacet",
35478 	           xmlMemBlocks() - mem_base);
35479 	    test_ret++;
35480             printf(" %d", n_base);
35481             printf(" %d", n_facet);
35482             printf(" %d", n_value);
35483             printf(" %d", n_val);
35484             printf("\n");
35485         }
35486     }
35487     }
35488     }
35489     }
35490     function_tests++;
35491 #endif
35492 
35493     return(test_ret);
35494 }
35495 
35496 
35497 static int
test_xmlSchemaValidateFacetWhtsp(void)35498 test_xmlSchemaValidateFacetWhtsp(void) {
35499     int test_ret = 0;
35500 
35501 #if defined(LIBXML_SCHEMAS_ENABLED)
35502     int mem_base;
35503     int ret_val;
35504     xmlSchemaFacetPtr facet; /* the facet to check */
35505     int n_facet;
35506     xmlSchemaWhitespaceValueType fws; /* the whitespace type of the facet's value */
35507     int n_fws;
35508     xmlSchemaValType valType; /* the built-in type of the value */
35509     int n_valType;
35510     const xmlChar * value; /* the lexical (or normalized for pattern) repr of the value to validate */
35511     int n_value;
35512     xmlSchemaValPtr val; /* the precomputed value */
35513     int n_val;
35514     xmlSchemaWhitespaceValueType ws; /* the whitespace type of the value */
35515     int n_ws;
35516 
35517     for (n_facet = 0;n_facet < gen_nb_xmlSchemaFacetPtr;n_facet++) {
35518     for (n_fws = 0;n_fws < gen_nb_xmlSchemaWhitespaceValueType;n_fws++) {
35519     for (n_valType = 0;n_valType < gen_nb_xmlSchemaValType;n_valType++) {
35520     for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
35521     for (n_val = 0;n_val < gen_nb_xmlSchemaValPtr;n_val++) {
35522     for (n_ws = 0;n_ws < gen_nb_xmlSchemaWhitespaceValueType;n_ws++) {
35523         mem_base = xmlMemBlocks();
35524         facet = gen_xmlSchemaFacetPtr(n_facet, 0);
35525         fws = gen_xmlSchemaWhitespaceValueType(n_fws, 1);
35526         valType = gen_xmlSchemaValType(n_valType, 2);
35527         value = gen_const_xmlChar_ptr(n_value, 3);
35528         val = gen_xmlSchemaValPtr(n_val, 4);
35529         ws = gen_xmlSchemaWhitespaceValueType(n_ws, 5);
35530 
35531         ret_val = xmlSchemaValidateFacetWhtsp(facet, fws, valType, value, val, ws);
35532         desret_int(ret_val);
35533         call_tests++;
35534         des_xmlSchemaFacetPtr(n_facet, facet, 0);
35535         des_xmlSchemaWhitespaceValueType(n_fws, fws, 1);
35536         des_xmlSchemaValType(n_valType, valType, 2);
35537         des_const_xmlChar_ptr(n_value, value, 3);
35538         des_xmlSchemaValPtr(n_val, val, 4);
35539         des_xmlSchemaWhitespaceValueType(n_ws, ws, 5);
35540         xmlResetLastError();
35541         if (mem_base != xmlMemBlocks()) {
35542             printf("Leak of %d blocks found in xmlSchemaValidateFacetWhtsp",
35543 	           xmlMemBlocks() - mem_base);
35544 	    test_ret++;
35545             printf(" %d", n_facet);
35546             printf(" %d", n_fws);
35547             printf(" %d", n_valType);
35548             printf(" %d", n_value);
35549             printf(" %d", n_val);
35550             printf(" %d", n_ws);
35551             printf("\n");
35552         }
35553     }
35554     }
35555     }
35556     }
35557     }
35558     }
35559     function_tests++;
35560 #endif
35561 
35562     return(test_ret);
35563 }
35564 
35565 
35566 static int
test_xmlSchemaValidateLengthFacet(void)35567 test_xmlSchemaValidateLengthFacet(void) {
35568     int test_ret = 0;
35569 
35570 #if defined(LIBXML_SCHEMAS_ENABLED)
35571     int mem_base;
35572     int ret_val;
35573     xmlSchemaTypePtr type; /* the built-in type */
35574     int n_type;
35575     xmlSchemaFacetPtr facet; /* the facet to check */
35576     int n_facet;
35577     const xmlChar * value; /* the lexical repr. of the value to be validated */
35578     int n_value;
35579     xmlSchemaValPtr val; /* the precomputed value */
35580     int n_val;
35581     unsigned long * length; /* the actual length of the value */
35582     int n_length;
35583 
35584     for (n_type = 0;n_type < gen_nb_xmlSchemaTypePtr;n_type++) {
35585     for (n_facet = 0;n_facet < gen_nb_xmlSchemaFacetPtr;n_facet++) {
35586     for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
35587     for (n_val = 0;n_val < gen_nb_xmlSchemaValPtr;n_val++) {
35588     for (n_length = 0;n_length < gen_nb_unsigned_long_ptr;n_length++) {
35589         mem_base = xmlMemBlocks();
35590         type = gen_xmlSchemaTypePtr(n_type, 0);
35591         facet = gen_xmlSchemaFacetPtr(n_facet, 1);
35592         value = gen_const_xmlChar_ptr(n_value, 2);
35593         val = gen_xmlSchemaValPtr(n_val, 3);
35594         length = gen_unsigned_long_ptr(n_length, 4);
35595 
35596         ret_val = xmlSchemaValidateLengthFacet(type, facet, value, val, length);
35597         desret_int(ret_val);
35598         call_tests++;
35599         des_xmlSchemaTypePtr(n_type, type, 0);
35600         des_xmlSchemaFacetPtr(n_facet, facet, 1);
35601         des_const_xmlChar_ptr(n_value, value, 2);
35602         des_xmlSchemaValPtr(n_val, val, 3);
35603         des_unsigned_long_ptr(n_length, length, 4);
35604         xmlResetLastError();
35605         if (mem_base != xmlMemBlocks()) {
35606             printf("Leak of %d blocks found in xmlSchemaValidateLengthFacet",
35607 	           xmlMemBlocks() - mem_base);
35608 	    test_ret++;
35609             printf(" %d", n_type);
35610             printf(" %d", n_facet);
35611             printf(" %d", n_value);
35612             printf(" %d", n_val);
35613             printf(" %d", n_length);
35614             printf("\n");
35615         }
35616     }
35617     }
35618     }
35619     }
35620     }
35621     function_tests++;
35622 #endif
35623 
35624     return(test_ret);
35625 }
35626 
35627 
35628 static int
test_xmlSchemaValidateLengthFacetWhtsp(void)35629 test_xmlSchemaValidateLengthFacetWhtsp(void) {
35630     int test_ret = 0;
35631 
35632 #if defined(LIBXML_SCHEMAS_ENABLED)
35633     int mem_base;
35634     int ret_val;
35635     xmlSchemaFacetPtr facet; /* the facet to check */
35636     int n_facet;
35637     xmlSchemaValType valType; /* the built-in type */
35638     int n_valType;
35639     const xmlChar * value; /* the lexical repr. of the value to be validated */
35640     int n_value;
35641     xmlSchemaValPtr val; /* the precomputed value */
35642     int n_val;
35643     unsigned long * length; /* the actual length of the value */
35644     int n_length;
35645     xmlSchemaWhitespaceValueType ws; /* the whitespace type of the value */
35646     int n_ws;
35647 
35648     for (n_facet = 0;n_facet < gen_nb_xmlSchemaFacetPtr;n_facet++) {
35649     for (n_valType = 0;n_valType < gen_nb_xmlSchemaValType;n_valType++) {
35650     for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
35651     for (n_val = 0;n_val < gen_nb_xmlSchemaValPtr;n_val++) {
35652     for (n_length = 0;n_length < gen_nb_unsigned_long_ptr;n_length++) {
35653     for (n_ws = 0;n_ws < gen_nb_xmlSchemaWhitespaceValueType;n_ws++) {
35654         mem_base = xmlMemBlocks();
35655         facet = gen_xmlSchemaFacetPtr(n_facet, 0);
35656         valType = gen_xmlSchemaValType(n_valType, 1);
35657         value = gen_const_xmlChar_ptr(n_value, 2);
35658         val = gen_xmlSchemaValPtr(n_val, 3);
35659         length = gen_unsigned_long_ptr(n_length, 4);
35660         ws = gen_xmlSchemaWhitespaceValueType(n_ws, 5);
35661 
35662         ret_val = xmlSchemaValidateLengthFacetWhtsp(facet, valType, value, val, length, ws);
35663         desret_int(ret_val);
35664         call_tests++;
35665         des_xmlSchemaFacetPtr(n_facet, facet, 0);
35666         des_xmlSchemaValType(n_valType, valType, 1);
35667         des_const_xmlChar_ptr(n_value, value, 2);
35668         des_xmlSchemaValPtr(n_val, val, 3);
35669         des_unsigned_long_ptr(n_length, length, 4);
35670         des_xmlSchemaWhitespaceValueType(n_ws, ws, 5);
35671         xmlResetLastError();
35672         if (mem_base != xmlMemBlocks()) {
35673             printf("Leak of %d blocks found in xmlSchemaValidateLengthFacetWhtsp",
35674 	           xmlMemBlocks() - mem_base);
35675 	    test_ret++;
35676             printf(" %d", n_facet);
35677             printf(" %d", n_valType);
35678             printf(" %d", n_value);
35679             printf(" %d", n_val);
35680             printf(" %d", n_length);
35681             printf(" %d", n_ws);
35682             printf("\n");
35683         }
35684     }
35685     }
35686     }
35687     }
35688     }
35689     }
35690     function_tests++;
35691 #endif
35692 
35693     return(test_ret);
35694 }
35695 
35696 
35697 static int
test_xmlSchemaValidateListSimpleTypeFacet(void)35698 test_xmlSchemaValidateListSimpleTypeFacet(void) {
35699     int test_ret = 0;
35700 
35701 #if defined(LIBXML_SCHEMAS_ENABLED)
35702     int mem_base;
35703     int ret_val;
35704     xmlSchemaFacetPtr facet; /* the facet to check */
35705     int n_facet;
35706     const xmlChar * value; /* the lexical repr of the value to validate */
35707     int n_value;
35708     unsigned long actualLen; /* the number of list items */
35709     int n_actualLen;
35710     unsigned long * expectedLen; /* the resulting expected number of list items */
35711     int n_expectedLen;
35712 
35713     for (n_facet = 0;n_facet < gen_nb_xmlSchemaFacetPtr;n_facet++) {
35714     for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
35715     for (n_actualLen = 0;n_actualLen < gen_nb_unsigned_long;n_actualLen++) {
35716     for (n_expectedLen = 0;n_expectedLen < gen_nb_unsigned_long_ptr;n_expectedLen++) {
35717         mem_base = xmlMemBlocks();
35718         facet = gen_xmlSchemaFacetPtr(n_facet, 0);
35719         value = gen_const_xmlChar_ptr(n_value, 1);
35720         actualLen = gen_unsigned_long(n_actualLen, 2);
35721         expectedLen = gen_unsigned_long_ptr(n_expectedLen, 3);
35722 
35723         ret_val = xmlSchemaValidateListSimpleTypeFacet(facet, value, actualLen, expectedLen);
35724         desret_int(ret_val);
35725         call_tests++;
35726         des_xmlSchemaFacetPtr(n_facet, facet, 0);
35727         des_const_xmlChar_ptr(n_value, value, 1);
35728         des_unsigned_long(n_actualLen, actualLen, 2);
35729         des_unsigned_long_ptr(n_expectedLen, expectedLen, 3);
35730         xmlResetLastError();
35731         if (mem_base != xmlMemBlocks()) {
35732             printf("Leak of %d blocks found in xmlSchemaValidateListSimpleTypeFacet",
35733 	           xmlMemBlocks() - mem_base);
35734 	    test_ret++;
35735             printf(" %d", n_facet);
35736             printf(" %d", n_value);
35737             printf(" %d", n_actualLen);
35738             printf(" %d", n_expectedLen);
35739             printf("\n");
35740         }
35741     }
35742     }
35743     }
35744     }
35745     function_tests++;
35746 #endif
35747 
35748     return(test_ret);
35749 }
35750 
35751 
35752 static int
test_xmlSchemaValidatePredefinedType(void)35753 test_xmlSchemaValidatePredefinedType(void) {
35754     int test_ret = 0;
35755 
35756 #if defined(LIBXML_SCHEMAS_ENABLED)
35757     int mem_base;
35758     int ret_val;
35759     xmlSchemaTypePtr type; /* the predefined type */
35760     int n_type;
35761     const xmlChar * value; /* the value to check */
35762     int n_value;
35763     xmlSchemaValPtr * val; /* the return computed value */
35764     int n_val;
35765 
35766     for (n_type = 0;n_type < gen_nb_xmlSchemaTypePtr;n_type++) {
35767     for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
35768     for (n_val = 0;n_val < gen_nb_xmlSchemaValPtr_ptr;n_val++) {
35769         mem_base = xmlMemBlocks();
35770         type = gen_xmlSchemaTypePtr(n_type, 0);
35771         value = gen_const_xmlChar_ptr(n_value, 1);
35772         val = gen_xmlSchemaValPtr_ptr(n_val, 2);
35773 
35774         ret_val = xmlSchemaValidatePredefinedType(type, value, val);
35775         desret_int(ret_val);
35776         call_tests++;
35777         des_xmlSchemaTypePtr(n_type, type, 0);
35778         des_const_xmlChar_ptr(n_value, value, 1);
35779         des_xmlSchemaValPtr_ptr(n_val, val, 2);
35780         xmlResetLastError();
35781         if (mem_base != xmlMemBlocks()) {
35782             printf("Leak of %d blocks found in xmlSchemaValidatePredefinedType",
35783 	           xmlMemBlocks() - mem_base);
35784 	    test_ret++;
35785             printf(" %d", n_type);
35786             printf(" %d", n_value);
35787             printf(" %d", n_val);
35788             printf("\n");
35789         }
35790     }
35791     }
35792     }
35793     function_tests++;
35794 #endif
35795 
35796     return(test_ret);
35797 }
35798 
35799 
35800 static int
test_xmlSchemaValueAppend(void)35801 test_xmlSchemaValueAppend(void) {
35802     int test_ret = 0;
35803 
35804 #if defined(LIBXML_SCHEMAS_ENABLED)
35805     int mem_base;
35806     int ret_val;
35807     xmlSchemaValPtr prev; /* the value */
35808     int n_prev;
35809     xmlSchemaValPtr cur; /* the value to be appended */
35810     int n_cur;
35811 
35812     for (n_prev = 0;n_prev < gen_nb_xmlSchemaValPtr;n_prev++) {
35813     for (n_cur = 0;n_cur < gen_nb_xmlSchemaValPtr;n_cur++) {
35814         mem_base = xmlMemBlocks();
35815         prev = gen_xmlSchemaValPtr(n_prev, 0);
35816         cur = gen_xmlSchemaValPtr(n_cur, 1);
35817 
35818         ret_val = xmlSchemaValueAppend(prev, cur);
35819         desret_int(ret_val);
35820         call_tests++;
35821         des_xmlSchemaValPtr(n_prev, prev, 0);
35822         des_xmlSchemaValPtr(n_cur, cur, 1);
35823         xmlResetLastError();
35824         if (mem_base != xmlMemBlocks()) {
35825             printf("Leak of %d blocks found in xmlSchemaValueAppend",
35826 	           xmlMemBlocks() - mem_base);
35827 	    test_ret++;
35828             printf(" %d", n_prev);
35829             printf(" %d", n_cur);
35830             printf("\n");
35831         }
35832     }
35833     }
35834     function_tests++;
35835 #endif
35836 
35837     return(test_ret);
35838 }
35839 
35840 
35841 static int
test_xmlSchemaValueGetAsBoolean(void)35842 test_xmlSchemaValueGetAsBoolean(void) {
35843     int test_ret = 0;
35844 
35845 #if defined(LIBXML_SCHEMAS_ENABLED)
35846     int mem_base;
35847     int ret_val;
35848     xmlSchemaValPtr val; /* the value */
35849     int n_val;
35850 
35851     for (n_val = 0;n_val < gen_nb_xmlSchemaValPtr;n_val++) {
35852         mem_base = xmlMemBlocks();
35853         val = gen_xmlSchemaValPtr(n_val, 0);
35854 
35855         ret_val = xmlSchemaValueGetAsBoolean(val);
35856         desret_int(ret_val);
35857         call_tests++;
35858         des_xmlSchemaValPtr(n_val, val, 0);
35859         xmlResetLastError();
35860         if (mem_base != xmlMemBlocks()) {
35861             printf("Leak of %d blocks found in xmlSchemaValueGetAsBoolean",
35862 	           xmlMemBlocks() - mem_base);
35863 	    test_ret++;
35864             printf(" %d", n_val);
35865             printf("\n");
35866         }
35867     }
35868     function_tests++;
35869 #endif
35870 
35871     return(test_ret);
35872 }
35873 
35874 
35875 static int
test_xmlSchemaValueGetAsString(void)35876 test_xmlSchemaValueGetAsString(void) {
35877     int test_ret = 0;
35878 
35879 #if defined(LIBXML_SCHEMAS_ENABLED)
35880     int mem_base;
35881     const xmlChar * ret_val;
35882     xmlSchemaValPtr val; /* the value */
35883     int n_val;
35884 
35885     for (n_val = 0;n_val < gen_nb_xmlSchemaValPtr;n_val++) {
35886         mem_base = xmlMemBlocks();
35887         val = gen_xmlSchemaValPtr(n_val, 0);
35888 
35889         ret_val = xmlSchemaValueGetAsString(val);
35890         desret_const_xmlChar_ptr(ret_val);
35891         call_tests++;
35892         des_xmlSchemaValPtr(n_val, val, 0);
35893         xmlResetLastError();
35894         if (mem_base != xmlMemBlocks()) {
35895             printf("Leak of %d blocks found in xmlSchemaValueGetAsString",
35896 	           xmlMemBlocks() - mem_base);
35897 	    test_ret++;
35898             printf(" %d", n_val);
35899             printf("\n");
35900         }
35901     }
35902     function_tests++;
35903 #endif
35904 
35905     return(test_ret);
35906 }
35907 
35908 
35909 static int
test_xmlSchemaValueGetNext(void)35910 test_xmlSchemaValueGetNext(void) {
35911     int test_ret = 0;
35912 
35913 
35914     /* missing type support */
35915     return(test_ret);
35916 }
35917 
35918 
35919 static int
test_xmlSchemaWhiteSpaceReplace(void)35920 test_xmlSchemaWhiteSpaceReplace(void) {
35921     int test_ret = 0;
35922 
35923 #if defined(LIBXML_SCHEMAS_ENABLED)
35924     int mem_base;
35925     xmlChar * ret_val;
35926     const xmlChar * value; /* a value */
35927     int n_value;
35928 
35929     for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
35930         mem_base = xmlMemBlocks();
35931         value = gen_const_xmlChar_ptr(n_value, 0);
35932 
35933         ret_val = xmlSchemaWhiteSpaceReplace(value);
35934         desret_xmlChar_ptr(ret_val);
35935         call_tests++;
35936         des_const_xmlChar_ptr(n_value, value, 0);
35937         xmlResetLastError();
35938         if (mem_base != xmlMemBlocks()) {
35939             printf("Leak of %d blocks found in xmlSchemaWhiteSpaceReplace",
35940 	           xmlMemBlocks() - mem_base);
35941 	    test_ret++;
35942             printf(" %d", n_value);
35943             printf("\n");
35944         }
35945     }
35946     function_tests++;
35947 #endif
35948 
35949     return(test_ret);
35950 }
35951 
35952 static int
test_xmlschemastypes(void)35953 test_xmlschemastypes(void) {
35954     int test_ret = 0;
35955 
35956     if (quiet == 0) printf("Testing xmlschemastypes : 26 of 34 functions ...\n");
35957     test_ret += test_xmlSchemaCheckFacet();
35958     test_ret += test_xmlSchemaCleanupTypes();
35959     test_ret += test_xmlSchemaCollapseString();
35960     test_ret += test_xmlSchemaCompareValues();
35961     test_ret += test_xmlSchemaCompareValuesWhtsp();
35962     test_ret += test_xmlSchemaCopyValue();
35963     test_ret += test_xmlSchemaGetBuiltInListSimpleTypeItemType();
35964     test_ret += test_xmlSchemaGetBuiltInType();
35965     test_ret += test_xmlSchemaGetCanonValue();
35966     test_ret += test_xmlSchemaGetCanonValueWhtsp();
35967     test_ret += test_xmlSchemaGetFacetValueAsULong();
35968     test_ret += test_xmlSchemaGetPredefinedType();
35969     test_ret += test_xmlSchemaGetValType();
35970     test_ret += test_xmlSchemaInitTypes();
35971     test_ret += test_xmlSchemaIsBuiltInTypeFacet();
35972     test_ret += test_xmlSchemaNewFacet();
35973     test_ret += test_xmlSchemaNewNOTATIONValue();
35974     test_ret += test_xmlSchemaNewQNameValue();
35975     test_ret += test_xmlSchemaNewStringValue();
35976     test_ret += test_xmlSchemaValPredefTypeNode();
35977     test_ret += test_xmlSchemaValPredefTypeNodeNoNorm();
35978     test_ret += test_xmlSchemaValidateFacet();
35979     test_ret += test_xmlSchemaValidateFacetWhtsp();
35980     test_ret += test_xmlSchemaValidateLengthFacet();
35981     test_ret += test_xmlSchemaValidateLengthFacetWhtsp();
35982     test_ret += test_xmlSchemaValidateListSimpleTypeFacet();
35983     test_ret += test_xmlSchemaValidatePredefinedType();
35984     test_ret += test_xmlSchemaValueAppend();
35985     test_ret += test_xmlSchemaValueGetAsBoolean();
35986     test_ret += test_xmlSchemaValueGetAsString();
35987     test_ret += test_xmlSchemaValueGetNext();
35988     test_ret += test_xmlSchemaWhiteSpaceReplace();
35989 
35990     if (test_ret != 0)
35991 	printf("Module xmlschemastypes: %d errors\n", test_ret);
35992     return(test_ret);
35993 }
35994 
35995 static int
test_xmlCharStrdup(void)35996 test_xmlCharStrdup(void) {
35997     int test_ret = 0;
35998 
35999     int mem_base;
36000     xmlChar * ret_val;
36001     const char * cur; /* the input char * */
36002     int n_cur;
36003 
36004     for (n_cur = 0;n_cur < gen_nb_const_char_ptr;n_cur++) {
36005         mem_base = xmlMemBlocks();
36006         cur = gen_const_char_ptr(n_cur, 0);
36007 
36008         ret_val = xmlCharStrdup(cur);
36009         desret_xmlChar_ptr(ret_val);
36010         call_tests++;
36011         des_const_char_ptr(n_cur, cur, 0);
36012         xmlResetLastError();
36013         if (mem_base != xmlMemBlocks()) {
36014             printf("Leak of %d blocks found in xmlCharStrdup",
36015 	           xmlMemBlocks() - mem_base);
36016 	    test_ret++;
36017             printf(" %d", n_cur);
36018             printf("\n");
36019         }
36020     }
36021     function_tests++;
36022 
36023     return(test_ret);
36024 }
36025 
36026 
36027 static int
test_xmlCharStrndup(void)36028 test_xmlCharStrndup(void) {
36029     int test_ret = 0;
36030 
36031     int mem_base;
36032     xmlChar * ret_val;
36033     const char * cur; /* the input char * */
36034     int n_cur;
36035     int len; /* the len of @cur */
36036     int n_len;
36037 
36038     for (n_cur = 0;n_cur < gen_nb_const_char_ptr;n_cur++) {
36039     for (n_len = 0;n_len < gen_nb_int;n_len++) {
36040         mem_base = xmlMemBlocks();
36041         cur = gen_const_char_ptr(n_cur, 0);
36042         len = gen_int(n_len, 1);
36043         if ((cur != NULL) &&
36044             (len > xmlStrlen(BAD_CAST cur)))
36045             len = 0;
36046 
36047         ret_val = xmlCharStrndup(cur, len);
36048         desret_xmlChar_ptr(ret_val);
36049         call_tests++;
36050         des_const_char_ptr(n_cur, cur, 0);
36051         des_int(n_len, len, 1);
36052         xmlResetLastError();
36053         if (mem_base != xmlMemBlocks()) {
36054             printf("Leak of %d blocks found in xmlCharStrndup",
36055 	           xmlMemBlocks() - mem_base);
36056 	    test_ret++;
36057             printf(" %d", n_cur);
36058             printf(" %d", n_len);
36059             printf("\n");
36060         }
36061     }
36062     }
36063     function_tests++;
36064 
36065     return(test_ret);
36066 }
36067 
36068 
36069 static int
test_xmlCheckUTF8(void)36070 test_xmlCheckUTF8(void) {
36071     int test_ret = 0;
36072 
36073     int mem_base;
36074     int ret_val;
36075     const unsigned char * utf; /* Pointer to putative UTF-8 encoded string. */
36076     int n_utf;
36077 
36078     for (n_utf = 0;n_utf < gen_nb_const_unsigned_char_ptr;n_utf++) {
36079         mem_base = xmlMemBlocks();
36080         utf = gen_const_unsigned_char_ptr(n_utf, 0);
36081 
36082         ret_val = xmlCheckUTF8(utf);
36083         desret_int(ret_val);
36084         call_tests++;
36085         des_const_unsigned_char_ptr(n_utf, utf, 0);
36086         xmlResetLastError();
36087         if (mem_base != xmlMemBlocks()) {
36088             printf("Leak of %d blocks found in xmlCheckUTF8",
36089 	           xmlMemBlocks() - mem_base);
36090 	    test_ret++;
36091             printf(" %d", n_utf);
36092             printf("\n");
36093         }
36094     }
36095     function_tests++;
36096 
36097     return(test_ret);
36098 }
36099 
36100 
36101 static int
test_xmlGetUTF8Char(void)36102 test_xmlGetUTF8Char(void) {
36103     int test_ret = 0;
36104 
36105     int mem_base;
36106     int ret_val;
36107     const unsigned char * utf; /* a sequence of UTF-8 encoded bytes */
36108     int n_utf;
36109     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. */
36110     int n_len;
36111 
36112     for (n_utf = 0;n_utf < gen_nb_const_unsigned_char_ptr;n_utf++) {
36113     for (n_len = 0;n_len < gen_nb_int_ptr;n_len++) {
36114         mem_base = xmlMemBlocks();
36115         utf = gen_const_unsigned_char_ptr(n_utf, 0);
36116         len = gen_int_ptr(n_len, 1);
36117 
36118         ret_val = xmlGetUTF8Char(utf, len);
36119         desret_int(ret_val);
36120         call_tests++;
36121         des_const_unsigned_char_ptr(n_utf, utf, 0);
36122         des_int_ptr(n_len, len, 1);
36123         xmlResetLastError();
36124         if (mem_base != xmlMemBlocks()) {
36125             printf("Leak of %d blocks found in xmlGetUTF8Char",
36126 	           xmlMemBlocks() - mem_base);
36127 	    test_ret++;
36128             printf(" %d", n_utf);
36129             printf(" %d", n_len);
36130             printf("\n");
36131         }
36132     }
36133     }
36134     function_tests++;
36135 
36136     return(test_ret);
36137 }
36138 
36139 
36140 static int
test_xmlStrEqual(void)36141 test_xmlStrEqual(void) {
36142     int test_ret = 0;
36143 
36144     int mem_base;
36145     int ret_val;
36146     const xmlChar * str1; /* the first xmlChar * */
36147     int n_str1;
36148     const xmlChar * str2; /* the second xmlChar * */
36149     int n_str2;
36150 
36151     for (n_str1 = 0;n_str1 < gen_nb_const_xmlChar_ptr;n_str1++) {
36152     for (n_str2 = 0;n_str2 < gen_nb_const_xmlChar_ptr;n_str2++) {
36153         mem_base = xmlMemBlocks();
36154         str1 = gen_const_xmlChar_ptr(n_str1, 0);
36155         str2 = gen_const_xmlChar_ptr(n_str2, 1);
36156 
36157         ret_val = xmlStrEqual(str1, str2);
36158         desret_int(ret_val);
36159         call_tests++;
36160         des_const_xmlChar_ptr(n_str1, str1, 0);
36161         des_const_xmlChar_ptr(n_str2, str2, 1);
36162         xmlResetLastError();
36163         if (mem_base != xmlMemBlocks()) {
36164             printf("Leak of %d blocks found in xmlStrEqual",
36165 	           xmlMemBlocks() - mem_base);
36166 	    test_ret++;
36167             printf(" %d", n_str1);
36168             printf(" %d", n_str2);
36169             printf("\n");
36170         }
36171     }
36172     }
36173     function_tests++;
36174 
36175     return(test_ret);
36176 }
36177 
36178 
36179 static int
test_xmlStrPrintf(void)36180 test_xmlStrPrintf(void) {
36181     int test_ret = 0;
36182 
36183 
36184     /* missing type support */
36185     return(test_ret);
36186 }
36187 
36188 
36189 static int
test_xmlStrQEqual(void)36190 test_xmlStrQEqual(void) {
36191     int test_ret = 0;
36192 
36193     int mem_base;
36194     int ret_val;
36195     const xmlChar * pref; /* the prefix of the QName */
36196     int n_pref;
36197     const xmlChar * name; /* the localname of the QName */
36198     int n_name;
36199     const xmlChar * str; /* the second xmlChar * */
36200     int n_str;
36201 
36202     for (n_pref = 0;n_pref < gen_nb_const_xmlChar_ptr;n_pref++) {
36203     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
36204     for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) {
36205         mem_base = xmlMemBlocks();
36206         pref = gen_const_xmlChar_ptr(n_pref, 0);
36207         name = gen_const_xmlChar_ptr(n_name, 1);
36208         str = gen_const_xmlChar_ptr(n_str, 2);
36209 
36210         ret_val = xmlStrQEqual(pref, name, str);
36211         desret_int(ret_val);
36212         call_tests++;
36213         des_const_xmlChar_ptr(n_pref, pref, 0);
36214         des_const_xmlChar_ptr(n_name, name, 1);
36215         des_const_xmlChar_ptr(n_str, str, 2);
36216         xmlResetLastError();
36217         if (mem_base != xmlMemBlocks()) {
36218             printf("Leak of %d blocks found in xmlStrQEqual",
36219 	           xmlMemBlocks() - mem_base);
36220 	    test_ret++;
36221             printf(" %d", n_pref);
36222             printf(" %d", n_name);
36223             printf(" %d", n_str);
36224             printf("\n");
36225         }
36226     }
36227     }
36228     }
36229     function_tests++;
36230 
36231     return(test_ret);
36232 }
36233 
36234 
36235 static int
test_xmlStrVPrintf(void)36236 test_xmlStrVPrintf(void) {
36237     int test_ret = 0;
36238 
36239 
36240     /* missing type support */
36241     return(test_ret);
36242 }
36243 
36244 
36245 static int
test_xmlStrcasecmp(void)36246 test_xmlStrcasecmp(void) {
36247     int test_ret = 0;
36248 
36249     int mem_base;
36250     int ret_val;
36251     const xmlChar * str1; /* the first xmlChar * */
36252     int n_str1;
36253     const xmlChar * str2; /* the second xmlChar * */
36254     int n_str2;
36255 
36256     for (n_str1 = 0;n_str1 < gen_nb_const_xmlChar_ptr;n_str1++) {
36257     for (n_str2 = 0;n_str2 < gen_nb_const_xmlChar_ptr;n_str2++) {
36258         mem_base = xmlMemBlocks();
36259         str1 = gen_const_xmlChar_ptr(n_str1, 0);
36260         str2 = gen_const_xmlChar_ptr(n_str2, 1);
36261 
36262         ret_val = xmlStrcasecmp(str1, str2);
36263         desret_int(ret_val);
36264         call_tests++;
36265         des_const_xmlChar_ptr(n_str1, str1, 0);
36266         des_const_xmlChar_ptr(n_str2, str2, 1);
36267         xmlResetLastError();
36268         if (mem_base != xmlMemBlocks()) {
36269             printf("Leak of %d blocks found in xmlStrcasecmp",
36270 	           xmlMemBlocks() - mem_base);
36271 	    test_ret++;
36272             printf(" %d", n_str1);
36273             printf(" %d", n_str2);
36274             printf("\n");
36275         }
36276     }
36277     }
36278     function_tests++;
36279 
36280     return(test_ret);
36281 }
36282 
36283 
36284 static int
test_xmlStrcasestr(void)36285 test_xmlStrcasestr(void) {
36286     int test_ret = 0;
36287 
36288     int mem_base;
36289     const xmlChar * ret_val;
36290     const xmlChar * str; /* the xmlChar * array (haystack) */
36291     int n_str;
36292     const xmlChar * val; /* the xmlChar to search (needle) */
36293     int n_val;
36294 
36295     for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) {
36296     for (n_val = 0;n_val < gen_nb_const_xmlChar_ptr;n_val++) {
36297         mem_base = xmlMemBlocks();
36298         str = gen_const_xmlChar_ptr(n_str, 0);
36299         val = gen_const_xmlChar_ptr(n_val, 1);
36300 
36301         ret_val = xmlStrcasestr(str, val);
36302         desret_const_xmlChar_ptr(ret_val);
36303         call_tests++;
36304         des_const_xmlChar_ptr(n_str, str, 0);
36305         des_const_xmlChar_ptr(n_val, val, 1);
36306         xmlResetLastError();
36307         if (mem_base != xmlMemBlocks()) {
36308             printf("Leak of %d blocks found in xmlStrcasestr",
36309 	           xmlMemBlocks() - mem_base);
36310 	    test_ret++;
36311             printf(" %d", n_str);
36312             printf(" %d", n_val);
36313             printf("\n");
36314         }
36315     }
36316     }
36317     function_tests++;
36318 
36319     return(test_ret);
36320 }
36321 
36322 
36323 static int
test_xmlStrchr(void)36324 test_xmlStrchr(void) {
36325     int test_ret = 0;
36326 
36327     int mem_base;
36328     const xmlChar * ret_val;
36329     const xmlChar * str; /* the xmlChar * array */
36330     int n_str;
36331     xmlChar val; /* the xmlChar to search */
36332     int n_val;
36333 
36334     for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) {
36335     for (n_val = 0;n_val < gen_nb_xmlChar;n_val++) {
36336         mem_base = xmlMemBlocks();
36337         str = gen_const_xmlChar_ptr(n_str, 0);
36338         val = gen_xmlChar(n_val, 1);
36339 
36340         ret_val = xmlStrchr(str, val);
36341         desret_const_xmlChar_ptr(ret_val);
36342         call_tests++;
36343         des_const_xmlChar_ptr(n_str, str, 0);
36344         des_xmlChar(n_val, val, 1);
36345         xmlResetLastError();
36346         if (mem_base != xmlMemBlocks()) {
36347             printf("Leak of %d blocks found in xmlStrchr",
36348 	           xmlMemBlocks() - mem_base);
36349 	    test_ret++;
36350             printf(" %d", n_str);
36351             printf(" %d", n_val);
36352             printf("\n");
36353         }
36354     }
36355     }
36356     function_tests++;
36357 
36358     return(test_ret);
36359 }
36360 
36361 
36362 static int
test_xmlStrcmp(void)36363 test_xmlStrcmp(void) {
36364     int test_ret = 0;
36365 
36366     int mem_base;
36367     int ret_val;
36368     const xmlChar * str1; /* the first xmlChar * */
36369     int n_str1;
36370     const xmlChar * str2; /* the second xmlChar * */
36371     int n_str2;
36372 
36373     for (n_str1 = 0;n_str1 < gen_nb_const_xmlChar_ptr;n_str1++) {
36374     for (n_str2 = 0;n_str2 < gen_nb_const_xmlChar_ptr;n_str2++) {
36375         mem_base = xmlMemBlocks();
36376         str1 = gen_const_xmlChar_ptr(n_str1, 0);
36377         str2 = gen_const_xmlChar_ptr(n_str2, 1);
36378 
36379         ret_val = xmlStrcmp(str1, str2);
36380         desret_int(ret_val);
36381         call_tests++;
36382         des_const_xmlChar_ptr(n_str1, str1, 0);
36383         des_const_xmlChar_ptr(n_str2, str2, 1);
36384         xmlResetLastError();
36385         if (mem_base != xmlMemBlocks()) {
36386             printf("Leak of %d blocks found in xmlStrcmp",
36387 	           xmlMemBlocks() - mem_base);
36388 	    test_ret++;
36389             printf(" %d", n_str1);
36390             printf(" %d", n_str2);
36391             printf("\n");
36392         }
36393     }
36394     }
36395     function_tests++;
36396 
36397     return(test_ret);
36398 }
36399 
36400 
36401 static int
test_xmlStrdup(void)36402 test_xmlStrdup(void) {
36403     int test_ret = 0;
36404 
36405     int mem_base;
36406     xmlChar * ret_val;
36407     const xmlChar * cur; /* the input xmlChar * */
36408     int n_cur;
36409 
36410     for (n_cur = 0;n_cur < gen_nb_const_xmlChar_ptr;n_cur++) {
36411         mem_base = xmlMemBlocks();
36412         cur = gen_const_xmlChar_ptr(n_cur, 0);
36413 
36414         ret_val = xmlStrdup(cur);
36415         desret_xmlChar_ptr(ret_val);
36416         call_tests++;
36417         des_const_xmlChar_ptr(n_cur, cur, 0);
36418         xmlResetLastError();
36419         if (mem_base != xmlMemBlocks()) {
36420             printf("Leak of %d blocks found in xmlStrdup",
36421 	           xmlMemBlocks() - mem_base);
36422 	    test_ret++;
36423             printf(" %d", n_cur);
36424             printf("\n");
36425         }
36426     }
36427     function_tests++;
36428 
36429     return(test_ret);
36430 }
36431 
36432 
36433 static int
test_xmlStrlen(void)36434 test_xmlStrlen(void) {
36435     int test_ret = 0;
36436 
36437     int mem_base;
36438     int ret_val;
36439     const xmlChar * str; /* the xmlChar * array */
36440     int n_str;
36441 
36442     for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) {
36443         mem_base = xmlMemBlocks();
36444         str = gen_const_xmlChar_ptr(n_str, 0);
36445 
36446         ret_val = xmlStrlen(str);
36447         desret_int(ret_val);
36448         call_tests++;
36449         des_const_xmlChar_ptr(n_str, str, 0);
36450         xmlResetLastError();
36451         if (mem_base != xmlMemBlocks()) {
36452             printf("Leak of %d blocks found in xmlStrlen",
36453 	           xmlMemBlocks() - mem_base);
36454 	    test_ret++;
36455             printf(" %d", n_str);
36456             printf("\n");
36457         }
36458     }
36459     function_tests++;
36460 
36461     return(test_ret);
36462 }
36463 
36464 
36465 static int
test_xmlStrncasecmp(void)36466 test_xmlStrncasecmp(void) {
36467     int test_ret = 0;
36468 
36469     int mem_base;
36470     int ret_val;
36471     const xmlChar * str1; /* the first xmlChar * */
36472     int n_str1;
36473     const xmlChar * str2; /* the second xmlChar * */
36474     int n_str2;
36475     int len; /* the max comparison length */
36476     int n_len;
36477 
36478     for (n_str1 = 0;n_str1 < gen_nb_const_xmlChar_ptr;n_str1++) {
36479     for (n_str2 = 0;n_str2 < gen_nb_const_xmlChar_ptr;n_str2++) {
36480     for (n_len = 0;n_len < gen_nb_int;n_len++) {
36481         mem_base = xmlMemBlocks();
36482         str1 = gen_const_xmlChar_ptr(n_str1, 0);
36483         str2 = gen_const_xmlChar_ptr(n_str2, 1);
36484         len = gen_int(n_len, 2);
36485         if ((str2 != NULL) &&
36486             (len > xmlStrlen(BAD_CAST str2)))
36487             len = 0;
36488 
36489         ret_val = xmlStrncasecmp(str1, str2, len);
36490         desret_int(ret_val);
36491         call_tests++;
36492         des_const_xmlChar_ptr(n_str1, str1, 0);
36493         des_const_xmlChar_ptr(n_str2, str2, 1);
36494         des_int(n_len, len, 2);
36495         xmlResetLastError();
36496         if (mem_base != xmlMemBlocks()) {
36497             printf("Leak of %d blocks found in xmlStrncasecmp",
36498 	           xmlMemBlocks() - mem_base);
36499 	    test_ret++;
36500             printf(" %d", n_str1);
36501             printf(" %d", n_str2);
36502             printf(" %d", n_len);
36503             printf("\n");
36504         }
36505     }
36506     }
36507     }
36508     function_tests++;
36509 
36510     return(test_ret);
36511 }
36512 
36513 
36514 static int
test_xmlStrncatNew(void)36515 test_xmlStrncatNew(void) {
36516     int test_ret = 0;
36517 
36518     int mem_base;
36519     xmlChar * ret_val;
36520     const xmlChar * str1; /* first xmlChar string */
36521     int n_str1;
36522     const xmlChar * str2; /* second xmlChar string */
36523     int n_str2;
36524     int len; /* the len of @str2 or < 0 */
36525     int n_len;
36526 
36527     for (n_str1 = 0;n_str1 < gen_nb_const_xmlChar_ptr;n_str1++) {
36528     for (n_str2 = 0;n_str2 < gen_nb_const_xmlChar_ptr;n_str2++) {
36529     for (n_len = 0;n_len < gen_nb_int;n_len++) {
36530         mem_base = xmlMemBlocks();
36531         str1 = gen_const_xmlChar_ptr(n_str1, 0);
36532         str2 = gen_const_xmlChar_ptr(n_str2, 1);
36533         len = gen_int(n_len, 2);
36534         if ((str2 != NULL) &&
36535             (len > xmlStrlen(BAD_CAST str2)))
36536             len = 0;
36537 
36538         ret_val = xmlStrncatNew(str1, str2, len);
36539         desret_xmlChar_ptr(ret_val);
36540         call_tests++;
36541         des_const_xmlChar_ptr(n_str1, str1, 0);
36542         des_const_xmlChar_ptr(n_str2, str2, 1);
36543         des_int(n_len, len, 2);
36544         xmlResetLastError();
36545         if (mem_base != xmlMemBlocks()) {
36546             printf("Leak of %d blocks found in xmlStrncatNew",
36547 	           xmlMemBlocks() - mem_base);
36548 	    test_ret++;
36549             printf(" %d", n_str1);
36550             printf(" %d", n_str2);
36551             printf(" %d", n_len);
36552             printf("\n");
36553         }
36554     }
36555     }
36556     }
36557     function_tests++;
36558 
36559     return(test_ret);
36560 }
36561 
36562 
36563 static int
test_xmlStrncmp(void)36564 test_xmlStrncmp(void) {
36565     int test_ret = 0;
36566 
36567     int mem_base;
36568     int ret_val;
36569     const xmlChar * str1; /* the first xmlChar * */
36570     int n_str1;
36571     const xmlChar * str2; /* the second xmlChar * */
36572     int n_str2;
36573     int len; /* the max comparison length */
36574     int n_len;
36575 
36576     for (n_str1 = 0;n_str1 < gen_nb_const_xmlChar_ptr;n_str1++) {
36577     for (n_str2 = 0;n_str2 < gen_nb_const_xmlChar_ptr;n_str2++) {
36578     for (n_len = 0;n_len < gen_nb_int;n_len++) {
36579         mem_base = xmlMemBlocks();
36580         str1 = gen_const_xmlChar_ptr(n_str1, 0);
36581         str2 = gen_const_xmlChar_ptr(n_str2, 1);
36582         len = gen_int(n_len, 2);
36583         if ((str2 != NULL) &&
36584             (len > xmlStrlen(BAD_CAST str2)))
36585             len = 0;
36586 
36587         ret_val = xmlStrncmp(str1, str2, len);
36588         desret_int(ret_val);
36589         call_tests++;
36590         des_const_xmlChar_ptr(n_str1, str1, 0);
36591         des_const_xmlChar_ptr(n_str2, str2, 1);
36592         des_int(n_len, len, 2);
36593         xmlResetLastError();
36594         if (mem_base != xmlMemBlocks()) {
36595             printf("Leak of %d blocks found in xmlStrncmp",
36596 	           xmlMemBlocks() - mem_base);
36597 	    test_ret++;
36598             printf(" %d", n_str1);
36599             printf(" %d", n_str2);
36600             printf(" %d", n_len);
36601             printf("\n");
36602         }
36603     }
36604     }
36605     }
36606     function_tests++;
36607 
36608     return(test_ret);
36609 }
36610 
36611 
36612 static int
test_xmlStrndup(void)36613 test_xmlStrndup(void) {
36614     int test_ret = 0;
36615 
36616     int mem_base;
36617     xmlChar * ret_val;
36618     const xmlChar * cur; /* the input xmlChar * */
36619     int n_cur;
36620     int len; /* the len of @cur */
36621     int n_len;
36622 
36623     for (n_cur = 0;n_cur < gen_nb_const_xmlChar_ptr;n_cur++) {
36624     for (n_len = 0;n_len < gen_nb_int;n_len++) {
36625         mem_base = xmlMemBlocks();
36626         cur = gen_const_xmlChar_ptr(n_cur, 0);
36627         len = gen_int(n_len, 1);
36628         if ((cur != NULL) &&
36629             (len > xmlStrlen(BAD_CAST cur)))
36630             len = 0;
36631 
36632         ret_val = xmlStrndup(cur, len);
36633         desret_xmlChar_ptr(ret_val);
36634         call_tests++;
36635         des_const_xmlChar_ptr(n_cur, cur, 0);
36636         des_int(n_len, len, 1);
36637         xmlResetLastError();
36638         if (mem_base != xmlMemBlocks()) {
36639             printf("Leak of %d blocks found in xmlStrndup",
36640 	           xmlMemBlocks() - mem_base);
36641 	    test_ret++;
36642             printf(" %d", n_cur);
36643             printf(" %d", n_len);
36644             printf("\n");
36645         }
36646     }
36647     }
36648     function_tests++;
36649 
36650     return(test_ret);
36651 }
36652 
36653 
36654 static int
test_xmlStrstr(void)36655 test_xmlStrstr(void) {
36656     int test_ret = 0;
36657 
36658     int mem_base;
36659     const xmlChar * ret_val;
36660     const xmlChar * str; /* the xmlChar * array (haystack) */
36661     int n_str;
36662     const xmlChar * val; /* the xmlChar to search (needle) */
36663     int n_val;
36664 
36665     for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) {
36666     for (n_val = 0;n_val < gen_nb_const_xmlChar_ptr;n_val++) {
36667         mem_base = xmlMemBlocks();
36668         str = gen_const_xmlChar_ptr(n_str, 0);
36669         val = gen_const_xmlChar_ptr(n_val, 1);
36670 
36671         ret_val = xmlStrstr(str, val);
36672         desret_const_xmlChar_ptr(ret_val);
36673         call_tests++;
36674         des_const_xmlChar_ptr(n_str, str, 0);
36675         des_const_xmlChar_ptr(n_val, val, 1);
36676         xmlResetLastError();
36677         if (mem_base != xmlMemBlocks()) {
36678             printf("Leak of %d blocks found in xmlStrstr",
36679 	           xmlMemBlocks() - mem_base);
36680 	    test_ret++;
36681             printf(" %d", n_str);
36682             printf(" %d", n_val);
36683             printf("\n");
36684         }
36685     }
36686     }
36687     function_tests++;
36688 
36689     return(test_ret);
36690 }
36691 
36692 
36693 static int
test_xmlStrsub(void)36694 test_xmlStrsub(void) {
36695     int test_ret = 0;
36696 
36697     int mem_base;
36698     xmlChar * ret_val;
36699     const xmlChar * str; /* the xmlChar * array (haystack) */
36700     int n_str;
36701     int start; /* the index of the first char (zero based) */
36702     int n_start;
36703     int len; /* the length of the substring */
36704     int n_len;
36705 
36706     for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) {
36707     for (n_start = 0;n_start < gen_nb_int;n_start++) {
36708     for (n_len = 0;n_len < gen_nb_int;n_len++) {
36709         mem_base = xmlMemBlocks();
36710         str = gen_const_xmlChar_ptr(n_str, 0);
36711         start = gen_int(n_start, 1);
36712         len = gen_int(n_len, 2);
36713         if ((str != NULL) &&
36714             (start > xmlStrlen(BAD_CAST str)))
36715             start = 0;
36716         if ((str != NULL) &&
36717             (len > xmlStrlen(BAD_CAST str)))
36718             len = 0;
36719 
36720         ret_val = xmlStrsub(str, start, len);
36721         desret_xmlChar_ptr(ret_val);
36722         call_tests++;
36723         des_const_xmlChar_ptr(n_str, str, 0);
36724         des_int(n_start, start, 1);
36725         des_int(n_len, len, 2);
36726         xmlResetLastError();
36727         if (mem_base != xmlMemBlocks()) {
36728             printf("Leak of %d blocks found in xmlStrsub",
36729 	           xmlMemBlocks() - mem_base);
36730 	    test_ret++;
36731             printf(" %d", n_str);
36732             printf(" %d", n_start);
36733             printf(" %d", n_len);
36734             printf("\n");
36735         }
36736     }
36737     }
36738     }
36739     function_tests++;
36740 
36741     return(test_ret);
36742 }
36743 
36744 
36745 static int
test_xmlUTF8Charcmp(void)36746 test_xmlUTF8Charcmp(void) {
36747     int test_ret = 0;
36748 
36749     int mem_base;
36750     int ret_val;
36751     const xmlChar * utf1; /* pointer to first UTF8 char */
36752     int n_utf1;
36753     const xmlChar * utf2; /* pointer to second UTF8 char */
36754     int n_utf2;
36755 
36756     for (n_utf1 = 0;n_utf1 < gen_nb_const_xmlChar_ptr;n_utf1++) {
36757     for (n_utf2 = 0;n_utf2 < gen_nb_const_xmlChar_ptr;n_utf2++) {
36758         mem_base = xmlMemBlocks();
36759         utf1 = gen_const_xmlChar_ptr(n_utf1, 0);
36760         utf2 = gen_const_xmlChar_ptr(n_utf2, 1);
36761 
36762         ret_val = xmlUTF8Charcmp(utf1, utf2);
36763         desret_int(ret_val);
36764         call_tests++;
36765         des_const_xmlChar_ptr(n_utf1, utf1, 0);
36766         des_const_xmlChar_ptr(n_utf2, utf2, 1);
36767         xmlResetLastError();
36768         if (mem_base != xmlMemBlocks()) {
36769             printf("Leak of %d blocks found in xmlUTF8Charcmp",
36770 	           xmlMemBlocks() - mem_base);
36771 	    test_ret++;
36772             printf(" %d", n_utf1);
36773             printf(" %d", n_utf2);
36774             printf("\n");
36775         }
36776     }
36777     }
36778     function_tests++;
36779 
36780     return(test_ret);
36781 }
36782 
36783 
36784 static int
test_xmlUTF8Size(void)36785 test_xmlUTF8Size(void) {
36786     int test_ret = 0;
36787 
36788     int mem_base;
36789     int ret_val;
36790     const xmlChar * utf; /* pointer to the UTF8 character */
36791     int n_utf;
36792 
36793     for (n_utf = 0;n_utf < gen_nb_const_xmlChar_ptr;n_utf++) {
36794         mem_base = xmlMemBlocks();
36795         utf = gen_const_xmlChar_ptr(n_utf, 0);
36796 
36797         ret_val = xmlUTF8Size(utf);
36798         desret_int(ret_val);
36799         call_tests++;
36800         des_const_xmlChar_ptr(n_utf, utf, 0);
36801         xmlResetLastError();
36802         if (mem_base != xmlMemBlocks()) {
36803             printf("Leak of %d blocks found in xmlUTF8Size",
36804 	           xmlMemBlocks() - mem_base);
36805 	    test_ret++;
36806             printf(" %d", n_utf);
36807             printf("\n");
36808         }
36809     }
36810     function_tests++;
36811 
36812     return(test_ret);
36813 }
36814 
36815 
36816 static int
test_xmlUTF8Strlen(void)36817 test_xmlUTF8Strlen(void) {
36818     int test_ret = 0;
36819 
36820     int mem_base;
36821     int ret_val;
36822     const xmlChar * utf; /* a sequence of UTF-8 encoded bytes */
36823     int n_utf;
36824 
36825     for (n_utf = 0;n_utf < gen_nb_const_xmlChar_ptr;n_utf++) {
36826         mem_base = xmlMemBlocks();
36827         utf = gen_const_xmlChar_ptr(n_utf, 0);
36828 
36829         ret_val = xmlUTF8Strlen(utf);
36830         desret_int(ret_val);
36831         call_tests++;
36832         des_const_xmlChar_ptr(n_utf, utf, 0);
36833         xmlResetLastError();
36834         if (mem_base != xmlMemBlocks()) {
36835             printf("Leak of %d blocks found in xmlUTF8Strlen",
36836 	           xmlMemBlocks() - mem_base);
36837 	    test_ret++;
36838             printf(" %d", n_utf);
36839             printf("\n");
36840         }
36841     }
36842     function_tests++;
36843 
36844     return(test_ret);
36845 }
36846 
36847 
36848 static int
test_xmlUTF8Strloc(void)36849 test_xmlUTF8Strloc(void) {
36850     int test_ret = 0;
36851 
36852     int mem_base;
36853     int ret_val;
36854     const xmlChar * utf; /* the input UTF8 * */
36855     int n_utf;
36856     const xmlChar * utfchar; /* the UTF8 character to be found */
36857     int n_utfchar;
36858 
36859     for (n_utf = 0;n_utf < gen_nb_const_xmlChar_ptr;n_utf++) {
36860     for (n_utfchar = 0;n_utfchar < gen_nb_const_xmlChar_ptr;n_utfchar++) {
36861         mem_base = xmlMemBlocks();
36862         utf = gen_const_xmlChar_ptr(n_utf, 0);
36863         utfchar = gen_const_xmlChar_ptr(n_utfchar, 1);
36864 
36865         ret_val = xmlUTF8Strloc(utf, utfchar);
36866         desret_int(ret_val);
36867         call_tests++;
36868         des_const_xmlChar_ptr(n_utf, utf, 0);
36869         des_const_xmlChar_ptr(n_utfchar, utfchar, 1);
36870         xmlResetLastError();
36871         if (mem_base != xmlMemBlocks()) {
36872             printf("Leak of %d blocks found in xmlUTF8Strloc",
36873 	           xmlMemBlocks() - mem_base);
36874 	    test_ret++;
36875             printf(" %d", n_utf);
36876             printf(" %d", n_utfchar);
36877             printf("\n");
36878         }
36879     }
36880     }
36881     function_tests++;
36882 
36883     return(test_ret);
36884 }
36885 
36886 
36887 static int
test_xmlUTF8Strndup(void)36888 test_xmlUTF8Strndup(void) {
36889     int test_ret = 0;
36890 
36891     int mem_base;
36892     xmlChar * ret_val;
36893     const xmlChar * utf; /* the input UTF8 * */
36894     int n_utf;
36895     int len; /* the len of @utf (in chars) */
36896     int n_len;
36897 
36898     for (n_utf = 0;n_utf < gen_nb_const_xmlChar_ptr;n_utf++) {
36899     for (n_len = 0;n_len < gen_nb_int;n_len++) {
36900         mem_base = xmlMemBlocks();
36901         utf = gen_const_xmlChar_ptr(n_utf, 0);
36902         len = gen_int(n_len, 1);
36903         if ((utf != NULL) &&
36904             (len > xmlStrlen(BAD_CAST utf)))
36905             len = 0;
36906 
36907         ret_val = xmlUTF8Strndup(utf, len);
36908         desret_xmlChar_ptr(ret_val);
36909         call_tests++;
36910         des_const_xmlChar_ptr(n_utf, utf, 0);
36911         des_int(n_len, len, 1);
36912         xmlResetLastError();
36913         if (mem_base != xmlMemBlocks()) {
36914             printf("Leak of %d blocks found in xmlUTF8Strndup",
36915 	           xmlMemBlocks() - mem_base);
36916 	    test_ret++;
36917             printf(" %d", n_utf);
36918             printf(" %d", n_len);
36919             printf("\n");
36920         }
36921     }
36922     }
36923     function_tests++;
36924 
36925     return(test_ret);
36926 }
36927 
36928 
36929 static int
test_xmlUTF8Strpos(void)36930 test_xmlUTF8Strpos(void) {
36931     int test_ret = 0;
36932 
36933     int mem_base;
36934     const xmlChar * ret_val;
36935     const xmlChar * utf; /* the input UTF8 * */
36936     int n_utf;
36937     int pos; /* the position of the desired UTF8 char (in chars) */
36938     int n_pos;
36939 
36940     for (n_utf = 0;n_utf < gen_nb_const_xmlChar_ptr;n_utf++) {
36941     for (n_pos = 0;n_pos < gen_nb_int;n_pos++) {
36942         mem_base = xmlMemBlocks();
36943         utf = gen_const_xmlChar_ptr(n_utf, 0);
36944         pos = gen_int(n_pos, 1);
36945 
36946         ret_val = xmlUTF8Strpos(utf, pos);
36947         desret_const_xmlChar_ptr(ret_val);
36948         call_tests++;
36949         des_const_xmlChar_ptr(n_utf, utf, 0);
36950         des_int(n_pos, pos, 1);
36951         xmlResetLastError();
36952         if (mem_base != xmlMemBlocks()) {
36953             printf("Leak of %d blocks found in xmlUTF8Strpos",
36954 	           xmlMemBlocks() - mem_base);
36955 	    test_ret++;
36956             printf(" %d", n_utf);
36957             printf(" %d", n_pos);
36958             printf("\n");
36959         }
36960     }
36961     }
36962     function_tests++;
36963 
36964     return(test_ret);
36965 }
36966 
36967 
36968 static int
test_xmlUTF8Strsize(void)36969 test_xmlUTF8Strsize(void) {
36970     int test_ret = 0;
36971 
36972     int mem_base;
36973     int ret_val;
36974     const xmlChar * utf; /* a sequence of UTF-8 encoded bytes */
36975     int n_utf;
36976     int len; /* the number of characters in the array */
36977     int n_len;
36978 
36979     for (n_utf = 0;n_utf < gen_nb_const_xmlChar_ptr;n_utf++) {
36980     for (n_len = 0;n_len < gen_nb_int;n_len++) {
36981         mem_base = xmlMemBlocks();
36982         utf = gen_const_xmlChar_ptr(n_utf, 0);
36983         len = gen_int(n_len, 1);
36984         if ((utf != NULL) &&
36985             (len > xmlStrlen(BAD_CAST utf)))
36986             len = 0;
36987 
36988         ret_val = xmlUTF8Strsize(utf, len);
36989         desret_int(ret_val);
36990         call_tests++;
36991         des_const_xmlChar_ptr(n_utf, utf, 0);
36992         des_int(n_len, len, 1);
36993         xmlResetLastError();
36994         if (mem_base != xmlMemBlocks()) {
36995             printf("Leak of %d blocks found in xmlUTF8Strsize",
36996 	           xmlMemBlocks() - mem_base);
36997 	    test_ret++;
36998             printf(" %d", n_utf);
36999             printf(" %d", n_len);
37000             printf("\n");
37001         }
37002     }
37003     }
37004     function_tests++;
37005 
37006     return(test_ret);
37007 }
37008 
37009 
37010 static int
test_xmlUTF8Strsub(void)37011 test_xmlUTF8Strsub(void) {
37012     int test_ret = 0;
37013 
37014     int mem_base;
37015     xmlChar * ret_val;
37016     const xmlChar * utf; /* a sequence of UTF-8 encoded bytes */
37017     int n_utf;
37018     int start; /* relative pos of first char */
37019     int n_start;
37020     int len; /* total number to copy */
37021     int n_len;
37022 
37023     for (n_utf = 0;n_utf < gen_nb_const_xmlChar_ptr;n_utf++) {
37024     for (n_start = 0;n_start < gen_nb_int;n_start++) {
37025     for (n_len = 0;n_len < gen_nb_int;n_len++) {
37026         mem_base = xmlMemBlocks();
37027         utf = gen_const_xmlChar_ptr(n_utf, 0);
37028         start = gen_int(n_start, 1);
37029         len = gen_int(n_len, 2);
37030         if ((utf != NULL) &&
37031             (start > xmlStrlen(BAD_CAST utf)))
37032             start = 0;
37033         if ((utf != NULL) &&
37034             (len > xmlStrlen(BAD_CAST utf)))
37035             len = 0;
37036 
37037         ret_val = xmlUTF8Strsub(utf, start, len);
37038         desret_xmlChar_ptr(ret_val);
37039         call_tests++;
37040         des_const_xmlChar_ptr(n_utf, utf, 0);
37041         des_int(n_start, start, 1);
37042         des_int(n_len, len, 2);
37043         xmlResetLastError();
37044         if (mem_base != xmlMemBlocks()) {
37045             printf("Leak of %d blocks found in xmlUTF8Strsub",
37046 	           xmlMemBlocks() - mem_base);
37047 	    test_ret++;
37048             printf(" %d", n_utf);
37049             printf(" %d", n_start);
37050             printf(" %d", n_len);
37051             printf("\n");
37052         }
37053     }
37054     }
37055     }
37056     function_tests++;
37057 
37058     return(test_ret);
37059 }
37060 
37061 static int
test_xmlstring(void)37062 test_xmlstring(void) {
37063     int test_ret = 0;
37064 
37065     if (quiet == 0) printf("Testing xmlstring : 26 of 30 functions ...\n");
37066     test_ret += test_xmlCharStrdup();
37067     test_ret += test_xmlCharStrndup();
37068     test_ret += test_xmlCheckUTF8();
37069     test_ret += test_xmlGetUTF8Char();
37070     test_ret += test_xmlStrEqual();
37071     test_ret += test_xmlStrPrintf();
37072     test_ret += test_xmlStrQEqual();
37073     test_ret += test_xmlStrVPrintf();
37074     test_ret += test_xmlStrcasecmp();
37075     test_ret += test_xmlStrcasestr();
37076     test_ret += test_xmlStrchr();
37077     test_ret += test_xmlStrcmp();
37078     test_ret += test_xmlStrdup();
37079     test_ret += test_xmlStrlen();
37080     test_ret += test_xmlStrncasecmp();
37081     test_ret += test_xmlStrncatNew();
37082     test_ret += test_xmlStrncmp();
37083     test_ret += test_xmlStrndup();
37084     test_ret += test_xmlStrstr();
37085     test_ret += test_xmlStrsub();
37086     test_ret += test_xmlUTF8Charcmp();
37087     test_ret += test_xmlUTF8Size();
37088     test_ret += test_xmlUTF8Strlen();
37089     test_ret += test_xmlUTF8Strloc();
37090     test_ret += test_xmlUTF8Strndup();
37091     test_ret += test_xmlUTF8Strpos();
37092     test_ret += test_xmlUTF8Strsize();
37093     test_ret += test_xmlUTF8Strsub();
37094 
37095     if (test_ret != 0)
37096 	printf("Module xmlstring: %d errors\n", test_ret);
37097     return(test_ret);
37098 }
37099 
37100 static int
test_xmlUCSIsAegeanNumbers(void)37101 test_xmlUCSIsAegeanNumbers(void) {
37102     int test_ret = 0;
37103 
37104 #if defined(LIBXML_UNICODE_ENABLED)
37105     int mem_base;
37106     int ret_val;
37107     int code; /* UCS code point */
37108     int n_code;
37109 
37110     for (n_code = 0;n_code < gen_nb_int;n_code++) {
37111         mem_base = xmlMemBlocks();
37112         code = gen_int(n_code, 0);
37113 
37114         ret_val = xmlUCSIsAegeanNumbers(code);
37115         desret_int(ret_val);
37116         call_tests++;
37117         des_int(n_code, code, 0);
37118         xmlResetLastError();
37119         if (mem_base != xmlMemBlocks()) {
37120             printf("Leak of %d blocks found in xmlUCSIsAegeanNumbers",
37121 	           xmlMemBlocks() - mem_base);
37122 	    test_ret++;
37123             printf(" %d", n_code);
37124             printf("\n");
37125         }
37126     }
37127     function_tests++;
37128 #endif
37129 
37130     return(test_ret);
37131 }
37132 
37133 
37134 static int
test_xmlUCSIsAlphabeticPresentationForms(void)37135 test_xmlUCSIsAlphabeticPresentationForms(void) {
37136     int test_ret = 0;
37137 
37138 #if defined(LIBXML_UNICODE_ENABLED)
37139     int mem_base;
37140     int ret_val;
37141     int code; /* UCS code point */
37142     int n_code;
37143 
37144     for (n_code = 0;n_code < gen_nb_int;n_code++) {
37145         mem_base = xmlMemBlocks();
37146         code = gen_int(n_code, 0);
37147 
37148         ret_val = xmlUCSIsAlphabeticPresentationForms(code);
37149         desret_int(ret_val);
37150         call_tests++;
37151         des_int(n_code, code, 0);
37152         xmlResetLastError();
37153         if (mem_base != xmlMemBlocks()) {
37154             printf("Leak of %d blocks found in xmlUCSIsAlphabeticPresentationForms",
37155 	           xmlMemBlocks() - mem_base);
37156 	    test_ret++;
37157             printf(" %d", n_code);
37158             printf("\n");
37159         }
37160     }
37161     function_tests++;
37162 #endif
37163 
37164     return(test_ret);
37165 }
37166 
37167 
37168 static int
test_xmlUCSIsArabic(void)37169 test_xmlUCSIsArabic(void) {
37170     int test_ret = 0;
37171 
37172 #if defined(LIBXML_UNICODE_ENABLED)
37173     int mem_base;
37174     int ret_val;
37175     int code; /* UCS code point */
37176     int n_code;
37177 
37178     for (n_code = 0;n_code < gen_nb_int;n_code++) {
37179         mem_base = xmlMemBlocks();
37180         code = gen_int(n_code, 0);
37181 
37182         ret_val = xmlUCSIsArabic(code);
37183         desret_int(ret_val);
37184         call_tests++;
37185         des_int(n_code, code, 0);
37186         xmlResetLastError();
37187         if (mem_base != xmlMemBlocks()) {
37188             printf("Leak of %d blocks found in xmlUCSIsArabic",
37189 	           xmlMemBlocks() - mem_base);
37190 	    test_ret++;
37191             printf(" %d", n_code);
37192             printf("\n");
37193         }
37194     }
37195     function_tests++;
37196 #endif
37197 
37198     return(test_ret);
37199 }
37200 
37201 
37202 static int
test_xmlUCSIsArabicPresentationFormsA(void)37203 test_xmlUCSIsArabicPresentationFormsA(void) {
37204     int test_ret = 0;
37205 
37206 #if defined(LIBXML_UNICODE_ENABLED)
37207     int mem_base;
37208     int ret_val;
37209     int code; /* UCS code point */
37210     int n_code;
37211 
37212     for (n_code = 0;n_code < gen_nb_int;n_code++) {
37213         mem_base = xmlMemBlocks();
37214         code = gen_int(n_code, 0);
37215 
37216         ret_val = xmlUCSIsArabicPresentationFormsA(code);
37217         desret_int(ret_val);
37218         call_tests++;
37219         des_int(n_code, code, 0);
37220         xmlResetLastError();
37221         if (mem_base != xmlMemBlocks()) {
37222             printf("Leak of %d blocks found in xmlUCSIsArabicPresentationFormsA",
37223 	           xmlMemBlocks() - mem_base);
37224 	    test_ret++;
37225             printf(" %d", n_code);
37226             printf("\n");
37227         }
37228     }
37229     function_tests++;
37230 #endif
37231 
37232     return(test_ret);
37233 }
37234 
37235 
37236 static int
test_xmlUCSIsArabicPresentationFormsB(void)37237 test_xmlUCSIsArabicPresentationFormsB(void) {
37238     int test_ret = 0;
37239 
37240 #if defined(LIBXML_UNICODE_ENABLED)
37241     int mem_base;
37242     int ret_val;
37243     int code; /* UCS code point */
37244     int n_code;
37245 
37246     for (n_code = 0;n_code < gen_nb_int;n_code++) {
37247         mem_base = xmlMemBlocks();
37248         code = gen_int(n_code, 0);
37249 
37250         ret_val = xmlUCSIsArabicPresentationFormsB(code);
37251         desret_int(ret_val);
37252         call_tests++;
37253         des_int(n_code, code, 0);
37254         xmlResetLastError();
37255         if (mem_base != xmlMemBlocks()) {
37256             printf("Leak of %d blocks found in xmlUCSIsArabicPresentationFormsB",
37257 	           xmlMemBlocks() - mem_base);
37258 	    test_ret++;
37259             printf(" %d", n_code);
37260             printf("\n");
37261         }
37262     }
37263     function_tests++;
37264 #endif
37265 
37266     return(test_ret);
37267 }
37268 
37269 
37270 static int
test_xmlUCSIsArmenian(void)37271 test_xmlUCSIsArmenian(void) {
37272     int test_ret = 0;
37273 
37274 #if defined(LIBXML_UNICODE_ENABLED)
37275     int mem_base;
37276     int ret_val;
37277     int code; /* UCS code point */
37278     int n_code;
37279 
37280     for (n_code = 0;n_code < gen_nb_int;n_code++) {
37281         mem_base = xmlMemBlocks();
37282         code = gen_int(n_code, 0);
37283 
37284         ret_val = xmlUCSIsArmenian(code);
37285         desret_int(ret_val);
37286         call_tests++;
37287         des_int(n_code, code, 0);
37288         xmlResetLastError();
37289         if (mem_base != xmlMemBlocks()) {
37290             printf("Leak of %d blocks found in xmlUCSIsArmenian",
37291 	           xmlMemBlocks() - mem_base);
37292 	    test_ret++;
37293             printf(" %d", n_code);
37294             printf("\n");
37295         }
37296     }
37297     function_tests++;
37298 #endif
37299 
37300     return(test_ret);
37301 }
37302 
37303 
37304 static int
test_xmlUCSIsArrows(void)37305 test_xmlUCSIsArrows(void) {
37306     int test_ret = 0;
37307 
37308 #if defined(LIBXML_UNICODE_ENABLED)
37309     int mem_base;
37310     int ret_val;
37311     int code; /* UCS code point */
37312     int n_code;
37313 
37314     for (n_code = 0;n_code < gen_nb_int;n_code++) {
37315         mem_base = xmlMemBlocks();
37316         code = gen_int(n_code, 0);
37317 
37318         ret_val = xmlUCSIsArrows(code);
37319         desret_int(ret_val);
37320         call_tests++;
37321         des_int(n_code, code, 0);
37322         xmlResetLastError();
37323         if (mem_base != xmlMemBlocks()) {
37324             printf("Leak of %d blocks found in xmlUCSIsArrows",
37325 	           xmlMemBlocks() - mem_base);
37326 	    test_ret++;
37327             printf(" %d", n_code);
37328             printf("\n");
37329         }
37330     }
37331     function_tests++;
37332 #endif
37333 
37334     return(test_ret);
37335 }
37336 
37337 
37338 static int
test_xmlUCSIsBasicLatin(void)37339 test_xmlUCSIsBasicLatin(void) {
37340     int test_ret = 0;
37341 
37342 #if defined(LIBXML_UNICODE_ENABLED)
37343     int mem_base;
37344     int ret_val;
37345     int code; /* UCS code point */
37346     int n_code;
37347 
37348     for (n_code = 0;n_code < gen_nb_int;n_code++) {
37349         mem_base = xmlMemBlocks();
37350         code = gen_int(n_code, 0);
37351 
37352         ret_val = xmlUCSIsBasicLatin(code);
37353         desret_int(ret_val);
37354         call_tests++;
37355         des_int(n_code, code, 0);
37356         xmlResetLastError();
37357         if (mem_base != xmlMemBlocks()) {
37358             printf("Leak of %d blocks found in xmlUCSIsBasicLatin",
37359 	           xmlMemBlocks() - mem_base);
37360 	    test_ret++;
37361             printf(" %d", n_code);
37362             printf("\n");
37363         }
37364     }
37365     function_tests++;
37366 #endif
37367 
37368     return(test_ret);
37369 }
37370 
37371 
37372 static int
test_xmlUCSIsBengali(void)37373 test_xmlUCSIsBengali(void) {
37374     int test_ret = 0;
37375 
37376 #if defined(LIBXML_UNICODE_ENABLED)
37377     int mem_base;
37378     int ret_val;
37379     int code; /* UCS code point */
37380     int n_code;
37381 
37382     for (n_code = 0;n_code < gen_nb_int;n_code++) {
37383         mem_base = xmlMemBlocks();
37384         code = gen_int(n_code, 0);
37385 
37386         ret_val = xmlUCSIsBengali(code);
37387         desret_int(ret_val);
37388         call_tests++;
37389         des_int(n_code, code, 0);
37390         xmlResetLastError();
37391         if (mem_base != xmlMemBlocks()) {
37392             printf("Leak of %d blocks found in xmlUCSIsBengali",
37393 	           xmlMemBlocks() - mem_base);
37394 	    test_ret++;
37395             printf(" %d", n_code);
37396             printf("\n");
37397         }
37398     }
37399     function_tests++;
37400 #endif
37401 
37402     return(test_ret);
37403 }
37404 
37405 
37406 static int
test_xmlUCSIsBlock(void)37407 test_xmlUCSIsBlock(void) {
37408     int test_ret = 0;
37409 
37410 #if defined(LIBXML_UNICODE_ENABLED)
37411     int mem_base;
37412     int ret_val;
37413     int code; /* UCS code point */
37414     int n_code;
37415     const char * block; /* UCS block name */
37416     int n_block;
37417 
37418     for (n_code = 0;n_code < gen_nb_int;n_code++) {
37419     for (n_block = 0;n_block < gen_nb_const_char_ptr;n_block++) {
37420         mem_base = xmlMemBlocks();
37421         code = gen_int(n_code, 0);
37422         block = gen_const_char_ptr(n_block, 1);
37423 
37424         ret_val = xmlUCSIsBlock(code, block);
37425         desret_int(ret_val);
37426         call_tests++;
37427         des_int(n_code, code, 0);
37428         des_const_char_ptr(n_block, block, 1);
37429         xmlResetLastError();
37430         if (mem_base != xmlMemBlocks()) {
37431             printf("Leak of %d blocks found in xmlUCSIsBlock",
37432 	           xmlMemBlocks() - mem_base);
37433 	    test_ret++;
37434             printf(" %d", n_code);
37435             printf(" %d", n_block);
37436             printf("\n");
37437         }
37438     }
37439     }
37440     function_tests++;
37441 #endif
37442 
37443     return(test_ret);
37444 }
37445 
37446 
37447 static int
test_xmlUCSIsBlockElements(void)37448 test_xmlUCSIsBlockElements(void) {
37449     int test_ret = 0;
37450 
37451 #if defined(LIBXML_UNICODE_ENABLED)
37452     int mem_base;
37453     int ret_val;
37454     int code; /* UCS code point */
37455     int n_code;
37456 
37457     for (n_code = 0;n_code < gen_nb_int;n_code++) {
37458         mem_base = xmlMemBlocks();
37459         code = gen_int(n_code, 0);
37460 
37461         ret_val = xmlUCSIsBlockElements(code);
37462         desret_int(ret_val);
37463         call_tests++;
37464         des_int(n_code, code, 0);
37465         xmlResetLastError();
37466         if (mem_base != xmlMemBlocks()) {
37467             printf("Leak of %d blocks found in xmlUCSIsBlockElements",
37468 	           xmlMemBlocks() - mem_base);
37469 	    test_ret++;
37470             printf(" %d", n_code);
37471             printf("\n");
37472         }
37473     }
37474     function_tests++;
37475 #endif
37476 
37477     return(test_ret);
37478 }
37479 
37480 
37481 static int
test_xmlUCSIsBopomofo(void)37482 test_xmlUCSIsBopomofo(void) {
37483     int test_ret = 0;
37484 
37485 #if defined(LIBXML_UNICODE_ENABLED)
37486     int mem_base;
37487     int ret_val;
37488     int code; /* UCS code point */
37489     int n_code;
37490 
37491     for (n_code = 0;n_code < gen_nb_int;n_code++) {
37492         mem_base = xmlMemBlocks();
37493         code = gen_int(n_code, 0);
37494 
37495         ret_val = xmlUCSIsBopomofo(code);
37496         desret_int(ret_val);
37497         call_tests++;
37498         des_int(n_code, code, 0);
37499         xmlResetLastError();
37500         if (mem_base != xmlMemBlocks()) {
37501             printf("Leak of %d blocks found in xmlUCSIsBopomofo",
37502 	           xmlMemBlocks() - mem_base);
37503 	    test_ret++;
37504             printf(" %d", n_code);
37505             printf("\n");
37506         }
37507     }
37508     function_tests++;
37509 #endif
37510 
37511     return(test_ret);
37512 }
37513 
37514 
37515 static int
test_xmlUCSIsBopomofoExtended(void)37516 test_xmlUCSIsBopomofoExtended(void) {
37517     int test_ret = 0;
37518 
37519 #if defined(LIBXML_UNICODE_ENABLED)
37520     int mem_base;
37521     int ret_val;
37522     int code; /* UCS code point */
37523     int n_code;
37524 
37525     for (n_code = 0;n_code < gen_nb_int;n_code++) {
37526         mem_base = xmlMemBlocks();
37527         code = gen_int(n_code, 0);
37528 
37529         ret_val = xmlUCSIsBopomofoExtended(code);
37530         desret_int(ret_val);
37531         call_tests++;
37532         des_int(n_code, code, 0);
37533         xmlResetLastError();
37534         if (mem_base != xmlMemBlocks()) {
37535             printf("Leak of %d blocks found in xmlUCSIsBopomofoExtended",
37536 	           xmlMemBlocks() - mem_base);
37537 	    test_ret++;
37538             printf(" %d", n_code);
37539             printf("\n");
37540         }
37541     }
37542     function_tests++;
37543 #endif
37544 
37545     return(test_ret);
37546 }
37547 
37548 
37549 static int
test_xmlUCSIsBoxDrawing(void)37550 test_xmlUCSIsBoxDrawing(void) {
37551     int test_ret = 0;
37552 
37553 #if defined(LIBXML_UNICODE_ENABLED)
37554     int mem_base;
37555     int ret_val;
37556     int code; /* UCS code point */
37557     int n_code;
37558 
37559     for (n_code = 0;n_code < gen_nb_int;n_code++) {
37560         mem_base = xmlMemBlocks();
37561         code = gen_int(n_code, 0);
37562 
37563         ret_val = xmlUCSIsBoxDrawing(code);
37564         desret_int(ret_val);
37565         call_tests++;
37566         des_int(n_code, code, 0);
37567         xmlResetLastError();
37568         if (mem_base != xmlMemBlocks()) {
37569             printf("Leak of %d blocks found in xmlUCSIsBoxDrawing",
37570 	           xmlMemBlocks() - mem_base);
37571 	    test_ret++;
37572             printf(" %d", n_code);
37573             printf("\n");
37574         }
37575     }
37576     function_tests++;
37577 #endif
37578 
37579     return(test_ret);
37580 }
37581 
37582 
37583 static int
test_xmlUCSIsBraillePatterns(void)37584 test_xmlUCSIsBraillePatterns(void) {
37585     int test_ret = 0;
37586 
37587 #if defined(LIBXML_UNICODE_ENABLED)
37588     int mem_base;
37589     int ret_val;
37590     int code; /* UCS code point */
37591     int n_code;
37592 
37593     for (n_code = 0;n_code < gen_nb_int;n_code++) {
37594         mem_base = xmlMemBlocks();
37595         code = gen_int(n_code, 0);
37596 
37597         ret_val = xmlUCSIsBraillePatterns(code);
37598         desret_int(ret_val);
37599         call_tests++;
37600         des_int(n_code, code, 0);
37601         xmlResetLastError();
37602         if (mem_base != xmlMemBlocks()) {
37603             printf("Leak of %d blocks found in xmlUCSIsBraillePatterns",
37604 	           xmlMemBlocks() - mem_base);
37605 	    test_ret++;
37606             printf(" %d", n_code);
37607             printf("\n");
37608         }
37609     }
37610     function_tests++;
37611 #endif
37612 
37613     return(test_ret);
37614 }
37615 
37616 
37617 static int
test_xmlUCSIsBuhid(void)37618 test_xmlUCSIsBuhid(void) {
37619     int test_ret = 0;
37620 
37621 #if defined(LIBXML_UNICODE_ENABLED)
37622     int mem_base;
37623     int ret_val;
37624     int code; /* UCS code point */
37625     int n_code;
37626 
37627     for (n_code = 0;n_code < gen_nb_int;n_code++) {
37628         mem_base = xmlMemBlocks();
37629         code = gen_int(n_code, 0);
37630 
37631         ret_val = xmlUCSIsBuhid(code);
37632         desret_int(ret_val);
37633         call_tests++;
37634         des_int(n_code, code, 0);
37635         xmlResetLastError();
37636         if (mem_base != xmlMemBlocks()) {
37637             printf("Leak of %d blocks found in xmlUCSIsBuhid",
37638 	           xmlMemBlocks() - mem_base);
37639 	    test_ret++;
37640             printf(" %d", n_code);
37641             printf("\n");
37642         }
37643     }
37644     function_tests++;
37645 #endif
37646 
37647     return(test_ret);
37648 }
37649 
37650 
37651 static int
test_xmlUCSIsByzantineMusicalSymbols(void)37652 test_xmlUCSIsByzantineMusicalSymbols(void) {
37653     int test_ret = 0;
37654 
37655 #if defined(LIBXML_UNICODE_ENABLED)
37656     int mem_base;
37657     int ret_val;
37658     int code; /* UCS code point */
37659     int n_code;
37660 
37661     for (n_code = 0;n_code < gen_nb_int;n_code++) {
37662         mem_base = xmlMemBlocks();
37663         code = gen_int(n_code, 0);
37664 
37665         ret_val = xmlUCSIsByzantineMusicalSymbols(code);
37666         desret_int(ret_val);
37667         call_tests++;
37668         des_int(n_code, code, 0);
37669         xmlResetLastError();
37670         if (mem_base != xmlMemBlocks()) {
37671             printf("Leak of %d blocks found in xmlUCSIsByzantineMusicalSymbols",
37672 	           xmlMemBlocks() - mem_base);
37673 	    test_ret++;
37674             printf(" %d", n_code);
37675             printf("\n");
37676         }
37677     }
37678     function_tests++;
37679 #endif
37680 
37681     return(test_ret);
37682 }
37683 
37684 
37685 static int
test_xmlUCSIsCJKCompatibility(void)37686 test_xmlUCSIsCJKCompatibility(void) {
37687     int test_ret = 0;
37688 
37689 #if defined(LIBXML_UNICODE_ENABLED)
37690     int mem_base;
37691     int ret_val;
37692     int code; /* UCS code point */
37693     int n_code;
37694 
37695     for (n_code = 0;n_code < gen_nb_int;n_code++) {
37696         mem_base = xmlMemBlocks();
37697         code = gen_int(n_code, 0);
37698 
37699         ret_val = xmlUCSIsCJKCompatibility(code);
37700         desret_int(ret_val);
37701         call_tests++;
37702         des_int(n_code, code, 0);
37703         xmlResetLastError();
37704         if (mem_base != xmlMemBlocks()) {
37705             printf("Leak of %d blocks found in xmlUCSIsCJKCompatibility",
37706 	           xmlMemBlocks() - mem_base);
37707 	    test_ret++;
37708             printf(" %d", n_code);
37709             printf("\n");
37710         }
37711     }
37712     function_tests++;
37713 #endif
37714 
37715     return(test_ret);
37716 }
37717 
37718 
37719 static int
test_xmlUCSIsCJKCompatibilityForms(void)37720 test_xmlUCSIsCJKCompatibilityForms(void) {
37721     int test_ret = 0;
37722 
37723 #if defined(LIBXML_UNICODE_ENABLED)
37724     int mem_base;
37725     int ret_val;
37726     int code; /* UCS code point */
37727     int n_code;
37728 
37729     for (n_code = 0;n_code < gen_nb_int;n_code++) {
37730         mem_base = xmlMemBlocks();
37731         code = gen_int(n_code, 0);
37732 
37733         ret_val = xmlUCSIsCJKCompatibilityForms(code);
37734         desret_int(ret_val);
37735         call_tests++;
37736         des_int(n_code, code, 0);
37737         xmlResetLastError();
37738         if (mem_base != xmlMemBlocks()) {
37739             printf("Leak of %d blocks found in xmlUCSIsCJKCompatibilityForms",
37740 	           xmlMemBlocks() - mem_base);
37741 	    test_ret++;
37742             printf(" %d", n_code);
37743             printf("\n");
37744         }
37745     }
37746     function_tests++;
37747 #endif
37748 
37749     return(test_ret);
37750 }
37751 
37752 
37753 static int
test_xmlUCSIsCJKCompatibilityIdeographs(void)37754 test_xmlUCSIsCJKCompatibilityIdeographs(void) {
37755     int test_ret = 0;
37756 
37757 #if defined(LIBXML_UNICODE_ENABLED)
37758     int mem_base;
37759     int ret_val;
37760     int code; /* UCS code point */
37761     int n_code;
37762 
37763     for (n_code = 0;n_code < gen_nb_int;n_code++) {
37764         mem_base = xmlMemBlocks();
37765         code = gen_int(n_code, 0);
37766 
37767         ret_val = xmlUCSIsCJKCompatibilityIdeographs(code);
37768         desret_int(ret_val);
37769         call_tests++;
37770         des_int(n_code, code, 0);
37771         xmlResetLastError();
37772         if (mem_base != xmlMemBlocks()) {
37773             printf("Leak of %d blocks found in xmlUCSIsCJKCompatibilityIdeographs",
37774 	           xmlMemBlocks() - mem_base);
37775 	    test_ret++;
37776             printf(" %d", n_code);
37777             printf("\n");
37778         }
37779     }
37780     function_tests++;
37781 #endif
37782 
37783     return(test_ret);
37784 }
37785 
37786 
37787 static int
test_xmlUCSIsCJKCompatibilityIdeographsSupplement(void)37788 test_xmlUCSIsCJKCompatibilityIdeographsSupplement(void) {
37789     int test_ret = 0;
37790 
37791 #if defined(LIBXML_UNICODE_ENABLED)
37792     int mem_base;
37793     int ret_val;
37794     int code; /* UCS code point */
37795     int n_code;
37796 
37797     for (n_code = 0;n_code < gen_nb_int;n_code++) {
37798         mem_base = xmlMemBlocks();
37799         code = gen_int(n_code, 0);
37800 
37801         ret_val = xmlUCSIsCJKCompatibilityIdeographsSupplement(code);
37802         desret_int(ret_val);
37803         call_tests++;
37804         des_int(n_code, code, 0);
37805         xmlResetLastError();
37806         if (mem_base != xmlMemBlocks()) {
37807             printf("Leak of %d blocks found in xmlUCSIsCJKCompatibilityIdeographsSupplement",
37808 	           xmlMemBlocks() - mem_base);
37809 	    test_ret++;
37810             printf(" %d", n_code);
37811             printf("\n");
37812         }
37813     }
37814     function_tests++;
37815 #endif
37816 
37817     return(test_ret);
37818 }
37819 
37820 
37821 static int
test_xmlUCSIsCJKRadicalsSupplement(void)37822 test_xmlUCSIsCJKRadicalsSupplement(void) {
37823     int test_ret = 0;
37824 
37825 #if defined(LIBXML_UNICODE_ENABLED)
37826     int mem_base;
37827     int ret_val;
37828     int code; /* UCS code point */
37829     int n_code;
37830 
37831     for (n_code = 0;n_code < gen_nb_int;n_code++) {
37832         mem_base = xmlMemBlocks();
37833         code = gen_int(n_code, 0);
37834 
37835         ret_val = xmlUCSIsCJKRadicalsSupplement(code);
37836         desret_int(ret_val);
37837         call_tests++;
37838         des_int(n_code, code, 0);
37839         xmlResetLastError();
37840         if (mem_base != xmlMemBlocks()) {
37841             printf("Leak of %d blocks found in xmlUCSIsCJKRadicalsSupplement",
37842 	           xmlMemBlocks() - mem_base);
37843 	    test_ret++;
37844             printf(" %d", n_code);
37845             printf("\n");
37846         }
37847     }
37848     function_tests++;
37849 #endif
37850 
37851     return(test_ret);
37852 }
37853 
37854 
37855 static int
test_xmlUCSIsCJKSymbolsandPunctuation(void)37856 test_xmlUCSIsCJKSymbolsandPunctuation(void) {
37857     int test_ret = 0;
37858 
37859 #if defined(LIBXML_UNICODE_ENABLED)
37860     int mem_base;
37861     int ret_val;
37862     int code; /* UCS code point */
37863     int n_code;
37864 
37865     for (n_code = 0;n_code < gen_nb_int;n_code++) {
37866         mem_base = xmlMemBlocks();
37867         code = gen_int(n_code, 0);
37868 
37869         ret_val = xmlUCSIsCJKSymbolsandPunctuation(code);
37870         desret_int(ret_val);
37871         call_tests++;
37872         des_int(n_code, code, 0);
37873         xmlResetLastError();
37874         if (mem_base != xmlMemBlocks()) {
37875             printf("Leak of %d blocks found in xmlUCSIsCJKSymbolsandPunctuation",
37876 	           xmlMemBlocks() - mem_base);
37877 	    test_ret++;
37878             printf(" %d", n_code);
37879             printf("\n");
37880         }
37881     }
37882     function_tests++;
37883 #endif
37884 
37885     return(test_ret);
37886 }
37887 
37888 
37889 static int
test_xmlUCSIsCJKUnifiedIdeographs(void)37890 test_xmlUCSIsCJKUnifiedIdeographs(void) {
37891     int test_ret = 0;
37892 
37893 #if defined(LIBXML_UNICODE_ENABLED)
37894     int mem_base;
37895     int ret_val;
37896     int code; /* UCS code point */
37897     int n_code;
37898 
37899     for (n_code = 0;n_code < gen_nb_int;n_code++) {
37900         mem_base = xmlMemBlocks();
37901         code = gen_int(n_code, 0);
37902 
37903         ret_val = xmlUCSIsCJKUnifiedIdeographs(code);
37904         desret_int(ret_val);
37905         call_tests++;
37906         des_int(n_code, code, 0);
37907         xmlResetLastError();
37908         if (mem_base != xmlMemBlocks()) {
37909             printf("Leak of %d blocks found in xmlUCSIsCJKUnifiedIdeographs",
37910 	           xmlMemBlocks() - mem_base);
37911 	    test_ret++;
37912             printf(" %d", n_code);
37913             printf("\n");
37914         }
37915     }
37916     function_tests++;
37917 #endif
37918 
37919     return(test_ret);
37920 }
37921 
37922 
37923 static int
test_xmlUCSIsCJKUnifiedIdeographsExtensionA(void)37924 test_xmlUCSIsCJKUnifiedIdeographsExtensionA(void) {
37925     int test_ret = 0;
37926 
37927 #if defined(LIBXML_UNICODE_ENABLED)
37928     int mem_base;
37929     int ret_val;
37930     int code; /* UCS code point */
37931     int n_code;
37932 
37933     for (n_code = 0;n_code < gen_nb_int;n_code++) {
37934         mem_base = xmlMemBlocks();
37935         code = gen_int(n_code, 0);
37936 
37937         ret_val = xmlUCSIsCJKUnifiedIdeographsExtensionA(code);
37938         desret_int(ret_val);
37939         call_tests++;
37940         des_int(n_code, code, 0);
37941         xmlResetLastError();
37942         if (mem_base != xmlMemBlocks()) {
37943             printf("Leak of %d blocks found in xmlUCSIsCJKUnifiedIdeographsExtensionA",
37944 	           xmlMemBlocks() - mem_base);
37945 	    test_ret++;
37946             printf(" %d", n_code);
37947             printf("\n");
37948         }
37949     }
37950     function_tests++;
37951 #endif
37952 
37953     return(test_ret);
37954 }
37955 
37956 
37957 static int
test_xmlUCSIsCJKUnifiedIdeographsExtensionB(void)37958 test_xmlUCSIsCJKUnifiedIdeographsExtensionB(void) {
37959     int test_ret = 0;
37960 
37961 #if defined(LIBXML_UNICODE_ENABLED)
37962     int mem_base;
37963     int ret_val;
37964     int code; /* UCS code point */
37965     int n_code;
37966 
37967     for (n_code = 0;n_code < gen_nb_int;n_code++) {
37968         mem_base = xmlMemBlocks();
37969         code = gen_int(n_code, 0);
37970 
37971         ret_val = xmlUCSIsCJKUnifiedIdeographsExtensionB(code);
37972         desret_int(ret_val);
37973         call_tests++;
37974         des_int(n_code, code, 0);
37975         xmlResetLastError();
37976         if (mem_base != xmlMemBlocks()) {
37977             printf("Leak of %d blocks found in xmlUCSIsCJKUnifiedIdeographsExtensionB",
37978 	           xmlMemBlocks() - mem_base);
37979 	    test_ret++;
37980             printf(" %d", n_code);
37981             printf("\n");
37982         }
37983     }
37984     function_tests++;
37985 #endif
37986 
37987     return(test_ret);
37988 }
37989 
37990 
37991 static int
test_xmlUCSIsCat(void)37992 test_xmlUCSIsCat(void) {
37993     int test_ret = 0;
37994 
37995 #if defined(LIBXML_UNICODE_ENABLED)
37996     int mem_base;
37997     int ret_val;
37998     int code; /* UCS code point */
37999     int n_code;
38000     const char * cat; /* UCS Category name */
38001     int n_cat;
38002 
38003     for (n_code = 0;n_code < gen_nb_int;n_code++) {
38004     for (n_cat = 0;n_cat < gen_nb_const_char_ptr;n_cat++) {
38005         mem_base = xmlMemBlocks();
38006         code = gen_int(n_code, 0);
38007         cat = gen_const_char_ptr(n_cat, 1);
38008 
38009         ret_val = xmlUCSIsCat(code, cat);
38010         desret_int(ret_val);
38011         call_tests++;
38012         des_int(n_code, code, 0);
38013         des_const_char_ptr(n_cat, cat, 1);
38014         xmlResetLastError();
38015         if (mem_base != xmlMemBlocks()) {
38016             printf("Leak of %d blocks found in xmlUCSIsCat",
38017 	           xmlMemBlocks() - mem_base);
38018 	    test_ret++;
38019             printf(" %d", n_code);
38020             printf(" %d", n_cat);
38021             printf("\n");
38022         }
38023     }
38024     }
38025     function_tests++;
38026 #endif
38027 
38028     return(test_ret);
38029 }
38030 
38031 
38032 static int
test_xmlUCSIsCatC(void)38033 test_xmlUCSIsCatC(void) {
38034     int test_ret = 0;
38035 
38036 #if defined(LIBXML_UNICODE_ENABLED)
38037     int mem_base;
38038     int ret_val;
38039     int code; /* UCS code point */
38040     int n_code;
38041 
38042     for (n_code = 0;n_code < gen_nb_int;n_code++) {
38043         mem_base = xmlMemBlocks();
38044         code = gen_int(n_code, 0);
38045 
38046         ret_val = xmlUCSIsCatC(code);
38047         desret_int(ret_val);
38048         call_tests++;
38049         des_int(n_code, code, 0);
38050         xmlResetLastError();
38051         if (mem_base != xmlMemBlocks()) {
38052             printf("Leak of %d blocks found in xmlUCSIsCatC",
38053 	           xmlMemBlocks() - mem_base);
38054 	    test_ret++;
38055             printf(" %d", n_code);
38056             printf("\n");
38057         }
38058     }
38059     function_tests++;
38060 #endif
38061 
38062     return(test_ret);
38063 }
38064 
38065 
38066 static int
test_xmlUCSIsCatCc(void)38067 test_xmlUCSIsCatCc(void) {
38068     int test_ret = 0;
38069 
38070 #if defined(LIBXML_UNICODE_ENABLED)
38071     int mem_base;
38072     int ret_val;
38073     int code; /* UCS code point */
38074     int n_code;
38075 
38076     for (n_code = 0;n_code < gen_nb_int;n_code++) {
38077         mem_base = xmlMemBlocks();
38078         code = gen_int(n_code, 0);
38079 
38080         ret_val = xmlUCSIsCatCc(code);
38081         desret_int(ret_val);
38082         call_tests++;
38083         des_int(n_code, code, 0);
38084         xmlResetLastError();
38085         if (mem_base != xmlMemBlocks()) {
38086             printf("Leak of %d blocks found in xmlUCSIsCatCc",
38087 	           xmlMemBlocks() - mem_base);
38088 	    test_ret++;
38089             printf(" %d", n_code);
38090             printf("\n");
38091         }
38092     }
38093     function_tests++;
38094 #endif
38095 
38096     return(test_ret);
38097 }
38098 
38099 
38100 static int
test_xmlUCSIsCatCf(void)38101 test_xmlUCSIsCatCf(void) {
38102     int test_ret = 0;
38103 
38104 #if defined(LIBXML_UNICODE_ENABLED)
38105     int mem_base;
38106     int ret_val;
38107     int code; /* UCS code point */
38108     int n_code;
38109 
38110     for (n_code = 0;n_code < gen_nb_int;n_code++) {
38111         mem_base = xmlMemBlocks();
38112         code = gen_int(n_code, 0);
38113 
38114         ret_val = xmlUCSIsCatCf(code);
38115         desret_int(ret_val);
38116         call_tests++;
38117         des_int(n_code, code, 0);
38118         xmlResetLastError();
38119         if (mem_base != xmlMemBlocks()) {
38120             printf("Leak of %d blocks found in xmlUCSIsCatCf",
38121 	           xmlMemBlocks() - mem_base);
38122 	    test_ret++;
38123             printf(" %d", n_code);
38124             printf("\n");
38125         }
38126     }
38127     function_tests++;
38128 #endif
38129 
38130     return(test_ret);
38131 }
38132 
38133 
38134 static int
test_xmlUCSIsCatCo(void)38135 test_xmlUCSIsCatCo(void) {
38136     int test_ret = 0;
38137 
38138 #if defined(LIBXML_UNICODE_ENABLED)
38139     int mem_base;
38140     int ret_val;
38141     int code; /* UCS code point */
38142     int n_code;
38143 
38144     for (n_code = 0;n_code < gen_nb_int;n_code++) {
38145         mem_base = xmlMemBlocks();
38146         code = gen_int(n_code, 0);
38147 
38148         ret_val = xmlUCSIsCatCo(code);
38149         desret_int(ret_val);
38150         call_tests++;
38151         des_int(n_code, code, 0);
38152         xmlResetLastError();
38153         if (mem_base != xmlMemBlocks()) {
38154             printf("Leak of %d blocks found in xmlUCSIsCatCo",
38155 	           xmlMemBlocks() - mem_base);
38156 	    test_ret++;
38157             printf(" %d", n_code);
38158             printf("\n");
38159         }
38160     }
38161     function_tests++;
38162 #endif
38163 
38164     return(test_ret);
38165 }
38166 
38167 
38168 static int
test_xmlUCSIsCatCs(void)38169 test_xmlUCSIsCatCs(void) {
38170     int test_ret = 0;
38171 
38172 #if defined(LIBXML_UNICODE_ENABLED)
38173     int mem_base;
38174     int ret_val;
38175     int code; /* UCS code point */
38176     int n_code;
38177 
38178     for (n_code = 0;n_code < gen_nb_int;n_code++) {
38179         mem_base = xmlMemBlocks();
38180         code = gen_int(n_code, 0);
38181 
38182         ret_val = xmlUCSIsCatCs(code);
38183         desret_int(ret_val);
38184         call_tests++;
38185         des_int(n_code, code, 0);
38186         xmlResetLastError();
38187         if (mem_base != xmlMemBlocks()) {
38188             printf("Leak of %d blocks found in xmlUCSIsCatCs",
38189 	           xmlMemBlocks() - mem_base);
38190 	    test_ret++;
38191             printf(" %d", n_code);
38192             printf("\n");
38193         }
38194     }
38195     function_tests++;
38196 #endif
38197 
38198     return(test_ret);
38199 }
38200 
38201 
38202 static int
test_xmlUCSIsCatL(void)38203 test_xmlUCSIsCatL(void) {
38204     int test_ret = 0;
38205 
38206 #if defined(LIBXML_UNICODE_ENABLED)
38207     int mem_base;
38208     int ret_val;
38209     int code; /* UCS code point */
38210     int n_code;
38211 
38212     for (n_code = 0;n_code < gen_nb_int;n_code++) {
38213         mem_base = xmlMemBlocks();
38214         code = gen_int(n_code, 0);
38215 
38216         ret_val = xmlUCSIsCatL(code);
38217         desret_int(ret_val);
38218         call_tests++;
38219         des_int(n_code, code, 0);
38220         xmlResetLastError();
38221         if (mem_base != xmlMemBlocks()) {
38222             printf("Leak of %d blocks found in xmlUCSIsCatL",
38223 	           xmlMemBlocks() - mem_base);
38224 	    test_ret++;
38225             printf(" %d", n_code);
38226             printf("\n");
38227         }
38228     }
38229     function_tests++;
38230 #endif
38231 
38232     return(test_ret);
38233 }
38234 
38235 
38236 static int
test_xmlUCSIsCatLl(void)38237 test_xmlUCSIsCatLl(void) {
38238     int test_ret = 0;
38239 
38240 #if defined(LIBXML_UNICODE_ENABLED)
38241     int mem_base;
38242     int ret_val;
38243     int code; /* UCS code point */
38244     int n_code;
38245 
38246     for (n_code = 0;n_code < gen_nb_int;n_code++) {
38247         mem_base = xmlMemBlocks();
38248         code = gen_int(n_code, 0);
38249 
38250         ret_val = xmlUCSIsCatLl(code);
38251         desret_int(ret_val);
38252         call_tests++;
38253         des_int(n_code, code, 0);
38254         xmlResetLastError();
38255         if (mem_base != xmlMemBlocks()) {
38256             printf("Leak of %d blocks found in xmlUCSIsCatLl",
38257 	           xmlMemBlocks() - mem_base);
38258 	    test_ret++;
38259             printf(" %d", n_code);
38260             printf("\n");
38261         }
38262     }
38263     function_tests++;
38264 #endif
38265 
38266     return(test_ret);
38267 }
38268 
38269 
38270 static int
test_xmlUCSIsCatLm(void)38271 test_xmlUCSIsCatLm(void) {
38272     int test_ret = 0;
38273 
38274 #if defined(LIBXML_UNICODE_ENABLED)
38275     int mem_base;
38276     int ret_val;
38277     int code; /* UCS code point */
38278     int n_code;
38279 
38280     for (n_code = 0;n_code < gen_nb_int;n_code++) {
38281         mem_base = xmlMemBlocks();
38282         code = gen_int(n_code, 0);
38283 
38284         ret_val = xmlUCSIsCatLm(code);
38285         desret_int(ret_val);
38286         call_tests++;
38287         des_int(n_code, code, 0);
38288         xmlResetLastError();
38289         if (mem_base != xmlMemBlocks()) {
38290             printf("Leak of %d blocks found in xmlUCSIsCatLm",
38291 	           xmlMemBlocks() - mem_base);
38292 	    test_ret++;
38293             printf(" %d", n_code);
38294             printf("\n");
38295         }
38296     }
38297     function_tests++;
38298 #endif
38299 
38300     return(test_ret);
38301 }
38302 
38303 
38304 static int
test_xmlUCSIsCatLo(void)38305 test_xmlUCSIsCatLo(void) {
38306     int test_ret = 0;
38307 
38308 #if defined(LIBXML_UNICODE_ENABLED)
38309     int mem_base;
38310     int ret_val;
38311     int code; /* UCS code point */
38312     int n_code;
38313 
38314     for (n_code = 0;n_code < gen_nb_int;n_code++) {
38315         mem_base = xmlMemBlocks();
38316         code = gen_int(n_code, 0);
38317 
38318         ret_val = xmlUCSIsCatLo(code);
38319         desret_int(ret_val);
38320         call_tests++;
38321         des_int(n_code, code, 0);
38322         xmlResetLastError();
38323         if (mem_base != xmlMemBlocks()) {
38324             printf("Leak of %d blocks found in xmlUCSIsCatLo",
38325 	           xmlMemBlocks() - mem_base);
38326 	    test_ret++;
38327             printf(" %d", n_code);
38328             printf("\n");
38329         }
38330     }
38331     function_tests++;
38332 #endif
38333 
38334     return(test_ret);
38335 }
38336 
38337 
38338 static int
test_xmlUCSIsCatLt(void)38339 test_xmlUCSIsCatLt(void) {
38340     int test_ret = 0;
38341 
38342 #if defined(LIBXML_UNICODE_ENABLED)
38343     int mem_base;
38344     int ret_val;
38345     int code; /* UCS code point */
38346     int n_code;
38347 
38348     for (n_code = 0;n_code < gen_nb_int;n_code++) {
38349         mem_base = xmlMemBlocks();
38350         code = gen_int(n_code, 0);
38351 
38352         ret_val = xmlUCSIsCatLt(code);
38353         desret_int(ret_val);
38354         call_tests++;
38355         des_int(n_code, code, 0);
38356         xmlResetLastError();
38357         if (mem_base != xmlMemBlocks()) {
38358             printf("Leak of %d blocks found in xmlUCSIsCatLt",
38359 	           xmlMemBlocks() - mem_base);
38360 	    test_ret++;
38361             printf(" %d", n_code);
38362             printf("\n");
38363         }
38364     }
38365     function_tests++;
38366 #endif
38367 
38368     return(test_ret);
38369 }
38370 
38371 
38372 static int
test_xmlUCSIsCatLu(void)38373 test_xmlUCSIsCatLu(void) {
38374     int test_ret = 0;
38375 
38376 #if defined(LIBXML_UNICODE_ENABLED)
38377     int mem_base;
38378     int ret_val;
38379     int code; /* UCS code point */
38380     int n_code;
38381 
38382     for (n_code = 0;n_code < gen_nb_int;n_code++) {
38383         mem_base = xmlMemBlocks();
38384         code = gen_int(n_code, 0);
38385 
38386         ret_val = xmlUCSIsCatLu(code);
38387         desret_int(ret_val);
38388         call_tests++;
38389         des_int(n_code, code, 0);
38390         xmlResetLastError();
38391         if (mem_base != xmlMemBlocks()) {
38392             printf("Leak of %d blocks found in xmlUCSIsCatLu",
38393 	           xmlMemBlocks() - mem_base);
38394 	    test_ret++;
38395             printf(" %d", n_code);
38396             printf("\n");
38397         }
38398     }
38399     function_tests++;
38400 #endif
38401 
38402     return(test_ret);
38403 }
38404 
38405 
38406 static int
test_xmlUCSIsCatM(void)38407 test_xmlUCSIsCatM(void) {
38408     int test_ret = 0;
38409 
38410 #if defined(LIBXML_UNICODE_ENABLED)
38411     int mem_base;
38412     int ret_val;
38413     int code; /* UCS code point */
38414     int n_code;
38415 
38416     for (n_code = 0;n_code < gen_nb_int;n_code++) {
38417         mem_base = xmlMemBlocks();
38418         code = gen_int(n_code, 0);
38419 
38420         ret_val = xmlUCSIsCatM(code);
38421         desret_int(ret_val);
38422         call_tests++;
38423         des_int(n_code, code, 0);
38424         xmlResetLastError();
38425         if (mem_base != xmlMemBlocks()) {
38426             printf("Leak of %d blocks found in xmlUCSIsCatM",
38427 	           xmlMemBlocks() - mem_base);
38428 	    test_ret++;
38429             printf(" %d", n_code);
38430             printf("\n");
38431         }
38432     }
38433     function_tests++;
38434 #endif
38435 
38436     return(test_ret);
38437 }
38438 
38439 
38440 static int
test_xmlUCSIsCatMc(void)38441 test_xmlUCSIsCatMc(void) {
38442     int test_ret = 0;
38443 
38444 #if defined(LIBXML_UNICODE_ENABLED)
38445     int mem_base;
38446     int ret_val;
38447     int code; /* UCS code point */
38448     int n_code;
38449 
38450     for (n_code = 0;n_code < gen_nb_int;n_code++) {
38451         mem_base = xmlMemBlocks();
38452         code = gen_int(n_code, 0);
38453 
38454         ret_val = xmlUCSIsCatMc(code);
38455         desret_int(ret_val);
38456         call_tests++;
38457         des_int(n_code, code, 0);
38458         xmlResetLastError();
38459         if (mem_base != xmlMemBlocks()) {
38460             printf("Leak of %d blocks found in xmlUCSIsCatMc",
38461 	           xmlMemBlocks() - mem_base);
38462 	    test_ret++;
38463             printf(" %d", n_code);
38464             printf("\n");
38465         }
38466     }
38467     function_tests++;
38468 #endif
38469 
38470     return(test_ret);
38471 }
38472 
38473 
38474 static int
test_xmlUCSIsCatMe(void)38475 test_xmlUCSIsCatMe(void) {
38476     int test_ret = 0;
38477 
38478 #if defined(LIBXML_UNICODE_ENABLED)
38479     int mem_base;
38480     int ret_val;
38481     int code; /* UCS code point */
38482     int n_code;
38483 
38484     for (n_code = 0;n_code < gen_nb_int;n_code++) {
38485         mem_base = xmlMemBlocks();
38486         code = gen_int(n_code, 0);
38487 
38488         ret_val = xmlUCSIsCatMe(code);
38489         desret_int(ret_val);
38490         call_tests++;
38491         des_int(n_code, code, 0);
38492         xmlResetLastError();
38493         if (mem_base != xmlMemBlocks()) {
38494             printf("Leak of %d blocks found in xmlUCSIsCatMe",
38495 	           xmlMemBlocks() - mem_base);
38496 	    test_ret++;
38497             printf(" %d", n_code);
38498             printf("\n");
38499         }
38500     }
38501     function_tests++;
38502 #endif
38503 
38504     return(test_ret);
38505 }
38506 
38507 
38508 static int
test_xmlUCSIsCatMn(void)38509 test_xmlUCSIsCatMn(void) {
38510     int test_ret = 0;
38511 
38512 #if defined(LIBXML_UNICODE_ENABLED)
38513     int mem_base;
38514     int ret_val;
38515     int code; /* UCS code point */
38516     int n_code;
38517 
38518     for (n_code = 0;n_code < gen_nb_int;n_code++) {
38519         mem_base = xmlMemBlocks();
38520         code = gen_int(n_code, 0);
38521 
38522         ret_val = xmlUCSIsCatMn(code);
38523         desret_int(ret_val);
38524         call_tests++;
38525         des_int(n_code, code, 0);
38526         xmlResetLastError();
38527         if (mem_base != xmlMemBlocks()) {
38528             printf("Leak of %d blocks found in xmlUCSIsCatMn",
38529 	           xmlMemBlocks() - mem_base);
38530 	    test_ret++;
38531             printf(" %d", n_code);
38532             printf("\n");
38533         }
38534     }
38535     function_tests++;
38536 #endif
38537 
38538     return(test_ret);
38539 }
38540 
38541 
38542 static int
test_xmlUCSIsCatN(void)38543 test_xmlUCSIsCatN(void) {
38544     int test_ret = 0;
38545 
38546 #if defined(LIBXML_UNICODE_ENABLED)
38547     int mem_base;
38548     int ret_val;
38549     int code; /* UCS code point */
38550     int n_code;
38551 
38552     for (n_code = 0;n_code < gen_nb_int;n_code++) {
38553         mem_base = xmlMemBlocks();
38554         code = gen_int(n_code, 0);
38555 
38556         ret_val = xmlUCSIsCatN(code);
38557         desret_int(ret_val);
38558         call_tests++;
38559         des_int(n_code, code, 0);
38560         xmlResetLastError();
38561         if (mem_base != xmlMemBlocks()) {
38562             printf("Leak of %d blocks found in xmlUCSIsCatN",
38563 	           xmlMemBlocks() - mem_base);
38564 	    test_ret++;
38565             printf(" %d", n_code);
38566             printf("\n");
38567         }
38568     }
38569     function_tests++;
38570 #endif
38571 
38572     return(test_ret);
38573 }
38574 
38575 
38576 static int
test_xmlUCSIsCatNd(void)38577 test_xmlUCSIsCatNd(void) {
38578     int test_ret = 0;
38579 
38580 #if defined(LIBXML_UNICODE_ENABLED)
38581     int mem_base;
38582     int ret_val;
38583     int code; /* UCS code point */
38584     int n_code;
38585 
38586     for (n_code = 0;n_code < gen_nb_int;n_code++) {
38587         mem_base = xmlMemBlocks();
38588         code = gen_int(n_code, 0);
38589 
38590         ret_val = xmlUCSIsCatNd(code);
38591         desret_int(ret_val);
38592         call_tests++;
38593         des_int(n_code, code, 0);
38594         xmlResetLastError();
38595         if (mem_base != xmlMemBlocks()) {
38596             printf("Leak of %d blocks found in xmlUCSIsCatNd",
38597 	           xmlMemBlocks() - mem_base);
38598 	    test_ret++;
38599             printf(" %d", n_code);
38600             printf("\n");
38601         }
38602     }
38603     function_tests++;
38604 #endif
38605 
38606     return(test_ret);
38607 }
38608 
38609 
38610 static int
test_xmlUCSIsCatNl(void)38611 test_xmlUCSIsCatNl(void) {
38612     int test_ret = 0;
38613 
38614 #if defined(LIBXML_UNICODE_ENABLED)
38615     int mem_base;
38616     int ret_val;
38617     int code; /* UCS code point */
38618     int n_code;
38619 
38620     for (n_code = 0;n_code < gen_nb_int;n_code++) {
38621         mem_base = xmlMemBlocks();
38622         code = gen_int(n_code, 0);
38623 
38624         ret_val = xmlUCSIsCatNl(code);
38625         desret_int(ret_val);
38626         call_tests++;
38627         des_int(n_code, code, 0);
38628         xmlResetLastError();
38629         if (mem_base != xmlMemBlocks()) {
38630             printf("Leak of %d blocks found in xmlUCSIsCatNl",
38631 	           xmlMemBlocks() - mem_base);
38632 	    test_ret++;
38633             printf(" %d", n_code);
38634             printf("\n");
38635         }
38636     }
38637     function_tests++;
38638 #endif
38639 
38640     return(test_ret);
38641 }
38642 
38643 
38644 static int
test_xmlUCSIsCatNo(void)38645 test_xmlUCSIsCatNo(void) {
38646     int test_ret = 0;
38647 
38648 #if defined(LIBXML_UNICODE_ENABLED)
38649     int mem_base;
38650     int ret_val;
38651     int code; /* UCS code point */
38652     int n_code;
38653 
38654     for (n_code = 0;n_code < gen_nb_int;n_code++) {
38655         mem_base = xmlMemBlocks();
38656         code = gen_int(n_code, 0);
38657 
38658         ret_val = xmlUCSIsCatNo(code);
38659         desret_int(ret_val);
38660         call_tests++;
38661         des_int(n_code, code, 0);
38662         xmlResetLastError();
38663         if (mem_base != xmlMemBlocks()) {
38664             printf("Leak of %d blocks found in xmlUCSIsCatNo",
38665 	           xmlMemBlocks() - mem_base);
38666 	    test_ret++;
38667             printf(" %d", n_code);
38668             printf("\n");
38669         }
38670     }
38671     function_tests++;
38672 #endif
38673 
38674     return(test_ret);
38675 }
38676 
38677 
38678 static int
test_xmlUCSIsCatP(void)38679 test_xmlUCSIsCatP(void) {
38680     int test_ret = 0;
38681 
38682 #if defined(LIBXML_UNICODE_ENABLED)
38683     int mem_base;
38684     int ret_val;
38685     int code; /* UCS code point */
38686     int n_code;
38687 
38688     for (n_code = 0;n_code < gen_nb_int;n_code++) {
38689         mem_base = xmlMemBlocks();
38690         code = gen_int(n_code, 0);
38691 
38692         ret_val = xmlUCSIsCatP(code);
38693         desret_int(ret_val);
38694         call_tests++;
38695         des_int(n_code, code, 0);
38696         xmlResetLastError();
38697         if (mem_base != xmlMemBlocks()) {
38698             printf("Leak of %d blocks found in xmlUCSIsCatP",
38699 	           xmlMemBlocks() - mem_base);
38700 	    test_ret++;
38701             printf(" %d", n_code);
38702             printf("\n");
38703         }
38704     }
38705     function_tests++;
38706 #endif
38707 
38708     return(test_ret);
38709 }
38710 
38711 
38712 static int
test_xmlUCSIsCatPc(void)38713 test_xmlUCSIsCatPc(void) {
38714     int test_ret = 0;
38715 
38716 #if defined(LIBXML_UNICODE_ENABLED)
38717     int mem_base;
38718     int ret_val;
38719     int code; /* UCS code point */
38720     int n_code;
38721 
38722     for (n_code = 0;n_code < gen_nb_int;n_code++) {
38723         mem_base = xmlMemBlocks();
38724         code = gen_int(n_code, 0);
38725 
38726         ret_val = xmlUCSIsCatPc(code);
38727         desret_int(ret_val);
38728         call_tests++;
38729         des_int(n_code, code, 0);
38730         xmlResetLastError();
38731         if (mem_base != xmlMemBlocks()) {
38732             printf("Leak of %d blocks found in xmlUCSIsCatPc",
38733 	           xmlMemBlocks() - mem_base);
38734 	    test_ret++;
38735             printf(" %d", n_code);
38736             printf("\n");
38737         }
38738     }
38739     function_tests++;
38740 #endif
38741 
38742     return(test_ret);
38743 }
38744 
38745 
38746 static int
test_xmlUCSIsCatPd(void)38747 test_xmlUCSIsCatPd(void) {
38748     int test_ret = 0;
38749 
38750 #if defined(LIBXML_UNICODE_ENABLED)
38751     int mem_base;
38752     int ret_val;
38753     int code; /* UCS code point */
38754     int n_code;
38755 
38756     for (n_code = 0;n_code < gen_nb_int;n_code++) {
38757         mem_base = xmlMemBlocks();
38758         code = gen_int(n_code, 0);
38759 
38760         ret_val = xmlUCSIsCatPd(code);
38761         desret_int(ret_val);
38762         call_tests++;
38763         des_int(n_code, code, 0);
38764         xmlResetLastError();
38765         if (mem_base != xmlMemBlocks()) {
38766             printf("Leak of %d blocks found in xmlUCSIsCatPd",
38767 	           xmlMemBlocks() - mem_base);
38768 	    test_ret++;
38769             printf(" %d", n_code);
38770             printf("\n");
38771         }
38772     }
38773     function_tests++;
38774 #endif
38775 
38776     return(test_ret);
38777 }
38778 
38779 
38780 static int
test_xmlUCSIsCatPe(void)38781 test_xmlUCSIsCatPe(void) {
38782     int test_ret = 0;
38783 
38784 #if defined(LIBXML_UNICODE_ENABLED)
38785     int mem_base;
38786     int ret_val;
38787     int code; /* UCS code point */
38788     int n_code;
38789 
38790     for (n_code = 0;n_code < gen_nb_int;n_code++) {
38791         mem_base = xmlMemBlocks();
38792         code = gen_int(n_code, 0);
38793 
38794         ret_val = xmlUCSIsCatPe(code);
38795         desret_int(ret_val);
38796         call_tests++;
38797         des_int(n_code, code, 0);
38798         xmlResetLastError();
38799         if (mem_base != xmlMemBlocks()) {
38800             printf("Leak of %d blocks found in xmlUCSIsCatPe",
38801 	           xmlMemBlocks() - mem_base);
38802 	    test_ret++;
38803             printf(" %d", n_code);
38804             printf("\n");
38805         }
38806     }
38807     function_tests++;
38808 #endif
38809 
38810     return(test_ret);
38811 }
38812 
38813 
38814 static int
test_xmlUCSIsCatPf(void)38815 test_xmlUCSIsCatPf(void) {
38816     int test_ret = 0;
38817 
38818 #if defined(LIBXML_UNICODE_ENABLED)
38819     int mem_base;
38820     int ret_val;
38821     int code; /* UCS code point */
38822     int n_code;
38823 
38824     for (n_code = 0;n_code < gen_nb_int;n_code++) {
38825         mem_base = xmlMemBlocks();
38826         code = gen_int(n_code, 0);
38827 
38828         ret_val = xmlUCSIsCatPf(code);
38829         desret_int(ret_val);
38830         call_tests++;
38831         des_int(n_code, code, 0);
38832         xmlResetLastError();
38833         if (mem_base != xmlMemBlocks()) {
38834             printf("Leak of %d blocks found in xmlUCSIsCatPf",
38835 	           xmlMemBlocks() - mem_base);
38836 	    test_ret++;
38837             printf(" %d", n_code);
38838             printf("\n");
38839         }
38840     }
38841     function_tests++;
38842 #endif
38843 
38844     return(test_ret);
38845 }
38846 
38847 
38848 static int
test_xmlUCSIsCatPi(void)38849 test_xmlUCSIsCatPi(void) {
38850     int test_ret = 0;
38851 
38852 #if defined(LIBXML_UNICODE_ENABLED)
38853     int mem_base;
38854     int ret_val;
38855     int code; /* UCS code point */
38856     int n_code;
38857 
38858     for (n_code = 0;n_code < gen_nb_int;n_code++) {
38859         mem_base = xmlMemBlocks();
38860         code = gen_int(n_code, 0);
38861 
38862         ret_val = xmlUCSIsCatPi(code);
38863         desret_int(ret_val);
38864         call_tests++;
38865         des_int(n_code, code, 0);
38866         xmlResetLastError();
38867         if (mem_base != xmlMemBlocks()) {
38868             printf("Leak of %d blocks found in xmlUCSIsCatPi",
38869 	           xmlMemBlocks() - mem_base);
38870 	    test_ret++;
38871             printf(" %d", n_code);
38872             printf("\n");
38873         }
38874     }
38875     function_tests++;
38876 #endif
38877 
38878     return(test_ret);
38879 }
38880 
38881 
38882 static int
test_xmlUCSIsCatPo(void)38883 test_xmlUCSIsCatPo(void) {
38884     int test_ret = 0;
38885 
38886 #if defined(LIBXML_UNICODE_ENABLED)
38887     int mem_base;
38888     int ret_val;
38889     int code; /* UCS code point */
38890     int n_code;
38891 
38892     for (n_code = 0;n_code < gen_nb_int;n_code++) {
38893         mem_base = xmlMemBlocks();
38894         code = gen_int(n_code, 0);
38895 
38896         ret_val = xmlUCSIsCatPo(code);
38897         desret_int(ret_val);
38898         call_tests++;
38899         des_int(n_code, code, 0);
38900         xmlResetLastError();
38901         if (mem_base != xmlMemBlocks()) {
38902             printf("Leak of %d blocks found in xmlUCSIsCatPo",
38903 	           xmlMemBlocks() - mem_base);
38904 	    test_ret++;
38905             printf(" %d", n_code);
38906             printf("\n");
38907         }
38908     }
38909     function_tests++;
38910 #endif
38911 
38912     return(test_ret);
38913 }
38914 
38915 
38916 static int
test_xmlUCSIsCatPs(void)38917 test_xmlUCSIsCatPs(void) {
38918     int test_ret = 0;
38919 
38920 #if defined(LIBXML_UNICODE_ENABLED)
38921     int mem_base;
38922     int ret_val;
38923     int code; /* UCS code point */
38924     int n_code;
38925 
38926     for (n_code = 0;n_code < gen_nb_int;n_code++) {
38927         mem_base = xmlMemBlocks();
38928         code = gen_int(n_code, 0);
38929 
38930         ret_val = xmlUCSIsCatPs(code);
38931         desret_int(ret_val);
38932         call_tests++;
38933         des_int(n_code, code, 0);
38934         xmlResetLastError();
38935         if (mem_base != xmlMemBlocks()) {
38936             printf("Leak of %d blocks found in xmlUCSIsCatPs",
38937 	           xmlMemBlocks() - mem_base);
38938 	    test_ret++;
38939             printf(" %d", n_code);
38940             printf("\n");
38941         }
38942     }
38943     function_tests++;
38944 #endif
38945 
38946     return(test_ret);
38947 }
38948 
38949 
38950 static int
test_xmlUCSIsCatS(void)38951 test_xmlUCSIsCatS(void) {
38952     int test_ret = 0;
38953 
38954 #if defined(LIBXML_UNICODE_ENABLED)
38955     int mem_base;
38956     int ret_val;
38957     int code; /* UCS code point */
38958     int n_code;
38959 
38960     for (n_code = 0;n_code < gen_nb_int;n_code++) {
38961         mem_base = xmlMemBlocks();
38962         code = gen_int(n_code, 0);
38963 
38964         ret_val = xmlUCSIsCatS(code);
38965         desret_int(ret_val);
38966         call_tests++;
38967         des_int(n_code, code, 0);
38968         xmlResetLastError();
38969         if (mem_base != xmlMemBlocks()) {
38970             printf("Leak of %d blocks found in xmlUCSIsCatS",
38971 	           xmlMemBlocks() - mem_base);
38972 	    test_ret++;
38973             printf(" %d", n_code);
38974             printf("\n");
38975         }
38976     }
38977     function_tests++;
38978 #endif
38979 
38980     return(test_ret);
38981 }
38982 
38983 
38984 static int
test_xmlUCSIsCatSc(void)38985 test_xmlUCSIsCatSc(void) {
38986     int test_ret = 0;
38987 
38988 #if defined(LIBXML_UNICODE_ENABLED)
38989     int mem_base;
38990     int ret_val;
38991     int code; /* UCS code point */
38992     int n_code;
38993 
38994     for (n_code = 0;n_code < gen_nb_int;n_code++) {
38995         mem_base = xmlMemBlocks();
38996         code = gen_int(n_code, 0);
38997 
38998         ret_val = xmlUCSIsCatSc(code);
38999         desret_int(ret_val);
39000         call_tests++;
39001         des_int(n_code, code, 0);
39002         xmlResetLastError();
39003         if (mem_base != xmlMemBlocks()) {
39004             printf("Leak of %d blocks found in xmlUCSIsCatSc",
39005 	           xmlMemBlocks() - mem_base);
39006 	    test_ret++;
39007             printf(" %d", n_code);
39008             printf("\n");
39009         }
39010     }
39011     function_tests++;
39012 #endif
39013 
39014     return(test_ret);
39015 }
39016 
39017 
39018 static int
test_xmlUCSIsCatSk(void)39019 test_xmlUCSIsCatSk(void) {
39020     int test_ret = 0;
39021 
39022 #if defined(LIBXML_UNICODE_ENABLED)
39023     int mem_base;
39024     int ret_val;
39025     int code; /* UCS code point */
39026     int n_code;
39027 
39028     for (n_code = 0;n_code < gen_nb_int;n_code++) {
39029         mem_base = xmlMemBlocks();
39030         code = gen_int(n_code, 0);
39031 
39032         ret_val = xmlUCSIsCatSk(code);
39033         desret_int(ret_val);
39034         call_tests++;
39035         des_int(n_code, code, 0);
39036         xmlResetLastError();
39037         if (mem_base != xmlMemBlocks()) {
39038             printf("Leak of %d blocks found in xmlUCSIsCatSk",
39039 	           xmlMemBlocks() - mem_base);
39040 	    test_ret++;
39041             printf(" %d", n_code);
39042             printf("\n");
39043         }
39044     }
39045     function_tests++;
39046 #endif
39047 
39048     return(test_ret);
39049 }
39050 
39051 
39052 static int
test_xmlUCSIsCatSm(void)39053 test_xmlUCSIsCatSm(void) {
39054     int test_ret = 0;
39055 
39056 #if defined(LIBXML_UNICODE_ENABLED)
39057     int mem_base;
39058     int ret_val;
39059     int code; /* UCS code point */
39060     int n_code;
39061 
39062     for (n_code = 0;n_code < gen_nb_int;n_code++) {
39063         mem_base = xmlMemBlocks();
39064         code = gen_int(n_code, 0);
39065 
39066         ret_val = xmlUCSIsCatSm(code);
39067         desret_int(ret_val);
39068         call_tests++;
39069         des_int(n_code, code, 0);
39070         xmlResetLastError();
39071         if (mem_base != xmlMemBlocks()) {
39072             printf("Leak of %d blocks found in xmlUCSIsCatSm",
39073 	           xmlMemBlocks() - mem_base);
39074 	    test_ret++;
39075             printf(" %d", n_code);
39076             printf("\n");
39077         }
39078     }
39079     function_tests++;
39080 #endif
39081 
39082     return(test_ret);
39083 }
39084 
39085 
39086 static int
test_xmlUCSIsCatSo(void)39087 test_xmlUCSIsCatSo(void) {
39088     int test_ret = 0;
39089 
39090 #if defined(LIBXML_UNICODE_ENABLED)
39091     int mem_base;
39092     int ret_val;
39093     int code; /* UCS code point */
39094     int n_code;
39095 
39096     for (n_code = 0;n_code < gen_nb_int;n_code++) {
39097         mem_base = xmlMemBlocks();
39098         code = gen_int(n_code, 0);
39099 
39100         ret_val = xmlUCSIsCatSo(code);
39101         desret_int(ret_val);
39102         call_tests++;
39103         des_int(n_code, code, 0);
39104         xmlResetLastError();
39105         if (mem_base != xmlMemBlocks()) {
39106             printf("Leak of %d blocks found in xmlUCSIsCatSo",
39107 	           xmlMemBlocks() - mem_base);
39108 	    test_ret++;
39109             printf(" %d", n_code);
39110             printf("\n");
39111         }
39112     }
39113     function_tests++;
39114 #endif
39115 
39116     return(test_ret);
39117 }
39118 
39119 
39120 static int
test_xmlUCSIsCatZ(void)39121 test_xmlUCSIsCatZ(void) {
39122     int test_ret = 0;
39123 
39124 #if defined(LIBXML_UNICODE_ENABLED)
39125     int mem_base;
39126     int ret_val;
39127     int code; /* UCS code point */
39128     int n_code;
39129 
39130     for (n_code = 0;n_code < gen_nb_int;n_code++) {
39131         mem_base = xmlMemBlocks();
39132         code = gen_int(n_code, 0);
39133 
39134         ret_val = xmlUCSIsCatZ(code);
39135         desret_int(ret_val);
39136         call_tests++;
39137         des_int(n_code, code, 0);
39138         xmlResetLastError();
39139         if (mem_base != xmlMemBlocks()) {
39140             printf("Leak of %d blocks found in xmlUCSIsCatZ",
39141 	           xmlMemBlocks() - mem_base);
39142 	    test_ret++;
39143             printf(" %d", n_code);
39144             printf("\n");
39145         }
39146     }
39147     function_tests++;
39148 #endif
39149 
39150     return(test_ret);
39151 }
39152 
39153 
39154 static int
test_xmlUCSIsCatZl(void)39155 test_xmlUCSIsCatZl(void) {
39156     int test_ret = 0;
39157 
39158 #if defined(LIBXML_UNICODE_ENABLED)
39159     int mem_base;
39160     int ret_val;
39161     int code; /* UCS code point */
39162     int n_code;
39163 
39164     for (n_code = 0;n_code < gen_nb_int;n_code++) {
39165         mem_base = xmlMemBlocks();
39166         code = gen_int(n_code, 0);
39167 
39168         ret_val = xmlUCSIsCatZl(code);
39169         desret_int(ret_val);
39170         call_tests++;
39171         des_int(n_code, code, 0);
39172         xmlResetLastError();
39173         if (mem_base != xmlMemBlocks()) {
39174             printf("Leak of %d blocks found in xmlUCSIsCatZl",
39175 	           xmlMemBlocks() - mem_base);
39176 	    test_ret++;
39177             printf(" %d", n_code);
39178             printf("\n");
39179         }
39180     }
39181     function_tests++;
39182 #endif
39183 
39184     return(test_ret);
39185 }
39186 
39187 
39188 static int
test_xmlUCSIsCatZp(void)39189 test_xmlUCSIsCatZp(void) {
39190     int test_ret = 0;
39191 
39192 #if defined(LIBXML_UNICODE_ENABLED)
39193     int mem_base;
39194     int ret_val;
39195     int code; /* UCS code point */
39196     int n_code;
39197 
39198     for (n_code = 0;n_code < gen_nb_int;n_code++) {
39199         mem_base = xmlMemBlocks();
39200         code = gen_int(n_code, 0);
39201 
39202         ret_val = xmlUCSIsCatZp(code);
39203         desret_int(ret_val);
39204         call_tests++;
39205         des_int(n_code, code, 0);
39206         xmlResetLastError();
39207         if (mem_base != xmlMemBlocks()) {
39208             printf("Leak of %d blocks found in xmlUCSIsCatZp",
39209 	           xmlMemBlocks() - mem_base);
39210 	    test_ret++;
39211             printf(" %d", n_code);
39212             printf("\n");
39213         }
39214     }
39215     function_tests++;
39216 #endif
39217 
39218     return(test_ret);
39219 }
39220 
39221 
39222 static int
test_xmlUCSIsCatZs(void)39223 test_xmlUCSIsCatZs(void) {
39224     int test_ret = 0;
39225 
39226 #if defined(LIBXML_UNICODE_ENABLED)
39227     int mem_base;
39228     int ret_val;
39229     int code; /* UCS code point */
39230     int n_code;
39231 
39232     for (n_code = 0;n_code < gen_nb_int;n_code++) {
39233         mem_base = xmlMemBlocks();
39234         code = gen_int(n_code, 0);
39235 
39236         ret_val = xmlUCSIsCatZs(code);
39237         desret_int(ret_val);
39238         call_tests++;
39239         des_int(n_code, code, 0);
39240         xmlResetLastError();
39241         if (mem_base != xmlMemBlocks()) {
39242             printf("Leak of %d blocks found in xmlUCSIsCatZs",
39243 	           xmlMemBlocks() - mem_base);
39244 	    test_ret++;
39245             printf(" %d", n_code);
39246             printf("\n");
39247         }
39248     }
39249     function_tests++;
39250 #endif
39251 
39252     return(test_ret);
39253 }
39254 
39255 
39256 static int
test_xmlUCSIsCherokee(void)39257 test_xmlUCSIsCherokee(void) {
39258     int test_ret = 0;
39259 
39260 #if defined(LIBXML_UNICODE_ENABLED)
39261     int mem_base;
39262     int ret_val;
39263     int code; /* UCS code point */
39264     int n_code;
39265 
39266     for (n_code = 0;n_code < gen_nb_int;n_code++) {
39267         mem_base = xmlMemBlocks();
39268         code = gen_int(n_code, 0);
39269 
39270         ret_val = xmlUCSIsCherokee(code);
39271         desret_int(ret_val);
39272         call_tests++;
39273         des_int(n_code, code, 0);
39274         xmlResetLastError();
39275         if (mem_base != xmlMemBlocks()) {
39276             printf("Leak of %d blocks found in xmlUCSIsCherokee",
39277 	           xmlMemBlocks() - mem_base);
39278 	    test_ret++;
39279             printf(" %d", n_code);
39280             printf("\n");
39281         }
39282     }
39283     function_tests++;
39284 #endif
39285 
39286     return(test_ret);
39287 }
39288 
39289 
39290 static int
test_xmlUCSIsCombiningDiacriticalMarks(void)39291 test_xmlUCSIsCombiningDiacriticalMarks(void) {
39292     int test_ret = 0;
39293 
39294 #if defined(LIBXML_UNICODE_ENABLED)
39295     int mem_base;
39296     int ret_val;
39297     int code; /* UCS code point */
39298     int n_code;
39299 
39300     for (n_code = 0;n_code < gen_nb_int;n_code++) {
39301         mem_base = xmlMemBlocks();
39302         code = gen_int(n_code, 0);
39303 
39304         ret_val = xmlUCSIsCombiningDiacriticalMarks(code);
39305         desret_int(ret_val);
39306         call_tests++;
39307         des_int(n_code, code, 0);
39308         xmlResetLastError();
39309         if (mem_base != xmlMemBlocks()) {
39310             printf("Leak of %d blocks found in xmlUCSIsCombiningDiacriticalMarks",
39311 	           xmlMemBlocks() - mem_base);
39312 	    test_ret++;
39313             printf(" %d", n_code);
39314             printf("\n");
39315         }
39316     }
39317     function_tests++;
39318 #endif
39319 
39320     return(test_ret);
39321 }
39322 
39323 
39324 static int
test_xmlUCSIsCombiningDiacriticalMarksforSymbols(void)39325 test_xmlUCSIsCombiningDiacriticalMarksforSymbols(void) {
39326     int test_ret = 0;
39327 
39328 #if defined(LIBXML_UNICODE_ENABLED)
39329     int mem_base;
39330     int ret_val;
39331     int code; /* UCS code point */
39332     int n_code;
39333 
39334     for (n_code = 0;n_code < gen_nb_int;n_code++) {
39335         mem_base = xmlMemBlocks();
39336         code = gen_int(n_code, 0);
39337 
39338         ret_val = xmlUCSIsCombiningDiacriticalMarksforSymbols(code);
39339         desret_int(ret_val);
39340         call_tests++;
39341         des_int(n_code, code, 0);
39342         xmlResetLastError();
39343         if (mem_base != xmlMemBlocks()) {
39344             printf("Leak of %d blocks found in xmlUCSIsCombiningDiacriticalMarksforSymbols",
39345 	           xmlMemBlocks() - mem_base);
39346 	    test_ret++;
39347             printf(" %d", n_code);
39348             printf("\n");
39349         }
39350     }
39351     function_tests++;
39352 #endif
39353 
39354     return(test_ret);
39355 }
39356 
39357 
39358 static int
test_xmlUCSIsCombiningHalfMarks(void)39359 test_xmlUCSIsCombiningHalfMarks(void) {
39360     int test_ret = 0;
39361 
39362 #if defined(LIBXML_UNICODE_ENABLED)
39363     int mem_base;
39364     int ret_val;
39365     int code; /* UCS code point */
39366     int n_code;
39367 
39368     for (n_code = 0;n_code < gen_nb_int;n_code++) {
39369         mem_base = xmlMemBlocks();
39370         code = gen_int(n_code, 0);
39371 
39372         ret_val = xmlUCSIsCombiningHalfMarks(code);
39373         desret_int(ret_val);
39374         call_tests++;
39375         des_int(n_code, code, 0);
39376         xmlResetLastError();
39377         if (mem_base != xmlMemBlocks()) {
39378             printf("Leak of %d blocks found in xmlUCSIsCombiningHalfMarks",
39379 	           xmlMemBlocks() - mem_base);
39380 	    test_ret++;
39381             printf(" %d", n_code);
39382             printf("\n");
39383         }
39384     }
39385     function_tests++;
39386 #endif
39387 
39388     return(test_ret);
39389 }
39390 
39391 
39392 static int
test_xmlUCSIsCombiningMarksforSymbols(void)39393 test_xmlUCSIsCombiningMarksforSymbols(void) {
39394     int test_ret = 0;
39395 
39396 #if defined(LIBXML_UNICODE_ENABLED)
39397     int mem_base;
39398     int ret_val;
39399     int code; /* UCS code point */
39400     int n_code;
39401 
39402     for (n_code = 0;n_code < gen_nb_int;n_code++) {
39403         mem_base = xmlMemBlocks();
39404         code = gen_int(n_code, 0);
39405 
39406         ret_val = xmlUCSIsCombiningMarksforSymbols(code);
39407         desret_int(ret_val);
39408         call_tests++;
39409         des_int(n_code, code, 0);
39410         xmlResetLastError();
39411         if (mem_base != xmlMemBlocks()) {
39412             printf("Leak of %d blocks found in xmlUCSIsCombiningMarksforSymbols",
39413 	           xmlMemBlocks() - mem_base);
39414 	    test_ret++;
39415             printf(" %d", n_code);
39416             printf("\n");
39417         }
39418     }
39419     function_tests++;
39420 #endif
39421 
39422     return(test_ret);
39423 }
39424 
39425 
39426 static int
test_xmlUCSIsControlPictures(void)39427 test_xmlUCSIsControlPictures(void) {
39428     int test_ret = 0;
39429 
39430 #if defined(LIBXML_UNICODE_ENABLED)
39431     int mem_base;
39432     int ret_val;
39433     int code; /* UCS code point */
39434     int n_code;
39435 
39436     for (n_code = 0;n_code < gen_nb_int;n_code++) {
39437         mem_base = xmlMemBlocks();
39438         code = gen_int(n_code, 0);
39439 
39440         ret_val = xmlUCSIsControlPictures(code);
39441         desret_int(ret_val);
39442         call_tests++;
39443         des_int(n_code, code, 0);
39444         xmlResetLastError();
39445         if (mem_base != xmlMemBlocks()) {
39446             printf("Leak of %d blocks found in xmlUCSIsControlPictures",
39447 	           xmlMemBlocks() - mem_base);
39448 	    test_ret++;
39449             printf(" %d", n_code);
39450             printf("\n");
39451         }
39452     }
39453     function_tests++;
39454 #endif
39455 
39456     return(test_ret);
39457 }
39458 
39459 
39460 static int
test_xmlUCSIsCurrencySymbols(void)39461 test_xmlUCSIsCurrencySymbols(void) {
39462     int test_ret = 0;
39463 
39464 #if defined(LIBXML_UNICODE_ENABLED)
39465     int mem_base;
39466     int ret_val;
39467     int code; /* UCS code point */
39468     int n_code;
39469 
39470     for (n_code = 0;n_code < gen_nb_int;n_code++) {
39471         mem_base = xmlMemBlocks();
39472         code = gen_int(n_code, 0);
39473 
39474         ret_val = xmlUCSIsCurrencySymbols(code);
39475         desret_int(ret_val);
39476         call_tests++;
39477         des_int(n_code, code, 0);
39478         xmlResetLastError();
39479         if (mem_base != xmlMemBlocks()) {
39480             printf("Leak of %d blocks found in xmlUCSIsCurrencySymbols",
39481 	           xmlMemBlocks() - mem_base);
39482 	    test_ret++;
39483             printf(" %d", n_code);
39484             printf("\n");
39485         }
39486     }
39487     function_tests++;
39488 #endif
39489 
39490     return(test_ret);
39491 }
39492 
39493 
39494 static int
test_xmlUCSIsCypriotSyllabary(void)39495 test_xmlUCSIsCypriotSyllabary(void) {
39496     int test_ret = 0;
39497 
39498 #if defined(LIBXML_UNICODE_ENABLED)
39499     int mem_base;
39500     int ret_val;
39501     int code; /* UCS code point */
39502     int n_code;
39503 
39504     for (n_code = 0;n_code < gen_nb_int;n_code++) {
39505         mem_base = xmlMemBlocks();
39506         code = gen_int(n_code, 0);
39507 
39508         ret_val = xmlUCSIsCypriotSyllabary(code);
39509         desret_int(ret_val);
39510         call_tests++;
39511         des_int(n_code, code, 0);
39512         xmlResetLastError();
39513         if (mem_base != xmlMemBlocks()) {
39514             printf("Leak of %d blocks found in xmlUCSIsCypriotSyllabary",
39515 	           xmlMemBlocks() - mem_base);
39516 	    test_ret++;
39517             printf(" %d", n_code);
39518             printf("\n");
39519         }
39520     }
39521     function_tests++;
39522 #endif
39523 
39524     return(test_ret);
39525 }
39526 
39527 
39528 static int
test_xmlUCSIsCyrillic(void)39529 test_xmlUCSIsCyrillic(void) {
39530     int test_ret = 0;
39531 
39532 #if defined(LIBXML_UNICODE_ENABLED)
39533     int mem_base;
39534     int ret_val;
39535     int code; /* UCS code point */
39536     int n_code;
39537 
39538     for (n_code = 0;n_code < gen_nb_int;n_code++) {
39539         mem_base = xmlMemBlocks();
39540         code = gen_int(n_code, 0);
39541 
39542         ret_val = xmlUCSIsCyrillic(code);
39543         desret_int(ret_val);
39544         call_tests++;
39545         des_int(n_code, code, 0);
39546         xmlResetLastError();
39547         if (mem_base != xmlMemBlocks()) {
39548             printf("Leak of %d blocks found in xmlUCSIsCyrillic",
39549 	           xmlMemBlocks() - mem_base);
39550 	    test_ret++;
39551             printf(" %d", n_code);
39552             printf("\n");
39553         }
39554     }
39555     function_tests++;
39556 #endif
39557 
39558     return(test_ret);
39559 }
39560 
39561 
39562 static int
test_xmlUCSIsCyrillicSupplement(void)39563 test_xmlUCSIsCyrillicSupplement(void) {
39564     int test_ret = 0;
39565 
39566 #if defined(LIBXML_UNICODE_ENABLED)
39567     int mem_base;
39568     int ret_val;
39569     int code; /* UCS code point */
39570     int n_code;
39571 
39572     for (n_code = 0;n_code < gen_nb_int;n_code++) {
39573         mem_base = xmlMemBlocks();
39574         code = gen_int(n_code, 0);
39575 
39576         ret_val = xmlUCSIsCyrillicSupplement(code);
39577         desret_int(ret_val);
39578         call_tests++;
39579         des_int(n_code, code, 0);
39580         xmlResetLastError();
39581         if (mem_base != xmlMemBlocks()) {
39582             printf("Leak of %d blocks found in xmlUCSIsCyrillicSupplement",
39583 	           xmlMemBlocks() - mem_base);
39584 	    test_ret++;
39585             printf(" %d", n_code);
39586             printf("\n");
39587         }
39588     }
39589     function_tests++;
39590 #endif
39591 
39592     return(test_ret);
39593 }
39594 
39595 
39596 static int
test_xmlUCSIsDeseret(void)39597 test_xmlUCSIsDeseret(void) {
39598     int test_ret = 0;
39599 
39600 #if defined(LIBXML_UNICODE_ENABLED)
39601     int mem_base;
39602     int ret_val;
39603     int code; /* UCS code point */
39604     int n_code;
39605 
39606     for (n_code = 0;n_code < gen_nb_int;n_code++) {
39607         mem_base = xmlMemBlocks();
39608         code = gen_int(n_code, 0);
39609 
39610         ret_val = xmlUCSIsDeseret(code);
39611         desret_int(ret_val);
39612         call_tests++;
39613         des_int(n_code, code, 0);
39614         xmlResetLastError();
39615         if (mem_base != xmlMemBlocks()) {
39616             printf("Leak of %d blocks found in xmlUCSIsDeseret",
39617 	           xmlMemBlocks() - mem_base);
39618 	    test_ret++;
39619             printf(" %d", n_code);
39620             printf("\n");
39621         }
39622     }
39623     function_tests++;
39624 #endif
39625 
39626     return(test_ret);
39627 }
39628 
39629 
39630 static int
test_xmlUCSIsDevanagari(void)39631 test_xmlUCSIsDevanagari(void) {
39632     int test_ret = 0;
39633 
39634 #if defined(LIBXML_UNICODE_ENABLED)
39635     int mem_base;
39636     int ret_val;
39637     int code; /* UCS code point */
39638     int n_code;
39639 
39640     for (n_code = 0;n_code < gen_nb_int;n_code++) {
39641         mem_base = xmlMemBlocks();
39642         code = gen_int(n_code, 0);
39643 
39644         ret_val = xmlUCSIsDevanagari(code);
39645         desret_int(ret_val);
39646         call_tests++;
39647         des_int(n_code, code, 0);
39648         xmlResetLastError();
39649         if (mem_base != xmlMemBlocks()) {
39650             printf("Leak of %d blocks found in xmlUCSIsDevanagari",
39651 	           xmlMemBlocks() - mem_base);
39652 	    test_ret++;
39653             printf(" %d", n_code);
39654             printf("\n");
39655         }
39656     }
39657     function_tests++;
39658 #endif
39659 
39660     return(test_ret);
39661 }
39662 
39663 
39664 static int
test_xmlUCSIsDingbats(void)39665 test_xmlUCSIsDingbats(void) {
39666     int test_ret = 0;
39667 
39668 #if defined(LIBXML_UNICODE_ENABLED)
39669     int mem_base;
39670     int ret_val;
39671     int code; /* UCS code point */
39672     int n_code;
39673 
39674     for (n_code = 0;n_code < gen_nb_int;n_code++) {
39675         mem_base = xmlMemBlocks();
39676         code = gen_int(n_code, 0);
39677 
39678         ret_val = xmlUCSIsDingbats(code);
39679         desret_int(ret_val);
39680         call_tests++;
39681         des_int(n_code, code, 0);
39682         xmlResetLastError();
39683         if (mem_base != xmlMemBlocks()) {
39684             printf("Leak of %d blocks found in xmlUCSIsDingbats",
39685 	           xmlMemBlocks() - mem_base);
39686 	    test_ret++;
39687             printf(" %d", n_code);
39688             printf("\n");
39689         }
39690     }
39691     function_tests++;
39692 #endif
39693 
39694     return(test_ret);
39695 }
39696 
39697 
39698 static int
test_xmlUCSIsEnclosedAlphanumerics(void)39699 test_xmlUCSIsEnclosedAlphanumerics(void) {
39700     int test_ret = 0;
39701 
39702 #if defined(LIBXML_UNICODE_ENABLED)
39703     int mem_base;
39704     int ret_val;
39705     int code; /* UCS code point */
39706     int n_code;
39707 
39708     for (n_code = 0;n_code < gen_nb_int;n_code++) {
39709         mem_base = xmlMemBlocks();
39710         code = gen_int(n_code, 0);
39711 
39712         ret_val = xmlUCSIsEnclosedAlphanumerics(code);
39713         desret_int(ret_val);
39714         call_tests++;
39715         des_int(n_code, code, 0);
39716         xmlResetLastError();
39717         if (mem_base != xmlMemBlocks()) {
39718             printf("Leak of %d blocks found in xmlUCSIsEnclosedAlphanumerics",
39719 	           xmlMemBlocks() - mem_base);
39720 	    test_ret++;
39721             printf(" %d", n_code);
39722             printf("\n");
39723         }
39724     }
39725     function_tests++;
39726 #endif
39727 
39728     return(test_ret);
39729 }
39730 
39731 
39732 static int
test_xmlUCSIsEnclosedCJKLettersandMonths(void)39733 test_xmlUCSIsEnclosedCJKLettersandMonths(void) {
39734     int test_ret = 0;
39735 
39736 #if defined(LIBXML_UNICODE_ENABLED)
39737     int mem_base;
39738     int ret_val;
39739     int code; /* UCS code point */
39740     int n_code;
39741 
39742     for (n_code = 0;n_code < gen_nb_int;n_code++) {
39743         mem_base = xmlMemBlocks();
39744         code = gen_int(n_code, 0);
39745 
39746         ret_val = xmlUCSIsEnclosedCJKLettersandMonths(code);
39747         desret_int(ret_val);
39748         call_tests++;
39749         des_int(n_code, code, 0);
39750         xmlResetLastError();
39751         if (mem_base != xmlMemBlocks()) {
39752             printf("Leak of %d blocks found in xmlUCSIsEnclosedCJKLettersandMonths",
39753 	           xmlMemBlocks() - mem_base);
39754 	    test_ret++;
39755             printf(" %d", n_code);
39756             printf("\n");
39757         }
39758     }
39759     function_tests++;
39760 #endif
39761 
39762     return(test_ret);
39763 }
39764 
39765 
39766 static int
test_xmlUCSIsEthiopic(void)39767 test_xmlUCSIsEthiopic(void) {
39768     int test_ret = 0;
39769 
39770 #if defined(LIBXML_UNICODE_ENABLED)
39771     int mem_base;
39772     int ret_val;
39773     int code; /* UCS code point */
39774     int n_code;
39775 
39776     for (n_code = 0;n_code < gen_nb_int;n_code++) {
39777         mem_base = xmlMemBlocks();
39778         code = gen_int(n_code, 0);
39779 
39780         ret_val = xmlUCSIsEthiopic(code);
39781         desret_int(ret_val);
39782         call_tests++;
39783         des_int(n_code, code, 0);
39784         xmlResetLastError();
39785         if (mem_base != xmlMemBlocks()) {
39786             printf("Leak of %d blocks found in xmlUCSIsEthiopic",
39787 	           xmlMemBlocks() - mem_base);
39788 	    test_ret++;
39789             printf(" %d", n_code);
39790             printf("\n");
39791         }
39792     }
39793     function_tests++;
39794 #endif
39795 
39796     return(test_ret);
39797 }
39798 
39799 
39800 static int
test_xmlUCSIsGeneralPunctuation(void)39801 test_xmlUCSIsGeneralPunctuation(void) {
39802     int test_ret = 0;
39803 
39804 #if defined(LIBXML_UNICODE_ENABLED)
39805     int mem_base;
39806     int ret_val;
39807     int code; /* UCS code point */
39808     int n_code;
39809 
39810     for (n_code = 0;n_code < gen_nb_int;n_code++) {
39811         mem_base = xmlMemBlocks();
39812         code = gen_int(n_code, 0);
39813 
39814         ret_val = xmlUCSIsGeneralPunctuation(code);
39815         desret_int(ret_val);
39816         call_tests++;
39817         des_int(n_code, code, 0);
39818         xmlResetLastError();
39819         if (mem_base != xmlMemBlocks()) {
39820             printf("Leak of %d blocks found in xmlUCSIsGeneralPunctuation",
39821 	           xmlMemBlocks() - mem_base);
39822 	    test_ret++;
39823             printf(" %d", n_code);
39824             printf("\n");
39825         }
39826     }
39827     function_tests++;
39828 #endif
39829 
39830     return(test_ret);
39831 }
39832 
39833 
39834 static int
test_xmlUCSIsGeometricShapes(void)39835 test_xmlUCSIsGeometricShapes(void) {
39836     int test_ret = 0;
39837 
39838 #if defined(LIBXML_UNICODE_ENABLED)
39839     int mem_base;
39840     int ret_val;
39841     int code; /* UCS code point */
39842     int n_code;
39843 
39844     for (n_code = 0;n_code < gen_nb_int;n_code++) {
39845         mem_base = xmlMemBlocks();
39846         code = gen_int(n_code, 0);
39847 
39848         ret_val = xmlUCSIsGeometricShapes(code);
39849         desret_int(ret_val);
39850         call_tests++;
39851         des_int(n_code, code, 0);
39852         xmlResetLastError();
39853         if (mem_base != xmlMemBlocks()) {
39854             printf("Leak of %d blocks found in xmlUCSIsGeometricShapes",
39855 	           xmlMemBlocks() - mem_base);
39856 	    test_ret++;
39857             printf(" %d", n_code);
39858             printf("\n");
39859         }
39860     }
39861     function_tests++;
39862 #endif
39863 
39864     return(test_ret);
39865 }
39866 
39867 
39868 static int
test_xmlUCSIsGeorgian(void)39869 test_xmlUCSIsGeorgian(void) {
39870     int test_ret = 0;
39871 
39872 #if defined(LIBXML_UNICODE_ENABLED)
39873     int mem_base;
39874     int ret_val;
39875     int code; /* UCS code point */
39876     int n_code;
39877 
39878     for (n_code = 0;n_code < gen_nb_int;n_code++) {
39879         mem_base = xmlMemBlocks();
39880         code = gen_int(n_code, 0);
39881 
39882         ret_val = xmlUCSIsGeorgian(code);
39883         desret_int(ret_val);
39884         call_tests++;
39885         des_int(n_code, code, 0);
39886         xmlResetLastError();
39887         if (mem_base != xmlMemBlocks()) {
39888             printf("Leak of %d blocks found in xmlUCSIsGeorgian",
39889 	           xmlMemBlocks() - mem_base);
39890 	    test_ret++;
39891             printf(" %d", n_code);
39892             printf("\n");
39893         }
39894     }
39895     function_tests++;
39896 #endif
39897 
39898     return(test_ret);
39899 }
39900 
39901 
39902 static int
test_xmlUCSIsGothic(void)39903 test_xmlUCSIsGothic(void) {
39904     int test_ret = 0;
39905 
39906 #if defined(LIBXML_UNICODE_ENABLED)
39907     int mem_base;
39908     int ret_val;
39909     int code; /* UCS code point */
39910     int n_code;
39911 
39912     for (n_code = 0;n_code < gen_nb_int;n_code++) {
39913         mem_base = xmlMemBlocks();
39914         code = gen_int(n_code, 0);
39915 
39916         ret_val = xmlUCSIsGothic(code);
39917         desret_int(ret_val);
39918         call_tests++;
39919         des_int(n_code, code, 0);
39920         xmlResetLastError();
39921         if (mem_base != xmlMemBlocks()) {
39922             printf("Leak of %d blocks found in xmlUCSIsGothic",
39923 	           xmlMemBlocks() - mem_base);
39924 	    test_ret++;
39925             printf(" %d", n_code);
39926             printf("\n");
39927         }
39928     }
39929     function_tests++;
39930 #endif
39931 
39932     return(test_ret);
39933 }
39934 
39935 
39936 static int
test_xmlUCSIsGreek(void)39937 test_xmlUCSIsGreek(void) {
39938     int test_ret = 0;
39939 
39940 #if defined(LIBXML_UNICODE_ENABLED)
39941     int mem_base;
39942     int ret_val;
39943     int code; /* UCS code point */
39944     int n_code;
39945 
39946     for (n_code = 0;n_code < gen_nb_int;n_code++) {
39947         mem_base = xmlMemBlocks();
39948         code = gen_int(n_code, 0);
39949 
39950         ret_val = xmlUCSIsGreek(code);
39951         desret_int(ret_val);
39952         call_tests++;
39953         des_int(n_code, code, 0);
39954         xmlResetLastError();
39955         if (mem_base != xmlMemBlocks()) {
39956             printf("Leak of %d blocks found in xmlUCSIsGreek",
39957 	           xmlMemBlocks() - mem_base);
39958 	    test_ret++;
39959             printf(" %d", n_code);
39960             printf("\n");
39961         }
39962     }
39963     function_tests++;
39964 #endif
39965 
39966     return(test_ret);
39967 }
39968 
39969 
39970 static int
test_xmlUCSIsGreekExtended(void)39971 test_xmlUCSIsGreekExtended(void) {
39972     int test_ret = 0;
39973 
39974 #if defined(LIBXML_UNICODE_ENABLED)
39975     int mem_base;
39976     int ret_val;
39977     int code; /* UCS code point */
39978     int n_code;
39979 
39980     for (n_code = 0;n_code < gen_nb_int;n_code++) {
39981         mem_base = xmlMemBlocks();
39982         code = gen_int(n_code, 0);
39983 
39984         ret_val = xmlUCSIsGreekExtended(code);
39985         desret_int(ret_val);
39986         call_tests++;
39987         des_int(n_code, code, 0);
39988         xmlResetLastError();
39989         if (mem_base != xmlMemBlocks()) {
39990             printf("Leak of %d blocks found in xmlUCSIsGreekExtended",
39991 	           xmlMemBlocks() - mem_base);
39992 	    test_ret++;
39993             printf(" %d", n_code);
39994             printf("\n");
39995         }
39996     }
39997     function_tests++;
39998 #endif
39999 
40000     return(test_ret);
40001 }
40002 
40003 
40004 static int
test_xmlUCSIsGreekandCoptic(void)40005 test_xmlUCSIsGreekandCoptic(void) {
40006     int test_ret = 0;
40007 
40008 #if defined(LIBXML_UNICODE_ENABLED)
40009     int mem_base;
40010     int ret_val;
40011     int code; /* UCS code point */
40012     int n_code;
40013 
40014     for (n_code = 0;n_code < gen_nb_int;n_code++) {
40015         mem_base = xmlMemBlocks();
40016         code = gen_int(n_code, 0);
40017 
40018         ret_val = xmlUCSIsGreekandCoptic(code);
40019         desret_int(ret_val);
40020         call_tests++;
40021         des_int(n_code, code, 0);
40022         xmlResetLastError();
40023         if (mem_base != xmlMemBlocks()) {
40024             printf("Leak of %d blocks found in xmlUCSIsGreekandCoptic",
40025 	           xmlMemBlocks() - mem_base);
40026 	    test_ret++;
40027             printf(" %d", n_code);
40028             printf("\n");
40029         }
40030     }
40031     function_tests++;
40032 #endif
40033 
40034     return(test_ret);
40035 }
40036 
40037 
40038 static int
test_xmlUCSIsGujarati(void)40039 test_xmlUCSIsGujarati(void) {
40040     int test_ret = 0;
40041 
40042 #if defined(LIBXML_UNICODE_ENABLED)
40043     int mem_base;
40044     int ret_val;
40045     int code; /* UCS code point */
40046     int n_code;
40047 
40048     for (n_code = 0;n_code < gen_nb_int;n_code++) {
40049         mem_base = xmlMemBlocks();
40050         code = gen_int(n_code, 0);
40051 
40052         ret_val = xmlUCSIsGujarati(code);
40053         desret_int(ret_val);
40054         call_tests++;
40055         des_int(n_code, code, 0);
40056         xmlResetLastError();
40057         if (mem_base != xmlMemBlocks()) {
40058             printf("Leak of %d blocks found in xmlUCSIsGujarati",
40059 	           xmlMemBlocks() - mem_base);
40060 	    test_ret++;
40061             printf(" %d", n_code);
40062             printf("\n");
40063         }
40064     }
40065     function_tests++;
40066 #endif
40067 
40068     return(test_ret);
40069 }
40070 
40071 
40072 static int
test_xmlUCSIsGurmukhi(void)40073 test_xmlUCSIsGurmukhi(void) {
40074     int test_ret = 0;
40075 
40076 #if defined(LIBXML_UNICODE_ENABLED)
40077     int mem_base;
40078     int ret_val;
40079     int code; /* UCS code point */
40080     int n_code;
40081 
40082     for (n_code = 0;n_code < gen_nb_int;n_code++) {
40083         mem_base = xmlMemBlocks();
40084         code = gen_int(n_code, 0);
40085 
40086         ret_val = xmlUCSIsGurmukhi(code);
40087         desret_int(ret_val);
40088         call_tests++;
40089         des_int(n_code, code, 0);
40090         xmlResetLastError();
40091         if (mem_base != xmlMemBlocks()) {
40092             printf("Leak of %d blocks found in xmlUCSIsGurmukhi",
40093 	           xmlMemBlocks() - mem_base);
40094 	    test_ret++;
40095             printf(" %d", n_code);
40096             printf("\n");
40097         }
40098     }
40099     function_tests++;
40100 #endif
40101 
40102     return(test_ret);
40103 }
40104 
40105 
40106 static int
test_xmlUCSIsHalfwidthandFullwidthForms(void)40107 test_xmlUCSIsHalfwidthandFullwidthForms(void) {
40108     int test_ret = 0;
40109 
40110 #if defined(LIBXML_UNICODE_ENABLED)
40111     int mem_base;
40112     int ret_val;
40113     int code; /* UCS code point */
40114     int n_code;
40115 
40116     for (n_code = 0;n_code < gen_nb_int;n_code++) {
40117         mem_base = xmlMemBlocks();
40118         code = gen_int(n_code, 0);
40119 
40120         ret_val = xmlUCSIsHalfwidthandFullwidthForms(code);
40121         desret_int(ret_val);
40122         call_tests++;
40123         des_int(n_code, code, 0);
40124         xmlResetLastError();
40125         if (mem_base != xmlMemBlocks()) {
40126             printf("Leak of %d blocks found in xmlUCSIsHalfwidthandFullwidthForms",
40127 	           xmlMemBlocks() - mem_base);
40128 	    test_ret++;
40129             printf(" %d", n_code);
40130             printf("\n");
40131         }
40132     }
40133     function_tests++;
40134 #endif
40135 
40136     return(test_ret);
40137 }
40138 
40139 
40140 static int
test_xmlUCSIsHangulCompatibilityJamo(void)40141 test_xmlUCSIsHangulCompatibilityJamo(void) {
40142     int test_ret = 0;
40143 
40144 #if defined(LIBXML_UNICODE_ENABLED)
40145     int mem_base;
40146     int ret_val;
40147     int code; /* UCS code point */
40148     int n_code;
40149 
40150     for (n_code = 0;n_code < gen_nb_int;n_code++) {
40151         mem_base = xmlMemBlocks();
40152         code = gen_int(n_code, 0);
40153 
40154         ret_val = xmlUCSIsHangulCompatibilityJamo(code);
40155         desret_int(ret_val);
40156         call_tests++;
40157         des_int(n_code, code, 0);
40158         xmlResetLastError();
40159         if (mem_base != xmlMemBlocks()) {
40160             printf("Leak of %d blocks found in xmlUCSIsHangulCompatibilityJamo",
40161 	           xmlMemBlocks() - mem_base);
40162 	    test_ret++;
40163             printf(" %d", n_code);
40164             printf("\n");
40165         }
40166     }
40167     function_tests++;
40168 #endif
40169 
40170     return(test_ret);
40171 }
40172 
40173 
40174 static int
test_xmlUCSIsHangulJamo(void)40175 test_xmlUCSIsHangulJamo(void) {
40176     int test_ret = 0;
40177 
40178 #if defined(LIBXML_UNICODE_ENABLED)
40179     int mem_base;
40180     int ret_val;
40181     int code; /* UCS code point */
40182     int n_code;
40183 
40184     for (n_code = 0;n_code < gen_nb_int;n_code++) {
40185         mem_base = xmlMemBlocks();
40186         code = gen_int(n_code, 0);
40187 
40188         ret_val = xmlUCSIsHangulJamo(code);
40189         desret_int(ret_val);
40190         call_tests++;
40191         des_int(n_code, code, 0);
40192         xmlResetLastError();
40193         if (mem_base != xmlMemBlocks()) {
40194             printf("Leak of %d blocks found in xmlUCSIsHangulJamo",
40195 	           xmlMemBlocks() - mem_base);
40196 	    test_ret++;
40197             printf(" %d", n_code);
40198             printf("\n");
40199         }
40200     }
40201     function_tests++;
40202 #endif
40203 
40204     return(test_ret);
40205 }
40206 
40207 
40208 static int
test_xmlUCSIsHangulSyllables(void)40209 test_xmlUCSIsHangulSyllables(void) {
40210     int test_ret = 0;
40211 
40212 #if defined(LIBXML_UNICODE_ENABLED)
40213     int mem_base;
40214     int ret_val;
40215     int code; /* UCS code point */
40216     int n_code;
40217 
40218     for (n_code = 0;n_code < gen_nb_int;n_code++) {
40219         mem_base = xmlMemBlocks();
40220         code = gen_int(n_code, 0);
40221 
40222         ret_val = xmlUCSIsHangulSyllables(code);
40223         desret_int(ret_val);
40224         call_tests++;
40225         des_int(n_code, code, 0);
40226         xmlResetLastError();
40227         if (mem_base != xmlMemBlocks()) {
40228             printf("Leak of %d blocks found in xmlUCSIsHangulSyllables",
40229 	           xmlMemBlocks() - mem_base);
40230 	    test_ret++;
40231             printf(" %d", n_code);
40232             printf("\n");
40233         }
40234     }
40235     function_tests++;
40236 #endif
40237 
40238     return(test_ret);
40239 }
40240 
40241 
40242 static int
test_xmlUCSIsHanunoo(void)40243 test_xmlUCSIsHanunoo(void) {
40244     int test_ret = 0;
40245 
40246 #if defined(LIBXML_UNICODE_ENABLED)
40247     int mem_base;
40248     int ret_val;
40249     int code; /* UCS code point */
40250     int n_code;
40251 
40252     for (n_code = 0;n_code < gen_nb_int;n_code++) {
40253         mem_base = xmlMemBlocks();
40254         code = gen_int(n_code, 0);
40255 
40256         ret_val = xmlUCSIsHanunoo(code);
40257         desret_int(ret_val);
40258         call_tests++;
40259         des_int(n_code, code, 0);
40260         xmlResetLastError();
40261         if (mem_base != xmlMemBlocks()) {
40262             printf("Leak of %d blocks found in xmlUCSIsHanunoo",
40263 	           xmlMemBlocks() - mem_base);
40264 	    test_ret++;
40265             printf(" %d", n_code);
40266             printf("\n");
40267         }
40268     }
40269     function_tests++;
40270 #endif
40271 
40272     return(test_ret);
40273 }
40274 
40275 
40276 static int
test_xmlUCSIsHebrew(void)40277 test_xmlUCSIsHebrew(void) {
40278     int test_ret = 0;
40279 
40280 #if defined(LIBXML_UNICODE_ENABLED)
40281     int mem_base;
40282     int ret_val;
40283     int code; /* UCS code point */
40284     int n_code;
40285 
40286     for (n_code = 0;n_code < gen_nb_int;n_code++) {
40287         mem_base = xmlMemBlocks();
40288         code = gen_int(n_code, 0);
40289 
40290         ret_val = xmlUCSIsHebrew(code);
40291         desret_int(ret_val);
40292         call_tests++;
40293         des_int(n_code, code, 0);
40294         xmlResetLastError();
40295         if (mem_base != xmlMemBlocks()) {
40296             printf("Leak of %d blocks found in xmlUCSIsHebrew",
40297 	           xmlMemBlocks() - mem_base);
40298 	    test_ret++;
40299             printf(" %d", n_code);
40300             printf("\n");
40301         }
40302     }
40303     function_tests++;
40304 #endif
40305 
40306     return(test_ret);
40307 }
40308 
40309 
40310 static int
test_xmlUCSIsHighPrivateUseSurrogates(void)40311 test_xmlUCSIsHighPrivateUseSurrogates(void) {
40312     int test_ret = 0;
40313 
40314 #if defined(LIBXML_UNICODE_ENABLED)
40315     int mem_base;
40316     int ret_val;
40317     int code; /* UCS code point */
40318     int n_code;
40319 
40320     for (n_code = 0;n_code < gen_nb_int;n_code++) {
40321         mem_base = xmlMemBlocks();
40322         code = gen_int(n_code, 0);
40323 
40324         ret_val = xmlUCSIsHighPrivateUseSurrogates(code);
40325         desret_int(ret_val);
40326         call_tests++;
40327         des_int(n_code, code, 0);
40328         xmlResetLastError();
40329         if (mem_base != xmlMemBlocks()) {
40330             printf("Leak of %d blocks found in xmlUCSIsHighPrivateUseSurrogates",
40331 	           xmlMemBlocks() - mem_base);
40332 	    test_ret++;
40333             printf(" %d", n_code);
40334             printf("\n");
40335         }
40336     }
40337     function_tests++;
40338 #endif
40339 
40340     return(test_ret);
40341 }
40342 
40343 
40344 static int
test_xmlUCSIsHighSurrogates(void)40345 test_xmlUCSIsHighSurrogates(void) {
40346     int test_ret = 0;
40347 
40348 #if defined(LIBXML_UNICODE_ENABLED)
40349     int mem_base;
40350     int ret_val;
40351     int code; /* UCS code point */
40352     int n_code;
40353 
40354     for (n_code = 0;n_code < gen_nb_int;n_code++) {
40355         mem_base = xmlMemBlocks();
40356         code = gen_int(n_code, 0);
40357 
40358         ret_val = xmlUCSIsHighSurrogates(code);
40359         desret_int(ret_val);
40360         call_tests++;
40361         des_int(n_code, code, 0);
40362         xmlResetLastError();
40363         if (mem_base != xmlMemBlocks()) {
40364             printf("Leak of %d blocks found in xmlUCSIsHighSurrogates",
40365 	           xmlMemBlocks() - mem_base);
40366 	    test_ret++;
40367             printf(" %d", n_code);
40368             printf("\n");
40369         }
40370     }
40371     function_tests++;
40372 #endif
40373 
40374     return(test_ret);
40375 }
40376 
40377 
40378 static int
test_xmlUCSIsHiragana(void)40379 test_xmlUCSIsHiragana(void) {
40380     int test_ret = 0;
40381 
40382 #if defined(LIBXML_UNICODE_ENABLED)
40383     int mem_base;
40384     int ret_val;
40385     int code; /* UCS code point */
40386     int n_code;
40387 
40388     for (n_code = 0;n_code < gen_nb_int;n_code++) {
40389         mem_base = xmlMemBlocks();
40390         code = gen_int(n_code, 0);
40391 
40392         ret_val = xmlUCSIsHiragana(code);
40393         desret_int(ret_val);
40394         call_tests++;
40395         des_int(n_code, code, 0);
40396         xmlResetLastError();
40397         if (mem_base != xmlMemBlocks()) {
40398             printf("Leak of %d blocks found in xmlUCSIsHiragana",
40399 	           xmlMemBlocks() - mem_base);
40400 	    test_ret++;
40401             printf(" %d", n_code);
40402             printf("\n");
40403         }
40404     }
40405     function_tests++;
40406 #endif
40407 
40408     return(test_ret);
40409 }
40410 
40411 
40412 static int
test_xmlUCSIsIPAExtensions(void)40413 test_xmlUCSIsIPAExtensions(void) {
40414     int test_ret = 0;
40415 
40416 #if defined(LIBXML_UNICODE_ENABLED)
40417     int mem_base;
40418     int ret_val;
40419     int code; /* UCS code point */
40420     int n_code;
40421 
40422     for (n_code = 0;n_code < gen_nb_int;n_code++) {
40423         mem_base = xmlMemBlocks();
40424         code = gen_int(n_code, 0);
40425 
40426         ret_val = xmlUCSIsIPAExtensions(code);
40427         desret_int(ret_val);
40428         call_tests++;
40429         des_int(n_code, code, 0);
40430         xmlResetLastError();
40431         if (mem_base != xmlMemBlocks()) {
40432             printf("Leak of %d blocks found in xmlUCSIsIPAExtensions",
40433 	           xmlMemBlocks() - mem_base);
40434 	    test_ret++;
40435             printf(" %d", n_code);
40436             printf("\n");
40437         }
40438     }
40439     function_tests++;
40440 #endif
40441 
40442     return(test_ret);
40443 }
40444 
40445 
40446 static int
test_xmlUCSIsIdeographicDescriptionCharacters(void)40447 test_xmlUCSIsIdeographicDescriptionCharacters(void) {
40448     int test_ret = 0;
40449 
40450 #if defined(LIBXML_UNICODE_ENABLED)
40451     int mem_base;
40452     int ret_val;
40453     int code; /* UCS code point */
40454     int n_code;
40455 
40456     for (n_code = 0;n_code < gen_nb_int;n_code++) {
40457         mem_base = xmlMemBlocks();
40458         code = gen_int(n_code, 0);
40459 
40460         ret_val = xmlUCSIsIdeographicDescriptionCharacters(code);
40461         desret_int(ret_val);
40462         call_tests++;
40463         des_int(n_code, code, 0);
40464         xmlResetLastError();
40465         if (mem_base != xmlMemBlocks()) {
40466             printf("Leak of %d blocks found in xmlUCSIsIdeographicDescriptionCharacters",
40467 	           xmlMemBlocks() - mem_base);
40468 	    test_ret++;
40469             printf(" %d", n_code);
40470             printf("\n");
40471         }
40472     }
40473     function_tests++;
40474 #endif
40475 
40476     return(test_ret);
40477 }
40478 
40479 
40480 static int
test_xmlUCSIsKanbun(void)40481 test_xmlUCSIsKanbun(void) {
40482     int test_ret = 0;
40483 
40484 #if defined(LIBXML_UNICODE_ENABLED)
40485     int mem_base;
40486     int ret_val;
40487     int code; /* UCS code point */
40488     int n_code;
40489 
40490     for (n_code = 0;n_code < gen_nb_int;n_code++) {
40491         mem_base = xmlMemBlocks();
40492         code = gen_int(n_code, 0);
40493 
40494         ret_val = xmlUCSIsKanbun(code);
40495         desret_int(ret_val);
40496         call_tests++;
40497         des_int(n_code, code, 0);
40498         xmlResetLastError();
40499         if (mem_base != xmlMemBlocks()) {
40500             printf("Leak of %d blocks found in xmlUCSIsKanbun",
40501 	           xmlMemBlocks() - mem_base);
40502 	    test_ret++;
40503             printf(" %d", n_code);
40504             printf("\n");
40505         }
40506     }
40507     function_tests++;
40508 #endif
40509 
40510     return(test_ret);
40511 }
40512 
40513 
40514 static int
test_xmlUCSIsKangxiRadicals(void)40515 test_xmlUCSIsKangxiRadicals(void) {
40516     int test_ret = 0;
40517 
40518 #if defined(LIBXML_UNICODE_ENABLED)
40519     int mem_base;
40520     int ret_val;
40521     int code; /* UCS code point */
40522     int n_code;
40523 
40524     for (n_code = 0;n_code < gen_nb_int;n_code++) {
40525         mem_base = xmlMemBlocks();
40526         code = gen_int(n_code, 0);
40527 
40528         ret_val = xmlUCSIsKangxiRadicals(code);
40529         desret_int(ret_val);
40530         call_tests++;
40531         des_int(n_code, code, 0);
40532         xmlResetLastError();
40533         if (mem_base != xmlMemBlocks()) {
40534             printf("Leak of %d blocks found in xmlUCSIsKangxiRadicals",
40535 	           xmlMemBlocks() - mem_base);
40536 	    test_ret++;
40537             printf(" %d", n_code);
40538             printf("\n");
40539         }
40540     }
40541     function_tests++;
40542 #endif
40543 
40544     return(test_ret);
40545 }
40546 
40547 
40548 static int
test_xmlUCSIsKannada(void)40549 test_xmlUCSIsKannada(void) {
40550     int test_ret = 0;
40551 
40552 #if defined(LIBXML_UNICODE_ENABLED)
40553     int mem_base;
40554     int ret_val;
40555     int code; /* UCS code point */
40556     int n_code;
40557 
40558     for (n_code = 0;n_code < gen_nb_int;n_code++) {
40559         mem_base = xmlMemBlocks();
40560         code = gen_int(n_code, 0);
40561 
40562         ret_val = xmlUCSIsKannada(code);
40563         desret_int(ret_val);
40564         call_tests++;
40565         des_int(n_code, code, 0);
40566         xmlResetLastError();
40567         if (mem_base != xmlMemBlocks()) {
40568             printf("Leak of %d blocks found in xmlUCSIsKannada",
40569 	           xmlMemBlocks() - mem_base);
40570 	    test_ret++;
40571             printf(" %d", n_code);
40572             printf("\n");
40573         }
40574     }
40575     function_tests++;
40576 #endif
40577 
40578     return(test_ret);
40579 }
40580 
40581 
40582 static int
test_xmlUCSIsKatakana(void)40583 test_xmlUCSIsKatakana(void) {
40584     int test_ret = 0;
40585 
40586 #if defined(LIBXML_UNICODE_ENABLED)
40587     int mem_base;
40588     int ret_val;
40589     int code; /* UCS code point */
40590     int n_code;
40591 
40592     for (n_code = 0;n_code < gen_nb_int;n_code++) {
40593         mem_base = xmlMemBlocks();
40594         code = gen_int(n_code, 0);
40595 
40596         ret_val = xmlUCSIsKatakana(code);
40597         desret_int(ret_val);
40598         call_tests++;
40599         des_int(n_code, code, 0);
40600         xmlResetLastError();
40601         if (mem_base != xmlMemBlocks()) {
40602             printf("Leak of %d blocks found in xmlUCSIsKatakana",
40603 	           xmlMemBlocks() - mem_base);
40604 	    test_ret++;
40605             printf(" %d", n_code);
40606             printf("\n");
40607         }
40608     }
40609     function_tests++;
40610 #endif
40611 
40612     return(test_ret);
40613 }
40614 
40615 
40616 static int
test_xmlUCSIsKatakanaPhoneticExtensions(void)40617 test_xmlUCSIsKatakanaPhoneticExtensions(void) {
40618     int test_ret = 0;
40619 
40620 #if defined(LIBXML_UNICODE_ENABLED)
40621     int mem_base;
40622     int ret_val;
40623     int code; /* UCS code point */
40624     int n_code;
40625 
40626     for (n_code = 0;n_code < gen_nb_int;n_code++) {
40627         mem_base = xmlMemBlocks();
40628         code = gen_int(n_code, 0);
40629 
40630         ret_val = xmlUCSIsKatakanaPhoneticExtensions(code);
40631         desret_int(ret_val);
40632         call_tests++;
40633         des_int(n_code, code, 0);
40634         xmlResetLastError();
40635         if (mem_base != xmlMemBlocks()) {
40636             printf("Leak of %d blocks found in xmlUCSIsKatakanaPhoneticExtensions",
40637 	           xmlMemBlocks() - mem_base);
40638 	    test_ret++;
40639             printf(" %d", n_code);
40640             printf("\n");
40641         }
40642     }
40643     function_tests++;
40644 #endif
40645 
40646     return(test_ret);
40647 }
40648 
40649 
40650 static int
test_xmlUCSIsKhmer(void)40651 test_xmlUCSIsKhmer(void) {
40652     int test_ret = 0;
40653 
40654 #if defined(LIBXML_UNICODE_ENABLED)
40655     int mem_base;
40656     int ret_val;
40657     int code; /* UCS code point */
40658     int n_code;
40659 
40660     for (n_code = 0;n_code < gen_nb_int;n_code++) {
40661         mem_base = xmlMemBlocks();
40662         code = gen_int(n_code, 0);
40663 
40664         ret_val = xmlUCSIsKhmer(code);
40665         desret_int(ret_val);
40666         call_tests++;
40667         des_int(n_code, code, 0);
40668         xmlResetLastError();
40669         if (mem_base != xmlMemBlocks()) {
40670             printf("Leak of %d blocks found in xmlUCSIsKhmer",
40671 	           xmlMemBlocks() - mem_base);
40672 	    test_ret++;
40673             printf(" %d", n_code);
40674             printf("\n");
40675         }
40676     }
40677     function_tests++;
40678 #endif
40679 
40680     return(test_ret);
40681 }
40682 
40683 
40684 static int
test_xmlUCSIsKhmerSymbols(void)40685 test_xmlUCSIsKhmerSymbols(void) {
40686     int test_ret = 0;
40687 
40688 #if defined(LIBXML_UNICODE_ENABLED)
40689     int mem_base;
40690     int ret_val;
40691     int code; /* UCS code point */
40692     int n_code;
40693 
40694     for (n_code = 0;n_code < gen_nb_int;n_code++) {
40695         mem_base = xmlMemBlocks();
40696         code = gen_int(n_code, 0);
40697 
40698         ret_val = xmlUCSIsKhmerSymbols(code);
40699         desret_int(ret_val);
40700         call_tests++;
40701         des_int(n_code, code, 0);
40702         xmlResetLastError();
40703         if (mem_base != xmlMemBlocks()) {
40704             printf("Leak of %d blocks found in xmlUCSIsKhmerSymbols",
40705 	           xmlMemBlocks() - mem_base);
40706 	    test_ret++;
40707             printf(" %d", n_code);
40708             printf("\n");
40709         }
40710     }
40711     function_tests++;
40712 #endif
40713 
40714     return(test_ret);
40715 }
40716 
40717 
40718 static int
test_xmlUCSIsLao(void)40719 test_xmlUCSIsLao(void) {
40720     int test_ret = 0;
40721 
40722 #if defined(LIBXML_UNICODE_ENABLED)
40723     int mem_base;
40724     int ret_val;
40725     int code; /* UCS code point */
40726     int n_code;
40727 
40728     for (n_code = 0;n_code < gen_nb_int;n_code++) {
40729         mem_base = xmlMemBlocks();
40730         code = gen_int(n_code, 0);
40731 
40732         ret_val = xmlUCSIsLao(code);
40733         desret_int(ret_val);
40734         call_tests++;
40735         des_int(n_code, code, 0);
40736         xmlResetLastError();
40737         if (mem_base != xmlMemBlocks()) {
40738             printf("Leak of %d blocks found in xmlUCSIsLao",
40739 	           xmlMemBlocks() - mem_base);
40740 	    test_ret++;
40741             printf(" %d", n_code);
40742             printf("\n");
40743         }
40744     }
40745     function_tests++;
40746 #endif
40747 
40748     return(test_ret);
40749 }
40750 
40751 
40752 static int
test_xmlUCSIsLatin1Supplement(void)40753 test_xmlUCSIsLatin1Supplement(void) {
40754     int test_ret = 0;
40755 
40756 #if defined(LIBXML_UNICODE_ENABLED)
40757     int mem_base;
40758     int ret_val;
40759     int code; /* UCS code point */
40760     int n_code;
40761 
40762     for (n_code = 0;n_code < gen_nb_int;n_code++) {
40763         mem_base = xmlMemBlocks();
40764         code = gen_int(n_code, 0);
40765 
40766         ret_val = xmlUCSIsLatin1Supplement(code);
40767         desret_int(ret_val);
40768         call_tests++;
40769         des_int(n_code, code, 0);
40770         xmlResetLastError();
40771         if (mem_base != xmlMemBlocks()) {
40772             printf("Leak of %d blocks found in xmlUCSIsLatin1Supplement",
40773 	           xmlMemBlocks() - mem_base);
40774 	    test_ret++;
40775             printf(" %d", n_code);
40776             printf("\n");
40777         }
40778     }
40779     function_tests++;
40780 #endif
40781 
40782     return(test_ret);
40783 }
40784 
40785 
40786 static int
test_xmlUCSIsLatinExtendedA(void)40787 test_xmlUCSIsLatinExtendedA(void) {
40788     int test_ret = 0;
40789 
40790 #if defined(LIBXML_UNICODE_ENABLED)
40791     int mem_base;
40792     int ret_val;
40793     int code; /* UCS code point */
40794     int n_code;
40795 
40796     for (n_code = 0;n_code < gen_nb_int;n_code++) {
40797         mem_base = xmlMemBlocks();
40798         code = gen_int(n_code, 0);
40799 
40800         ret_val = xmlUCSIsLatinExtendedA(code);
40801         desret_int(ret_val);
40802         call_tests++;
40803         des_int(n_code, code, 0);
40804         xmlResetLastError();
40805         if (mem_base != xmlMemBlocks()) {
40806             printf("Leak of %d blocks found in xmlUCSIsLatinExtendedA",
40807 	           xmlMemBlocks() - mem_base);
40808 	    test_ret++;
40809             printf(" %d", n_code);
40810             printf("\n");
40811         }
40812     }
40813     function_tests++;
40814 #endif
40815 
40816     return(test_ret);
40817 }
40818 
40819 
40820 static int
test_xmlUCSIsLatinExtendedAdditional(void)40821 test_xmlUCSIsLatinExtendedAdditional(void) {
40822     int test_ret = 0;
40823 
40824 #if defined(LIBXML_UNICODE_ENABLED)
40825     int mem_base;
40826     int ret_val;
40827     int code; /* UCS code point */
40828     int n_code;
40829 
40830     for (n_code = 0;n_code < gen_nb_int;n_code++) {
40831         mem_base = xmlMemBlocks();
40832         code = gen_int(n_code, 0);
40833 
40834         ret_val = xmlUCSIsLatinExtendedAdditional(code);
40835         desret_int(ret_val);
40836         call_tests++;
40837         des_int(n_code, code, 0);
40838         xmlResetLastError();
40839         if (mem_base != xmlMemBlocks()) {
40840             printf("Leak of %d blocks found in xmlUCSIsLatinExtendedAdditional",
40841 	           xmlMemBlocks() - mem_base);
40842 	    test_ret++;
40843             printf(" %d", n_code);
40844             printf("\n");
40845         }
40846     }
40847     function_tests++;
40848 #endif
40849 
40850     return(test_ret);
40851 }
40852 
40853 
40854 static int
test_xmlUCSIsLatinExtendedB(void)40855 test_xmlUCSIsLatinExtendedB(void) {
40856     int test_ret = 0;
40857 
40858 #if defined(LIBXML_UNICODE_ENABLED)
40859     int mem_base;
40860     int ret_val;
40861     int code; /* UCS code point */
40862     int n_code;
40863 
40864     for (n_code = 0;n_code < gen_nb_int;n_code++) {
40865         mem_base = xmlMemBlocks();
40866         code = gen_int(n_code, 0);
40867 
40868         ret_val = xmlUCSIsLatinExtendedB(code);
40869         desret_int(ret_val);
40870         call_tests++;
40871         des_int(n_code, code, 0);
40872         xmlResetLastError();
40873         if (mem_base != xmlMemBlocks()) {
40874             printf("Leak of %d blocks found in xmlUCSIsLatinExtendedB",
40875 	           xmlMemBlocks() - mem_base);
40876 	    test_ret++;
40877             printf(" %d", n_code);
40878             printf("\n");
40879         }
40880     }
40881     function_tests++;
40882 #endif
40883 
40884     return(test_ret);
40885 }
40886 
40887 
40888 static int
test_xmlUCSIsLetterlikeSymbols(void)40889 test_xmlUCSIsLetterlikeSymbols(void) {
40890     int test_ret = 0;
40891 
40892 #if defined(LIBXML_UNICODE_ENABLED)
40893     int mem_base;
40894     int ret_val;
40895     int code; /* UCS code point */
40896     int n_code;
40897 
40898     for (n_code = 0;n_code < gen_nb_int;n_code++) {
40899         mem_base = xmlMemBlocks();
40900         code = gen_int(n_code, 0);
40901 
40902         ret_val = xmlUCSIsLetterlikeSymbols(code);
40903         desret_int(ret_val);
40904         call_tests++;
40905         des_int(n_code, code, 0);
40906         xmlResetLastError();
40907         if (mem_base != xmlMemBlocks()) {
40908             printf("Leak of %d blocks found in xmlUCSIsLetterlikeSymbols",
40909 	           xmlMemBlocks() - mem_base);
40910 	    test_ret++;
40911             printf(" %d", n_code);
40912             printf("\n");
40913         }
40914     }
40915     function_tests++;
40916 #endif
40917 
40918     return(test_ret);
40919 }
40920 
40921 
40922 static int
test_xmlUCSIsLimbu(void)40923 test_xmlUCSIsLimbu(void) {
40924     int test_ret = 0;
40925 
40926 #if defined(LIBXML_UNICODE_ENABLED)
40927     int mem_base;
40928     int ret_val;
40929     int code; /* UCS code point */
40930     int n_code;
40931 
40932     for (n_code = 0;n_code < gen_nb_int;n_code++) {
40933         mem_base = xmlMemBlocks();
40934         code = gen_int(n_code, 0);
40935 
40936         ret_val = xmlUCSIsLimbu(code);
40937         desret_int(ret_val);
40938         call_tests++;
40939         des_int(n_code, code, 0);
40940         xmlResetLastError();
40941         if (mem_base != xmlMemBlocks()) {
40942             printf("Leak of %d blocks found in xmlUCSIsLimbu",
40943 	           xmlMemBlocks() - mem_base);
40944 	    test_ret++;
40945             printf(" %d", n_code);
40946             printf("\n");
40947         }
40948     }
40949     function_tests++;
40950 #endif
40951 
40952     return(test_ret);
40953 }
40954 
40955 
40956 static int
test_xmlUCSIsLinearBIdeograms(void)40957 test_xmlUCSIsLinearBIdeograms(void) {
40958     int test_ret = 0;
40959 
40960 #if defined(LIBXML_UNICODE_ENABLED)
40961     int mem_base;
40962     int ret_val;
40963     int code; /* UCS code point */
40964     int n_code;
40965 
40966     for (n_code = 0;n_code < gen_nb_int;n_code++) {
40967         mem_base = xmlMemBlocks();
40968         code = gen_int(n_code, 0);
40969 
40970         ret_val = xmlUCSIsLinearBIdeograms(code);
40971         desret_int(ret_val);
40972         call_tests++;
40973         des_int(n_code, code, 0);
40974         xmlResetLastError();
40975         if (mem_base != xmlMemBlocks()) {
40976             printf("Leak of %d blocks found in xmlUCSIsLinearBIdeograms",
40977 	           xmlMemBlocks() - mem_base);
40978 	    test_ret++;
40979             printf(" %d", n_code);
40980             printf("\n");
40981         }
40982     }
40983     function_tests++;
40984 #endif
40985 
40986     return(test_ret);
40987 }
40988 
40989 
40990 static int
test_xmlUCSIsLinearBSyllabary(void)40991 test_xmlUCSIsLinearBSyllabary(void) {
40992     int test_ret = 0;
40993 
40994 #if defined(LIBXML_UNICODE_ENABLED)
40995     int mem_base;
40996     int ret_val;
40997     int code; /* UCS code point */
40998     int n_code;
40999 
41000     for (n_code = 0;n_code < gen_nb_int;n_code++) {
41001         mem_base = xmlMemBlocks();
41002         code = gen_int(n_code, 0);
41003 
41004         ret_val = xmlUCSIsLinearBSyllabary(code);
41005         desret_int(ret_val);
41006         call_tests++;
41007         des_int(n_code, code, 0);
41008         xmlResetLastError();
41009         if (mem_base != xmlMemBlocks()) {
41010             printf("Leak of %d blocks found in xmlUCSIsLinearBSyllabary",
41011 	           xmlMemBlocks() - mem_base);
41012 	    test_ret++;
41013             printf(" %d", n_code);
41014             printf("\n");
41015         }
41016     }
41017     function_tests++;
41018 #endif
41019 
41020     return(test_ret);
41021 }
41022 
41023 
41024 static int
test_xmlUCSIsLowSurrogates(void)41025 test_xmlUCSIsLowSurrogates(void) {
41026     int test_ret = 0;
41027 
41028 #if defined(LIBXML_UNICODE_ENABLED)
41029     int mem_base;
41030     int ret_val;
41031     int code; /* UCS code point */
41032     int n_code;
41033 
41034     for (n_code = 0;n_code < gen_nb_int;n_code++) {
41035         mem_base = xmlMemBlocks();
41036         code = gen_int(n_code, 0);
41037 
41038         ret_val = xmlUCSIsLowSurrogates(code);
41039         desret_int(ret_val);
41040         call_tests++;
41041         des_int(n_code, code, 0);
41042         xmlResetLastError();
41043         if (mem_base != xmlMemBlocks()) {
41044             printf("Leak of %d blocks found in xmlUCSIsLowSurrogates",
41045 	           xmlMemBlocks() - mem_base);
41046 	    test_ret++;
41047             printf(" %d", n_code);
41048             printf("\n");
41049         }
41050     }
41051     function_tests++;
41052 #endif
41053 
41054     return(test_ret);
41055 }
41056 
41057 
41058 static int
test_xmlUCSIsMalayalam(void)41059 test_xmlUCSIsMalayalam(void) {
41060     int test_ret = 0;
41061 
41062 #if defined(LIBXML_UNICODE_ENABLED)
41063     int mem_base;
41064     int ret_val;
41065     int code; /* UCS code point */
41066     int n_code;
41067 
41068     for (n_code = 0;n_code < gen_nb_int;n_code++) {
41069         mem_base = xmlMemBlocks();
41070         code = gen_int(n_code, 0);
41071 
41072         ret_val = xmlUCSIsMalayalam(code);
41073         desret_int(ret_val);
41074         call_tests++;
41075         des_int(n_code, code, 0);
41076         xmlResetLastError();
41077         if (mem_base != xmlMemBlocks()) {
41078             printf("Leak of %d blocks found in xmlUCSIsMalayalam",
41079 	           xmlMemBlocks() - mem_base);
41080 	    test_ret++;
41081             printf(" %d", n_code);
41082             printf("\n");
41083         }
41084     }
41085     function_tests++;
41086 #endif
41087 
41088     return(test_ret);
41089 }
41090 
41091 
41092 static int
test_xmlUCSIsMathematicalAlphanumericSymbols(void)41093 test_xmlUCSIsMathematicalAlphanumericSymbols(void) {
41094     int test_ret = 0;
41095 
41096 #if defined(LIBXML_UNICODE_ENABLED)
41097     int mem_base;
41098     int ret_val;
41099     int code; /* UCS code point */
41100     int n_code;
41101 
41102     for (n_code = 0;n_code < gen_nb_int;n_code++) {
41103         mem_base = xmlMemBlocks();
41104         code = gen_int(n_code, 0);
41105 
41106         ret_val = xmlUCSIsMathematicalAlphanumericSymbols(code);
41107         desret_int(ret_val);
41108         call_tests++;
41109         des_int(n_code, code, 0);
41110         xmlResetLastError();
41111         if (mem_base != xmlMemBlocks()) {
41112             printf("Leak of %d blocks found in xmlUCSIsMathematicalAlphanumericSymbols",
41113 	           xmlMemBlocks() - mem_base);
41114 	    test_ret++;
41115             printf(" %d", n_code);
41116             printf("\n");
41117         }
41118     }
41119     function_tests++;
41120 #endif
41121 
41122     return(test_ret);
41123 }
41124 
41125 
41126 static int
test_xmlUCSIsMathematicalOperators(void)41127 test_xmlUCSIsMathematicalOperators(void) {
41128     int test_ret = 0;
41129 
41130 #if defined(LIBXML_UNICODE_ENABLED)
41131     int mem_base;
41132     int ret_val;
41133     int code; /* UCS code point */
41134     int n_code;
41135 
41136     for (n_code = 0;n_code < gen_nb_int;n_code++) {
41137         mem_base = xmlMemBlocks();
41138         code = gen_int(n_code, 0);
41139 
41140         ret_val = xmlUCSIsMathematicalOperators(code);
41141         desret_int(ret_val);
41142         call_tests++;
41143         des_int(n_code, code, 0);
41144         xmlResetLastError();
41145         if (mem_base != xmlMemBlocks()) {
41146             printf("Leak of %d blocks found in xmlUCSIsMathematicalOperators",
41147 	           xmlMemBlocks() - mem_base);
41148 	    test_ret++;
41149             printf(" %d", n_code);
41150             printf("\n");
41151         }
41152     }
41153     function_tests++;
41154 #endif
41155 
41156     return(test_ret);
41157 }
41158 
41159 
41160 static int
test_xmlUCSIsMiscellaneousMathematicalSymbolsA(void)41161 test_xmlUCSIsMiscellaneousMathematicalSymbolsA(void) {
41162     int test_ret = 0;
41163 
41164 #if defined(LIBXML_UNICODE_ENABLED)
41165     int mem_base;
41166     int ret_val;
41167     int code; /* UCS code point */
41168     int n_code;
41169 
41170     for (n_code = 0;n_code < gen_nb_int;n_code++) {
41171         mem_base = xmlMemBlocks();
41172         code = gen_int(n_code, 0);
41173 
41174         ret_val = xmlUCSIsMiscellaneousMathematicalSymbolsA(code);
41175         desret_int(ret_val);
41176         call_tests++;
41177         des_int(n_code, code, 0);
41178         xmlResetLastError();
41179         if (mem_base != xmlMemBlocks()) {
41180             printf("Leak of %d blocks found in xmlUCSIsMiscellaneousMathematicalSymbolsA",
41181 	           xmlMemBlocks() - mem_base);
41182 	    test_ret++;
41183             printf(" %d", n_code);
41184             printf("\n");
41185         }
41186     }
41187     function_tests++;
41188 #endif
41189 
41190     return(test_ret);
41191 }
41192 
41193 
41194 static int
test_xmlUCSIsMiscellaneousMathematicalSymbolsB(void)41195 test_xmlUCSIsMiscellaneousMathematicalSymbolsB(void) {
41196     int test_ret = 0;
41197 
41198 #if defined(LIBXML_UNICODE_ENABLED)
41199     int mem_base;
41200     int ret_val;
41201     int code; /* UCS code point */
41202     int n_code;
41203 
41204     for (n_code = 0;n_code < gen_nb_int;n_code++) {
41205         mem_base = xmlMemBlocks();
41206         code = gen_int(n_code, 0);
41207 
41208         ret_val = xmlUCSIsMiscellaneousMathematicalSymbolsB(code);
41209         desret_int(ret_val);
41210         call_tests++;
41211         des_int(n_code, code, 0);
41212         xmlResetLastError();
41213         if (mem_base != xmlMemBlocks()) {
41214             printf("Leak of %d blocks found in xmlUCSIsMiscellaneousMathematicalSymbolsB",
41215 	           xmlMemBlocks() - mem_base);
41216 	    test_ret++;
41217             printf(" %d", n_code);
41218             printf("\n");
41219         }
41220     }
41221     function_tests++;
41222 #endif
41223 
41224     return(test_ret);
41225 }
41226 
41227 
41228 static int
test_xmlUCSIsMiscellaneousSymbols(void)41229 test_xmlUCSIsMiscellaneousSymbols(void) {
41230     int test_ret = 0;
41231 
41232 #if defined(LIBXML_UNICODE_ENABLED)
41233     int mem_base;
41234     int ret_val;
41235     int code; /* UCS code point */
41236     int n_code;
41237 
41238     for (n_code = 0;n_code < gen_nb_int;n_code++) {
41239         mem_base = xmlMemBlocks();
41240         code = gen_int(n_code, 0);
41241 
41242         ret_val = xmlUCSIsMiscellaneousSymbols(code);
41243         desret_int(ret_val);
41244         call_tests++;
41245         des_int(n_code, code, 0);
41246         xmlResetLastError();
41247         if (mem_base != xmlMemBlocks()) {
41248             printf("Leak of %d blocks found in xmlUCSIsMiscellaneousSymbols",
41249 	           xmlMemBlocks() - mem_base);
41250 	    test_ret++;
41251             printf(" %d", n_code);
41252             printf("\n");
41253         }
41254     }
41255     function_tests++;
41256 #endif
41257 
41258     return(test_ret);
41259 }
41260 
41261 
41262 static int
test_xmlUCSIsMiscellaneousSymbolsandArrows(void)41263 test_xmlUCSIsMiscellaneousSymbolsandArrows(void) {
41264     int test_ret = 0;
41265 
41266 #if defined(LIBXML_UNICODE_ENABLED)
41267     int mem_base;
41268     int ret_val;
41269     int code; /* UCS code point */
41270     int n_code;
41271 
41272     for (n_code = 0;n_code < gen_nb_int;n_code++) {
41273         mem_base = xmlMemBlocks();
41274         code = gen_int(n_code, 0);
41275 
41276         ret_val = xmlUCSIsMiscellaneousSymbolsandArrows(code);
41277         desret_int(ret_val);
41278         call_tests++;
41279         des_int(n_code, code, 0);
41280         xmlResetLastError();
41281         if (mem_base != xmlMemBlocks()) {
41282             printf("Leak of %d blocks found in xmlUCSIsMiscellaneousSymbolsandArrows",
41283 	           xmlMemBlocks() - mem_base);
41284 	    test_ret++;
41285             printf(" %d", n_code);
41286             printf("\n");
41287         }
41288     }
41289     function_tests++;
41290 #endif
41291 
41292     return(test_ret);
41293 }
41294 
41295 
41296 static int
test_xmlUCSIsMiscellaneousTechnical(void)41297 test_xmlUCSIsMiscellaneousTechnical(void) {
41298     int test_ret = 0;
41299 
41300 #if defined(LIBXML_UNICODE_ENABLED)
41301     int mem_base;
41302     int ret_val;
41303     int code; /* UCS code point */
41304     int n_code;
41305 
41306     for (n_code = 0;n_code < gen_nb_int;n_code++) {
41307         mem_base = xmlMemBlocks();
41308         code = gen_int(n_code, 0);
41309 
41310         ret_val = xmlUCSIsMiscellaneousTechnical(code);
41311         desret_int(ret_val);
41312         call_tests++;
41313         des_int(n_code, code, 0);
41314         xmlResetLastError();
41315         if (mem_base != xmlMemBlocks()) {
41316             printf("Leak of %d blocks found in xmlUCSIsMiscellaneousTechnical",
41317 	           xmlMemBlocks() - mem_base);
41318 	    test_ret++;
41319             printf(" %d", n_code);
41320             printf("\n");
41321         }
41322     }
41323     function_tests++;
41324 #endif
41325 
41326     return(test_ret);
41327 }
41328 
41329 
41330 static int
test_xmlUCSIsMongolian(void)41331 test_xmlUCSIsMongolian(void) {
41332     int test_ret = 0;
41333 
41334 #if defined(LIBXML_UNICODE_ENABLED)
41335     int mem_base;
41336     int ret_val;
41337     int code; /* UCS code point */
41338     int n_code;
41339 
41340     for (n_code = 0;n_code < gen_nb_int;n_code++) {
41341         mem_base = xmlMemBlocks();
41342         code = gen_int(n_code, 0);
41343 
41344         ret_val = xmlUCSIsMongolian(code);
41345         desret_int(ret_val);
41346         call_tests++;
41347         des_int(n_code, code, 0);
41348         xmlResetLastError();
41349         if (mem_base != xmlMemBlocks()) {
41350             printf("Leak of %d blocks found in xmlUCSIsMongolian",
41351 	           xmlMemBlocks() - mem_base);
41352 	    test_ret++;
41353             printf(" %d", n_code);
41354             printf("\n");
41355         }
41356     }
41357     function_tests++;
41358 #endif
41359 
41360     return(test_ret);
41361 }
41362 
41363 
41364 static int
test_xmlUCSIsMusicalSymbols(void)41365 test_xmlUCSIsMusicalSymbols(void) {
41366     int test_ret = 0;
41367 
41368 #if defined(LIBXML_UNICODE_ENABLED)
41369     int mem_base;
41370     int ret_val;
41371     int code; /* UCS code point */
41372     int n_code;
41373 
41374     for (n_code = 0;n_code < gen_nb_int;n_code++) {
41375         mem_base = xmlMemBlocks();
41376         code = gen_int(n_code, 0);
41377 
41378         ret_val = xmlUCSIsMusicalSymbols(code);
41379         desret_int(ret_val);
41380         call_tests++;
41381         des_int(n_code, code, 0);
41382         xmlResetLastError();
41383         if (mem_base != xmlMemBlocks()) {
41384             printf("Leak of %d blocks found in xmlUCSIsMusicalSymbols",
41385 	           xmlMemBlocks() - mem_base);
41386 	    test_ret++;
41387             printf(" %d", n_code);
41388             printf("\n");
41389         }
41390     }
41391     function_tests++;
41392 #endif
41393 
41394     return(test_ret);
41395 }
41396 
41397 
41398 static int
test_xmlUCSIsMyanmar(void)41399 test_xmlUCSIsMyanmar(void) {
41400     int test_ret = 0;
41401 
41402 #if defined(LIBXML_UNICODE_ENABLED)
41403     int mem_base;
41404     int ret_val;
41405     int code; /* UCS code point */
41406     int n_code;
41407 
41408     for (n_code = 0;n_code < gen_nb_int;n_code++) {
41409         mem_base = xmlMemBlocks();
41410         code = gen_int(n_code, 0);
41411 
41412         ret_val = xmlUCSIsMyanmar(code);
41413         desret_int(ret_val);
41414         call_tests++;
41415         des_int(n_code, code, 0);
41416         xmlResetLastError();
41417         if (mem_base != xmlMemBlocks()) {
41418             printf("Leak of %d blocks found in xmlUCSIsMyanmar",
41419 	           xmlMemBlocks() - mem_base);
41420 	    test_ret++;
41421             printf(" %d", n_code);
41422             printf("\n");
41423         }
41424     }
41425     function_tests++;
41426 #endif
41427 
41428     return(test_ret);
41429 }
41430 
41431 
41432 static int
test_xmlUCSIsNumberForms(void)41433 test_xmlUCSIsNumberForms(void) {
41434     int test_ret = 0;
41435 
41436 #if defined(LIBXML_UNICODE_ENABLED)
41437     int mem_base;
41438     int ret_val;
41439     int code; /* UCS code point */
41440     int n_code;
41441 
41442     for (n_code = 0;n_code < gen_nb_int;n_code++) {
41443         mem_base = xmlMemBlocks();
41444         code = gen_int(n_code, 0);
41445 
41446         ret_val = xmlUCSIsNumberForms(code);
41447         desret_int(ret_val);
41448         call_tests++;
41449         des_int(n_code, code, 0);
41450         xmlResetLastError();
41451         if (mem_base != xmlMemBlocks()) {
41452             printf("Leak of %d blocks found in xmlUCSIsNumberForms",
41453 	           xmlMemBlocks() - mem_base);
41454 	    test_ret++;
41455             printf(" %d", n_code);
41456             printf("\n");
41457         }
41458     }
41459     function_tests++;
41460 #endif
41461 
41462     return(test_ret);
41463 }
41464 
41465 
41466 static int
test_xmlUCSIsOgham(void)41467 test_xmlUCSIsOgham(void) {
41468     int test_ret = 0;
41469 
41470 #if defined(LIBXML_UNICODE_ENABLED)
41471     int mem_base;
41472     int ret_val;
41473     int code; /* UCS code point */
41474     int n_code;
41475 
41476     for (n_code = 0;n_code < gen_nb_int;n_code++) {
41477         mem_base = xmlMemBlocks();
41478         code = gen_int(n_code, 0);
41479 
41480         ret_val = xmlUCSIsOgham(code);
41481         desret_int(ret_val);
41482         call_tests++;
41483         des_int(n_code, code, 0);
41484         xmlResetLastError();
41485         if (mem_base != xmlMemBlocks()) {
41486             printf("Leak of %d blocks found in xmlUCSIsOgham",
41487 	           xmlMemBlocks() - mem_base);
41488 	    test_ret++;
41489             printf(" %d", n_code);
41490             printf("\n");
41491         }
41492     }
41493     function_tests++;
41494 #endif
41495 
41496     return(test_ret);
41497 }
41498 
41499 
41500 static int
test_xmlUCSIsOldItalic(void)41501 test_xmlUCSIsOldItalic(void) {
41502     int test_ret = 0;
41503 
41504 #if defined(LIBXML_UNICODE_ENABLED)
41505     int mem_base;
41506     int ret_val;
41507     int code; /* UCS code point */
41508     int n_code;
41509 
41510     for (n_code = 0;n_code < gen_nb_int;n_code++) {
41511         mem_base = xmlMemBlocks();
41512         code = gen_int(n_code, 0);
41513 
41514         ret_val = xmlUCSIsOldItalic(code);
41515         desret_int(ret_val);
41516         call_tests++;
41517         des_int(n_code, code, 0);
41518         xmlResetLastError();
41519         if (mem_base != xmlMemBlocks()) {
41520             printf("Leak of %d blocks found in xmlUCSIsOldItalic",
41521 	           xmlMemBlocks() - mem_base);
41522 	    test_ret++;
41523             printf(" %d", n_code);
41524             printf("\n");
41525         }
41526     }
41527     function_tests++;
41528 #endif
41529 
41530     return(test_ret);
41531 }
41532 
41533 
41534 static int
test_xmlUCSIsOpticalCharacterRecognition(void)41535 test_xmlUCSIsOpticalCharacterRecognition(void) {
41536     int test_ret = 0;
41537 
41538 #if defined(LIBXML_UNICODE_ENABLED)
41539     int mem_base;
41540     int ret_val;
41541     int code; /* UCS code point */
41542     int n_code;
41543 
41544     for (n_code = 0;n_code < gen_nb_int;n_code++) {
41545         mem_base = xmlMemBlocks();
41546         code = gen_int(n_code, 0);
41547 
41548         ret_val = xmlUCSIsOpticalCharacterRecognition(code);
41549         desret_int(ret_val);
41550         call_tests++;
41551         des_int(n_code, code, 0);
41552         xmlResetLastError();
41553         if (mem_base != xmlMemBlocks()) {
41554             printf("Leak of %d blocks found in xmlUCSIsOpticalCharacterRecognition",
41555 	           xmlMemBlocks() - mem_base);
41556 	    test_ret++;
41557             printf(" %d", n_code);
41558             printf("\n");
41559         }
41560     }
41561     function_tests++;
41562 #endif
41563 
41564     return(test_ret);
41565 }
41566 
41567 
41568 static int
test_xmlUCSIsOriya(void)41569 test_xmlUCSIsOriya(void) {
41570     int test_ret = 0;
41571 
41572 #if defined(LIBXML_UNICODE_ENABLED)
41573     int mem_base;
41574     int ret_val;
41575     int code; /* UCS code point */
41576     int n_code;
41577 
41578     for (n_code = 0;n_code < gen_nb_int;n_code++) {
41579         mem_base = xmlMemBlocks();
41580         code = gen_int(n_code, 0);
41581 
41582         ret_val = xmlUCSIsOriya(code);
41583         desret_int(ret_val);
41584         call_tests++;
41585         des_int(n_code, code, 0);
41586         xmlResetLastError();
41587         if (mem_base != xmlMemBlocks()) {
41588             printf("Leak of %d blocks found in xmlUCSIsOriya",
41589 	           xmlMemBlocks() - mem_base);
41590 	    test_ret++;
41591             printf(" %d", n_code);
41592             printf("\n");
41593         }
41594     }
41595     function_tests++;
41596 #endif
41597 
41598     return(test_ret);
41599 }
41600 
41601 
41602 static int
test_xmlUCSIsOsmanya(void)41603 test_xmlUCSIsOsmanya(void) {
41604     int test_ret = 0;
41605 
41606 #if defined(LIBXML_UNICODE_ENABLED)
41607     int mem_base;
41608     int ret_val;
41609     int code; /* UCS code point */
41610     int n_code;
41611 
41612     for (n_code = 0;n_code < gen_nb_int;n_code++) {
41613         mem_base = xmlMemBlocks();
41614         code = gen_int(n_code, 0);
41615 
41616         ret_val = xmlUCSIsOsmanya(code);
41617         desret_int(ret_val);
41618         call_tests++;
41619         des_int(n_code, code, 0);
41620         xmlResetLastError();
41621         if (mem_base != xmlMemBlocks()) {
41622             printf("Leak of %d blocks found in xmlUCSIsOsmanya",
41623 	           xmlMemBlocks() - mem_base);
41624 	    test_ret++;
41625             printf(" %d", n_code);
41626             printf("\n");
41627         }
41628     }
41629     function_tests++;
41630 #endif
41631 
41632     return(test_ret);
41633 }
41634 
41635 
41636 static int
test_xmlUCSIsPhoneticExtensions(void)41637 test_xmlUCSIsPhoneticExtensions(void) {
41638     int test_ret = 0;
41639 
41640 #if defined(LIBXML_UNICODE_ENABLED)
41641     int mem_base;
41642     int ret_val;
41643     int code; /* UCS code point */
41644     int n_code;
41645 
41646     for (n_code = 0;n_code < gen_nb_int;n_code++) {
41647         mem_base = xmlMemBlocks();
41648         code = gen_int(n_code, 0);
41649 
41650         ret_val = xmlUCSIsPhoneticExtensions(code);
41651         desret_int(ret_val);
41652         call_tests++;
41653         des_int(n_code, code, 0);
41654         xmlResetLastError();
41655         if (mem_base != xmlMemBlocks()) {
41656             printf("Leak of %d blocks found in xmlUCSIsPhoneticExtensions",
41657 	           xmlMemBlocks() - mem_base);
41658 	    test_ret++;
41659             printf(" %d", n_code);
41660             printf("\n");
41661         }
41662     }
41663     function_tests++;
41664 #endif
41665 
41666     return(test_ret);
41667 }
41668 
41669 
41670 static int
test_xmlUCSIsPrivateUse(void)41671 test_xmlUCSIsPrivateUse(void) {
41672     int test_ret = 0;
41673 
41674 #if defined(LIBXML_UNICODE_ENABLED)
41675     int mem_base;
41676     int ret_val;
41677     int code; /* UCS code point */
41678     int n_code;
41679 
41680     for (n_code = 0;n_code < gen_nb_int;n_code++) {
41681         mem_base = xmlMemBlocks();
41682         code = gen_int(n_code, 0);
41683 
41684         ret_val = xmlUCSIsPrivateUse(code);
41685         desret_int(ret_val);
41686         call_tests++;
41687         des_int(n_code, code, 0);
41688         xmlResetLastError();
41689         if (mem_base != xmlMemBlocks()) {
41690             printf("Leak of %d blocks found in xmlUCSIsPrivateUse",
41691 	           xmlMemBlocks() - mem_base);
41692 	    test_ret++;
41693             printf(" %d", n_code);
41694             printf("\n");
41695         }
41696     }
41697     function_tests++;
41698 #endif
41699 
41700     return(test_ret);
41701 }
41702 
41703 
41704 static int
test_xmlUCSIsPrivateUseArea(void)41705 test_xmlUCSIsPrivateUseArea(void) {
41706     int test_ret = 0;
41707 
41708 #if defined(LIBXML_UNICODE_ENABLED)
41709     int mem_base;
41710     int ret_val;
41711     int code; /* UCS code point */
41712     int n_code;
41713 
41714     for (n_code = 0;n_code < gen_nb_int;n_code++) {
41715         mem_base = xmlMemBlocks();
41716         code = gen_int(n_code, 0);
41717 
41718         ret_val = xmlUCSIsPrivateUseArea(code);
41719         desret_int(ret_val);
41720         call_tests++;
41721         des_int(n_code, code, 0);
41722         xmlResetLastError();
41723         if (mem_base != xmlMemBlocks()) {
41724             printf("Leak of %d blocks found in xmlUCSIsPrivateUseArea",
41725 	           xmlMemBlocks() - mem_base);
41726 	    test_ret++;
41727             printf(" %d", n_code);
41728             printf("\n");
41729         }
41730     }
41731     function_tests++;
41732 #endif
41733 
41734     return(test_ret);
41735 }
41736 
41737 
41738 static int
test_xmlUCSIsRunic(void)41739 test_xmlUCSIsRunic(void) {
41740     int test_ret = 0;
41741 
41742 #if defined(LIBXML_UNICODE_ENABLED)
41743     int mem_base;
41744     int ret_val;
41745     int code; /* UCS code point */
41746     int n_code;
41747 
41748     for (n_code = 0;n_code < gen_nb_int;n_code++) {
41749         mem_base = xmlMemBlocks();
41750         code = gen_int(n_code, 0);
41751 
41752         ret_val = xmlUCSIsRunic(code);
41753         desret_int(ret_val);
41754         call_tests++;
41755         des_int(n_code, code, 0);
41756         xmlResetLastError();
41757         if (mem_base != xmlMemBlocks()) {
41758             printf("Leak of %d blocks found in xmlUCSIsRunic",
41759 	           xmlMemBlocks() - mem_base);
41760 	    test_ret++;
41761             printf(" %d", n_code);
41762             printf("\n");
41763         }
41764     }
41765     function_tests++;
41766 #endif
41767 
41768     return(test_ret);
41769 }
41770 
41771 
41772 static int
test_xmlUCSIsShavian(void)41773 test_xmlUCSIsShavian(void) {
41774     int test_ret = 0;
41775 
41776 #if defined(LIBXML_UNICODE_ENABLED)
41777     int mem_base;
41778     int ret_val;
41779     int code; /* UCS code point */
41780     int n_code;
41781 
41782     for (n_code = 0;n_code < gen_nb_int;n_code++) {
41783         mem_base = xmlMemBlocks();
41784         code = gen_int(n_code, 0);
41785 
41786         ret_val = xmlUCSIsShavian(code);
41787         desret_int(ret_val);
41788         call_tests++;
41789         des_int(n_code, code, 0);
41790         xmlResetLastError();
41791         if (mem_base != xmlMemBlocks()) {
41792             printf("Leak of %d blocks found in xmlUCSIsShavian",
41793 	           xmlMemBlocks() - mem_base);
41794 	    test_ret++;
41795             printf(" %d", n_code);
41796             printf("\n");
41797         }
41798     }
41799     function_tests++;
41800 #endif
41801 
41802     return(test_ret);
41803 }
41804 
41805 
41806 static int
test_xmlUCSIsSinhala(void)41807 test_xmlUCSIsSinhala(void) {
41808     int test_ret = 0;
41809 
41810 #if defined(LIBXML_UNICODE_ENABLED)
41811     int mem_base;
41812     int ret_val;
41813     int code; /* UCS code point */
41814     int n_code;
41815 
41816     for (n_code = 0;n_code < gen_nb_int;n_code++) {
41817         mem_base = xmlMemBlocks();
41818         code = gen_int(n_code, 0);
41819 
41820         ret_val = xmlUCSIsSinhala(code);
41821         desret_int(ret_val);
41822         call_tests++;
41823         des_int(n_code, code, 0);
41824         xmlResetLastError();
41825         if (mem_base != xmlMemBlocks()) {
41826             printf("Leak of %d blocks found in xmlUCSIsSinhala",
41827 	           xmlMemBlocks() - mem_base);
41828 	    test_ret++;
41829             printf(" %d", n_code);
41830             printf("\n");
41831         }
41832     }
41833     function_tests++;
41834 #endif
41835 
41836     return(test_ret);
41837 }
41838 
41839 
41840 static int
test_xmlUCSIsSmallFormVariants(void)41841 test_xmlUCSIsSmallFormVariants(void) {
41842     int test_ret = 0;
41843 
41844 #if defined(LIBXML_UNICODE_ENABLED)
41845     int mem_base;
41846     int ret_val;
41847     int code; /* UCS code point */
41848     int n_code;
41849 
41850     for (n_code = 0;n_code < gen_nb_int;n_code++) {
41851         mem_base = xmlMemBlocks();
41852         code = gen_int(n_code, 0);
41853 
41854         ret_val = xmlUCSIsSmallFormVariants(code);
41855         desret_int(ret_val);
41856         call_tests++;
41857         des_int(n_code, code, 0);
41858         xmlResetLastError();
41859         if (mem_base != xmlMemBlocks()) {
41860             printf("Leak of %d blocks found in xmlUCSIsSmallFormVariants",
41861 	           xmlMemBlocks() - mem_base);
41862 	    test_ret++;
41863             printf(" %d", n_code);
41864             printf("\n");
41865         }
41866     }
41867     function_tests++;
41868 #endif
41869 
41870     return(test_ret);
41871 }
41872 
41873 
41874 static int
test_xmlUCSIsSpacingModifierLetters(void)41875 test_xmlUCSIsSpacingModifierLetters(void) {
41876     int test_ret = 0;
41877 
41878 #if defined(LIBXML_UNICODE_ENABLED)
41879     int mem_base;
41880     int ret_val;
41881     int code; /* UCS code point */
41882     int n_code;
41883 
41884     for (n_code = 0;n_code < gen_nb_int;n_code++) {
41885         mem_base = xmlMemBlocks();
41886         code = gen_int(n_code, 0);
41887 
41888         ret_val = xmlUCSIsSpacingModifierLetters(code);
41889         desret_int(ret_val);
41890         call_tests++;
41891         des_int(n_code, code, 0);
41892         xmlResetLastError();
41893         if (mem_base != xmlMemBlocks()) {
41894             printf("Leak of %d blocks found in xmlUCSIsSpacingModifierLetters",
41895 	           xmlMemBlocks() - mem_base);
41896 	    test_ret++;
41897             printf(" %d", n_code);
41898             printf("\n");
41899         }
41900     }
41901     function_tests++;
41902 #endif
41903 
41904     return(test_ret);
41905 }
41906 
41907 
41908 static int
test_xmlUCSIsSpecials(void)41909 test_xmlUCSIsSpecials(void) {
41910     int test_ret = 0;
41911 
41912 #if defined(LIBXML_UNICODE_ENABLED)
41913     int mem_base;
41914     int ret_val;
41915     int code; /* UCS code point */
41916     int n_code;
41917 
41918     for (n_code = 0;n_code < gen_nb_int;n_code++) {
41919         mem_base = xmlMemBlocks();
41920         code = gen_int(n_code, 0);
41921 
41922         ret_val = xmlUCSIsSpecials(code);
41923         desret_int(ret_val);
41924         call_tests++;
41925         des_int(n_code, code, 0);
41926         xmlResetLastError();
41927         if (mem_base != xmlMemBlocks()) {
41928             printf("Leak of %d blocks found in xmlUCSIsSpecials",
41929 	           xmlMemBlocks() - mem_base);
41930 	    test_ret++;
41931             printf(" %d", n_code);
41932             printf("\n");
41933         }
41934     }
41935     function_tests++;
41936 #endif
41937 
41938     return(test_ret);
41939 }
41940 
41941 
41942 static int
test_xmlUCSIsSuperscriptsandSubscripts(void)41943 test_xmlUCSIsSuperscriptsandSubscripts(void) {
41944     int test_ret = 0;
41945 
41946 #if defined(LIBXML_UNICODE_ENABLED)
41947     int mem_base;
41948     int ret_val;
41949     int code; /* UCS code point */
41950     int n_code;
41951 
41952     for (n_code = 0;n_code < gen_nb_int;n_code++) {
41953         mem_base = xmlMemBlocks();
41954         code = gen_int(n_code, 0);
41955 
41956         ret_val = xmlUCSIsSuperscriptsandSubscripts(code);
41957         desret_int(ret_val);
41958         call_tests++;
41959         des_int(n_code, code, 0);
41960         xmlResetLastError();
41961         if (mem_base != xmlMemBlocks()) {
41962             printf("Leak of %d blocks found in xmlUCSIsSuperscriptsandSubscripts",
41963 	           xmlMemBlocks() - mem_base);
41964 	    test_ret++;
41965             printf(" %d", n_code);
41966             printf("\n");
41967         }
41968     }
41969     function_tests++;
41970 #endif
41971 
41972     return(test_ret);
41973 }
41974 
41975 
41976 static int
test_xmlUCSIsSupplementalArrowsA(void)41977 test_xmlUCSIsSupplementalArrowsA(void) {
41978     int test_ret = 0;
41979 
41980 #if defined(LIBXML_UNICODE_ENABLED)
41981     int mem_base;
41982     int ret_val;
41983     int code; /* UCS code point */
41984     int n_code;
41985 
41986     for (n_code = 0;n_code < gen_nb_int;n_code++) {
41987         mem_base = xmlMemBlocks();
41988         code = gen_int(n_code, 0);
41989 
41990         ret_val = xmlUCSIsSupplementalArrowsA(code);
41991         desret_int(ret_val);
41992         call_tests++;
41993         des_int(n_code, code, 0);
41994         xmlResetLastError();
41995         if (mem_base != xmlMemBlocks()) {
41996             printf("Leak of %d blocks found in xmlUCSIsSupplementalArrowsA",
41997 	           xmlMemBlocks() - mem_base);
41998 	    test_ret++;
41999             printf(" %d", n_code);
42000             printf("\n");
42001         }
42002     }
42003     function_tests++;
42004 #endif
42005 
42006     return(test_ret);
42007 }
42008 
42009 
42010 static int
test_xmlUCSIsSupplementalArrowsB(void)42011 test_xmlUCSIsSupplementalArrowsB(void) {
42012     int test_ret = 0;
42013 
42014 #if defined(LIBXML_UNICODE_ENABLED)
42015     int mem_base;
42016     int ret_val;
42017     int code; /* UCS code point */
42018     int n_code;
42019 
42020     for (n_code = 0;n_code < gen_nb_int;n_code++) {
42021         mem_base = xmlMemBlocks();
42022         code = gen_int(n_code, 0);
42023 
42024         ret_val = xmlUCSIsSupplementalArrowsB(code);
42025         desret_int(ret_val);
42026         call_tests++;
42027         des_int(n_code, code, 0);
42028         xmlResetLastError();
42029         if (mem_base != xmlMemBlocks()) {
42030             printf("Leak of %d blocks found in xmlUCSIsSupplementalArrowsB",
42031 	           xmlMemBlocks() - mem_base);
42032 	    test_ret++;
42033             printf(" %d", n_code);
42034             printf("\n");
42035         }
42036     }
42037     function_tests++;
42038 #endif
42039 
42040     return(test_ret);
42041 }
42042 
42043 
42044 static int
test_xmlUCSIsSupplementalMathematicalOperators(void)42045 test_xmlUCSIsSupplementalMathematicalOperators(void) {
42046     int test_ret = 0;
42047 
42048 #if defined(LIBXML_UNICODE_ENABLED)
42049     int mem_base;
42050     int ret_val;
42051     int code; /* UCS code point */
42052     int n_code;
42053 
42054     for (n_code = 0;n_code < gen_nb_int;n_code++) {
42055         mem_base = xmlMemBlocks();
42056         code = gen_int(n_code, 0);
42057 
42058         ret_val = xmlUCSIsSupplementalMathematicalOperators(code);
42059         desret_int(ret_val);
42060         call_tests++;
42061         des_int(n_code, code, 0);
42062         xmlResetLastError();
42063         if (mem_base != xmlMemBlocks()) {
42064             printf("Leak of %d blocks found in xmlUCSIsSupplementalMathematicalOperators",
42065 	           xmlMemBlocks() - mem_base);
42066 	    test_ret++;
42067             printf(" %d", n_code);
42068             printf("\n");
42069         }
42070     }
42071     function_tests++;
42072 #endif
42073 
42074     return(test_ret);
42075 }
42076 
42077 
42078 static int
test_xmlUCSIsSupplementaryPrivateUseAreaA(void)42079 test_xmlUCSIsSupplementaryPrivateUseAreaA(void) {
42080     int test_ret = 0;
42081 
42082 #if defined(LIBXML_UNICODE_ENABLED)
42083     int mem_base;
42084     int ret_val;
42085     int code; /* UCS code point */
42086     int n_code;
42087 
42088     for (n_code = 0;n_code < gen_nb_int;n_code++) {
42089         mem_base = xmlMemBlocks();
42090         code = gen_int(n_code, 0);
42091 
42092         ret_val = xmlUCSIsSupplementaryPrivateUseAreaA(code);
42093         desret_int(ret_val);
42094         call_tests++;
42095         des_int(n_code, code, 0);
42096         xmlResetLastError();
42097         if (mem_base != xmlMemBlocks()) {
42098             printf("Leak of %d blocks found in xmlUCSIsSupplementaryPrivateUseAreaA",
42099 	           xmlMemBlocks() - mem_base);
42100 	    test_ret++;
42101             printf(" %d", n_code);
42102             printf("\n");
42103         }
42104     }
42105     function_tests++;
42106 #endif
42107 
42108     return(test_ret);
42109 }
42110 
42111 
42112 static int
test_xmlUCSIsSupplementaryPrivateUseAreaB(void)42113 test_xmlUCSIsSupplementaryPrivateUseAreaB(void) {
42114     int test_ret = 0;
42115 
42116 #if defined(LIBXML_UNICODE_ENABLED)
42117     int mem_base;
42118     int ret_val;
42119     int code; /* UCS code point */
42120     int n_code;
42121 
42122     for (n_code = 0;n_code < gen_nb_int;n_code++) {
42123         mem_base = xmlMemBlocks();
42124         code = gen_int(n_code, 0);
42125 
42126         ret_val = xmlUCSIsSupplementaryPrivateUseAreaB(code);
42127         desret_int(ret_val);
42128         call_tests++;
42129         des_int(n_code, code, 0);
42130         xmlResetLastError();
42131         if (mem_base != xmlMemBlocks()) {
42132             printf("Leak of %d blocks found in xmlUCSIsSupplementaryPrivateUseAreaB",
42133 	           xmlMemBlocks() - mem_base);
42134 	    test_ret++;
42135             printf(" %d", n_code);
42136             printf("\n");
42137         }
42138     }
42139     function_tests++;
42140 #endif
42141 
42142     return(test_ret);
42143 }
42144 
42145 
42146 static int
test_xmlUCSIsSyriac(void)42147 test_xmlUCSIsSyriac(void) {
42148     int test_ret = 0;
42149 
42150 #if defined(LIBXML_UNICODE_ENABLED)
42151     int mem_base;
42152     int ret_val;
42153     int code; /* UCS code point */
42154     int n_code;
42155 
42156     for (n_code = 0;n_code < gen_nb_int;n_code++) {
42157         mem_base = xmlMemBlocks();
42158         code = gen_int(n_code, 0);
42159 
42160         ret_val = xmlUCSIsSyriac(code);
42161         desret_int(ret_val);
42162         call_tests++;
42163         des_int(n_code, code, 0);
42164         xmlResetLastError();
42165         if (mem_base != xmlMemBlocks()) {
42166             printf("Leak of %d blocks found in xmlUCSIsSyriac",
42167 	           xmlMemBlocks() - mem_base);
42168 	    test_ret++;
42169             printf(" %d", n_code);
42170             printf("\n");
42171         }
42172     }
42173     function_tests++;
42174 #endif
42175 
42176     return(test_ret);
42177 }
42178 
42179 
42180 static int
test_xmlUCSIsTagalog(void)42181 test_xmlUCSIsTagalog(void) {
42182     int test_ret = 0;
42183 
42184 #if defined(LIBXML_UNICODE_ENABLED)
42185     int mem_base;
42186     int ret_val;
42187     int code; /* UCS code point */
42188     int n_code;
42189 
42190     for (n_code = 0;n_code < gen_nb_int;n_code++) {
42191         mem_base = xmlMemBlocks();
42192         code = gen_int(n_code, 0);
42193 
42194         ret_val = xmlUCSIsTagalog(code);
42195         desret_int(ret_val);
42196         call_tests++;
42197         des_int(n_code, code, 0);
42198         xmlResetLastError();
42199         if (mem_base != xmlMemBlocks()) {
42200             printf("Leak of %d blocks found in xmlUCSIsTagalog",
42201 	           xmlMemBlocks() - mem_base);
42202 	    test_ret++;
42203             printf(" %d", n_code);
42204             printf("\n");
42205         }
42206     }
42207     function_tests++;
42208 #endif
42209 
42210     return(test_ret);
42211 }
42212 
42213 
42214 static int
test_xmlUCSIsTagbanwa(void)42215 test_xmlUCSIsTagbanwa(void) {
42216     int test_ret = 0;
42217 
42218 #if defined(LIBXML_UNICODE_ENABLED)
42219     int mem_base;
42220     int ret_val;
42221     int code; /* UCS code point */
42222     int n_code;
42223 
42224     for (n_code = 0;n_code < gen_nb_int;n_code++) {
42225         mem_base = xmlMemBlocks();
42226         code = gen_int(n_code, 0);
42227 
42228         ret_val = xmlUCSIsTagbanwa(code);
42229         desret_int(ret_val);
42230         call_tests++;
42231         des_int(n_code, code, 0);
42232         xmlResetLastError();
42233         if (mem_base != xmlMemBlocks()) {
42234             printf("Leak of %d blocks found in xmlUCSIsTagbanwa",
42235 	           xmlMemBlocks() - mem_base);
42236 	    test_ret++;
42237             printf(" %d", n_code);
42238             printf("\n");
42239         }
42240     }
42241     function_tests++;
42242 #endif
42243 
42244     return(test_ret);
42245 }
42246 
42247 
42248 static int
test_xmlUCSIsTags(void)42249 test_xmlUCSIsTags(void) {
42250     int test_ret = 0;
42251 
42252 #if defined(LIBXML_UNICODE_ENABLED)
42253     int mem_base;
42254     int ret_val;
42255     int code; /* UCS code point */
42256     int n_code;
42257 
42258     for (n_code = 0;n_code < gen_nb_int;n_code++) {
42259         mem_base = xmlMemBlocks();
42260         code = gen_int(n_code, 0);
42261 
42262         ret_val = xmlUCSIsTags(code);
42263         desret_int(ret_val);
42264         call_tests++;
42265         des_int(n_code, code, 0);
42266         xmlResetLastError();
42267         if (mem_base != xmlMemBlocks()) {
42268             printf("Leak of %d blocks found in xmlUCSIsTags",
42269 	           xmlMemBlocks() - mem_base);
42270 	    test_ret++;
42271             printf(" %d", n_code);
42272             printf("\n");
42273         }
42274     }
42275     function_tests++;
42276 #endif
42277 
42278     return(test_ret);
42279 }
42280 
42281 
42282 static int
test_xmlUCSIsTaiLe(void)42283 test_xmlUCSIsTaiLe(void) {
42284     int test_ret = 0;
42285 
42286 #if defined(LIBXML_UNICODE_ENABLED)
42287     int mem_base;
42288     int ret_val;
42289     int code; /* UCS code point */
42290     int n_code;
42291 
42292     for (n_code = 0;n_code < gen_nb_int;n_code++) {
42293         mem_base = xmlMemBlocks();
42294         code = gen_int(n_code, 0);
42295 
42296         ret_val = xmlUCSIsTaiLe(code);
42297         desret_int(ret_val);
42298         call_tests++;
42299         des_int(n_code, code, 0);
42300         xmlResetLastError();
42301         if (mem_base != xmlMemBlocks()) {
42302             printf("Leak of %d blocks found in xmlUCSIsTaiLe",
42303 	           xmlMemBlocks() - mem_base);
42304 	    test_ret++;
42305             printf(" %d", n_code);
42306             printf("\n");
42307         }
42308     }
42309     function_tests++;
42310 #endif
42311 
42312     return(test_ret);
42313 }
42314 
42315 
42316 static int
test_xmlUCSIsTaiXuanJingSymbols(void)42317 test_xmlUCSIsTaiXuanJingSymbols(void) {
42318     int test_ret = 0;
42319 
42320 #if defined(LIBXML_UNICODE_ENABLED)
42321     int mem_base;
42322     int ret_val;
42323     int code; /* UCS code point */
42324     int n_code;
42325 
42326     for (n_code = 0;n_code < gen_nb_int;n_code++) {
42327         mem_base = xmlMemBlocks();
42328         code = gen_int(n_code, 0);
42329 
42330         ret_val = xmlUCSIsTaiXuanJingSymbols(code);
42331         desret_int(ret_val);
42332         call_tests++;
42333         des_int(n_code, code, 0);
42334         xmlResetLastError();
42335         if (mem_base != xmlMemBlocks()) {
42336             printf("Leak of %d blocks found in xmlUCSIsTaiXuanJingSymbols",
42337 	           xmlMemBlocks() - mem_base);
42338 	    test_ret++;
42339             printf(" %d", n_code);
42340             printf("\n");
42341         }
42342     }
42343     function_tests++;
42344 #endif
42345 
42346     return(test_ret);
42347 }
42348 
42349 
42350 static int
test_xmlUCSIsTamil(void)42351 test_xmlUCSIsTamil(void) {
42352     int test_ret = 0;
42353 
42354 #if defined(LIBXML_UNICODE_ENABLED)
42355     int mem_base;
42356     int ret_val;
42357     int code; /* UCS code point */
42358     int n_code;
42359 
42360     for (n_code = 0;n_code < gen_nb_int;n_code++) {
42361         mem_base = xmlMemBlocks();
42362         code = gen_int(n_code, 0);
42363 
42364         ret_val = xmlUCSIsTamil(code);
42365         desret_int(ret_val);
42366         call_tests++;
42367         des_int(n_code, code, 0);
42368         xmlResetLastError();
42369         if (mem_base != xmlMemBlocks()) {
42370             printf("Leak of %d blocks found in xmlUCSIsTamil",
42371 	           xmlMemBlocks() - mem_base);
42372 	    test_ret++;
42373             printf(" %d", n_code);
42374             printf("\n");
42375         }
42376     }
42377     function_tests++;
42378 #endif
42379 
42380     return(test_ret);
42381 }
42382 
42383 
42384 static int
test_xmlUCSIsTelugu(void)42385 test_xmlUCSIsTelugu(void) {
42386     int test_ret = 0;
42387 
42388 #if defined(LIBXML_UNICODE_ENABLED)
42389     int mem_base;
42390     int ret_val;
42391     int code; /* UCS code point */
42392     int n_code;
42393 
42394     for (n_code = 0;n_code < gen_nb_int;n_code++) {
42395         mem_base = xmlMemBlocks();
42396         code = gen_int(n_code, 0);
42397 
42398         ret_val = xmlUCSIsTelugu(code);
42399         desret_int(ret_val);
42400         call_tests++;
42401         des_int(n_code, code, 0);
42402         xmlResetLastError();
42403         if (mem_base != xmlMemBlocks()) {
42404             printf("Leak of %d blocks found in xmlUCSIsTelugu",
42405 	           xmlMemBlocks() - mem_base);
42406 	    test_ret++;
42407             printf(" %d", n_code);
42408             printf("\n");
42409         }
42410     }
42411     function_tests++;
42412 #endif
42413 
42414     return(test_ret);
42415 }
42416 
42417 
42418 static int
test_xmlUCSIsThaana(void)42419 test_xmlUCSIsThaana(void) {
42420     int test_ret = 0;
42421 
42422 #if defined(LIBXML_UNICODE_ENABLED)
42423     int mem_base;
42424     int ret_val;
42425     int code; /* UCS code point */
42426     int n_code;
42427 
42428     for (n_code = 0;n_code < gen_nb_int;n_code++) {
42429         mem_base = xmlMemBlocks();
42430         code = gen_int(n_code, 0);
42431 
42432         ret_val = xmlUCSIsThaana(code);
42433         desret_int(ret_val);
42434         call_tests++;
42435         des_int(n_code, code, 0);
42436         xmlResetLastError();
42437         if (mem_base != xmlMemBlocks()) {
42438             printf("Leak of %d blocks found in xmlUCSIsThaana",
42439 	           xmlMemBlocks() - mem_base);
42440 	    test_ret++;
42441             printf(" %d", n_code);
42442             printf("\n");
42443         }
42444     }
42445     function_tests++;
42446 #endif
42447 
42448     return(test_ret);
42449 }
42450 
42451 
42452 static int
test_xmlUCSIsThai(void)42453 test_xmlUCSIsThai(void) {
42454     int test_ret = 0;
42455 
42456 #if defined(LIBXML_UNICODE_ENABLED)
42457     int mem_base;
42458     int ret_val;
42459     int code; /* UCS code point */
42460     int n_code;
42461 
42462     for (n_code = 0;n_code < gen_nb_int;n_code++) {
42463         mem_base = xmlMemBlocks();
42464         code = gen_int(n_code, 0);
42465 
42466         ret_val = xmlUCSIsThai(code);
42467         desret_int(ret_val);
42468         call_tests++;
42469         des_int(n_code, code, 0);
42470         xmlResetLastError();
42471         if (mem_base != xmlMemBlocks()) {
42472             printf("Leak of %d blocks found in xmlUCSIsThai",
42473 	           xmlMemBlocks() - mem_base);
42474 	    test_ret++;
42475             printf(" %d", n_code);
42476             printf("\n");
42477         }
42478     }
42479     function_tests++;
42480 #endif
42481 
42482     return(test_ret);
42483 }
42484 
42485 
42486 static int
test_xmlUCSIsTibetan(void)42487 test_xmlUCSIsTibetan(void) {
42488     int test_ret = 0;
42489 
42490 #if defined(LIBXML_UNICODE_ENABLED)
42491     int mem_base;
42492     int ret_val;
42493     int code; /* UCS code point */
42494     int n_code;
42495 
42496     for (n_code = 0;n_code < gen_nb_int;n_code++) {
42497         mem_base = xmlMemBlocks();
42498         code = gen_int(n_code, 0);
42499 
42500         ret_val = xmlUCSIsTibetan(code);
42501         desret_int(ret_val);
42502         call_tests++;
42503         des_int(n_code, code, 0);
42504         xmlResetLastError();
42505         if (mem_base != xmlMemBlocks()) {
42506             printf("Leak of %d blocks found in xmlUCSIsTibetan",
42507 	           xmlMemBlocks() - mem_base);
42508 	    test_ret++;
42509             printf(" %d", n_code);
42510             printf("\n");
42511         }
42512     }
42513     function_tests++;
42514 #endif
42515 
42516     return(test_ret);
42517 }
42518 
42519 
42520 static int
test_xmlUCSIsUgaritic(void)42521 test_xmlUCSIsUgaritic(void) {
42522     int test_ret = 0;
42523 
42524 #if defined(LIBXML_UNICODE_ENABLED)
42525     int mem_base;
42526     int ret_val;
42527     int code; /* UCS code point */
42528     int n_code;
42529 
42530     for (n_code = 0;n_code < gen_nb_int;n_code++) {
42531         mem_base = xmlMemBlocks();
42532         code = gen_int(n_code, 0);
42533 
42534         ret_val = xmlUCSIsUgaritic(code);
42535         desret_int(ret_val);
42536         call_tests++;
42537         des_int(n_code, code, 0);
42538         xmlResetLastError();
42539         if (mem_base != xmlMemBlocks()) {
42540             printf("Leak of %d blocks found in xmlUCSIsUgaritic",
42541 	           xmlMemBlocks() - mem_base);
42542 	    test_ret++;
42543             printf(" %d", n_code);
42544             printf("\n");
42545         }
42546     }
42547     function_tests++;
42548 #endif
42549 
42550     return(test_ret);
42551 }
42552 
42553 
42554 static int
test_xmlUCSIsUnifiedCanadianAboriginalSyllabics(void)42555 test_xmlUCSIsUnifiedCanadianAboriginalSyllabics(void) {
42556     int test_ret = 0;
42557 
42558 #if defined(LIBXML_UNICODE_ENABLED)
42559     int mem_base;
42560     int ret_val;
42561     int code; /* UCS code point */
42562     int n_code;
42563 
42564     for (n_code = 0;n_code < gen_nb_int;n_code++) {
42565         mem_base = xmlMemBlocks();
42566         code = gen_int(n_code, 0);
42567 
42568         ret_val = xmlUCSIsUnifiedCanadianAboriginalSyllabics(code);
42569         desret_int(ret_val);
42570         call_tests++;
42571         des_int(n_code, code, 0);
42572         xmlResetLastError();
42573         if (mem_base != xmlMemBlocks()) {
42574             printf("Leak of %d blocks found in xmlUCSIsUnifiedCanadianAboriginalSyllabics",
42575 	           xmlMemBlocks() - mem_base);
42576 	    test_ret++;
42577             printf(" %d", n_code);
42578             printf("\n");
42579         }
42580     }
42581     function_tests++;
42582 #endif
42583 
42584     return(test_ret);
42585 }
42586 
42587 
42588 static int
test_xmlUCSIsVariationSelectors(void)42589 test_xmlUCSIsVariationSelectors(void) {
42590     int test_ret = 0;
42591 
42592 #if defined(LIBXML_UNICODE_ENABLED)
42593     int mem_base;
42594     int ret_val;
42595     int code; /* UCS code point */
42596     int n_code;
42597 
42598     for (n_code = 0;n_code < gen_nb_int;n_code++) {
42599         mem_base = xmlMemBlocks();
42600         code = gen_int(n_code, 0);
42601 
42602         ret_val = xmlUCSIsVariationSelectors(code);
42603         desret_int(ret_val);
42604         call_tests++;
42605         des_int(n_code, code, 0);
42606         xmlResetLastError();
42607         if (mem_base != xmlMemBlocks()) {
42608             printf("Leak of %d blocks found in xmlUCSIsVariationSelectors",
42609 	           xmlMemBlocks() - mem_base);
42610 	    test_ret++;
42611             printf(" %d", n_code);
42612             printf("\n");
42613         }
42614     }
42615     function_tests++;
42616 #endif
42617 
42618     return(test_ret);
42619 }
42620 
42621 
42622 static int
test_xmlUCSIsVariationSelectorsSupplement(void)42623 test_xmlUCSIsVariationSelectorsSupplement(void) {
42624     int test_ret = 0;
42625 
42626 #if defined(LIBXML_UNICODE_ENABLED)
42627     int mem_base;
42628     int ret_val;
42629     int code; /* UCS code point */
42630     int n_code;
42631 
42632     for (n_code = 0;n_code < gen_nb_int;n_code++) {
42633         mem_base = xmlMemBlocks();
42634         code = gen_int(n_code, 0);
42635 
42636         ret_val = xmlUCSIsVariationSelectorsSupplement(code);
42637         desret_int(ret_val);
42638         call_tests++;
42639         des_int(n_code, code, 0);
42640         xmlResetLastError();
42641         if (mem_base != xmlMemBlocks()) {
42642             printf("Leak of %d blocks found in xmlUCSIsVariationSelectorsSupplement",
42643 	           xmlMemBlocks() - mem_base);
42644 	    test_ret++;
42645             printf(" %d", n_code);
42646             printf("\n");
42647         }
42648     }
42649     function_tests++;
42650 #endif
42651 
42652     return(test_ret);
42653 }
42654 
42655 
42656 static int
test_xmlUCSIsYiRadicals(void)42657 test_xmlUCSIsYiRadicals(void) {
42658     int test_ret = 0;
42659 
42660 #if defined(LIBXML_UNICODE_ENABLED)
42661     int mem_base;
42662     int ret_val;
42663     int code; /* UCS code point */
42664     int n_code;
42665 
42666     for (n_code = 0;n_code < gen_nb_int;n_code++) {
42667         mem_base = xmlMemBlocks();
42668         code = gen_int(n_code, 0);
42669 
42670         ret_val = xmlUCSIsYiRadicals(code);
42671         desret_int(ret_val);
42672         call_tests++;
42673         des_int(n_code, code, 0);
42674         xmlResetLastError();
42675         if (mem_base != xmlMemBlocks()) {
42676             printf("Leak of %d blocks found in xmlUCSIsYiRadicals",
42677 	           xmlMemBlocks() - mem_base);
42678 	    test_ret++;
42679             printf(" %d", n_code);
42680             printf("\n");
42681         }
42682     }
42683     function_tests++;
42684 #endif
42685 
42686     return(test_ret);
42687 }
42688 
42689 
42690 static int
test_xmlUCSIsYiSyllables(void)42691 test_xmlUCSIsYiSyllables(void) {
42692     int test_ret = 0;
42693 
42694 #if defined(LIBXML_UNICODE_ENABLED)
42695     int mem_base;
42696     int ret_val;
42697     int code; /* UCS code point */
42698     int n_code;
42699 
42700     for (n_code = 0;n_code < gen_nb_int;n_code++) {
42701         mem_base = xmlMemBlocks();
42702         code = gen_int(n_code, 0);
42703 
42704         ret_val = xmlUCSIsYiSyllables(code);
42705         desret_int(ret_val);
42706         call_tests++;
42707         des_int(n_code, code, 0);
42708         xmlResetLastError();
42709         if (mem_base != xmlMemBlocks()) {
42710             printf("Leak of %d blocks found in xmlUCSIsYiSyllables",
42711 	           xmlMemBlocks() - mem_base);
42712 	    test_ret++;
42713             printf(" %d", n_code);
42714             printf("\n");
42715         }
42716     }
42717     function_tests++;
42718 #endif
42719 
42720     return(test_ret);
42721 }
42722 
42723 
42724 static int
test_xmlUCSIsYijingHexagramSymbols(void)42725 test_xmlUCSIsYijingHexagramSymbols(void) {
42726     int test_ret = 0;
42727 
42728 #if defined(LIBXML_UNICODE_ENABLED)
42729     int mem_base;
42730     int ret_val;
42731     int code; /* UCS code point */
42732     int n_code;
42733 
42734     for (n_code = 0;n_code < gen_nb_int;n_code++) {
42735         mem_base = xmlMemBlocks();
42736         code = gen_int(n_code, 0);
42737 
42738         ret_val = xmlUCSIsYijingHexagramSymbols(code);
42739         desret_int(ret_val);
42740         call_tests++;
42741         des_int(n_code, code, 0);
42742         xmlResetLastError();
42743         if (mem_base != xmlMemBlocks()) {
42744             printf("Leak of %d blocks found in xmlUCSIsYijingHexagramSymbols",
42745 	           xmlMemBlocks() - mem_base);
42746 	    test_ret++;
42747             printf(" %d", n_code);
42748             printf("\n");
42749         }
42750     }
42751     function_tests++;
42752 #endif
42753 
42754     return(test_ret);
42755 }
42756 
42757 static int
test_xmlunicode(void)42758 test_xmlunicode(void) {
42759     int test_ret = 0;
42760 
42761     if (quiet == 0) printf("Testing xmlunicode : 166 of 166 functions ...\n");
42762     test_ret += test_xmlUCSIsAegeanNumbers();
42763     test_ret += test_xmlUCSIsAlphabeticPresentationForms();
42764     test_ret += test_xmlUCSIsArabic();
42765     test_ret += test_xmlUCSIsArabicPresentationFormsA();
42766     test_ret += test_xmlUCSIsArabicPresentationFormsB();
42767     test_ret += test_xmlUCSIsArmenian();
42768     test_ret += test_xmlUCSIsArrows();
42769     test_ret += test_xmlUCSIsBasicLatin();
42770     test_ret += test_xmlUCSIsBengali();
42771     test_ret += test_xmlUCSIsBlock();
42772     test_ret += test_xmlUCSIsBlockElements();
42773     test_ret += test_xmlUCSIsBopomofo();
42774     test_ret += test_xmlUCSIsBopomofoExtended();
42775     test_ret += test_xmlUCSIsBoxDrawing();
42776     test_ret += test_xmlUCSIsBraillePatterns();
42777     test_ret += test_xmlUCSIsBuhid();
42778     test_ret += test_xmlUCSIsByzantineMusicalSymbols();
42779     test_ret += test_xmlUCSIsCJKCompatibility();
42780     test_ret += test_xmlUCSIsCJKCompatibilityForms();
42781     test_ret += test_xmlUCSIsCJKCompatibilityIdeographs();
42782     test_ret += test_xmlUCSIsCJKCompatibilityIdeographsSupplement();
42783     test_ret += test_xmlUCSIsCJKRadicalsSupplement();
42784     test_ret += test_xmlUCSIsCJKSymbolsandPunctuation();
42785     test_ret += test_xmlUCSIsCJKUnifiedIdeographs();
42786     test_ret += test_xmlUCSIsCJKUnifiedIdeographsExtensionA();
42787     test_ret += test_xmlUCSIsCJKUnifiedIdeographsExtensionB();
42788     test_ret += test_xmlUCSIsCat();
42789     test_ret += test_xmlUCSIsCatC();
42790     test_ret += test_xmlUCSIsCatCc();
42791     test_ret += test_xmlUCSIsCatCf();
42792     test_ret += test_xmlUCSIsCatCo();
42793     test_ret += test_xmlUCSIsCatCs();
42794     test_ret += test_xmlUCSIsCatL();
42795     test_ret += test_xmlUCSIsCatLl();
42796     test_ret += test_xmlUCSIsCatLm();
42797     test_ret += test_xmlUCSIsCatLo();
42798     test_ret += test_xmlUCSIsCatLt();
42799     test_ret += test_xmlUCSIsCatLu();
42800     test_ret += test_xmlUCSIsCatM();
42801     test_ret += test_xmlUCSIsCatMc();
42802     test_ret += test_xmlUCSIsCatMe();
42803     test_ret += test_xmlUCSIsCatMn();
42804     test_ret += test_xmlUCSIsCatN();
42805     test_ret += test_xmlUCSIsCatNd();
42806     test_ret += test_xmlUCSIsCatNl();
42807     test_ret += test_xmlUCSIsCatNo();
42808     test_ret += test_xmlUCSIsCatP();
42809     test_ret += test_xmlUCSIsCatPc();
42810     test_ret += test_xmlUCSIsCatPd();
42811     test_ret += test_xmlUCSIsCatPe();
42812     test_ret += test_xmlUCSIsCatPf();
42813     test_ret += test_xmlUCSIsCatPi();
42814     test_ret += test_xmlUCSIsCatPo();
42815     test_ret += test_xmlUCSIsCatPs();
42816     test_ret += test_xmlUCSIsCatS();
42817     test_ret += test_xmlUCSIsCatSc();
42818     test_ret += test_xmlUCSIsCatSk();
42819     test_ret += test_xmlUCSIsCatSm();
42820     test_ret += test_xmlUCSIsCatSo();
42821     test_ret += test_xmlUCSIsCatZ();
42822     test_ret += test_xmlUCSIsCatZl();
42823     test_ret += test_xmlUCSIsCatZp();
42824     test_ret += test_xmlUCSIsCatZs();
42825     test_ret += test_xmlUCSIsCherokee();
42826     test_ret += test_xmlUCSIsCombiningDiacriticalMarks();
42827     test_ret += test_xmlUCSIsCombiningDiacriticalMarksforSymbols();
42828     test_ret += test_xmlUCSIsCombiningHalfMarks();
42829     test_ret += test_xmlUCSIsCombiningMarksforSymbols();
42830     test_ret += test_xmlUCSIsControlPictures();
42831     test_ret += test_xmlUCSIsCurrencySymbols();
42832     test_ret += test_xmlUCSIsCypriotSyllabary();
42833     test_ret += test_xmlUCSIsCyrillic();
42834     test_ret += test_xmlUCSIsCyrillicSupplement();
42835     test_ret += test_xmlUCSIsDeseret();
42836     test_ret += test_xmlUCSIsDevanagari();
42837     test_ret += test_xmlUCSIsDingbats();
42838     test_ret += test_xmlUCSIsEnclosedAlphanumerics();
42839     test_ret += test_xmlUCSIsEnclosedCJKLettersandMonths();
42840     test_ret += test_xmlUCSIsEthiopic();
42841     test_ret += test_xmlUCSIsGeneralPunctuation();
42842     test_ret += test_xmlUCSIsGeometricShapes();
42843     test_ret += test_xmlUCSIsGeorgian();
42844     test_ret += test_xmlUCSIsGothic();
42845     test_ret += test_xmlUCSIsGreek();
42846     test_ret += test_xmlUCSIsGreekExtended();
42847     test_ret += test_xmlUCSIsGreekandCoptic();
42848     test_ret += test_xmlUCSIsGujarati();
42849     test_ret += test_xmlUCSIsGurmukhi();
42850     test_ret += test_xmlUCSIsHalfwidthandFullwidthForms();
42851     test_ret += test_xmlUCSIsHangulCompatibilityJamo();
42852     test_ret += test_xmlUCSIsHangulJamo();
42853     test_ret += test_xmlUCSIsHangulSyllables();
42854     test_ret += test_xmlUCSIsHanunoo();
42855     test_ret += test_xmlUCSIsHebrew();
42856     test_ret += test_xmlUCSIsHighPrivateUseSurrogates();
42857     test_ret += test_xmlUCSIsHighSurrogates();
42858     test_ret += test_xmlUCSIsHiragana();
42859     test_ret += test_xmlUCSIsIPAExtensions();
42860     test_ret += test_xmlUCSIsIdeographicDescriptionCharacters();
42861     test_ret += test_xmlUCSIsKanbun();
42862     test_ret += test_xmlUCSIsKangxiRadicals();
42863     test_ret += test_xmlUCSIsKannada();
42864     test_ret += test_xmlUCSIsKatakana();
42865     test_ret += test_xmlUCSIsKatakanaPhoneticExtensions();
42866     test_ret += test_xmlUCSIsKhmer();
42867     test_ret += test_xmlUCSIsKhmerSymbols();
42868     test_ret += test_xmlUCSIsLao();
42869     test_ret += test_xmlUCSIsLatin1Supplement();
42870     test_ret += test_xmlUCSIsLatinExtendedA();
42871     test_ret += test_xmlUCSIsLatinExtendedAdditional();
42872     test_ret += test_xmlUCSIsLatinExtendedB();
42873     test_ret += test_xmlUCSIsLetterlikeSymbols();
42874     test_ret += test_xmlUCSIsLimbu();
42875     test_ret += test_xmlUCSIsLinearBIdeograms();
42876     test_ret += test_xmlUCSIsLinearBSyllabary();
42877     test_ret += test_xmlUCSIsLowSurrogates();
42878     test_ret += test_xmlUCSIsMalayalam();
42879     test_ret += test_xmlUCSIsMathematicalAlphanumericSymbols();
42880     test_ret += test_xmlUCSIsMathematicalOperators();
42881     test_ret += test_xmlUCSIsMiscellaneousMathematicalSymbolsA();
42882     test_ret += test_xmlUCSIsMiscellaneousMathematicalSymbolsB();
42883     test_ret += test_xmlUCSIsMiscellaneousSymbols();
42884     test_ret += test_xmlUCSIsMiscellaneousSymbolsandArrows();
42885     test_ret += test_xmlUCSIsMiscellaneousTechnical();
42886     test_ret += test_xmlUCSIsMongolian();
42887     test_ret += test_xmlUCSIsMusicalSymbols();
42888     test_ret += test_xmlUCSIsMyanmar();
42889     test_ret += test_xmlUCSIsNumberForms();
42890     test_ret += test_xmlUCSIsOgham();
42891     test_ret += test_xmlUCSIsOldItalic();
42892     test_ret += test_xmlUCSIsOpticalCharacterRecognition();
42893     test_ret += test_xmlUCSIsOriya();
42894     test_ret += test_xmlUCSIsOsmanya();
42895     test_ret += test_xmlUCSIsPhoneticExtensions();
42896     test_ret += test_xmlUCSIsPrivateUse();
42897     test_ret += test_xmlUCSIsPrivateUseArea();
42898     test_ret += test_xmlUCSIsRunic();
42899     test_ret += test_xmlUCSIsShavian();
42900     test_ret += test_xmlUCSIsSinhala();
42901     test_ret += test_xmlUCSIsSmallFormVariants();
42902     test_ret += test_xmlUCSIsSpacingModifierLetters();
42903     test_ret += test_xmlUCSIsSpecials();
42904     test_ret += test_xmlUCSIsSuperscriptsandSubscripts();
42905     test_ret += test_xmlUCSIsSupplementalArrowsA();
42906     test_ret += test_xmlUCSIsSupplementalArrowsB();
42907     test_ret += test_xmlUCSIsSupplementalMathematicalOperators();
42908     test_ret += test_xmlUCSIsSupplementaryPrivateUseAreaA();
42909     test_ret += test_xmlUCSIsSupplementaryPrivateUseAreaB();
42910     test_ret += test_xmlUCSIsSyriac();
42911     test_ret += test_xmlUCSIsTagalog();
42912     test_ret += test_xmlUCSIsTagbanwa();
42913     test_ret += test_xmlUCSIsTags();
42914     test_ret += test_xmlUCSIsTaiLe();
42915     test_ret += test_xmlUCSIsTaiXuanJingSymbols();
42916     test_ret += test_xmlUCSIsTamil();
42917     test_ret += test_xmlUCSIsTelugu();
42918     test_ret += test_xmlUCSIsThaana();
42919     test_ret += test_xmlUCSIsThai();
42920     test_ret += test_xmlUCSIsTibetan();
42921     test_ret += test_xmlUCSIsUgaritic();
42922     test_ret += test_xmlUCSIsUnifiedCanadianAboriginalSyllabics();
42923     test_ret += test_xmlUCSIsVariationSelectors();
42924     test_ret += test_xmlUCSIsVariationSelectorsSupplement();
42925     test_ret += test_xmlUCSIsYiRadicals();
42926     test_ret += test_xmlUCSIsYiSyllables();
42927     test_ret += test_xmlUCSIsYijingHexagramSymbols();
42928 
42929     if (test_ret != 0)
42930 	printf("Module xmlunicode: %d errors\n", test_ret);
42931     return(test_ret);
42932 }
42933 
42934 static int
test_xmlNewTextWriter(void)42935 test_xmlNewTextWriter(void) {
42936     int test_ret = 0;
42937 
42938 #if defined(LIBXML_WRITER_ENABLED)
42939     int mem_base;
42940     xmlTextWriterPtr ret_val;
42941     xmlOutputBufferPtr out; /* an xmlOutputBufferPtr */
42942     int n_out;
42943 
42944     for (n_out = 0;n_out < gen_nb_xmlOutputBufferPtr;n_out++) {
42945         mem_base = xmlMemBlocks();
42946         out = gen_xmlOutputBufferPtr(n_out, 0);
42947 
42948         ret_val = xmlNewTextWriter(out);
42949         if (ret_val != NULL) out = NULL;
42950         desret_xmlTextWriterPtr(ret_val);
42951         call_tests++;
42952         des_xmlOutputBufferPtr(n_out, out, 0);
42953         xmlResetLastError();
42954         if (mem_base != xmlMemBlocks()) {
42955             printf("Leak of %d blocks found in xmlNewTextWriter",
42956 	           xmlMemBlocks() - mem_base);
42957 	    test_ret++;
42958             printf(" %d", n_out);
42959             printf("\n");
42960         }
42961     }
42962     function_tests++;
42963 #endif
42964 
42965     return(test_ret);
42966 }
42967 
42968 
42969 static int
test_xmlNewTextWriterFilename(void)42970 test_xmlNewTextWriterFilename(void) {
42971     int test_ret = 0;
42972 
42973 #if defined(LIBXML_WRITER_ENABLED)
42974     int mem_base;
42975     xmlTextWriterPtr ret_val;
42976     const char * uri; /* the URI of the resource for the output */
42977     int n_uri;
42978     int compression; /* compress the output? */
42979     int n_compression;
42980 
42981     for (n_uri = 0;n_uri < gen_nb_fileoutput;n_uri++) {
42982     for (n_compression = 0;n_compression < gen_nb_int;n_compression++) {
42983         mem_base = xmlMemBlocks();
42984         uri = gen_fileoutput(n_uri, 0);
42985         compression = gen_int(n_compression, 1);
42986 
42987         ret_val = xmlNewTextWriterFilename(uri, compression);
42988         desret_xmlTextWriterPtr(ret_val);
42989         call_tests++;
42990         des_fileoutput(n_uri, uri, 0);
42991         des_int(n_compression, compression, 1);
42992         xmlResetLastError();
42993         if (mem_base != xmlMemBlocks()) {
42994             printf("Leak of %d blocks found in xmlNewTextWriterFilename",
42995 	           xmlMemBlocks() - mem_base);
42996 	    test_ret++;
42997             printf(" %d", n_uri);
42998             printf(" %d", n_compression);
42999             printf("\n");
43000         }
43001     }
43002     }
43003     function_tests++;
43004 #endif
43005 
43006     return(test_ret);
43007 }
43008 
43009 
43010 static int
test_xmlNewTextWriterMemory(void)43011 test_xmlNewTextWriterMemory(void) {
43012     int test_ret = 0;
43013 
43014 #if defined(LIBXML_WRITER_ENABLED)
43015     int mem_base;
43016     xmlTextWriterPtr ret_val;
43017     xmlBufferPtr buf; /* xmlBufferPtr */
43018     int n_buf;
43019     int compression; /* compress the output? */
43020     int n_compression;
43021 
43022     for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
43023     for (n_compression = 0;n_compression < gen_nb_int;n_compression++) {
43024         mem_base = xmlMemBlocks();
43025         buf = gen_xmlBufferPtr(n_buf, 0);
43026         compression = gen_int(n_compression, 1);
43027 
43028         ret_val = xmlNewTextWriterMemory(buf, compression);
43029         desret_xmlTextWriterPtr(ret_val);
43030         call_tests++;
43031         des_xmlBufferPtr(n_buf, buf, 0);
43032         des_int(n_compression, compression, 1);
43033         xmlResetLastError();
43034         if (mem_base != xmlMemBlocks()) {
43035             printf("Leak of %d blocks found in xmlNewTextWriterMemory",
43036 	           xmlMemBlocks() - mem_base);
43037 	    test_ret++;
43038             printf(" %d", n_buf);
43039             printf(" %d", n_compression);
43040             printf("\n");
43041         }
43042     }
43043     }
43044     function_tests++;
43045 #endif
43046 
43047     return(test_ret);
43048 }
43049 
43050 
43051 static int
test_xmlNewTextWriterPushParser(void)43052 test_xmlNewTextWriterPushParser(void) {
43053     int test_ret = 0;
43054 
43055 #if defined(LIBXML_WRITER_ENABLED)
43056     int mem_base;
43057     xmlTextWriterPtr ret_val;
43058     xmlParserCtxtPtr ctxt; /* xmlParserCtxtPtr to hold the new XML document tree */
43059     int n_ctxt;
43060     int compression; /* compress the output? */
43061     int n_compression;
43062 
43063     for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
43064     for (n_compression = 0;n_compression < gen_nb_int;n_compression++) {
43065         mem_base = xmlMemBlocks();
43066         ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
43067         compression = gen_int(n_compression, 1);
43068 
43069         ret_val = xmlNewTextWriterPushParser(ctxt, compression);
43070         if (ctxt != NULL) {xmlFreeDoc(ctxt->myDoc); ctxt->myDoc = NULL;} if (ret_val != NULL) ctxt = NULL;
43071         desret_xmlTextWriterPtr(ret_val);
43072         call_tests++;
43073         des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
43074         des_int(n_compression, compression, 1);
43075         xmlResetLastError();
43076         if (mem_base != xmlMemBlocks()) {
43077             printf("Leak of %d blocks found in xmlNewTextWriterPushParser",
43078 	           xmlMemBlocks() - mem_base);
43079 	    test_ret++;
43080             printf(" %d", n_ctxt);
43081             printf(" %d", n_compression);
43082             printf("\n");
43083         }
43084     }
43085     }
43086     function_tests++;
43087 #endif
43088 
43089     return(test_ret);
43090 }
43091 
43092 
43093 static int
test_xmlNewTextWriterTree(void)43094 test_xmlNewTextWriterTree(void) {
43095     int test_ret = 0;
43096 
43097 #if defined(LIBXML_WRITER_ENABLED)
43098     int mem_base;
43099     xmlTextWriterPtr ret_val;
43100     xmlDocPtr doc; /* xmlDocPtr */
43101     int n_doc;
43102     xmlNodePtr node; /* xmlNodePtr or NULL for doc->children */
43103     int n_node;
43104     int compression; /* compress the output? */
43105     int n_compression;
43106 
43107     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
43108     for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
43109     for (n_compression = 0;n_compression < gen_nb_int;n_compression++) {
43110         mem_base = xmlMemBlocks();
43111         doc = gen_xmlDocPtr(n_doc, 0);
43112         node = gen_xmlNodePtr(n_node, 1);
43113         compression = gen_int(n_compression, 2);
43114 
43115         ret_val = xmlNewTextWriterTree(doc, node, compression);
43116         desret_xmlTextWriterPtr(ret_val);
43117         call_tests++;
43118         des_xmlDocPtr(n_doc, doc, 0);
43119         des_xmlNodePtr(n_node, node, 1);
43120         des_int(n_compression, compression, 2);
43121         xmlResetLastError();
43122         if (mem_base != xmlMemBlocks()) {
43123             printf("Leak of %d blocks found in xmlNewTextWriterTree",
43124 	           xmlMemBlocks() - mem_base);
43125 	    test_ret++;
43126             printf(" %d", n_doc);
43127             printf(" %d", n_node);
43128             printf(" %d", n_compression);
43129             printf("\n");
43130         }
43131     }
43132     }
43133     }
43134     function_tests++;
43135 #endif
43136 
43137     return(test_ret);
43138 }
43139 
43140 
43141 static int
test_xmlTextWriterEndAttribute(void)43142 test_xmlTextWriterEndAttribute(void) {
43143     int test_ret = 0;
43144 
43145 #if defined(LIBXML_WRITER_ENABLED)
43146     int mem_base;
43147     int ret_val;
43148     xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
43149     int n_writer;
43150 
43151     for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
43152         mem_base = xmlMemBlocks();
43153         writer = gen_xmlTextWriterPtr(n_writer, 0);
43154 
43155         ret_val = xmlTextWriterEndAttribute(writer);
43156         desret_int(ret_val);
43157         call_tests++;
43158         des_xmlTextWriterPtr(n_writer, writer, 0);
43159         xmlResetLastError();
43160         if (mem_base != xmlMemBlocks()) {
43161             printf("Leak of %d blocks found in xmlTextWriterEndAttribute",
43162 	           xmlMemBlocks() - mem_base);
43163 	    test_ret++;
43164             printf(" %d", n_writer);
43165             printf("\n");
43166         }
43167     }
43168     function_tests++;
43169 #endif
43170 
43171     return(test_ret);
43172 }
43173 
43174 
43175 static int
test_xmlTextWriterEndCDATA(void)43176 test_xmlTextWriterEndCDATA(void) {
43177     int test_ret = 0;
43178 
43179 #if defined(LIBXML_WRITER_ENABLED)
43180     int mem_base;
43181     int ret_val;
43182     xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
43183     int n_writer;
43184 
43185     for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
43186         mem_base = xmlMemBlocks();
43187         writer = gen_xmlTextWriterPtr(n_writer, 0);
43188 
43189         ret_val = xmlTextWriterEndCDATA(writer);
43190         desret_int(ret_val);
43191         call_tests++;
43192         des_xmlTextWriterPtr(n_writer, writer, 0);
43193         xmlResetLastError();
43194         if (mem_base != xmlMemBlocks()) {
43195             printf("Leak of %d blocks found in xmlTextWriterEndCDATA",
43196 	           xmlMemBlocks() - mem_base);
43197 	    test_ret++;
43198             printf(" %d", n_writer);
43199             printf("\n");
43200         }
43201     }
43202     function_tests++;
43203 #endif
43204 
43205     return(test_ret);
43206 }
43207 
43208 
43209 static int
test_xmlTextWriterEndComment(void)43210 test_xmlTextWriterEndComment(void) {
43211     int test_ret = 0;
43212 
43213 #if defined(LIBXML_WRITER_ENABLED)
43214     int mem_base;
43215     int ret_val;
43216     xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
43217     int n_writer;
43218 
43219     for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
43220         mem_base = xmlMemBlocks();
43221         writer = gen_xmlTextWriterPtr(n_writer, 0);
43222 
43223         ret_val = xmlTextWriterEndComment(writer);
43224         desret_int(ret_val);
43225         call_tests++;
43226         des_xmlTextWriterPtr(n_writer, writer, 0);
43227         xmlResetLastError();
43228         if (mem_base != xmlMemBlocks()) {
43229             printf("Leak of %d blocks found in xmlTextWriterEndComment",
43230 	           xmlMemBlocks() - mem_base);
43231 	    test_ret++;
43232             printf(" %d", n_writer);
43233             printf("\n");
43234         }
43235     }
43236     function_tests++;
43237 #endif
43238 
43239     return(test_ret);
43240 }
43241 
43242 
43243 static int
test_xmlTextWriterEndDTD(void)43244 test_xmlTextWriterEndDTD(void) {
43245     int test_ret = 0;
43246 
43247 #if defined(LIBXML_WRITER_ENABLED)
43248     int mem_base;
43249     int ret_val;
43250     xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
43251     int n_writer;
43252 
43253     for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
43254         mem_base = xmlMemBlocks();
43255         writer = gen_xmlTextWriterPtr(n_writer, 0);
43256 
43257         ret_val = xmlTextWriterEndDTD(writer);
43258         desret_int(ret_val);
43259         call_tests++;
43260         des_xmlTextWriterPtr(n_writer, writer, 0);
43261         xmlResetLastError();
43262         if (mem_base != xmlMemBlocks()) {
43263             printf("Leak of %d blocks found in xmlTextWriterEndDTD",
43264 	           xmlMemBlocks() - mem_base);
43265 	    test_ret++;
43266             printf(" %d", n_writer);
43267             printf("\n");
43268         }
43269     }
43270     function_tests++;
43271 #endif
43272 
43273     return(test_ret);
43274 }
43275 
43276 
43277 static int
test_xmlTextWriterEndDTDAttlist(void)43278 test_xmlTextWriterEndDTDAttlist(void) {
43279     int test_ret = 0;
43280 
43281 #if defined(LIBXML_WRITER_ENABLED)
43282     int mem_base;
43283     int ret_val;
43284     xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
43285     int n_writer;
43286 
43287     for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
43288         mem_base = xmlMemBlocks();
43289         writer = gen_xmlTextWriterPtr(n_writer, 0);
43290 
43291         ret_val = xmlTextWriterEndDTDAttlist(writer);
43292         desret_int(ret_val);
43293         call_tests++;
43294         des_xmlTextWriterPtr(n_writer, writer, 0);
43295         xmlResetLastError();
43296         if (mem_base != xmlMemBlocks()) {
43297             printf("Leak of %d blocks found in xmlTextWriterEndDTDAttlist",
43298 	           xmlMemBlocks() - mem_base);
43299 	    test_ret++;
43300             printf(" %d", n_writer);
43301             printf("\n");
43302         }
43303     }
43304     function_tests++;
43305 #endif
43306 
43307     return(test_ret);
43308 }
43309 
43310 
43311 static int
test_xmlTextWriterEndDTDElement(void)43312 test_xmlTextWriterEndDTDElement(void) {
43313     int test_ret = 0;
43314 
43315 #if defined(LIBXML_WRITER_ENABLED)
43316     int mem_base;
43317     int ret_val;
43318     xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
43319     int n_writer;
43320 
43321     for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
43322         mem_base = xmlMemBlocks();
43323         writer = gen_xmlTextWriterPtr(n_writer, 0);
43324 
43325         ret_val = xmlTextWriterEndDTDElement(writer);
43326         desret_int(ret_val);
43327         call_tests++;
43328         des_xmlTextWriterPtr(n_writer, writer, 0);
43329         xmlResetLastError();
43330         if (mem_base != xmlMemBlocks()) {
43331             printf("Leak of %d blocks found in xmlTextWriterEndDTDElement",
43332 	           xmlMemBlocks() - mem_base);
43333 	    test_ret++;
43334             printf(" %d", n_writer);
43335             printf("\n");
43336         }
43337     }
43338     function_tests++;
43339 #endif
43340 
43341     return(test_ret);
43342 }
43343 
43344 
43345 static int
test_xmlTextWriterEndDTDEntity(void)43346 test_xmlTextWriterEndDTDEntity(void) {
43347     int test_ret = 0;
43348 
43349 #if defined(LIBXML_WRITER_ENABLED)
43350     int mem_base;
43351     int ret_val;
43352     xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
43353     int n_writer;
43354 
43355     for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
43356         mem_base = xmlMemBlocks();
43357         writer = gen_xmlTextWriterPtr(n_writer, 0);
43358 
43359         ret_val = xmlTextWriterEndDTDEntity(writer);
43360         desret_int(ret_val);
43361         call_tests++;
43362         des_xmlTextWriterPtr(n_writer, writer, 0);
43363         xmlResetLastError();
43364         if (mem_base != xmlMemBlocks()) {
43365             printf("Leak of %d blocks found in xmlTextWriterEndDTDEntity",
43366 	           xmlMemBlocks() - mem_base);
43367 	    test_ret++;
43368             printf(" %d", n_writer);
43369             printf("\n");
43370         }
43371     }
43372     function_tests++;
43373 #endif
43374 
43375     return(test_ret);
43376 }
43377 
43378 
43379 static int
test_xmlTextWriterEndDocument(void)43380 test_xmlTextWriterEndDocument(void) {
43381     int test_ret = 0;
43382 
43383 #if defined(LIBXML_WRITER_ENABLED)
43384     int mem_base;
43385     int ret_val;
43386     xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
43387     int n_writer;
43388 
43389     for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
43390         mem_base = xmlMemBlocks();
43391         writer = gen_xmlTextWriterPtr(n_writer, 0);
43392 
43393         ret_val = xmlTextWriterEndDocument(writer);
43394         desret_int(ret_val);
43395         call_tests++;
43396         des_xmlTextWriterPtr(n_writer, writer, 0);
43397         xmlResetLastError();
43398         if (mem_base != xmlMemBlocks()) {
43399             printf("Leak of %d blocks found in xmlTextWriterEndDocument",
43400 	           xmlMemBlocks() - mem_base);
43401 	    test_ret++;
43402             printf(" %d", n_writer);
43403             printf("\n");
43404         }
43405     }
43406     function_tests++;
43407 #endif
43408 
43409     return(test_ret);
43410 }
43411 
43412 
43413 static int
test_xmlTextWriterEndElement(void)43414 test_xmlTextWriterEndElement(void) {
43415     int test_ret = 0;
43416 
43417 #if defined(LIBXML_WRITER_ENABLED)
43418     int mem_base;
43419     int ret_val;
43420     xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
43421     int n_writer;
43422 
43423     for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
43424         mem_base = xmlMemBlocks();
43425         writer = gen_xmlTextWriterPtr(n_writer, 0);
43426 
43427         ret_val = xmlTextWriterEndElement(writer);
43428         desret_int(ret_val);
43429         call_tests++;
43430         des_xmlTextWriterPtr(n_writer, writer, 0);
43431         xmlResetLastError();
43432         if (mem_base != xmlMemBlocks()) {
43433             printf("Leak of %d blocks found in xmlTextWriterEndElement",
43434 	           xmlMemBlocks() - mem_base);
43435 	    test_ret++;
43436             printf(" %d", n_writer);
43437             printf("\n");
43438         }
43439     }
43440     function_tests++;
43441 #endif
43442 
43443     return(test_ret);
43444 }
43445 
43446 
43447 static int
test_xmlTextWriterEndPI(void)43448 test_xmlTextWriterEndPI(void) {
43449     int test_ret = 0;
43450 
43451 #if defined(LIBXML_WRITER_ENABLED)
43452     int mem_base;
43453     int ret_val;
43454     xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
43455     int n_writer;
43456 
43457     for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
43458         mem_base = xmlMemBlocks();
43459         writer = gen_xmlTextWriterPtr(n_writer, 0);
43460 
43461         ret_val = xmlTextWriterEndPI(writer);
43462         desret_int(ret_val);
43463         call_tests++;
43464         des_xmlTextWriterPtr(n_writer, writer, 0);
43465         xmlResetLastError();
43466         if (mem_base != xmlMemBlocks()) {
43467             printf("Leak of %d blocks found in xmlTextWriterEndPI",
43468 	           xmlMemBlocks() - mem_base);
43469 	    test_ret++;
43470             printf(" %d", n_writer);
43471             printf("\n");
43472         }
43473     }
43474     function_tests++;
43475 #endif
43476 
43477     return(test_ret);
43478 }
43479 
43480 
43481 static int
test_xmlTextWriterFlush(void)43482 test_xmlTextWriterFlush(void) {
43483     int test_ret = 0;
43484 
43485 #if defined(LIBXML_WRITER_ENABLED)
43486     int mem_base;
43487     int ret_val;
43488     xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
43489     int n_writer;
43490 
43491     for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
43492         mem_base = xmlMemBlocks();
43493         writer = gen_xmlTextWriterPtr(n_writer, 0);
43494 
43495         ret_val = xmlTextWriterFlush(writer);
43496         desret_int(ret_val);
43497         call_tests++;
43498         des_xmlTextWriterPtr(n_writer, writer, 0);
43499         xmlResetLastError();
43500         if (mem_base != xmlMemBlocks()) {
43501             printf("Leak of %d blocks found in xmlTextWriterFlush",
43502 	           xmlMemBlocks() - mem_base);
43503 	    test_ret++;
43504             printf(" %d", n_writer);
43505             printf("\n");
43506         }
43507     }
43508     function_tests++;
43509 #endif
43510 
43511     return(test_ret);
43512 }
43513 
43514 
43515 static int
test_xmlTextWriterFullEndElement(void)43516 test_xmlTextWriterFullEndElement(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 
43525     for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
43526         mem_base = xmlMemBlocks();
43527         writer = gen_xmlTextWriterPtr(n_writer, 0);
43528 
43529         ret_val = xmlTextWriterFullEndElement(writer);
43530         desret_int(ret_val);
43531         call_tests++;
43532         des_xmlTextWriterPtr(n_writer, writer, 0);
43533         xmlResetLastError();
43534         if (mem_base != xmlMemBlocks()) {
43535             printf("Leak of %d blocks found in xmlTextWriterFullEndElement",
43536 	           xmlMemBlocks() - mem_base);
43537 	    test_ret++;
43538             printf(" %d", n_writer);
43539             printf("\n");
43540         }
43541     }
43542     function_tests++;
43543 #endif
43544 
43545     return(test_ret);
43546 }
43547 
43548 
43549 static int
test_xmlTextWriterSetIndent(void)43550 test_xmlTextWriterSetIndent(void) {
43551     int test_ret = 0;
43552 
43553 #if defined(LIBXML_WRITER_ENABLED)
43554     int mem_base;
43555     int ret_val;
43556     xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
43557     int n_writer;
43558     int indent; /* do indentation? */
43559     int n_indent;
43560 
43561     for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
43562     for (n_indent = 0;n_indent < gen_nb_int;n_indent++) {
43563         mem_base = xmlMemBlocks();
43564         writer = gen_xmlTextWriterPtr(n_writer, 0);
43565         indent = gen_int(n_indent, 1);
43566 
43567         ret_val = xmlTextWriterSetIndent(writer, indent);
43568         desret_int(ret_val);
43569         call_tests++;
43570         des_xmlTextWriterPtr(n_writer, writer, 0);
43571         des_int(n_indent, indent, 1);
43572         xmlResetLastError();
43573         if (mem_base != xmlMemBlocks()) {
43574             printf("Leak of %d blocks found in xmlTextWriterSetIndent",
43575 	           xmlMemBlocks() - mem_base);
43576 	    test_ret++;
43577             printf(" %d", n_writer);
43578             printf(" %d", n_indent);
43579             printf("\n");
43580         }
43581     }
43582     }
43583     function_tests++;
43584 #endif
43585 
43586     return(test_ret);
43587 }
43588 
43589 
43590 static int
test_xmlTextWriterSetIndentString(void)43591 test_xmlTextWriterSetIndentString(void) {
43592     int test_ret = 0;
43593 
43594 #if defined(LIBXML_WRITER_ENABLED)
43595     int mem_base;
43596     int ret_val;
43597     xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
43598     int n_writer;
43599     const xmlChar * str; /* the xmlChar string */
43600     int n_str;
43601 
43602     for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
43603     for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) {
43604         mem_base = xmlMemBlocks();
43605         writer = gen_xmlTextWriterPtr(n_writer, 0);
43606         str = gen_const_xmlChar_ptr(n_str, 1);
43607 
43608         ret_val = xmlTextWriterSetIndentString(writer, str);
43609         desret_int(ret_val);
43610         call_tests++;
43611         des_xmlTextWriterPtr(n_writer, writer, 0);
43612         des_const_xmlChar_ptr(n_str, str, 1);
43613         xmlResetLastError();
43614         if (mem_base != xmlMemBlocks()) {
43615             printf("Leak of %d blocks found in xmlTextWriterSetIndentString",
43616 	           xmlMemBlocks() - mem_base);
43617 	    test_ret++;
43618             printf(" %d", n_writer);
43619             printf(" %d", n_str);
43620             printf("\n");
43621         }
43622     }
43623     }
43624     function_tests++;
43625 #endif
43626 
43627     return(test_ret);
43628 }
43629 
43630 
43631 static int
test_xmlTextWriterSetQuoteChar(void)43632 test_xmlTextWriterSetQuoteChar(void) {
43633     int test_ret = 0;
43634 
43635 #if defined(LIBXML_WRITER_ENABLED)
43636     int mem_base;
43637     int ret_val;
43638     xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
43639     int n_writer;
43640     xmlChar quotechar; /* the quote character */
43641     int n_quotechar;
43642 
43643     for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
43644     for (n_quotechar = 0;n_quotechar < gen_nb_xmlChar;n_quotechar++) {
43645         mem_base = xmlMemBlocks();
43646         writer = gen_xmlTextWriterPtr(n_writer, 0);
43647         quotechar = gen_xmlChar(n_quotechar, 1);
43648 
43649         ret_val = xmlTextWriterSetQuoteChar(writer, quotechar);
43650         desret_int(ret_val);
43651         call_tests++;
43652         des_xmlTextWriterPtr(n_writer, writer, 0);
43653         des_xmlChar(n_quotechar, quotechar, 1);
43654         xmlResetLastError();
43655         if (mem_base != xmlMemBlocks()) {
43656             printf("Leak of %d blocks found in xmlTextWriterSetQuoteChar",
43657 	           xmlMemBlocks() - mem_base);
43658 	    test_ret++;
43659             printf(" %d", n_writer);
43660             printf(" %d", n_quotechar);
43661             printf("\n");
43662         }
43663     }
43664     }
43665     function_tests++;
43666 #endif
43667 
43668     return(test_ret);
43669 }
43670 
43671 
43672 static int
test_xmlTextWriterStartAttribute(void)43673 test_xmlTextWriterStartAttribute(void) {
43674     int test_ret = 0;
43675 
43676 #if defined(LIBXML_WRITER_ENABLED)
43677     int mem_base;
43678     int ret_val;
43679     xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
43680     int n_writer;
43681     const xmlChar * name; /* element name */
43682     int n_name;
43683 
43684     for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
43685     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
43686         mem_base = xmlMemBlocks();
43687         writer = gen_xmlTextWriterPtr(n_writer, 0);
43688         name = gen_const_xmlChar_ptr(n_name, 1);
43689 
43690         ret_val = xmlTextWriterStartAttribute(writer, name);
43691         desret_int(ret_val);
43692         call_tests++;
43693         des_xmlTextWriterPtr(n_writer, writer, 0);
43694         des_const_xmlChar_ptr(n_name, name, 1);
43695         xmlResetLastError();
43696         if (mem_base != xmlMemBlocks()) {
43697             printf("Leak of %d blocks found in xmlTextWriterStartAttribute",
43698 	           xmlMemBlocks() - mem_base);
43699 	    test_ret++;
43700             printf(" %d", n_writer);
43701             printf(" %d", n_name);
43702             printf("\n");
43703         }
43704     }
43705     }
43706     function_tests++;
43707 #endif
43708 
43709     return(test_ret);
43710 }
43711 
43712 
43713 static int
test_xmlTextWriterStartAttributeNS(void)43714 test_xmlTextWriterStartAttributeNS(void) {
43715     int test_ret = 0;
43716 
43717 #if defined(LIBXML_WRITER_ENABLED)
43718     int mem_base;
43719     int ret_val;
43720     xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
43721     int n_writer;
43722     const xmlChar * prefix; /* namespace prefix or NULL */
43723     int n_prefix;
43724     const xmlChar * name; /* element local name */
43725     int n_name;
43726     const xmlChar * namespaceURI; /* namespace URI or NULL */
43727     int n_namespaceURI;
43728 
43729     for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
43730     for (n_prefix = 0;n_prefix < gen_nb_const_xmlChar_ptr;n_prefix++) {
43731     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
43732     for (n_namespaceURI = 0;n_namespaceURI < gen_nb_const_xmlChar_ptr;n_namespaceURI++) {
43733         mem_base = xmlMemBlocks();
43734         writer = gen_xmlTextWriterPtr(n_writer, 0);
43735         prefix = gen_const_xmlChar_ptr(n_prefix, 1);
43736         name = gen_const_xmlChar_ptr(n_name, 2);
43737         namespaceURI = gen_const_xmlChar_ptr(n_namespaceURI, 3);
43738 
43739         ret_val = xmlTextWriterStartAttributeNS(writer, prefix, name, namespaceURI);
43740         desret_int(ret_val);
43741         call_tests++;
43742         des_xmlTextWriterPtr(n_writer, writer, 0);
43743         des_const_xmlChar_ptr(n_prefix, prefix, 1);
43744         des_const_xmlChar_ptr(n_name, name, 2);
43745         des_const_xmlChar_ptr(n_namespaceURI, namespaceURI, 3);
43746         xmlResetLastError();
43747         if (mem_base != xmlMemBlocks()) {
43748             printf("Leak of %d blocks found in xmlTextWriterStartAttributeNS",
43749 	           xmlMemBlocks() - mem_base);
43750 	    test_ret++;
43751             printf(" %d", n_writer);
43752             printf(" %d", n_prefix);
43753             printf(" %d", n_name);
43754             printf(" %d", n_namespaceURI);
43755             printf("\n");
43756         }
43757     }
43758     }
43759     }
43760     }
43761     function_tests++;
43762 #endif
43763 
43764     return(test_ret);
43765 }
43766 
43767 
43768 static int
test_xmlTextWriterStartCDATA(void)43769 test_xmlTextWriterStartCDATA(void) {
43770     int test_ret = 0;
43771 
43772 #if defined(LIBXML_WRITER_ENABLED)
43773     int mem_base;
43774     int ret_val;
43775     xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
43776     int n_writer;
43777 
43778     for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
43779         mem_base = xmlMemBlocks();
43780         writer = gen_xmlTextWriterPtr(n_writer, 0);
43781 
43782         ret_val = xmlTextWriterStartCDATA(writer);
43783         desret_int(ret_val);
43784         call_tests++;
43785         des_xmlTextWriterPtr(n_writer, writer, 0);
43786         xmlResetLastError();
43787         if (mem_base != xmlMemBlocks()) {
43788             printf("Leak of %d blocks found in xmlTextWriterStartCDATA",
43789 	           xmlMemBlocks() - mem_base);
43790 	    test_ret++;
43791             printf(" %d", n_writer);
43792             printf("\n");
43793         }
43794     }
43795     function_tests++;
43796 #endif
43797 
43798     return(test_ret);
43799 }
43800 
43801 
43802 static int
test_xmlTextWriterStartComment(void)43803 test_xmlTextWriterStartComment(void) {
43804     int test_ret = 0;
43805 
43806 #if defined(LIBXML_WRITER_ENABLED)
43807     int mem_base;
43808     int ret_val;
43809     xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
43810     int n_writer;
43811 
43812     for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
43813         mem_base = xmlMemBlocks();
43814         writer = gen_xmlTextWriterPtr(n_writer, 0);
43815 
43816         ret_val = xmlTextWriterStartComment(writer);
43817         desret_int(ret_val);
43818         call_tests++;
43819         des_xmlTextWriterPtr(n_writer, writer, 0);
43820         xmlResetLastError();
43821         if (mem_base != xmlMemBlocks()) {
43822             printf("Leak of %d blocks found in xmlTextWriterStartComment",
43823 	           xmlMemBlocks() - mem_base);
43824 	    test_ret++;
43825             printf(" %d", n_writer);
43826             printf("\n");
43827         }
43828     }
43829     function_tests++;
43830 #endif
43831 
43832     return(test_ret);
43833 }
43834 
43835 
43836 static int
test_xmlTextWriterStartDTD(void)43837 test_xmlTextWriterStartDTD(void) {
43838     int test_ret = 0;
43839 
43840 #if defined(LIBXML_WRITER_ENABLED)
43841     int mem_base;
43842     int ret_val;
43843     xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
43844     int n_writer;
43845     const xmlChar * name; /* the name of the DTD */
43846     int n_name;
43847     const xmlChar * pubid; /* the public identifier, which is an alternative to the system identifier */
43848     int n_pubid;
43849     const xmlChar * sysid; /* the system identifier, which is the URI of the DTD */
43850     int n_sysid;
43851 
43852     for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
43853     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
43854     for (n_pubid = 0;n_pubid < gen_nb_const_xmlChar_ptr;n_pubid++) {
43855     for (n_sysid = 0;n_sysid < gen_nb_const_xmlChar_ptr;n_sysid++) {
43856         mem_base = xmlMemBlocks();
43857         writer = gen_xmlTextWriterPtr(n_writer, 0);
43858         name = gen_const_xmlChar_ptr(n_name, 1);
43859         pubid = gen_const_xmlChar_ptr(n_pubid, 2);
43860         sysid = gen_const_xmlChar_ptr(n_sysid, 3);
43861 
43862         ret_val = xmlTextWriterStartDTD(writer, name, pubid, sysid);
43863         desret_int(ret_val);
43864         call_tests++;
43865         des_xmlTextWriterPtr(n_writer, writer, 0);
43866         des_const_xmlChar_ptr(n_name, name, 1);
43867         des_const_xmlChar_ptr(n_pubid, pubid, 2);
43868         des_const_xmlChar_ptr(n_sysid, sysid, 3);
43869         xmlResetLastError();
43870         if (mem_base != xmlMemBlocks()) {
43871             printf("Leak of %d blocks found in xmlTextWriterStartDTD",
43872 	           xmlMemBlocks() - mem_base);
43873 	    test_ret++;
43874             printf(" %d", n_writer);
43875             printf(" %d", n_name);
43876             printf(" %d", n_pubid);
43877             printf(" %d", n_sysid);
43878             printf("\n");
43879         }
43880     }
43881     }
43882     }
43883     }
43884     function_tests++;
43885 #endif
43886 
43887     return(test_ret);
43888 }
43889 
43890 
43891 static int
test_xmlTextWriterStartDTDAttlist(void)43892 test_xmlTextWriterStartDTDAttlist(void) {
43893     int test_ret = 0;
43894 
43895 #if defined(LIBXML_WRITER_ENABLED)
43896     int mem_base;
43897     int ret_val;
43898     xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
43899     int n_writer;
43900     const xmlChar * name; /* the name of the DTD ATTLIST */
43901     int n_name;
43902 
43903     for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
43904     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
43905         mem_base = xmlMemBlocks();
43906         writer = gen_xmlTextWriterPtr(n_writer, 0);
43907         name = gen_const_xmlChar_ptr(n_name, 1);
43908 
43909         ret_val = xmlTextWriterStartDTDAttlist(writer, name);
43910         desret_int(ret_val);
43911         call_tests++;
43912         des_xmlTextWriterPtr(n_writer, writer, 0);
43913         des_const_xmlChar_ptr(n_name, name, 1);
43914         xmlResetLastError();
43915         if (mem_base != xmlMemBlocks()) {
43916             printf("Leak of %d blocks found in xmlTextWriterStartDTDAttlist",
43917 	           xmlMemBlocks() - mem_base);
43918 	    test_ret++;
43919             printf(" %d", n_writer);
43920             printf(" %d", n_name);
43921             printf("\n");
43922         }
43923     }
43924     }
43925     function_tests++;
43926 #endif
43927 
43928     return(test_ret);
43929 }
43930 
43931 
43932 static int
test_xmlTextWriterStartDTDElement(void)43933 test_xmlTextWriterStartDTDElement(void) {
43934     int test_ret = 0;
43935 
43936 #if defined(LIBXML_WRITER_ENABLED)
43937     int mem_base;
43938     int ret_val;
43939     xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
43940     int n_writer;
43941     const xmlChar * name; /* the name of the DTD element */
43942     int n_name;
43943 
43944     for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
43945     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
43946         mem_base = xmlMemBlocks();
43947         writer = gen_xmlTextWriterPtr(n_writer, 0);
43948         name = gen_const_xmlChar_ptr(n_name, 1);
43949 
43950         ret_val = xmlTextWriterStartDTDElement(writer, name);
43951         desret_int(ret_val);
43952         call_tests++;
43953         des_xmlTextWriterPtr(n_writer, writer, 0);
43954         des_const_xmlChar_ptr(n_name, name, 1);
43955         xmlResetLastError();
43956         if (mem_base != xmlMemBlocks()) {
43957             printf("Leak of %d blocks found in xmlTextWriterStartDTDElement",
43958 	           xmlMemBlocks() - mem_base);
43959 	    test_ret++;
43960             printf(" %d", n_writer);
43961             printf(" %d", n_name);
43962             printf("\n");
43963         }
43964     }
43965     }
43966     function_tests++;
43967 #endif
43968 
43969     return(test_ret);
43970 }
43971 
43972 
43973 static int
test_xmlTextWriterStartDTDEntity(void)43974 test_xmlTextWriterStartDTDEntity(void) {
43975     int test_ret = 0;
43976 
43977 #if defined(LIBXML_WRITER_ENABLED)
43978     int mem_base;
43979     int ret_val;
43980     xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
43981     int n_writer;
43982     int pe; /* TRUE if this is a parameter entity, FALSE if not */
43983     int n_pe;
43984     const xmlChar * name; /* the name of the DTD ATTLIST */
43985     int n_name;
43986 
43987     for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
43988     for (n_pe = 0;n_pe < gen_nb_int;n_pe++) {
43989     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
43990         mem_base = xmlMemBlocks();
43991         writer = gen_xmlTextWriterPtr(n_writer, 0);
43992         pe = gen_int(n_pe, 1);
43993         name = gen_const_xmlChar_ptr(n_name, 2);
43994 
43995         ret_val = xmlTextWriterStartDTDEntity(writer, pe, name);
43996         desret_int(ret_val);
43997         call_tests++;
43998         des_xmlTextWriterPtr(n_writer, writer, 0);
43999         des_int(n_pe, pe, 1);
44000         des_const_xmlChar_ptr(n_name, name, 2);
44001         xmlResetLastError();
44002         if (mem_base != xmlMemBlocks()) {
44003             printf("Leak of %d blocks found in xmlTextWriterStartDTDEntity",
44004 	           xmlMemBlocks() - mem_base);
44005 	    test_ret++;
44006             printf(" %d", n_writer);
44007             printf(" %d", n_pe);
44008             printf(" %d", n_name);
44009             printf("\n");
44010         }
44011     }
44012     }
44013     }
44014     function_tests++;
44015 #endif
44016 
44017     return(test_ret);
44018 }
44019 
44020 
44021 static int
test_xmlTextWriterStartDocument(void)44022 test_xmlTextWriterStartDocument(void) {
44023     int test_ret = 0;
44024 
44025 #if defined(LIBXML_WRITER_ENABLED)
44026     int mem_base;
44027     int ret_val;
44028     xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
44029     int n_writer;
44030     const char * version; /* the xml version ("1.0") or NULL for default ("1.0") */
44031     int n_version;
44032     const char * encoding; /* the encoding or NULL for default */
44033     int n_encoding;
44034     const char * standalone; /* "yes" or "no" or NULL for default */
44035     int n_standalone;
44036 
44037     for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
44038     for (n_version = 0;n_version < gen_nb_const_char_ptr;n_version++) {
44039     for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
44040     for (n_standalone = 0;n_standalone < gen_nb_const_char_ptr;n_standalone++) {
44041         mem_base = xmlMemBlocks();
44042         writer = gen_xmlTextWriterPtr(n_writer, 0);
44043         version = gen_const_char_ptr(n_version, 1);
44044         encoding = gen_const_char_ptr(n_encoding, 2);
44045         standalone = gen_const_char_ptr(n_standalone, 3);
44046 
44047         ret_val = xmlTextWriterStartDocument(writer, version, encoding, standalone);
44048         desret_int(ret_val);
44049         call_tests++;
44050         des_xmlTextWriterPtr(n_writer, writer, 0);
44051         des_const_char_ptr(n_version, version, 1);
44052         des_const_char_ptr(n_encoding, encoding, 2);
44053         des_const_char_ptr(n_standalone, standalone, 3);
44054         xmlResetLastError();
44055         if (mem_base != xmlMemBlocks()) {
44056             printf("Leak of %d blocks found in xmlTextWriterStartDocument",
44057 	           xmlMemBlocks() - mem_base);
44058 	    test_ret++;
44059             printf(" %d", n_writer);
44060             printf(" %d", n_version);
44061             printf(" %d", n_encoding);
44062             printf(" %d", n_standalone);
44063             printf("\n");
44064         }
44065     }
44066     }
44067     }
44068     }
44069     function_tests++;
44070 #endif
44071 
44072     return(test_ret);
44073 }
44074 
44075 
44076 static int
test_xmlTextWriterStartElement(void)44077 test_xmlTextWriterStartElement(void) {
44078     int test_ret = 0;
44079 
44080 #if defined(LIBXML_WRITER_ENABLED)
44081     int mem_base;
44082     int ret_val;
44083     xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
44084     int n_writer;
44085     const xmlChar * name; /* element name */
44086     int n_name;
44087 
44088     for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
44089     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
44090         mem_base = xmlMemBlocks();
44091         writer = gen_xmlTextWriterPtr(n_writer, 0);
44092         name = gen_const_xmlChar_ptr(n_name, 1);
44093 
44094         ret_val = xmlTextWriterStartElement(writer, name);
44095         desret_int(ret_val);
44096         call_tests++;
44097         des_xmlTextWriterPtr(n_writer, writer, 0);
44098         des_const_xmlChar_ptr(n_name, name, 1);
44099         xmlResetLastError();
44100         if (mem_base != xmlMemBlocks()) {
44101             printf("Leak of %d blocks found in xmlTextWriterStartElement",
44102 	           xmlMemBlocks() - mem_base);
44103 	    test_ret++;
44104             printf(" %d", n_writer);
44105             printf(" %d", n_name);
44106             printf("\n");
44107         }
44108     }
44109     }
44110     function_tests++;
44111 #endif
44112 
44113     return(test_ret);
44114 }
44115 
44116 
44117 static int
test_xmlTextWriterStartElementNS(void)44118 test_xmlTextWriterStartElementNS(void) {
44119     int test_ret = 0;
44120 
44121 #if defined(LIBXML_WRITER_ENABLED)
44122     int mem_base;
44123     int ret_val;
44124     xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
44125     int n_writer;
44126     const xmlChar * prefix; /* namespace prefix or NULL */
44127     int n_prefix;
44128     const xmlChar * name; /* element local name */
44129     int n_name;
44130     const xmlChar * namespaceURI; /* namespace URI or NULL */
44131     int n_namespaceURI;
44132 
44133     for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
44134     for (n_prefix = 0;n_prefix < gen_nb_const_xmlChar_ptr;n_prefix++) {
44135     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
44136     for (n_namespaceURI = 0;n_namespaceURI < gen_nb_const_xmlChar_ptr;n_namespaceURI++) {
44137         mem_base = xmlMemBlocks();
44138         writer = gen_xmlTextWriterPtr(n_writer, 0);
44139         prefix = gen_const_xmlChar_ptr(n_prefix, 1);
44140         name = gen_const_xmlChar_ptr(n_name, 2);
44141         namespaceURI = gen_const_xmlChar_ptr(n_namespaceURI, 3);
44142 
44143         ret_val = xmlTextWriterStartElementNS(writer, prefix, name, namespaceURI);
44144         desret_int(ret_val);
44145         call_tests++;
44146         des_xmlTextWriterPtr(n_writer, writer, 0);
44147         des_const_xmlChar_ptr(n_prefix, prefix, 1);
44148         des_const_xmlChar_ptr(n_name, name, 2);
44149         des_const_xmlChar_ptr(n_namespaceURI, namespaceURI, 3);
44150         xmlResetLastError();
44151         if (mem_base != xmlMemBlocks()) {
44152             printf("Leak of %d blocks found in xmlTextWriterStartElementNS",
44153 	           xmlMemBlocks() - mem_base);
44154 	    test_ret++;
44155             printf(" %d", n_writer);
44156             printf(" %d", n_prefix);
44157             printf(" %d", n_name);
44158             printf(" %d", n_namespaceURI);
44159             printf("\n");
44160         }
44161     }
44162     }
44163     }
44164     }
44165     function_tests++;
44166 #endif
44167 
44168     return(test_ret);
44169 }
44170 
44171 
44172 static int
test_xmlTextWriterStartPI(void)44173 test_xmlTextWriterStartPI(void) {
44174     int test_ret = 0;
44175 
44176 #if defined(LIBXML_WRITER_ENABLED)
44177     int mem_base;
44178     int ret_val;
44179     xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
44180     int n_writer;
44181     const xmlChar * target; /* PI target */
44182     int n_target;
44183 
44184     for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
44185     for (n_target = 0;n_target < gen_nb_const_xmlChar_ptr;n_target++) {
44186         mem_base = xmlMemBlocks();
44187         writer = gen_xmlTextWriterPtr(n_writer, 0);
44188         target = gen_const_xmlChar_ptr(n_target, 1);
44189 
44190         ret_val = xmlTextWriterStartPI(writer, target);
44191         desret_int(ret_val);
44192         call_tests++;
44193         des_xmlTextWriterPtr(n_writer, writer, 0);
44194         des_const_xmlChar_ptr(n_target, target, 1);
44195         xmlResetLastError();
44196         if (mem_base != xmlMemBlocks()) {
44197             printf("Leak of %d blocks found in xmlTextWriterStartPI",
44198 	           xmlMemBlocks() - mem_base);
44199 	    test_ret++;
44200             printf(" %d", n_writer);
44201             printf(" %d", n_target);
44202             printf("\n");
44203         }
44204     }
44205     }
44206     function_tests++;
44207 #endif
44208 
44209     return(test_ret);
44210 }
44211 
44212 
44213 static int
test_xmlTextWriterWriteAttribute(void)44214 test_xmlTextWriterWriteAttribute(void) {
44215     int test_ret = 0;
44216 
44217 #if defined(LIBXML_WRITER_ENABLED)
44218     int mem_base;
44219     int ret_val;
44220     xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
44221     int n_writer;
44222     const xmlChar * name; /* attribute name */
44223     int n_name;
44224     const xmlChar * content; /* attribute content */
44225     int n_content;
44226 
44227     for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
44228     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
44229     for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
44230         mem_base = xmlMemBlocks();
44231         writer = gen_xmlTextWriterPtr(n_writer, 0);
44232         name = gen_const_xmlChar_ptr(n_name, 1);
44233         content = gen_const_xmlChar_ptr(n_content, 2);
44234 
44235         ret_val = xmlTextWriterWriteAttribute(writer, name, content);
44236         desret_int(ret_val);
44237         call_tests++;
44238         des_xmlTextWriterPtr(n_writer, writer, 0);
44239         des_const_xmlChar_ptr(n_name, name, 1);
44240         des_const_xmlChar_ptr(n_content, content, 2);
44241         xmlResetLastError();
44242         if (mem_base != xmlMemBlocks()) {
44243             printf("Leak of %d blocks found in xmlTextWriterWriteAttribute",
44244 	           xmlMemBlocks() - mem_base);
44245 	    test_ret++;
44246             printf(" %d", n_writer);
44247             printf(" %d", n_name);
44248             printf(" %d", n_content);
44249             printf("\n");
44250         }
44251     }
44252     }
44253     }
44254     function_tests++;
44255 #endif
44256 
44257     return(test_ret);
44258 }
44259 
44260 
44261 static int
test_xmlTextWriterWriteAttributeNS(void)44262 test_xmlTextWriterWriteAttributeNS(void) {
44263     int test_ret = 0;
44264 
44265 #if defined(LIBXML_WRITER_ENABLED)
44266     int mem_base;
44267     int ret_val;
44268     xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
44269     int n_writer;
44270     const xmlChar * prefix; /* namespace prefix */
44271     int n_prefix;
44272     const xmlChar * name; /* attribute local name */
44273     int n_name;
44274     const xmlChar * namespaceURI; /* namespace URI */
44275     int n_namespaceURI;
44276     const xmlChar * content; /* attribute content */
44277     int n_content;
44278 
44279     for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
44280     for (n_prefix = 0;n_prefix < gen_nb_const_xmlChar_ptr;n_prefix++) {
44281     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
44282     for (n_namespaceURI = 0;n_namespaceURI < gen_nb_const_xmlChar_ptr;n_namespaceURI++) {
44283     for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
44284         mem_base = xmlMemBlocks();
44285         writer = gen_xmlTextWriterPtr(n_writer, 0);
44286         prefix = gen_const_xmlChar_ptr(n_prefix, 1);
44287         name = gen_const_xmlChar_ptr(n_name, 2);
44288         namespaceURI = gen_const_xmlChar_ptr(n_namespaceURI, 3);
44289         content = gen_const_xmlChar_ptr(n_content, 4);
44290 
44291         ret_val = xmlTextWriterWriteAttributeNS(writer, prefix, name, namespaceURI, content);
44292         desret_int(ret_val);
44293         call_tests++;
44294         des_xmlTextWriterPtr(n_writer, writer, 0);
44295         des_const_xmlChar_ptr(n_prefix, prefix, 1);
44296         des_const_xmlChar_ptr(n_name, name, 2);
44297         des_const_xmlChar_ptr(n_namespaceURI, namespaceURI, 3);
44298         des_const_xmlChar_ptr(n_content, content, 4);
44299         xmlResetLastError();
44300         if (mem_base != xmlMemBlocks()) {
44301             printf("Leak of %d blocks found in xmlTextWriterWriteAttributeNS",
44302 	           xmlMemBlocks() - mem_base);
44303 	    test_ret++;
44304             printf(" %d", n_writer);
44305             printf(" %d", n_prefix);
44306             printf(" %d", n_name);
44307             printf(" %d", n_namespaceURI);
44308             printf(" %d", n_content);
44309             printf("\n");
44310         }
44311     }
44312     }
44313     }
44314     }
44315     }
44316     function_tests++;
44317 #endif
44318 
44319     return(test_ret);
44320 }
44321 
44322 
44323 static int
test_xmlTextWriterWriteBase64(void)44324 test_xmlTextWriterWriteBase64(void) {
44325     int test_ret = 0;
44326 
44327 #if defined(LIBXML_WRITER_ENABLED)
44328     int mem_base;
44329     int ret_val;
44330     xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
44331     int n_writer;
44332     const char * data; /* binary data */
44333     int n_data;
44334     int start; /* the position within the data of the first byte to encode */
44335     int n_start;
44336     int len; /* the number of bytes to encode */
44337     int n_len;
44338 
44339     for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
44340     for (n_data = 0;n_data < gen_nb_const_char_ptr;n_data++) {
44341     for (n_start = 0;n_start < gen_nb_int;n_start++) {
44342     for (n_len = 0;n_len < gen_nb_int;n_len++) {
44343         mem_base = xmlMemBlocks();
44344         writer = gen_xmlTextWriterPtr(n_writer, 0);
44345         data = gen_const_char_ptr(n_data, 1);
44346         start = gen_int(n_start, 2);
44347         len = gen_int(n_len, 3);
44348         if ((data != NULL) &&
44349             (start > xmlStrlen(BAD_CAST data)))
44350             start = 0;
44351         if ((data != NULL) &&
44352             (len > xmlStrlen(BAD_CAST data)))
44353             len = 0;
44354 
44355         ret_val = xmlTextWriterWriteBase64(writer, data, start, len);
44356         desret_int(ret_val);
44357         call_tests++;
44358         des_xmlTextWriterPtr(n_writer, writer, 0);
44359         des_const_char_ptr(n_data, data, 1);
44360         des_int(n_start, start, 2);
44361         des_int(n_len, len, 3);
44362         xmlResetLastError();
44363         if (mem_base != xmlMemBlocks()) {
44364             printf("Leak of %d blocks found in xmlTextWriterWriteBase64",
44365 	           xmlMemBlocks() - mem_base);
44366 	    test_ret++;
44367             printf(" %d", n_writer);
44368             printf(" %d", n_data);
44369             printf(" %d", n_start);
44370             printf(" %d", n_len);
44371             printf("\n");
44372         }
44373     }
44374     }
44375     }
44376     }
44377     function_tests++;
44378 #endif
44379 
44380     return(test_ret);
44381 }
44382 
44383 
44384 static int
test_xmlTextWriterWriteBinHex(void)44385 test_xmlTextWriterWriteBinHex(void) {
44386     int test_ret = 0;
44387 
44388 #if defined(LIBXML_WRITER_ENABLED)
44389     int mem_base;
44390     int ret_val;
44391     xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
44392     int n_writer;
44393     const char * data; /* binary data */
44394     int n_data;
44395     int start; /* the position within the data of the first byte to encode */
44396     int n_start;
44397     int len; /* the number of bytes to encode */
44398     int n_len;
44399 
44400     for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
44401     for (n_data = 0;n_data < gen_nb_const_char_ptr;n_data++) {
44402     for (n_start = 0;n_start < gen_nb_int;n_start++) {
44403     for (n_len = 0;n_len < gen_nb_int;n_len++) {
44404         mem_base = xmlMemBlocks();
44405         writer = gen_xmlTextWriterPtr(n_writer, 0);
44406         data = gen_const_char_ptr(n_data, 1);
44407         start = gen_int(n_start, 2);
44408         len = gen_int(n_len, 3);
44409         if ((data != NULL) &&
44410             (start > xmlStrlen(BAD_CAST data)))
44411             start = 0;
44412         if ((data != NULL) &&
44413             (len > xmlStrlen(BAD_CAST data)))
44414             len = 0;
44415 
44416         ret_val = xmlTextWriterWriteBinHex(writer, data, start, len);
44417         desret_int(ret_val);
44418         call_tests++;
44419         des_xmlTextWriterPtr(n_writer, writer, 0);
44420         des_const_char_ptr(n_data, data, 1);
44421         des_int(n_start, start, 2);
44422         des_int(n_len, len, 3);
44423         xmlResetLastError();
44424         if (mem_base != xmlMemBlocks()) {
44425             printf("Leak of %d blocks found in xmlTextWriterWriteBinHex",
44426 	           xmlMemBlocks() - mem_base);
44427 	    test_ret++;
44428             printf(" %d", n_writer);
44429             printf(" %d", n_data);
44430             printf(" %d", n_start);
44431             printf(" %d", n_len);
44432             printf("\n");
44433         }
44434     }
44435     }
44436     }
44437     }
44438     function_tests++;
44439 #endif
44440 
44441     return(test_ret);
44442 }
44443 
44444 
44445 static int
test_xmlTextWriterWriteCDATA(void)44446 test_xmlTextWriterWriteCDATA(void) {
44447     int test_ret = 0;
44448 
44449 #if defined(LIBXML_WRITER_ENABLED)
44450     int mem_base;
44451     int ret_val;
44452     xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
44453     int n_writer;
44454     const xmlChar * content; /* CDATA content */
44455     int n_content;
44456 
44457     for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
44458     for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
44459         mem_base = xmlMemBlocks();
44460         writer = gen_xmlTextWriterPtr(n_writer, 0);
44461         content = gen_const_xmlChar_ptr(n_content, 1);
44462 
44463         ret_val = xmlTextWriterWriteCDATA(writer, content);
44464         desret_int(ret_val);
44465         call_tests++;
44466         des_xmlTextWriterPtr(n_writer, writer, 0);
44467         des_const_xmlChar_ptr(n_content, content, 1);
44468         xmlResetLastError();
44469         if (mem_base != xmlMemBlocks()) {
44470             printf("Leak of %d blocks found in xmlTextWriterWriteCDATA",
44471 	           xmlMemBlocks() - mem_base);
44472 	    test_ret++;
44473             printf(" %d", n_writer);
44474             printf(" %d", n_content);
44475             printf("\n");
44476         }
44477     }
44478     }
44479     function_tests++;
44480 #endif
44481 
44482     return(test_ret);
44483 }
44484 
44485 
44486 static int
test_xmlTextWriterWriteComment(void)44487 test_xmlTextWriterWriteComment(void) {
44488     int test_ret = 0;
44489 
44490 #if defined(LIBXML_WRITER_ENABLED)
44491     int mem_base;
44492     int ret_val;
44493     xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
44494     int n_writer;
44495     const xmlChar * content; /* comment string */
44496     int n_content;
44497 
44498     for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
44499     for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
44500         mem_base = xmlMemBlocks();
44501         writer = gen_xmlTextWriterPtr(n_writer, 0);
44502         content = gen_const_xmlChar_ptr(n_content, 1);
44503 
44504         ret_val = xmlTextWriterWriteComment(writer, content);
44505         desret_int(ret_val);
44506         call_tests++;
44507         des_xmlTextWriterPtr(n_writer, writer, 0);
44508         des_const_xmlChar_ptr(n_content, content, 1);
44509         xmlResetLastError();
44510         if (mem_base != xmlMemBlocks()) {
44511             printf("Leak of %d blocks found in xmlTextWriterWriteComment",
44512 	           xmlMemBlocks() - mem_base);
44513 	    test_ret++;
44514             printf(" %d", n_writer);
44515             printf(" %d", n_content);
44516             printf("\n");
44517         }
44518     }
44519     }
44520     function_tests++;
44521 #endif
44522 
44523     return(test_ret);
44524 }
44525 
44526 
44527 static int
test_xmlTextWriterWriteDTD(void)44528 test_xmlTextWriterWriteDTD(void) {
44529     int test_ret = 0;
44530 
44531 #if defined(LIBXML_WRITER_ENABLED)
44532     int mem_base;
44533     int ret_val;
44534     xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
44535     int n_writer;
44536     const xmlChar * name; /* the name of the DTD */
44537     int n_name;
44538     const xmlChar * pubid; /* the public identifier, which is an alternative to the system identifier */
44539     int n_pubid;
44540     const xmlChar * sysid; /* the system identifier, which is the URI of the DTD */
44541     int n_sysid;
44542     const xmlChar * subset; /* string content of the DTD */
44543     int n_subset;
44544 
44545     for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
44546     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
44547     for (n_pubid = 0;n_pubid < gen_nb_const_xmlChar_ptr;n_pubid++) {
44548     for (n_sysid = 0;n_sysid < gen_nb_const_xmlChar_ptr;n_sysid++) {
44549     for (n_subset = 0;n_subset < gen_nb_const_xmlChar_ptr;n_subset++) {
44550         mem_base = xmlMemBlocks();
44551         writer = gen_xmlTextWriterPtr(n_writer, 0);
44552         name = gen_const_xmlChar_ptr(n_name, 1);
44553         pubid = gen_const_xmlChar_ptr(n_pubid, 2);
44554         sysid = gen_const_xmlChar_ptr(n_sysid, 3);
44555         subset = gen_const_xmlChar_ptr(n_subset, 4);
44556 
44557         ret_val = xmlTextWriterWriteDTD(writer, name, pubid, sysid, subset);
44558         desret_int(ret_val);
44559         call_tests++;
44560         des_xmlTextWriterPtr(n_writer, writer, 0);
44561         des_const_xmlChar_ptr(n_name, name, 1);
44562         des_const_xmlChar_ptr(n_pubid, pubid, 2);
44563         des_const_xmlChar_ptr(n_sysid, sysid, 3);
44564         des_const_xmlChar_ptr(n_subset, subset, 4);
44565         xmlResetLastError();
44566         if (mem_base != xmlMemBlocks()) {
44567             printf("Leak of %d blocks found in xmlTextWriterWriteDTD",
44568 	           xmlMemBlocks() - mem_base);
44569 	    test_ret++;
44570             printf(" %d", n_writer);
44571             printf(" %d", n_name);
44572             printf(" %d", n_pubid);
44573             printf(" %d", n_sysid);
44574             printf(" %d", n_subset);
44575             printf("\n");
44576         }
44577     }
44578     }
44579     }
44580     }
44581     }
44582     function_tests++;
44583 #endif
44584 
44585     return(test_ret);
44586 }
44587 
44588 
44589 static int
test_xmlTextWriterWriteDTDAttlist(void)44590 test_xmlTextWriterWriteDTDAttlist(void) {
44591     int test_ret = 0;
44592 
44593 #if defined(LIBXML_WRITER_ENABLED)
44594     int mem_base;
44595     int ret_val;
44596     xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
44597     int n_writer;
44598     const xmlChar * name; /* the name of the DTD ATTLIST */
44599     int n_name;
44600     const xmlChar * content; /* content of the ATTLIST */
44601     int n_content;
44602 
44603     for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
44604     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
44605     for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
44606         mem_base = xmlMemBlocks();
44607         writer = gen_xmlTextWriterPtr(n_writer, 0);
44608         name = gen_const_xmlChar_ptr(n_name, 1);
44609         content = gen_const_xmlChar_ptr(n_content, 2);
44610 
44611         ret_val = xmlTextWriterWriteDTDAttlist(writer, name, content);
44612         desret_int(ret_val);
44613         call_tests++;
44614         des_xmlTextWriterPtr(n_writer, writer, 0);
44615         des_const_xmlChar_ptr(n_name, name, 1);
44616         des_const_xmlChar_ptr(n_content, content, 2);
44617         xmlResetLastError();
44618         if (mem_base != xmlMemBlocks()) {
44619             printf("Leak of %d blocks found in xmlTextWriterWriteDTDAttlist",
44620 	           xmlMemBlocks() - mem_base);
44621 	    test_ret++;
44622             printf(" %d", n_writer);
44623             printf(" %d", n_name);
44624             printf(" %d", n_content);
44625             printf("\n");
44626         }
44627     }
44628     }
44629     }
44630     function_tests++;
44631 #endif
44632 
44633     return(test_ret);
44634 }
44635 
44636 
44637 static int
test_xmlTextWriterWriteDTDElement(void)44638 test_xmlTextWriterWriteDTDElement(void) {
44639     int test_ret = 0;
44640 
44641 #if defined(LIBXML_WRITER_ENABLED)
44642     int mem_base;
44643     int ret_val;
44644     xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
44645     int n_writer;
44646     const xmlChar * name; /* the name of the DTD element */
44647     int n_name;
44648     const xmlChar * content; /* content of the element */
44649     int n_content;
44650 
44651     for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
44652     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
44653     for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
44654         mem_base = xmlMemBlocks();
44655         writer = gen_xmlTextWriterPtr(n_writer, 0);
44656         name = gen_const_xmlChar_ptr(n_name, 1);
44657         content = gen_const_xmlChar_ptr(n_content, 2);
44658 
44659         ret_val = xmlTextWriterWriteDTDElement(writer, name, content);
44660         desret_int(ret_val);
44661         call_tests++;
44662         des_xmlTextWriterPtr(n_writer, writer, 0);
44663         des_const_xmlChar_ptr(n_name, name, 1);
44664         des_const_xmlChar_ptr(n_content, content, 2);
44665         xmlResetLastError();
44666         if (mem_base != xmlMemBlocks()) {
44667             printf("Leak of %d blocks found in xmlTextWriterWriteDTDElement",
44668 	           xmlMemBlocks() - mem_base);
44669 	    test_ret++;
44670             printf(" %d", n_writer);
44671             printf(" %d", n_name);
44672             printf(" %d", n_content);
44673             printf("\n");
44674         }
44675     }
44676     }
44677     }
44678     function_tests++;
44679 #endif
44680 
44681     return(test_ret);
44682 }
44683 
44684 
44685 static int
test_xmlTextWriterWriteDTDEntity(void)44686 test_xmlTextWriterWriteDTDEntity(void) {
44687     int test_ret = 0;
44688 
44689 #if defined(LIBXML_WRITER_ENABLED)
44690     int mem_base;
44691     int ret_val;
44692     xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
44693     int n_writer;
44694     int pe; /* TRUE if this is a parameter entity, FALSE if not */
44695     int n_pe;
44696     const xmlChar * name; /* the name of the DTD entity */
44697     int n_name;
44698     const xmlChar * pubid; /* the public identifier, which is an alternative to the system identifier */
44699     int n_pubid;
44700     const xmlChar * sysid; /* the system identifier, which is the URI of the DTD */
44701     int n_sysid;
44702     const xmlChar * ndataid; /* the xml notation name. */
44703     int n_ndataid;
44704     const xmlChar * content; /* content of the entity */
44705     int n_content;
44706 
44707     for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
44708     for (n_pe = 0;n_pe < gen_nb_int;n_pe++) {
44709     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
44710     for (n_pubid = 0;n_pubid < gen_nb_const_xmlChar_ptr;n_pubid++) {
44711     for (n_sysid = 0;n_sysid < gen_nb_const_xmlChar_ptr;n_sysid++) {
44712     for (n_ndataid = 0;n_ndataid < gen_nb_const_xmlChar_ptr;n_ndataid++) {
44713     for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
44714         mem_base = xmlMemBlocks();
44715         writer = gen_xmlTextWriterPtr(n_writer, 0);
44716         pe = gen_int(n_pe, 1);
44717         name = gen_const_xmlChar_ptr(n_name, 2);
44718         pubid = gen_const_xmlChar_ptr(n_pubid, 3);
44719         sysid = gen_const_xmlChar_ptr(n_sysid, 4);
44720         ndataid = gen_const_xmlChar_ptr(n_ndataid, 5);
44721         content = gen_const_xmlChar_ptr(n_content, 6);
44722 
44723         ret_val = xmlTextWriterWriteDTDEntity(writer, pe, name, pubid, sysid, ndataid, content);
44724         desret_int(ret_val);
44725         call_tests++;
44726         des_xmlTextWriterPtr(n_writer, writer, 0);
44727         des_int(n_pe, pe, 1);
44728         des_const_xmlChar_ptr(n_name, name, 2);
44729         des_const_xmlChar_ptr(n_pubid, pubid, 3);
44730         des_const_xmlChar_ptr(n_sysid, sysid, 4);
44731         des_const_xmlChar_ptr(n_ndataid, ndataid, 5);
44732         des_const_xmlChar_ptr(n_content, content, 6);
44733         xmlResetLastError();
44734         if (mem_base != xmlMemBlocks()) {
44735             printf("Leak of %d blocks found in xmlTextWriterWriteDTDEntity",
44736 	           xmlMemBlocks() - mem_base);
44737 	    test_ret++;
44738             printf(" %d", n_writer);
44739             printf(" %d", n_pe);
44740             printf(" %d", n_name);
44741             printf(" %d", n_pubid);
44742             printf(" %d", n_sysid);
44743             printf(" %d", n_ndataid);
44744             printf(" %d", n_content);
44745             printf("\n");
44746         }
44747     }
44748     }
44749     }
44750     }
44751     }
44752     }
44753     }
44754     function_tests++;
44755 #endif
44756 
44757     return(test_ret);
44758 }
44759 
44760 
44761 static int
test_xmlTextWriterWriteDTDExternalEntity(void)44762 test_xmlTextWriterWriteDTDExternalEntity(void) {
44763     int test_ret = 0;
44764 
44765 #if defined(LIBXML_WRITER_ENABLED)
44766     int mem_base;
44767     int ret_val;
44768     xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
44769     int n_writer;
44770     int pe; /* TRUE if this is a parameter entity, FALSE if not */
44771     int n_pe;
44772     const xmlChar * name; /* the name of the DTD entity */
44773     int n_name;
44774     const xmlChar * pubid; /* the public identifier, which is an alternative to the system identifier */
44775     int n_pubid;
44776     const xmlChar * sysid; /* the system identifier, which is the URI of the DTD */
44777     int n_sysid;
44778     const xmlChar * ndataid; /* the xml notation name. */
44779     int n_ndataid;
44780 
44781     for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
44782     for (n_pe = 0;n_pe < gen_nb_int;n_pe++) {
44783     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
44784     for (n_pubid = 0;n_pubid < gen_nb_const_xmlChar_ptr;n_pubid++) {
44785     for (n_sysid = 0;n_sysid < gen_nb_const_xmlChar_ptr;n_sysid++) {
44786     for (n_ndataid = 0;n_ndataid < gen_nb_const_xmlChar_ptr;n_ndataid++) {
44787         mem_base = xmlMemBlocks();
44788         writer = gen_xmlTextWriterPtr(n_writer, 0);
44789         pe = gen_int(n_pe, 1);
44790         name = gen_const_xmlChar_ptr(n_name, 2);
44791         pubid = gen_const_xmlChar_ptr(n_pubid, 3);
44792         sysid = gen_const_xmlChar_ptr(n_sysid, 4);
44793         ndataid = gen_const_xmlChar_ptr(n_ndataid, 5);
44794 
44795         ret_val = xmlTextWriterWriteDTDExternalEntity(writer, pe, name, pubid, sysid, ndataid);
44796         desret_int(ret_val);
44797         call_tests++;
44798         des_xmlTextWriterPtr(n_writer, writer, 0);
44799         des_int(n_pe, pe, 1);
44800         des_const_xmlChar_ptr(n_name, name, 2);
44801         des_const_xmlChar_ptr(n_pubid, pubid, 3);
44802         des_const_xmlChar_ptr(n_sysid, sysid, 4);
44803         des_const_xmlChar_ptr(n_ndataid, ndataid, 5);
44804         xmlResetLastError();
44805         if (mem_base != xmlMemBlocks()) {
44806             printf("Leak of %d blocks found in xmlTextWriterWriteDTDExternalEntity",
44807 	           xmlMemBlocks() - mem_base);
44808 	    test_ret++;
44809             printf(" %d", n_writer);
44810             printf(" %d", n_pe);
44811             printf(" %d", n_name);
44812             printf(" %d", n_pubid);
44813             printf(" %d", n_sysid);
44814             printf(" %d", n_ndataid);
44815             printf("\n");
44816         }
44817     }
44818     }
44819     }
44820     }
44821     }
44822     }
44823     function_tests++;
44824 #endif
44825 
44826     return(test_ret);
44827 }
44828 
44829 
44830 static int
test_xmlTextWriterWriteDTDExternalEntityContents(void)44831 test_xmlTextWriterWriteDTDExternalEntityContents(void) {
44832     int test_ret = 0;
44833 
44834 #if defined(LIBXML_WRITER_ENABLED)
44835     int mem_base;
44836     int ret_val;
44837     xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
44838     int n_writer;
44839     const xmlChar * pubid; /* the public identifier, which is an alternative to the system identifier */
44840     int n_pubid;
44841     const xmlChar * sysid; /* the system identifier, which is the URI of the DTD */
44842     int n_sysid;
44843     const xmlChar * ndataid; /* the xml notation name. */
44844     int n_ndataid;
44845 
44846     for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
44847     for (n_pubid = 0;n_pubid < gen_nb_const_xmlChar_ptr;n_pubid++) {
44848     for (n_sysid = 0;n_sysid < gen_nb_const_xmlChar_ptr;n_sysid++) {
44849     for (n_ndataid = 0;n_ndataid < gen_nb_const_xmlChar_ptr;n_ndataid++) {
44850         mem_base = xmlMemBlocks();
44851         writer = gen_xmlTextWriterPtr(n_writer, 0);
44852         pubid = gen_const_xmlChar_ptr(n_pubid, 1);
44853         sysid = gen_const_xmlChar_ptr(n_sysid, 2);
44854         ndataid = gen_const_xmlChar_ptr(n_ndataid, 3);
44855 
44856         ret_val = xmlTextWriterWriteDTDExternalEntityContents(writer, pubid, sysid, ndataid);
44857         desret_int(ret_val);
44858         call_tests++;
44859         des_xmlTextWriterPtr(n_writer, writer, 0);
44860         des_const_xmlChar_ptr(n_pubid, pubid, 1);
44861         des_const_xmlChar_ptr(n_sysid, sysid, 2);
44862         des_const_xmlChar_ptr(n_ndataid, ndataid, 3);
44863         xmlResetLastError();
44864         if (mem_base != xmlMemBlocks()) {
44865             printf("Leak of %d blocks found in xmlTextWriterWriteDTDExternalEntityContents",
44866 	           xmlMemBlocks() - mem_base);
44867 	    test_ret++;
44868             printf(" %d", n_writer);
44869             printf(" %d", n_pubid);
44870             printf(" %d", n_sysid);
44871             printf(" %d", n_ndataid);
44872             printf("\n");
44873         }
44874     }
44875     }
44876     }
44877     }
44878     function_tests++;
44879 #endif
44880 
44881     return(test_ret);
44882 }
44883 
44884 
44885 static int
test_xmlTextWriterWriteDTDInternalEntity(void)44886 test_xmlTextWriterWriteDTDInternalEntity(void) {
44887     int test_ret = 0;
44888 
44889 #if defined(LIBXML_WRITER_ENABLED)
44890     int mem_base;
44891     int ret_val;
44892     xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
44893     int n_writer;
44894     int pe; /* TRUE if this is a parameter entity, FALSE if not */
44895     int n_pe;
44896     const xmlChar * name; /* the name of the DTD entity */
44897     int n_name;
44898     const xmlChar * content; /* content of the entity */
44899     int n_content;
44900 
44901     for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
44902     for (n_pe = 0;n_pe < gen_nb_int;n_pe++) {
44903     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
44904     for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
44905         mem_base = xmlMemBlocks();
44906         writer = gen_xmlTextWriterPtr(n_writer, 0);
44907         pe = gen_int(n_pe, 1);
44908         name = gen_const_xmlChar_ptr(n_name, 2);
44909         content = gen_const_xmlChar_ptr(n_content, 3);
44910 
44911         ret_val = xmlTextWriterWriteDTDInternalEntity(writer, pe, name, content);
44912         desret_int(ret_val);
44913         call_tests++;
44914         des_xmlTextWriterPtr(n_writer, writer, 0);
44915         des_int(n_pe, pe, 1);
44916         des_const_xmlChar_ptr(n_name, name, 2);
44917         des_const_xmlChar_ptr(n_content, content, 3);
44918         xmlResetLastError();
44919         if (mem_base != xmlMemBlocks()) {
44920             printf("Leak of %d blocks found in xmlTextWriterWriteDTDInternalEntity",
44921 	           xmlMemBlocks() - mem_base);
44922 	    test_ret++;
44923             printf(" %d", n_writer);
44924             printf(" %d", n_pe);
44925             printf(" %d", n_name);
44926             printf(" %d", n_content);
44927             printf("\n");
44928         }
44929     }
44930     }
44931     }
44932     }
44933     function_tests++;
44934 #endif
44935 
44936     return(test_ret);
44937 }
44938 
44939 
44940 static int
test_xmlTextWriterWriteDTDNotation(void)44941 test_xmlTextWriterWriteDTDNotation(void) {
44942     int test_ret = 0;
44943 
44944 #if defined(LIBXML_WRITER_ENABLED)
44945     int mem_base;
44946     int ret_val;
44947     xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
44948     int n_writer;
44949     const xmlChar * name; /* the name of the xml notation */
44950     int n_name;
44951     const xmlChar * pubid; /* the public identifier, which is an alternative to the system identifier */
44952     int n_pubid;
44953     const xmlChar * sysid; /* the system identifier, which is the URI of the DTD */
44954     int n_sysid;
44955 
44956     for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
44957     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
44958     for (n_pubid = 0;n_pubid < gen_nb_const_xmlChar_ptr;n_pubid++) {
44959     for (n_sysid = 0;n_sysid < gen_nb_const_xmlChar_ptr;n_sysid++) {
44960         mem_base = xmlMemBlocks();
44961         writer = gen_xmlTextWriterPtr(n_writer, 0);
44962         name = gen_const_xmlChar_ptr(n_name, 1);
44963         pubid = gen_const_xmlChar_ptr(n_pubid, 2);
44964         sysid = gen_const_xmlChar_ptr(n_sysid, 3);
44965 
44966         ret_val = xmlTextWriterWriteDTDNotation(writer, name, pubid, sysid);
44967         desret_int(ret_val);
44968         call_tests++;
44969         des_xmlTextWriterPtr(n_writer, writer, 0);
44970         des_const_xmlChar_ptr(n_name, name, 1);
44971         des_const_xmlChar_ptr(n_pubid, pubid, 2);
44972         des_const_xmlChar_ptr(n_sysid, sysid, 3);
44973         xmlResetLastError();
44974         if (mem_base != xmlMemBlocks()) {
44975             printf("Leak of %d blocks found in xmlTextWriterWriteDTDNotation",
44976 	           xmlMemBlocks() - mem_base);
44977 	    test_ret++;
44978             printf(" %d", n_writer);
44979             printf(" %d", n_name);
44980             printf(" %d", n_pubid);
44981             printf(" %d", n_sysid);
44982             printf("\n");
44983         }
44984     }
44985     }
44986     }
44987     }
44988     function_tests++;
44989 #endif
44990 
44991     return(test_ret);
44992 }
44993 
44994 
44995 static int
test_xmlTextWriterWriteElement(void)44996 test_xmlTextWriterWriteElement(void) {
44997     int test_ret = 0;
44998 
44999 #if defined(LIBXML_WRITER_ENABLED)
45000     int mem_base;
45001     int ret_val;
45002     xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
45003     int n_writer;
45004     const xmlChar * name; /* element name */
45005     int n_name;
45006     const xmlChar * content; /* element content */
45007     int n_content;
45008 
45009     for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
45010     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
45011     for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
45012         mem_base = xmlMemBlocks();
45013         writer = gen_xmlTextWriterPtr(n_writer, 0);
45014         name = gen_const_xmlChar_ptr(n_name, 1);
45015         content = gen_const_xmlChar_ptr(n_content, 2);
45016 
45017         ret_val = xmlTextWriterWriteElement(writer, name, content);
45018         desret_int(ret_val);
45019         call_tests++;
45020         des_xmlTextWriterPtr(n_writer, writer, 0);
45021         des_const_xmlChar_ptr(n_name, name, 1);
45022         des_const_xmlChar_ptr(n_content, content, 2);
45023         xmlResetLastError();
45024         if (mem_base != xmlMemBlocks()) {
45025             printf("Leak of %d blocks found in xmlTextWriterWriteElement",
45026 	           xmlMemBlocks() - mem_base);
45027 	    test_ret++;
45028             printf(" %d", n_writer);
45029             printf(" %d", n_name);
45030             printf(" %d", n_content);
45031             printf("\n");
45032         }
45033     }
45034     }
45035     }
45036     function_tests++;
45037 #endif
45038 
45039     return(test_ret);
45040 }
45041 
45042 
45043 static int
test_xmlTextWriterWriteElementNS(void)45044 test_xmlTextWriterWriteElementNS(void) {
45045     int test_ret = 0;
45046 
45047 #if defined(LIBXML_WRITER_ENABLED)
45048     int mem_base;
45049     int ret_val;
45050     xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
45051     int n_writer;
45052     const xmlChar * prefix; /* namespace prefix */
45053     int n_prefix;
45054     const xmlChar * name; /* element local name */
45055     int n_name;
45056     const xmlChar * namespaceURI; /* namespace URI */
45057     int n_namespaceURI;
45058     const xmlChar * content; /* element content */
45059     int n_content;
45060 
45061     for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
45062     for (n_prefix = 0;n_prefix < gen_nb_const_xmlChar_ptr;n_prefix++) {
45063     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
45064     for (n_namespaceURI = 0;n_namespaceURI < gen_nb_const_xmlChar_ptr;n_namespaceURI++) {
45065     for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
45066         mem_base = xmlMemBlocks();
45067         writer = gen_xmlTextWriterPtr(n_writer, 0);
45068         prefix = gen_const_xmlChar_ptr(n_prefix, 1);
45069         name = gen_const_xmlChar_ptr(n_name, 2);
45070         namespaceURI = gen_const_xmlChar_ptr(n_namespaceURI, 3);
45071         content = gen_const_xmlChar_ptr(n_content, 4);
45072 
45073         ret_val = xmlTextWriterWriteElementNS(writer, prefix, name, namespaceURI, content);
45074         desret_int(ret_val);
45075         call_tests++;
45076         des_xmlTextWriterPtr(n_writer, writer, 0);
45077         des_const_xmlChar_ptr(n_prefix, prefix, 1);
45078         des_const_xmlChar_ptr(n_name, name, 2);
45079         des_const_xmlChar_ptr(n_namespaceURI, namespaceURI, 3);
45080         des_const_xmlChar_ptr(n_content, content, 4);
45081         xmlResetLastError();
45082         if (mem_base != xmlMemBlocks()) {
45083             printf("Leak of %d blocks found in xmlTextWriterWriteElementNS",
45084 	           xmlMemBlocks() - mem_base);
45085 	    test_ret++;
45086             printf(" %d", n_writer);
45087             printf(" %d", n_prefix);
45088             printf(" %d", n_name);
45089             printf(" %d", n_namespaceURI);
45090             printf(" %d", n_content);
45091             printf("\n");
45092         }
45093     }
45094     }
45095     }
45096     }
45097     }
45098     function_tests++;
45099 #endif
45100 
45101     return(test_ret);
45102 }
45103 
45104 
45105 static int
test_xmlTextWriterWriteFormatAttribute(void)45106 test_xmlTextWriterWriteFormatAttribute(void) {
45107     int test_ret = 0;
45108 
45109 
45110     /* missing type support */
45111     return(test_ret);
45112 }
45113 
45114 
45115 static int
test_xmlTextWriterWriteFormatAttributeNS(void)45116 test_xmlTextWriterWriteFormatAttributeNS(void) {
45117     int test_ret = 0;
45118 
45119 
45120     /* missing type support */
45121     return(test_ret);
45122 }
45123 
45124 
45125 static int
test_xmlTextWriterWriteFormatCDATA(void)45126 test_xmlTextWriterWriteFormatCDATA(void) {
45127     int test_ret = 0;
45128 
45129 
45130     /* missing type support */
45131     return(test_ret);
45132 }
45133 
45134 
45135 static int
test_xmlTextWriterWriteFormatComment(void)45136 test_xmlTextWriterWriteFormatComment(void) {
45137     int test_ret = 0;
45138 
45139 
45140     /* missing type support */
45141     return(test_ret);
45142 }
45143 
45144 
45145 static int
test_xmlTextWriterWriteFormatDTD(void)45146 test_xmlTextWriterWriteFormatDTD(void) {
45147     int test_ret = 0;
45148 
45149 
45150     /* missing type support */
45151     return(test_ret);
45152 }
45153 
45154 
45155 static int
test_xmlTextWriterWriteFormatDTDAttlist(void)45156 test_xmlTextWriterWriteFormatDTDAttlist(void) {
45157     int test_ret = 0;
45158 
45159 
45160     /* missing type support */
45161     return(test_ret);
45162 }
45163 
45164 
45165 static int
test_xmlTextWriterWriteFormatDTDElement(void)45166 test_xmlTextWriterWriteFormatDTDElement(void) {
45167     int test_ret = 0;
45168 
45169 
45170     /* missing type support */
45171     return(test_ret);
45172 }
45173 
45174 
45175 static int
test_xmlTextWriterWriteFormatDTDInternalEntity(void)45176 test_xmlTextWriterWriteFormatDTDInternalEntity(void) {
45177     int test_ret = 0;
45178 
45179 
45180     /* missing type support */
45181     return(test_ret);
45182 }
45183 
45184 
45185 static int
test_xmlTextWriterWriteFormatElement(void)45186 test_xmlTextWriterWriteFormatElement(void) {
45187     int test_ret = 0;
45188 
45189 
45190     /* missing type support */
45191     return(test_ret);
45192 }
45193 
45194 
45195 static int
test_xmlTextWriterWriteFormatElementNS(void)45196 test_xmlTextWriterWriteFormatElementNS(void) {
45197     int test_ret = 0;
45198 
45199 
45200     /* missing type support */
45201     return(test_ret);
45202 }
45203 
45204 
45205 static int
test_xmlTextWriterWriteFormatPI(void)45206 test_xmlTextWriterWriteFormatPI(void) {
45207     int test_ret = 0;
45208 
45209 
45210     /* missing type support */
45211     return(test_ret);
45212 }
45213 
45214 
45215 static int
test_xmlTextWriterWriteFormatRaw(void)45216 test_xmlTextWriterWriteFormatRaw(void) {
45217     int test_ret = 0;
45218 
45219 
45220     /* missing type support */
45221     return(test_ret);
45222 }
45223 
45224 
45225 static int
test_xmlTextWriterWriteFormatString(void)45226 test_xmlTextWriterWriteFormatString(void) {
45227     int test_ret = 0;
45228 
45229 
45230     /* missing type support */
45231     return(test_ret);
45232 }
45233 
45234 
45235 static int
test_xmlTextWriterWritePI(void)45236 test_xmlTextWriterWritePI(void) {
45237     int test_ret = 0;
45238 
45239 #if defined(LIBXML_WRITER_ENABLED)
45240     int mem_base;
45241     int ret_val;
45242     xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
45243     int n_writer;
45244     const xmlChar * target; /* PI target */
45245     int n_target;
45246     const xmlChar * content; /* PI content */
45247     int n_content;
45248 
45249     for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
45250     for (n_target = 0;n_target < gen_nb_const_xmlChar_ptr;n_target++) {
45251     for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
45252         mem_base = xmlMemBlocks();
45253         writer = gen_xmlTextWriterPtr(n_writer, 0);
45254         target = gen_const_xmlChar_ptr(n_target, 1);
45255         content = gen_const_xmlChar_ptr(n_content, 2);
45256 
45257         ret_val = xmlTextWriterWritePI(writer, target, content);
45258         desret_int(ret_val);
45259         call_tests++;
45260         des_xmlTextWriterPtr(n_writer, writer, 0);
45261         des_const_xmlChar_ptr(n_target, target, 1);
45262         des_const_xmlChar_ptr(n_content, content, 2);
45263         xmlResetLastError();
45264         if (mem_base != xmlMemBlocks()) {
45265             printf("Leak of %d blocks found in xmlTextWriterWritePI",
45266 	           xmlMemBlocks() - mem_base);
45267 	    test_ret++;
45268             printf(" %d", n_writer);
45269             printf(" %d", n_target);
45270             printf(" %d", n_content);
45271             printf("\n");
45272         }
45273     }
45274     }
45275     }
45276     function_tests++;
45277 #endif
45278 
45279     return(test_ret);
45280 }
45281 
45282 
45283 static int
test_xmlTextWriterWriteRaw(void)45284 test_xmlTextWriterWriteRaw(void) {
45285     int test_ret = 0;
45286 
45287 #if defined(LIBXML_WRITER_ENABLED)
45288     int mem_base;
45289     int ret_val;
45290     xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
45291     int n_writer;
45292     const xmlChar * content; /* text string */
45293     int n_content;
45294 
45295     for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
45296     for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
45297         mem_base = xmlMemBlocks();
45298         writer = gen_xmlTextWriterPtr(n_writer, 0);
45299         content = gen_const_xmlChar_ptr(n_content, 1);
45300 
45301         ret_val = xmlTextWriterWriteRaw(writer, content);
45302         desret_int(ret_val);
45303         call_tests++;
45304         des_xmlTextWriterPtr(n_writer, writer, 0);
45305         des_const_xmlChar_ptr(n_content, content, 1);
45306         xmlResetLastError();
45307         if (mem_base != xmlMemBlocks()) {
45308             printf("Leak of %d blocks found in xmlTextWriterWriteRaw",
45309 	           xmlMemBlocks() - mem_base);
45310 	    test_ret++;
45311             printf(" %d", n_writer);
45312             printf(" %d", n_content);
45313             printf("\n");
45314         }
45315     }
45316     }
45317     function_tests++;
45318 #endif
45319 
45320     return(test_ret);
45321 }
45322 
45323 
45324 static int
test_xmlTextWriterWriteRawLen(void)45325 test_xmlTextWriterWriteRawLen(void) {
45326     int test_ret = 0;
45327 
45328 #if defined(LIBXML_WRITER_ENABLED)
45329     int mem_base;
45330     int ret_val;
45331     xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
45332     int n_writer;
45333     const xmlChar * content; /* text string */
45334     int n_content;
45335     int len; /* length of the text string */
45336     int n_len;
45337 
45338     for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
45339     for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
45340     for (n_len = 0;n_len < gen_nb_int;n_len++) {
45341         mem_base = xmlMemBlocks();
45342         writer = gen_xmlTextWriterPtr(n_writer, 0);
45343         content = gen_const_xmlChar_ptr(n_content, 1);
45344         len = gen_int(n_len, 2);
45345         if ((content != NULL) &&
45346             (len > xmlStrlen(BAD_CAST content)))
45347             len = 0;
45348 
45349         ret_val = xmlTextWriterWriteRawLen(writer, content, len);
45350         desret_int(ret_val);
45351         call_tests++;
45352         des_xmlTextWriterPtr(n_writer, writer, 0);
45353         des_const_xmlChar_ptr(n_content, content, 1);
45354         des_int(n_len, len, 2);
45355         xmlResetLastError();
45356         if (mem_base != xmlMemBlocks()) {
45357             printf("Leak of %d blocks found in xmlTextWriterWriteRawLen",
45358 	           xmlMemBlocks() - mem_base);
45359 	    test_ret++;
45360             printf(" %d", n_writer);
45361             printf(" %d", n_content);
45362             printf(" %d", n_len);
45363             printf("\n");
45364         }
45365     }
45366     }
45367     }
45368     function_tests++;
45369 #endif
45370 
45371     return(test_ret);
45372 }
45373 
45374 
45375 static int
test_xmlTextWriterWriteString(void)45376 test_xmlTextWriterWriteString(void) {
45377     int test_ret = 0;
45378 
45379 #if defined(LIBXML_WRITER_ENABLED)
45380     int mem_base;
45381     int ret_val;
45382     xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
45383     int n_writer;
45384     const xmlChar * content; /* text string */
45385     int n_content;
45386 
45387     for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
45388     for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
45389         mem_base = xmlMemBlocks();
45390         writer = gen_xmlTextWriterPtr(n_writer, 0);
45391         content = gen_const_xmlChar_ptr(n_content, 1);
45392 
45393         ret_val = xmlTextWriterWriteString(writer, content);
45394         desret_int(ret_val);
45395         call_tests++;
45396         des_xmlTextWriterPtr(n_writer, writer, 0);
45397         des_const_xmlChar_ptr(n_content, content, 1);
45398         xmlResetLastError();
45399         if (mem_base != xmlMemBlocks()) {
45400             printf("Leak of %d blocks found in xmlTextWriterWriteString",
45401 	           xmlMemBlocks() - mem_base);
45402 	    test_ret++;
45403             printf(" %d", n_writer);
45404             printf(" %d", n_content);
45405             printf("\n");
45406         }
45407     }
45408     }
45409     function_tests++;
45410 #endif
45411 
45412     return(test_ret);
45413 }
45414 
45415 
45416 static int
test_xmlTextWriterWriteVFormatAttribute(void)45417 test_xmlTextWriterWriteVFormatAttribute(void) {
45418     int test_ret = 0;
45419 
45420 
45421     /* missing type support */
45422     return(test_ret);
45423 }
45424 
45425 
45426 static int
test_xmlTextWriterWriteVFormatAttributeNS(void)45427 test_xmlTextWriterWriteVFormatAttributeNS(void) {
45428     int test_ret = 0;
45429 
45430 
45431     /* missing type support */
45432     return(test_ret);
45433 }
45434 
45435 
45436 static int
test_xmlTextWriterWriteVFormatCDATA(void)45437 test_xmlTextWriterWriteVFormatCDATA(void) {
45438     int test_ret = 0;
45439 
45440 
45441     /* missing type support */
45442     return(test_ret);
45443 }
45444 
45445 
45446 static int
test_xmlTextWriterWriteVFormatComment(void)45447 test_xmlTextWriterWriteVFormatComment(void) {
45448     int test_ret = 0;
45449 
45450 
45451     /* missing type support */
45452     return(test_ret);
45453 }
45454 
45455 
45456 static int
test_xmlTextWriterWriteVFormatDTD(void)45457 test_xmlTextWriterWriteVFormatDTD(void) {
45458     int test_ret = 0;
45459 
45460 
45461     /* missing type support */
45462     return(test_ret);
45463 }
45464 
45465 
45466 static int
test_xmlTextWriterWriteVFormatDTDAttlist(void)45467 test_xmlTextWriterWriteVFormatDTDAttlist(void) {
45468     int test_ret = 0;
45469 
45470 
45471     /* missing type support */
45472     return(test_ret);
45473 }
45474 
45475 
45476 static int
test_xmlTextWriterWriteVFormatDTDElement(void)45477 test_xmlTextWriterWriteVFormatDTDElement(void) {
45478     int test_ret = 0;
45479 
45480 
45481     /* missing type support */
45482     return(test_ret);
45483 }
45484 
45485 
45486 static int
test_xmlTextWriterWriteVFormatDTDInternalEntity(void)45487 test_xmlTextWriterWriteVFormatDTDInternalEntity(void) {
45488     int test_ret = 0;
45489 
45490 
45491     /* missing type support */
45492     return(test_ret);
45493 }
45494 
45495 
45496 static int
test_xmlTextWriterWriteVFormatElement(void)45497 test_xmlTextWriterWriteVFormatElement(void) {
45498     int test_ret = 0;
45499 
45500 
45501     /* missing type support */
45502     return(test_ret);
45503 }
45504 
45505 
45506 static int
test_xmlTextWriterWriteVFormatElementNS(void)45507 test_xmlTextWriterWriteVFormatElementNS(void) {
45508     int test_ret = 0;
45509 
45510 
45511     /* missing type support */
45512     return(test_ret);
45513 }
45514 
45515 
45516 static int
test_xmlTextWriterWriteVFormatPI(void)45517 test_xmlTextWriterWriteVFormatPI(void) {
45518     int test_ret = 0;
45519 
45520 
45521     /* missing type support */
45522     return(test_ret);
45523 }
45524 
45525 
45526 static int
test_xmlTextWriterWriteVFormatRaw(void)45527 test_xmlTextWriterWriteVFormatRaw(void) {
45528     int test_ret = 0;
45529 
45530 
45531     /* missing type support */
45532     return(test_ret);
45533 }
45534 
45535 
45536 static int
test_xmlTextWriterWriteVFormatString(void)45537 test_xmlTextWriterWriteVFormatString(void) {
45538     int test_ret = 0;
45539 
45540 
45541     /* missing type support */
45542     return(test_ret);
45543 }
45544 
45545 static int
test_xmlwriter(void)45546 test_xmlwriter(void) {
45547     int test_ret = 0;
45548 
45549     if (quiet == 0) printf("Testing xmlwriter : 52 of 80 functions ...\n");
45550     test_ret += test_xmlNewTextWriter();
45551     test_ret += test_xmlNewTextWriterFilename();
45552     test_ret += test_xmlNewTextWriterMemory();
45553     test_ret += test_xmlNewTextWriterPushParser();
45554     test_ret += test_xmlNewTextWriterTree();
45555     test_ret += test_xmlTextWriterEndAttribute();
45556     test_ret += test_xmlTextWriterEndCDATA();
45557     test_ret += test_xmlTextWriterEndComment();
45558     test_ret += test_xmlTextWriterEndDTD();
45559     test_ret += test_xmlTextWriterEndDTDAttlist();
45560     test_ret += test_xmlTextWriterEndDTDElement();
45561     test_ret += test_xmlTextWriterEndDTDEntity();
45562     test_ret += test_xmlTextWriterEndDocument();
45563     test_ret += test_xmlTextWriterEndElement();
45564     test_ret += test_xmlTextWriterEndPI();
45565     test_ret += test_xmlTextWriterFlush();
45566     test_ret += test_xmlTextWriterFullEndElement();
45567     test_ret += test_xmlTextWriterSetIndent();
45568     test_ret += test_xmlTextWriterSetIndentString();
45569     test_ret += test_xmlTextWriterSetQuoteChar();
45570     test_ret += test_xmlTextWriterStartAttribute();
45571     test_ret += test_xmlTextWriterStartAttributeNS();
45572     test_ret += test_xmlTextWriterStartCDATA();
45573     test_ret += test_xmlTextWriterStartComment();
45574     test_ret += test_xmlTextWriterStartDTD();
45575     test_ret += test_xmlTextWriterStartDTDAttlist();
45576     test_ret += test_xmlTextWriterStartDTDElement();
45577     test_ret += test_xmlTextWriterStartDTDEntity();
45578     test_ret += test_xmlTextWriterStartDocument();
45579     test_ret += test_xmlTextWriterStartElement();
45580     test_ret += test_xmlTextWriterStartElementNS();
45581     test_ret += test_xmlTextWriterStartPI();
45582     test_ret += test_xmlTextWriterWriteAttribute();
45583     test_ret += test_xmlTextWriterWriteAttributeNS();
45584     test_ret += test_xmlTextWriterWriteBase64();
45585     test_ret += test_xmlTextWriterWriteBinHex();
45586     test_ret += test_xmlTextWriterWriteCDATA();
45587     test_ret += test_xmlTextWriterWriteComment();
45588     test_ret += test_xmlTextWriterWriteDTD();
45589     test_ret += test_xmlTextWriterWriteDTDAttlist();
45590     test_ret += test_xmlTextWriterWriteDTDElement();
45591     test_ret += test_xmlTextWriterWriteDTDEntity();
45592     test_ret += test_xmlTextWriterWriteDTDExternalEntity();
45593     test_ret += test_xmlTextWriterWriteDTDExternalEntityContents();
45594     test_ret += test_xmlTextWriterWriteDTDInternalEntity();
45595     test_ret += test_xmlTextWriterWriteDTDNotation();
45596     test_ret += test_xmlTextWriterWriteElement();
45597     test_ret += test_xmlTextWriterWriteElementNS();
45598     test_ret += test_xmlTextWriterWriteFormatAttribute();
45599     test_ret += test_xmlTextWriterWriteFormatAttributeNS();
45600     test_ret += test_xmlTextWriterWriteFormatCDATA();
45601     test_ret += test_xmlTextWriterWriteFormatComment();
45602     test_ret += test_xmlTextWriterWriteFormatDTD();
45603     test_ret += test_xmlTextWriterWriteFormatDTDAttlist();
45604     test_ret += test_xmlTextWriterWriteFormatDTDElement();
45605     test_ret += test_xmlTextWriterWriteFormatDTDInternalEntity();
45606     test_ret += test_xmlTextWriterWriteFormatElement();
45607     test_ret += test_xmlTextWriterWriteFormatElementNS();
45608     test_ret += test_xmlTextWriterWriteFormatPI();
45609     test_ret += test_xmlTextWriterWriteFormatRaw();
45610     test_ret += test_xmlTextWriterWriteFormatString();
45611     test_ret += test_xmlTextWriterWritePI();
45612     test_ret += test_xmlTextWriterWriteRaw();
45613     test_ret += test_xmlTextWriterWriteRawLen();
45614     test_ret += test_xmlTextWriterWriteString();
45615     test_ret += test_xmlTextWriterWriteVFormatAttribute();
45616     test_ret += test_xmlTextWriterWriteVFormatAttributeNS();
45617     test_ret += test_xmlTextWriterWriteVFormatCDATA();
45618     test_ret += test_xmlTextWriterWriteVFormatComment();
45619     test_ret += test_xmlTextWriterWriteVFormatDTD();
45620     test_ret += test_xmlTextWriterWriteVFormatDTDAttlist();
45621     test_ret += test_xmlTextWriterWriteVFormatDTDElement();
45622     test_ret += test_xmlTextWriterWriteVFormatDTDInternalEntity();
45623     test_ret += test_xmlTextWriterWriteVFormatElement();
45624     test_ret += test_xmlTextWriterWriteVFormatElementNS();
45625     test_ret += test_xmlTextWriterWriteVFormatPI();
45626     test_ret += test_xmlTextWriterWriteVFormatRaw();
45627     test_ret += test_xmlTextWriterWriteVFormatString();
45628 
45629     if (test_ret != 0)
45630 	printf("Module xmlwriter: %d errors\n", test_ret);
45631     return(test_ret);
45632 }
45633 
45634 static int
test_xmlXPathCastBooleanToNumber(void)45635 test_xmlXPathCastBooleanToNumber(void) {
45636     int test_ret = 0;
45637 
45638 #if defined(LIBXML_XPATH_ENABLED)
45639     int mem_base;
45640     double ret_val;
45641     int val; /* a boolean */
45642     int n_val;
45643 
45644     for (n_val = 0;n_val < gen_nb_int;n_val++) {
45645         mem_base = xmlMemBlocks();
45646         val = gen_int(n_val, 0);
45647 
45648         ret_val = xmlXPathCastBooleanToNumber(val);
45649         desret_double(ret_val);
45650         call_tests++;
45651         des_int(n_val, val, 0);
45652         xmlResetLastError();
45653         if (mem_base != xmlMemBlocks()) {
45654             printf("Leak of %d blocks found in xmlXPathCastBooleanToNumber",
45655 	           xmlMemBlocks() - mem_base);
45656 	    test_ret++;
45657             printf(" %d", n_val);
45658             printf("\n");
45659         }
45660     }
45661     function_tests++;
45662 #endif
45663 
45664     return(test_ret);
45665 }
45666 
45667 
45668 static int
test_xmlXPathCastBooleanToString(void)45669 test_xmlXPathCastBooleanToString(void) {
45670     int test_ret = 0;
45671 
45672 #if defined(LIBXML_XPATH_ENABLED)
45673     int mem_base;
45674     xmlChar * ret_val;
45675     int val; /* a boolean */
45676     int n_val;
45677 
45678     for (n_val = 0;n_val < gen_nb_int;n_val++) {
45679         mem_base = xmlMemBlocks();
45680         val = gen_int(n_val, 0);
45681 
45682         ret_val = xmlXPathCastBooleanToString(val);
45683         desret_xmlChar_ptr(ret_val);
45684         call_tests++;
45685         des_int(n_val, val, 0);
45686         xmlResetLastError();
45687         if (mem_base != xmlMemBlocks()) {
45688             printf("Leak of %d blocks found in xmlXPathCastBooleanToString",
45689 	           xmlMemBlocks() - mem_base);
45690 	    test_ret++;
45691             printf(" %d", n_val);
45692             printf("\n");
45693         }
45694     }
45695     function_tests++;
45696 #endif
45697 
45698     return(test_ret);
45699 }
45700 
45701 
45702 static int
test_xmlXPathCastNodeSetToBoolean(void)45703 test_xmlXPathCastNodeSetToBoolean(void) {
45704     int test_ret = 0;
45705 
45706 #if defined(LIBXML_XPATH_ENABLED)
45707     int mem_base;
45708     int ret_val;
45709     xmlNodeSetPtr ns; /* a node-set */
45710     int n_ns;
45711 
45712     for (n_ns = 0;n_ns < gen_nb_xmlNodeSetPtr;n_ns++) {
45713         mem_base = xmlMemBlocks();
45714         ns = gen_xmlNodeSetPtr(n_ns, 0);
45715 
45716         ret_val = xmlXPathCastNodeSetToBoolean(ns);
45717         desret_int(ret_val);
45718         call_tests++;
45719         des_xmlNodeSetPtr(n_ns, ns, 0);
45720         xmlResetLastError();
45721         if (mem_base != xmlMemBlocks()) {
45722             printf("Leak of %d blocks found in xmlXPathCastNodeSetToBoolean",
45723 	           xmlMemBlocks() - mem_base);
45724 	    test_ret++;
45725             printf(" %d", n_ns);
45726             printf("\n");
45727         }
45728     }
45729     function_tests++;
45730 #endif
45731 
45732     return(test_ret);
45733 }
45734 
45735 
45736 static int
test_xmlXPathCastNodeSetToNumber(void)45737 test_xmlXPathCastNodeSetToNumber(void) {
45738     int test_ret = 0;
45739 
45740 #if defined(LIBXML_XPATH_ENABLED)
45741     int mem_base;
45742     double ret_val;
45743     xmlNodeSetPtr ns; /* a node-set */
45744     int n_ns;
45745 
45746     for (n_ns = 0;n_ns < gen_nb_xmlNodeSetPtr;n_ns++) {
45747         mem_base = xmlMemBlocks();
45748         ns = gen_xmlNodeSetPtr(n_ns, 0);
45749 
45750         ret_val = xmlXPathCastNodeSetToNumber(ns);
45751         desret_double(ret_val);
45752         call_tests++;
45753         des_xmlNodeSetPtr(n_ns, ns, 0);
45754         xmlResetLastError();
45755         if (mem_base != xmlMemBlocks()) {
45756             printf("Leak of %d blocks found in xmlXPathCastNodeSetToNumber",
45757 	           xmlMemBlocks() - mem_base);
45758 	    test_ret++;
45759             printf(" %d", n_ns);
45760             printf("\n");
45761         }
45762     }
45763     function_tests++;
45764 #endif
45765 
45766     return(test_ret);
45767 }
45768 
45769 
45770 static int
test_xmlXPathCastNodeSetToString(void)45771 test_xmlXPathCastNodeSetToString(void) {
45772     int test_ret = 0;
45773 
45774 #if defined(LIBXML_XPATH_ENABLED)
45775     int mem_base;
45776     xmlChar * ret_val;
45777     xmlNodeSetPtr ns; /* a node-set */
45778     int n_ns;
45779 
45780     for (n_ns = 0;n_ns < gen_nb_xmlNodeSetPtr;n_ns++) {
45781         mem_base = xmlMemBlocks();
45782         ns = gen_xmlNodeSetPtr(n_ns, 0);
45783 
45784         ret_val = xmlXPathCastNodeSetToString(ns);
45785         desret_xmlChar_ptr(ret_val);
45786         call_tests++;
45787         des_xmlNodeSetPtr(n_ns, ns, 0);
45788         xmlResetLastError();
45789         if (mem_base != xmlMemBlocks()) {
45790             printf("Leak of %d blocks found in xmlXPathCastNodeSetToString",
45791 	           xmlMemBlocks() - mem_base);
45792 	    test_ret++;
45793             printf(" %d", n_ns);
45794             printf("\n");
45795         }
45796     }
45797     function_tests++;
45798 #endif
45799 
45800     return(test_ret);
45801 }
45802 
45803 
45804 static int
test_xmlXPathCastNodeToNumber(void)45805 test_xmlXPathCastNodeToNumber(void) {
45806     int test_ret = 0;
45807 
45808 #if defined(LIBXML_XPATH_ENABLED)
45809     int mem_base;
45810     double ret_val;
45811     xmlNodePtr node; /* a node */
45812     int n_node;
45813 
45814     for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
45815         mem_base = xmlMemBlocks();
45816         node = gen_xmlNodePtr(n_node, 0);
45817 
45818         ret_val = xmlXPathCastNodeToNumber(node);
45819         desret_double(ret_val);
45820         call_tests++;
45821         des_xmlNodePtr(n_node, node, 0);
45822         xmlResetLastError();
45823         if (mem_base != xmlMemBlocks()) {
45824             printf("Leak of %d blocks found in xmlXPathCastNodeToNumber",
45825 	           xmlMemBlocks() - mem_base);
45826 	    test_ret++;
45827             printf(" %d", n_node);
45828             printf("\n");
45829         }
45830     }
45831     function_tests++;
45832 #endif
45833 
45834     return(test_ret);
45835 }
45836 
45837 
45838 static int
test_xmlXPathCastNodeToString(void)45839 test_xmlXPathCastNodeToString(void) {
45840     int test_ret = 0;
45841 
45842 #if defined(LIBXML_XPATH_ENABLED)
45843     int mem_base;
45844     xmlChar * ret_val;
45845     xmlNodePtr node; /* a node */
45846     int n_node;
45847 
45848     for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
45849         mem_base = xmlMemBlocks();
45850         node = gen_xmlNodePtr(n_node, 0);
45851 
45852         ret_val = xmlXPathCastNodeToString(node);
45853         desret_xmlChar_ptr(ret_val);
45854         call_tests++;
45855         des_xmlNodePtr(n_node, node, 0);
45856         xmlResetLastError();
45857         if (mem_base != xmlMemBlocks()) {
45858             printf("Leak of %d blocks found in xmlXPathCastNodeToString",
45859 	           xmlMemBlocks() - mem_base);
45860 	    test_ret++;
45861             printf(" %d", n_node);
45862             printf("\n");
45863         }
45864     }
45865     function_tests++;
45866 #endif
45867 
45868     return(test_ret);
45869 }
45870 
45871 
45872 static int
test_xmlXPathCastNumberToBoolean(void)45873 test_xmlXPathCastNumberToBoolean(void) {
45874     int test_ret = 0;
45875 
45876 #if defined(LIBXML_XPATH_ENABLED)
45877     int mem_base;
45878     int ret_val;
45879     double val; /* a number */
45880     int n_val;
45881 
45882     for (n_val = 0;n_val < gen_nb_double;n_val++) {
45883         mem_base = xmlMemBlocks();
45884         val = gen_double(n_val, 0);
45885 
45886         ret_val = xmlXPathCastNumberToBoolean(val);
45887         desret_int(ret_val);
45888         call_tests++;
45889         des_double(n_val, val, 0);
45890         xmlResetLastError();
45891         if (mem_base != xmlMemBlocks()) {
45892             printf("Leak of %d blocks found in xmlXPathCastNumberToBoolean",
45893 	           xmlMemBlocks() - mem_base);
45894 	    test_ret++;
45895             printf(" %d", n_val);
45896             printf("\n");
45897         }
45898     }
45899     function_tests++;
45900 #endif
45901 
45902     return(test_ret);
45903 }
45904 
45905 
45906 static int
test_xmlXPathCastNumberToString(void)45907 test_xmlXPathCastNumberToString(void) {
45908     int test_ret = 0;
45909 
45910 #if defined(LIBXML_XPATH_ENABLED)
45911     int mem_base;
45912     xmlChar * ret_val;
45913     double val; /* a number */
45914     int n_val;
45915 
45916     for (n_val = 0;n_val < gen_nb_double;n_val++) {
45917         mem_base = xmlMemBlocks();
45918         val = gen_double(n_val, 0);
45919 
45920         ret_val = xmlXPathCastNumberToString(val);
45921         desret_xmlChar_ptr(ret_val);
45922         call_tests++;
45923         des_double(n_val, val, 0);
45924         xmlResetLastError();
45925         if (mem_base != xmlMemBlocks()) {
45926             printf("Leak of %d blocks found in xmlXPathCastNumberToString",
45927 	           xmlMemBlocks() - mem_base);
45928 	    test_ret++;
45929             printf(" %d", n_val);
45930             printf("\n");
45931         }
45932     }
45933     function_tests++;
45934 #endif
45935 
45936     return(test_ret);
45937 }
45938 
45939 
45940 static int
test_xmlXPathCastStringToBoolean(void)45941 test_xmlXPathCastStringToBoolean(void) {
45942     int test_ret = 0;
45943 
45944 #if defined(LIBXML_XPATH_ENABLED)
45945     int mem_base;
45946     int ret_val;
45947     const xmlChar * val; /* a string */
45948     int n_val;
45949 
45950     for (n_val = 0;n_val < gen_nb_const_xmlChar_ptr;n_val++) {
45951         mem_base = xmlMemBlocks();
45952         val = gen_const_xmlChar_ptr(n_val, 0);
45953 
45954         ret_val = xmlXPathCastStringToBoolean(val);
45955         desret_int(ret_val);
45956         call_tests++;
45957         des_const_xmlChar_ptr(n_val, val, 0);
45958         xmlResetLastError();
45959         if (mem_base != xmlMemBlocks()) {
45960             printf("Leak of %d blocks found in xmlXPathCastStringToBoolean",
45961 	           xmlMemBlocks() - mem_base);
45962 	    test_ret++;
45963             printf(" %d", n_val);
45964             printf("\n");
45965         }
45966     }
45967     function_tests++;
45968 #endif
45969 
45970     return(test_ret);
45971 }
45972 
45973 
45974 static int
test_xmlXPathCastStringToNumber(void)45975 test_xmlXPathCastStringToNumber(void) {
45976     int test_ret = 0;
45977 
45978 #if defined(LIBXML_XPATH_ENABLED)
45979     int mem_base;
45980     double ret_val;
45981     const xmlChar * val; /* a string */
45982     int n_val;
45983 
45984     for (n_val = 0;n_val < gen_nb_const_xmlChar_ptr;n_val++) {
45985         mem_base = xmlMemBlocks();
45986         val = gen_const_xmlChar_ptr(n_val, 0);
45987 
45988         ret_val = xmlXPathCastStringToNumber(val);
45989         desret_double(ret_val);
45990         call_tests++;
45991         des_const_xmlChar_ptr(n_val, val, 0);
45992         xmlResetLastError();
45993         if (mem_base != xmlMemBlocks()) {
45994             printf("Leak of %d blocks found in xmlXPathCastStringToNumber",
45995 	           xmlMemBlocks() - mem_base);
45996 	    test_ret++;
45997             printf(" %d", n_val);
45998             printf("\n");
45999         }
46000     }
46001     function_tests++;
46002 #endif
46003 
46004     return(test_ret);
46005 }
46006 
46007 
46008 static int
test_xmlXPathCastToBoolean(void)46009 test_xmlXPathCastToBoolean(void) {
46010     int test_ret = 0;
46011 
46012 #if defined(LIBXML_XPATH_ENABLED)
46013     int mem_base;
46014     int ret_val;
46015     xmlXPathObjectPtr val; /* an XPath object */
46016     int n_val;
46017 
46018     for (n_val = 0;n_val < gen_nb_xmlXPathObjectPtr;n_val++) {
46019         mem_base = xmlMemBlocks();
46020         val = gen_xmlXPathObjectPtr(n_val, 0);
46021 
46022         ret_val = xmlXPathCastToBoolean(val);
46023         desret_int(ret_val);
46024         call_tests++;
46025         des_xmlXPathObjectPtr(n_val, val, 0);
46026         xmlResetLastError();
46027         if (mem_base != xmlMemBlocks()) {
46028             printf("Leak of %d blocks found in xmlXPathCastToBoolean",
46029 	           xmlMemBlocks() - mem_base);
46030 	    test_ret++;
46031             printf(" %d", n_val);
46032             printf("\n");
46033         }
46034     }
46035     function_tests++;
46036 #endif
46037 
46038     return(test_ret);
46039 }
46040 
46041 
46042 static int
test_xmlXPathCastToNumber(void)46043 test_xmlXPathCastToNumber(void) {
46044     int test_ret = 0;
46045 
46046 #if defined(LIBXML_XPATH_ENABLED)
46047     int mem_base;
46048     double ret_val;
46049     xmlXPathObjectPtr val; /* an XPath object */
46050     int n_val;
46051 
46052     for (n_val = 0;n_val < gen_nb_xmlXPathObjectPtr;n_val++) {
46053         mem_base = xmlMemBlocks();
46054         val = gen_xmlXPathObjectPtr(n_val, 0);
46055 
46056         ret_val = xmlXPathCastToNumber(val);
46057         desret_double(ret_val);
46058         call_tests++;
46059         des_xmlXPathObjectPtr(n_val, val, 0);
46060         xmlResetLastError();
46061         if (mem_base != xmlMemBlocks()) {
46062             printf("Leak of %d blocks found in xmlXPathCastToNumber",
46063 	           xmlMemBlocks() - mem_base);
46064 	    test_ret++;
46065             printf(" %d", n_val);
46066             printf("\n");
46067         }
46068     }
46069     function_tests++;
46070 #endif
46071 
46072     return(test_ret);
46073 }
46074 
46075 
46076 static int
test_xmlXPathCastToString(void)46077 test_xmlXPathCastToString(void) {
46078     int test_ret = 0;
46079 
46080 #if defined(LIBXML_XPATH_ENABLED)
46081     int mem_base;
46082     xmlChar * ret_val;
46083     xmlXPathObjectPtr val; /* an XPath object */
46084     int n_val;
46085 
46086     for (n_val = 0;n_val < gen_nb_xmlXPathObjectPtr;n_val++) {
46087         mem_base = xmlMemBlocks();
46088         val = gen_xmlXPathObjectPtr(n_val, 0);
46089 
46090         ret_val = xmlXPathCastToString(val);
46091         desret_xmlChar_ptr(ret_val);
46092         call_tests++;
46093         des_xmlXPathObjectPtr(n_val, val, 0);
46094         xmlResetLastError();
46095         if (mem_base != xmlMemBlocks()) {
46096             printf("Leak of %d blocks found in xmlXPathCastToString",
46097 	           xmlMemBlocks() - mem_base);
46098 	    test_ret++;
46099             printf(" %d", n_val);
46100             printf("\n");
46101         }
46102     }
46103     function_tests++;
46104 #endif
46105 
46106     return(test_ret);
46107 }
46108 
46109 
46110 static int
test_xmlXPathCmpNodes(void)46111 test_xmlXPathCmpNodes(void) {
46112     int test_ret = 0;
46113 
46114 #if defined(LIBXML_XPATH_ENABLED)
46115     int mem_base;
46116     int ret_val;
46117     xmlNodePtr node1; /* the first node */
46118     int n_node1;
46119     xmlNodePtr node2; /* the second node */
46120     int n_node2;
46121 
46122     for (n_node1 = 0;n_node1 < gen_nb_xmlNodePtr;n_node1++) {
46123     for (n_node2 = 0;n_node2 < gen_nb_xmlNodePtr;n_node2++) {
46124         mem_base = xmlMemBlocks();
46125         node1 = gen_xmlNodePtr(n_node1, 0);
46126         node2 = gen_xmlNodePtr(n_node2, 1);
46127 
46128         ret_val = xmlXPathCmpNodes(node1, node2);
46129         desret_int(ret_val);
46130         call_tests++;
46131         des_xmlNodePtr(n_node1, node1, 0);
46132         des_xmlNodePtr(n_node2, node2, 1);
46133         xmlResetLastError();
46134         if (mem_base != xmlMemBlocks()) {
46135             printf("Leak of %d blocks found in xmlXPathCmpNodes",
46136 	           xmlMemBlocks() - mem_base);
46137 	    test_ret++;
46138             printf(" %d", n_node1);
46139             printf(" %d", n_node2);
46140             printf("\n");
46141         }
46142     }
46143     }
46144     function_tests++;
46145 #endif
46146 
46147     return(test_ret);
46148 }
46149 
46150 
46151 static int
test_xmlXPathCompile(void)46152 test_xmlXPathCompile(void) {
46153     int test_ret = 0;
46154 
46155 
46156     /* missing type support */
46157     return(test_ret);
46158 }
46159 
46160 #ifdef LIBXML_XPATH_ENABLED
46161 
46162 #define gen_nb_xmlXPathCompExprPtr 1
46163 #define gen_xmlXPathCompExprPtr(no, nr) NULL
46164 #define des_xmlXPathCompExprPtr(no, val, nr)
46165 #endif
46166 
46167 #ifdef LIBXML_XPATH_ENABLED
46168 
46169 #define gen_nb_xmlXPathContextPtr 1
46170 #define gen_xmlXPathContextPtr(no, nr) NULL
46171 #define des_xmlXPathContextPtr(no, val, nr)
46172 #endif
46173 
46174 
46175 static int
test_xmlXPathCompiledEval(void)46176 test_xmlXPathCompiledEval(void) {
46177     int test_ret = 0;
46178 
46179 #if defined(LIBXML_XPATH_ENABLED)
46180     int mem_base;
46181     xmlXPathObjectPtr ret_val;
46182     xmlXPathCompExprPtr comp; /* the compiled XPath expression */
46183     int n_comp;
46184     xmlXPathContextPtr ctx; /* the XPath context */
46185     int n_ctx;
46186 
46187     for (n_comp = 0;n_comp < gen_nb_xmlXPathCompExprPtr;n_comp++) {
46188     for (n_ctx = 0;n_ctx < gen_nb_xmlXPathContextPtr;n_ctx++) {
46189         mem_base = xmlMemBlocks();
46190         comp = gen_xmlXPathCompExprPtr(n_comp, 0);
46191         ctx = gen_xmlXPathContextPtr(n_ctx, 1);
46192 
46193         ret_val = xmlXPathCompiledEval(comp, ctx);
46194         desret_xmlXPathObjectPtr(ret_val);
46195         call_tests++;
46196         des_xmlXPathCompExprPtr(n_comp, comp, 0);
46197         des_xmlXPathContextPtr(n_ctx, ctx, 1);
46198         xmlResetLastError();
46199         if (mem_base != xmlMemBlocks()) {
46200             printf("Leak of %d blocks found in xmlXPathCompiledEval",
46201 	           xmlMemBlocks() - mem_base);
46202 	    test_ret++;
46203             printf(" %d", n_comp);
46204             printf(" %d", n_ctx);
46205             printf("\n");
46206         }
46207     }
46208     }
46209     function_tests++;
46210 #endif
46211 
46212     return(test_ret);
46213 }
46214 
46215 
46216 static int
test_xmlXPathCompiledEvalToBoolean(void)46217 test_xmlXPathCompiledEvalToBoolean(void) {
46218     int test_ret = 0;
46219 
46220 #if defined(LIBXML_XPATH_ENABLED)
46221     int mem_base;
46222     int ret_val;
46223     xmlXPathCompExprPtr comp; /* the compiled XPath expression */
46224     int n_comp;
46225     xmlXPathContextPtr ctxt; /* the XPath context */
46226     int n_ctxt;
46227 
46228     for (n_comp = 0;n_comp < gen_nb_xmlXPathCompExprPtr;n_comp++) {
46229     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathContextPtr;n_ctxt++) {
46230         mem_base = xmlMemBlocks();
46231         comp = gen_xmlXPathCompExprPtr(n_comp, 0);
46232         ctxt = gen_xmlXPathContextPtr(n_ctxt, 1);
46233 
46234         ret_val = xmlXPathCompiledEvalToBoolean(comp, ctxt);
46235         desret_int(ret_val);
46236         call_tests++;
46237         des_xmlXPathCompExprPtr(n_comp, comp, 0);
46238         des_xmlXPathContextPtr(n_ctxt, ctxt, 1);
46239         xmlResetLastError();
46240         if (mem_base != xmlMemBlocks()) {
46241             printf("Leak of %d blocks found in xmlXPathCompiledEvalToBoolean",
46242 	           xmlMemBlocks() - mem_base);
46243 	    test_ret++;
46244             printf(" %d", n_comp);
46245             printf(" %d", n_ctxt);
46246             printf("\n");
46247         }
46248     }
46249     }
46250     function_tests++;
46251 #endif
46252 
46253     return(test_ret);
46254 }
46255 
46256 
46257 static int
test_xmlXPathContextSetCache(void)46258 test_xmlXPathContextSetCache(void) {
46259     int test_ret = 0;
46260 
46261 #if defined(LIBXML_XPATH_ENABLED)
46262     int mem_base;
46263     int ret_val;
46264     xmlXPathContextPtr ctxt; /* the XPath context */
46265     int n_ctxt;
46266     int active; /* enables/disables (creates/frees) the cache */
46267     int n_active;
46268     int value; /* a value with semantics dependent on @options */
46269     int n_value;
46270     int options; /* options (currently only the value 0 is used) */
46271     int n_options;
46272 
46273     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathContextPtr;n_ctxt++) {
46274     for (n_active = 0;n_active < gen_nb_int;n_active++) {
46275     for (n_value = 0;n_value < gen_nb_int;n_value++) {
46276     for (n_options = 0;n_options < gen_nb_int;n_options++) {
46277         mem_base = xmlMemBlocks();
46278         ctxt = gen_xmlXPathContextPtr(n_ctxt, 0);
46279         active = gen_int(n_active, 1);
46280         value = gen_int(n_value, 2);
46281         options = gen_int(n_options, 3);
46282 
46283         ret_val = xmlXPathContextSetCache(ctxt, active, value, options);
46284         desret_int(ret_val);
46285         call_tests++;
46286         des_xmlXPathContextPtr(n_ctxt, ctxt, 0);
46287         des_int(n_active, active, 1);
46288         des_int(n_value, value, 2);
46289         des_int(n_options, options, 3);
46290         xmlResetLastError();
46291         if (mem_base != xmlMemBlocks()) {
46292             printf("Leak of %d blocks found in xmlXPathContextSetCache",
46293 	           xmlMemBlocks() - mem_base);
46294 	    test_ret++;
46295             printf(" %d", n_ctxt);
46296             printf(" %d", n_active);
46297             printf(" %d", n_value);
46298             printf(" %d", n_options);
46299             printf("\n");
46300         }
46301     }
46302     }
46303     }
46304     }
46305     function_tests++;
46306 #endif
46307 
46308     return(test_ret);
46309 }
46310 
46311 
46312 static int
test_xmlXPathConvertBoolean(void)46313 test_xmlXPathConvertBoolean(void) {
46314     int test_ret = 0;
46315 
46316 #if defined(LIBXML_XPATH_ENABLED)
46317     int mem_base;
46318     xmlXPathObjectPtr ret_val;
46319     xmlXPathObjectPtr val; /* an XPath object */
46320     int n_val;
46321 
46322     for (n_val = 0;n_val < gen_nb_xmlXPathObjectPtr;n_val++) {
46323         mem_base = xmlMemBlocks();
46324         val = gen_xmlXPathObjectPtr(n_val, 0);
46325 
46326         ret_val = xmlXPathConvertBoolean(val);
46327         val = NULL;
46328         desret_xmlXPathObjectPtr(ret_val);
46329         call_tests++;
46330         des_xmlXPathObjectPtr(n_val, val, 0);
46331         xmlResetLastError();
46332         if (mem_base != xmlMemBlocks()) {
46333             printf("Leak of %d blocks found in xmlXPathConvertBoolean",
46334 	           xmlMemBlocks() - mem_base);
46335 	    test_ret++;
46336             printf(" %d", n_val);
46337             printf("\n");
46338         }
46339     }
46340     function_tests++;
46341 #endif
46342 
46343     return(test_ret);
46344 }
46345 
46346 
46347 static int
test_xmlXPathConvertNumber(void)46348 test_xmlXPathConvertNumber(void) {
46349     int test_ret = 0;
46350 
46351 #if defined(LIBXML_XPATH_ENABLED)
46352     int mem_base;
46353     xmlXPathObjectPtr ret_val;
46354     xmlXPathObjectPtr val; /* an XPath object */
46355     int n_val;
46356 
46357     for (n_val = 0;n_val < gen_nb_xmlXPathObjectPtr;n_val++) {
46358         mem_base = xmlMemBlocks();
46359         val = gen_xmlXPathObjectPtr(n_val, 0);
46360 
46361         ret_val = xmlXPathConvertNumber(val);
46362         val = NULL;
46363         desret_xmlXPathObjectPtr(ret_val);
46364         call_tests++;
46365         des_xmlXPathObjectPtr(n_val, val, 0);
46366         xmlResetLastError();
46367         if (mem_base != xmlMemBlocks()) {
46368             printf("Leak of %d blocks found in xmlXPathConvertNumber",
46369 	           xmlMemBlocks() - mem_base);
46370 	    test_ret++;
46371             printf(" %d", n_val);
46372             printf("\n");
46373         }
46374     }
46375     function_tests++;
46376 #endif
46377 
46378     return(test_ret);
46379 }
46380 
46381 
46382 static int
test_xmlXPathConvertString(void)46383 test_xmlXPathConvertString(void) {
46384     int test_ret = 0;
46385 
46386 #if defined(LIBXML_XPATH_ENABLED)
46387     int mem_base;
46388     xmlXPathObjectPtr ret_val;
46389     xmlXPathObjectPtr val; /* an XPath object */
46390     int n_val;
46391 
46392     for (n_val = 0;n_val < gen_nb_xmlXPathObjectPtr;n_val++) {
46393         mem_base = xmlMemBlocks();
46394         val = gen_xmlXPathObjectPtr(n_val, 0);
46395 
46396         ret_val = xmlXPathConvertString(val);
46397         val = NULL;
46398         desret_xmlXPathObjectPtr(ret_val);
46399         call_tests++;
46400         des_xmlXPathObjectPtr(n_val, val, 0);
46401         xmlResetLastError();
46402         if (mem_base != xmlMemBlocks()) {
46403             printf("Leak of %d blocks found in xmlXPathConvertString",
46404 	           xmlMemBlocks() - mem_base);
46405 	    test_ret++;
46406             printf(" %d", n_val);
46407             printf("\n");
46408         }
46409     }
46410     function_tests++;
46411 #endif
46412 
46413     return(test_ret);
46414 }
46415 
46416 
46417 static int
test_xmlXPathCtxtCompile(void)46418 test_xmlXPathCtxtCompile(void) {
46419     int test_ret = 0;
46420 
46421 
46422     /* missing type support */
46423     return(test_ret);
46424 }
46425 
46426 
46427 static int
test_xmlXPathEval(void)46428 test_xmlXPathEval(void) {
46429     int test_ret = 0;
46430 
46431 #if defined(LIBXML_XPATH_ENABLED)
46432     int mem_base;
46433     xmlXPathObjectPtr ret_val;
46434     const xmlChar * str; /* the XPath expression */
46435     int n_str;
46436     xmlXPathContextPtr ctx; /* the XPath context */
46437     int n_ctx;
46438 
46439     for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) {
46440     for (n_ctx = 0;n_ctx < gen_nb_xmlXPathContextPtr;n_ctx++) {
46441         mem_base = xmlMemBlocks();
46442         str = gen_const_xmlChar_ptr(n_str, 0);
46443         ctx = gen_xmlXPathContextPtr(n_ctx, 1);
46444 
46445         ret_val = xmlXPathEval(str, ctx);
46446         desret_xmlXPathObjectPtr(ret_val);
46447         call_tests++;
46448         des_const_xmlChar_ptr(n_str, str, 0);
46449         des_xmlXPathContextPtr(n_ctx, ctx, 1);
46450         xmlResetLastError();
46451         if (mem_base != xmlMemBlocks()) {
46452             printf("Leak of %d blocks found in xmlXPathEval",
46453 	           xmlMemBlocks() - mem_base);
46454 	    test_ret++;
46455             printf(" %d", n_str);
46456             printf(" %d", n_ctx);
46457             printf("\n");
46458         }
46459     }
46460     }
46461     function_tests++;
46462 #endif
46463 
46464     return(test_ret);
46465 }
46466 
46467 
46468 static int
test_xmlXPathEvalExpression(void)46469 test_xmlXPathEvalExpression(void) {
46470     int test_ret = 0;
46471 
46472 #if defined(LIBXML_XPATH_ENABLED)
46473     int mem_base;
46474     xmlXPathObjectPtr ret_val;
46475     const xmlChar * str; /* the XPath expression */
46476     int n_str;
46477     xmlXPathContextPtr ctxt; /* the XPath context */
46478     int n_ctxt;
46479 
46480     for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) {
46481     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathContextPtr;n_ctxt++) {
46482         mem_base = xmlMemBlocks();
46483         str = gen_const_xmlChar_ptr(n_str, 0);
46484         ctxt = gen_xmlXPathContextPtr(n_ctxt, 1);
46485 
46486         ret_val = xmlXPathEvalExpression(str, ctxt);
46487         desret_xmlXPathObjectPtr(ret_val);
46488         call_tests++;
46489         des_const_xmlChar_ptr(n_str, str, 0);
46490         des_xmlXPathContextPtr(n_ctxt, ctxt, 1);
46491         xmlResetLastError();
46492         if (mem_base != xmlMemBlocks()) {
46493             printf("Leak of %d blocks found in xmlXPathEvalExpression",
46494 	           xmlMemBlocks() - mem_base);
46495 	    test_ret++;
46496             printf(" %d", n_str);
46497             printf(" %d", n_ctxt);
46498             printf("\n");
46499         }
46500     }
46501     }
46502     function_tests++;
46503 #endif
46504 
46505     return(test_ret);
46506 }
46507 
46508 
46509 static int
test_xmlXPathEvalPredicate(void)46510 test_xmlXPathEvalPredicate(void) {
46511     int test_ret = 0;
46512 
46513 #if defined(LIBXML_XPATH_ENABLED)
46514     int mem_base;
46515     int ret_val;
46516     xmlXPathContextPtr ctxt; /* the XPath context */
46517     int n_ctxt;
46518     xmlXPathObjectPtr res; /* the Predicate Expression evaluation result */
46519     int n_res;
46520 
46521     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathContextPtr;n_ctxt++) {
46522     for (n_res = 0;n_res < gen_nb_xmlXPathObjectPtr;n_res++) {
46523         mem_base = xmlMemBlocks();
46524         ctxt = gen_xmlXPathContextPtr(n_ctxt, 0);
46525         res = gen_xmlXPathObjectPtr(n_res, 1);
46526 
46527         ret_val = xmlXPathEvalPredicate(ctxt, res);
46528         desret_int(ret_val);
46529         call_tests++;
46530         des_xmlXPathContextPtr(n_ctxt, ctxt, 0);
46531         des_xmlXPathObjectPtr(n_res, res, 1);
46532         xmlResetLastError();
46533         if (mem_base != xmlMemBlocks()) {
46534             printf("Leak of %d blocks found in xmlXPathEvalPredicate",
46535 	           xmlMemBlocks() - mem_base);
46536 	    test_ret++;
46537             printf(" %d", n_ctxt);
46538             printf(" %d", n_res);
46539             printf("\n");
46540         }
46541     }
46542     }
46543     function_tests++;
46544 #endif
46545 
46546     return(test_ret);
46547 }
46548 
46549 
46550 static int
test_xmlXPathInit(void)46551 test_xmlXPathInit(void) {
46552     int test_ret = 0;
46553 
46554 #if defined(LIBXML_XPATH_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED)
46555     int mem_base;
46556 
46557         mem_base = xmlMemBlocks();
46558 
46559         xmlXPathInit();
46560         call_tests++;
46561         xmlResetLastError();
46562         if (mem_base != xmlMemBlocks()) {
46563             printf("Leak of %d blocks found in xmlXPathInit",
46564 	           xmlMemBlocks() - mem_base);
46565 	    test_ret++;
46566             printf("\n");
46567         }
46568     function_tests++;
46569 #endif
46570 
46571     return(test_ret);
46572 }
46573 
46574 
46575 static int
test_xmlXPathIsInf(void)46576 test_xmlXPathIsInf(void) {
46577     int test_ret = 0;
46578 
46579 #if defined(LIBXML_XPATH_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED)
46580     int mem_base;
46581     int ret_val;
46582     double val; /* a double value */
46583     int n_val;
46584 
46585     for (n_val = 0;n_val < gen_nb_double;n_val++) {
46586         mem_base = xmlMemBlocks();
46587         val = gen_double(n_val, 0);
46588 
46589         ret_val = xmlXPathIsInf(val);
46590         desret_int(ret_val);
46591         call_tests++;
46592         des_double(n_val, val, 0);
46593         xmlResetLastError();
46594         if (mem_base != xmlMemBlocks()) {
46595             printf("Leak of %d blocks found in xmlXPathIsInf",
46596 	           xmlMemBlocks() - mem_base);
46597 	    test_ret++;
46598             printf(" %d", n_val);
46599             printf("\n");
46600         }
46601     }
46602     function_tests++;
46603 #endif
46604 
46605     return(test_ret);
46606 }
46607 
46608 
46609 static int
test_xmlXPathIsNaN(void)46610 test_xmlXPathIsNaN(void) {
46611     int test_ret = 0;
46612 
46613 #if defined(LIBXML_XPATH_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED)
46614     int mem_base;
46615     int ret_val;
46616     double val; /* a double value */
46617     int n_val;
46618 
46619     for (n_val = 0;n_val < gen_nb_double;n_val++) {
46620         mem_base = xmlMemBlocks();
46621         val = gen_double(n_val, 0);
46622 
46623         ret_val = xmlXPathIsNaN(val);
46624         desret_int(ret_val);
46625         call_tests++;
46626         des_double(n_val, val, 0);
46627         xmlResetLastError();
46628         if (mem_base != xmlMemBlocks()) {
46629             printf("Leak of %d blocks found in xmlXPathIsNaN",
46630 	           xmlMemBlocks() - mem_base);
46631 	    test_ret++;
46632             printf(" %d", n_val);
46633             printf("\n");
46634         }
46635     }
46636     function_tests++;
46637 #endif
46638 
46639     return(test_ret);
46640 }
46641 
46642 
46643 static int
test_xmlXPathNewContext(void)46644 test_xmlXPathNewContext(void) {
46645     int test_ret = 0;
46646 
46647 
46648     /* missing type support */
46649     return(test_ret);
46650 }
46651 
46652 
46653 static int
test_xmlXPathNodeEval(void)46654 test_xmlXPathNodeEval(void) {
46655     int test_ret = 0;
46656 
46657 #if defined(LIBXML_XPATH_ENABLED)
46658     int mem_base;
46659     xmlXPathObjectPtr ret_val;
46660     xmlNodePtr node; /* the node to to use as the context node */
46661     int n_node;
46662     const xmlChar * str; /* the XPath expression */
46663     int n_str;
46664     xmlXPathContextPtr ctx; /* the XPath context */
46665     int n_ctx;
46666 
46667     for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
46668     for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) {
46669     for (n_ctx = 0;n_ctx < gen_nb_xmlXPathContextPtr;n_ctx++) {
46670         mem_base = xmlMemBlocks();
46671         node = gen_xmlNodePtr(n_node, 0);
46672         str = gen_const_xmlChar_ptr(n_str, 1);
46673         ctx = gen_xmlXPathContextPtr(n_ctx, 2);
46674 
46675         ret_val = xmlXPathNodeEval(node, str, ctx);
46676         desret_xmlXPathObjectPtr(ret_val);
46677         call_tests++;
46678         des_xmlNodePtr(n_node, node, 0);
46679         des_const_xmlChar_ptr(n_str, str, 1);
46680         des_xmlXPathContextPtr(n_ctx, ctx, 2);
46681         xmlResetLastError();
46682         if (mem_base != xmlMemBlocks()) {
46683             printf("Leak of %d blocks found in xmlXPathNodeEval",
46684 	           xmlMemBlocks() - mem_base);
46685 	    test_ret++;
46686             printf(" %d", n_node);
46687             printf(" %d", n_str);
46688             printf(" %d", n_ctx);
46689             printf("\n");
46690         }
46691     }
46692     }
46693     }
46694     function_tests++;
46695 #endif
46696 
46697     return(test_ret);
46698 }
46699 
46700 
46701 static int
test_xmlXPathNodeSetCreate(void)46702 test_xmlXPathNodeSetCreate(void) {
46703     int test_ret = 0;
46704 
46705 #if defined(LIBXML_XPATH_ENABLED)
46706     int mem_base;
46707     xmlNodeSetPtr ret_val;
46708     xmlNodePtr val; /* an initial xmlNodePtr, or NULL */
46709     int n_val;
46710 
46711     for (n_val = 0;n_val < gen_nb_xmlNodePtr;n_val++) {
46712         mem_base = xmlMemBlocks();
46713         val = gen_xmlNodePtr(n_val, 0);
46714 
46715         ret_val = xmlXPathNodeSetCreate(val);
46716         desret_xmlNodeSetPtr(ret_val);
46717         call_tests++;
46718         des_xmlNodePtr(n_val, val, 0);
46719         xmlResetLastError();
46720         if (mem_base != xmlMemBlocks()) {
46721             printf("Leak of %d blocks found in xmlXPathNodeSetCreate",
46722 	           xmlMemBlocks() - mem_base);
46723 	    test_ret++;
46724             printf(" %d", n_val);
46725             printf("\n");
46726         }
46727     }
46728     function_tests++;
46729 #endif
46730 
46731     return(test_ret);
46732 }
46733 
46734 
46735 static int
test_xmlXPathObjectCopy(void)46736 test_xmlXPathObjectCopy(void) {
46737     int test_ret = 0;
46738 
46739 #if defined(LIBXML_XPATH_ENABLED)
46740     int mem_base;
46741     xmlXPathObjectPtr ret_val;
46742     xmlXPathObjectPtr val; /* the original object */
46743     int n_val;
46744 
46745     for (n_val = 0;n_val < gen_nb_xmlXPathObjectPtr;n_val++) {
46746         mem_base = xmlMemBlocks();
46747         val = gen_xmlXPathObjectPtr(n_val, 0);
46748 
46749         ret_val = xmlXPathObjectCopy(val);
46750         desret_xmlXPathObjectPtr(ret_val);
46751         call_tests++;
46752         des_xmlXPathObjectPtr(n_val, val, 0);
46753         xmlResetLastError();
46754         if (mem_base != xmlMemBlocks()) {
46755             printf("Leak of %d blocks found in xmlXPathObjectCopy",
46756 	           xmlMemBlocks() - mem_base);
46757 	    test_ret++;
46758             printf(" %d", n_val);
46759             printf("\n");
46760         }
46761     }
46762     function_tests++;
46763 #endif
46764 
46765     return(test_ret);
46766 }
46767 
46768 
46769 static int
test_xmlXPathOrderDocElems(void)46770 test_xmlXPathOrderDocElems(void) {
46771     int test_ret = 0;
46772 
46773 #if defined(LIBXML_XPATH_ENABLED)
46774     int mem_base;
46775     long ret_val;
46776     xmlDocPtr doc; /* an input document */
46777     int n_doc;
46778 
46779     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
46780         mem_base = xmlMemBlocks();
46781         doc = gen_xmlDocPtr(n_doc, 0);
46782 
46783         ret_val = xmlXPathOrderDocElems(doc);
46784         desret_long(ret_val);
46785         call_tests++;
46786         des_xmlDocPtr(n_doc, doc, 0);
46787         xmlResetLastError();
46788         if (mem_base != xmlMemBlocks()) {
46789             printf("Leak of %d blocks found in xmlXPathOrderDocElems",
46790 	           xmlMemBlocks() - mem_base);
46791 	    test_ret++;
46792             printf(" %d", n_doc);
46793             printf("\n");
46794         }
46795     }
46796     function_tests++;
46797 #endif
46798 
46799     return(test_ret);
46800 }
46801 
46802 
46803 static int
test_xmlXPathSetContextNode(void)46804 test_xmlXPathSetContextNode(void) {
46805     int test_ret = 0;
46806 
46807 #if defined(LIBXML_XPATH_ENABLED)
46808     int mem_base;
46809     int ret_val;
46810     xmlNodePtr node; /* the node to to use as the context node */
46811     int n_node;
46812     xmlXPathContextPtr ctx; /* the XPath context */
46813     int n_ctx;
46814 
46815     for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
46816     for (n_ctx = 0;n_ctx < gen_nb_xmlXPathContextPtr;n_ctx++) {
46817         mem_base = xmlMemBlocks();
46818         node = gen_xmlNodePtr(n_node, 0);
46819         ctx = gen_xmlXPathContextPtr(n_ctx, 1);
46820 
46821         ret_val = xmlXPathSetContextNode(node, ctx);
46822         desret_int(ret_val);
46823         call_tests++;
46824         des_xmlNodePtr(n_node, node, 0);
46825         des_xmlXPathContextPtr(n_ctx, ctx, 1);
46826         xmlResetLastError();
46827         if (mem_base != xmlMemBlocks()) {
46828             printf("Leak of %d blocks found in xmlXPathSetContextNode",
46829 	           xmlMemBlocks() - mem_base);
46830 	    test_ret++;
46831             printf(" %d", n_node);
46832             printf(" %d", n_ctx);
46833             printf("\n");
46834         }
46835     }
46836     }
46837     function_tests++;
46838 #endif
46839 
46840     return(test_ret);
46841 }
46842 
46843 static int
test_xpath(void)46844 test_xpath(void) {
46845     int test_ret = 0;
46846 
46847     if (quiet == 0) printf("Testing xpath : 32 of 40 functions ...\n");
46848     test_ret += test_xmlXPathCastBooleanToNumber();
46849     test_ret += test_xmlXPathCastBooleanToString();
46850     test_ret += test_xmlXPathCastNodeSetToBoolean();
46851     test_ret += test_xmlXPathCastNodeSetToNumber();
46852     test_ret += test_xmlXPathCastNodeSetToString();
46853     test_ret += test_xmlXPathCastNodeToNumber();
46854     test_ret += test_xmlXPathCastNodeToString();
46855     test_ret += test_xmlXPathCastNumberToBoolean();
46856     test_ret += test_xmlXPathCastNumberToString();
46857     test_ret += test_xmlXPathCastStringToBoolean();
46858     test_ret += test_xmlXPathCastStringToNumber();
46859     test_ret += test_xmlXPathCastToBoolean();
46860     test_ret += test_xmlXPathCastToNumber();
46861     test_ret += test_xmlXPathCastToString();
46862     test_ret += test_xmlXPathCmpNodes();
46863     test_ret += test_xmlXPathCompile();
46864     test_ret += test_xmlXPathCompiledEval();
46865     test_ret += test_xmlXPathCompiledEvalToBoolean();
46866     test_ret += test_xmlXPathContextSetCache();
46867     test_ret += test_xmlXPathConvertBoolean();
46868     test_ret += test_xmlXPathConvertNumber();
46869     test_ret += test_xmlXPathConvertString();
46870     test_ret += test_xmlXPathCtxtCompile();
46871     test_ret += test_xmlXPathEval();
46872     test_ret += test_xmlXPathEvalExpression();
46873     test_ret += test_xmlXPathEvalPredicate();
46874     test_ret += test_xmlXPathInit();
46875     test_ret += test_xmlXPathIsInf();
46876     test_ret += test_xmlXPathIsNaN();
46877     test_ret += test_xmlXPathNewContext();
46878     test_ret += test_xmlXPathNodeEval();
46879     test_ret += test_xmlXPathNodeSetCreate();
46880     test_ret += test_xmlXPathObjectCopy();
46881     test_ret += test_xmlXPathOrderDocElems();
46882     test_ret += test_xmlXPathSetContextNode();
46883 
46884     if (test_ret != 0)
46885 	printf("Module xpath: %d errors\n", test_ret);
46886     return(test_ret);
46887 }
46888 #ifdef LIBXML_XPATH_ENABLED
46889 
46890 #define gen_nb_xmlXPathParserContextPtr 1
46891 #define gen_xmlXPathParserContextPtr(no, nr) NULL
46892 #define des_xmlXPathParserContextPtr(no, val, nr)
46893 #endif
46894 
46895 
46896 static int
test_valuePop(void)46897 test_valuePop(void) {
46898     int test_ret = 0;
46899 
46900 #if defined(LIBXML_XPATH_ENABLED)
46901     int mem_base;
46902     xmlXPathObjectPtr ret_val;
46903     xmlXPathParserContextPtr ctxt; /* an XPath evaluation context */
46904     int n_ctxt;
46905 
46906     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
46907         mem_base = xmlMemBlocks();
46908         ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
46909 
46910         ret_val = valuePop(ctxt);
46911         desret_xmlXPathObjectPtr(ret_val);
46912         call_tests++;
46913         des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
46914         xmlResetLastError();
46915         if (mem_base != xmlMemBlocks()) {
46916             printf("Leak of %d blocks found in valuePop",
46917 	           xmlMemBlocks() - mem_base);
46918 	    test_ret++;
46919             printf(" %d", n_ctxt);
46920             printf("\n");
46921         }
46922     }
46923     function_tests++;
46924 #endif
46925 
46926     return(test_ret);
46927 }
46928 
46929 
46930 static int
test_valuePush(void)46931 test_valuePush(void) {
46932     int test_ret = 0;
46933 
46934 #if defined(LIBXML_XPATH_ENABLED)
46935     int mem_base;
46936     int ret_val;
46937     xmlXPathParserContextPtr ctxt; /* an XPath evaluation context */
46938     int n_ctxt;
46939     xmlXPathObjectPtr value; /* the XPath object */
46940     int n_value;
46941 
46942     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
46943     for (n_value = 0;n_value < gen_nb_xmlXPathObjectPtr;n_value++) {
46944         mem_base = xmlMemBlocks();
46945         ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
46946         value = gen_xmlXPathObjectPtr(n_value, 1);
46947 
46948         ret_val = valuePush(ctxt, value);
46949         desret_int(ret_val);
46950         call_tests++;
46951         des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
46952         des_xmlXPathObjectPtr(n_value, value, 1);
46953         xmlResetLastError();
46954         if (mem_base != xmlMemBlocks()) {
46955             printf("Leak of %d blocks found in valuePush",
46956 	           xmlMemBlocks() - mem_base);
46957 	    test_ret++;
46958             printf(" %d", n_ctxt);
46959             printf(" %d", n_value);
46960             printf("\n");
46961         }
46962     }
46963     }
46964     function_tests++;
46965 #endif
46966 
46967     return(test_ret);
46968 }
46969 
46970 
46971 static int
test_xmlXPathAddValues(void)46972 test_xmlXPathAddValues(void) {
46973     int test_ret = 0;
46974 
46975 #if defined(LIBXML_XPATH_ENABLED)
46976     int mem_base;
46977     xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
46978     int n_ctxt;
46979 
46980     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
46981         mem_base = xmlMemBlocks();
46982         ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
46983 
46984         xmlXPathAddValues(ctxt);
46985         call_tests++;
46986         des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
46987         xmlResetLastError();
46988         if (mem_base != xmlMemBlocks()) {
46989             printf("Leak of %d blocks found in xmlXPathAddValues",
46990 	           xmlMemBlocks() - mem_base);
46991 	    test_ret++;
46992             printf(" %d", n_ctxt);
46993             printf("\n");
46994         }
46995     }
46996     function_tests++;
46997 #endif
46998 
46999     return(test_ret);
47000 }
47001 
47002 
47003 static int
test_xmlXPathBooleanFunction(void)47004 test_xmlXPathBooleanFunction(void) {
47005     int test_ret = 0;
47006 
47007 #if defined(LIBXML_XPATH_ENABLED)
47008     int mem_base;
47009     xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
47010     int n_ctxt;
47011     int nargs; /* the number of arguments */
47012     int n_nargs;
47013 
47014     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
47015     for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
47016         mem_base = xmlMemBlocks();
47017         ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
47018         nargs = gen_int(n_nargs, 1);
47019 
47020         xmlXPathBooleanFunction(ctxt, nargs);
47021         call_tests++;
47022         des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
47023         des_int(n_nargs, nargs, 1);
47024         xmlResetLastError();
47025         if (mem_base != xmlMemBlocks()) {
47026             printf("Leak of %d blocks found in xmlXPathBooleanFunction",
47027 	           xmlMemBlocks() - mem_base);
47028 	    test_ret++;
47029             printf(" %d", n_ctxt);
47030             printf(" %d", n_nargs);
47031             printf("\n");
47032         }
47033     }
47034     }
47035     function_tests++;
47036 #endif
47037 
47038     return(test_ret);
47039 }
47040 
47041 
47042 static int
test_xmlXPathCeilingFunction(void)47043 test_xmlXPathCeilingFunction(void) {
47044     int test_ret = 0;
47045 
47046 #if defined(LIBXML_XPATH_ENABLED)
47047     int mem_base;
47048     xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
47049     int n_ctxt;
47050     int nargs; /* the number of arguments */
47051     int n_nargs;
47052 
47053     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
47054     for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
47055         mem_base = xmlMemBlocks();
47056         ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
47057         nargs = gen_int(n_nargs, 1);
47058 
47059         xmlXPathCeilingFunction(ctxt, nargs);
47060         call_tests++;
47061         des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
47062         des_int(n_nargs, nargs, 1);
47063         xmlResetLastError();
47064         if (mem_base != xmlMemBlocks()) {
47065             printf("Leak of %d blocks found in xmlXPathCeilingFunction",
47066 	           xmlMemBlocks() - mem_base);
47067 	    test_ret++;
47068             printf(" %d", n_ctxt);
47069             printf(" %d", n_nargs);
47070             printf("\n");
47071         }
47072     }
47073     }
47074     function_tests++;
47075 #endif
47076 
47077     return(test_ret);
47078 }
47079 
47080 
47081 static int
test_xmlXPathCompareValues(void)47082 test_xmlXPathCompareValues(void) {
47083     int test_ret = 0;
47084 
47085 #if defined(LIBXML_XPATH_ENABLED)
47086     int mem_base;
47087     int ret_val;
47088     xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
47089     int n_ctxt;
47090     int inf; /* less than (1) or greater than (0) */
47091     int n_inf;
47092     int strict; /* is the comparison strict */
47093     int n_strict;
47094 
47095     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
47096     for (n_inf = 0;n_inf < gen_nb_int;n_inf++) {
47097     for (n_strict = 0;n_strict < gen_nb_int;n_strict++) {
47098         mem_base = xmlMemBlocks();
47099         ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
47100         inf = gen_int(n_inf, 1);
47101         strict = gen_int(n_strict, 2);
47102 
47103         ret_val = xmlXPathCompareValues(ctxt, inf, strict);
47104         desret_int(ret_val);
47105         call_tests++;
47106         des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
47107         des_int(n_inf, inf, 1);
47108         des_int(n_strict, strict, 2);
47109         xmlResetLastError();
47110         if (mem_base != xmlMemBlocks()) {
47111             printf("Leak of %d blocks found in xmlXPathCompareValues",
47112 	           xmlMemBlocks() - mem_base);
47113 	    test_ret++;
47114             printf(" %d", n_ctxt);
47115             printf(" %d", n_inf);
47116             printf(" %d", n_strict);
47117             printf("\n");
47118         }
47119     }
47120     }
47121     }
47122     function_tests++;
47123 #endif
47124 
47125     return(test_ret);
47126 }
47127 
47128 
47129 static int
test_xmlXPathConcatFunction(void)47130 test_xmlXPathConcatFunction(void) {
47131     int test_ret = 0;
47132 
47133 #if defined(LIBXML_XPATH_ENABLED)
47134     int mem_base;
47135     xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
47136     int n_ctxt;
47137     int nargs; /* the number of arguments */
47138     int n_nargs;
47139 
47140     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
47141     for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
47142         mem_base = xmlMemBlocks();
47143         ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
47144         nargs = gen_int(n_nargs, 1);
47145 
47146         xmlXPathConcatFunction(ctxt, nargs);
47147         call_tests++;
47148         des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
47149         des_int(n_nargs, nargs, 1);
47150         xmlResetLastError();
47151         if (mem_base != xmlMemBlocks()) {
47152             printf("Leak of %d blocks found in xmlXPathConcatFunction",
47153 	           xmlMemBlocks() - mem_base);
47154 	    test_ret++;
47155             printf(" %d", n_ctxt);
47156             printf(" %d", n_nargs);
47157             printf("\n");
47158         }
47159     }
47160     }
47161     function_tests++;
47162 #endif
47163 
47164     return(test_ret);
47165 }
47166 
47167 
47168 static int
test_xmlXPathContainsFunction(void)47169 test_xmlXPathContainsFunction(void) {
47170     int test_ret = 0;
47171 
47172 #if defined(LIBXML_XPATH_ENABLED)
47173     int mem_base;
47174     xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
47175     int n_ctxt;
47176     int nargs; /* the number of arguments */
47177     int n_nargs;
47178 
47179     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
47180     for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
47181         mem_base = xmlMemBlocks();
47182         ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
47183         nargs = gen_int(n_nargs, 1);
47184 
47185         xmlXPathContainsFunction(ctxt, nargs);
47186         call_tests++;
47187         des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
47188         des_int(n_nargs, nargs, 1);
47189         xmlResetLastError();
47190         if (mem_base != xmlMemBlocks()) {
47191             printf("Leak of %d blocks found in xmlXPathContainsFunction",
47192 	           xmlMemBlocks() - mem_base);
47193 	    test_ret++;
47194             printf(" %d", n_ctxt);
47195             printf(" %d", n_nargs);
47196             printf("\n");
47197         }
47198     }
47199     }
47200     function_tests++;
47201 #endif
47202 
47203     return(test_ret);
47204 }
47205 
47206 
47207 static int
test_xmlXPathCountFunction(void)47208 test_xmlXPathCountFunction(void) {
47209     int test_ret = 0;
47210 
47211 #if defined(LIBXML_XPATH_ENABLED)
47212     int mem_base;
47213     xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
47214     int n_ctxt;
47215     int nargs; /* the number of arguments */
47216     int n_nargs;
47217 
47218     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
47219     for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
47220         mem_base = xmlMemBlocks();
47221         ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
47222         nargs = gen_int(n_nargs, 1);
47223 
47224         xmlXPathCountFunction(ctxt, nargs);
47225         call_tests++;
47226         des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
47227         des_int(n_nargs, nargs, 1);
47228         xmlResetLastError();
47229         if (mem_base != xmlMemBlocks()) {
47230             printf("Leak of %d blocks found in xmlXPathCountFunction",
47231 	           xmlMemBlocks() - mem_base);
47232 	    test_ret++;
47233             printf(" %d", n_ctxt);
47234             printf(" %d", n_nargs);
47235             printf("\n");
47236         }
47237     }
47238     }
47239     function_tests++;
47240 #endif
47241 
47242     return(test_ret);
47243 }
47244 
47245 
47246 static int
test_xmlXPathDebugDumpCompExpr(void)47247 test_xmlXPathDebugDumpCompExpr(void) {
47248     int test_ret = 0;
47249 
47250 #if defined(LIBXML_XPATH_ENABLED) && defined(LIBXML_DEBUG_ENABLED)
47251     int mem_base;
47252     FILE * output; /* the FILE * for the output */
47253     int n_output;
47254     xmlXPathCompExprPtr comp; /* the precompiled XPath expression */
47255     int n_comp;
47256     int depth; /* the indentation level. */
47257     int n_depth;
47258 
47259     for (n_output = 0;n_output < gen_nb_FILE_ptr;n_output++) {
47260     for (n_comp = 0;n_comp < gen_nb_xmlXPathCompExprPtr;n_comp++) {
47261     for (n_depth = 0;n_depth < gen_nb_int;n_depth++) {
47262         mem_base = xmlMemBlocks();
47263         output = gen_FILE_ptr(n_output, 0);
47264         comp = gen_xmlXPathCompExprPtr(n_comp, 1);
47265         depth = gen_int(n_depth, 2);
47266 
47267         xmlXPathDebugDumpCompExpr(output, comp, depth);
47268         call_tests++;
47269         des_FILE_ptr(n_output, output, 0);
47270         des_xmlXPathCompExprPtr(n_comp, comp, 1);
47271         des_int(n_depth, depth, 2);
47272         xmlResetLastError();
47273         if (mem_base != xmlMemBlocks()) {
47274             printf("Leak of %d blocks found in xmlXPathDebugDumpCompExpr",
47275 	           xmlMemBlocks() - mem_base);
47276 	    test_ret++;
47277             printf(" %d", n_output);
47278             printf(" %d", n_comp);
47279             printf(" %d", n_depth);
47280             printf("\n");
47281         }
47282     }
47283     }
47284     }
47285     function_tests++;
47286 #endif
47287 
47288     return(test_ret);
47289 }
47290 
47291 
47292 static int
test_xmlXPathDebugDumpObject(void)47293 test_xmlXPathDebugDumpObject(void) {
47294     int test_ret = 0;
47295 
47296 #if defined(LIBXML_XPATH_ENABLED) && defined(LIBXML_DEBUG_ENABLED)
47297     int mem_base;
47298     FILE * output; /* the FILE * to dump the output */
47299     int n_output;
47300     xmlXPathObjectPtr cur; /* the object to inspect */
47301     int n_cur;
47302     int depth; /* indentation level */
47303     int n_depth;
47304 
47305     for (n_output = 0;n_output < gen_nb_FILE_ptr;n_output++) {
47306     for (n_cur = 0;n_cur < gen_nb_xmlXPathObjectPtr;n_cur++) {
47307     for (n_depth = 0;n_depth < gen_nb_int;n_depth++) {
47308         mem_base = xmlMemBlocks();
47309         output = gen_FILE_ptr(n_output, 0);
47310         cur = gen_xmlXPathObjectPtr(n_cur, 1);
47311         depth = gen_int(n_depth, 2);
47312 
47313         xmlXPathDebugDumpObject(output, cur, depth);
47314         call_tests++;
47315         des_FILE_ptr(n_output, output, 0);
47316         des_xmlXPathObjectPtr(n_cur, cur, 1);
47317         des_int(n_depth, depth, 2);
47318         xmlResetLastError();
47319         if (mem_base != xmlMemBlocks()) {
47320             printf("Leak of %d blocks found in xmlXPathDebugDumpObject",
47321 	           xmlMemBlocks() - mem_base);
47322 	    test_ret++;
47323             printf(" %d", n_output);
47324             printf(" %d", n_cur);
47325             printf(" %d", n_depth);
47326             printf("\n");
47327         }
47328     }
47329     }
47330     }
47331     function_tests++;
47332 #endif
47333 
47334     return(test_ret);
47335 }
47336 
47337 
47338 static int
test_xmlXPathDifference(void)47339 test_xmlXPathDifference(void) {
47340     int test_ret = 0;
47341 
47342 #if defined(LIBXML_XPATH_ENABLED)
47343     int mem_base;
47344     xmlNodeSetPtr ret_val;
47345     xmlNodeSetPtr nodes1; /* a node-set */
47346     int n_nodes1;
47347     xmlNodeSetPtr nodes2; /* a node-set */
47348     int n_nodes2;
47349 
47350     for (n_nodes1 = 0;n_nodes1 < gen_nb_xmlNodeSetPtr;n_nodes1++) {
47351     for (n_nodes2 = 0;n_nodes2 < gen_nb_xmlNodeSetPtr;n_nodes2++) {
47352         mem_base = xmlMemBlocks();
47353         nodes1 = gen_xmlNodeSetPtr(n_nodes1, 0);
47354         nodes2 = gen_xmlNodeSetPtr(n_nodes2, 1);
47355 
47356         ret_val = xmlXPathDifference(nodes1, nodes2);
47357         desret_xmlNodeSetPtr(ret_val);
47358         call_tests++;
47359         des_xmlNodeSetPtr(n_nodes1, nodes1, 0);
47360         des_xmlNodeSetPtr(n_nodes2, nodes2, 1);
47361         xmlResetLastError();
47362         if (mem_base != xmlMemBlocks()) {
47363             printf("Leak of %d blocks found in xmlXPathDifference",
47364 	           xmlMemBlocks() - mem_base);
47365 	    test_ret++;
47366             printf(" %d", n_nodes1);
47367             printf(" %d", n_nodes2);
47368             printf("\n");
47369         }
47370     }
47371     }
47372     function_tests++;
47373 #endif
47374 
47375     return(test_ret);
47376 }
47377 
47378 
47379 static int
test_xmlXPathDistinct(void)47380 test_xmlXPathDistinct(void) {
47381     int test_ret = 0;
47382 
47383 #if defined(LIBXML_XPATH_ENABLED)
47384     int mem_base;
47385     xmlNodeSetPtr ret_val;
47386     xmlNodeSetPtr nodes; /* a node-set */
47387     int n_nodes;
47388 
47389     for (n_nodes = 0;n_nodes < gen_nb_xmlNodeSetPtr;n_nodes++) {
47390         mem_base = xmlMemBlocks();
47391         nodes = gen_xmlNodeSetPtr(n_nodes, 0);
47392 
47393         ret_val = xmlXPathDistinct(nodes);
47394         desret_xmlNodeSetPtr(ret_val);
47395         call_tests++;
47396         des_xmlNodeSetPtr(n_nodes, nodes, 0);
47397         xmlResetLastError();
47398         if (mem_base != xmlMemBlocks()) {
47399             printf("Leak of %d blocks found in xmlXPathDistinct",
47400 	           xmlMemBlocks() - mem_base);
47401 	    test_ret++;
47402             printf(" %d", n_nodes);
47403             printf("\n");
47404         }
47405     }
47406     function_tests++;
47407 #endif
47408 
47409     return(test_ret);
47410 }
47411 
47412 
47413 static int
test_xmlXPathDistinctSorted(void)47414 test_xmlXPathDistinctSorted(void) {
47415     int test_ret = 0;
47416 
47417 #if defined(LIBXML_XPATH_ENABLED)
47418     int mem_base;
47419     xmlNodeSetPtr ret_val;
47420     xmlNodeSetPtr nodes; /* a node-set, sorted by document order */
47421     int n_nodes;
47422 
47423     for (n_nodes = 0;n_nodes < gen_nb_xmlNodeSetPtr;n_nodes++) {
47424         mem_base = xmlMemBlocks();
47425         nodes = gen_xmlNodeSetPtr(n_nodes, 0);
47426 
47427         ret_val = xmlXPathDistinctSorted(nodes);
47428         desret_xmlNodeSetPtr(ret_val);
47429         call_tests++;
47430         des_xmlNodeSetPtr(n_nodes, nodes, 0);
47431         xmlResetLastError();
47432         if (mem_base != xmlMemBlocks()) {
47433             printf("Leak of %d blocks found in xmlXPathDistinctSorted",
47434 	           xmlMemBlocks() - mem_base);
47435 	    test_ret++;
47436             printf(" %d", n_nodes);
47437             printf("\n");
47438         }
47439     }
47440     function_tests++;
47441 #endif
47442 
47443     return(test_ret);
47444 }
47445 
47446 
47447 static int
test_xmlXPathDivValues(void)47448 test_xmlXPathDivValues(void) {
47449     int test_ret = 0;
47450 
47451 #if defined(LIBXML_XPATH_ENABLED)
47452     int mem_base;
47453     xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
47454     int n_ctxt;
47455 
47456     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
47457         mem_base = xmlMemBlocks();
47458         ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
47459 
47460         xmlXPathDivValues(ctxt);
47461         call_tests++;
47462         des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
47463         xmlResetLastError();
47464         if (mem_base != xmlMemBlocks()) {
47465             printf("Leak of %d blocks found in xmlXPathDivValues",
47466 	           xmlMemBlocks() - mem_base);
47467 	    test_ret++;
47468             printf(" %d", n_ctxt);
47469             printf("\n");
47470         }
47471     }
47472     function_tests++;
47473 #endif
47474 
47475     return(test_ret);
47476 }
47477 
47478 
47479 static int
test_xmlXPathEqualValues(void)47480 test_xmlXPathEqualValues(void) {
47481     int test_ret = 0;
47482 
47483 #if defined(LIBXML_XPATH_ENABLED)
47484     int mem_base;
47485     int ret_val;
47486     xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
47487     int n_ctxt;
47488 
47489     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
47490         mem_base = xmlMemBlocks();
47491         ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
47492 
47493         ret_val = xmlXPathEqualValues(ctxt);
47494         desret_int(ret_val);
47495         call_tests++;
47496         des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
47497         xmlResetLastError();
47498         if (mem_base != xmlMemBlocks()) {
47499             printf("Leak of %d blocks found in xmlXPathEqualValues",
47500 	           xmlMemBlocks() - mem_base);
47501 	    test_ret++;
47502             printf(" %d", n_ctxt);
47503             printf("\n");
47504         }
47505     }
47506     function_tests++;
47507 #endif
47508 
47509     return(test_ret);
47510 }
47511 
47512 
47513 static int
test_xmlXPathErr(void)47514 test_xmlXPathErr(void) {
47515     int test_ret = 0;
47516 
47517 #if defined(LIBXML_XPATH_ENABLED)
47518     int mem_base;
47519     xmlXPathParserContextPtr ctxt; /* a XPath parser context */
47520     int n_ctxt;
47521     int error; /* the error code */
47522     int n_error;
47523 
47524     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
47525     for (n_error = 0;n_error < gen_nb_int;n_error++) {
47526         mem_base = xmlMemBlocks();
47527         ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
47528         error = gen_int(n_error, 1);
47529 
47530         xmlXPathErr(ctxt, error);
47531         call_tests++;
47532         des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
47533         des_int(n_error, error, 1);
47534         xmlResetLastError();
47535         if (mem_base != xmlMemBlocks()) {
47536             printf("Leak of %d blocks found in xmlXPathErr",
47537 	           xmlMemBlocks() - mem_base);
47538 	    test_ret++;
47539             printf(" %d", n_ctxt);
47540             printf(" %d", n_error);
47541             printf("\n");
47542         }
47543     }
47544     }
47545     function_tests++;
47546 #endif
47547 
47548     return(test_ret);
47549 }
47550 
47551 
47552 static int
test_xmlXPathEvalExpr(void)47553 test_xmlXPathEvalExpr(void) {
47554     int test_ret = 0;
47555 
47556 #if defined(LIBXML_XPATH_ENABLED)
47557     int mem_base;
47558     xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
47559     int n_ctxt;
47560 
47561     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
47562         mem_base = xmlMemBlocks();
47563         ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
47564 
47565         xmlXPathEvalExpr(ctxt);
47566         call_tests++;
47567         des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
47568         xmlResetLastError();
47569         if (mem_base != xmlMemBlocks()) {
47570             printf("Leak of %d blocks found in xmlXPathEvalExpr",
47571 	           xmlMemBlocks() - mem_base);
47572 	    test_ret++;
47573             printf(" %d", n_ctxt);
47574             printf("\n");
47575         }
47576     }
47577     function_tests++;
47578 #endif
47579 
47580     return(test_ret);
47581 }
47582 
47583 
47584 static int
test_xmlXPathEvaluatePredicateResult(void)47585 test_xmlXPathEvaluatePredicateResult(void) {
47586     int test_ret = 0;
47587 
47588 #if defined(LIBXML_XPATH_ENABLED)
47589     int mem_base;
47590     int ret_val;
47591     xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
47592     int n_ctxt;
47593     xmlXPathObjectPtr res; /* the Predicate Expression evaluation result */
47594     int n_res;
47595 
47596     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
47597     for (n_res = 0;n_res < gen_nb_xmlXPathObjectPtr;n_res++) {
47598         mem_base = xmlMemBlocks();
47599         ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
47600         res = gen_xmlXPathObjectPtr(n_res, 1);
47601 
47602         ret_val = xmlXPathEvaluatePredicateResult(ctxt, res);
47603         desret_int(ret_val);
47604         call_tests++;
47605         des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
47606         des_xmlXPathObjectPtr(n_res, res, 1);
47607         xmlResetLastError();
47608         if (mem_base != xmlMemBlocks()) {
47609             printf("Leak of %d blocks found in xmlXPathEvaluatePredicateResult",
47610 	           xmlMemBlocks() - mem_base);
47611 	    test_ret++;
47612             printf(" %d", n_ctxt);
47613             printf(" %d", n_res);
47614             printf("\n");
47615         }
47616     }
47617     }
47618     function_tests++;
47619 #endif
47620 
47621     return(test_ret);
47622 }
47623 
47624 
47625 static int
test_xmlXPathFalseFunction(void)47626 test_xmlXPathFalseFunction(void) {
47627     int test_ret = 0;
47628 
47629 #if defined(LIBXML_XPATH_ENABLED)
47630     int mem_base;
47631     xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
47632     int n_ctxt;
47633     int nargs; /* the number of arguments */
47634     int n_nargs;
47635 
47636     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
47637     for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
47638         mem_base = xmlMemBlocks();
47639         ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
47640         nargs = gen_int(n_nargs, 1);
47641 
47642         xmlXPathFalseFunction(ctxt, nargs);
47643         call_tests++;
47644         des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
47645         des_int(n_nargs, nargs, 1);
47646         xmlResetLastError();
47647         if (mem_base != xmlMemBlocks()) {
47648             printf("Leak of %d blocks found in xmlXPathFalseFunction",
47649 	           xmlMemBlocks() - mem_base);
47650 	    test_ret++;
47651             printf(" %d", n_ctxt);
47652             printf(" %d", n_nargs);
47653             printf("\n");
47654         }
47655     }
47656     }
47657     function_tests++;
47658 #endif
47659 
47660     return(test_ret);
47661 }
47662 
47663 
47664 static int
test_xmlXPathFloorFunction(void)47665 test_xmlXPathFloorFunction(void) {
47666     int test_ret = 0;
47667 
47668 #if defined(LIBXML_XPATH_ENABLED)
47669     int mem_base;
47670     xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
47671     int n_ctxt;
47672     int nargs; /* the number of arguments */
47673     int n_nargs;
47674 
47675     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
47676     for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
47677         mem_base = xmlMemBlocks();
47678         ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
47679         nargs = gen_int(n_nargs, 1);
47680 
47681         xmlXPathFloorFunction(ctxt, nargs);
47682         call_tests++;
47683         des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
47684         des_int(n_nargs, nargs, 1);
47685         xmlResetLastError();
47686         if (mem_base != xmlMemBlocks()) {
47687             printf("Leak of %d blocks found in xmlXPathFloorFunction",
47688 	           xmlMemBlocks() - mem_base);
47689 	    test_ret++;
47690             printf(" %d", n_ctxt);
47691             printf(" %d", n_nargs);
47692             printf("\n");
47693         }
47694     }
47695     }
47696     function_tests++;
47697 #endif
47698 
47699     return(test_ret);
47700 }
47701 
47702 
47703 static int
test_xmlXPathFunctionLookup(void)47704 test_xmlXPathFunctionLookup(void) {
47705     int test_ret = 0;
47706 
47707 
47708     /* missing type support */
47709     return(test_ret);
47710 }
47711 
47712 
47713 static int
test_xmlXPathFunctionLookupNS(void)47714 test_xmlXPathFunctionLookupNS(void) {
47715     int test_ret = 0;
47716 
47717 
47718     /* missing type support */
47719     return(test_ret);
47720 }
47721 
47722 
47723 static int
test_xmlXPathHasSameNodes(void)47724 test_xmlXPathHasSameNodes(void) {
47725     int test_ret = 0;
47726 
47727 #if defined(LIBXML_XPATH_ENABLED)
47728     int mem_base;
47729     int ret_val;
47730     xmlNodeSetPtr nodes1; /* a node-set */
47731     int n_nodes1;
47732     xmlNodeSetPtr nodes2; /* a node-set */
47733     int n_nodes2;
47734 
47735     for (n_nodes1 = 0;n_nodes1 < gen_nb_xmlNodeSetPtr;n_nodes1++) {
47736     for (n_nodes2 = 0;n_nodes2 < gen_nb_xmlNodeSetPtr;n_nodes2++) {
47737         mem_base = xmlMemBlocks();
47738         nodes1 = gen_xmlNodeSetPtr(n_nodes1, 0);
47739         nodes2 = gen_xmlNodeSetPtr(n_nodes2, 1);
47740 
47741         ret_val = xmlXPathHasSameNodes(nodes1, nodes2);
47742         desret_int(ret_val);
47743         call_tests++;
47744         des_xmlNodeSetPtr(n_nodes1, nodes1, 0);
47745         des_xmlNodeSetPtr(n_nodes2, nodes2, 1);
47746         xmlResetLastError();
47747         if (mem_base != xmlMemBlocks()) {
47748             printf("Leak of %d blocks found in xmlXPathHasSameNodes",
47749 	           xmlMemBlocks() - mem_base);
47750 	    test_ret++;
47751             printf(" %d", n_nodes1);
47752             printf(" %d", n_nodes2);
47753             printf("\n");
47754         }
47755     }
47756     }
47757     function_tests++;
47758 #endif
47759 
47760     return(test_ret);
47761 }
47762 
47763 
47764 static int
test_xmlXPathIdFunction(void)47765 test_xmlXPathIdFunction(void) {
47766     int test_ret = 0;
47767 
47768 #if defined(LIBXML_XPATH_ENABLED)
47769     int mem_base;
47770     xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
47771     int n_ctxt;
47772     int nargs; /* the number of arguments */
47773     int n_nargs;
47774 
47775     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
47776     for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
47777         mem_base = xmlMemBlocks();
47778         ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
47779         nargs = gen_int(n_nargs, 1);
47780 
47781         xmlXPathIdFunction(ctxt, nargs);
47782         call_tests++;
47783         des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
47784         des_int(n_nargs, nargs, 1);
47785         xmlResetLastError();
47786         if (mem_base != xmlMemBlocks()) {
47787             printf("Leak of %d blocks found in xmlXPathIdFunction",
47788 	           xmlMemBlocks() - mem_base);
47789 	    test_ret++;
47790             printf(" %d", n_ctxt);
47791             printf(" %d", n_nargs);
47792             printf("\n");
47793         }
47794     }
47795     }
47796     function_tests++;
47797 #endif
47798 
47799     return(test_ret);
47800 }
47801 
47802 
47803 static int
test_xmlXPathIntersection(void)47804 test_xmlXPathIntersection(void) {
47805     int test_ret = 0;
47806 
47807 #if defined(LIBXML_XPATH_ENABLED)
47808     int mem_base;
47809     xmlNodeSetPtr ret_val;
47810     xmlNodeSetPtr nodes1; /* a node-set */
47811     int n_nodes1;
47812     xmlNodeSetPtr nodes2; /* a node-set */
47813     int n_nodes2;
47814 
47815     for (n_nodes1 = 0;n_nodes1 < gen_nb_xmlNodeSetPtr;n_nodes1++) {
47816     for (n_nodes2 = 0;n_nodes2 < gen_nb_xmlNodeSetPtr;n_nodes2++) {
47817         mem_base = xmlMemBlocks();
47818         nodes1 = gen_xmlNodeSetPtr(n_nodes1, 0);
47819         nodes2 = gen_xmlNodeSetPtr(n_nodes2, 1);
47820 
47821         ret_val = xmlXPathIntersection(nodes1, nodes2);
47822         desret_xmlNodeSetPtr(ret_val);
47823         call_tests++;
47824         des_xmlNodeSetPtr(n_nodes1, nodes1, 0);
47825         des_xmlNodeSetPtr(n_nodes2, nodes2, 1);
47826         xmlResetLastError();
47827         if (mem_base != xmlMemBlocks()) {
47828             printf("Leak of %d blocks found in xmlXPathIntersection",
47829 	           xmlMemBlocks() - mem_base);
47830 	    test_ret++;
47831             printf(" %d", n_nodes1);
47832             printf(" %d", n_nodes2);
47833             printf("\n");
47834         }
47835     }
47836     }
47837     function_tests++;
47838 #endif
47839 
47840     return(test_ret);
47841 }
47842 
47843 
47844 static int
test_xmlXPathIsNodeType(void)47845 test_xmlXPathIsNodeType(void) {
47846     int test_ret = 0;
47847 
47848 #if defined(LIBXML_XPATH_ENABLED)
47849     int mem_base;
47850     int ret_val;
47851     const xmlChar * name; /* a name string */
47852     int n_name;
47853 
47854     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
47855         mem_base = xmlMemBlocks();
47856         name = gen_const_xmlChar_ptr(n_name, 0);
47857 
47858         ret_val = xmlXPathIsNodeType(name);
47859         desret_int(ret_val);
47860         call_tests++;
47861         des_const_xmlChar_ptr(n_name, name, 0);
47862         xmlResetLastError();
47863         if (mem_base != xmlMemBlocks()) {
47864             printf("Leak of %d blocks found in xmlXPathIsNodeType",
47865 	           xmlMemBlocks() - mem_base);
47866 	    test_ret++;
47867             printf(" %d", n_name);
47868             printf("\n");
47869         }
47870     }
47871     function_tests++;
47872 #endif
47873 
47874     return(test_ret);
47875 }
47876 
47877 
47878 static int
test_xmlXPathLangFunction(void)47879 test_xmlXPathLangFunction(void) {
47880     int test_ret = 0;
47881 
47882 #if defined(LIBXML_XPATH_ENABLED)
47883     int mem_base;
47884     xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
47885     int n_ctxt;
47886     int nargs; /* the number of arguments */
47887     int n_nargs;
47888 
47889     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
47890     for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
47891         mem_base = xmlMemBlocks();
47892         ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
47893         nargs = gen_int(n_nargs, 1);
47894 
47895         xmlXPathLangFunction(ctxt, nargs);
47896         call_tests++;
47897         des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
47898         des_int(n_nargs, nargs, 1);
47899         xmlResetLastError();
47900         if (mem_base != xmlMemBlocks()) {
47901             printf("Leak of %d blocks found in xmlXPathLangFunction",
47902 	           xmlMemBlocks() - mem_base);
47903 	    test_ret++;
47904             printf(" %d", n_ctxt);
47905             printf(" %d", n_nargs);
47906             printf("\n");
47907         }
47908     }
47909     }
47910     function_tests++;
47911 #endif
47912 
47913     return(test_ret);
47914 }
47915 
47916 
47917 static int
test_xmlXPathLastFunction(void)47918 test_xmlXPathLastFunction(void) {
47919     int test_ret = 0;
47920 
47921 #if defined(LIBXML_XPATH_ENABLED)
47922     int mem_base;
47923     xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
47924     int n_ctxt;
47925     int nargs; /* the number of arguments */
47926     int n_nargs;
47927 
47928     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
47929     for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
47930         mem_base = xmlMemBlocks();
47931         ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
47932         nargs = gen_int(n_nargs, 1);
47933 
47934         xmlXPathLastFunction(ctxt, nargs);
47935         call_tests++;
47936         des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
47937         des_int(n_nargs, nargs, 1);
47938         xmlResetLastError();
47939         if (mem_base != xmlMemBlocks()) {
47940             printf("Leak of %d blocks found in xmlXPathLastFunction",
47941 	           xmlMemBlocks() - mem_base);
47942 	    test_ret++;
47943             printf(" %d", n_ctxt);
47944             printf(" %d", n_nargs);
47945             printf("\n");
47946         }
47947     }
47948     }
47949     function_tests++;
47950 #endif
47951 
47952     return(test_ret);
47953 }
47954 
47955 
47956 static int
test_xmlXPathLeading(void)47957 test_xmlXPathLeading(void) {
47958     int test_ret = 0;
47959 
47960 #if defined(LIBXML_XPATH_ENABLED)
47961     int mem_base;
47962     xmlNodeSetPtr ret_val;
47963     xmlNodeSetPtr nodes1; /* a node-set */
47964     int n_nodes1;
47965     xmlNodeSetPtr nodes2; /* a node-set */
47966     int n_nodes2;
47967 
47968     for (n_nodes1 = 0;n_nodes1 < gen_nb_xmlNodeSetPtr;n_nodes1++) {
47969     for (n_nodes2 = 0;n_nodes2 < gen_nb_xmlNodeSetPtr;n_nodes2++) {
47970         mem_base = xmlMemBlocks();
47971         nodes1 = gen_xmlNodeSetPtr(n_nodes1, 0);
47972         nodes2 = gen_xmlNodeSetPtr(n_nodes2, 1);
47973 
47974         ret_val = xmlXPathLeading(nodes1, nodes2);
47975         desret_xmlNodeSetPtr(ret_val);
47976         call_tests++;
47977         des_xmlNodeSetPtr(n_nodes1, nodes1, 0);
47978         des_xmlNodeSetPtr(n_nodes2, nodes2, 1);
47979         xmlResetLastError();
47980         if (mem_base != xmlMemBlocks()) {
47981             printf("Leak of %d blocks found in xmlXPathLeading",
47982 	           xmlMemBlocks() - mem_base);
47983 	    test_ret++;
47984             printf(" %d", n_nodes1);
47985             printf(" %d", n_nodes2);
47986             printf("\n");
47987         }
47988     }
47989     }
47990     function_tests++;
47991 #endif
47992 
47993     return(test_ret);
47994 }
47995 
47996 
47997 static int
test_xmlXPathLeadingSorted(void)47998 test_xmlXPathLeadingSorted(void) {
47999     int test_ret = 0;
48000 
48001 #if defined(LIBXML_XPATH_ENABLED)
48002     int mem_base;
48003     xmlNodeSetPtr ret_val;
48004     xmlNodeSetPtr nodes1; /* a node-set, sorted by document order */
48005     int n_nodes1;
48006     xmlNodeSetPtr nodes2; /* a node-set, sorted by document order */
48007     int n_nodes2;
48008 
48009     for (n_nodes1 = 0;n_nodes1 < gen_nb_xmlNodeSetPtr;n_nodes1++) {
48010     for (n_nodes2 = 0;n_nodes2 < gen_nb_xmlNodeSetPtr;n_nodes2++) {
48011         mem_base = xmlMemBlocks();
48012         nodes1 = gen_xmlNodeSetPtr(n_nodes1, 0);
48013         nodes2 = gen_xmlNodeSetPtr(n_nodes2, 1);
48014 
48015         ret_val = xmlXPathLeadingSorted(nodes1, nodes2);
48016         desret_xmlNodeSetPtr(ret_val);
48017         call_tests++;
48018         des_xmlNodeSetPtr(n_nodes1, nodes1, 0);
48019         des_xmlNodeSetPtr(n_nodes2, nodes2, 1);
48020         xmlResetLastError();
48021         if (mem_base != xmlMemBlocks()) {
48022             printf("Leak of %d blocks found in xmlXPathLeadingSorted",
48023 	           xmlMemBlocks() - mem_base);
48024 	    test_ret++;
48025             printf(" %d", n_nodes1);
48026             printf(" %d", n_nodes2);
48027             printf("\n");
48028         }
48029     }
48030     }
48031     function_tests++;
48032 #endif
48033 
48034     return(test_ret);
48035 }
48036 
48037 
48038 static int
test_xmlXPathLocalNameFunction(void)48039 test_xmlXPathLocalNameFunction(void) {
48040     int test_ret = 0;
48041 
48042 #if defined(LIBXML_XPATH_ENABLED)
48043     int mem_base;
48044     xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
48045     int n_ctxt;
48046     int nargs; /* the number of arguments */
48047     int n_nargs;
48048 
48049     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
48050     for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
48051         mem_base = xmlMemBlocks();
48052         ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
48053         nargs = gen_int(n_nargs, 1);
48054 
48055         xmlXPathLocalNameFunction(ctxt, nargs);
48056         call_tests++;
48057         des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
48058         des_int(n_nargs, nargs, 1);
48059         xmlResetLastError();
48060         if (mem_base != xmlMemBlocks()) {
48061             printf("Leak of %d blocks found in xmlXPathLocalNameFunction",
48062 	           xmlMemBlocks() - mem_base);
48063 	    test_ret++;
48064             printf(" %d", n_ctxt);
48065             printf(" %d", n_nargs);
48066             printf("\n");
48067         }
48068     }
48069     }
48070     function_tests++;
48071 #endif
48072 
48073     return(test_ret);
48074 }
48075 
48076 
48077 static int
test_xmlXPathModValues(void)48078 test_xmlXPathModValues(void) {
48079     int test_ret = 0;
48080 
48081 #if defined(LIBXML_XPATH_ENABLED)
48082     int mem_base;
48083     xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
48084     int n_ctxt;
48085 
48086     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
48087         mem_base = xmlMemBlocks();
48088         ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
48089 
48090         xmlXPathModValues(ctxt);
48091         call_tests++;
48092         des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
48093         xmlResetLastError();
48094         if (mem_base != xmlMemBlocks()) {
48095             printf("Leak of %d blocks found in xmlXPathModValues",
48096 	           xmlMemBlocks() - mem_base);
48097 	    test_ret++;
48098             printf(" %d", n_ctxt);
48099             printf("\n");
48100         }
48101     }
48102     function_tests++;
48103 #endif
48104 
48105     return(test_ret);
48106 }
48107 
48108 
48109 static int
test_xmlXPathMultValues(void)48110 test_xmlXPathMultValues(void) {
48111     int test_ret = 0;
48112 
48113 #if defined(LIBXML_XPATH_ENABLED)
48114     int mem_base;
48115     xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
48116     int n_ctxt;
48117 
48118     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
48119         mem_base = xmlMemBlocks();
48120         ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
48121 
48122         xmlXPathMultValues(ctxt);
48123         call_tests++;
48124         des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
48125         xmlResetLastError();
48126         if (mem_base != xmlMemBlocks()) {
48127             printf("Leak of %d blocks found in xmlXPathMultValues",
48128 	           xmlMemBlocks() - mem_base);
48129 	    test_ret++;
48130             printf(" %d", n_ctxt);
48131             printf("\n");
48132         }
48133     }
48134     function_tests++;
48135 #endif
48136 
48137     return(test_ret);
48138 }
48139 
48140 
48141 static int
test_xmlXPathNamespaceURIFunction(void)48142 test_xmlXPathNamespaceURIFunction(void) {
48143     int test_ret = 0;
48144 
48145 #if defined(LIBXML_XPATH_ENABLED)
48146     int mem_base;
48147     xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
48148     int n_ctxt;
48149     int nargs; /* the number of arguments */
48150     int n_nargs;
48151 
48152     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
48153     for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
48154         mem_base = xmlMemBlocks();
48155         ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
48156         nargs = gen_int(n_nargs, 1);
48157 
48158         xmlXPathNamespaceURIFunction(ctxt, nargs);
48159         call_tests++;
48160         des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
48161         des_int(n_nargs, nargs, 1);
48162         xmlResetLastError();
48163         if (mem_base != xmlMemBlocks()) {
48164             printf("Leak of %d blocks found in xmlXPathNamespaceURIFunction",
48165 	           xmlMemBlocks() - mem_base);
48166 	    test_ret++;
48167             printf(" %d", n_ctxt);
48168             printf(" %d", n_nargs);
48169             printf("\n");
48170         }
48171     }
48172     }
48173     function_tests++;
48174 #endif
48175 
48176     return(test_ret);
48177 }
48178 
48179 
48180 static int
test_xmlXPathNewBoolean(void)48181 test_xmlXPathNewBoolean(void) {
48182     int test_ret = 0;
48183 
48184 #if defined(LIBXML_XPATH_ENABLED)
48185     int mem_base;
48186     xmlXPathObjectPtr ret_val;
48187     int val; /* the boolean value */
48188     int n_val;
48189 
48190     for (n_val = 0;n_val < gen_nb_int;n_val++) {
48191         mem_base = xmlMemBlocks();
48192         val = gen_int(n_val, 0);
48193 
48194         ret_val = xmlXPathNewBoolean(val);
48195         desret_xmlXPathObjectPtr(ret_val);
48196         call_tests++;
48197         des_int(n_val, val, 0);
48198         xmlResetLastError();
48199         if (mem_base != xmlMemBlocks()) {
48200             printf("Leak of %d blocks found in xmlXPathNewBoolean",
48201 	           xmlMemBlocks() - mem_base);
48202 	    test_ret++;
48203             printf(" %d", n_val);
48204             printf("\n");
48205         }
48206     }
48207     function_tests++;
48208 #endif
48209 
48210     return(test_ret);
48211 }
48212 
48213 
48214 static int
test_xmlXPathNewCString(void)48215 test_xmlXPathNewCString(void) {
48216     int test_ret = 0;
48217 
48218 #if defined(LIBXML_XPATH_ENABLED)
48219     int mem_base;
48220     xmlXPathObjectPtr ret_val;
48221     const char * val; /* the char * value */
48222     int n_val;
48223 
48224     for (n_val = 0;n_val < gen_nb_const_char_ptr;n_val++) {
48225         mem_base = xmlMemBlocks();
48226         val = gen_const_char_ptr(n_val, 0);
48227 
48228         ret_val = xmlXPathNewCString(val);
48229         desret_xmlXPathObjectPtr(ret_val);
48230         call_tests++;
48231         des_const_char_ptr(n_val, val, 0);
48232         xmlResetLastError();
48233         if (mem_base != xmlMemBlocks()) {
48234             printf("Leak of %d blocks found in xmlXPathNewCString",
48235 	           xmlMemBlocks() - mem_base);
48236 	    test_ret++;
48237             printf(" %d", n_val);
48238             printf("\n");
48239         }
48240     }
48241     function_tests++;
48242 #endif
48243 
48244     return(test_ret);
48245 }
48246 
48247 
48248 static int
test_xmlXPathNewFloat(void)48249 test_xmlXPathNewFloat(void) {
48250     int test_ret = 0;
48251 
48252 #if defined(LIBXML_XPATH_ENABLED)
48253     int mem_base;
48254     xmlXPathObjectPtr ret_val;
48255     double val; /* the double value */
48256     int n_val;
48257 
48258     for (n_val = 0;n_val < gen_nb_double;n_val++) {
48259         mem_base = xmlMemBlocks();
48260         val = gen_double(n_val, 0);
48261 
48262         ret_val = xmlXPathNewFloat(val);
48263         desret_xmlXPathObjectPtr(ret_val);
48264         call_tests++;
48265         des_double(n_val, val, 0);
48266         xmlResetLastError();
48267         if (mem_base != xmlMemBlocks()) {
48268             printf("Leak of %d blocks found in xmlXPathNewFloat",
48269 	           xmlMemBlocks() - mem_base);
48270 	    test_ret++;
48271             printf(" %d", n_val);
48272             printf("\n");
48273         }
48274     }
48275     function_tests++;
48276 #endif
48277 
48278     return(test_ret);
48279 }
48280 
48281 
48282 static int
test_xmlXPathNewNodeSet(void)48283 test_xmlXPathNewNodeSet(void) {
48284     int test_ret = 0;
48285 
48286 #if defined(LIBXML_XPATH_ENABLED)
48287     int mem_base;
48288     xmlXPathObjectPtr ret_val;
48289     xmlNodePtr val; /* the NodePtr value */
48290     int n_val;
48291 
48292     for (n_val = 0;n_val < gen_nb_xmlNodePtr;n_val++) {
48293         mem_base = xmlMemBlocks();
48294         val = gen_xmlNodePtr(n_val, 0);
48295 
48296         ret_val = xmlXPathNewNodeSet(val);
48297         desret_xmlXPathObjectPtr(ret_val);
48298         call_tests++;
48299         des_xmlNodePtr(n_val, val, 0);
48300         xmlResetLastError();
48301         if (mem_base != xmlMemBlocks()) {
48302             printf("Leak of %d blocks found in xmlXPathNewNodeSet",
48303 	           xmlMemBlocks() - mem_base);
48304 	    test_ret++;
48305             printf(" %d", n_val);
48306             printf("\n");
48307         }
48308     }
48309     function_tests++;
48310 #endif
48311 
48312     return(test_ret);
48313 }
48314 
48315 
48316 static int
test_xmlXPathNewNodeSetList(void)48317 test_xmlXPathNewNodeSetList(void) {
48318     int test_ret = 0;
48319 
48320 #if defined(LIBXML_XPATH_ENABLED)
48321     int mem_base;
48322     xmlXPathObjectPtr ret_val;
48323     xmlNodeSetPtr val; /* an existing NodeSet */
48324     int n_val;
48325 
48326     for (n_val = 0;n_val < gen_nb_xmlNodeSetPtr;n_val++) {
48327         mem_base = xmlMemBlocks();
48328         val = gen_xmlNodeSetPtr(n_val, 0);
48329 
48330         ret_val = xmlXPathNewNodeSetList(val);
48331         desret_xmlXPathObjectPtr(ret_val);
48332         call_tests++;
48333         des_xmlNodeSetPtr(n_val, val, 0);
48334         xmlResetLastError();
48335         if (mem_base != xmlMemBlocks()) {
48336             printf("Leak of %d blocks found in xmlXPathNewNodeSetList",
48337 	           xmlMemBlocks() - mem_base);
48338 	    test_ret++;
48339             printf(" %d", n_val);
48340             printf("\n");
48341         }
48342     }
48343     function_tests++;
48344 #endif
48345 
48346     return(test_ret);
48347 }
48348 
48349 
48350 static int
test_xmlXPathNewParserContext(void)48351 test_xmlXPathNewParserContext(void) {
48352     int test_ret = 0;
48353 
48354 
48355     /* missing type support */
48356     return(test_ret);
48357 }
48358 
48359 
48360 static int
test_xmlXPathNewString(void)48361 test_xmlXPathNewString(void) {
48362     int test_ret = 0;
48363 
48364 #if defined(LIBXML_XPATH_ENABLED)
48365     int mem_base;
48366     xmlXPathObjectPtr ret_val;
48367     const xmlChar * val; /* the xmlChar * value */
48368     int n_val;
48369 
48370     for (n_val = 0;n_val < gen_nb_const_xmlChar_ptr;n_val++) {
48371         mem_base = xmlMemBlocks();
48372         val = gen_const_xmlChar_ptr(n_val, 0);
48373 
48374         ret_val = xmlXPathNewString(val);
48375         desret_xmlXPathObjectPtr(ret_val);
48376         call_tests++;
48377         des_const_xmlChar_ptr(n_val, val, 0);
48378         xmlResetLastError();
48379         if (mem_base != xmlMemBlocks()) {
48380             printf("Leak of %d blocks found in xmlXPathNewString",
48381 	           xmlMemBlocks() - mem_base);
48382 	    test_ret++;
48383             printf(" %d", n_val);
48384             printf("\n");
48385         }
48386     }
48387     function_tests++;
48388 #endif
48389 
48390     return(test_ret);
48391 }
48392 
48393 
48394 static int
test_xmlXPathNextAncestor(void)48395 test_xmlXPathNextAncestor(void) {
48396     int test_ret = 0;
48397 
48398 #if defined(LIBXML_XPATH_ENABLED)
48399     int mem_base;
48400     xmlNodePtr ret_val;
48401     xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
48402     int n_ctxt;
48403     xmlNodePtr cur; /* the current node in the traversal */
48404     int n_cur;
48405 
48406     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
48407     for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
48408         mem_base = xmlMemBlocks();
48409         ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
48410         cur = gen_xmlNodePtr(n_cur, 1);
48411 
48412         ret_val = xmlXPathNextAncestor(ctxt, cur);
48413         desret_xmlNodePtr(ret_val);
48414         call_tests++;
48415         des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
48416         des_xmlNodePtr(n_cur, cur, 1);
48417         xmlResetLastError();
48418         if (mem_base != xmlMemBlocks()) {
48419             printf("Leak of %d blocks found in xmlXPathNextAncestor",
48420 	           xmlMemBlocks() - mem_base);
48421 	    test_ret++;
48422             printf(" %d", n_ctxt);
48423             printf(" %d", n_cur);
48424             printf("\n");
48425         }
48426     }
48427     }
48428     function_tests++;
48429 #endif
48430 
48431     return(test_ret);
48432 }
48433 
48434 
48435 static int
test_xmlXPathNextAncestorOrSelf(void)48436 test_xmlXPathNextAncestorOrSelf(void) {
48437     int test_ret = 0;
48438 
48439 #if defined(LIBXML_XPATH_ENABLED)
48440     int mem_base;
48441     xmlNodePtr ret_val;
48442     xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
48443     int n_ctxt;
48444     xmlNodePtr cur; /* the current node in the traversal */
48445     int n_cur;
48446 
48447     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
48448     for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
48449         mem_base = xmlMemBlocks();
48450         ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
48451         cur = gen_xmlNodePtr(n_cur, 1);
48452 
48453         ret_val = xmlXPathNextAncestorOrSelf(ctxt, cur);
48454         desret_xmlNodePtr(ret_val);
48455         call_tests++;
48456         des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
48457         des_xmlNodePtr(n_cur, cur, 1);
48458         xmlResetLastError();
48459         if (mem_base != xmlMemBlocks()) {
48460             printf("Leak of %d blocks found in xmlXPathNextAncestorOrSelf",
48461 	           xmlMemBlocks() - mem_base);
48462 	    test_ret++;
48463             printf(" %d", n_ctxt);
48464             printf(" %d", n_cur);
48465             printf("\n");
48466         }
48467     }
48468     }
48469     function_tests++;
48470 #endif
48471 
48472     return(test_ret);
48473 }
48474 
48475 
48476 static int
test_xmlXPathNextAttribute(void)48477 test_xmlXPathNextAttribute(void) {
48478     int test_ret = 0;
48479 
48480 #if defined(LIBXML_XPATH_ENABLED)
48481     int mem_base;
48482     xmlNodePtr ret_val;
48483     xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
48484     int n_ctxt;
48485     xmlNodePtr cur; /* the current attribute in the traversal */
48486     int n_cur;
48487 
48488     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
48489     for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
48490         mem_base = xmlMemBlocks();
48491         ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
48492         cur = gen_xmlNodePtr(n_cur, 1);
48493 
48494         ret_val = xmlXPathNextAttribute(ctxt, cur);
48495         desret_xmlNodePtr(ret_val);
48496         call_tests++;
48497         des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
48498         des_xmlNodePtr(n_cur, cur, 1);
48499         xmlResetLastError();
48500         if (mem_base != xmlMemBlocks()) {
48501             printf("Leak of %d blocks found in xmlXPathNextAttribute",
48502 	           xmlMemBlocks() - mem_base);
48503 	    test_ret++;
48504             printf(" %d", n_ctxt);
48505             printf(" %d", n_cur);
48506             printf("\n");
48507         }
48508     }
48509     }
48510     function_tests++;
48511 #endif
48512 
48513     return(test_ret);
48514 }
48515 
48516 
48517 static int
test_xmlXPathNextChild(void)48518 test_xmlXPathNextChild(void) {
48519     int test_ret = 0;
48520 
48521 #if defined(LIBXML_XPATH_ENABLED)
48522     int mem_base;
48523     xmlNodePtr ret_val;
48524     xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
48525     int n_ctxt;
48526     xmlNodePtr cur; /* the current node in the traversal */
48527     int n_cur;
48528 
48529     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
48530     for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
48531         mem_base = xmlMemBlocks();
48532         ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
48533         cur = gen_xmlNodePtr(n_cur, 1);
48534 
48535         ret_val = xmlXPathNextChild(ctxt, cur);
48536         desret_xmlNodePtr(ret_val);
48537         call_tests++;
48538         des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
48539         des_xmlNodePtr(n_cur, cur, 1);
48540         xmlResetLastError();
48541         if (mem_base != xmlMemBlocks()) {
48542             printf("Leak of %d blocks found in xmlXPathNextChild",
48543 	           xmlMemBlocks() - mem_base);
48544 	    test_ret++;
48545             printf(" %d", n_ctxt);
48546             printf(" %d", n_cur);
48547             printf("\n");
48548         }
48549     }
48550     }
48551     function_tests++;
48552 #endif
48553 
48554     return(test_ret);
48555 }
48556 
48557 
48558 static int
test_xmlXPathNextDescendant(void)48559 test_xmlXPathNextDescendant(void) {
48560     int test_ret = 0;
48561 
48562 #if defined(LIBXML_XPATH_ENABLED)
48563     int mem_base;
48564     xmlNodePtr ret_val;
48565     xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
48566     int n_ctxt;
48567     xmlNodePtr cur; /* the current node in the traversal */
48568     int n_cur;
48569 
48570     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
48571     for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
48572         mem_base = xmlMemBlocks();
48573         ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
48574         cur = gen_xmlNodePtr(n_cur, 1);
48575 
48576         ret_val = xmlXPathNextDescendant(ctxt, cur);
48577         desret_xmlNodePtr(ret_val);
48578         call_tests++;
48579         des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
48580         des_xmlNodePtr(n_cur, cur, 1);
48581         xmlResetLastError();
48582         if (mem_base != xmlMemBlocks()) {
48583             printf("Leak of %d blocks found in xmlXPathNextDescendant",
48584 	           xmlMemBlocks() - mem_base);
48585 	    test_ret++;
48586             printf(" %d", n_ctxt);
48587             printf(" %d", n_cur);
48588             printf("\n");
48589         }
48590     }
48591     }
48592     function_tests++;
48593 #endif
48594 
48595     return(test_ret);
48596 }
48597 
48598 
48599 static int
test_xmlXPathNextDescendantOrSelf(void)48600 test_xmlXPathNextDescendantOrSelf(void) {
48601     int test_ret = 0;
48602 
48603 #if defined(LIBXML_XPATH_ENABLED)
48604     int mem_base;
48605     xmlNodePtr ret_val;
48606     xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
48607     int n_ctxt;
48608     xmlNodePtr cur; /* the current node in the traversal */
48609     int n_cur;
48610 
48611     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
48612     for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
48613         mem_base = xmlMemBlocks();
48614         ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
48615         cur = gen_xmlNodePtr(n_cur, 1);
48616 
48617         ret_val = xmlXPathNextDescendantOrSelf(ctxt, cur);
48618         desret_xmlNodePtr(ret_val);
48619         call_tests++;
48620         des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
48621         des_xmlNodePtr(n_cur, cur, 1);
48622         xmlResetLastError();
48623         if (mem_base != xmlMemBlocks()) {
48624             printf("Leak of %d blocks found in xmlXPathNextDescendantOrSelf",
48625 	           xmlMemBlocks() - mem_base);
48626 	    test_ret++;
48627             printf(" %d", n_ctxt);
48628             printf(" %d", n_cur);
48629             printf("\n");
48630         }
48631     }
48632     }
48633     function_tests++;
48634 #endif
48635 
48636     return(test_ret);
48637 }
48638 
48639 
48640 static int
test_xmlXPathNextFollowing(void)48641 test_xmlXPathNextFollowing(void) {
48642     int test_ret = 0;
48643 
48644 #if defined(LIBXML_XPATH_ENABLED)
48645     int mem_base;
48646     xmlNodePtr ret_val;
48647     xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
48648     int n_ctxt;
48649     xmlNodePtr cur; /* the current node in the traversal */
48650     int n_cur;
48651 
48652     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
48653     for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
48654         mem_base = xmlMemBlocks();
48655         ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
48656         cur = gen_xmlNodePtr(n_cur, 1);
48657 
48658         ret_val = xmlXPathNextFollowing(ctxt, cur);
48659         desret_xmlNodePtr(ret_val);
48660         call_tests++;
48661         des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
48662         des_xmlNodePtr(n_cur, cur, 1);
48663         xmlResetLastError();
48664         if (mem_base != xmlMemBlocks()) {
48665             printf("Leak of %d blocks found in xmlXPathNextFollowing",
48666 	           xmlMemBlocks() - mem_base);
48667 	    test_ret++;
48668             printf(" %d", n_ctxt);
48669             printf(" %d", n_cur);
48670             printf("\n");
48671         }
48672     }
48673     }
48674     function_tests++;
48675 #endif
48676 
48677     return(test_ret);
48678 }
48679 
48680 
48681 static int
test_xmlXPathNextFollowingSibling(void)48682 test_xmlXPathNextFollowingSibling(void) {
48683     int test_ret = 0;
48684 
48685 #if defined(LIBXML_XPATH_ENABLED)
48686     int mem_base;
48687     xmlNodePtr ret_val;
48688     xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
48689     int n_ctxt;
48690     xmlNodePtr cur; /* the current node in the traversal */
48691     int n_cur;
48692 
48693     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
48694     for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
48695         mem_base = xmlMemBlocks();
48696         ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
48697         cur = gen_xmlNodePtr(n_cur, 1);
48698 
48699         ret_val = xmlXPathNextFollowingSibling(ctxt, cur);
48700         desret_xmlNodePtr(ret_val);
48701         call_tests++;
48702         des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
48703         des_xmlNodePtr(n_cur, cur, 1);
48704         xmlResetLastError();
48705         if (mem_base != xmlMemBlocks()) {
48706             printf("Leak of %d blocks found in xmlXPathNextFollowingSibling",
48707 	           xmlMemBlocks() - mem_base);
48708 	    test_ret++;
48709             printf(" %d", n_ctxt);
48710             printf(" %d", n_cur);
48711             printf("\n");
48712         }
48713     }
48714     }
48715     function_tests++;
48716 #endif
48717 
48718     return(test_ret);
48719 }
48720 
48721 
48722 static int
test_xmlXPathNextNamespace(void)48723 test_xmlXPathNextNamespace(void) {
48724     int test_ret = 0;
48725 
48726 #if defined(LIBXML_XPATH_ENABLED)
48727     int mem_base;
48728     xmlNodePtr ret_val;
48729     xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
48730     int n_ctxt;
48731     xmlNodePtr cur; /* the current attribute in the traversal */
48732     int n_cur;
48733 
48734     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
48735     for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
48736         mem_base = xmlMemBlocks();
48737         ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
48738         cur = gen_xmlNodePtr(n_cur, 1);
48739 
48740         ret_val = xmlXPathNextNamespace(ctxt, cur);
48741         desret_xmlNodePtr(ret_val);
48742         call_tests++;
48743         des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
48744         des_xmlNodePtr(n_cur, cur, 1);
48745         xmlResetLastError();
48746         if (mem_base != xmlMemBlocks()) {
48747             printf("Leak of %d blocks found in xmlXPathNextNamespace",
48748 	           xmlMemBlocks() - mem_base);
48749 	    test_ret++;
48750             printf(" %d", n_ctxt);
48751             printf(" %d", n_cur);
48752             printf("\n");
48753         }
48754     }
48755     }
48756     function_tests++;
48757 #endif
48758 
48759     return(test_ret);
48760 }
48761 
48762 
48763 static int
test_xmlXPathNextParent(void)48764 test_xmlXPathNextParent(void) {
48765     int test_ret = 0;
48766 
48767 #if defined(LIBXML_XPATH_ENABLED)
48768     int mem_base;
48769     xmlNodePtr ret_val;
48770     xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
48771     int n_ctxt;
48772     xmlNodePtr cur; /* the current node in the traversal */
48773     int n_cur;
48774 
48775     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
48776     for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
48777         mem_base = xmlMemBlocks();
48778         ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
48779         cur = gen_xmlNodePtr(n_cur, 1);
48780 
48781         ret_val = xmlXPathNextParent(ctxt, cur);
48782         desret_xmlNodePtr(ret_val);
48783         call_tests++;
48784         des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
48785         des_xmlNodePtr(n_cur, cur, 1);
48786         xmlResetLastError();
48787         if (mem_base != xmlMemBlocks()) {
48788             printf("Leak of %d blocks found in xmlXPathNextParent",
48789 	           xmlMemBlocks() - mem_base);
48790 	    test_ret++;
48791             printf(" %d", n_ctxt);
48792             printf(" %d", n_cur);
48793             printf("\n");
48794         }
48795     }
48796     }
48797     function_tests++;
48798 #endif
48799 
48800     return(test_ret);
48801 }
48802 
48803 
48804 static int
test_xmlXPathNextPreceding(void)48805 test_xmlXPathNextPreceding(void) {
48806     int test_ret = 0;
48807 
48808 #if defined(LIBXML_XPATH_ENABLED)
48809     int mem_base;
48810     xmlNodePtr ret_val;
48811     xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
48812     int n_ctxt;
48813     xmlNodePtr cur; /* the current node in the traversal */
48814     int n_cur;
48815 
48816     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
48817     for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
48818         mem_base = xmlMemBlocks();
48819         ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
48820         cur = gen_xmlNodePtr(n_cur, 1);
48821 
48822         ret_val = xmlXPathNextPreceding(ctxt, cur);
48823         desret_xmlNodePtr(ret_val);
48824         call_tests++;
48825         des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
48826         des_xmlNodePtr(n_cur, cur, 1);
48827         xmlResetLastError();
48828         if (mem_base != xmlMemBlocks()) {
48829             printf("Leak of %d blocks found in xmlXPathNextPreceding",
48830 	           xmlMemBlocks() - mem_base);
48831 	    test_ret++;
48832             printf(" %d", n_ctxt);
48833             printf(" %d", n_cur);
48834             printf("\n");
48835         }
48836     }
48837     }
48838     function_tests++;
48839 #endif
48840 
48841     return(test_ret);
48842 }
48843 
48844 
48845 static int
test_xmlXPathNextPrecedingSibling(void)48846 test_xmlXPathNextPrecedingSibling(void) {
48847     int test_ret = 0;
48848 
48849 #if defined(LIBXML_XPATH_ENABLED)
48850     int mem_base;
48851     xmlNodePtr ret_val;
48852     xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
48853     int n_ctxt;
48854     xmlNodePtr cur; /* the current node in the traversal */
48855     int n_cur;
48856 
48857     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
48858     for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
48859         mem_base = xmlMemBlocks();
48860         ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
48861         cur = gen_xmlNodePtr(n_cur, 1);
48862 
48863         ret_val = xmlXPathNextPrecedingSibling(ctxt, cur);
48864         desret_xmlNodePtr(ret_val);
48865         call_tests++;
48866         des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
48867         des_xmlNodePtr(n_cur, cur, 1);
48868         xmlResetLastError();
48869         if (mem_base != xmlMemBlocks()) {
48870             printf("Leak of %d blocks found in xmlXPathNextPrecedingSibling",
48871 	           xmlMemBlocks() - mem_base);
48872 	    test_ret++;
48873             printf(" %d", n_ctxt);
48874             printf(" %d", n_cur);
48875             printf("\n");
48876         }
48877     }
48878     }
48879     function_tests++;
48880 #endif
48881 
48882     return(test_ret);
48883 }
48884 
48885 
48886 static int
test_xmlXPathNextSelf(void)48887 test_xmlXPathNextSelf(void) {
48888     int test_ret = 0;
48889 
48890 #if defined(LIBXML_XPATH_ENABLED)
48891     int mem_base;
48892     xmlNodePtr ret_val;
48893     xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
48894     int n_ctxt;
48895     xmlNodePtr cur; /* the current node in the traversal */
48896     int n_cur;
48897 
48898     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
48899     for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
48900         mem_base = xmlMemBlocks();
48901         ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
48902         cur = gen_xmlNodePtr(n_cur, 1);
48903 
48904         ret_val = xmlXPathNextSelf(ctxt, cur);
48905         desret_xmlNodePtr(ret_val);
48906         call_tests++;
48907         des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
48908         des_xmlNodePtr(n_cur, cur, 1);
48909         xmlResetLastError();
48910         if (mem_base != xmlMemBlocks()) {
48911             printf("Leak of %d blocks found in xmlXPathNextSelf",
48912 	           xmlMemBlocks() - mem_base);
48913 	    test_ret++;
48914             printf(" %d", n_ctxt);
48915             printf(" %d", n_cur);
48916             printf("\n");
48917         }
48918     }
48919     }
48920     function_tests++;
48921 #endif
48922 
48923     return(test_ret);
48924 }
48925 
48926 
48927 static int
test_xmlXPathNodeLeading(void)48928 test_xmlXPathNodeLeading(void) {
48929     int test_ret = 0;
48930 
48931 #if defined(LIBXML_XPATH_ENABLED)
48932     int mem_base;
48933     xmlNodeSetPtr ret_val;
48934     xmlNodeSetPtr nodes; /* a node-set */
48935     int n_nodes;
48936     xmlNodePtr node; /* a node */
48937     int n_node;
48938 
48939     for (n_nodes = 0;n_nodes < gen_nb_xmlNodeSetPtr;n_nodes++) {
48940     for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
48941         mem_base = xmlMemBlocks();
48942         nodes = gen_xmlNodeSetPtr(n_nodes, 0);
48943         node = gen_xmlNodePtr(n_node, 1);
48944 
48945         ret_val = xmlXPathNodeLeading(nodes, node);
48946         desret_xmlNodeSetPtr(ret_val);
48947         call_tests++;
48948         des_xmlNodeSetPtr(n_nodes, nodes, 0);
48949         des_xmlNodePtr(n_node, node, 1);
48950         xmlResetLastError();
48951         if (mem_base != xmlMemBlocks()) {
48952             printf("Leak of %d blocks found in xmlXPathNodeLeading",
48953 	           xmlMemBlocks() - mem_base);
48954 	    test_ret++;
48955             printf(" %d", n_nodes);
48956             printf(" %d", n_node);
48957             printf("\n");
48958         }
48959     }
48960     }
48961     function_tests++;
48962 #endif
48963 
48964     return(test_ret);
48965 }
48966 
48967 
48968 static int
test_xmlXPathNodeLeadingSorted(void)48969 test_xmlXPathNodeLeadingSorted(void) {
48970     int test_ret = 0;
48971 
48972 #if defined(LIBXML_XPATH_ENABLED)
48973     int mem_base;
48974     xmlNodeSetPtr ret_val;
48975     xmlNodeSetPtr nodes; /* a node-set, sorted by document order */
48976     int n_nodes;
48977     xmlNodePtr node; /* a node */
48978     int n_node;
48979 
48980     for (n_nodes = 0;n_nodes < gen_nb_xmlNodeSetPtr;n_nodes++) {
48981     for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
48982         mem_base = xmlMemBlocks();
48983         nodes = gen_xmlNodeSetPtr(n_nodes, 0);
48984         node = gen_xmlNodePtr(n_node, 1);
48985 
48986         ret_val = xmlXPathNodeLeadingSorted(nodes, node);
48987         desret_xmlNodeSetPtr(ret_val);
48988         call_tests++;
48989         des_xmlNodeSetPtr(n_nodes, nodes, 0);
48990         des_xmlNodePtr(n_node, node, 1);
48991         xmlResetLastError();
48992         if (mem_base != xmlMemBlocks()) {
48993             printf("Leak of %d blocks found in xmlXPathNodeLeadingSorted",
48994 	           xmlMemBlocks() - mem_base);
48995 	    test_ret++;
48996             printf(" %d", n_nodes);
48997             printf(" %d", n_node);
48998             printf("\n");
48999         }
49000     }
49001     }
49002     function_tests++;
49003 #endif
49004 
49005     return(test_ret);
49006 }
49007 
49008 
49009 static int
test_xmlXPathNodeSetAdd(void)49010 test_xmlXPathNodeSetAdd(void) {
49011     int test_ret = 0;
49012 
49013 #if defined(LIBXML_XPATH_ENABLED)
49014     int mem_base;
49015     int ret_val;
49016     xmlNodeSetPtr cur; /* the initial node set */
49017     int n_cur;
49018     xmlNodePtr val; /* a new xmlNodePtr */
49019     int n_val;
49020 
49021     for (n_cur = 0;n_cur < gen_nb_xmlNodeSetPtr;n_cur++) {
49022     for (n_val = 0;n_val < gen_nb_xmlNodePtr;n_val++) {
49023         mem_base = xmlMemBlocks();
49024         cur = gen_xmlNodeSetPtr(n_cur, 0);
49025         val = gen_xmlNodePtr(n_val, 1);
49026 
49027         ret_val = xmlXPathNodeSetAdd(cur, val);
49028         desret_int(ret_val);
49029         call_tests++;
49030         des_xmlNodeSetPtr(n_cur, cur, 0);
49031         des_xmlNodePtr(n_val, val, 1);
49032         xmlResetLastError();
49033         if (mem_base != xmlMemBlocks()) {
49034             printf("Leak of %d blocks found in xmlXPathNodeSetAdd",
49035 	           xmlMemBlocks() - mem_base);
49036 	    test_ret++;
49037             printf(" %d", n_cur);
49038             printf(" %d", n_val);
49039             printf("\n");
49040         }
49041     }
49042     }
49043     function_tests++;
49044 #endif
49045 
49046     return(test_ret);
49047 }
49048 
49049 
49050 static int
test_xmlXPathNodeSetAddNs(void)49051 test_xmlXPathNodeSetAddNs(void) {
49052     int test_ret = 0;
49053 
49054 #if defined(LIBXML_XPATH_ENABLED)
49055     int mem_base;
49056     int ret_val;
49057     xmlNodeSetPtr cur; /* the initial node set */
49058     int n_cur;
49059     xmlNodePtr node; /* the hosting node */
49060     int n_node;
49061     xmlNsPtr ns; /* a the namespace node */
49062     int n_ns;
49063 
49064     for (n_cur = 0;n_cur < gen_nb_xmlNodeSetPtr;n_cur++) {
49065     for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
49066     for (n_ns = 0;n_ns < gen_nb_xmlNsPtr;n_ns++) {
49067         mem_base = xmlMemBlocks();
49068         cur = gen_xmlNodeSetPtr(n_cur, 0);
49069         node = gen_xmlNodePtr(n_node, 1);
49070         ns = gen_xmlNsPtr(n_ns, 2);
49071 
49072         ret_val = xmlXPathNodeSetAddNs(cur, node, ns);
49073         desret_int(ret_val);
49074         call_tests++;
49075         des_xmlNodeSetPtr(n_cur, cur, 0);
49076         des_xmlNodePtr(n_node, node, 1);
49077         des_xmlNsPtr(n_ns, ns, 2);
49078         xmlResetLastError();
49079         if (mem_base != xmlMemBlocks()) {
49080             printf("Leak of %d blocks found in xmlXPathNodeSetAddNs",
49081 	           xmlMemBlocks() - mem_base);
49082 	    test_ret++;
49083             printf(" %d", n_cur);
49084             printf(" %d", n_node);
49085             printf(" %d", n_ns);
49086             printf("\n");
49087         }
49088     }
49089     }
49090     }
49091     function_tests++;
49092 #endif
49093 
49094     return(test_ret);
49095 }
49096 
49097 
49098 static int
test_xmlXPathNodeSetAddUnique(void)49099 test_xmlXPathNodeSetAddUnique(void) {
49100     int test_ret = 0;
49101 
49102 #if defined(LIBXML_XPATH_ENABLED)
49103     int mem_base;
49104     int ret_val;
49105     xmlNodeSetPtr cur; /* the initial node set */
49106     int n_cur;
49107     xmlNodePtr val; /* a new xmlNodePtr */
49108     int n_val;
49109 
49110     for (n_cur = 0;n_cur < gen_nb_xmlNodeSetPtr;n_cur++) {
49111     for (n_val = 0;n_val < gen_nb_xmlNodePtr;n_val++) {
49112         mem_base = xmlMemBlocks();
49113         cur = gen_xmlNodeSetPtr(n_cur, 0);
49114         val = gen_xmlNodePtr(n_val, 1);
49115 
49116         ret_val = xmlXPathNodeSetAddUnique(cur, val);
49117         desret_int(ret_val);
49118         call_tests++;
49119         des_xmlNodeSetPtr(n_cur, cur, 0);
49120         des_xmlNodePtr(n_val, val, 1);
49121         xmlResetLastError();
49122         if (mem_base != xmlMemBlocks()) {
49123             printf("Leak of %d blocks found in xmlXPathNodeSetAddUnique",
49124 	           xmlMemBlocks() - mem_base);
49125 	    test_ret++;
49126             printf(" %d", n_cur);
49127             printf(" %d", n_val);
49128             printf("\n");
49129         }
49130     }
49131     }
49132     function_tests++;
49133 #endif
49134 
49135     return(test_ret);
49136 }
49137 
49138 
49139 static int
test_xmlXPathNodeSetContains(void)49140 test_xmlXPathNodeSetContains(void) {
49141     int test_ret = 0;
49142 
49143 #if defined(LIBXML_XPATH_ENABLED)
49144     int mem_base;
49145     int ret_val;
49146     xmlNodeSetPtr cur; /* the node-set */
49147     int n_cur;
49148     xmlNodePtr val; /* the node */
49149     int n_val;
49150 
49151     for (n_cur = 0;n_cur < gen_nb_xmlNodeSetPtr;n_cur++) {
49152     for (n_val = 0;n_val < gen_nb_xmlNodePtr;n_val++) {
49153         mem_base = xmlMemBlocks();
49154         cur = gen_xmlNodeSetPtr(n_cur, 0);
49155         val = gen_xmlNodePtr(n_val, 1);
49156 
49157         ret_val = xmlXPathNodeSetContains(cur, val);
49158         desret_int(ret_val);
49159         call_tests++;
49160         des_xmlNodeSetPtr(n_cur, cur, 0);
49161         des_xmlNodePtr(n_val, val, 1);
49162         xmlResetLastError();
49163         if (mem_base != xmlMemBlocks()) {
49164             printf("Leak of %d blocks found in xmlXPathNodeSetContains",
49165 	           xmlMemBlocks() - mem_base);
49166 	    test_ret++;
49167             printf(" %d", n_cur);
49168             printf(" %d", n_val);
49169             printf("\n");
49170         }
49171     }
49172     }
49173     function_tests++;
49174 #endif
49175 
49176     return(test_ret);
49177 }
49178 
49179 
49180 static int
test_xmlXPathNodeSetDel(void)49181 test_xmlXPathNodeSetDel(void) {
49182     int test_ret = 0;
49183 
49184 #if defined(LIBXML_XPATH_ENABLED)
49185     int mem_base;
49186     xmlNodeSetPtr cur; /* the initial node set */
49187     int n_cur;
49188     xmlNodePtr val; /* an xmlNodePtr */
49189     int n_val;
49190 
49191     for (n_cur = 0;n_cur < gen_nb_xmlNodeSetPtr;n_cur++) {
49192     for (n_val = 0;n_val < gen_nb_xmlNodePtr;n_val++) {
49193         mem_base = xmlMemBlocks();
49194         cur = gen_xmlNodeSetPtr(n_cur, 0);
49195         val = gen_xmlNodePtr(n_val, 1);
49196 
49197         xmlXPathNodeSetDel(cur, val);
49198         call_tests++;
49199         des_xmlNodeSetPtr(n_cur, cur, 0);
49200         des_xmlNodePtr(n_val, val, 1);
49201         xmlResetLastError();
49202         if (mem_base != xmlMemBlocks()) {
49203             printf("Leak of %d blocks found in xmlXPathNodeSetDel",
49204 	           xmlMemBlocks() - mem_base);
49205 	    test_ret++;
49206             printf(" %d", n_cur);
49207             printf(" %d", n_val);
49208             printf("\n");
49209         }
49210     }
49211     }
49212     function_tests++;
49213 #endif
49214 
49215     return(test_ret);
49216 }
49217 
49218 
49219 static int
test_xmlXPathNodeSetMerge(void)49220 test_xmlXPathNodeSetMerge(void) {
49221     int test_ret = 0;
49222 
49223 #if defined(LIBXML_XPATH_ENABLED)
49224     int mem_base;
49225     xmlNodeSetPtr ret_val;
49226     xmlNodeSetPtr val1; /* the first NodeSet or NULL */
49227     int n_val1;
49228     xmlNodeSetPtr val2; /* the second NodeSet */
49229     int n_val2;
49230 
49231     for (n_val1 = 0;n_val1 < gen_nb_xmlNodeSetPtr;n_val1++) {
49232     for (n_val2 = 0;n_val2 < gen_nb_xmlNodeSetPtr;n_val2++) {
49233         mem_base = xmlMemBlocks();
49234         val1 = gen_xmlNodeSetPtr(n_val1, 0);
49235         val2 = gen_xmlNodeSetPtr(n_val2, 1);
49236 
49237         ret_val = xmlXPathNodeSetMerge(val1, val2);
49238         desret_xmlNodeSetPtr(ret_val);
49239         call_tests++;
49240         des_xmlNodeSetPtr(n_val1, val1, 0);
49241         des_xmlNodeSetPtr(n_val2, val2, 1);
49242         xmlResetLastError();
49243         if (mem_base != xmlMemBlocks()) {
49244             printf("Leak of %d blocks found in xmlXPathNodeSetMerge",
49245 	           xmlMemBlocks() - mem_base);
49246 	    test_ret++;
49247             printf(" %d", n_val1);
49248             printf(" %d", n_val2);
49249             printf("\n");
49250         }
49251     }
49252     }
49253     function_tests++;
49254 #endif
49255 
49256     return(test_ret);
49257 }
49258 
49259 
49260 static int
test_xmlXPathNodeSetRemove(void)49261 test_xmlXPathNodeSetRemove(void) {
49262     int test_ret = 0;
49263 
49264 #if defined(LIBXML_XPATH_ENABLED)
49265     int mem_base;
49266     xmlNodeSetPtr cur; /* the initial node set */
49267     int n_cur;
49268     int val; /* the index to remove */
49269     int n_val;
49270 
49271     for (n_cur = 0;n_cur < gen_nb_xmlNodeSetPtr;n_cur++) {
49272     for (n_val = 0;n_val < gen_nb_int;n_val++) {
49273         mem_base = xmlMemBlocks();
49274         cur = gen_xmlNodeSetPtr(n_cur, 0);
49275         val = gen_int(n_val, 1);
49276 
49277         xmlXPathNodeSetRemove(cur, val);
49278         call_tests++;
49279         des_xmlNodeSetPtr(n_cur, cur, 0);
49280         des_int(n_val, val, 1);
49281         xmlResetLastError();
49282         if (mem_base != xmlMemBlocks()) {
49283             printf("Leak of %d blocks found in xmlXPathNodeSetRemove",
49284 	           xmlMemBlocks() - mem_base);
49285 	    test_ret++;
49286             printf(" %d", n_cur);
49287             printf(" %d", n_val);
49288             printf("\n");
49289         }
49290     }
49291     }
49292     function_tests++;
49293 #endif
49294 
49295     return(test_ret);
49296 }
49297 
49298 
49299 static int
test_xmlXPathNodeSetSort(void)49300 test_xmlXPathNodeSetSort(void) {
49301     int test_ret = 0;
49302 
49303 #if defined(LIBXML_XPATH_ENABLED)
49304     int mem_base;
49305     xmlNodeSetPtr set; /* the node set */
49306     int n_set;
49307 
49308     for (n_set = 0;n_set < gen_nb_xmlNodeSetPtr;n_set++) {
49309         mem_base = xmlMemBlocks();
49310         set = gen_xmlNodeSetPtr(n_set, 0);
49311 
49312         xmlXPathNodeSetSort(set);
49313         call_tests++;
49314         des_xmlNodeSetPtr(n_set, set, 0);
49315         xmlResetLastError();
49316         if (mem_base != xmlMemBlocks()) {
49317             printf("Leak of %d blocks found in xmlXPathNodeSetSort",
49318 	           xmlMemBlocks() - mem_base);
49319 	    test_ret++;
49320             printf(" %d", n_set);
49321             printf("\n");
49322         }
49323     }
49324     function_tests++;
49325 #endif
49326 
49327     return(test_ret);
49328 }
49329 
49330 
49331 static int
test_xmlXPathNodeTrailing(void)49332 test_xmlXPathNodeTrailing(void) {
49333     int test_ret = 0;
49334 
49335 #if defined(LIBXML_XPATH_ENABLED)
49336     int mem_base;
49337     xmlNodeSetPtr ret_val;
49338     xmlNodeSetPtr nodes; /* a node-set */
49339     int n_nodes;
49340     xmlNodePtr node; /* a node */
49341     int n_node;
49342 
49343     for (n_nodes = 0;n_nodes < gen_nb_xmlNodeSetPtr;n_nodes++) {
49344     for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
49345         mem_base = xmlMemBlocks();
49346         nodes = gen_xmlNodeSetPtr(n_nodes, 0);
49347         node = gen_xmlNodePtr(n_node, 1);
49348 
49349         ret_val = xmlXPathNodeTrailing(nodes, node);
49350         desret_xmlNodeSetPtr(ret_val);
49351         call_tests++;
49352         des_xmlNodeSetPtr(n_nodes, nodes, 0);
49353         des_xmlNodePtr(n_node, node, 1);
49354         xmlResetLastError();
49355         if (mem_base != xmlMemBlocks()) {
49356             printf("Leak of %d blocks found in xmlXPathNodeTrailing",
49357 	           xmlMemBlocks() - mem_base);
49358 	    test_ret++;
49359             printf(" %d", n_nodes);
49360             printf(" %d", n_node);
49361             printf("\n");
49362         }
49363     }
49364     }
49365     function_tests++;
49366 #endif
49367 
49368     return(test_ret);
49369 }
49370 
49371 
49372 static int
test_xmlXPathNodeTrailingSorted(void)49373 test_xmlXPathNodeTrailingSorted(void) {
49374     int test_ret = 0;
49375 
49376 #if defined(LIBXML_XPATH_ENABLED)
49377     int mem_base;
49378     xmlNodeSetPtr ret_val;
49379     xmlNodeSetPtr nodes; /* a node-set, sorted by document order */
49380     int n_nodes;
49381     xmlNodePtr node; /* a node */
49382     int n_node;
49383 
49384     for (n_nodes = 0;n_nodes < gen_nb_xmlNodeSetPtr;n_nodes++) {
49385     for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
49386         mem_base = xmlMemBlocks();
49387         nodes = gen_xmlNodeSetPtr(n_nodes, 0);
49388         node = gen_xmlNodePtr(n_node, 1);
49389 
49390         ret_val = xmlXPathNodeTrailingSorted(nodes, node);
49391         desret_xmlNodeSetPtr(ret_val);
49392         call_tests++;
49393         des_xmlNodeSetPtr(n_nodes, nodes, 0);
49394         des_xmlNodePtr(n_node, node, 1);
49395         xmlResetLastError();
49396         if (mem_base != xmlMemBlocks()) {
49397             printf("Leak of %d blocks found in xmlXPathNodeTrailingSorted",
49398 	           xmlMemBlocks() - mem_base);
49399 	    test_ret++;
49400             printf(" %d", n_nodes);
49401             printf(" %d", n_node);
49402             printf("\n");
49403         }
49404     }
49405     }
49406     function_tests++;
49407 #endif
49408 
49409     return(test_ret);
49410 }
49411 
49412 
49413 static int
test_xmlXPathNormalizeFunction(void)49414 test_xmlXPathNormalizeFunction(void) {
49415     int test_ret = 0;
49416 
49417 #if defined(LIBXML_XPATH_ENABLED)
49418     int mem_base;
49419     xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
49420     int n_ctxt;
49421     int nargs; /* the number of arguments */
49422     int n_nargs;
49423 
49424     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
49425     for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
49426         mem_base = xmlMemBlocks();
49427         ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
49428         nargs = gen_int(n_nargs, 1);
49429 
49430         xmlXPathNormalizeFunction(ctxt, nargs);
49431         call_tests++;
49432         des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
49433         des_int(n_nargs, nargs, 1);
49434         xmlResetLastError();
49435         if (mem_base != xmlMemBlocks()) {
49436             printf("Leak of %d blocks found in xmlXPathNormalizeFunction",
49437 	           xmlMemBlocks() - mem_base);
49438 	    test_ret++;
49439             printf(" %d", n_ctxt);
49440             printf(" %d", n_nargs);
49441             printf("\n");
49442         }
49443     }
49444     }
49445     function_tests++;
49446 #endif
49447 
49448     return(test_ret);
49449 }
49450 
49451 
49452 static int
test_xmlXPathNotEqualValues(void)49453 test_xmlXPathNotEqualValues(void) {
49454     int test_ret = 0;
49455 
49456 #if defined(LIBXML_XPATH_ENABLED)
49457     int mem_base;
49458     int ret_val;
49459     xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
49460     int n_ctxt;
49461 
49462     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
49463         mem_base = xmlMemBlocks();
49464         ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
49465 
49466         ret_val = xmlXPathNotEqualValues(ctxt);
49467         desret_int(ret_val);
49468         call_tests++;
49469         des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
49470         xmlResetLastError();
49471         if (mem_base != xmlMemBlocks()) {
49472             printf("Leak of %d blocks found in xmlXPathNotEqualValues",
49473 	           xmlMemBlocks() - mem_base);
49474 	    test_ret++;
49475             printf(" %d", n_ctxt);
49476             printf("\n");
49477         }
49478     }
49479     function_tests++;
49480 #endif
49481 
49482     return(test_ret);
49483 }
49484 
49485 
49486 static int
test_xmlXPathNotFunction(void)49487 test_xmlXPathNotFunction(void) {
49488     int test_ret = 0;
49489 
49490 #if defined(LIBXML_XPATH_ENABLED)
49491     int mem_base;
49492     xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
49493     int n_ctxt;
49494     int nargs; /* the number of arguments */
49495     int n_nargs;
49496 
49497     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
49498     for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
49499         mem_base = xmlMemBlocks();
49500         ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
49501         nargs = gen_int(n_nargs, 1);
49502 
49503         xmlXPathNotFunction(ctxt, nargs);
49504         call_tests++;
49505         des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
49506         des_int(n_nargs, nargs, 1);
49507         xmlResetLastError();
49508         if (mem_base != xmlMemBlocks()) {
49509             printf("Leak of %d blocks found in xmlXPathNotFunction",
49510 	           xmlMemBlocks() - mem_base);
49511 	    test_ret++;
49512             printf(" %d", n_ctxt);
49513             printf(" %d", n_nargs);
49514             printf("\n");
49515         }
49516     }
49517     }
49518     function_tests++;
49519 #endif
49520 
49521     return(test_ret);
49522 }
49523 
49524 
49525 static int
test_xmlXPathNsLookup(void)49526 test_xmlXPathNsLookup(void) {
49527     int test_ret = 0;
49528 
49529 #if defined(LIBXML_XPATH_ENABLED)
49530     int mem_base;
49531     const xmlChar * ret_val;
49532     xmlXPathContextPtr ctxt; /* the XPath context */
49533     int n_ctxt;
49534     const xmlChar * prefix; /* the namespace prefix value */
49535     int n_prefix;
49536 
49537     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathContextPtr;n_ctxt++) {
49538     for (n_prefix = 0;n_prefix < gen_nb_const_xmlChar_ptr;n_prefix++) {
49539         mem_base = xmlMemBlocks();
49540         ctxt = gen_xmlXPathContextPtr(n_ctxt, 0);
49541         prefix = gen_const_xmlChar_ptr(n_prefix, 1);
49542 
49543         ret_val = xmlXPathNsLookup(ctxt, prefix);
49544         desret_const_xmlChar_ptr(ret_val);
49545         call_tests++;
49546         des_xmlXPathContextPtr(n_ctxt, ctxt, 0);
49547         des_const_xmlChar_ptr(n_prefix, prefix, 1);
49548         xmlResetLastError();
49549         if (mem_base != xmlMemBlocks()) {
49550             printf("Leak of %d blocks found in xmlXPathNsLookup",
49551 	           xmlMemBlocks() - mem_base);
49552 	    test_ret++;
49553             printf(" %d", n_ctxt);
49554             printf(" %d", n_prefix);
49555             printf("\n");
49556         }
49557     }
49558     }
49559     function_tests++;
49560 #endif
49561 
49562     return(test_ret);
49563 }
49564 
49565 
49566 static int
test_xmlXPathNumberFunction(void)49567 test_xmlXPathNumberFunction(void) {
49568     int test_ret = 0;
49569 
49570 #if defined(LIBXML_XPATH_ENABLED)
49571     int mem_base;
49572     xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
49573     int n_ctxt;
49574     int nargs; /* the number of arguments */
49575     int n_nargs;
49576 
49577     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
49578     for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
49579         mem_base = xmlMemBlocks();
49580         ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
49581         nargs = gen_int(n_nargs, 1);
49582 
49583         xmlXPathNumberFunction(ctxt, nargs);
49584         call_tests++;
49585         des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
49586         des_int(n_nargs, nargs, 1);
49587         xmlResetLastError();
49588         if (mem_base != xmlMemBlocks()) {
49589             printf("Leak of %d blocks found in xmlXPathNumberFunction",
49590 	           xmlMemBlocks() - mem_base);
49591 	    test_ret++;
49592             printf(" %d", n_ctxt);
49593             printf(" %d", n_nargs);
49594             printf("\n");
49595         }
49596     }
49597     }
49598     function_tests++;
49599 #endif
49600 
49601     return(test_ret);
49602 }
49603 
49604 
49605 static int
test_xmlXPathParseNCName(void)49606 test_xmlXPathParseNCName(void) {
49607     int test_ret = 0;
49608 
49609 #if defined(LIBXML_XPATH_ENABLED)
49610     int mem_base;
49611     xmlChar * ret_val;
49612     xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
49613     int n_ctxt;
49614 
49615     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
49616         mem_base = xmlMemBlocks();
49617         ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
49618 
49619         ret_val = xmlXPathParseNCName(ctxt);
49620         desret_xmlChar_ptr(ret_val);
49621         call_tests++;
49622         des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
49623         xmlResetLastError();
49624         if (mem_base != xmlMemBlocks()) {
49625             printf("Leak of %d blocks found in xmlXPathParseNCName",
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_xmlXPathParseName(void)49640 test_xmlXPathParseName(void) {
49641     int test_ret = 0;
49642 
49643 #if defined(LIBXML_XPATH_ENABLED)
49644     int mem_base;
49645     xmlChar * ret_val;
49646     xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
49647     int n_ctxt;
49648 
49649     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
49650         mem_base = xmlMemBlocks();
49651         ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
49652 
49653         ret_val = xmlXPathParseName(ctxt);
49654         desret_xmlChar_ptr(ret_val);
49655         call_tests++;
49656         des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
49657         xmlResetLastError();
49658         if (mem_base != xmlMemBlocks()) {
49659             printf("Leak of %d blocks found in xmlXPathParseName",
49660 	           xmlMemBlocks() - mem_base);
49661 	    test_ret++;
49662             printf(" %d", n_ctxt);
49663             printf("\n");
49664         }
49665     }
49666     function_tests++;
49667 #endif
49668 
49669     return(test_ret);
49670 }
49671 
49672 
49673 static int
test_xmlXPathPopBoolean(void)49674 test_xmlXPathPopBoolean(void) {
49675     int test_ret = 0;
49676 
49677 #if defined(LIBXML_XPATH_ENABLED)
49678     int mem_base;
49679     int ret_val;
49680     xmlXPathParserContextPtr ctxt; /* an XPath parser context */
49681     int n_ctxt;
49682 
49683     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
49684         mem_base = xmlMemBlocks();
49685         ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
49686 
49687         ret_val = xmlXPathPopBoolean(ctxt);
49688         desret_int(ret_val);
49689         call_tests++;
49690         des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
49691         xmlResetLastError();
49692         if (mem_base != xmlMemBlocks()) {
49693             printf("Leak of %d blocks found in xmlXPathPopBoolean",
49694 	           xmlMemBlocks() - mem_base);
49695 	    test_ret++;
49696             printf(" %d", n_ctxt);
49697             printf("\n");
49698         }
49699     }
49700     function_tests++;
49701 #endif
49702 
49703     return(test_ret);
49704 }
49705 
49706 
49707 static int
test_xmlXPathPopExternal(void)49708 test_xmlXPathPopExternal(void) {
49709     int test_ret = 0;
49710 
49711 #if defined(LIBXML_XPATH_ENABLED)
49712     int mem_base;
49713     void * ret_val;
49714     xmlXPathParserContextPtr ctxt; /* an XPath parser context */
49715     int n_ctxt;
49716 
49717     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
49718         mem_base = xmlMemBlocks();
49719         ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
49720 
49721         ret_val = xmlXPathPopExternal(ctxt);
49722         desret_void_ptr(ret_val);
49723         call_tests++;
49724         des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
49725         xmlResetLastError();
49726         if (mem_base != xmlMemBlocks()) {
49727             printf("Leak of %d blocks found in xmlXPathPopExternal",
49728 	           xmlMemBlocks() - mem_base);
49729 	    test_ret++;
49730             printf(" %d", n_ctxt);
49731             printf("\n");
49732         }
49733     }
49734     function_tests++;
49735 #endif
49736 
49737     return(test_ret);
49738 }
49739 
49740 
49741 static int
test_xmlXPathPopNodeSet(void)49742 test_xmlXPathPopNodeSet(void) {
49743     int test_ret = 0;
49744 
49745 #if defined(LIBXML_XPATH_ENABLED)
49746     int mem_base;
49747     xmlNodeSetPtr ret_val;
49748     xmlXPathParserContextPtr ctxt; /* an XPath parser context */
49749     int n_ctxt;
49750 
49751     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
49752         mem_base = xmlMemBlocks();
49753         ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
49754 
49755         ret_val = xmlXPathPopNodeSet(ctxt);
49756         desret_xmlNodeSetPtr(ret_val);
49757         call_tests++;
49758         des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
49759         xmlResetLastError();
49760         if (mem_base != xmlMemBlocks()) {
49761             printf("Leak of %d blocks found in xmlXPathPopNodeSet",
49762 	           xmlMemBlocks() - mem_base);
49763 	    test_ret++;
49764             printf(" %d", n_ctxt);
49765             printf("\n");
49766         }
49767     }
49768     function_tests++;
49769 #endif
49770 
49771     return(test_ret);
49772 }
49773 
49774 
49775 static int
test_xmlXPathPopNumber(void)49776 test_xmlXPathPopNumber(void) {
49777     int test_ret = 0;
49778 
49779 #if defined(LIBXML_XPATH_ENABLED)
49780     int mem_base;
49781     double ret_val;
49782     xmlXPathParserContextPtr ctxt; /* an XPath parser context */
49783     int n_ctxt;
49784 
49785     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
49786         mem_base = xmlMemBlocks();
49787         ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
49788 
49789         ret_val = xmlXPathPopNumber(ctxt);
49790         desret_double(ret_val);
49791         call_tests++;
49792         des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
49793         xmlResetLastError();
49794         if (mem_base != xmlMemBlocks()) {
49795             printf("Leak of %d blocks found in xmlXPathPopNumber",
49796 	           xmlMemBlocks() - mem_base);
49797 	    test_ret++;
49798             printf(" %d", n_ctxt);
49799             printf("\n");
49800         }
49801     }
49802     function_tests++;
49803 #endif
49804 
49805     return(test_ret);
49806 }
49807 
49808 
49809 static int
test_xmlXPathPopString(void)49810 test_xmlXPathPopString(void) {
49811     int test_ret = 0;
49812 
49813 #if defined(LIBXML_XPATH_ENABLED)
49814     int mem_base;
49815     xmlChar * ret_val;
49816     xmlXPathParserContextPtr ctxt; /* an XPath parser context */
49817     int n_ctxt;
49818 
49819     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
49820         mem_base = xmlMemBlocks();
49821         ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
49822 
49823         ret_val = xmlXPathPopString(ctxt);
49824         desret_xmlChar_ptr(ret_val);
49825         call_tests++;
49826         des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
49827         xmlResetLastError();
49828         if (mem_base != xmlMemBlocks()) {
49829             printf("Leak of %d blocks found in xmlXPathPopString",
49830 	           xmlMemBlocks() - mem_base);
49831 	    test_ret++;
49832             printf(" %d", n_ctxt);
49833             printf("\n");
49834         }
49835     }
49836     function_tests++;
49837 #endif
49838 
49839     return(test_ret);
49840 }
49841 
49842 
49843 static int
test_xmlXPathPositionFunction(void)49844 test_xmlXPathPositionFunction(void) {
49845     int test_ret = 0;
49846 
49847 #if defined(LIBXML_XPATH_ENABLED)
49848     int mem_base;
49849     xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
49850     int n_ctxt;
49851     int nargs; /* the number of arguments */
49852     int n_nargs;
49853 
49854     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
49855     for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
49856         mem_base = xmlMemBlocks();
49857         ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
49858         nargs = gen_int(n_nargs, 1);
49859 
49860         xmlXPathPositionFunction(ctxt, nargs);
49861         call_tests++;
49862         des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
49863         des_int(n_nargs, nargs, 1);
49864         xmlResetLastError();
49865         if (mem_base != xmlMemBlocks()) {
49866             printf("Leak of %d blocks found in xmlXPathPositionFunction",
49867 	           xmlMemBlocks() - mem_base);
49868 	    test_ret++;
49869             printf(" %d", n_ctxt);
49870             printf(" %d", n_nargs);
49871             printf("\n");
49872         }
49873     }
49874     }
49875     function_tests++;
49876 #endif
49877 
49878     return(test_ret);
49879 }
49880 
49881 
49882 static int
test_xmlXPathRegisterAllFunctions(void)49883 test_xmlXPathRegisterAllFunctions(void) {
49884     int test_ret = 0;
49885 
49886 #if defined(LIBXML_XPATH_ENABLED)
49887     int mem_base;
49888     xmlXPathContextPtr ctxt; /* the XPath context */
49889     int n_ctxt;
49890 
49891     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathContextPtr;n_ctxt++) {
49892         mem_base = xmlMemBlocks();
49893         ctxt = gen_xmlXPathContextPtr(n_ctxt, 0);
49894 
49895         xmlXPathRegisterAllFunctions(ctxt);
49896         call_tests++;
49897         des_xmlXPathContextPtr(n_ctxt, ctxt, 0);
49898         xmlResetLastError();
49899         if (mem_base != xmlMemBlocks()) {
49900             printf("Leak of %d blocks found in xmlXPathRegisterAllFunctions",
49901 	           xmlMemBlocks() - mem_base);
49902 	    test_ret++;
49903             printf(" %d", n_ctxt);
49904             printf("\n");
49905         }
49906     }
49907     function_tests++;
49908 #endif
49909 
49910     return(test_ret);
49911 }
49912 
49913 
49914 static int
test_xmlXPathRegisterFunc(void)49915 test_xmlXPathRegisterFunc(void) {
49916     int test_ret = 0;
49917 
49918 
49919     /* missing type support */
49920     return(test_ret);
49921 }
49922 
49923 
49924 static int
test_xmlXPathRegisterFuncLookup(void)49925 test_xmlXPathRegisterFuncLookup(void) {
49926     int test_ret = 0;
49927 
49928 
49929     /* missing type support */
49930     return(test_ret);
49931 }
49932 
49933 
49934 static int
test_xmlXPathRegisterFuncNS(void)49935 test_xmlXPathRegisterFuncNS(void) {
49936     int test_ret = 0;
49937 
49938 
49939     /* missing type support */
49940     return(test_ret);
49941 }
49942 
49943 
49944 static int
test_xmlXPathRegisterNs(void)49945 test_xmlXPathRegisterNs(void) {
49946     int test_ret = 0;
49947 
49948 #if defined(LIBXML_XPATH_ENABLED)
49949     int mem_base;
49950     int ret_val;
49951     xmlXPathContextPtr ctxt; /* the XPath context */
49952     int n_ctxt;
49953     const xmlChar * prefix; /* the namespace prefix cannot be NULL or empty string */
49954     int n_prefix;
49955     const xmlChar * ns_uri; /* the namespace name */
49956     int n_ns_uri;
49957 
49958     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathContextPtr;n_ctxt++) {
49959     for (n_prefix = 0;n_prefix < gen_nb_const_xmlChar_ptr;n_prefix++) {
49960     for (n_ns_uri = 0;n_ns_uri < gen_nb_const_xmlChar_ptr;n_ns_uri++) {
49961         mem_base = xmlMemBlocks();
49962         ctxt = gen_xmlXPathContextPtr(n_ctxt, 0);
49963         prefix = gen_const_xmlChar_ptr(n_prefix, 1);
49964         ns_uri = gen_const_xmlChar_ptr(n_ns_uri, 2);
49965 
49966         ret_val = xmlXPathRegisterNs(ctxt, prefix, ns_uri);
49967         desret_int(ret_val);
49968         call_tests++;
49969         des_xmlXPathContextPtr(n_ctxt, ctxt, 0);
49970         des_const_xmlChar_ptr(n_prefix, prefix, 1);
49971         des_const_xmlChar_ptr(n_ns_uri, ns_uri, 2);
49972         xmlResetLastError();
49973         if (mem_base != xmlMemBlocks()) {
49974             printf("Leak of %d blocks found in xmlXPathRegisterNs",
49975 	           xmlMemBlocks() - mem_base);
49976 	    test_ret++;
49977             printf(" %d", n_ctxt);
49978             printf(" %d", n_prefix);
49979             printf(" %d", n_ns_uri);
49980             printf("\n");
49981         }
49982     }
49983     }
49984     }
49985     function_tests++;
49986 #endif
49987 
49988     return(test_ret);
49989 }
49990 
49991 
49992 static int
test_xmlXPathRegisterVariable(void)49993 test_xmlXPathRegisterVariable(void) {
49994     int test_ret = 0;
49995 
49996 #if defined(LIBXML_XPATH_ENABLED)
49997     int mem_base;
49998     int ret_val;
49999     xmlXPathContextPtr ctxt; /* the XPath context */
50000     int n_ctxt;
50001     const xmlChar * name; /* the variable name */
50002     int n_name;
50003     xmlXPathObjectPtr value; /* the variable value or NULL */
50004     int n_value;
50005 
50006     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathContextPtr;n_ctxt++) {
50007     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
50008     for (n_value = 0;n_value < gen_nb_xmlXPathObjectPtr;n_value++) {
50009         mem_base = xmlMemBlocks();
50010         ctxt = gen_xmlXPathContextPtr(n_ctxt, 0);
50011         name = gen_const_xmlChar_ptr(n_name, 1);
50012         value = gen_xmlXPathObjectPtr(n_value, 2);
50013 
50014         ret_val = xmlXPathRegisterVariable(ctxt, name, value);
50015         desret_int(ret_val);
50016         call_tests++;
50017         des_xmlXPathContextPtr(n_ctxt, ctxt, 0);
50018         des_const_xmlChar_ptr(n_name, name, 1);
50019         des_xmlXPathObjectPtr(n_value, value, 2);
50020         xmlResetLastError();
50021         if (mem_base != xmlMemBlocks()) {
50022             printf("Leak of %d blocks found in xmlXPathRegisterVariable",
50023 	           xmlMemBlocks() - mem_base);
50024 	    test_ret++;
50025             printf(" %d", n_ctxt);
50026             printf(" %d", n_name);
50027             printf(" %d", n_value);
50028             printf("\n");
50029         }
50030     }
50031     }
50032     }
50033     function_tests++;
50034 #endif
50035 
50036     return(test_ret);
50037 }
50038 
50039 
50040 static int
test_xmlXPathRegisterVariableLookup(void)50041 test_xmlXPathRegisterVariableLookup(void) {
50042     int test_ret = 0;
50043 
50044 
50045     /* missing type support */
50046     return(test_ret);
50047 }
50048 
50049 
50050 static int
test_xmlXPathRegisterVariableNS(void)50051 test_xmlXPathRegisterVariableNS(void) {
50052     int test_ret = 0;
50053 
50054 #if defined(LIBXML_XPATH_ENABLED)
50055     int mem_base;
50056     int ret_val;
50057     xmlXPathContextPtr ctxt; /* the XPath context */
50058     int n_ctxt;
50059     const xmlChar * name; /* the variable name */
50060     int n_name;
50061     const xmlChar * ns_uri; /* the variable namespace URI */
50062     int n_ns_uri;
50063     xmlXPathObjectPtr value; /* the variable value or NULL */
50064     int n_value;
50065 
50066     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathContextPtr;n_ctxt++) {
50067     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
50068     for (n_ns_uri = 0;n_ns_uri < gen_nb_const_xmlChar_ptr;n_ns_uri++) {
50069     for (n_value = 0;n_value < gen_nb_xmlXPathObjectPtr;n_value++) {
50070         mem_base = xmlMemBlocks();
50071         ctxt = gen_xmlXPathContextPtr(n_ctxt, 0);
50072         name = gen_const_xmlChar_ptr(n_name, 1);
50073         ns_uri = gen_const_xmlChar_ptr(n_ns_uri, 2);
50074         value = gen_xmlXPathObjectPtr(n_value, 3);
50075 
50076         ret_val = xmlXPathRegisterVariableNS(ctxt, name, ns_uri, value);
50077         desret_int(ret_val);
50078         call_tests++;
50079         des_xmlXPathContextPtr(n_ctxt, ctxt, 0);
50080         des_const_xmlChar_ptr(n_name, name, 1);
50081         des_const_xmlChar_ptr(n_ns_uri, ns_uri, 2);
50082         des_xmlXPathObjectPtr(n_value, value, 3);
50083         xmlResetLastError();
50084         if (mem_base != xmlMemBlocks()) {
50085             printf("Leak of %d blocks found in xmlXPathRegisterVariableNS",
50086 	           xmlMemBlocks() - mem_base);
50087 	    test_ret++;
50088             printf(" %d", n_ctxt);
50089             printf(" %d", n_name);
50090             printf(" %d", n_ns_uri);
50091             printf(" %d", n_value);
50092             printf("\n");
50093         }
50094     }
50095     }
50096     }
50097     }
50098     function_tests++;
50099 #endif
50100 
50101     return(test_ret);
50102 }
50103 
50104 
50105 static int
test_xmlXPathRegisteredFuncsCleanup(void)50106 test_xmlXPathRegisteredFuncsCleanup(void) {
50107     int test_ret = 0;
50108 
50109 #if defined(LIBXML_XPATH_ENABLED)
50110     int mem_base;
50111     xmlXPathContextPtr ctxt; /* the XPath context */
50112     int n_ctxt;
50113 
50114     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathContextPtr;n_ctxt++) {
50115         mem_base = xmlMemBlocks();
50116         ctxt = gen_xmlXPathContextPtr(n_ctxt, 0);
50117 
50118         xmlXPathRegisteredFuncsCleanup(ctxt);
50119         call_tests++;
50120         des_xmlXPathContextPtr(n_ctxt, ctxt, 0);
50121         xmlResetLastError();
50122         if (mem_base != xmlMemBlocks()) {
50123             printf("Leak of %d blocks found in xmlXPathRegisteredFuncsCleanup",
50124 	           xmlMemBlocks() - mem_base);
50125 	    test_ret++;
50126             printf(" %d", n_ctxt);
50127             printf("\n");
50128         }
50129     }
50130     function_tests++;
50131 #endif
50132 
50133     return(test_ret);
50134 }
50135 
50136 
50137 static int
test_xmlXPathRegisteredNsCleanup(void)50138 test_xmlXPathRegisteredNsCleanup(void) {
50139     int test_ret = 0;
50140 
50141 #if defined(LIBXML_XPATH_ENABLED)
50142     int mem_base;
50143     xmlXPathContextPtr ctxt; /* the XPath context */
50144     int n_ctxt;
50145 
50146     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathContextPtr;n_ctxt++) {
50147         mem_base = xmlMemBlocks();
50148         ctxt = gen_xmlXPathContextPtr(n_ctxt, 0);
50149 
50150         xmlXPathRegisteredNsCleanup(ctxt);
50151         call_tests++;
50152         des_xmlXPathContextPtr(n_ctxt, ctxt, 0);
50153         xmlResetLastError();
50154         if (mem_base != xmlMemBlocks()) {
50155             printf("Leak of %d blocks found in xmlXPathRegisteredNsCleanup",
50156 	           xmlMemBlocks() - mem_base);
50157 	    test_ret++;
50158             printf(" %d", n_ctxt);
50159             printf("\n");
50160         }
50161     }
50162     function_tests++;
50163 #endif
50164 
50165     return(test_ret);
50166 }
50167 
50168 
50169 static int
test_xmlXPathRegisteredVariablesCleanup(void)50170 test_xmlXPathRegisteredVariablesCleanup(void) {
50171     int test_ret = 0;
50172 
50173 #if defined(LIBXML_XPATH_ENABLED)
50174     int mem_base;
50175     xmlXPathContextPtr ctxt; /* the XPath context */
50176     int n_ctxt;
50177 
50178     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathContextPtr;n_ctxt++) {
50179         mem_base = xmlMemBlocks();
50180         ctxt = gen_xmlXPathContextPtr(n_ctxt, 0);
50181 
50182         xmlXPathRegisteredVariablesCleanup(ctxt);
50183         call_tests++;
50184         des_xmlXPathContextPtr(n_ctxt, ctxt, 0);
50185         xmlResetLastError();
50186         if (mem_base != xmlMemBlocks()) {
50187             printf("Leak of %d blocks found in xmlXPathRegisteredVariablesCleanup",
50188 	           xmlMemBlocks() - mem_base);
50189 	    test_ret++;
50190             printf(" %d", n_ctxt);
50191             printf("\n");
50192         }
50193     }
50194     function_tests++;
50195 #endif
50196 
50197     return(test_ret);
50198 }
50199 
50200 
50201 static int
test_xmlXPathRoot(void)50202 test_xmlXPathRoot(void) {
50203     int test_ret = 0;
50204 
50205 #if defined(LIBXML_XPATH_ENABLED)
50206     int mem_base;
50207     xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
50208     int n_ctxt;
50209 
50210     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
50211         mem_base = xmlMemBlocks();
50212         ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
50213 
50214         xmlXPathRoot(ctxt);
50215         call_tests++;
50216         des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
50217         xmlResetLastError();
50218         if (mem_base != xmlMemBlocks()) {
50219             printf("Leak of %d blocks found in xmlXPathRoot",
50220 	           xmlMemBlocks() - mem_base);
50221 	    test_ret++;
50222             printf(" %d", n_ctxt);
50223             printf("\n");
50224         }
50225     }
50226     function_tests++;
50227 #endif
50228 
50229     return(test_ret);
50230 }
50231 
50232 
50233 static int
test_xmlXPathRoundFunction(void)50234 test_xmlXPathRoundFunction(void) {
50235     int test_ret = 0;
50236 
50237 #if defined(LIBXML_XPATH_ENABLED)
50238     int mem_base;
50239     xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
50240     int n_ctxt;
50241     int nargs; /* the number of arguments */
50242     int n_nargs;
50243 
50244     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
50245     for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
50246         mem_base = xmlMemBlocks();
50247         ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
50248         nargs = gen_int(n_nargs, 1);
50249 
50250         xmlXPathRoundFunction(ctxt, nargs);
50251         call_tests++;
50252         des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
50253         des_int(n_nargs, nargs, 1);
50254         xmlResetLastError();
50255         if (mem_base != xmlMemBlocks()) {
50256             printf("Leak of %d blocks found in xmlXPathRoundFunction",
50257 	           xmlMemBlocks() - mem_base);
50258 	    test_ret++;
50259             printf(" %d", n_ctxt);
50260             printf(" %d", n_nargs);
50261             printf("\n");
50262         }
50263     }
50264     }
50265     function_tests++;
50266 #endif
50267 
50268     return(test_ret);
50269 }
50270 
50271 
50272 static int
test_xmlXPathStartsWithFunction(void)50273 test_xmlXPathStartsWithFunction(void) {
50274     int test_ret = 0;
50275 
50276 #if defined(LIBXML_XPATH_ENABLED)
50277     int mem_base;
50278     xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
50279     int n_ctxt;
50280     int nargs; /* the number of arguments */
50281     int n_nargs;
50282 
50283     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
50284     for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
50285         mem_base = xmlMemBlocks();
50286         ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
50287         nargs = gen_int(n_nargs, 1);
50288 
50289         xmlXPathStartsWithFunction(ctxt, nargs);
50290         call_tests++;
50291         des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
50292         des_int(n_nargs, nargs, 1);
50293         xmlResetLastError();
50294         if (mem_base != xmlMemBlocks()) {
50295             printf("Leak of %d blocks found in xmlXPathStartsWithFunction",
50296 	           xmlMemBlocks() - mem_base);
50297 	    test_ret++;
50298             printf(" %d", n_ctxt);
50299             printf(" %d", n_nargs);
50300             printf("\n");
50301         }
50302     }
50303     }
50304     function_tests++;
50305 #endif
50306 
50307     return(test_ret);
50308 }
50309 
50310 
50311 static int
test_xmlXPathStringEvalNumber(void)50312 test_xmlXPathStringEvalNumber(void) {
50313     int test_ret = 0;
50314 
50315 #if defined(LIBXML_XPATH_ENABLED)
50316     int mem_base;
50317     double ret_val;
50318     const xmlChar * str; /* A string to scan */
50319     int n_str;
50320 
50321     for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) {
50322         mem_base = xmlMemBlocks();
50323         str = gen_const_xmlChar_ptr(n_str, 0);
50324 
50325         ret_val = xmlXPathStringEvalNumber(str);
50326         desret_double(ret_val);
50327         call_tests++;
50328         des_const_xmlChar_ptr(n_str, str, 0);
50329         xmlResetLastError();
50330         if (mem_base != xmlMemBlocks()) {
50331             printf("Leak of %d blocks found in xmlXPathStringEvalNumber",
50332 	           xmlMemBlocks() - mem_base);
50333 	    test_ret++;
50334             printf(" %d", n_str);
50335             printf("\n");
50336         }
50337     }
50338     function_tests++;
50339 #endif
50340 
50341     return(test_ret);
50342 }
50343 
50344 
50345 static int
test_xmlXPathStringFunction(void)50346 test_xmlXPathStringFunction(void) {
50347     int test_ret = 0;
50348 
50349 #if defined(LIBXML_XPATH_ENABLED)
50350     int mem_base;
50351     xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
50352     int n_ctxt;
50353     int nargs; /* the number of arguments */
50354     int n_nargs;
50355 
50356     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
50357     for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
50358         mem_base = xmlMemBlocks();
50359         ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
50360         nargs = gen_int(n_nargs, 1);
50361 
50362         xmlXPathStringFunction(ctxt, nargs);
50363         call_tests++;
50364         des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
50365         des_int(n_nargs, nargs, 1);
50366         xmlResetLastError();
50367         if (mem_base != xmlMemBlocks()) {
50368             printf("Leak of %d blocks found in xmlXPathStringFunction",
50369 	           xmlMemBlocks() - mem_base);
50370 	    test_ret++;
50371             printf(" %d", n_ctxt);
50372             printf(" %d", n_nargs);
50373             printf("\n");
50374         }
50375     }
50376     }
50377     function_tests++;
50378 #endif
50379 
50380     return(test_ret);
50381 }
50382 
50383 
50384 static int
test_xmlXPathStringLengthFunction(void)50385 test_xmlXPathStringLengthFunction(void) {
50386     int test_ret = 0;
50387 
50388 #if defined(LIBXML_XPATH_ENABLED)
50389     int mem_base;
50390     xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
50391     int n_ctxt;
50392     int nargs; /* the number of arguments */
50393     int n_nargs;
50394 
50395     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
50396     for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
50397         mem_base = xmlMemBlocks();
50398         ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
50399         nargs = gen_int(n_nargs, 1);
50400 
50401         xmlXPathStringLengthFunction(ctxt, nargs);
50402         call_tests++;
50403         des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
50404         des_int(n_nargs, nargs, 1);
50405         xmlResetLastError();
50406         if (mem_base != xmlMemBlocks()) {
50407             printf("Leak of %d blocks found in xmlXPathStringLengthFunction",
50408 	           xmlMemBlocks() - mem_base);
50409 	    test_ret++;
50410             printf(" %d", n_ctxt);
50411             printf(" %d", n_nargs);
50412             printf("\n");
50413         }
50414     }
50415     }
50416     function_tests++;
50417 #endif
50418 
50419     return(test_ret);
50420 }
50421 
50422 
50423 static int
test_xmlXPathSubValues(void)50424 test_xmlXPathSubValues(void) {
50425     int test_ret = 0;
50426 
50427 #if defined(LIBXML_XPATH_ENABLED)
50428     int mem_base;
50429     xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
50430     int n_ctxt;
50431 
50432     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
50433         mem_base = xmlMemBlocks();
50434         ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
50435 
50436         xmlXPathSubValues(ctxt);
50437         call_tests++;
50438         des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
50439         xmlResetLastError();
50440         if (mem_base != xmlMemBlocks()) {
50441             printf("Leak of %d blocks found in xmlXPathSubValues",
50442 	           xmlMemBlocks() - mem_base);
50443 	    test_ret++;
50444             printf(" %d", n_ctxt);
50445             printf("\n");
50446         }
50447     }
50448     function_tests++;
50449 #endif
50450 
50451     return(test_ret);
50452 }
50453 
50454 
50455 static int
test_xmlXPathSubstringAfterFunction(void)50456 test_xmlXPathSubstringAfterFunction(void) {
50457     int test_ret = 0;
50458 
50459 #if defined(LIBXML_XPATH_ENABLED)
50460     int mem_base;
50461     xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
50462     int n_ctxt;
50463     int nargs; /* the number of arguments */
50464     int n_nargs;
50465 
50466     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
50467     for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
50468         mem_base = xmlMemBlocks();
50469         ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
50470         nargs = gen_int(n_nargs, 1);
50471 
50472         xmlXPathSubstringAfterFunction(ctxt, nargs);
50473         call_tests++;
50474         des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
50475         des_int(n_nargs, nargs, 1);
50476         xmlResetLastError();
50477         if (mem_base != xmlMemBlocks()) {
50478             printf("Leak of %d blocks found in xmlXPathSubstringAfterFunction",
50479 	           xmlMemBlocks() - mem_base);
50480 	    test_ret++;
50481             printf(" %d", n_ctxt);
50482             printf(" %d", n_nargs);
50483             printf("\n");
50484         }
50485     }
50486     }
50487     function_tests++;
50488 #endif
50489 
50490     return(test_ret);
50491 }
50492 
50493 
50494 static int
test_xmlXPathSubstringBeforeFunction(void)50495 test_xmlXPathSubstringBeforeFunction(void) {
50496     int test_ret = 0;
50497 
50498 #if defined(LIBXML_XPATH_ENABLED)
50499     int mem_base;
50500     xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
50501     int n_ctxt;
50502     int nargs; /* the number of arguments */
50503     int n_nargs;
50504 
50505     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
50506     for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
50507         mem_base = xmlMemBlocks();
50508         ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
50509         nargs = gen_int(n_nargs, 1);
50510 
50511         xmlXPathSubstringBeforeFunction(ctxt, nargs);
50512         call_tests++;
50513         des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
50514         des_int(n_nargs, nargs, 1);
50515         xmlResetLastError();
50516         if (mem_base != xmlMemBlocks()) {
50517             printf("Leak of %d blocks found in xmlXPathSubstringBeforeFunction",
50518 	           xmlMemBlocks() - mem_base);
50519 	    test_ret++;
50520             printf(" %d", n_ctxt);
50521             printf(" %d", n_nargs);
50522             printf("\n");
50523         }
50524     }
50525     }
50526     function_tests++;
50527 #endif
50528 
50529     return(test_ret);
50530 }
50531 
50532 
50533 static int
test_xmlXPathSubstringFunction(void)50534 test_xmlXPathSubstringFunction(void) {
50535     int test_ret = 0;
50536 
50537 #if defined(LIBXML_XPATH_ENABLED)
50538     int mem_base;
50539     xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
50540     int n_ctxt;
50541     int nargs; /* the number of arguments */
50542     int n_nargs;
50543 
50544     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
50545     for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
50546         mem_base = xmlMemBlocks();
50547         ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
50548         nargs = gen_int(n_nargs, 1);
50549 
50550         xmlXPathSubstringFunction(ctxt, nargs);
50551         call_tests++;
50552         des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
50553         des_int(n_nargs, nargs, 1);
50554         xmlResetLastError();
50555         if (mem_base != xmlMemBlocks()) {
50556             printf("Leak of %d blocks found in xmlXPathSubstringFunction",
50557 	           xmlMemBlocks() - mem_base);
50558 	    test_ret++;
50559             printf(" %d", n_ctxt);
50560             printf(" %d", n_nargs);
50561             printf("\n");
50562         }
50563     }
50564     }
50565     function_tests++;
50566 #endif
50567 
50568     return(test_ret);
50569 }
50570 
50571 
50572 static int
test_xmlXPathSumFunction(void)50573 test_xmlXPathSumFunction(void) {
50574     int test_ret = 0;
50575 
50576 #if defined(LIBXML_XPATH_ENABLED)
50577     int mem_base;
50578     xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
50579     int n_ctxt;
50580     int nargs; /* the number of arguments */
50581     int n_nargs;
50582 
50583     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
50584     for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
50585         mem_base = xmlMemBlocks();
50586         ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
50587         nargs = gen_int(n_nargs, 1);
50588 
50589         xmlXPathSumFunction(ctxt, nargs);
50590         call_tests++;
50591         des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
50592         des_int(n_nargs, nargs, 1);
50593         xmlResetLastError();
50594         if (mem_base != xmlMemBlocks()) {
50595             printf("Leak of %d blocks found in xmlXPathSumFunction",
50596 	           xmlMemBlocks() - mem_base);
50597 	    test_ret++;
50598             printf(" %d", n_ctxt);
50599             printf(" %d", n_nargs);
50600             printf("\n");
50601         }
50602     }
50603     }
50604     function_tests++;
50605 #endif
50606 
50607     return(test_ret);
50608 }
50609 
50610 
50611 static int
test_xmlXPathTrailing(void)50612 test_xmlXPathTrailing(void) {
50613     int test_ret = 0;
50614 
50615 #if defined(LIBXML_XPATH_ENABLED)
50616     int mem_base;
50617     xmlNodeSetPtr ret_val;
50618     xmlNodeSetPtr nodes1; /* a node-set */
50619     int n_nodes1;
50620     xmlNodeSetPtr nodes2; /* a node-set */
50621     int n_nodes2;
50622 
50623     for (n_nodes1 = 0;n_nodes1 < gen_nb_xmlNodeSetPtr;n_nodes1++) {
50624     for (n_nodes2 = 0;n_nodes2 < gen_nb_xmlNodeSetPtr;n_nodes2++) {
50625         mem_base = xmlMemBlocks();
50626         nodes1 = gen_xmlNodeSetPtr(n_nodes1, 0);
50627         nodes2 = gen_xmlNodeSetPtr(n_nodes2, 1);
50628 
50629         ret_val = xmlXPathTrailing(nodes1, nodes2);
50630         desret_xmlNodeSetPtr(ret_val);
50631         call_tests++;
50632         des_xmlNodeSetPtr(n_nodes1, nodes1, 0);
50633         des_xmlNodeSetPtr(n_nodes2, nodes2, 1);
50634         xmlResetLastError();
50635         if (mem_base != xmlMemBlocks()) {
50636             printf("Leak of %d blocks found in xmlXPathTrailing",
50637 	           xmlMemBlocks() - mem_base);
50638 	    test_ret++;
50639             printf(" %d", n_nodes1);
50640             printf(" %d", n_nodes2);
50641             printf("\n");
50642         }
50643     }
50644     }
50645     function_tests++;
50646 #endif
50647 
50648     return(test_ret);
50649 }
50650 
50651 
50652 static int
test_xmlXPathTrailingSorted(void)50653 test_xmlXPathTrailingSorted(void) {
50654     int test_ret = 0;
50655 
50656 #if defined(LIBXML_XPATH_ENABLED)
50657     int mem_base;
50658     xmlNodeSetPtr ret_val;
50659     xmlNodeSetPtr nodes1; /* a node-set, sorted by document order */
50660     int n_nodes1;
50661     xmlNodeSetPtr nodes2; /* a node-set, sorted by document order */
50662     int n_nodes2;
50663 
50664     for (n_nodes1 = 0;n_nodes1 < gen_nb_xmlNodeSetPtr;n_nodes1++) {
50665     for (n_nodes2 = 0;n_nodes2 < gen_nb_xmlNodeSetPtr;n_nodes2++) {
50666         mem_base = xmlMemBlocks();
50667         nodes1 = gen_xmlNodeSetPtr(n_nodes1, 0);
50668         nodes2 = gen_xmlNodeSetPtr(n_nodes2, 1);
50669 
50670         ret_val = xmlXPathTrailingSorted(nodes1, nodes2);
50671         desret_xmlNodeSetPtr(ret_val);
50672         call_tests++;
50673         des_xmlNodeSetPtr(n_nodes1, nodes1, 0);
50674         des_xmlNodeSetPtr(n_nodes2, nodes2, 1);
50675         xmlResetLastError();
50676         if (mem_base != xmlMemBlocks()) {
50677             printf("Leak of %d blocks found in xmlXPathTrailingSorted",
50678 	           xmlMemBlocks() - mem_base);
50679 	    test_ret++;
50680             printf(" %d", n_nodes1);
50681             printf(" %d", n_nodes2);
50682             printf("\n");
50683         }
50684     }
50685     }
50686     function_tests++;
50687 #endif
50688 
50689     return(test_ret);
50690 }
50691 
50692 
50693 static int
test_xmlXPathTranslateFunction(void)50694 test_xmlXPathTranslateFunction(void) {
50695     int test_ret = 0;
50696 
50697 #if defined(LIBXML_XPATH_ENABLED)
50698     int mem_base;
50699     xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
50700     int n_ctxt;
50701     int nargs; /* the number of arguments */
50702     int n_nargs;
50703 
50704     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
50705     for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
50706         mem_base = xmlMemBlocks();
50707         ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
50708         nargs = gen_int(n_nargs, 1);
50709 
50710         xmlXPathTranslateFunction(ctxt, nargs);
50711         call_tests++;
50712         des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
50713         des_int(n_nargs, nargs, 1);
50714         xmlResetLastError();
50715         if (mem_base != xmlMemBlocks()) {
50716             printf("Leak of %d blocks found in xmlXPathTranslateFunction",
50717 	           xmlMemBlocks() - mem_base);
50718 	    test_ret++;
50719             printf(" %d", n_ctxt);
50720             printf(" %d", n_nargs);
50721             printf("\n");
50722         }
50723     }
50724     }
50725     function_tests++;
50726 #endif
50727 
50728     return(test_ret);
50729 }
50730 
50731 
50732 static int
test_xmlXPathTrueFunction(void)50733 test_xmlXPathTrueFunction(void) {
50734     int test_ret = 0;
50735 
50736 #if defined(LIBXML_XPATH_ENABLED)
50737     int mem_base;
50738     xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
50739     int n_ctxt;
50740     int nargs; /* the number of arguments */
50741     int n_nargs;
50742 
50743     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
50744     for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
50745         mem_base = xmlMemBlocks();
50746         ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
50747         nargs = gen_int(n_nargs, 1);
50748 
50749         xmlXPathTrueFunction(ctxt, nargs);
50750         call_tests++;
50751         des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
50752         des_int(n_nargs, nargs, 1);
50753         xmlResetLastError();
50754         if (mem_base != xmlMemBlocks()) {
50755             printf("Leak of %d blocks found in xmlXPathTrueFunction",
50756 	           xmlMemBlocks() - mem_base);
50757 	    test_ret++;
50758             printf(" %d", n_ctxt);
50759             printf(" %d", n_nargs);
50760             printf("\n");
50761         }
50762     }
50763     }
50764     function_tests++;
50765 #endif
50766 
50767     return(test_ret);
50768 }
50769 
50770 
50771 static int
test_xmlXPathValueFlipSign(void)50772 test_xmlXPathValueFlipSign(void) {
50773     int test_ret = 0;
50774 
50775 #if defined(LIBXML_XPATH_ENABLED)
50776     int mem_base;
50777     xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
50778     int n_ctxt;
50779 
50780     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
50781         mem_base = xmlMemBlocks();
50782         ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
50783 
50784         xmlXPathValueFlipSign(ctxt);
50785         call_tests++;
50786         des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
50787         xmlResetLastError();
50788         if (mem_base != xmlMemBlocks()) {
50789             printf("Leak of %d blocks found in xmlXPathValueFlipSign",
50790 	           xmlMemBlocks() - mem_base);
50791 	    test_ret++;
50792             printf(" %d", n_ctxt);
50793             printf("\n");
50794         }
50795     }
50796     function_tests++;
50797 #endif
50798 
50799     return(test_ret);
50800 }
50801 
50802 
50803 static int
test_xmlXPathVariableLookup(void)50804 test_xmlXPathVariableLookup(void) {
50805     int test_ret = 0;
50806 
50807 #if defined(LIBXML_XPATH_ENABLED)
50808     int mem_base;
50809     xmlXPathObjectPtr ret_val;
50810     xmlXPathContextPtr ctxt; /* the XPath context */
50811     int n_ctxt;
50812     const xmlChar * name; /* the variable name */
50813     int n_name;
50814 
50815     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathContextPtr;n_ctxt++) {
50816     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
50817         mem_base = xmlMemBlocks();
50818         ctxt = gen_xmlXPathContextPtr(n_ctxt, 0);
50819         name = gen_const_xmlChar_ptr(n_name, 1);
50820 
50821         ret_val = xmlXPathVariableLookup(ctxt, name);
50822         desret_xmlXPathObjectPtr(ret_val);
50823         call_tests++;
50824         des_xmlXPathContextPtr(n_ctxt, ctxt, 0);
50825         des_const_xmlChar_ptr(n_name, name, 1);
50826         xmlResetLastError();
50827         if (mem_base != xmlMemBlocks()) {
50828             printf("Leak of %d blocks found in xmlXPathVariableLookup",
50829 	           xmlMemBlocks() - mem_base);
50830 	    test_ret++;
50831             printf(" %d", n_ctxt);
50832             printf(" %d", n_name);
50833             printf("\n");
50834         }
50835     }
50836     }
50837     function_tests++;
50838 #endif
50839 
50840     return(test_ret);
50841 }
50842 
50843 
50844 static int
test_xmlXPathVariableLookupNS(void)50845 test_xmlXPathVariableLookupNS(void) {
50846     int test_ret = 0;
50847 
50848 #if defined(LIBXML_XPATH_ENABLED)
50849     int mem_base;
50850     xmlXPathObjectPtr ret_val;
50851     xmlXPathContextPtr ctxt; /* the XPath context */
50852     int n_ctxt;
50853     const xmlChar * name; /* the variable name */
50854     int n_name;
50855     const xmlChar * ns_uri; /* the variable namespace URI */
50856     int n_ns_uri;
50857 
50858     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathContextPtr;n_ctxt++) {
50859     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
50860     for (n_ns_uri = 0;n_ns_uri < gen_nb_const_xmlChar_ptr;n_ns_uri++) {
50861         mem_base = xmlMemBlocks();
50862         ctxt = gen_xmlXPathContextPtr(n_ctxt, 0);
50863         name = gen_const_xmlChar_ptr(n_name, 1);
50864         ns_uri = gen_const_xmlChar_ptr(n_ns_uri, 2);
50865 
50866         ret_val = xmlXPathVariableLookupNS(ctxt, name, ns_uri);
50867         desret_xmlXPathObjectPtr(ret_val);
50868         call_tests++;
50869         des_xmlXPathContextPtr(n_ctxt, ctxt, 0);
50870         des_const_xmlChar_ptr(n_name, name, 1);
50871         des_const_xmlChar_ptr(n_ns_uri, ns_uri, 2);
50872         xmlResetLastError();
50873         if (mem_base != xmlMemBlocks()) {
50874             printf("Leak of %d blocks found in xmlXPathVariableLookupNS",
50875 	           xmlMemBlocks() - mem_base);
50876 	    test_ret++;
50877             printf(" %d", n_ctxt);
50878             printf(" %d", n_name);
50879             printf(" %d", n_ns_uri);
50880             printf("\n");
50881         }
50882     }
50883     }
50884     }
50885     function_tests++;
50886 #endif
50887 
50888     return(test_ret);
50889 }
50890 
50891 
50892 static int
test_xmlXPathWrapCString(void)50893 test_xmlXPathWrapCString(void) {
50894     int test_ret = 0;
50895 
50896 #if defined(LIBXML_XPATH_ENABLED)
50897     int mem_base;
50898     xmlXPathObjectPtr ret_val;
50899     char * val; /* the char * value */
50900     int n_val;
50901 
50902     for (n_val = 0;n_val < gen_nb_char_ptr;n_val++) {
50903         mem_base = xmlMemBlocks();
50904         val = gen_char_ptr(n_val, 0);
50905 
50906         ret_val = xmlXPathWrapCString(val);
50907         desret_xmlXPathObjectPtr(ret_val);
50908         call_tests++;
50909         des_char_ptr(n_val, val, 0);
50910         xmlResetLastError();
50911         if (mem_base != xmlMemBlocks()) {
50912             printf("Leak of %d blocks found in xmlXPathWrapCString",
50913 	           xmlMemBlocks() - mem_base);
50914 	    test_ret++;
50915             printf(" %d", n_val);
50916             printf("\n");
50917         }
50918     }
50919     function_tests++;
50920 #endif
50921 
50922     return(test_ret);
50923 }
50924 
50925 
50926 static int
test_xmlXPathWrapExternal(void)50927 test_xmlXPathWrapExternal(void) {
50928     int test_ret = 0;
50929 
50930 #if defined(LIBXML_XPATH_ENABLED)
50931     int mem_base;
50932     xmlXPathObjectPtr ret_val;
50933     void * val; /* the user data */
50934     int n_val;
50935 
50936     for (n_val = 0;n_val < gen_nb_void_ptr;n_val++) {
50937         mem_base = xmlMemBlocks();
50938         val = gen_void_ptr(n_val, 0);
50939 
50940         ret_val = xmlXPathWrapExternal(val);
50941         desret_xmlXPathObjectPtr(ret_val);
50942         call_tests++;
50943         des_void_ptr(n_val, val, 0);
50944         xmlResetLastError();
50945         if (mem_base != xmlMemBlocks()) {
50946             printf("Leak of %d blocks found in xmlXPathWrapExternal",
50947 	           xmlMemBlocks() - mem_base);
50948 	    test_ret++;
50949             printf(" %d", n_val);
50950             printf("\n");
50951         }
50952     }
50953     function_tests++;
50954 #endif
50955 
50956     return(test_ret);
50957 }
50958 
50959 
50960 static int
test_xmlXPathWrapNodeSet(void)50961 test_xmlXPathWrapNodeSet(void) {
50962     int test_ret = 0;
50963 
50964 #if defined(LIBXML_XPATH_ENABLED)
50965     int mem_base;
50966     xmlXPathObjectPtr ret_val;
50967     xmlNodeSetPtr val; /* the NodePtr value */
50968     int n_val;
50969 
50970     for (n_val = 0;n_val < gen_nb_xmlNodeSetPtr;n_val++) {
50971         mem_base = xmlMemBlocks();
50972         val = gen_xmlNodeSetPtr(n_val, 0);
50973 
50974         ret_val = xmlXPathWrapNodeSet(val);
50975         desret_xmlXPathObjectPtr(ret_val);
50976         call_tests++;
50977         des_xmlNodeSetPtr(n_val, val, 0);
50978         xmlResetLastError();
50979         if (mem_base != xmlMemBlocks()) {
50980             printf("Leak of %d blocks found in xmlXPathWrapNodeSet",
50981 	           xmlMemBlocks() - mem_base);
50982 	    test_ret++;
50983             printf(" %d", n_val);
50984             printf("\n");
50985         }
50986     }
50987     function_tests++;
50988 #endif
50989 
50990     return(test_ret);
50991 }
50992 
50993 
50994 static int
test_xmlXPatherror(void)50995 test_xmlXPatherror(void) {
50996     int test_ret = 0;
50997 
50998 #if defined(LIBXML_XPATH_ENABLED)
50999     int mem_base;
51000     xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
51001     int n_ctxt;
51002     const char * file; /* the file name */
51003     int n_file;
51004     int line; /* the line number */
51005     int n_line;
51006     int no; /* the error number */
51007     int n_no;
51008 
51009     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
51010     for (n_file = 0;n_file < gen_nb_filepath;n_file++) {
51011     for (n_line = 0;n_line < gen_nb_int;n_line++) {
51012     for (n_no = 0;n_no < gen_nb_int;n_no++) {
51013         mem_base = xmlMemBlocks();
51014         ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
51015         file = gen_filepath(n_file, 1);
51016         line = gen_int(n_line, 2);
51017         no = gen_int(n_no, 3);
51018 
51019         xmlXPatherror(ctxt, file, line, no);
51020         call_tests++;
51021         des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
51022         des_filepath(n_file, file, 1);
51023         des_int(n_line, line, 2);
51024         des_int(n_no, no, 3);
51025         xmlResetLastError();
51026         if (mem_base != xmlMemBlocks()) {
51027             printf("Leak of %d blocks found in xmlXPatherror",
51028 	           xmlMemBlocks() - mem_base);
51029 	    test_ret++;
51030             printf(" %d", n_ctxt);
51031             printf(" %d", n_file);
51032             printf(" %d", n_line);
51033             printf(" %d", n_no);
51034             printf("\n");
51035         }
51036     }
51037     }
51038     }
51039     }
51040     function_tests++;
51041 #endif
51042 
51043     return(test_ret);
51044 }
51045 
51046 static int
test_xpathInternals(void)51047 test_xpathInternals(void) {
51048     int test_ret = 0;
51049 
51050     if (quiet == 0) printf("Testing xpathInternals : 106 of 117 functions ...\n");
51051     test_ret += test_valuePop();
51052     test_ret += test_valuePush();
51053     test_ret += test_xmlXPathAddValues();
51054     test_ret += test_xmlXPathBooleanFunction();
51055     test_ret += test_xmlXPathCeilingFunction();
51056     test_ret += test_xmlXPathCompareValues();
51057     test_ret += test_xmlXPathConcatFunction();
51058     test_ret += test_xmlXPathContainsFunction();
51059     test_ret += test_xmlXPathCountFunction();
51060     test_ret += test_xmlXPathDebugDumpCompExpr();
51061     test_ret += test_xmlXPathDebugDumpObject();
51062     test_ret += test_xmlXPathDifference();
51063     test_ret += test_xmlXPathDistinct();
51064     test_ret += test_xmlXPathDistinctSorted();
51065     test_ret += test_xmlXPathDivValues();
51066     test_ret += test_xmlXPathEqualValues();
51067     test_ret += test_xmlXPathErr();
51068     test_ret += test_xmlXPathEvalExpr();
51069     test_ret += test_xmlXPathEvaluatePredicateResult();
51070     test_ret += test_xmlXPathFalseFunction();
51071     test_ret += test_xmlXPathFloorFunction();
51072     test_ret += test_xmlXPathFunctionLookup();
51073     test_ret += test_xmlXPathFunctionLookupNS();
51074     test_ret += test_xmlXPathHasSameNodes();
51075     test_ret += test_xmlXPathIdFunction();
51076     test_ret += test_xmlXPathIntersection();
51077     test_ret += test_xmlXPathIsNodeType();
51078     test_ret += test_xmlXPathLangFunction();
51079     test_ret += test_xmlXPathLastFunction();
51080     test_ret += test_xmlXPathLeading();
51081     test_ret += test_xmlXPathLeadingSorted();
51082     test_ret += test_xmlXPathLocalNameFunction();
51083     test_ret += test_xmlXPathModValues();
51084     test_ret += test_xmlXPathMultValues();
51085     test_ret += test_xmlXPathNamespaceURIFunction();
51086     test_ret += test_xmlXPathNewBoolean();
51087     test_ret += test_xmlXPathNewCString();
51088     test_ret += test_xmlXPathNewFloat();
51089     test_ret += test_xmlXPathNewNodeSet();
51090     test_ret += test_xmlXPathNewNodeSetList();
51091     test_ret += test_xmlXPathNewParserContext();
51092     test_ret += test_xmlXPathNewString();
51093     test_ret += test_xmlXPathNextAncestor();
51094     test_ret += test_xmlXPathNextAncestorOrSelf();
51095     test_ret += test_xmlXPathNextAttribute();
51096     test_ret += test_xmlXPathNextChild();
51097     test_ret += test_xmlXPathNextDescendant();
51098     test_ret += test_xmlXPathNextDescendantOrSelf();
51099     test_ret += test_xmlXPathNextFollowing();
51100     test_ret += test_xmlXPathNextFollowingSibling();
51101     test_ret += test_xmlXPathNextNamespace();
51102     test_ret += test_xmlXPathNextParent();
51103     test_ret += test_xmlXPathNextPreceding();
51104     test_ret += test_xmlXPathNextPrecedingSibling();
51105     test_ret += test_xmlXPathNextSelf();
51106     test_ret += test_xmlXPathNodeLeading();
51107     test_ret += test_xmlXPathNodeLeadingSorted();
51108     test_ret += test_xmlXPathNodeSetAdd();
51109     test_ret += test_xmlXPathNodeSetAddNs();
51110     test_ret += test_xmlXPathNodeSetAddUnique();
51111     test_ret += test_xmlXPathNodeSetContains();
51112     test_ret += test_xmlXPathNodeSetDel();
51113     test_ret += test_xmlXPathNodeSetMerge();
51114     test_ret += test_xmlXPathNodeSetRemove();
51115     test_ret += test_xmlXPathNodeSetSort();
51116     test_ret += test_xmlXPathNodeTrailing();
51117     test_ret += test_xmlXPathNodeTrailingSorted();
51118     test_ret += test_xmlXPathNormalizeFunction();
51119     test_ret += test_xmlXPathNotEqualValues();
51120     test_ret += test_xmlXPathNotFunction();
51121     test_ret += test_xmlXPathNsLookup();
51122     test_ret += test_xmlXPathNumberFunction();
51123     test_ret += test_xmlXPathParseNCName();
51124     test_ret += test_xmlXPathParseName();
51125     test_ret += test_xmlXPathPopBoolean();
51126     test_ret += test_xmlXPathPopExternal();
51127     test_ret += test_xmlXPathPopNodeSet();
51128     test_ret += test_xmlXPathPopNumber();
51129     test_ret += test_xmlXPathPopString();
51130     test_ret += test_xmlXPathPositionFunction();
51131     test_ret += test_xmlXPathRegisterAllFunctions();
51132     test_ret += test_xmlXPathRegisterFunc();
51133     test_ret += test_xmlXPathRegisterFuncLookup();
51134     test_ret += test_xmlXPathRegisterFuncNS();
51135     test_ret += test_xmlXPathRegisterNs();
51136     test_ret += test_xmlXPathRegisterVariable();
51137     test_ret += test_xmlXPathRegisterVariableLookup();
51138     test_ret += test_xmlXPathRegisterVariableNS();
51139     test_ret += test_xmlXPathRegisteredFuncsCleanup();
51140     test_ret += test_xmlXPathRegisteredNsCleanup();
51141     test_ret += test_xmlXPathRegisteredVariablesCleanup();
51142     test_ret += test_xmlXPathRoot();
51143     test_ret += test_xmlXPathRoundFunction();
51144     test_ret += test_xmlXPathStartsWithFunction();
51145     test_ret += test_xmlXPathStringEvalNumber();
51146     test_ret += test_xmlXPathStringFunction();
51147     test_ret += test_xmlXPathStringLengthFunction();
51148     test_ret += test_xmlXPathSubValues();
51149     test_ret += test_xmlXPathSubstringAfterFunction();
51150     test_ret += test_xmlXPathSubstringBeforeFunction();
51151     test_ret += test_xmlXPathSubstringFunction();
51152     test_ret += test_xmlXPathSumFunction();
51153     test_ret += test_xmlXPathTrailing();
51154     test_ret += test_xmlXPathTrailingSorted();
51155     test_ret += test_xmlXPathTranslateFunction();
51156     test_ret += test_xmlXPathTrueFunction();
51157     test_ret += test_xmlXPathValueFlipSign();
51158     test_ret += test_xmlXPathVariableLookup();
51159     test_ret += test_xmlXPathVariableLookupNS();
51160     test_ret += test_xmlXPathWrapCString();
51161     test_ret += test_xmlXPathWrapExternal();
51162     test_ret += test_xmlXPathWrapNodeSet();
51163     test_ret += test_xmlXPatherror();
51164 
51165     if (test_ret != 0)
51166 	printf("Module xpathInternals: %d errors\n", test_ret);
51167     return(test_ret);
51168 }
51169 
51170 static int
test_xmlXPtrBuildNodeList(void)51171 test_xmlXPtrBuildNodeList(void) {
51172     int test_ret = 0;
51173 
51174 #if defined(LIBXML_XPTR_ENABLED) && defined(LIBXML_XPTR_LOCS_ENABLED)
51175     int mem_base;
51176     xmlNodePtr ret_val;
51177     xmlXPathObjectPtr obj; /* the XPointer result from the evaluation. */
51178     int n_obj;
51179 
51180     for (n_obj = 0;n_obj < gen_nb_xmlXPathObjectPtr;n_obj++) {
51181         mem_base = xmlMemBlocks();
51182         obj = gen_xmlXPathObjectPtr(n_obj, 0);
51183 
51184         ret_val = xmlXPtrBuildNodeList(obj);
51185         desret_xmlNodePtr(ret_val);
51186         call_tests++;
51187         des_xmlXPathObjectPtr(n_obj, obj, 0);
51188         xmlResetLastError();
51189         if (mem_base != xmlMemBlocks()) {
51190             printf("Leak of %d blocks found in xmlXPtrBuildNodeList",
51191 	           xmlMemBlocks() - mem_base);
51192 	    test_ret++;
51193             printf(" %d", n_obj);
51194             printf("\n");
51195         }
51196     }
51197     function_tests++;
51198 #endif
51199 
51200     return(test_ret);
51201 }
51202 
51203 
51204 static int
test_xmlXPtrEval(void)51205 test_xmlXPtrEval(void) {
51206     int test_ret = 0;
51207 
51208 #if defined(LIBXML_XPTR_ENABLED)
51209     int mem_base;
51210     xmlXPathObjectPtr ret_val;
51211     const xmlChar * str; /* the XPointer expression */
51212     int n_str;
51213     xmlXPathContextPtr ctx; /* the XPointer context */
51214     int n_ctx;
51215 
51216     for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) {
51217     for (n_ctx = 0;n_ctx < gen_nb_xmlXPathContextPtr;n_ctx++) {
51218         mem_base = xmlMemBlocks();
51219         str = gen_const_xmlChar_ptr(n_str, 0);
51220         ctx = gen_xmlXPathContextPtr(n_ctx, 1);
51221 
51222         ret_val = xmlXPtrEval(str, ctx);
51223         desret_xmlXPathObjectPtr(ret_val);
51224         call_tests++;
51225         des_const_xmlChar_ptr(n_str, str, 0);
51226         des_xmlXPathContextPtr(n_ctx, ctx, 1);
51227         xmlResetLastError();
51228         if (mem_base != xmlMemBlocks()) {
51229             printf("Leak of %d blocks found in xmlXPtrEval",
51230 	           xmlMemBlocks() - mem_base);
51231 	    test_ret++;
51232             printf(" %d", n_str);
51233             printf(" %d", n_ctx);
51234             printf("\n");
51235         }
51236     }
51237     }
51238     function_tests++;
51239 #endif
51240 
51241     return(test_ret);
51242 }
51243 
51244 
51245 static int
test_xmlXPtrEvalRangePredicate(void)51246 test_xmlXPtrEvalRangePredicate(void) {
51247     int test_ret = 0;
51248 
51249 #if defined(LIBXML_XPTR_ENABLED) && defined(LIBXML_XPTR_LOCS_ENABLED)
51250     int mem_base;
51251     xmlXPathParserContextPtr ctxt; /* the XPointer Parser context */
51252     int n_ctxt;
51253 
51254     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
51255         mem_base = xmlMemBlocks();
51256         ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
51257 
51258         xmlXPtrEvalRangePredicate(ctxt);
51259         call_tests++;
51260         des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
51261         xmlResetLastError();
51262         if (mem_base != xmlMemBlocks()) {
51263             printf("Leak of %d blocks found in xmlXPtrEvalRangePredicate",
51264 	           xmlMemBlocks() - mem_base);
51265 	    test_ret++;
51266             printf(" %d", n_ctxt);
51267             printf("\n");
51268         }
51269     }
51270     function_tests++;
51271 #endif
51272 
51273     return(test_ret);
51274 }
51275 
51276 
51277 static int
test_xmlXPtrNewCollapsedRange(void)51278 test_xmlXPtrNewCollapsedRange(void) {
51279     int test_ret = 0;
51280 
51281 #if defined(LIBXML_XPTR_ENABLED) && defined(LIBXML_XPTR_LOCS_ENABLED)
51282     int mem_base;
51283     xmlXPathObjectPtr ret_val;
51284     xmlNodePtr start; /* the starting and ending node */
51285     int n_start;
51286 
51287     for (n_start = 0;n_start < gen_nb_xmlNodePtr;n_start++) {
51288         mem_base = xmlMemBlocks();
51289         start = gen_xmlNodePtr(n_start, 0);
51290 
51291         ret_val = xmlXPtrNewCollapsedRange(start);
51292         desret_xmlXPathObjectPtr(ret_val);
51293         call_tests++;
51294         des_xmlNodePtr(n_start, start, 0);
51295         xmlResetLastError();
51296         if (mem_base != xmlMemBlocks()) {
51297             printf("Leak of %d blocks found in xmlXPtrNewCollapsedRange",
51298 	           xmlMemBlocks() - mem_base);
51299 	    test_ret++;
51300             printf(" %d", n_start);
51301             printf("\n");
51302         }
51303     }
51304     function_tests++;
51305 #endif
51306 
51307     return(test_ret);
51308 }
51309 
51310 
51311 static int
test_xmlXPtrNewContext(void)51312 test_xmlXPtrNewContext(void) {
51313     int test_ret = 0;
51314 
51315 
51316     /* missing type support */
51317     return(test_ret);
51318 }
51319 
51320 
51321 static int
test_xmlXPtrNewLocationSetNodeSet(void)51322 test_xmlXPtrNewLocationSetNodeSet(void) {
51323     int test_ret = 0;
51324 
51325 #if defined(LIBXML_XPTR_ENABLED) && defined(LIBXML_XPTR_LOCS_ENABLED)
51326     int mem_base;
51327     xmlXPathObjectPtr ret_val;
51328     xmlNodeSetPtr set; /* a node set */
51329     int n_set;
51330 
51331     for (n_set = 0;n_set < gen_nb_xmlNodeSetPtr;n_set++) {
51332         mem_base = xmlMemBlocks();
51333         set = gen_xmlNodeSetPtr(n_set, 0);
51334 
51335         ret_val = xmlXPtrNewLocationSetNodeSet(set);
51336         desret_xmlXPathObjectPtr(ret_val);
51337         call_tests++;
51338         des_xmlNodeSetPtr(n_set, set, 0);
51339         xmlResetLastError();
51340         if (mem_base != xmlMemBlocks()) {
51341             printf("Leak of %d blocks found in xmlXPtrNewLocationSetNodeSet",
51342 	           xmlMemBlocks() - mem_base);
51343 	    test_ret++;
51344             printf(" %d", n_set);
51345             printf("\n");
51346         }
51347     }
51348     function_tests++;
51349 #endif
51350 
51351     return(test_ret);
51352 }
51353 
51354 
51355 static int
test_xmlXPtrNewLocationSetNodes(void)51356 test_xmlXPtrNewLocationSetNodes(void) {
51357     int test_ret = 0;
51358 
51359 #if defined(LIBXML_XPTR_ENABLED) && defined(LIBXML_XPTR_LOCS_ENABLED)
51360     int mem_base;
51361     xmlXPathObjectPtr ret_val;
51362     xmlNodePtr start; /* the start NodePtr value */
51363     int n_start;
51364     xmlNodePtr end; /* the end NodePtr value or NULL */
51365     int n_end;
51366 
51367     for (n_start = 0;n_start < gen_nb_xmlNodePtr;n_start++) {
51368     for (n_end = 0;n_end < gen_nb_xmlNodePtr;n_end++) {
51369         mem_base = xmlMemBlocks();
51370         start = gen_xmlNodePtr(n_start, 0);
51371         end = gen_xmlNodePtr(n_end, 1);
51372 
51373         ret_val = xmlXPtrNewLocationSetNodes(start, end);
51374         desret_xmlXPathObjectPtr(ret_val);
51375         call_tests++;
51376         des_xmlNodePtr(n_start, start, 0);
51377         des_xmlNodePtr(n_end, end, 1);
51378         xmlResetLastError();
51379         if (mem_base != xmlMemBlocks()) {
51380             printf("Leak of %d blocks found in xmlXPtrNewLocationSetNodes",
51381 	           xmlMemBlocks() - mem_base);
51382 	    test_ret++;
51383             printf(" %d", n_start);
51384             printf(" %d", n_end);
51385             printf("\n");
51386         }
51387     }
51388     }
51389     function_tests++;
51390 #endif
51391 
51392     return(test_ret);
51393 }
51394 
51395 
51396 static int
test_xmlXPtrNewRange(void)51397 test_xmlXPtrNewRange(void) {
51398     int test_ret = 0;
51399 
51400 #if defined(LIBXML_XPTR_ENABLED) && defined(LIBXML_XPTR_LOCS_ENABLED)
51401     int mem_base;
51402     xmlXPathObjectPtr ret_val;
51403     xmlNodePtr start; /* the starting node */
51404     int n_start;
51405     int startindex; /* the start index */
51406     int n_startindex;
51407     xmlNodePtr end; /* the ending point */
51408     int n_end;
51409     int endindex; /* the ending index */
51410     int n_endindex;
51411 
51412     for (n_start = 0;n_start < gen_nb_xmlNodePtr;n_start++) {
51413     for (n_startindex = 0;n_startindex < gen_nb_int;n_startindex++) {
51414     for (n_end = 0;n_end < gen_nb_xmlNodePtr;n_end++) {
51415     for (n_endindex = 0;n_endindex < gen_nb_int;n_endindex++) {
51416         mem_base = xmlMemBlocks();
51417         start = gen_xmlNodePtr(n_start, 0);
51418         startindex = gen_int(n_startindex, 1);
51419         end = gen_xmlNodePtr(n_end, 2);
51420         endindex = gen_int(n_endindex, 3);
51421 
51422         ret_val = xmlXPtrNewRange(start, startindex, end, endindex);
51423         desret_xmlXPathObjectPtr(ret_val);
51424         call_tests++;
51425         des_xmlNodePtr(n_start, start, 0);
51426         des_int(n_startindex, startindex, 1);
51427         des_xmlNodePtr(n_end, end, 2);
51428         des_int(n_endindex, endindex, 3);
51429         xmlResetLastError();
51430         if (mem_base != xmlMemBlocks()) {
51431             printf("Leak of %d blocks found in xmlXPtrNewRange",
51432 	           xmlMemBlocks() - mem_base);
51433 	    test_ret++;
51434             printf(" %d", n_start);
51435             printf(" %d", n_startindex);
51436             printf(" %d", n_end);
51437             printf(" %d", n_endindex);
51438             printf("\n");
51439         }
51440     }
51441     }
51442     }
51443     }
51444     function_tests++;
51445 #endif
51446 
51447     return(test_ret);
51448 }
51449 
51450 
51451 static int
test_xmlXPtrNewRangeNodeObject(void)51452 test_xmlXPtrNewRangeNodeObject(void) {
51453     int test_ret = 0;
51454 
51455 #if defined(LIBXML_XPTR_ENABLED) && defined(LIBXML_XPTR_LOCS_ENABLED)
51456     int mem_base;
51457     xmlXPathObjectPtr ret_val;
51458     xmlNodePtr start; /* the starting node */
51459     int n_start;
51460     xmlXPathObjectPtr end; /* the ending object */
51461     int n_end;
51462 
51463     for (n_start = 0;n_start < gen_nb_xmlNodePtr;n_start++) {
51464     for (n_end = 0;n_end < gen_nb_xmlXPathObjectPtr;n_end++) {
51465         mem_base = xmlMemBlocks();
51466         start = gen_xmlNodePtr(n_start, 0);
51467         end = gen_xmlXPathObjectPtr(n_end, 1);
51468 
51469         ret_val = xmlXPtrNewRangeNodeObject(start, end);
51470         desret_xmlXPathObjectPtr(ret_val);
51471         call_tests++;
51472         des_xmlNodePtr(n_start, start, 0);
51473         des_xmlXPathObjectPtr(n_end, end, 1);
51474         xmlResetLastError();
51475         if (mem_base != xmlMemBlocks()) {
51476             printf("Leak of %d blocks found in xmlXPtrNewRangeNodeObject",
51477 	           xmlMemBlocks() - mem_base);
51478 	    test_ret++;
51479             printf(" %d", n_start);
51480             printf(" %d", n_end);
51481             printf("\n");
51482         }
51483     }
51484     }
51485     function_tests++;
51486 #endif
51487 
51488     return(test_ret);
51489 }
51490 
51491 
51492 static int
test_xmlXPtrNewRangeNodePoint(void)51493 test_xmlXPtrNewRangeNodePoint(void) {
51494     int test_ret = 0;
51495 
51496 #if defined(LIBXML_XPTR_ENABLED) && defined(LIBXML_XPTR_LOCS_ENABLED)
51497     int mem_base;
51498     xmlXPathObjectPtr ret_val;
51499     xmlNodePtr start; /* the starting node */
51500     int n_start;
51501     xmlXPathObjectPtr end; /* the ending point */
51502     int n_end;
51503 
51504     for (n_start = 0;n_start < gen_nb_xmlNodePtr;n_start++) {
51505     for (n_end = 0;n_end < gen_nb_xmlXPathObjectPtr;n_end++) {
51506         mem_base = xmlMemBlocks();
51507         start = gen_xmlNodePtr(n_start, 0);
51508         end = gen_xmlXPathObjectPtr(n_end, 1);
51509 
51510         ret_val = xmlXPtrNewRangeNodePoint(start, end);
51511         desret_xmlXPathObjectPtr(ret_val);
51512         call_tests++;
51513         des_xmlNodePtr(n_start, start, 0);
51514         des_xmlXPathObjectPtr(n_end, end, 1);
51515         xmlResetLastError();
51516         if (mem_base != xmlMemBlocks()) {
51517             printf("Leak of %d blocks found in xmlXPtrNewRangeNodePoint",
51518 	           xmlMemBlocks() - mem_base);
51519 	    test_ret++;
51520             printf(" %d", n_start);
51521             printf(" %d", n_end);
51522             printf("\n");
51523         }
51524     }
51525     }
51526     function_tests++;
51527 #endif
51528 
51529     return(test_ret);
51530 }
51531 
51532 
51533 static int
test_xmlXPtrNewRangeNodes(void)51534 test_xmlXPtrNewRangeNodes(void) {
51535     int test_ret = 0;
51536 
51537 #if defined(LIBXML_XPTR_ENABLED) && defined(LIBXML_XPTR_LOCS_ENABLED)
51538     int mem_base;
51539     xmlXPathObjectPtr ret_val;
51540     xmlNodePtr start; /* the starting node */
51541     int n_start;
51542     xmlNodePtr end; /* the ending node */
51543     int n_end;
51544 
51545     for (n_start = 0;n_start < gen_nb_xmlNodePtr;n_start++) {
51546     for (n_end = 0;n_end < gen_nb_xmlNodePtr;n_end++) {
51547         mem_base = xmlMemBlocks();
51548         start = gen_xmlNodePtr(n_start, 0);
51549         end = gen_xmlNodePtr(n_end, 1);
51550 
51551         ret_val = xmlXPtrNewRangeNodes(start, end);
51552         desret_xmlXPathObjectPtr(ret_val);
51553         call_tests++;
51554         des_xmlNodePtr(n_start, start, 0);
51555         des_xmlNodePtr(n_end, end, 1);
51556         xmlResetLastError();
51557         if (mem_base != xmlMemBlocks()) {
51558             printf("Leak of %d blocks found in xmlXPtrNewRangeNodes",
51559 	           xmlMemBlocks() - mem_base);
51560 	    test_ret++;
51561             printf(" %d", n_start);
51562             printf(" %d", n_end);
51563             printf("\n");
51564         }
51565     }
51566     }
51567     function_tests++;
51568 #endif
51569 
51570     return(test_ret);
51571 }
51572 
51573 
51574 static int
test_xmlXPtrNewRangePointNode(void)51575 test_xmlXPtrNewRangePointNode(void) {
51576     int test_ret = 0;
51577 
51578 #if defined(LIBXML_XPTR_ENABLED) && defined(LIBXML_XPTR_LOCS_ENABLED)
51579     int mem_base;
51580     xmlXPathObjectPtr ret_val;
51581     xmlXPathObjectPtr start; /* the starting point */
51582     int n_start;
51583     xmlNodePtr end; /* the ending node */
51584     int n_end;
51585 
51586     for (n_start = 0;n_start < gen_nb_xmlXPathObjectPtr;n_start++) {
51587     for (n_end = 0;n_end < gen_nb_xmlNodePtr;n_end++) {
51588         mem_base = xmlMemBlocks();
51589         start = gen_xmlXPathObjectPtr(n_start, 0);
51590         end = gen_xmlNodePtr(n_end, 1);
51591 
51592         ret_val = xmlXPtrNewRangePointNode(start, end);
51593         desret_xmlXPathObjectPtr(ret_val);
51594         call_tests++;
51595         des_xmlXPathObjectPtr(n_start, start, 0);
51596         des_xmlNodePtr(n_end, end, 1);
51597         xmlResetLastError();
51598         if (mem_base != xmlMemBlocks()) {
51599             printf("Leak of %d blocks found in xmlXPtrNewRangePointNode",
51600 	           xmlMemBlocks() - mem_base);
51601 	    test_ret++;
51602             printf(" %d", n_start);
51603             printf(" %d", n_end);
51604             printf("\n");
51605         }
51606     }
51607     }
51608     function_tests++;
51609 #endif
51610 
51611     return(test_ret);
51612 }
51613 
51614 
51615 static int
test_xmlXPtrNewRangePoints(void)51616 test_xmlXPtrNewRangePoints(void) {
51617     int test_ret = 0;
51618 
51619 #if defined(LIBXML_XPTR_ENABLED) && defined(LIBXML_XPTR_LOCS_ENABLED)
51620     int mem_base;
51621     xmlXPathObjectPtr ret_val;
51622     xmlXPathObjectPtr start; /* the starting point */
51623     int n_start;
51624     xmlXPathObjectPtr end; /* the ending point */
51625     int n_end;
51626 
51627     for (n_start = 0;n_start < gen_nb_xmlXPathObjectPtr;n_start++) {
51628     for (n_end = 0;n_end < gen_nb_xmlXPathObjectPtr;n_end++) {
51629         mem_base = xmlMemBlocks();
51630         start = gen_xmlXPathObjectPtr(n_start, 0);
51631         end = gen_xmlXPathObjectPtr(n_end, 1);
51632 
51633         ret_val = xmlXPtrNewRangePoints(start, end);
51634         desret_xmlXPathObjectPtr(ret_val);
51635         call_tests++;
51636         des_xmlXPathObjectPtr(n_start, start, 0);
51637         des_xmlXPathObjectPtr(n_end, end, 1);
51638         xmlResetLastError();
51639         if (mem_base != xmlMemBlocks()) {
51640             printf("Leak of %d blocks found in xmlXPtrNewRangePoints",
51641 	           xmlMemBlocks() - mem_base);
51642 	    test_ret++;
51643             printf(" %d", n_start);
51644             printf(" %d", n_end);
51645             printf("\n");
51646         }
51647     }
51648     }
51649     function_tests++;
51650 #endif
51651 
51652     return(test_ret);
51653 }
51654 
51655 
51656 static int
test_xmlXPtrRangeToFunction(void)51657 test_xmlXPtrRangeToFunction(void) {
51658     int test_ret = 0;
51659 
51660 #if defined(LIBXML_XPTR_ENABLED) && defined(LIBXML_XPTR_LOCS_ENABLED)
51661     int mem_base;
51662     xmlXPathParserContextPtr ctxt; /* the XPointer Parser context */
51663     int n_ctxt;
51664     int nargs; /* the number of args */
51665     int n_nargs;
51666 
51667     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
51668     for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
51669         mem_base = xmlMemBlocks();
51670         ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
51671         nargs = gen_int(n_nargs, 1);
51672 
51673         xmlXPtrRangeToFunction(ctxt, nargs);
51674         call_tests++;
51675         des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
51676         des_int(n_nargs, nargs, 1);
51677         xmlResetLastError();
51678         if (mem_base != xmlMemBlocks()) {
51679             printf("Leak of %d blocks found in xmlXPtrRangeToFunction",
51680 	           xmlMemBlocks() - mem_base);
51681 	    test_ret++;
51682             printf(" %d", n_ctxt);
51683             printf(" %d", n_nargs);
51684             printf("\n");
51685         }
51686     }
51687     }
51688     function_tests++;
51689 #endif
51690 
51691     return(test_ret);
51692 }
51693 
51694 static int
test_xpointer(void)51695 test_xpointer(void) {
51696     int test_ret = 0;
51697 
51698     if (quiet == 0) printf("Testing xpointer : 13 of 21 functions ...\n");
51699     test_ret += test_xmlXPtrBuildNodeList();
51700     test_ret += test_xmlXPtrEval();
51701     test_ret += test_xmlXPtrEvalRangePredicate();
51702     test_ret += test_xmlXPtrNewCollapsedRange();
51703     test_ret += test_xmlXPtrNewContext();
51704     test_ret += test_xmlXPtrNewLocationSetNodeSet();
51705     test_ret += test_xmlXPtrNewLocationSetNodes();
51706     test_ret += test_xmlXPtrNewRange();
51707     test_ret += test_xmlXPtrNewRangeNodeObject();
51708     test_ret += test_xmlXPtrNewRangeNodePoint();
51709     test_ret += test_xmlXPtrNewRangeNodes();
51710     test_ret += test_xmlXPtrNewRangePointNode();
51711     test_ret += test_xmlXPtrNewRangePoints();
51712     test_ret += test_xmlXPtrRangeToFunction();
51713 
51714     if (test_ret != 0)
51715 	printf("Module xpointer: %d errors\n", test_ret);
51716     return(test_ret);
51717 }
51718 static int
test_module(const char * module)51719 test_module(const char *module) {
51720     if (!strcmp(module, "HTMLparser")) return(test_HTMLparser());
51721     if (!strcmp(module, "HTMLtree")) return(test_HTMLtree());
51722     if (!strcmp(module, "SAX2")) return(test_SAX2());
51723     if (!strcmp(module, "c14n")) return(test_c14n());
51724     if (!strcmp(module, "catalog")) return(test_catalog());
51725     if (!strcmp(module, "chvalid")) return(test_chvalid());
51726     if (!strcmp(module, "debugXML")) return(test_debugXML());
51727     if (!strcmp(module, "dict")) return(test_dict());
51728     if (!strcmp(module, "encoding")) return(test_encoding());
51729     if (!strcmp(module, "entities")) return(test_entities());
51730     if (!strcmp(module, "hash")) return(test_hash());
51731     if (!strcmp(module, "list")) return(test_list());
51732     if (!strcmp(module, "nanohttp")) return(test_nanohttp());
51733     if (!strcmp(module, "parser")) return(test_parser());
51734     if (!strcmp(module, "parserInternals")) return(test_parserInternals());
51735     if (!strcmp(module, "pattern")) return(test_pattern());
51736     if (!strcmp(module, "relaxng")) return(test_relaxng());
51737     if (!strcmp(module, "schemasInternals")) return(test_schemasInternals());
51738     if (!strcmp(module, "schematron")) return(test_schematron());
51739     if (!strcmp(module, "tree")) return(test_tree());
51740     if (!strcmp(module, "uri")) return(test_uri());
51741     if (!strcmp(module, "valid")) return(test_valid());
51742     if (!strcmp(module, "xinclude")) return(test_xinclude());
51743     if (!strcmp(module, "xmlIO")) return(test_xmlIO());
51744     if (!strcmp(module, "xmlautomata")) return(test_xmlautomata());
51745     if (!strcmp(module, "xmlerror")) return(test_xmlerror());
51746     if (!strcmp(module, "xmlmodule")) return(test_xmlmodule());
51747     if (!strcmp(module, "xmlreader")) return(test_xmlreader());
51748     if (!strcmp(module, "xmlregexp")) return(test_xmlregexp());
51749     if (!strcmp(module, "xmlsave")) return(test_xmlsave());
51750     if (!strcmp(module, "xmlschemas")) return(test_xmlschemas());
51751     if (!strcmp(module, "xmlschemastypes")) return(test_xmlschemastypes());
51752     if (!strcmp(module, "xmlstring")) return(test_xmlstring());
51753     if (!strcmp(module, "xmlunicode")) return(test_xmlunicode());
51754     if (!strcmp(module, "xmlwriter")) return(test_xmlwriter());
51755     if (!strcmp(module, "xpath")) return(test_xpath());
51756     if (!strcmp(module, "xpathInternals")) return(test_xpathInternals());
51757     if (!strcmp(module, "xpointer")) return(test_xpointer());
51758     return(0);
51759 }
51760