1 /*
2  * testapi.c: libxml2 API tester program.
3  *
4  * Automatically generated by gentest.py from libxml2-api.xml
5  *
6  * See Copyright for the status of this software.
7  *
8  * daniel@veillard.com
9  */
10 
11 #include "libxml.h"
12 #include <stdio.h>
13 
14 #include <stdlib.h> /* for putenv() */
15 #include <string.h>
16 #include <libxml/xmlerror.h>
17 #include <libxml/relaxng.h>
18 
19 
20 static int testlibxml2(void);
21 static int test_module(const char *module);
22 
23 static int generic_errors = 0;
24 static int call_tests = 0;
25 static int function_tests = 0;
26 
27 static xmlChar chartab[1024];
28 static int inttab[1024];
29 static unsigned long longtab[1024];
30 
31 static xmlDocPtr api_doc = NULL;
32 static xmlDtdPtr api_dtd = NULL;
33 static xmlNodePtr api_root = NULL;
34 static xmlAttrPtr api_attr = NULL;
35 static xmlNsPtr api_ns = NULL;
36 
37 static void
structured_errors(void * userData ATTRIBUTE_UNUSED,xmlErrorPtr error ATTRIBUTE_UNUSED)38 structured_errors(void *userData ATTRIBUTE_UNUSED,
39                   xmlErrorPtr error ATTRIBUTE_UNUSED) {
40     generic_errors++;
41 }
42 
43 static void
free_api_doc(void)44 free_api_doc(void) {
45     xmlFreeDoc(api_doc);
46     api_doc = NULL;
47     api_dtd = NULL;
48     api_root = NULL;
49     api_attr = NULL;
50     api_ns = NULL;
51 }
52 
53 static xmlDocPtr
get_api_doc(void)54 get_api_doc(void) {
55     if (api_doc == NULL) {
56         api_doc = xmlReadMemory("<!DOCTYPE root [<!ELEMENT root EMPTY>]><root xmlns:h='http://example.com/' h:foo='bar'/>", 88, "root_test", NULL, 0);
57 	api_root = NULL;
58 	api_attr = NULL;
59     }
60     return(api_doc);
61 }
62 
63 static xmlDtdPtr
get_api_dtd(void)64 get_api_dtd(void) {
65     if ((api_dtd == NULL) || (api_dtd->type != XML_DTD_NODE)) {
66         get_api_doc();
67 	if ((api_doc != NULL) && (api_doc->children != NULL) &&
68 	    (api_doc->children->type == XML_DTD_NODE))
69 	    api_dtd = (xmlDtdPtr) api_doc->children;
70     }
71     return(api_dtd);
72 }
73 
74 static xmlNodePtr
get_api_root(void)75 get_api_root(void) {
76     if ((api_root == NULL) || (api_root->type != XML_ELEMENT_NODE)) {
77         get_api_doc();
78 	if ((api_doc != NULL) && (api_doc->children != NULL) &&
79 	    (api_doc->children->next != NULL) &&
80 	    (api_doc->children->next->type == XML_ELEMENT_NODE))
81 	    api_root = api_doc->children->next;
82     }
83     return(api_root);
84 }
85 
86 static xmlNsPtr
get_api_ns(void)87 get_api_ns(void) {
88     get_api_root();
89     if (api_root != NULL)
90         api_ns = api_root->nsDef;
91     return(api_ns);
92 }
93 
94 static xmlAttrPtr
get_api_attr(void)95 get_api_attr(void) {
96 #if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_XINCLUDE_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED) || defined(LIBXML_HTML_ENABLED)
97     static int nr = 0;
98     xmlChar name[20];
99 #endif
100 
101     if ((api_root == NULL) || (api_root->type != XML_ELEMENT_NODE)) {
102         get_api_root();
103     }
104     if (api_root == NULL)
105         return(NULL);
106     if (api_root->properties != NULL) {
107         api_attr = api_root->properties;
108         return(api_root->properties);
109     }
110     api_attr = NULL;
111 #if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_XINCLUDE_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED) || defined(LIBXML_HTML_ENABLED)
112     snprintf((char *) name, 20, "foo%d", nr++);
113     api_attr = xmlSetProp(api_root, name, (const xmlChar *) "bar");
114 #endif
115     return(api_attr);
116 }
117 
118 static int quiet = 0;
119 
main(int argc,char ** argv)120 int main(int argc, char **argv) {
121     int ret;
122     int blocks, mem;
123 
124 #ifdef HAVE_PUTENV
125     /* access to the proxy can slow up regression tests a lot */
126     putenv((char *) "http_proxy=");
127 #endif
128 
129     memset(chartab, 0, sizeof(chartab));
130     strncpy((char *) chartab, "  chartab\n", 20);
131     memset(inttab, 0, sizeof(inttab));
132     memset(longtab, 0, sizeof(longtab));
133 
134     xmlInitParser();
135 #ifdef LIBXML_SCHEMAS_ENABLED
136     xmlRelaxNGInitTypes();
137 #endif
138 
139     LIBXML_TEST_VERSION
140 
141     xmlSetStructuredErrorFunc(NULL, structured_errors);
142 
143     if (argc >= 2) {
144         if (!strcmp(argv[1], "-q")) {
145 	    quiet = 1;
146 	    if (argc >= 3)
147 	        ret = test_module(argv[2]);
148 	    else
149 		ret = testlibxml2();
150         } else {
151 	   ret = test_module(argv[1]);
152 	}
153     } else
154 	ret = testlibxml2();
155 
156     xmlCleanupParser();
157     blocks = xmlMemBlocks();
158     mem = xmlMemUsed();
159     if ((blocks != 0) || (mem != 0)) {
160         printf("testapi leaked %d bytes in %d blocks\n", mem, blocks);
161     }
162     xmlMemoryDump();
163 
164     return (ret != 0);
165 }
166 
167 #include <libxml/HTMLparser.h>
168 #include <libxml/HTMLtree.h>
169 #include <libxml/catalog.h>
170 #include <libxml/chvalid.h>
171 #include <libxml/dict.h>
172 #include <libxml/encoding.h>
173 #include <libxml/entities.h>
174 #include <libxml/hash.h>
175 #include <libxml/list.h>
176 #include <libxml/nanoftp.h>
177 #include <libxml/nanohttp.h>
178 #include <libxml/parser.h>
179 #include <libxml/parserInternals.h>
180 #include <libxml/pattern.h>
181 #include <libxml/relaxng.h>
182 #include <libxml/schemasInternals.h>
183 #include <libxml/schematron.h>
184 #include <libxml/tree.h>
185 #include <libxml/uri.h>
186 #include <libxml/valid.h>
187 #include <libxml/xinclude.h>
188 #include <libxml/xmlIO.h>
189 #include <libxml/xmlerror.h>
190 #include <libxml/xmlreader.h>
191 #include <libxml/xmlsave.h>
192 #include <libxml/xmlschemas.h>
193 #include <libxml/xmlschemastypes.h>
194 #include <libxml/xmlstring.h>
195 #include <libxml/xmlwriter.h>
196 #include <libxml/xpath.h>
197 #include <libxml/xpointer.h>
198 #include <libxml/debugXML.h>
199 
200 /*
201   We manually define xmlErrMemory because it's normal declaration
202   is "hidden" by #ifdef IN_LIBXML
203 */
204 void xmlErrMemory(xmlParserCtxtPtr ctxt, const char *extra);
205 
206 /*
207  We need some "remote" addresses, but want to avoid getting into
208  name resolution delays, so we use these
209 */
210 #define	REMOTE1GOOD	"http://localhost/"
211 #define	REMOTE1BAD	"http:http://http"
212 #define	REMOTE2GOOD	"ftp://localhost/foo"
213 
214 #define gen_nb_void_ptr 2
215 
gen_void_ptr(int no ATTRIBUTE_UNUSED,int nr ATTRIBUTE_UNUSED)216 static void *gen_void_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
217     return(NULL);
218 }
des_void_ptr(int no ATTRIBUTE_UNUSED,void * val ATTRIBUTE_UNUSED,int nr ATTRIBUTE_UNUSED)219 static void des_void_ptr(int no ATTRIBUTE_UNUSED, void *val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
220 }
221 
222 #if 0
223 #define gen_nb_const_void_ptr 2
224 
225 static const void *gen_const_void_ptr(int no, int nr ATTRIBUTE_UNUSED) {
226     if (no == 0) return((const void *) "immutable string");
227     return(NULL);
228 }
229 static void des_const_void_ptr(int no ATTRIBUTE_UNUSED, const void *val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
230 }
231 #endif
232 
233 #define gen_nb_userdata 3
234 
gen_userdata(int no,int nr ATTRIBUTE_UNUSED)235 static void *gen_userdata(int no, int nr ATTRIBUTE_UNUSED) {
236     if (no == 0) return((void *) &call_tests);
237     if (no == 1) return((void *) -1);
238     return(NULL);
239 }
des_userdata(int no ATTRIBUTE_UNUSED,void * val ATTRIBUTE_UNUSED,int nr ATTRIBUTE_UNUSED)240 static void des_userdata(int no ATTRIBUTE_UNUSED, void *val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
241 }
242 
243 
244 #define gen_nb_int 4
245 
gen_int(int no,int nr ATTRIBUTE_UNUSED)246 static int gen_int(int no, int nr ATTRIBUTE_UNUSED) {
247     if (no == 0) return(0);
248     if (no == 1) return(1);
249     if (no == 2) return(-1);
250     if (no == 3) return(122);
251     return(-1);
252 }
253 
des_int(int no ATTRIBUTE_UNUSED,int val ATTRIBUTE_UNUSED,int nr ATTRIBUTE_UNUSED)254 static void des_int(int no ATTRIBUTE_UNUSED, int val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
255 }
256 
257 #define gen_nb_parseroptions 5
258 
gen_parseroptions(int no,int nr ATTRIBUTE_UNUSED)259 static int gen_parseroptions(int no, int nr ATTRIBUTE_UNUSED) {
260     if (no == 0) return(XML_PARSE_NOBLANKS | XML_PARSE_RECOVER);
261     if (no == 1) return(XML_PARSE_NOENT | XML_PARSE_DTDLOAD | XML_PARSE_DTDATTR | XML_PARSE_DTDVALID | XML_PARSE_NOCDATA);
262     if (no == 2) return(XML_PARSE_XINCLUDE | XML_PARSE_NOXINCNODE | XML_PARSE_NSCLEAN);
263     if (no == 3) return(XML_PARSE_XINCLUDE | XML_PARSE_NODICT);
264     return(XML_PARSE_SAX1);
265 }
266 
des_parseroptions(int no ATTRIBUTE_UNUSED,int val ATTRIBUTE_UNUSED,int nr ATTRIBUTE_UNUSED)267 static void des_parseroptions(int no ATTRIBUTE_UNUSED, int val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
268 }
269 
270 #if 0
271 #define gen_nb_long 5
272 
273 static long gen_long(int no, int nr ATTRIBUTE_UNUSED) {
274     if (no == 0) return(0);
275     if (no == 1) return(1);
276     if (no == 2) return(-1);
277     if (no == 3) return(122);
278     return(-1);
279 }
280 
281 static void des_long(int no ATTRIBUTE_UNUSED, long val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
282 }
283 #endif
284 
285 #define gen_nb_xmlChar 4
286 
gen_xmlChar(int no,int nr ATTRIBUTE_UNUSED)287 static xmlChar gen_xmlChar(int no, int nr ATTRIBUTE_UNUSED) {
288     if (no == 0) return('a');
289     if (no == 1) return(' ');
290     if (no == 2) return((xmlChar) '\xf8');
291     return(0);
292 }
293 
des_xmlChar(int no ATTRIBUTE_UNUSED,xmlChar val ATTRIBUTE_UNUSED,int nr ATTRIBUTE_UNUSED)294 static void des_xmlChar(int no ATTRIBUTE_UNUSED, xmlChar val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
295 }
296 
297 #define gen_nb_unsigned_int 3
298 
gen_unsigned_int(int no,int nr ATTRIBUTE_UNUSED)299 static unsigned int gen_unsigned_int(int no, int nr ATTRIBUTE_UNUSED) {
300     if (no == 0) return(0);
301     if (no == 1) return(1);
302     if (no == 2) return(122);
303     return((unsigned int) -1);
304 }
305 
des_unsigned_int(int no ATTRIBUTE_UNUSED,unsigned int val ATTRIBUTE_UNUSED,int nr ATTRIBUTE_UNUSED)306 static void des_unsigned_int(int no ATTRIBUTE_UNUSED, unsigned int val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
307 }
308 
309 #define gen_nb_unsigned_long 4
310 
gen_unsigned_long(int no,int nr ATTRIBUTE_UNUSED)311 static unsigned long gen_unsigned_long(int no, int nr ATTRIBUTE_UNUSED) {
312     if (no == 0) return(0);
313     if (no == 1) return(1);
314     if (no == 2) return(122);
315     return((unsigned long) -1);
316 }
317 
des_unsigned_long(int no ATTRIBUTE_UNUSED,unsigned long val ATTRIBUTE_UNUSED,int nr ATTRIBUTE_UNUSED)318 static void des_unsigned_long(int no ATTRIBUTE_UNUSED, unsigned long val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
319 }
320 
321 #define gen_nb_double 4
322 
gen_double(int no,int nr ATTRIBUTE_UNUSED)323 static double gen_double(int no, int nr ATTRIBUTE_UNUSED) {
324     if (no == 0) return(0);
325     if (no == 1) return(-1.1);
326 #if defined(LIBXML_XPATH_ENABLED)
327     if (no == 2) return(xmlXPathNAN);
328 #endif
329     return(-1);
330 }
331 
des_double(int no ATTRIBUTE_UNUSED,double val ATTRIBUTE_UNUSED,int nr ATTRIBUTE_UNUSED)332 static void des_double(int no ATTRIBUTE_UNUSED, double val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
333 }
334 
335 #define gen_nb_unsigned_long_ptr 2
336 
gen_unsigned_long_ptr(int no,int nr)337 static unsigned long *gen_unsigned_long_ptr(int no, int nr) {
338     if (no == 0) return(&longtab[nr]);
339     return(NULL);
340 }
341 
des_unsigned_long_ptr(int no ATTRIBUTE_UNUSED,unsigned long * val ATTRIBUTE_UNUSED,int nr ATTRIBUTE_UNUSED)342 static void des_unsigned_long_ptr(int no ATTRIBUTE_UNUSED, unsigned long *val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
343 }
344 
345 #define gen_nb_int_ptr 2
346 
gen_int_ptr(int no,int nr)347 static int *gen_int_ptr(int no, int nr) {
348     if (no == 0) return(&inttab[nr]);
349     return(NULL);
350 }
351 
des_int_ptr(int no ATTRIBUTE_UNUSED,int * val ATTRIBUTE_UNUSED,int nr ATTRIBUTE_UNUSED)352 static void des_int_ptr(int no ATTRIBUTE_UNUSED, int *val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
353 }
354 
355 #define gen_nb_const_char_ptr 4
356 
gen_const_char_ptr(int no,int nr ATTRIBUTE_UNUSED)357 static char *gen_const_char_ptr(int no, int nr ATTRIBUTE_UNUSED) {
358     if (no == 0) return((char *) "foo");
359     if (no == 1) return((char *) "<foo/>");
360     if (no == 2) return((char *) "test/ent2");
361     return(NULL);
362 }
des_const_char_ptr(int no ATTRIBUTE_UNUSED,const char * val ATTRIBUTE_UNUSED,int nr ATTRIBUTE_UNUSED)363 static void des_const_char_ptr(int no ATTRIBUTE_UNUSED, const char *val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
364 }
365 
366 #define gen_nb_xmlChar_ptr 2
367 
gen_xmlChar_ptr(int no,int nr ATTRIBUTE_UNUSED)368 static xmlChar *gen_xmlChar_ptr(int no, int nr ATTRIBUTE_UNUSED) {
369     if (no == 0) return(&chartab[0]);
370     return(NULL);
371 }
des_xmlChar_ptr(int no ATTRIBUTE_UNUSED,xmlChar * val ATTRIBUTE_UNUSED,int nr ATTRIBUTE_UNUSED)372 static void des_xmlChar_ptr(int no ATTRIBUTE_UNUSED, xmlChar *val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
373 }
374 
375 #define gen_nb_FILE_ptr 2
376 
gen_FILE_ptr(int no,int nr ATTRIBUTE_UNUSED)377 static FILE *gen_FILE_ptr(int no, int nr ATTRIBUTE_UNUSED) {
378     if (no == 0) return(fopen("test.out", "a+"));
379     return(NULL);
380 }
des_FILE_ptr(int no ATTRIBUTE_UNUSED,FILE * val,int nr ATTRIBUTE_UNUSED)381 static void des_FILE_ptr(int no ATTRIBUTE_UNUSED, FILE *val, int nr ATTRIBUTE_UNUSED) {
382     if (val != NULL) fclose(val);
383 }
384 
385 #define gen_nb_debug_FILE_ptr 2
gen_debug_FILE_ptr(int no ATTRIBUTE_UNUSED,int nr ATTRIBUTE_UNUSED)386 static FILE *gen_debug_FILE_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
387     return(fopen("test.out", "a+"));
388 }
des_debug_FILE_ptr(int no ATTRIBUTE_UNUSED,FILE * val,int nr ATTRIBUTE_UNUSED)389 static void des_debug_FILE_ptr(int no ATTRIBUTE_UNUSED, FILE *val, int nr ATTRIBUTE_UNUSED) {
390     if (val != NULL) fclose(val);
391 }
392 
393 #define gen_nb_const_xmlChar_ptr 5
394 
gen_const_xmlChar_ptr(int no,int nr ATTRIBUTE_UNUSED)395 static xmlChar *gen_const_xmlChar_ptr(int no, int nr ATTRIBUTE_UNUSED) {
396     if (no == 0) return((xmlChar *) "foo");
397     if (no == 1) return((xmlChar *) "<foo/>");
398     if (no == 2) return((xmlChar *) "n" "\xf8" "ne");
399     if (no == 3) return((xmlChar *) " 2ab ");
400     return(NULL);
401 }
des_const_xmlChar_ptr(int no ATTRIBUTE_UNUSED,const xmlChar * val ATTRIBUTE_UNUSED,int nr ATTRIBUTE_UNUSED)402 static void des_const_xmlChar_ptr(int no ATTRIBUTE_UNUSED, const xmlChar *val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
403 }
404 
405 #define gen_nb_filepath 8
406 
gen_filepath(int no,int nr ATTRIBUTE_UNUSED)407 static const char *gen_filepath(int no, int nr ATTRIBUTE_UNUSED) {
408     if (no == 0) return("missing.xml");
409     if (no == 1) return("<foo/>");
410     if (no == 2) return("test/ent2");
411     if (no == 3) return("test/valid/REC-xml-19980210.xml");
412     if (no == 4) return("test/valid/dtds/xhtml1-strict.dtd");
413     if (no == 5) return(REMOTE1GOOD);
414     if (no == 6) return(REMOTE1BAD);
415     return(NULL);
416 }
des_filepath(int no ATTRIBUTE_UNUSED,const char * val ATTRIBUTE_UNUSED,int nr ATTRIBUTE_UNUSED)417 static void des_filepath(int no ATTRIBUTE_UNUSED, const char *val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
418 }
419 
420 #define gen_nb_eaten_name 2
421 
gen_eaten_name(int no,int nr ATTRIBUTE_UNUSED)422 static xmlChar *gen_eaten_name(int no, int nr ATTRIBUTE_UNUSED) {
423     if (no == 0) return(xmlStrdup(BAD_CAST "eaten"));
424     return(NULL);
425 }
des_eaten_name(int no ATTRIBUTE_UNUSED,xmlChar * val ATTRIBUTE_UNUSED,int nr ATTRIBUTE_UNUSED)426 static void des_eaten_name(int no ATTRIBUTE_UNUSED, xmlChar *val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
427 }
428 
429 #define gen_nb_fileoutput 6
430 
gen_fileoutput(int no,int nr ATTRIBUTE_UNUSED)431 static const char *gen_fileoutput(int no, int nr ATTRIBUTE_UNUSED) {
432     if (no == 0) return("/missing.xml");
433     if (no == 1) return("<foo/>");
434     if (no == 2) return(REMOTE2GOOD);
435     if (no == 3) return(REMOTE1GOOD);
436     if (no == 4) return(REMOTE1BAD);
437     return(NULL);
438 }
des_fileoutput(int no ATTRIBUTE_UNUSED,const char * val ATTRIBUTE_UNUSED,int nr ATTRIBUTE_UNUSED)439 static void des_fileoutput(int no ATTRIBUTE_UNUSED, const char *val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
440 }
441 
442 #define gen_nb_xmlParserCtxtPtr 3
gen_xmlParserCtxtPtr(int no,int nr ATTRIBUTE_UNUSED)443 static xmlParserCtxtPtr gen_xmlParserCtxtPtr(int no, int nr ATTRIBUTE_UNUSED) {
444     if (no == 0) return(xmlNewParserCtxt());
445     if (no == 1) return(xmlCreateMemoryParserCtxt("<doc/>", 6));
446     return(NULL);
447 }
des_xmlParserCtxtPtr(int no ATTRIBUTE_UNUSED,xmlParserCtxtPtr val,int nr ATTRIBUTE_UNUSED)448 static void des_xmlParserCtxtPtr(int no ATTRIBUTE_UNUSED, xmlParserCtxtPtr val, int nr ATTRIBUTE_UNUSED) {
449     if (val != NULL)
450         xmlFreeParserCtxt(val);
451 }
452 
453 #define gen_nb_xmlSAXHandlerPtr 2
gen_xmlSAXHandlerPtr(int no,int nr ATTRIBUTE_UNUSED)454 static xmlSAXHandlerPtr gen_xmlSAXHandlerPtr(int no, int nr ATTRIBUTE_UNUSED) {
455 #ifdef LIBXML_SAX1_ENABLED
456     if (no == 0) return((xmlSAXHandlerPtr) &xmlDefaultSAXHandler);
457 #endif
458     return(NULL);
459 }
des_xmlSAXHandlerPtr(int no ATTRIBUTE_UNUSED,xmlSAXHandlerPtr val ATTRIBUTE_UNUSED,int nr ATTRIBUTE_UNUSED)460 static void des_xmlSAXHandlerPtr(int no ATTRIBUTE_UNUSED, xmlSAXHandlerPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
461 }
462 
463 #define gen_nb_xmlValidCtxtPtr 2
gen_xmlValidCtxtPtr(int no,int nr ATTRIBUTE_UNUSED)464 static xmlValidCtxtPtr gen_xmlValidCtxtPtr(int no, int nr ATTRIBUTE_UNUSED) {
465 #ifdef LIBXML_VALID_ENABLED
466     if (no == 0) return(xmlNewValidCtxt());
467 #endif
468     return(NULL);
469 }
des_xmlValidCtxtPtr(int no ATTRIBUTE_UNUSED,xmlValidCtxtPtr val,int nr ATTRIBUTE_UNUSED)470 static void des_xmlValidCtxtPtr(int no ATTRIBUTE_UNUSED, xmlValidCtxtPtr val, int nr ATTRIBUTE_UNUSED) {
471 #ifdef LIBXML_VALID_ENABLED
472     if (val != NULL)
473         xmlFreeValidCtxt(val);
474 #endif
475 }
476 
477 #define gen_nb_xmlParserInputBufferPtr 8
478 
gen_xmlParserInputBufferPtr(int no,int nr ATTRIBUTE_UNUSED)479 static xmlParserInputBufferPtr gen_xmlParserInputBufferPtr(int no, int nr ATTRIBUTE_UNUSED) {
480     if (no == 0) return(xmlParserInputBufferCreateFilename("missing.xml", XML_CHAR_ENCODING_NONE));
481     if (no == 1) return(xmlParserInputBufferCreateFilename("<foo/>", XML_CHAR_ENCODING_NONE));
482     if (no == 2) return(xmlParserInputBufferCreateFilename("test/ent2", XML_CHAR_ENCODING_NONE));
483     if (no == 3) return(xmlParserInputBufferCreateFilename("test/valid/REC-xml-19980210.xml", XML_CHAR_ENCODING_NONE));
484     if (no == 4) return(xmlParserInputBufferCreateFilename("test/valid/dtds/xhtml1-strict.dtd", XML_CHAR_ENCODING_NONE));
485     if (no == 5) return(xmlParserInputBufferCreateFilename(REMOTE1GOOD, XML_CHAR_ENCODING_NONE));
486     if (no == 6) return(xmlParserInputBufferCreateFilename(REMOTE1BAD, XML_CHAR_ENCODING_NONE));
487     return(NULL);
488 }
des_xmlParserInputBufferPtr(int no ATTRIBUTE_UNUSED,xmlParserInputBufferPtr val,int nr ATTRIBUTE_UNUSED)489 static void des_xmlParserInputBufferPtr(int no ATTRIBUTE_UNUSED, xmlParserInputBufferPtr val, int nr ATTRIBUTE_UNUSED) {
490     xmlFreeParserInputBuffer(val);
491 }
492 
493 #define gen_nb_xmlDocPtr 4
gen_xmlDocPtr(int no,int nr ATTRIBUTE_UNUSED)494 static xmlDocPtr gen_xmlDocPtr(int no, int nr ATTRIBUTE_UNUSED) {
495     if (no == 0) return(xmlNewDoc(BAD_CAST "1.0"));
496     if (no == 1) return(xmlReadMemory("<foo/>", 6, "test", NULL, 0));
497     if (no == 2) return(xmlReadMemory("<!DOCTYPE foo []> <foo/>", 24, "test", NULL, 0));
498     return(NULL);
499 }
des_xmlDocPtr(int no ATTRIBUTE_UNUSED,xmlDocPtr val,int nr ATTRIBUTE_UNUSED)500 static void des_xmlDocPtr(int no ATTRIBUTE_UNUSED, xmlDocPtr val, int nr ATTRIBUTE_UNUSED) {
501     if ((val != NULL) && (val != api_doc) && (val->doc != api_doc))
502         xmlFreeDoc(val);
503 }
504 
505 #define gen_nb_xmlAttrPtr 2
gen_xmlAttrPtr(int no,int nr ATTRIBUTE_UNUSED)506 static xmlAttrPtr gen_xmlAttrPtr(int no, int nr ATTRIBUTE_UNUSED) {
507     if (no == 0) return(get_api_attr());
508     return(NULL);
509 }
des_xmlAttrPtr(int no,xmlAttrPtr val ATTRIBUTE_UNUSED,int nr ATTRIBUTE_UNUSED)510 static void des_xmlAttrPtr(int no, xmlAttrPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
511     if (no == 0) free_api_doc();
512 }
513 
514 #define gen_nb_xmlDictPtr 2
gen_xmlDictPtr(int no,int nr ATTRIBUTE_UNUSED)515 static xmlDictPtr gen_xmlDictPtr(int no, int nr ATTRIBUTE_UNUSED) {
516     if (no == 0) return(xmlDictCreate());
517     return(NULL);
518 }
des_xmlDictPtr(int no ATTRIBUTE_UNUSED,xmlDictPtr val,int nr ATTRIBUTE_UNUSED)519 static void des_xmlDictPtr(int no ATTRIBUTE_UNUSED, xmlDictPtr val, int nr ATTRIBUTE_UNUSED) {
520     if (val != NULL)
521         xmlDictFree(val);
522 }
523 
524 #define gen_nb_xmlNodePtr 3
gen_xmlNodePtr(int no,int nr ATTRIBUTE_UNUSED)525 static xmlNodePtr gen_xmlNodePtr(int no, int nr ATTRIBUTE_UNUSED) {
526     if (no == 0) return(xmlNewPI(BAD_CAST "test", NULL));
527     if (no == 1) return(get_api_root());
528     return(NULL);
529 /*     if (no == 2) return((xmlNodePtr) get_api_doc()); */
530 }
des_xmlNodePtr(int no,xmlNodePtr val,int nr ATTRIBUTE_UNUSED)531 static void des_xmlNodePtr(int no, xmlNodePtr val, int nr ATTRIBUTE_UNUSED) {
532     if (no == 1) {
533         free_api_doc();
534     } else if (val != NULL) {
535         xmlUnlinkNode(val);
536         xmlFreeNode(val);
537     }
538 }
539 
540 #define gen_nb_xmlDtdPtr 3
gen_xmlDtdPtr(int no,int nr ATTRIBUTE_UNUSED)541 static xmlDtdPtr gen_xmlDtdPtr(int no, int nr ATTRIBUTE_UNUSED) {
542     if (no == 0)
543         return(xmlNewDtd(NULL, BAD_CAST "dtd", BAD_CAST"foo", BAD_CAST"bar"));
544     if (no == 1) return(get_api_dtd());
545     return(NULL);
546 }
des_xmlDtdPtr(int no,xmlDtdPtr val,int nr ATTRIBUTE_UNUSED)547 static void des_xmlDtdPtr(int no, xmlDtdPtr val, int nr ATTRIBUTE_UNUSED) {
548     if (no == 1) free_api_doc();
549     else if (val != NULL) {
550         xmlUnlinkNode((xmlNodePtr) val);
551         xmlFreeNode((xmlNodePtr) val);
552     }
553 }
554 
555 #define gen_nb_xmlNsPtr 2
gen_xmlNsPtr(int no,int nr ATTRIBUTE_UNUSED)556 static xmlNsPtr gen_xmlNsPtr(int no, int nr ATTRIBUTE_UNUSED) {
557     if (no == 0) return(get_api_ns());
558     return(NULL);
559 }
des_xmlNsPtr(int no,xmlNsPtr val ATTRIBUTE_UNUSED,int nr ATTRIBUTE_UNUSED)560 static void des_xmlNsPtr(int no, xmlNsPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
561     if (no == 0) free_api_doc();
562 }
563 
564 #define gen_nb_xmlNodePtr_in 3
gen_xmlNodePtr_in(int no,int nr ATTRIBUTE_UNUSED)565 static xmlNodePtr gen_xmlNodePtr_in(int no, int nr ATTRIBUTE_UNUSED) {
566     if (no == 0) return(xmlNewPI(BAD_CAST "test", NULL));
567     if (no == 0) return(xmlNewText(BAD_CAST "text"));
568     return(NULL);
569 }
des_xmlNodePtr_in(int no ATTRIBUTE_UNUSED,xmlNodePtr val ATTRIBUTE_UNUSED,int nr ATTRIBUTE_UNUSED)570 static void des_xmlNodePtr_in(int no ATTRIBUTE_UNUSED, xmlNodePtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
571 }
572 
573 #ifdef LIBXML_WRITER_ENABLED
574 #define gen_nb_xmlTextWriterPtr 2
gen_xmlTextWriterPtr(int no,int nr ATTRIBUTE_UNUSED)575 static xmlTextWriterPtr gen_xmlTextWriterPtr(int no, int nr ATTRIBUTE_UNUSED) {
576     if (no == 0) return(xmlNewTextWriterFilename("test.out", 0));
577     return(NULL);
578 }
des_xmlTextWriterPtr(int no ATTRIBUTE_UNUSED,xmlTextWriterPtr val,int nr ATTRIBUTE_UNUSED)579 static void des_xmlTextWriterPtr(int no ATTRIBUTE_UNUSED, xmlTextWriterPtr val, int nr ATTRIBUTE_UNUSED) {
580     if (val != NULL) xmlFreeTextWriter(val);
581 }
582 #endif
583 
584 #ifdef LIBXML_READER_ENABLED
585 #define gen_nb_xmlTextReaderPtr 4
gen_xmlTextReaderPtr(int no,int nr ATTRIBUTE_UNUSED)586 static xmlTextReaderPtr gen_xmlTextReaderPtr(int no, int nr ATTRIBUTE_UNUSED) {
587     if (no == 0) return(xmlNewTextReaderFilename("test/ent2"));
588     if (no == 1) return(xmlNewTextReaderFilename("test/valid/REC-xml-19980210.xml"));
589     if (no == 2) return(xmlNewTextReaderFilename("test/valid/dtds/xhtml1-strict.dtd"));
590     return(NULL);
591 }
des_xmlTextReaderPtr(int no ATTRIBUTE_UNUSED,xmlTextReaderPtr val,int nr ATTRIBUTE_UNUSED)592 static void des_xmlTextReaderPtr(int no ATTRIBUTE_UNUSED, xmlTextReaderPtr val, int nr ATTRIBUTE_UNUSED) {
593     if (val != NULL) xmlFreeTextReader(val);
594 }
595 #endif
596 
597 #define gen_nb_xmlBufferPtr 3
598 static const xmlChar *static_buf_content = (xmlChar *)"a static buffer";
gen_xmlBufferPtr(int no,int nr ATTRIBUTE_UNUSED)599 static xmlBufferPtr gen_xmlBufferPtr(int no, int nr ATTRIBUTE_UNUSED) {
600     if (no == 0) return(xmlBufferCreate());
601     if (no == 1) return(xmlBufferCreateStatic((void *)static_buf_content, 13));
602     return(NULL);
603 }
des_xmlBufferPtr(int no ATTRIBUTE_UNUSED,xmlBufferPtr val,int nr ATTRIBUTE_UNUSED)604 static void des_xmlBufferPtr(int no ATTRIBUTE_UNUSED, xmlBufferPtr val, int nr ATTRIBUTE_UNUSED) {
605     if (val != NULL) {
606         xmlBufferFree(val);
607     }
608 }
609 
610 #define gen_nb_xmlListPtr 2
gen_xmlListPtr(int no,int nr ATTRIBUTE_UNUSED)611 static xmlListPtr gen_xmlListPtr(int no, int nr ATTRIBUTE_UNUSED) {
612     if (no == 0) return(xmlListCreate(NULL, NULL));
613     return(NULL);
614 }
des_xmlListPtr(int no ATTRIBUTE_UNUSED,xmlListPtr val,int nr ATTRIBUTE_UNUSED)615 static void des_xmlListPtr(int no ATTRIBUTE_UNUSED, xmlListPtr val, int nr ATTRIBUTE_UNUSED) {
616     if (val != NULL) {
617         xmlListDelete(val);
618     }
619 }
620 
621 #define gen_nb_xmlHashTablePtr 2
gen_xmlHashTablePtr(int no,int nr ATTRIBUTE_UNUSED)622 static xmlHashTablePtr gen_xmlHashTablePtr(int no, int nr ATTRIBUTE_UNUSED) {
623     if (no == 0) return(xmlHashCreate(10));
624     return(NULL);
625 }
des_xmlHashTablePtr(int no ATTRIBUTE_UNUSED,xmlHashTablePtr val,int nr ATTRIBUTE_UNUSED)626 static void des_xmlHashTablePtr(int no ATTRIBUTE_UNUSED, xmlHashTablePtr val, int nr ATTRIBUTE_UNUSED) {
627     if (val != NULL) {
628         xmlHashFree(val, NULL);
629     }
630 }
631 
632 #include <libxml/xpathInternals.h>
633 
634 #ifdef LIBXML_XPATH_ENABLED
635 #define gen_nb_xmlXPathObjectPtr 5
gen_xmlXPathObjectPtr(int no,int nr ATTRIBUTE_UNUSED)636 static xmlXPathObjectPtr gen_xmlXPathObjectPtr(int no, int nr ATTRIBUTE_UNUSED) {
637     if (no == 0) return(xmlXPathNewString(BAD_CAST "string object"));
638     if (no == 1) return(xmlXPathNewFloat(1.1));
639     if (no == 2) return(xmlXPathNewBoolean(1));
640     if (no == 3) return(xmlXPathNewNodeSet(NULL));
641     return(NULL);
642 }
des_xmlXPathObjectPtr(int no ATTRIBUTE_UNUSED,xmlXPathObjectPtr val,int nr ATTRIBUTE_UNUSED)643 static void des_xmlXPathObjectPtr(int no ATTRIBUTE_UNUSED, xmlXPathObjectPtr val, int nr ATTRIBUTE_UNUSED) {
644     if (val != NULL) {
645         xmlXPathFreeObject(val);
646     }
647 }
648 #endif
649 
650 #ifdef LIBXML_OUTPUT_ENABLED
651 #define gen_nb_xmlOutputBufferPtr 2
gen_xmlOutputBufferPtr(int no,int nr ATTRIBUTE_UNUSED)652 static xmlOutputBufferPtr gen_xmlOutputBufferPtr(int no, int nr ATTRIBUTE_UNUSED) {
653     if (no == 0) return(xmlOutputBufferCreateFilename("test.out", NULL, 0));
654     return(NULL);
655 }
des_xmlOutputBufferPtr(int no ATTRIBUTE_UNUSED,xmlOutputBufferPtr val,int nr ATTRIBUTE_UNUSED)656 static void des_xmlOutputBufferPtr(int no ATTRIBUTE_UNUSED, xmlOutputBufferPtr val, int nr ATTRIBUTE_UNUSED) {
657     if (val != NULL) {
658         xmlOutputBufferClose(val);
659     }
660 }
661 #endif
662 
663 #ifdef LIBXML_FTP_ENABLED
664 #define gen_nb_xmlNanoFTPCtxtPtr 4
gen_xmlNanoFTPCtxtPtr(int no,int nr ATTRIBUTE_UNUSED)665 static void *gen_xmlNanoFTPCtxtPtr(int no, int nr ATTRIBUTE_UNUSED) {
666     if (no == 0) return(xmlNanoFTPNewCtxt(REMOTE2GOOD));
667     if (no == 1) return(xmlNanoFTPNewCtxt(REMOTE1GOOD));
668     if (no == 2) return(xmlNanoFTPNewCtxt("foo"));
669     return(NULL);
670 }
des_xmlNanoFTPCtxtPtr(int no ATTRIBUTE_UNUSED,void * val,int nr ATTRIBUTE_UNUSED)671 static void des_xmlNanoFTPCtxtPtr(int no ATTRIBUTE_UNUSED, void *val, int nr ATTRIBUTE_UNUSED) {
672     if (val != NULL) {
673         xmlNanoFTPFreeCtxt(val);
674     }
675 }
676 #endif
677 
678 #ifdef LIBXML_HTTP_ENABLED
679 #define gen_nb_xmlNanoHTTPCtxtPtr 1
gen_xmlNanoHTTPCtxtPtr(int no,int nr ATTRIBUTE_UNUSED)680 static void *gen_xmlNanoHTTPCtxtPtr(int no, int nr ATTRIBUTE_UNUSED) {
681     if (no == 0) return(xmlNanoHTTPOpen(REMOTE1GOOD, NULL));
682     if (no == 1) return(xmlNanoHTTPOpen(REMOTE2GOOD, NULL));
683     if (no == 2) return(xmlNanoHTTPOpen(REMOTE1BAD, NULL));
684     return(NULL);
685 }
des_xmlNanoHTTPCtxtPtr(int no ATTRIBUTE_UNUSED,void * val,int nr ATTRIBUTE_UNUSED)686 static void des_xmlNanoHTTPCtxtPtr(int no ATTRIBUTE_UNUSED, void *val, int nr ATTRIBUTE_UNUSED) {
687     if (val != NULL) {
688 	xmlNanoHTTPClose(val);
689     }
690 }
691 #endif
692 
693 #define gen_nb_xmlCharEncoding 4
gen_xmlCharEncoding(int no,int nr ATTRIBUTE_UNUSED)694 static xmlCharEncoding gen_xmlCharEncoding(int no, int nr ATTRIBUTE_UNUSED) {
695     if (no == 0) return(XML_CHAR_ENCODING_UTF8);
696     if (no == 1) return(XML_CHAR_ENCODING_NONE);
697     if (no == 2) return(XML_CHAR_ENCODING_8859_1);
698     return(XML_CHAR_ENCODING_ERROR);
699 }
des_xmlCharEncoding(int no ATTRIBUTE_UNUSED,xmlCharEncoding val ATTRIBUTE_UNUSED,int nr ATTRIBUTE_UNUSED)700 static void des_xmlCharEncoding(int no ATTRIBUTE_UNUSED, xmlCharEncoding val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
701 }
702 
703 #if defined(LIBXML_REGEXP_ENABLED) && defined(LIBXML_EXPR_ENABLED)
704 
705 #define gen_nb_xmlExpCtxtPtr 1
gen_xmlExpCtxtPtr(int no ATTRIBUTE_UNUSED,int nr ATTRIBUTE_UNUSED)706 static xmlExpCtxtPtr gen_xmlExpCtxtPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
707     return(NULL);
708 }
des_xmlExpCtxtPtr(int no ATTRIBUTE_UNUSED,xmlExpCtxtPtr val ATTRIBUTE_UNUSED,int nr ATTRIBUTE_UNUSED)709 static void des_xmlExpCtxtPtr(int no ATTRIBUTE_UNUSED, xmlExpCtxtPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
710 }
711 
712 #define gen_nb_xmlExpNodePtr 1
gen_xmlExpNodePtr(int no ATTRIBUTE_UNUSED,int nr ATTRIBUTE_UNUSED)713 static xmlExpNodePtr gen_xmlExpNodePtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
714     return(NULL);
715 }
des_xmlExpNodePtr(int no ATTRIBUTE_UNUSED,xmlExpNodePtr val ATTRIBUTE_UNUSED,int nr ATTRIBUTE_UNUSED)716 static void des_xmlExpNodePtr(int no ATTRIBUTE_UNUSED, xmlExpNodePtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
717 }
718 
719 #endif
720 
721 #if defined(LIBXML_SCHEMAS_ENABLED)
722 #define gen_nb_xmlSchemaPtr 1
gen_xmlSchemaPtr(int no ATTRIBUTE_UNUSED,int nr ATTRIBUTE_UNUSED)723 static xmlSchemaPtr gen_xmlSchemaPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
724     return(NULL);
725 }
des_xmlSchemaPtr(int no ATTRIBUTE_UNUSED,xmlSchemaPtr val ATTRIBUTE_UNUSED,int nr ATTRIBUTE_UNUSED)726 static void des_xmlSchemaPtr(int no ATTRIBUTE_UNUSED, xmlSchemaPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
727 }
728 
729 #define gen_nb_xmlSchemaValidCtxtPtr 1
gen_xmlSchemaValidCtxtPtr(int no ATTRIBUTE_UNUSED,int nr ATTRIBUTE_UNUSED)730 static xmlSchemaValidCtxtPtr gen_xmlSchemaValidCtxtPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
731     return(NULL);
732 }
des_xmlSchemaValidCtxtPtr(int no ATTRIBUTE_UNUSED,xmlSchemaValidCtxtPtr val ATTRIBUTE_UNUSED,int nr ATTRIBUTE_UNUSED)733 static void des_xmlSchemaValidCtxtPtr(int no ATTRIBUTE_UNUSED, xmlSchemaValidCtxtPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
734 }
735 
736 #endif /* LIBXML_SCHEMAS_ENABLED */
737 
738 #define gen_nb_xmlHashDeallocator 2
739 static void
test_xmlHashDeallocator(void * payload ATTRIBUTE_UNUSED,const xmlChar * name ATTRIBUTE_UNUSED)740 test_xmlHashDeallocator(void *payload ATTRIBUTE_UNUSED,
741                         const xmlChar *name ATTRIBUTE_UNUSED) {
742 }
743 
gen_xmlHashDeallocator(int no,int nr ATTRIBUTE_UNUSED)744 static xmlHashDeallocator gen_xmlHashDeallocator(int no, int nr ATTRIBUTE_UNUSED) {
745     if (no == 0) return(test_xmlHashDeallocator);
746     return(NULL);
747 }
des_xmlHashDeallocator(int no ATTRIBUTE_UNUSED,xmlHashDeallocator val ATTRIBUTE_UNUSED,int nr ATTRIBUTE_UNUSED)748 static void des_xmlHashDeallocator(int no ATTRIBUTE_UNUSED, xmlHashDeallocator val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
749 }
750 
751 
desret_int(int val ATTRIBUTE_UNUSED)752 static void desret_int(int val ATTRIBUTE_UNUSED) {
753 }
desret_xmlChar(xmlChar val ATTRIBUTE_UNUSED)754 static void desret_xmlChar(xmlChar val ATTRIBUTE_UNUSED) {
755 }
desret_long(long val ATTRIBUTE_UNUSED)756 static void desret_long(long val ATTRIBUTE_UNUSED) {
757 }
desret_unsigned_long(unsigned long val ATTRIBUTE_UNUSED)758 static void desret_unsigned_long(unsigned long val ATTRIBUTE_UNUSED) {
759 }
desret_double(double val ATTRIBUTE_UNUSED)760 static void desret_double(double val ATTRIBUTE_UNUSED) {
761 }
desret_xmlCharEncoding(xmlCharEncoding val ATTRIBUTE_UNUSED)762 static void desret_xmlCharEncoding(xmlCharEncoding val ATTRIBUTE_UNUSED) {
763 }
764 #if 0
765 static void desret_const_void_ptr(void *val ATTRIBUTE_UNUSED) {
766 }
767 #endif
desret_void_ptr(void * val ATTRIBUTE_UNUSED)768 static void desret_void_ptr(void *val ATTRIBUTE_UNUSED) {
769 }
desret_const_char_ptr(const char * val ATTRIBUTE_UNUSED)770 static void desret_const_char_ptr(const char *val ATTRIBUTE_UNUSED) {
771 }
desret_const_xmlChar_ptr(const xmlChar * val ATTRIBUTE_UNUSED)772 static void desret_const_xmlChar_ptr(const xmlChar *val ATTRIBUTE_UNUSED) {
773 }
desret_xmlChar_ptr(xmlChar * val)774 static void desret_xmlChar_ptr(xmlChar *val) {
775     if (val != NULL)
776 	xmlFree(val);
777 }
desret_xmlDocPtr(xmlDocPtr val)778 static void desret_xmlDocPtr(xmlDocPtr val) {
779     if (val != api_doc)
780 	xmlFreeDoc(val);
781 }
desret_xmlDictPtr(xmlDictPtr val)782 static void desret_xmlDictPtr(xmlDictPtr val) {
783     xmlDictFree(val);
784 }
785 #ifdef LIBXML_OUTPUT_ENABLED
desret_xmlOutputBufferPtr(xmlOutputBufferPtr val)786 static void desret_xmlOutputBufferPtr(xmlOutputBufferPtr val) {
787     xmlOutputBufferClose(val);
788 }
789 #endif
790 #ifdef LIBXML_READER_ENABLED
desret_xmlTextReaderPtr(xmlTextReaderPtr val)791 static void desret_xmlTextReaderPtr(xmlTextReaderPtr val) {
792     xmlFreeTextReader(val);
793 }
794 #endif
desret_xmlNodePtr(xmlNodePtr val)795 static void desret_xmlNodePtr(xmlNodePtr val) {
796     if ((val != NULL) && (val != api_root) && (val != (xmlNodePtr) api_doc)) {
797 	xmlUnlinkNode(val);
798 	xmlFreeNode(val);
799     }
800 }
desret_xmlAttrPtr(xmlAttrPtr val)801 static void desret_xmlAttrPtr(xmlAttrPtr val) {
802     if (val != NULL) {
803 	xmlUnlinkNode((xmlNodePtr) val);
804 	xmlFreeNode((xmlNodePtr) val);
805     }
806 }
desret_xmlEntityPtr(xmlEntityPtr val)807 static void desret_xmlEntityPtr(xmlEntityPtr val) {
808     if (val != NULL) {
809 	xmlUnlinkNode((xmlNodePtr) val);
810 	xmlFreeNode((xmlNodePtr) val);
811     }
812 }
desret_xmlElementPtr(xmlElementPtr val)813 static void desret_xmlElementPtr(xmlElementPtr val) {
814     if (val != NULL) {
815 	xmlUnlinkNode((xmlNodePtr) val);
816     }
817 }
desret_xmlAttributePtr(xmlAttributePtr val)818 static void desret_xmlAttributePtr(xmlAttributePtr val) {
819     if (val != NULL) {
820 	xmlUnlinkNode((xmlNodePtr) val);
821     }
822 }
desret_xmlNsPtr(xmlNsPtr val ATTRIBUTE_UNUSED)823 static void desret_xmlNsPtr(xmlNsPtr val ATTRIBUTE_UNUSED) {
824 }
desret_xmlDtdPtr(xmlDtdPtr val)825 static void desret_xmlDtdPtr(xmlDtdPtr val) {
826     desret_xmlNodePtr((xmlNodePtr)val);
827 }
828 #ifdef LIBXML_XPATH_ENABLED
desret_xmlXPathObjectPtr(xmlXPathObjectPtr val)829 static void desret_xmlXPathObjectPtr(xmlXPathObjectPtr val) {
830     xmlXPathFreeObject(val);
831 }
desret_xmlNodeSetPtr(xmlNodeSetPtr val)832 static void desret_xmlNodeSetPtr(xmlNodeSetPtr val) {
833     xmlXPathFreeNodeSet(val);
834 }
835 #endif
desret_xmlParserCtxtPtr(xmlParserCtxtPtr val)836 static void desret_xmlParserCtxtPtr(xmlParserCtxtPtr val) {
837     xmlFreeParserCtxt(val);
838 }
desret_xmlParserInputBufferPtr(xmlParserInputBufferPtr val)839 static void desret_xmlParserInputBufferPtr(xmlParserInputBufferPtr val) {
840     xmlFreeParserInputBuffer(val);
841 }
desret_xmlParserInputPtr(xmlParserInputPtr val)842 static void desret_xmlParserInputPtr(xmlParserInputPtr val) {
843     xmlFreeInputStream(val);
844 }
845 #ifdef LIBXML_WRITER_ENABLED
desret_xmlTextWriterPtr(xmlTextWriterPtr val)846 static void desret_xmlTextWriterPtr(xmlTextWriterPtr val) {
847     xmlFreeTextWriter(val);
848 }
849 #endif
desret_xmlBufferPtr(xmlBufferPtr val)850 static void desret_xmlBufferPtr(xmlBufferPtr val) {
851     xmlBufferFree(val);
852 }
853 #ifdef LIBXML_SCHEMAS_ENABLED
desret_xmlSchemaParserCtxtPtr(xmlSchemaParserCtxtPtr val)854 static void desret_xmlSchemaParserCtxtPtr(xmlSchemaParserCtxtPtr val) {
855     xmlSchemaFreeParserCtxt(val);
856 }
desret_xmlSchemaTypePtr(xmlSchemaTypePtr val ATTRIBUTE_UNUSED)857 static void desret_xmlSchemaTypePtr(xmlSchemaTypePtr val ATTRIBUTE_UNUSED) {
858 }
desret_xmlRelaxNGParserCtxtPtr(xmlRelaxNGParserCtxtPtr val)859 static void desret_xmlRelaxNGParserCtxtPtr(xmlRelaxNGParserCtxtPtr val) {
860     xmlRelaxNGFreeParserCtxt(val);
861 }
862 #endif
863 #ifdef LIBXML_HTML_ENABLED
desret_const_htmlEntityDesc_ptr(const htmlEntityDesc * val ATTRIBUTE_UNUSED)864 static void desret_const_htmlEntityDesc_ptr(const htmlEntityDesc * val ATTRIBUTE_UNUSED) {
865 }
866 #endif
867 #ifdef LIBXML_HTTP_ENABLED
desret_xmlNanoHTTPCtxtPtr(void * val)868 static void desret_xmlNanoHTTPCtxtPtr(void *val) {
869     xmlNanoHTTPClose(val);
870 }
871 #endif
872 #ifdef LIBXML_FTP_ENABLED
desret_xmlNanoFTPCtxtPtr(void * val)873 static void desret_xmlNanoFTPCtxtPtr(void *val) {
874     xmlNanoFTPClose(val);
875 }
876 #endif
877 /* cut and pasted from autogenerated to avoid troubles */
878 #define gen_nb_const_xmlChar_ptr_ptr 1
gen_const_xmlChar_ptr_ptr(int no ATTRIBUTE_UNUSED,int nr ATTRIBUTE_UNUSED)879 static xmlChar ** gen_const_xmlChar_ptr_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
880     return(NULL);
881 }
des_const_xmlChar_ptr_ptr(int no ATTRIBUTE_UNUSED,const xmlChar ** val ATTRIBUTE_UNUSED,int nr ATTRIBUTE_UNUSED)882 static void des_const_xmlChar_ptr_ptr(int no ATTRIBUTE_UNUSED, const xmlChar ** val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
883 }
884 
885 #define gen_nb_unsigned_char_ptr 1
gen_unsigned_char_ptr(int no ATTRIBUTE_UNUSED,int nr ATTRIBUTE_UNUSED)886 static unsigned char * gen_unsigned_char_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
887     return(NULL);
888 }
des_unsigned_char_ptr(int no ATTRIBUTE_UNUSED,unsigned char * val ATTRIBUTE_UNUSED,int nr ATTRIBUTE_UNUSED)889 static void des_unsigned_char_ptr(int no ATTRIBUTE_UNUSED, unsigned char * val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
890 }
891 
892 #define gen_nb_const_unsigned_char_ptr 1
gen_const_unsigned_char_ptr(int no ATTRIBUTE_UNUSED,int nr ATTRIBUTE_UNUSED)893 static unsigned char * gen_const_unsigned_char_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
894     return(NULL);
895 }
des_const_unsigned_char_ptr(int no ATTRIBUTE_UNUSED,const unsigned char * val ATTRIBUTE_UNUSED,int nr ATTRIBUTE_UNUSED)896 static void des_const_unsigned_char_ptr(int no ATTRIBUTE_UNUSED, const unsigned char * val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
897 }
898 
899 #ifdef LIBXML_HTML_ENABLED
900 #define gen_nb_const_htmlNodePtr 1
gen_const_htmlNodePtr(int no ATTRIBUTE_UNUSED,int nr ATTRIBUTE_UNUSED)901 static htmlNodePtr gen_const_htmlNodePtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
902     return(NULL);
903 }
des_const_htmlNodePtr(int no ATTRIBUTE_UNUSED,const htmlNodePtr val ATTRIBUTE_UNUSED,int nr ATTRIBUTE_UNUSED)904 static void des_const_htmlNodePtr(int no ATTRIBUTE_UNUSED, const htmlNodePtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
905 }
906 #endif
907 
908 #ifdef LIBXML_HTML_ENABLED
909 #define gen_nb_htmlDocPtr 3
gen_htmlDocPtr(int no ATTRIBUTE_UNUSED,int nr ATTRIBUTE_UNUSED)910 static htmlDocPtr gen_htmlDocPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
911     if (no == 0) return(htmlNewDoc(NULL, NULL));
912     if (no == 1) return(htmlReadMemory("<html/>", 7, "test", NULL, 0));
913     return(NULL);
914 }
des_htmlDocPtr(int no ATTRIBUTE_UNUSED,htmlDocPtr val ATTRIBUTE_UNUSED,int nr ATTRIBUTE_UNUSED)915 static void des_htmlDocPtr(int no ATTRIBUTE_UNUSED, htmlDocPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
916     if ((val != NULL) && (val != api_doc) && (val->doc != api_doc))
917         xmlFreeDoc(val);
918 }
desret_htmlDocPtr(htmlDocPtr val)919 static void desret_htmlDocPtr(htmlDocPtr val) {
920     if ((val != NULL) && (val != api_doc) && (val->doc != api_doc))
921         xmlFreeDoc(val);
922 }
923 #define gen_nb_htmlParserCtxtPtr 3
gen_htmlParserCtxtPtr(int no ATTRIBUTE_UNUSED,int nr ATTRIBUTE_UNUSED)924 static htmlParserCtxtPtr gen_htmlParserCtxtPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
925     if (no == 0) return(xmlNewParserCtxt());
926     if (no == 1) return(htmlCreateMemoryParserCtxt("<html/>", 7));
927     return(NULL);
928 }
des_htmlParserCtxtPtr(int no ATTRIBUTE_UNUSED,htmlParserCtxtPtr val ATTRIBUTE_UNUSED,int nr ATTRIBUTE_UNUSED)929 static void des_htmlParserCtxtPtr(int no ATTRIBUTE_UNUSED, htmlParserCtxtPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
930     if (val != NULL)
931         htmlFreeParserCtxt(val);
932 }
desret_htmlParserCtxtPtr(htmlParserCtxtPtr val)933 static void desret_htmlParserCtxtPtr(htmlParserCtxtPtr val) {
934     if (val != NULL)
935         htmlFreeParserCtxt(val);
936 }
937 #endif
938 
939 #ifdef LIBXML_XPATH_ENABLED
940 #define gen_nb_xmlNodeSetPtr 1
gen_xmlNodeSetPtr(int no ATTRIBUTE_UNUSED,int nr ATTRIBUTE_UNUSED)941 static xmlNodeSetPtr gen_xmlNodeSetPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
942     return(NULL);
943 }
des_xmlNodeSetPtr(int no ATTRIBUTE_UNUSED,xmlNodeSetPtr val ATTRIBUTE_UNUSED,int nr ATTRIBUTE_UNUSED)944 static void des_xmlNodeSetPtr(int no ATTRIBUTE_UNUSED, xmlNodeSetPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
945 }
946 #endif
947 
948 #ifdef LIBXML_DEBUG_ENABLED
949 #ifdef LIBXML_XPATH_ENABLED
950 #define gen_nb_xmlShellCtxtPtr 1
gen_xmlShellCtxtPtr(int no ATTRIBUTE_UNUSED,int nr ATTRIBUTE_UNUSED)951 static xmlShellCtxtPtr gen_xmlShellCtxtPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
952     return(NULL);
953 }
des_xmlShellCtxtPtr(int no ATTRIBUTE_UNUSED,xmlShellCtxtPtr val ATTRIBUTE_UNUSED,int nr ATTRIBUTE_UNUSED)954 static void des_xmlShellCtxtPtr(int no ATTRIBUTE_UNUSED, xmlShellCtxtPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
955 }
956 #endif
957 #endif
958 
959 #ifdef LIBXML_PATTERN_ENABLED
960 #define gen_nb_xmlPatternPtr 1
gen_xmlPatternPtr(int no ATTRIBUTE_UNUSED,int nr ATTRIBUTE_UNUSED)961 static xmlPatternPtr gen_xmlPatternPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
962     return(NULL);
963 }
des_xmlPatternPtr(int no ATTRIBUTE_UNUSED,xmlPatternPtr val ATTRIBUTE_UNUSED,int nr ATTRIBUTE_UNUSED)964 static void des_xmlPatternPtr(int no ATTRIBUTE_UNUSED, xmlPatternPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
965 }
966 #endif
967 
968 #define gen_nb_xmlElementContentPtr 1
gen_xmlElementContentPtr(int no ATTRIBUTE_UNUSED,int nr ATTRIBUTE_UNUSED)969 static xmlElementContentPtr gen_xmlElementContentPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
970     return(NULL);
971 }
des_xmlElementContentPtr(int no ATTRIBUTE_UNUSED,xmlElementContentPtr val,int nr ATTRIBUTE_UNUSED)972 static void des_xmlElementContentPtr(int no ATTRIBUTE_UNUSED, xmlElementContentPtr val, int nr ATTRIBUTE_UNUSED) {
973     if (val != NULL)
974         xmlFreeElementContent(val);
975 }
desret_xmlElementContentPtr(xmlElementContentPtr val)976 static void desret_xmlElementContentPtr(xmlElementContentPtr val) {
977     if (val != NULL)
978         xmlFreeElementContent(val);
979 }
980 
981 #define gen_nb_xmlParserNodeInfoSeqPtr 1
gen_xmlParserNodeInfoSeqPtr(int no ATTRIBUTE_UNUSED,int nr ATTRIBUTE_UNUSED)982 static xmlParserNodeInfoSeqPtr gen_xmlParserNodeInfoSeqPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
983     return(NULL);
984 }
des_xmlParserNodeInfoSeqPtr(int no ATTRIBUTE_UNUSED,xmlParserNodeInfoSeqPtr val ATTRIBUTE_UNUSED,int nr ATTRIBUTE_UNUSED)985 static void des_xmlParserNodeInfoSeqPtr(int no ATTRIBUTE_UNUSED, xmlParserNodeInfoSeqPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
986 }
987 
desret_const_xmlParserNodeInfo_ptr(const xmlParserNodeInfo * val ATTRIBUTE_UNUSED)988 static void desret_const_xmlParserNodeInfo_ptr(const xmlParserNodeInfo *val ATTRIBUTE_UNUSED) {
989 }
990 
991 #define gen_nb_void_ptr_ptr 1
gen_void_ptr_ptr(int no ATTRIBUTE_UNUSED,int nr ATTRIBUTE_UNUSED)992 static void ** gen_void_ptr_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
993     return(NULL);
994 }
des_void_ptr_ptr(int no ATTRIBUTE_UNUSED,void ** val ATTRIBUTE_UNUSED,int nr ATTRIBUTE_UNUSED)995 static void des_void_ptr_ptr(int no ATTRIBUTE_UNUSED, void ** val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
996 }
997 
998 /************************************************************************
999  *									*
1000  *   WARNING: end of the manually maintained part of the test code	*
1001  *            do not remove or alter the CUT HERE line			*
1002  *									*
1003  ************************************************************************/
1004 
1005 /* CUT HERE: everything below that line is generated */
1006 #ifdef LIBXML_HTML_ENABLED
desret_htmlStatus(htmlStatus val ATTRIBUTE_UNUSED)1007 static void desret_htmlStatus(htmlStatus val ATTRIBUTE_UNUSED) {
1008 }
1009 
1010 #endif
1011 
1012 #define gen_nb_xmlAttributeDefault 4
gen_xmlAttributeDefault(int no,int nr ATTRIBUTE_UNUSED)1013 static xmlAttributeDefault gen_xmlAttributeDefault(int no, int nr ATTRIBUTE_UNUSED) {
1014     if (no == 1) return(XML_ATTRIBUTE_FIXED);
1015     if (no == 2) return(XML_ATTRIBUTE_IMPLIED);
1016     if (no == 3) return(XML_ATTRIBUTE_NONE);
1017     if (no == 4) return(XML_ATTRIBUTE_REQUIRED);
1018     return(0);
1019 }
1020 
des_xmlAttributeDefault(int no ATTRIBUTE_UNUSED,xmlAttributeDefault val ATTRIBUTE_UNUSED,int nr ATTRIBUTE_UNUSED)1021 static void des_xmlAttributeDefault(int no ATTRIBUTE_UNUSED, xmlAttributeDefault val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
1022 }
1023 
1024 #define gen_nb_xmlAttributeType 4
gen_xmlAttributeType(int no,int nr ATTRIBUTE_UNUSED)1025 static xmlAttributeType gen_xmlAttributeType(int no, int nr ATTRIBUTE_UNUSED) {
1026     if (no == 1) return(XML_ATTRIBUTE_CDATA);
1027     if (no == 2) return(XML_ATTRIBUTE_ENTITIES);
1028     if (no == 3) return(XML_ATTRIBUTE_ENTITY);
1029     if (no == 4) return(XML_ATTRIBUTE_ENUMERATION);
1030     return(0);
1031 }
1032 
des_xmlAttributeType(int no ATTRIBUTE_UNUSED,xmlAttributeType val ATTRIBUTE_UNUSED,int nr ATTRIBUTE_UNUSED)1033 static void des_xmlAttributeType(int no ATTRIBUTE_UNUSED, xmlAttributeType val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
1034 }
1035 
1036 #define gen_nb_xmlBufferAllocationScheme 4
gen_xmlBufferAllocationScheme(int no,int nr ATTRIBUTE_UNUSED)1037 static xmlBufferAllocationScheme gen_xmlBufferAllocationScheme(int no, int nr ATTRIBUTE_UNUSED) {
1038     if (no == 1) return(XML_BUFFER_ALLOC_BOUNDED);
1039     if (no == 2) return(XML_BUFFER_ALLOC_DOUBLEIT);
1040     if (no == 3) return(XML_BUFFER_ALLOC_EXACT);
1041     if (no == 4) return(XML_BUFFER_ALLOC_HYBRID);
1042     return(0);
1043 }
1044 
des_xmlBufferAllocationScheme(int no ATTRIBUTE_UNUSED,xmlBufferAllocationScheme val ATTRIBUTE_UNUSED,int nr ATTRIBUTE_UNUSED)1045 static void des_xmlBufferAllocationScheme(int no ATTRIBUTE_UNUSED, xmlBufferAllocationScheme val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
1046 }
1047 
desret_xmlBufferAllocationScheme(xmlBufferAllocationScheme val ATTRIBUTE_UNUSED)1048 static void desret_xmlBufferAllocationScheme(xmlBufferAllocationScheme val ATTRIBUTE_UNUSED) {
1049 }
1050 
1051 #ifdef LIBXML_CATALOG_ENABLED
1052 #define gen_nb_xmlCatalogAllow 4
gen_xmlCatalogAllow(int no,int nr ATTRIBUTE_UNUSED)1053 static xmlCatalogAllow gen_xmlCatalogAllow(int no, int nr ATTRIBUTE_UNUSED) {
1054     if (no == 1) return(XML_CATA_ALLOW_ALL);
1055     if (no == 2) return(XML_CATA_ALLOW_DOCUMENT);
1056     if (no == 3) return(XML_CATA_ALLOW_GLOBAL);
1057     if (no == 4) return(XML_CATA_ALLOW_NONE);
1058     return(0);
1059 }
1060 
des_xmlCatalogAllow(int no ATTRIBUTE_UNUSED,xmlCatalogAllow val ATTRIBUTE_UNUSED,int nr ATTRIBUTE_UNUSED)1061 static void des_xmlCatalogAllow(int no ATTRIBUTE_UNUSED, xmlCatalogAllow val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
1062 }
1063 
desret_xmlCatalogAllow(xmlCatalogAllow val ATTRIBUTE_UNUSED)1064 static void desret_xmlCatalogAllow(xmlCatalogAllow val ATTRIBUTE_UNUSED) {
1065 }
1066 
1067 #endif
1068 
1069 #ifdef LIBXML_CATALOG_ENABLED
1070 #define gen_nb_xmlCatalogPrefer 3
gen_xmlCatalogPrefer(int no,int nr ATTRIBUTE_UNUSED)1071 static xmlCatalogPrefer gen_xmlCatalogPrefer(int no, int nr ATTRIBUTE_UNUSED) {
1072     if (no == 1) return(XML_CATA_PREFER_NONE);
1073     if (no == 2) return(XML_CATA_PREFER_PUBLIC);
1074     if (no == 3) return(XML_CATA_PREFER_SYSTEM);
1075     return(0);
1076 }
1077 
des_xmlCatalogPrefer(int no ATTRIBUTE_UNUSED,xmlCatalogPrefer val ATTRIBUTE_UNUSED,int nr ATTRIBUTE_UNUSED)1078 static void des_xmlCatalogPrefer(int no ATTRIBUTE_UNUSED, xmlCatalogPrefer val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
1079 }
1080 
desret_xmlCatalogPrefer(xmlCatalogPrefer val ATTRIBUTE_UNUSED)1081 static void desret_xmlCatalogPrefer(xmlCatalogPrefer val ATTRIBUTE_UNUSED) {
1082 }
1083 
1084 #endif
1085 
1086 #define gen_nb_xmlElementContentType 4
gen_xmlElementContentType(int no,int nr ATTRIBUTE_UNUSED)1087 static xmlElementContentType gen_xmlElementContentType(int no, int nr ATTRIBUTE_UNUSED) {
1088     if (no == 1) return(XML_ELEMENT_CONTENT_ELEMENT);
1089     if (no == 2) return(XML_ELEMENT_CONTENT_OR);
1090     if (no == 3) return(XML_ELEMENT_CONTENT_PCDATA);
1091     if (no == 4) return(XML_ELEMENT_CONTENT_SEQ);
1092     return(0);
1093 }
1094 
des_xmlElementContentType(int no ATTRIBUTE_UNUSED,xmlElementContentType val ATTRIBUTE_UNUSED,int nr ATTRIBUTE_UNUSED)1095 static void des_xmlElementContentType(int no ATTRIBUTE_UNUSED, xmlElementContentType val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
1096 }
1097 
1098 #define gen_nb_xmlElementTypeVal 4
gen_xmlElementTypeVal(int no,int nr ATTRIBUTE_UNUSED)1099 static xmlElementTypeVal gen_xmlElementTypeVal(int no, int nr ATTRIBUTE_UNUSED) {
1100     if (no == 1) return(XML_ELEMENT_TYPE_ANY);
1101     if (no == 2) return(XML_ELEMENT_TYPE_ELEMENT);
1102     if (no == 3) return(XML_ELEMENT_TYPE_EMPTY);
1103     if (no == 4) return(XML_ELEMENT_TYPE_MIXED);
1104     return(0);
1105 }
1106 
des_xmlElementTypeVal(int no ATTRIBUTE_UNUSED,xmlElementTypeVal val ATTRIBUTE_UNUSED,int nr ATTRIBUTE_UNUSED)1107 static void des_xmlElementTypeVal(int no ATTRIBUTE_UNUSED, xmlElementTypeVal val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
1108 }
1109 
1110 #define gen_nb_xmlFeature 4
gen_xmlFeature(int no,int nr ATTRIBUTE_UNUSED)1111 static xmlFeature gen_xmlFeature(int no, int nr ATTRIBUTE_UNUSED) {
1112     if (no == 1) return(XML_WITH_AUTOMATA);
1113     if (no == 2) return(XML_WITH_C14N);
1114     if (no == 3) return(XML_WITH_CATALOG);
1115     if (no == 4) return(XML_WITH_DEBUG);
1116     return(0);
1117 }
1118 
des_xmlFeature(int no ATTRIBUTE_UNUSED,xmlFeature val ATTRIBUTE_UNUSED,int nr ATTRIBUTE_UNUSED)1119 static void des_xmlFeature(int no ATTRIBUTE_UNUSED, xmlFeature val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
1120 }
1121 
desret_xmlParserErrors(xmlParserErrors val ATTRIBUTE_UNUSED)1122 static void desret_xmlParserErrors(xmlParserErrors val ATTRIBUTE_UNUSED) {
1123 }
1124 
1125 #ifdef LIBXML_SCHEMAS_ENABLED
1126 #define gen_nb_xmlSchemaValType 4
gen_xmlSchemaValType(int no,int nr ATTRIBUTE_UNUSED)1127 static xmlSchemaValType gen_xmlSchemaValType(int no, int nr ATTRIBUTE_UNUSED) {
1128     if (no == 1) return(XML_SCHEMAS_ANYSIMPLETYPE);
1129     if (no == 2) return(XML_SCHEMAS_ANYTYPE);
1130     if (no == 3) return(XML_SCHEMAS_ANYURI);
1131     if (no == 4) return(XML_SCHEMAS_BASE64BINARY);
1132     return(0);
1133 }
1134 
des_xmlSchemaValType(int no ATTRIBUTE_UNUSED,xmlSchemaValType val ATTRIBUTE_UNUSED,int nr ATTRIBUTE_UNUSED)1135 static void des_xmlSchemaValType(int no ATTRIBUTE_UNUSED, xmlSchemaValType val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
1136 }
1137 
desret_xmlSchemaValType(xmlSchemaValType val ATTRIBUTE_UNUSED)1138 static void desret_xmlSchemaValType(xmlSchemaValType val ATTRIBUTE_UNUSED) {
1139 }
1140 
1141 #endif
1142 
1143 #ifdef LIBXML_SCHEMAS_ENABLED
1144 #define gen_nb_xmlSchemaWhitespaceValueType 4
gen_xmlSchemaWhitespaceValueType(int no,int nr ATTRIBUTE_UNUSED)1145 static xmlSchemaWhitespaceValueType gen_xmlSchemaWhitespaceValueType(int no, int nr ATTRIBUTE_UNUSED) {
1146     if (no == 1) return(XML_SCHEMA_WHITESPACE_COLLAPSE);
1147     if (no == 2) return(XML_SCHEMA_WHITESPACE_PRESERVE);
1148     if (no == 3) return(XML_SCHEMA_WHITESPACE_REPLACE);
1149     if (no == 4) return(XML_SCHEMA_WHITESPACE_UNKNOWN);
1150     return(0);
1151 }
1152 
des_xmlSchemaWhitespaceValueType(int no ATTRIBUTE_UNUSED,xmlSchemaWhitespaceValueType val ATTRIBUTE_UNUSED,int nr ATTRIBUTE_UNUSED)1153 static void des_xmlSchemaWhitespaceValueType(int no ATTRIBUTE_UNUSED, xmlSchemaWhitespaceValueType val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
1154 }
1155 
1156 #endif
1157 
1158 #include <libxml/HTMLparser.h>
1159 #include <libxml/HTMLtree.h>
1160 #include <libxml/SAX2.h>
1161 #include <libxml/c14n.h>
1162 #include <libxml/catalog.h>
1163 #include <libxml/chvalid.h>
1164 #include <libxml/debugXML.h>
1165 #include <libxml/dict.h>
1166 #include <libxml/encoding.h>
1167 #include <libxml/entities.h>
1168 #include <libxml/hash.h>
1169 #include <libxml/list.h>
1170 #include <libxml/nanoftp.h>
1171 #include <libxml/nanohttp.h>
1172 #include <libxml/parser.h>
1173 #include <libxml/parserInternals.h>
1174 #include <libxml/pattern.h>
1175 #include <libxml/relaxng.h>
1176 #include <libxml/schemasInternals.h>
1177 #include <libxml/schematron.h>
1178 #include <libxml/tree.h>
1179 #include <libxml/uri.h>
1180 #include <libxml/valid.h>
1181 #include <libxml/xinclude.h>
1182 #include <libxml/xmlIO.h>
1183 #include <libxml/xmlautomata.h>
1184 #include <libxml/xmlerror.h>
1185 #include <libxml/xmlmodule.h>
1186 #include <libxml/xmlreader.h>
1187 #include <libxml/xmlregexp.h>
1188 #include <libxml/xmlsave.h>
1189 #include <libxml/xmlschemas.h>
1190 #include <libxml/xmlschemastypes.h>
1191 #include <libxml/xmlstring.h>
1192 #include <libxml/xmlunicode.h>
1193 #include <libxml/xmlwriter.h>
1194 #include <libxml/xpath.h>
1195 #include <libxml/xpathInternals.h>
1196 #include <libxml/xpointer.h>
1197 static int test_HTMLparser(void);
1198 static int test_HTMLtree(void);
1199 static int test_SAX2(void);
1200 static int test_c14n(void);
1201 static int test_catalog(void);
1202 static int test_chvalid(void);
1203 static int test_debugXML(void);
1204 static int test_dict(void);
1205 static int test_encoding(void);
1206 static int test_entities(void);
1207 static int test_hash(void);
1208 static int test_list(void);
1209 static int test_nanoftp(void);
1210 static int test_nanohttp(void);
1211 static int test_parser(void);
1212 static int test_parserInternals(void);
1213 static int test_pattern(void);
1214 static int test_relaxng(void);
1215 static int test_schemasInternals(void);
1216 static int test_schematron(void);
1217 static int test_tree(void);
1218 static int test_uri(void);
1219 static int test_valid(void);
1220 static int test_xinclude(void);
1221 static int test_xmlIO(void);
1222 static int test_xmlautomata(void);
1223 static int test_xmlerror(void);
1224 static int test_xmlmodule(void);
1225 static int test_xmlreader(void);
1226 static int test_xmlregexp(void);
1227 static int test_xmlsave(void);
1228 static int test_xmlschemas(void);
1229 static int test_xmlschemastypes(void);
1230 static int test_xmlstring(void);
1231 static int test_xmlunicode(void);
1232 static int test_xmlwriter(void);
1233 static int test_xpath(void);
1234 static int test_xpathInternals(void);
1235 static int test_xpointer(void);
1236 
1237 /**
1238  * testlibxml2:
1239  *
1240  * Main entry point of the tester for the full libxml2 module,
1241  * it calls all the tester entry point for each module.
1242  *
1243  * Returns the number of error found
1244  */
1245 static int
testlibxml2(void)1246 testlibxml2(void)
1247 {
1248     int test_ret = 0;
1249 
1250     test_ret += test_HTMLparser();
1251     test_ret += test_HTMLtree();
1252     test_ret += test_SAX2();
1253     test_ret += test_c14n();
1254     test_ret += test_catalog();
1255     test_ret += test_chvalid();
1256     test_ret += test_debugXML();
1257     test_ret += test_dict();
1258     test_ret += test_encoding();
1259     test_ret += test_entities();
1260     test_ret += test_hash();
1261     test_ret += test_list();
1262     test_ret += test_nanoftp();
1263     test_ret += test_nanohttp();
1264     test_ret += test_parser();
1265     test_ret += test_parserInternals();
1266     test_ret += test_pattern();
1267     test_ret += test_relaxng();
1268     test_ret += test_schemasInternals();
1269     test_ret += test_schematron();
1270     test_ret += test_tree();
1271     test_ret += test_uri();
1272     test_ret += test_valid();
1273     test_ret += test_xinclude();
1274     test_ret += test_xmlIO();
1275     test_ret += test_xmlautomata();
1276     test_ret += test_xmlerror();
1277     test_ret += test_xmlmodule();
1278     test_ret += test_xmlreader();
1279     test_ret += test_xmlregexp();
1280     test_ret += test_xmlsave();
1281     test_ret += test_xmlschemas();
1282     test_ret += test_xmlschemastypes();
1283     test_ret += test_xmlstring();
1284     test_ret += test_xmlunicode();
1285     test_ret += test_xmlwriter();
1286     test_ret += test_xpath();
1287     test_ret += test_xpathInternals();
1288     test_ret += test_xpointer();
1289 
1290     printf("Total: %d functions, %d tests, %d errors\n",
1291            function_tests, call_tests, test_ret);
1292     return(test_ret);
1293 }
1294 
1295 
1296 static int
test_UTF8ToHtml(void)1297 test_UTF8ToHtml(void) {
1298     int test_ret = 0;
1299 
1300 #if defined(LIBXML_HTML_ENABLED)
1301     int mem_base;
1302     int ret_val;
1303     unsigned char * out; /* a pointer to an array of bytes to store the result */
1304     int n_out;
1305     int * outlen; /* the length of @out */
1306     int n_outlen;
1307     unsigned char * in; /* a pointer to an array of UTF-8 chars */
1308     int n_in;
1309     int * inlen; /* the length of @in */
1310     int n_inlen;
1311 
1312     for (n_out = 0;n_out < gen_nb_unsigned_char_ptr;n_out++) {
1313     for (n_outlen = 0;n_outlen < gen_nb_int_ptr;n_outlen++) {
1314     for (n_in = 0;n_in < gen_nb_const_unsigned_char_ptr;n_in++) {
1315     for (n_inlen = 0;n_inlen < gen_nb_int_ptr;n_inlen++) {
1316         mem_base = xmlMemBlocks();
1317         out = gen_unsigned_char_ptr(n_out, 0);
1318         outlen = gen_int_ptr(n_outlen, 1);
1319         in = gen_const_unsigned_char_ptr(n_in, 2);
1320         inlen = gen_int_ptr(n_inlen, 3);
1321 
1322         ret_val = UTF8ToHtml(out, outlen, (const unsigned char *)in, inlen);
1323         desret_int(ret_val);
1324         call_tests++;
1325         des_unsigned_char_ptr(n_out, out, 0);
1326         des_int_ptr(n_outlen, outlen, 1);
1327         des_const_unsigned_char_ptr(n_in, (const unsigned char *)in, 2);
1328         des_int_ptr(n_inlen, inlen, 3);
1329         xmlResetLastError();
1330         if (mem_base != xmlMemBlocks()) {
1331             printf("Leak of %d blocks found in UTF8ToHtml",
1332 	           xmlMemBlocks() - mem_base);
1333 	    test_ret++;
1334             printf(" %d", n_out);
1335             printf(" %d", n_outlen);
1336             printf(" %d", n_in);
1337             printf(" %d", n_inlen);
1338             printf("\n");
1339         }
1340     }
1341     }
1342     }
1343     }
1344     function_tests++;
1345 #endif
1346 
1347     return(test_ret);
1348 }
1349 
1350 #ifdef LIBXML_HTML_ENABLED
1351 
1352 #define gen_nb_const_htmlElemDesc_ptr 1
gen_const_htmlElemDesc_ptr(int no ATTRIBUTE_UNUSED,int nr ATTRIBUTE_UNUSED)1353 static htmlElemDesc * gen_const_htmlElemDesc_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
1354     return(NULL);
1355 }
des_const_htmlElemDesc_ptr(int no ATTRIBUTE_UNUSED,const htmlElemDesc * val ATTRIBUTE_UNUSED,int nr ATTRIBUTE_UNUSED)1356 static void des_const_htmlElemDesc_ptr(int no ATTRIBUTE_UNUSED, const htmlElemDesc * val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
1357 }
1358 #endif
1359 
1360 
1361 static int
test_htmlAttrAllowed(void)1362 test_htmlAttrAllowed(void) {
1363     int test_ret = 0;
1364 
1365 #if defined(LIBXML_HTML_ENABLED)
1366     int mem_base;
1367     htmlStatus ret_val;
1368     htmlElemDesc * elt; /* HTML element */
1369     int n_elt;
1370     xmlChar * attr; /* HTML attribute */
1371     int n_attr;
1372     int legacy; /* whether to allow deprecated attributes */
1373     int n_legacy;
1374 
1375     for (n_elt = 0;n_elt < gen_nb_const_htmlElemDesc_ptr;n_elt++) {
1376     for (n_attr = 0;n_attr < gen_nb_const_xmlChar_ptr;n_attr++) {
1377     for (n_legacy = 0;n_legacy < gen_nb_int;n_legacy++) {
1378         mem_base = xmlMemBlocks();
1379         elt = gen_const_htmlElemDesc_ptr(n_elt, 0);
1380         attr = gen_const_xmlChar_ptr(n_attr, 1);
1381         legacy = gen_int(n_legacy, 2);
1382 
1383         ret_val = htmlAttrAllowed((const htmlElemDesc *)elt, (const xmlChar *)attr, legacy);
1384         desret_htmlStatus(ret_val);
1385         call_tests++;
1386         des_const_htmlElemDesc_ptr(n_elt, (const htmlElemDesc *)elt, 0);
1387         des_const_xmlChar_ptr(n_attr, (const xmlChar *)attr, 1);
1388         des_int(n_legacy, legacy, 2);
1389         xmlResetLastError();
1390         if (mem_base != xmlMemBlocks()) {
1391             printf("Leak of %d blocks found in htmlAttrAllowed",
1392 	           xmlMemBlocks() - mem_base);
1393 	    test_ret++;
1394             printf(" %d", n_elt);
1395             printf(" %d", n_attr);
1396             printf(" %d", n_legacy);
1397             printf("\n");
1398         }
1399     }
1400     }
1401     }
1402     function_tests++;
1403 #endif
1404 
1405     return(test_ret);
1406 }
1407 
1408 #ifdef LIBXML_HTML_ENABLED
1409 
1410 #define gen_nb_htmlNodePtr 1
gen_htmlNodePtr(int no ATTRIBUTE_UNUSED,int nr ATTRIBUTE_UNUSED)1411 static htmlNodePtr gen_htmlNodePtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
1412     return(NULL);
1413 }
des_htmlNodePtr(int no ATTRIBUTE_UNUSED,htmlNodePtr val ATTRIBUTE_UNUSED,int nr ATTRIBUTE_UNUSED)1414 static void des_htmlNodePtr(int no ATTRIBUTE_UNUSED, htmlNodePtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
1415 }
1416 #endif
1417 
1418 
1419 static int
test_htmlAutoCloseTag(void)1420 test_htmlAutoCloseTag(void) {
1421     int test_ret = 0;
1422 
1423 #if defined(LIBXML_HTML_ENABLED)
1424     int mem_base;
1425     int ret_val;
1426     htmlDocPtr doc; /* the HTML document */
1427     int n_doc;
1428     xmlChar * name; /* The tag name */
1429     int n_name;
1430     htmlNodePtr elem; /* the HTML element */
1431     int n_elem;
1432 
1433     for (n_doc = 0;n_doc < gen_nb_htmlDocPtr;n_doc++) {
1434     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
1435     for (n_elem = 0;n_elem < gen_nb_htmlNodePtr;n_elem++) {
1436         mem_base = xmlMemBlocks();
1437         doc = gen_htmlDocPtr(n_doc, 0);
1438         name = gen_const_xmlChar_ptr(n_name, 1);
1439         elem = gen_htmlNodePtr(n_elem, 2);
1440 
1441         ret_val = htmlAutoCloseTag(doc, (const xmlChar *)name, elem);
1442         desret_int(ret_val);
1443         call_tests++;
1444         des_htmlDocPtr(n_doc, doc, 0);
1445         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
1446         des_htmlNodePtr(n_elem, elem, 2);
1447         xmlResetLastError();
1448         if (mem_base != xmlMemBlocks()) {
1449             printf("Leak of %d blocks found in htmlAutoCloseTag",
1450 	           xmlMemBlocks() - mem_base);
1451 	    test_ret++;
1452             printf(" %d", n_doc);
1453             printf(" %d", n_name);
1454             printf(" %d", n_elem);
1455             printf("\n");
1456         }
1457     }
1458     }
1459     }
1460     function_tests++;
1461 #endif
1462 
1463     return(test_ret);
1464 }
1465 
1466 
1467 static int
test_htmlCreateMemoryParserCtxt(void)1468 test_htmlCreateMemoryParserCtxt(void) {
1469     int test_ret = 0;
1470 
1471 #if defined(LIBXML_HTML_ENABLED)
1472     int mem_base;
1473     htmlParserCtxtPtr ret_val;
1474     char * buffer; /* a pointer to a char array */
1475     int n_buffer;
1476     int size; /* the size of the array */
1477     int n_size;
1478 
1479     for (n_buffer = 0;n_buffer < gen_nb_const_char_ptr;n_buffer++) {
1480     for (n_size = 0;n_size < gen_nb_int;n_size++) {
1481         mem_base = xmlMemBlocks();
1482         buffer = gen_const_char_ptr(n_buffer, 0);
1483         size = gen_int(n_size, 1);
1484         if ((buffer != NULL) &&
1485             (size > (int) strlen((const char *) buffer) + 1))
1486             continue;
1487 
1488         ret_val = htmlCreateMemoryParserCtxt((const char *)buffer, size);
1489         desret_htmlParserCtxtPtr(ret_val);
1490         call_tests++;
1491         des_const_char_ptr(n_buffer, (const char *)buffer, 0);
1492         des_int(n_size, size, 1);
1493         xmlResetLastError();
1494         if (mem_base != xmlMemBlocks()) {
1495             printf("Leak of %d blocks found in htmlCreateMemoryParserCtxt",
1496 	           xmlMemBlocks() - mem_base);
1497 	    test_ret++;
1498             printf(" %d", n_buffer);
1499             printf(" %d", n_size);
1500             printf("\n");
1501         }
1502     }
1503     }
1504     function_tests++;
1505 #endif
1506 
1507     return(test_ret);
1508 }
1509 
1510 #ifdef LIBXML_HTML_ENABLED
1511 
1512 #define gen_nb_htmlSAXHandlerPtr 1
gen_htmlSAXHandlerPtr(int no ATTRIBUTE_UNUSED,int nr ATTRIBUTE_UNUSED)1513 static htmlSAXHandlerPtr gen_htmlSAXHandlerPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
1514     return(NULL);
1515 }
des_htmlSAXHandlerPtr(int no ATTRIBUTE_UNUSED,htmlSAXHandlerPtr val ATTRIBUTE_UNUSED,int nr ATTRIBUTE_UNUSED)1516 static void des_htmlSAXHandlerPtr(int no ATTRIBUTE_UNUSED, htmlSAXHandlerPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
1517 }
1518 #endif
1519 
1520 
1521 static int
test_htmlCreatePushParserCtxt(void)1522 test_htmlCreatePushParserCtxt(void) {
1523     int test_ret = 0;
1524 
1525 #if defined(LIBXML_HTML_ENABLED) && defined(LIBXML_PUSH_ENABLED)
1526     int mem_base;
1527     htmlParserCtxtPtr ret_val;
1528     htmlSAXHandlerPtr sax; /* a SAX handler */
1529     int n_sax;
1530     void * user_data; /* The user data returned on SAX callbacks */
1531     int n_user_data;
1532     char * chunk; /* a pointer to an array of chars */
1533     int n_chunk;
1534     int size; /* number of chars in the array */
1535     int n_size;
1536     const char * filename; /* an optional file name or URI */
1537     int n_filename;
1538     xmlCharEncoding enc; /* an optional encoding */
1539     int n_enc;
1540 
1541     for (n_sax = 0;n_sax < gen_nb_htmlSAXHandlerPtr;n_sax++) {
1542     for (n_user_data = 0;n_user_data < gen_nb_userdata;n_user_data++) {
1543     for (n_chunk = 0;n_chunk < gen_nb_const_char_ptr;n_chunk++) {
1544     for (n_size = 0;n_size < gen_nb_int;n_size++) {
1545     for (n_filename = 0;n_filename < gen_nb_fileoutput;n_filename++) {
1546     for (n_enc = 0;n_enc < gen_nb_xmlCharEncoding;n_enc++) {
1547         mem_base = xmlMemBlocks();
1548         sax = gen_htmlSAXHandlerPtr(n_sax, 0);
1549         user_data = gen_userdata(n_user_data, 1);
1550         chunk = gen_const_char_ptr(n_chunk, 2);
1551         size = gen_int(n_size, 3);
1552         filename = gen_fileoutput(n_filename, 4);
1553         enc = gen_xmlCharEncoding(n_enc, 5);
1554         if ((chunk != NULL) &&
1555             (size > (int) strlen((const char *) chunk) + 1))
1556             continue;
1557 
1558         ret_val = htmlCreatePushParserCtxt(sax, user_data, (const char *)chunk, size, filename, enc);
1559         desret_htmlParserCtxtPtr(ret_val);
1560         call_tests++;
1561         des_htmlSAXHandlerPtr(n_sax, sax, 0);
1562         des_userdata(n_user_data, user_data, 1);
1563         des_const_char_ptr(n_chunk, (const char *)chunk, 2);
1564         des_int(n_size, size, 3);
1565         des_fileoutput(n_filename, filename, 4);
1566         des_xmlCharEncoding(n_enc, enc, 5);
1567         xmlResetLastError();
1568         if (mem_base != xmlMemBlocks()) {
1569             printf("Leak of %d blocks found in htmlCreatePushParserCtxt",
1570 	           xmlMemBlocks() - mem_base);
1571 	    test_ret++;
1572             printf(" %d", n_sax);
1573             printf(" %d", n_user_data);
1574             printf(" %d", n_chunk);
1575             printf(" %d", n_size);
1576             printf(" %d", n_filename);
1577             printf(" %d", n_enc);
1578             printf("\n");
1579         }
1580     }
1581     }
1582     }
1583     }
1584     }
1585     }
1586     function_tests++;
1587 #endif
1588 
1589     return(test_ret);
1590 }
1591 
1592 
1593 static int
test_htmlCtxtReadDoc(void)1594 test_htmlCtxtReadDoc(void) {
1595     int test_ret = 0;
1596 
1597 #if defined(LIBXML_HTML_ENABLED)
1598     int mem_base;
1599     htmlDocPtr ret_val;
1600     htmlParserCtxtPtr ctxt; /* an HTML parser context */
1601     int n_ctxt;
1602     xmlChar * cur; /* a pointer to a zero terminated string */
1603     int n_cur;
1604     const char * URL; /* the base URL to use for the document */
1605     int n_URL;
1606     char * encoding; /* the document encoding, or NULL */
1607     int n_encoding;
1608     int options; /* a combination of htmlParserOption(s) */
1609     int n_options;
1610 
1611     for (n_ctxt = 0;n_ctxt < gen_nb_htmlParserCtxtPtr;n_ctxt++) {
1612     for (n_cur = 0;n_cur < gen_nb_const_xmlChar_ptr;n_cur++) {
1613     for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) {
1614     for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
1615     for (n_options = 0;n_options < gen_nb_int;n_options++) {
1616         mem_base = xmlMemBlocks();
1617         ctxt = gen_htmlParserCtxtPtr(n_ctxt, 0);
1618         cur = gen_const_xmlChar_ptr(n_cur, 1);
1619         URL = gen_filepath(n_URL, 2);
1620         encoding = gen_const_char_ptr(n_encoding, 3);
1621         options = gen_int(n_options, 4);
1622 
1623         ret_val = htmlCtxtReadDoc(ctxt, (const xmlChar *)cur, URL, (const char *)encoding, options);
1624         desret_htmlDocPtr(ret_val);
1625         call_tests++;
1626         des_htmlParserCtxtPtr(n_ctxt, ctxt, 0);
1627         des_const_xmlChar_ptr(n_cur, (const xmlChar *)cur, 1);
1628         des_filepath(n_URL, URL, 2);
1629         des_const_char_ptr(n_encoding, (const char *)encoding, 3);
1630         des_int(n_options, options, 4);
1631         xmlResetLastError();
1632         if (mem_base != xmlMemBlocks()) {
1633             printf("Leak of %d blocks found in htmlCtxtReadDoc",
1634 	           xmlMemBlocks() - mem_base);
1635 	    test_ret++;
1636             printf(" %d", n_ctxt);
1637             printf(" %d", n_cur);
1638             printf(" %d", n_URL);
1639             printf(" %d", n_encoding);
1640             printf(" %d", n_options);
1641             printf("\n");
1642         }
1643     }
1644     }
1645     }
1646     }
1647     }
1648     function_tests++;
1649 #endif
1650 
1651     return(test_ret);
1652 }
1653 
1654 
1655 static int
test_htmlCtxtReadFile(void)1656 test_htmlCtxtReadFile(void) {
1657     int test_ret = 0;
1658 
1659 #if defined(LIBXML_HTML_ENABLED)
1660     htmlDocPtr ret_val;
1661     htmlParserCtxtPtr ctxt; /* an HTML parser context */
1662     int n_ctxt;
1663     const char * filename; /* a file or URL */
1664     int n_filename;
1665     char * encoding; /* the document encoding, or NULL */
1666     int n_encoding;
1667     int options; /* a combination of htmlParserOption(s) */
1668     int n_options;
1669 
1670     for (n_ctxt = 0;n_ctxt < gen_nb_htmlParserCtxtPtr;n_ctxt++) {
1671     for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
1672     for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
1673     for (n_options = 0;n_options < gen_nb_int;n_options++) {
1674         ctxt = gen_htmlParserCtxtPtr(n_ctxt, 0);
1675         filename = gen_filepath(n_filename, 1);
1676         encoding = gen_const_char_ptr(n_encoding, 2);
1677         options = gen_int(n_options, 3);
1678 
1679         ret_val = htmlCtxtReadFile(ctxt, filename, (const char *)encoding, options);
1680         desret_htmlDocPtr(ret_val);
1681         call_tests++;
1682         des_htmlParserCtxtPtr(n_ctxt, ctxt, 0);
1683         des_filepath(n_filename, filename, 1);
1684         des_const_char_ptr(n_encoding, (const char *)encoding, 2);
1685         des_int(n_options, options, 3);
1686         xmlResetLastError();
1687     }
1688     }
1689     }
1690     }
1691     function_tests++;
1692 #endif
1693 
1694     return(test_ret);
1695 }
1696 
1697 
1698 static int
test_htmlCtxtReadMemory(void)1699 test_htmlCtxtReadMemory(void) {
1700     int test_ret = 0;
1701 
1702 #if defined(LIBXML_HTML_ENABLED)
1703     int mem_base;
1704     htmlDocPtr ret_val;
1705     htmlParserCtxtPtr ctxt; /* an HTML parser context */
1706     int n_ctxt;
1707     char * buffer; /* a pointer to a char array */
1708     int n_buffer;
1709     int size; /* the size of the array */
1710     int n_size;
1711     const char * URL; /* the base URL to use for the document */
1712     int n_URL;
1713     char * encoding; /* the document encoding, or NULL */
1714     int n_encoding;
1715     int options; /* a combination of htmlParserOption(s) */
1716     int n_options;
1717 
1718     for (n_ctxt = 0;n_ctxt < gen_nb_htmlParserCtxtPtr;n_ctxt++) {
1719     for (n_buffer = 0;n_buffer < gen_nb_const_char_ptr;n_buffer++) {
1720     for (n_size = 0;n_size < gen_nb_int;n_size++) {
1721     for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) {
1722     for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
1723     for (n_options = 0;n_options < gen_nb_int;n_options++) {
1724         mem_base = xmlMemBlocks();
1725         ctxt = gen_htmlParserCtxtPtr(n_ctxt, 0);
1726         buffer = gen_const_char_ptr(n_buffer, 1);
1727         size = gen_int(n_size, 2);
1728         URL = gen_filepath(n_URL, 3);
1729         encoding = gen_const_char_ptr(n_encoding, 4);
1730         options = gen_int(n_options, 5);
1731         if ((buffer != NULL) &&
1732             (size > (int) strlen((const char *) buffer) + 1))
1733             continue;
1734 
1735         ret_val = htmlCtxtReadMemory(ctxt, (const char *)buffer, size, URL, (const char *)encoding, options);
1736         desret_htmlDocPtr(ret_val);
1737         call_tests++;
1738         des_htmlParserCtxtPtr(n_ctxt, ctxt, 0);
1739         des_const_char_ptr(n_buffer, (const char *)buffer, 1);
1740         des_int(n_size, size, 2);
1741         des_filepath(n_URL, URL, 3);
1742         des_const_char_ptr(n_encoding, (const char *)encoding, 4);
1743         des_int(n_options, options, 5);
1744         xmlResetLastError();
1745         if (mem_base != xmlMemBlocks()) {
1746             printf("Leak of %d blocks found in htmlCtxtReadMemory",
1747 	           xmlMemBlocks() - mem_base);
1748 	    test_ret++;
1749             printf(" %d", n_ctxt);
1750             printf(" %d", n_buffer);
1751             printf(" %d", n_size);
1752             printf(" %d", n_URL);
1753             printf(" %d", n_encoding);
1754             printf(" %d", n_options);
1755             printf("\n");
1756         }
1757     }
1758     }
1759     }
1760     }
1761     }
1762     }
1763     function_tests++;
1764 #endif
1765 
1766     return(test_ret);
1767 }
1768 
1769 
1770 static int
test_htmlCtxtReset(void)1771 test_htmlCtxtReset(void) {
1772     int test_ret = 0;
1773 
1774 #if defined(LIBXML_HTML_ENABLED)
1775     int mem_base;
1776     htmlParserCtxtPtr ctxt; /* an HTML parser context */
1777     int n_ctxt;
1778 
1779     for (n_ctxt = 0;n_ctxt < gen_nb_htmlParserCtxtPtr;n_ctxt++) {
1780         mem_base = xmlMemBlocks();
1781         ctxt = gen_htmlParserCtxtPtr(n_ctxt, 0);
1782 
1783         htmlCtxtReset(ctxt);
1784         call_tests++;
1785         des_htmlParserCtxtPtr(n_ctxt, ctxt, 0);
1786         xmlResetLastError();
1787         if (mem_base != xmlMemBlocks()) {
1788             printf("Leak of %d blocks found in htmlCtxtReset",
1789 	           xmlMemBlocks() - mem_base);
1790 	    test_ret++;
1791             printf(" %d", n_ctxt);
1792             printf("\n");
1793         }
1794     }
1795     function_tests++;
1796 #endif
1797 
1798     return(test_ret);
1799 }
1800 
1801 
1802 static int
test_htmlCtxtUseOptions(void)1803 test_htmlCtxtUseOptions(void) {
1804     int test_ret = 0;
1805 
1806 #if defined(LIBXML_HTML_ENABLED)
1807     int mem_base;
1808     int ret_val;
1809     htmlParserCtxtPtr ctxt; /* an HTML parser context */
1810     int n_ctxt;
1811     int options; /* a combination of htmlParserOption(s) */
1812     int n_options;
1813 
1814     for (n_ctxt = 0;n_ctxt < gen_nb_htmlParserCtxtPtr;n_ctxt++) {
1815     for (n_options = 0;n_options < gen_nb_int;n_options++) {
1816         mem_base = xmlMemBlocks();
1817         ctxt = gen_htmlParserCtxtPtr(n_ctxt, 0);
1818         options = gen_int(n_options, 1);
1819 
1820         ret_val = htmlCtxtUseOptions(ctxt, options);
1821         desret_int(ret_val);
1822         call_tests++;
1823         des_htmlParserCtxtPtr(n_ctxt, ctxt, 0);
1824         des_int(n_options, options, 1);
1825         xmlResetLastError();
1826         if (mem_base != xmlMemBlocks()) {
1827             printf("Leak of %d blocks found in htmlCtxtUseOptions",
1828 	           xmlMemBlocks() - mem_base);
1829 	    test_ret++;
1830             printf(" %d", n_ctxt);
1831             printf(" %d", n_options);
1832             printf("\n");
1833         }
1834     }
1835     }
1836     function_tests++;
1837 #endif
1838 
1839     return(test_ret);
1840 }
1841 
1842 
1843 static int
test_htmlElementAllowedHere(void)1844 test_htmlElementAllowedHere(void) {
1845     int test_ret = 0;
1846 
1847 #if defined(LIBXML_HTML_ENABLED)
1848     int mem_base;
1849     int ret_val;
1850     htmlElemDesc * parent; /* HTML parent element */
1851     int n_parent;
1852     xmlChar * elt; /* HTML element */
1853     int n_elt;
1854 
1855     for (n_parent = 0;n_parent < gen_nb_const_htmlElemDesc_ptr;n_parent++) {
1856     for (n_elt = 0;n_elt < gen_nb_const_xmlChar_ptr;n_elt++) {
1857         mem_base = xmlMemBlocks();
1858         parent = gen_const_htmlElemDesc_ptr(n_parent, 0);
1859         elt = gen_const_xmlChar_ptr(n_elt, 1);
1860 
1861         ret_val = htmlElementAllowedHere((const htmlElemDesc *)parent, (const xmlChar *)elt);
1862         desret_int(ret_val);
1863         call_tests++;
1864         des_const_htmlElemDesc_ptr(n_parent, (const htmlElemDesc *)parent, 0);
1865         des_const_xmlChar_ptr(n_elt, (const xmlChar *)elt, 1);
1866         xmlResetLastError();
1867         if (mem_base != xmlMemBlocks()) {
1868             printf("Leak of %d blocks found in htmlElementAllowedHere",
1869 	           xmlMemBlocks() - mem_base);
1870 	    test_ret++;
1871             printf(" %d", n_parent);
1872             printf(" %d", n_elt);
1873             printf("\n");
1874         }
1875     }
1876     }
1877     function_tests++;
1878 #endif
1879 
1880     return(test_ret);
1881 }
1882 
1883 
1884 static int
test_htmlElementStatusHere(void)1885 test_htmlElementStatusHere(void) {
1886     int test_ret = 0;
1887 
1888 #if defined(LIBXML_HTML_ENABLED)
1889     int mem_base;
1890     htmlStatus ret_val;
1891     htmlElemDesc * parent; /* HTML parent element */
1892     int n_parent;
1893     htmlElemDesc * elt; /* HTML element */
1894     int n_elt;
1895 
1896     for (n_parent = 0;n_parent < gen_nb_const_htmlElemDesc_ptr;n_parent++) {
1897     for (n_elt = 0;n_elt < gen_nb_const_htmlElemDesc_ptr;n_elt++) {
1898         mem_base = xmlMemBlocks();
1899         parent = gen_const_htmlElemDesc_ptr(n_parent, 0);
1900         elt = gen_const_htmlElemDesc_ptr(n_elt, 1);
1901 
1902         ret_val = htmlElementStatusHere((const htmlElemDesc *)parent, (const htmlElemDesc *)elt);
1903         desret_htmlStatus(ret_val);
1904         call_tests++;
1905         des_const_htmlElemDesc_ptr(n_parent, (const htmlElemDesc *)parent, 0);
1906         des_const_htmlElemDesc_ptr(n_elt, (const htmlElemDesc *)elt, 1);
1907         xmlResetLastError();
1908         if (mem_base != xmlMemBlocks()) {
1909             printf("Leak of %d blocks found in htmlElementStatusHere",
1910 	           xmlMemBlocks() - mem_base);
1911 	    test_ret++;
1912             printf(" %d", n_parent);
1913             printf(" %d", n_elt);
1914             printf("\n");
1915         }
1916     }
1917     }
1918     function_tests++;
1919 #endif
1920 
1921     return(test_ret);
1922 }
1923 
1924 
1925 static int
test_htmlEncodeEntities(void)1926 test_htmlEncodeEntities(void) {
1927     int test_ret = 0;
1928 
1929 #if defined(LIBXML_HTML_ENABLED)
1930     int mem_base;
1931     int ret_val;
1932     unsigned char * out; /* a pointer to an array of bytes to store the result */
1933     int n_out;
1934     int * outlen; /* the length of @out */
1935     int n_outlen;
1936     unsigned char * in; /* a pointer to an array of UTF-8 chars */
1937     int n_in;
1938     int * inlen; /* the length of @in */
1939     int n_inlen;
1940     int quoteChar; /* the quote character to escape (' or ") or zero. */
1941     int n_quoteChar;
1942 
1943     for (n_out = 0;n_out < gen_nb_unsigned_char_ptr;n_out++) {
1944     for (n_outlen = 0;n_outlen < gen_nb_int_ptr;n_outlen++) {
1945     for (n_in = 0;n_in < gen_nb_const_unsigned_char_ptr;n_in++) {
1946     for (n_inlen = 0;n_inlen < gen_nb_int_ptr;n_inlen++) {
1947     for (n_quoteChar = 0;n_quoteChar < gen_nb_int;n_quoteChar++) {
1948         mem_base = xmlMemBlocks();
1949         out = gen_unsigned_char_ptr(n_out, 0);
1950         outlen = gen_int_ptr(n_outlen, 1);
1951         in = gen_const_unsigned_char_ptr(n_in, 2);
1952         inlen = gen_int_ptr(n_inlen, 3);
1953         quoteChar = gen_int(n_quoteChar, 4);
1954 
1955         ret_val = htmlEncodeEntities(out, outlen, (const unsigned char *)in, inlen, quoteChar);
1956         desret_int(ret_val);
1957         call_tests++;
1958         des_unsigned_char_ptr(n_out, out, 0);
1959         des_int_ptr(n_outlen, outlen, 1);
1960         des_const_unsigned_char_ptr(n_in, (const unsigned char *)in, 2);
1961         des_int_ptr(n_inlen, inlen, 3);
1962         des_int(n_quoteChar, quoteChar, 4);
1963         xmlResetLastError();
1964         if (mem_base != xmlMemBlocks()) {
1965             printf("Leak of %d blocks found in htmlEncodeEntities",
1966 	           xmlMemBlocks() - mem_base);
1967 	    test_ret++;
1968             printf(" %d", n_out);
1969             printf(" %d", n_outlen);
1970             printf(" %d", n_in);
1971             printf(" %d", n_inlen);
1972             printf(" %d", n_quoteChar);
1973             printf("\n");
1974         }
1975     }
1976     }
1977     }
1978     }
1979     }
1980     function_tests++;
1981 #endif
1982 
1983     return(test_ret);
1984 }
1985 
1986 
1987 static int
test_htmlEntityLookup(void)1988 test_htmlEntityLookup(void) {
1989     int test_ret = 0;
1990 
1991 #if defined(LIBXML_HTML_ENABLED)
1992     int mem_base;
1993     const htmlEntityDesc * ret_val;
1994     xmlChar * name; /* the entity name */
1995     int n_name;
1996 
1997     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
1998         mem_base = xmlMemBlocks();
1999         name = gen_const_xmlChar_ptr(n_name, 0);
2000 
2001         ret_val = htmlEntityLookup((const xmlChar *)name);
2002         desret_const_htmlEntityDesc_ptr(ret_val);
2003         call_tests++;
2004         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 0);
2005         xmlResetLastError();
2006         if (mem_base != xmlMemBlocks()) {
2007             printf("Leak of %d blocks found in htmlEntityLookup",
2008 	           xmlMemBlocks() - mem_base);
2009 	    test_ret++;
2010             printf(" %d", n_name);
2011             printf("\n");
2012         }
2013     }
2014     function_tests++;
2015 #endif
2016 
2017     return(test_ret);
2018 }
2019 
2020 
2021 static int
test_htmlEntityValueLookup(void)2022 test_htmlEntityValueLookup(void) {
2023     int test_ret = 0;
2024 
2025 #if defined(LIBXML_HTML_ENABLED)
2026     int mem_base;
2027     const htmlEntityDesc * ret_val;
2028     unsigned int value; /* the entity's unicode value */
2029     int n_value;
2030 
2031     for (n_value = 0;n_value < gen_nb_unsigned_int;n_value++) {
2032         mem_base = xmlMemBlocks();
2033         value = gen_unsigned_int(n_value, 0);
2034 
2035         ret_val = htmlEntityValueLookup(value);
2036         desret_const_htmlEntityDesc_ptr(ret_val);
2037         call_tests++;
2038         des_unsigned_int(n_value, value, 0);
2039         xmlResetLastError();
2040         if (mem_base != xmlMemBlocks()) {
2041             printf("Leak of %d blocks found in htmlEntityValueLookup",
2042 	           xmlMemBlocks() - mem_base);
2043 	    test_ret++;
2044             printf(" %d", n_value);
2045             printf("\n");
2046         }
2047     }
2048     function_tests++;
2049 #endif
2050 
2051     return(test_ret);
2052 }
2053 
2054 
2055 static int
test_htmlHandleOmittedElem(void)2056 test_htmlHandleOmittedElem(void) {
2057     int test_ret = 0;
2058 
2059 #if defined(LIBXML_HTML_ENABLED)
2060     int mem_base;
2061     int ret_val;
2062     int val; /* int 0 or 1 */
2063     int n_val;
2064 
2065     for (n_val = 0;n_val < gen_nb_int;n_val++) {
2066         mem_base = xmlMemBlocks();
2067         val = gen_int(n_val, 0);
2068 
2069         ret_val = htmlHandleOmittedElem(val);
2070         desret_int(ret_val);
2071         call_tests++;
2072         des_int(n_val, val, 0);
2073         xmlResetLastError();
2074         if (mem_base != xmlMemBlocks()) {
2075             printf("Leak of %d blocks found in htmlHandleOmittedElem",
2076 	           xmlMemBlocks() - mem_base);
2077 	    test_ret++;
2078             printf(" %d", n_val);
2079             printf("\n");
2080         }
2081     }
2082     function_tests++;
2083 #endif
2084 
2085     return(test_ret);
2086 }
2087 
2088 
2089 static int
test_htmlIsAutoClosed(void)2090 test_htmlIsAutoClosed(void) {
2091     int test_ret = 0;
2092 
2093 #if defined(LIBXML_HTML_ENABLED)
2094     int mem_base;
2095     int ret_val;
2096     htmlDocPtr doc; /* the HTML document */
2097     int n_doc;
2098     htmlNodePtr elem; /* the HTML element */
2099     int n_elem;
2100 
2101     for (n_doc = 0;n_doc < gen_nb_htmlDocPtr;n_doc++) {
2102     for (n_elem = 0;n_elem < gen_nb_htmlNodePtr;n_elem++) {
2103         mem_base = xmlMemBlocks();
2104         doc = gen_htmlDocPtr(n_doc, 0);
2105         elem = gen_htmlNodePtr(n_elem, 1);
2106 
2107         ret_val = htmlIsAutoClosed(doc, elem);
2108         desret_int(ret_val);
2109         call_tests++;
2110         des_htmlDocPtr(n_doc, doc, 0);
2111         des_htmlNodePtr(n_elem, elem, 1);
2112         xmlResetLastError();
2113         if (mem_base != xmlMemBlocks()) {
2114             printf("Leak of %d blocks found in htmlIsAutoClosed",
2115 	           xmlMemBlocks() - mem_base);
2116 	    test_ret++;
2117             printf(" %d", n_doc);
2118             printf(" %d", n_elem);
2119             printf("\n");
2120         }
2121     }
2122     }
2123     function_tests++;
2124 #endif
2125 
2126     return(test_ret);
2127 }
2128 
2129 
2130 static int
test_htmlIsScriptAttribute(void)2131 test_htmlIsScriptAttribute(void) {
2132     int test_ret = 0;
2133 
2134 #if defined(LIBXML_HTML_ENABLED)
2135     int mem_base;
2136     int ret_val;
2137     xmlChar * name; /* an attribute name */
2138     int n_name;
2139 
2140     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
2141         mem_base = xmlMemBlocks();
2142         name = gen_const_xmlChar_ptr(n_name, 0);
2143 
2144         ret_val = htmlIsScriptAttribute((const xmlChar *)name);
2145         desret_int(ret_val);
2146         call_tests++;
2147         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 0);
2148         xmlResetLastError();
2149         if (mem_base != xmlMemBlocks()) {
2150             printf("Leak of %d blocks found in htmlIsScriptAttribute",
2151 	           xmlMemBlocks() - mem_base);
2152 	    test_ret++;
2153             printf(" %d", n_name);
2154             printf("\n");
2155         }
2156     }
2157     function_tests++;
2158 #endif
2159 
2160     return(test_ret);
2161 }
2162 
2163 
2164 static int
test_htmlNewParserCtxt(void)2165 test_htmlNewParserCtxt(void) {
2166     int test_ret = 0;
2167 
2168 #if defined(LIBXML_HTML_ENABLED)
2169     int mem_base;
2170     htmlParserCtxtPtr ret_val;
2171 
2172         mem_base = xmlMemBlocks();
2173 
2174         ret_val = htmlNewParserCtxt();
2175         desret_htmlParserCtxtPtr(ret_val);
2176         call_tests++;
2177         xmlResetLastError();
2178         if (mem_base != xmlMemBlocks()) {
2179             printf("Leak of %d blocks found in htmlNewParserCtxt",
2180 	           xmlMemBlocks() - mem_base);
2181 	    test_ret++;
2182             printf("\n");
2183         }
2184     function_tests++;
2185 #endif
2186 
2187     return(test_ret);
2188 }
2189 
2190 
2191 static int
test_htmlNodeStatus(void)2192 test_htmlNodeStatus(void) {
2193     int test_ret = 0;
2194 
2195 #if defined(LIBXML_HTML_ENABLED)
2196     int mem_base;
2197     htmlStatus ret_val;
2198     htmlNodePtr node; /* an htmlNodePtr in a tree */
2199     int n_node;
2200     int legacy; /* whether to allow deprecated elements (YES is faster here for Element nodes) */
2201     int n_legacy;
2202 
2203     for (n_node = 0;n_node < gen_nb_const_htmlNodePtr;n_node++) {
2204     for (n_legacy = 0;n_legacy < gen_nb_int;n_legacy++) {
2205         mem_base = xmlMemBlocks();
2206         node = gen_const_htmlNodePtr(n_node, 0);
2207         legacy = gen_int(n_legacy, 1);
2208 
2209         ret_val = htmlNodeStatus((const htmlNodePtr)node, legacy);
2210         desret_htmlStatus(ret_val);
2211         call_tests++;
2212         des_const_htmlNodePtr(n_node, (const htmlNodePtr)node, 0);
2213         des_int(n_legacy, legacy, 1);
2214         xmlResetLastError();
2215         if (mem_base != xmlMemBlocks()) {
2216             printf("Leak of %d blocks found in htmlNodeStatus",
2217 	           xmlMemBlocks() - mem_base);
2218 	    test_ret++;
2219             printf(" %d", n_node);
2220             printf(" %d", n_legacy);
2221             printf("\n");
2222         }
2223     }
2224     }
2225     function_tests++;
2226 #endif
2227 
2228     return(test_ret);
2229 }
2230 
2231 
2232 static int
test_htmlParseCharRef(void)2233 test_htmlParseCharRef(void) {
2234     int test_ret = 0;
2235 
2236 #if defined(LIBXML_HTML_ENABLED)
2237     int mem_base;
2238     int ret_val;
2239     htmlParserCtxtPtr ctxt; /* an HTML parser context */
2240     int n_ctxt;
2241 
2242     for (n_ctxt = 0;n_ctxt < gen_nb_htmlParserCtxtPtr;n_ctxt++) {
2243         mem_base = xmlMemBlocks();
2244         ctxt = gen_htmlParserCtxtPtr(n_ctxt, 0);
2245 
2246         ret_val = htmlParseCharRef(ctxt);
2247         desret_int(ret_val);
2248         call_tests++;
2249         des_htmlParserCtxtPtr(n_ctxt, ctxt, 0);
2250         xmlResetLastError();
2251         if (mem_base != xmlMemBlocks()) {
2252             printf("Leak of %d blocks found in htmlParseCharRef",
2253 	           xmlMemBlocks() - mem_base);
2254 	    test_ret++;
2255             printf(" %d", n_ctxt);
2256             printf("\n");
2257         }
2258     }
2259     function_tests++;
2260 #endif
2261 
2262     return(test_ret);
2263 }
2264 
2265 
2266 static int
test_htmlParseChunk(void)2267 test_htmlParseChunk(void) {
2268     int test_ret = 0;
2269 
2270 #if defined(LIBXML_HTML_ENABLED) && defined(LIBXML_PUSH_ENABLED)
2271     int mem_base;
2272     int ret_val;
2273     htmlParserCtxtPtr ctxt; /* an HTML parser context */
2274     int n_ctxt;
2275     char * chunk; /* an char array */
2276     int n_chunk;
2277     int size; /* the size in byte of the chunk */
2278     int n_size;
2279     int terminate; /* last chunk indicator */
2280     int n_terminate;
2281 
2282     for (n_ctxt = 0;n_ctxt < gen_nb_htmlParserCtxtPtr;n_ctxt++) {
2283     for (n_chunk = 0;n_chunk < gen_nb_const_char_ptr;n_chunk++) {
2284     for (n_size = 0;n_size < gen_nb_int;n_size++) {
2285     for (n_terminate = 0;n_terminate < gen_nb_int;n_terminate++) {
2286         mem_base = xmlMemBlocks();
2287         ctxt = gen_htmlParserCtxtPtr(n_ctxt, 0);
2288         chunk = gen_const_char_ptr(n_chunk, 1);
2289         size = gen_int(n_size, 2);
2290         terminate = gen_int(n_terminate, 3);
2291         if ((chunk != NULL) &&
2292             (size > (int) strlen((const char *) chunk) + 1))
2293             continue;
2294 
2295         ret_val = htmlParseChunk(ctxt, (const char *)chunk, size, terminate);
2296         if (ctxt != NULL) {xmlFreeDoc(ctxt->myDoc); ctxt->myDoc = NULL;}
2297         desret_int(ret_val);
2298         call_tests++;
2299         des_htmlParserCtxtPtr(n_ctxt, ctxt, 0);
2300         des_const_char_ptr(n_chunk, (const char *)chunk, 1);
2301         des_int(n_size, size, 2);
2302         des_int(n_terminate, terminate, 3);
2303         xmlResetLastError();
2304         if (mem_base != xmlMemBlocks()) {
2305             printf("Leak of %d blocks found in htmlParseChunk",
2306 	           xmlMemBlocks() - mem_base);
2307 	    test_ret++;
2308             printf(" %d", n_ctxt);
2309             printf(" %d", n_chunk);
2310             printf(" %d", n_size);
2311             printf(" %d", n_terminate);
2312             printf("\n");
2313         }
2314     }
2315     }
2316     }
2317     }
2318     function_tests++;
2319 #endif
2320 
2321     return(test_ret);
2322 }
2323 
2324 
2325 static int
test_htmlParseDoc(void)2326 test_htmlParseDoc(void) {
2327     int test_ret = 0;
2328 
2329 #if defined(LIBXML_HTML_ENABLED)
2330     int mem_base;
2331     htmlDocPtr ret_val;
2332     xmlChar * cur; /* a pointer to an array of xmlChar */
2333     int n_cur;
2334     char * encoding; /* a free form C string describing the HTML document encoding, or NULL */
2335     int n_encoding;
2336 
2337     for (n_cur = 0;n_cur < gen_nb_const_xmlChar_ptr;n_cur++) {
2338     for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
2339         mem_base = xmlMemBlocks();
2340         cur = gen_const_xmlChar_ptr(n_cur, 0);
2341         encoding = gen_const_char_ptr(n_encoding, 1);
2342 
2343         ret_val = htmlParseDoc((const xmlChar *)cur, (const char *)encoding);
2344         desret_htmlDocPtr(ret_val);
2345         call_tests++;
2346         des_const_xmlChar_ptr(n_cur, (const xmlChar *)cur, 0);
2347         des_const_char_ptr(n_encoding, (const char *)encoding, 1);
2348         xmlResetLastError();
2349         if (mem_base != xmlMemBlocks()) {
2350             printf("Leak of %d blocks found in htmlParseDoc",
2351 	           xmlMemBlocks() - mem_base);
2352 	    test_ret++;
2353             printf(" %d", n_cur);
2354             printf(" %d", n_encoding);
2355             printf("\n");
2356         }
2357     }
2358     }
2359     function_tests++;
2360 #endif
2361 
2362     return(test_ret);
2363 }
2364 
2365 
2366 static int
test_htmlParseDocument(void)2367 test_htmlParseDocument(void) {
2368     int test_ret = 0;
2369 
2370 #if defined(LIBXML_HTML_ENABLED)
2371     int mem_base;
2372     int ret_val;
2373     htmlParserCtxtPtr ctxt; /* an HTML parser context */
2374     int n_ctxt;
2375 
2376     for (n_ctxt = 0;n_ctxt < gen_nb_htmlParserCtxtPtr;n_ctxt++) {
2377         mem_base = xmlMemBlocks();
2378         ctxt = gen_htmlParserCtxtPtr(n_ctxt, 0);
2379 
2380         ret_val = htmlParseDocument(ctxt);
2381         if (ctxt != NULL) {xmlFreeDoc(ctxt->myDoc); ctxt->myDoc = NULL;}
2382         desret_int(ret_val);
2383         call_tests++;
2384         des_htmlParserCtxtPtr(n_ctxt, ctxt, 0);
2385         xmlResetLastError();
2386         if (mem_base != xmlMemBlocks()) {
2387             printf("Leak of %d blocks found in htmlParseDocument",
2388 	           xmlMemBlocks() - mem_base);
2389 	    test_ret++;
2390             printf(" %d", n_ctxt);
2391             printf("\n");
2392         }
2393     }
2394     function_tests++;
2395 #endif
2396 
2397     return(test_ret);
2398 }
2399 
2400 
2401 static int
test_htmlParseElement(void)2402 test_htmlParseElement(void) {
2403     int test_ret = 0;
2404 
2405 #if defined(LIBXML_HTML_ENABLED)
2406     int mem_base;
2407     htmlParserCtxtPtr ctxt; /* an HTML parser context */
2408     int n_ctxt;
2409 
2410     for (n_ctxt = 0;n_ctxt < gen_nb_htmlParserCtxtPtr;n_ctxt++) {
2411         mem_base = xmlMemBlocks();
2412         ctxt = gen_htmlParserCtxtPtr(n_ctxt, 0);
2413 
2414         htmlParseElement(ctxt);
2415         call_tests++;
2416         des_htmlParserCtxtPtr(n_ctxt, ctxt, 0);
2417         xmlResetLastError();
2418         if (mem_base != xmlMemBlocks()) {
2419             printf("Leak of %d blocks found in htmlParseElement",
2420 	           xmlMemBlocks() - mem_base);
2421 	    test_ret++;
2422             printf(" %d", n_ctxt);
2423             printf("\n");
2424         }
2425     }
2426     function_tests++;
2427 #endif
2428 
2429     return(test_ret);
2430 }
2431 
2432 
2433 static int
test_htmlParseEntityRef(void)2434 test_htmlParseEntityRef(void) {
2435     int test_ret = 0;
2436 
2437 #if defined(LIBXML_HTML_ENABLED)
2438     int mem_base;
2439     const htmlEntityDesc * ret_val;
2440     htmlParserCtxtPtr ctxt; /* an HTML parser context */
2441     int n_ctxt;
2442     xmlChar ** str; /* location to store the entity name */
2443     int n_str;
2444 
2445     for (n_ctxt = 0;n_ctxt < gen_nb_htmlParserCtxtPtr;n_ctxt++) {
2446     for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr_ptr;n_str++) {
2447         mem_base = xmlMemBlocks();
2448         ctxt = gen_htmlParserCtxtPtr(n_ctxt, 0);
2449         str = gen_const_xmlChar_ptr_ptr(n_str, 1);
2450 
2451         ret_val = htmlParseEntityRef(ctxt, (const xmlChar **)str);
2452         desret_const_htmlEntityDesc_ptr(ret_val);
2453         call_tests++;
2454         des_htmlParserCtxtPtr(n_ctxt, ctxt, 0);
2455         des_const_xmlChar_ptr_ptr(n_str, (const xmlChar **)str, 1);
2456         xmlResetLastError();
2457         if (mem_base != xmlMemBlocks()) {
2458             printf("Leak of %d blocks found in htmlParseEntityRef",
2459 	           xmlMemBlocks() - mem_base);
2460 	    test_ret++;
2461             printf(" %d", n_ctxt);
2462             printf(" %d", n_str);
2463             printf("\n");
2464         }
2465     }
2466     }
2467     function_tests++;
2468 #endif
2469 
2470     return(test_ret);
2471 }
2472 
2473 
2474 static int
test_htmlParseFile(void)2475 test_htmlParseFile(void) {
2476     int test_ret = 0;
2477 
2478 #if defined(LIBXML_HTML_ENABLED)
2479     htmlDocPtr ret_val;
2480     const char * filename; /* the filename */
2481     int n_filename;
2482     char * encoding; /* a free form C string describing the HTML document encoding, or NULL */
2483     int n_encoding;
2484 
2485     for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
2486     for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
2487         filename = gen_filepath(n_filename, 0);
2488         encoding = gen_const_char_ptr(n_encoding, 1);
2489 
2490         ret_val = htmlParseFile(filename, (const char *)encoding);
2491         desret_htmlDocPtr(ret_val);
2492         call_tests++;
2493         des_filepath(n_filename, filename, 0);
2494         des_const_char_ptr(n_encoding, (const char *)encoding, 1);
2495         xmlResetLastError();
2496     }
2497     }
2498     function_tests++;
2499 #endif
2500 
2501     return(test_ret);
2502 }
2503 
2504 
2505 static int
test_htmlReadDoc(void)2506 test_htmlReadDoc(void) {
2507     int test_ret = 0;
2508 
2509 #if defined(LIBXML_HTML_ENABLED)
2510     int mem_base;
2511     htmlDocPtr ret_val;
2512     xmlChar * cur; /* a pointer to a zero terminated string */
2513     int n_cur;
2514     const char * URL; /* the base URL to use for the document */
2515     int n_URL;
2516     char * encoding; /* the document encoding, or NULL */
2517     int n_encoding;
2518     int options; /* a combination of htmlParserOption(s) */
2519     int n_options;
2520 
2521     for (n_cur = 0;n_cur < gen_nb_const_xmlChar_ptr;n_cur++) {
2522     for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) {
2523     for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
2524     for (n_options = 0;n_options < gen_nb_int;n_options++) {
2525         mem_base = xmlMemBlocks();
2526         cur = gen_const_xmlChar_ptr(n_cur, 0);
2527         URL = gen_filepath(n_URL, 1);
2528         encoding = gen_const_char_ptr(n_encoding, 2);
2529         options = gen_int(n_options, 3);
2530 
2531         ret_val = htmlReadDoc((const xmlChar *)cur, URL, (const char *)encoding, options);
2532         desret_htmlDocPtr(ret_val);
2533         call_tests++;
2534         des_const_xmlChar_ptr(n_cur, (const xmlChar *)cur, 0);
2535         des_filepath(n_URL, URL, 1);
2536         des_const_char_ptr(n_encoding, (const char *)encoding, 2);
2537         des_int(n_options, options, 3);
2538         xmlResetLastError();
2539         if (mem_base != xmlMemBlocks()) {
2540             printf("Leak of %d blocks found in htmlReadDoc",
2541 	           xmlMemBlocks() - mem_base);
2542 	    test_ret++;
2543             printf(" %d", n_cur);
2544             printf(" %d", n_URL);
2545             printf(" %d", n_encoding);
2546             printf(" %d", n_options);
2547             printf("\n");
2548         }
2549     }
2550     }
2551     }
2552     }
2553     function_tests++;
2554 #endif
2555 
2556     return(test_ret);
2557 }
2558 
2559 
2560 static int
test_htmlReadFile(void)2561 test_htmlReadFile(void) {
2562     int test_ret = 0;
2563 
2564 #if defined(LIBXML_HTML_ENABLED)
2565     int mem_base;
2566     htmlDocPtr ret_val;
2567     const char * filename; /* a file or URL */
2568     int n_filename;
2569     char * encoding; /* the document encoding, or NULL */
2570     int n_encoding;
2571     int options; /* a combination of htmlParserOption(s) */
2572     int n_options;
2573 
2574     for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
2575     for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
2576     for (n_options = 0;n_options < gen_nb_int;n_options++) {
2577         mem_base = xmlMemBlocks();
2578         filename = gen_filepath(n_filename, 0);
2579         encoding = gen_const_char_ptr(n_encoding, 1);
2580         options = gen_int(n_options, 2);
2581 
2582         ret_val = htmlReadFile(filename, (const char *)encoding, options);
2583         desret_htmlDocPtr(ret_val);
2584         call_tests++;
2585         des_filepath(n_filename, filename, 0);
2586         des_const_char_ptr(n_encoding, (const char *)encoding, 1);
2587         des_int(n_options, options, 2);
2588         xmlResetLastError();
2589         if (mem_base != xmlMemBlocks()) {
2590             printf("Leak of %d blocks found in htmlReadFile",
2591 	           xmlMemBlocks() - mem_base);
2592 	    test_ret++;
2593             printf(" %d", n_filename);
2594             printf(" %d", n_encoding);
2595             printf(" %d", n_options);
2596             printf("\n");
2597         }
2598     }
2599     }
2600     }
2601     function_tests++;
2602 #endif
2603 
2604     return(test_ret);
2605 }
2606 
2607 
2608 static int
test_htmlReadMemory(void)2609 test_htmlReadMemory(void) {
2610     int test_ret = 0;
2611 
2612 #if defined(LIBXML_HTML_ENABLED)
2613     int mem_base;
2614     htmlDocPtr ret_val;
2615     char * buffer; /* a pointer to a char array */
2616     int n_buffer;
2617     int size; /* the size of the array */
2618     int n_size;
2619     const char * URL; /* the base URL to use for the document */
2620     int n_URL;
2621     char * encoding; /* the document encoding, or NULL */
2622     int n_encoding;
2623     int options; /* a combination of htmlParserOption(s) */
2624     int n_options;
2625 
2626     for (n_buffer = 0;n_buffer < gen_nb_const_char_ptr;n_buffer++) {
2627     for (n_size = 0;n_size < gen_nb_int;n_size++) {
2628     for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) {
2629     for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
2630     for (n_options = 0;n_options < gen_nb_int;n_options++) {
2631         mem_base = xmlMemBlocks();
2632         buffer = gen_const_char_ptr(n_buffer, 0);
2633         size = gen_int(n_size, 1);
2634         URL = gen_filepath(n_URL, 2);
2635         encoding = gen_const_char_ptr(n_encoding, 3);
2636         options = gen_int(n_options, 4);
2637         if ((buffer != NULL) &&
2638             (size > (int) strlen((const char *) buffer) + 1))
2639             continue;
2640 
2641         ret_val = htmlReadMemory((const char *)buffer, size, URL, (const char *)encoding, options);
2642         desret_htmlDocPtr(ret_val);
2643         call_tests++;
2644         des_const_char_ptr(n_buffer, (const char *)buffer, 0);
2645         des_int(n_size, size, 1);
2646         des_filepath(n_URL, URL, 2);
2647         des_const_char_ptr(n_encoding, (const char *)encoding, 3);
2648         des_int(n_options, options, 4);
2649         xmlResetLastError();
2650         if (mem_base != xmlMemBlocks()) {
2651             printf("Leak of %d blocks found in htmlReadMemory",
2652 	           xmlMemBlocks() - mem_base);
2653 	    test_ret++;
2654             printf(" %d", n_buffer);
2655             printf(" %d", n_size);
2656             printf(" %d", n_URL);
2657             printf(" %d", n_encoding);
2658             printf(" %d", n_options);
2659             printf("\n");
2660         }
2661     }
2662     }
2663     }
2664     }
2665     }
2666     function_tests++;
2667 #endif
2668 
2669     return(test_ret);
2670 }
2671 
2672 
2673 static int
test_htmlSAXParseDoc(void)2674 test_htmlSAXParseDoc(void) {
2675     int test_ret = 0;
2676 
2677 #if defined(LIBXML_HTML_ENABLED)
2678     int mem_base;
2679     htmlDocPtr ret_val;
2680     xmlChar * cur; /* a pointer to an array of xmlChar */
2681     int n_cur;
2682     char * encoding; /* a free form C string describing the HTML document encoding, or NULL */
2683     int n_encoding;
2684     htmlSAXHandlerPtr sax; /* the SAX handler block */
2685     int n_sax;
2686     void * userData; /* if using SAX, this pointer will be provided on callbacks. */
2687     int n_userData;
2688 
2689     for (n_cur = 0;n_cur < gen_nb_const_xmlChar_ptr;n_cur++) {
2690     for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
2691     for (n_sax = 0;n_sax < gen_nb_htmlSAXHandlerPtr;n_sax++) {
2692     for (n_userData = 0;n_userData < gen_nb_userdata;n_userData++) {
2693         mem_base = xmlMemBlocks();
2694         cur = gen_const_xmlChar_ptr(n_cur, 0);
2695         encoding = gen_const_char_ptr(n_encoding, 1);
2696         sax = gen_htmlSAXHandlerPtr(n_sax, 2);
2697         userData = gen_userdata(n_userData, 3);
2698 
2699         ret_val = htmlSAXParseDoc((const xmlChar *)cur, (const char *)encoding, sax, userData);
2700         desret_htmlDocPtr(ret_val);
2701         call_tests++;
2702         des_const_xmlChar_ptr(n_cur, (const xmlChar *)cur, 0);
2703         des_const_char_ptr(n_encoding, (const char *)encoding, 1);
2704         des_htmlSAXHandlerPtr(n_sax, sax, 2);
2705         des_userdata(n_userData, userData, 3);
2706         xmlResetLastError();
2707         if (mem_base != xmlMemBlocks()) {
2708             printf("Leak of %d blocks found in htmlSAXParseDoc",
2709 	           xmlMemBlocks() - mem_base);
2710 	    test_ret++;
2711             printf(" %d", n_cur);
2712             printf(" %d", n_encoding);
2713             printf(" %d", n_sax);
2714             printf(" %d", n_userData);
2715             printf("\n");
2716         }
2717     }
2718     }
2719     }
2720     }
2721     function_tests++;
2722 #endif
2723 
2724     return(test_ret);
2725 }
2726 
2727 
2728 static int
test_htmlSAXParseFile(void)2729 test_htmlSAXParseFile(void) {
2730     int test_ret = 0;
2731 
2732 #if defined(LIBXML_HTML_ENABLED)
2733     int mem_base;
2734     htmlDocPtr ret_val;
2735     const char * filename; /* the filename */
2736     int n_filename;
2737     char * encoding; /* a free form C string describing the HTML document encoding, or NULL */
2738     int n_encoding;
2739     htmlSAXHandlerPtr sax; /* the SAX handler block */
2740     int n_sax;
2741     void * userData; /* if using SAX, this pointer will be provided on callbacks. */
2742     int n_userData;
2743 
2744     for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
2745     for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
2746     for (n_sax = 0;n_sax < gen_nb_htmlSAXHandlerPtr;n_sax++) {
2747     for (n_userData = 0;n_userData < gen_nb_userdata;n_userData++) {
2748         mem_base = xmlMemBlocks();
2749         filename = gen_filepath(n_filename, 0);
2750         encoding = gen_const_char_ptr(n_encoding, 1);
2751         sax = gen_htmlSAXHandlerPtr(n_sax, 2);
2752         userData = gen_userdata(n_userData, 3);
2753 
2754         ret_val = htmlSAXParseFile(filename, (const char *)encoding, sax, userData);
2755         desret_htmlDocPtr(ret_val);
2756         call_tests++;
2757         des_filepath(n_filename, filename, 0);
2758         des_const_char_ptr(n_encoding, (const char *)encoding, 1);
2759         des_htmlSAXHandlerPtr(n_sax, sax, 2);
2760         des_userdata(n_userData, userData, 3);
2761         xmlResetLastError();
2762         if (mem_base != xmlMemBlocks()) {
2763             printf("Leak of %d blocks found in htmlSAXParseFile",
2764 	           xmlMemBlocks() - mem_base);
2765 	    test_ret++;
2766             printf(" %d", n_filename);
2767             printf(" %d", n_encoding);
2768             printf(" %d", n_sax);
2769             printf(" %d", n_userData);
2770             printf("\n");
2771         }
2772     }
2773     }
2774     }
2775     }
2776     function_tests++;
2777 #endif
2778 
2779     return(test_ret);
2780 }
2781 
2782 
2783 static int
test_htmlTagLookup(void)2784 test_htmlTagLookup(void) {
2785     int test_ret = 0;
2786 
2787 
2788     /* missing type support */
2789     return(test_ret);
2790 }
2791 
2792 static int
test_HTMLparser(void)2793 test_HTMLparser(void) {
2794     int test_ret = 0;
2795 
2796     if (quiet == 0) printf("Testing HTMLparser : 32 of 38 functions ...\n");
2797     test_ret += test_UTF8ToHtml();
2798     test_ret += test_htmlAttrAllowed();
2799     test_ret += test_htmlAutoCloseTag();
2800     test_ret += test_htmlCreateMemoryParserCtxt();
2801     test_ret += test_htmlCreatePushParserCtxt();
2802     test_ret += test_htmlCtxtReadDoc();
2803     test_ret += test_htmlCtxtReadFile();
2804     test_ret += test_htmlCtxtReadMemory();
2805     test_ret += test_htmlCtxtReset();
2806     test_ret += test_htmlCtxtUseOptions();
2807     test_ret += test_htmlElementAllowedHere();
2808     test_ret += test_htmlElementStatusHere();
2809     test_ret += test_htmlEncodeEntities();
2810     test_ret += test_htmlEntityLookup();
2811     test_ret += test_htmlEntityValueLookup();
2812     test_ret += test_htmlHandleOmittedElem();
2813     test_ret += test_htmlIsAutoClosed();
2814     test_ret += test_htmlIsScriptAttribute();
2815     test_ret += test_htmlNewParserCtxt();
2816     test_ret += test_htmlNodeStatus();
2817     test_ret += test_htmlParseCharRef();
2818     test_ret += test_htmlParseChunk();
2819     test_ret += test_htmlParseDoc();
2820     test_ret += test_htmlParseDocument();
2821     test_ret += test_htmlParseElement();
2822     test_ret += test_htmlParseEntityRef();
2823     test_ret += test_htmlParseFile();
2824     test_ret += test_htmlReadDoc();
2825     test_ret += test_htmlReadFile();
2826     test_ret += test_htmlReadMemory();
2827     test_ret += test_htmlSAXParseDoc();
2828     test_ret += test_htmlSAXParseFile();
2829     test_ret += test_htmlTagLookup();
2830 
2831     if (test_ret != 0)
2832 	printf("Module HTMLparser: %d errors\n", test_ret);
2833     return(test_ret);
2834 }
2835 
2836 static int
test_htmlDocContentDumpFormatOutput(void)2837 test_htmlDocContentDumpFormatOutput(void) {
2838     int test_ret = 0;
2839 
2840 #if defined(LIBXML_HTML_ENABLED) && defined(LIBXML_OUTPUT_ENABLED)
2841     int mem_base;
2842     xmlOutputBufferPtr buf; /* the HTML buffer output */
2843     int n_buf;
2844     xmlDocPtr cur; /* the document */
2845     int n_cur;
2846     char * encoding; /* the encoding string */
2847     int n_encoding;
2848     int format; /* should formatting spaces been added */
2849     int n_format;
2850 
2851     for (n_buf = 0;n_buf < gen_nb_xmlOutputBufferPtr;n_buf++) {
2852     for (n_cur = 0;n_cur < gen_nb_xmlDocPtr;n_cur++) {
2853     for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
2854     for (n_format = 0;n_format < gen_nb_int;n_format++) {
2855         mem_base = xmlMemBlocks();
2856         buf = gen_xmlOutputBufferPtr(n_buf, 0);
2857         cur = gen_xmlDocPtr(n_cur, 1);
2858         encoding = gen_const_char_ptr(n_encoding, 2);
2859         format = gen_int(n_format, 3);
2860 
2861         htmlDocContentDumpFormatOutput(buf, cur, (const char *)encoding, format);
2862         call_tests++;
2863         des_xmlOutputBufferPtr(n_buf, buf, 0);
2864         des_xmlDocPtr(n_cur, cur, 1);
2865         des_const_char_ptr(n_encoding, (const char *)encoding, 2);
2866         des_int(n_format, format, 3);
2867         xmlResetLastError();
2868         if (mem_base != xmlMemBlocks()) {
2869             printf("Leak of %d blocks found in htmlDocContentDumpFormatOutput",
2870 	           xmlMemBlocks() - mem_base);
2871 	    test_ret++;
2872             printf(" %d", n_buf);
2873             printf(" %d", n_cur);
2874             printf(" %d", n_encoding);
2875             printf(" %d", n_format);
2876             printf("\n");
2877         }
2878     }
2879     }
2880     }
2881     }
2882     function_tests++;
2883 #endif
2884 
2885     return(test_ret);
2886 }
2887 
2888 
2889 static int
test_htmlDocContentDumpOutput(void)2890 test_htmlDocContentDumpOutput(void) {
2891     int test_ret = 0;
2892 
2893 #if defined(LIBXML_HTML_ENABLED) && defined(LIBXML_OUTPUT_ENABLED)
2894     int mem_base;
2895     xmlOutputBufferPtr buf; /* the HTML buffer output */
2896     int n_buf;
2897     xmlDocPtr cur; /* the document */
2898     int n_cur;
2899     char * encoding; /* the encoding string */
2900     int n_encoding;
2901 
2902     for (n_buf = 0;n_buf < gen_nb_xmlOutputBufferPtr;n_buf++) {
2903     for (n_cur = 0;n_cur < gen_nb_xmlDocPtr;n_cur++) {
2904     for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
2905         mem_base = xmlMemBlocks();
2906         buf = gen_xmlOutputBufferPtr(n_buf, 0);
2907         cur = gen_xmlDocPtr(n_cur, 1);
2908         encoding = gen_const_char_ptr(n_encoding, 2);
2909 
2910         htmlDocContentDumpOutput(buf, cur, (const char *)encoding);
2911         call_tests++;
2912         des_xmlOutputBufferPtr(n_buf, buf, 0);
2913         des_xmlDocPtr(n_cur, cur, 1);
2914         des_const_char_ptr(n_encoding, (const char *)encoding, 2);
2915         xmlResetLastError();
2916         if (mem_base != xmlMemBlocks()) {
2917             printf("Leak of %d blocks found in htmlDocContentDumpOutput",
2918 	           xmlMemBlocks() - mem_base);
2919 	    test_ret++;
2920             printf(" %d", n_buf);
2921             printf(" %d", n_cur);
2922             printf(" %d", n_encoding);
2923             printf("\n");
2924         }
2925     }
2926     }
2927     }
2928     function_tests++;
2929 #endif
2930 
2931     return(test_ret);
2932 }
2933 
2934 
2935 static int
test_htmlDocDump(void)2936 test_htmlDocDump(void) {
2937     int test_ret = 0;
2938 
2939 #if defined(LIBXML_HTML_ENABLED) && defined(LIBXML_OUTPUT_ENABLED)
2940     int mem_base;
2941     int ret_val;
2942     FILE * f; /* the FILE* */
2943     int n_f;
2944     xmlDocPtr cur; /* the document */
2945     int n_cur;
2946 
2947     for (n_f = 0;n_f < gen_nb_FILE_ptr;n_f++) {
2948     for (n_cur = 0;n_cur < gen_nb_xmlDocPtr;n_cur++) {
2949         mem_base = xmlMemBlocks();
2950         f = gen_FILE_ptr(n_f, 0);
2951         cur = gen_xmlDocPtr(n_cur, 1);
2952 
2953         ret_val = htmlDocDump(f, cur);
2954         desret_int(ret_val);
2955         call_tests++;
2956         des_FILE_ptr(n_f, f, 0);
2957         des_xmlDocPtr(n_cur, cur, 1);
2958         xmlResetLastError();
2959         if (mem_base != xmlMemBlocks()) {
2960             printf("Leak of %d blocks found in htmlDocDump",
2961 	           xmlMemBlocks() - mem_base);
2962 	    test_ret++;
2963             printf(" %d", n_f);
2964             printf(" %d", n_cur);
2965             printf("\n");
2966         }
2967     }
2968     }
2969     function_tests++;
2970 #endif
2971 
2972     return(test_ret);
2973 }
2974 
2975 
2976 #define gen_nb_xmlChar_ptr_ptr 1
gen_xmlChar_ptr_ptr(int no ATTRIBUTE_UNUSED,int nr ATTRIBUTE_UNUSED)2977 static xmlChar ** gen_xmlChar_ptr_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
2978     return(NULL);
2979 }
des_xmlChar_ptr_ptr(int no ATTRIBUTE_UNUSED,xmlChar ** val ATTRIBUTE_UNUSED,int nr ATTRIBUTE_UNUSED)2980 static void des_xmlChar_ptr_ptr(int no ATTRIBUTE_UNUSED, xmlChar ** val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
2981 }
2982 
2983 static int
test_htmlDocDumpMemory(void)2984 test_htmlDocDumpMemory(void) {
2985     int test_ret = 0;
2986 
2987 #if defined(LIBXML_HTML_ENABLED) && defined(LIBXML_OUTPUT_ENABLED)
2988     int mem_base;
2989     xmlDocPtr cur; /* the document */
2990     int n_cur;
2991     xmlChar ** mem; /* OUT: the memory pointer */
2992     int n_mem;
2993     int * size; /* OUT: the memory length */
2994     int n_size;
2995 
2996     for (n_cur = 0;n_cur < gen_nb_xmlDocPtr;n_cur++) {
2997     for (n_mem = 0;n_mem < gen_nb_xmlChar_ptr_ptr;n_mem++) {
2998     for (n_size = 0;n_size < gen_nb_int_ptr;n_size++) {
2999         mem_base = xmlMemBlocks();
3000         cur = gen_xmlDocPtr(n_cur, 0);
3001         mem = gen_xmlChar_ptr_ptr(n_mem, 1);
3002         size = gen_int_ptr(n_size, 2);
3003 
3004         htmlDocDumpMemory(cur, mem, size);
3005         call_tests++;
3006         des_xmlDocPtr(n_cur, cur, 0);
3007         des_xmlChar_ptr_ptr(n_mem, mem, 1);
3008         des_int_ptr(n_size, size, 2);
3009         xmlResetLastError();
3010         if (mem_base != xmlMemBlocks()) {
3011             printf("Leak of %d blocks found in htmlDocDumpMemory",
3012 	           xmlMemBlocks() - mem_base);
3013 	    test_ret++;
3014             printf(" %d", n_cur);
3015             printf(" %d", n_mem);
3016             printf(" %d", n_size);
3017             printf("\n");
3018         }
3019     }
3020     }
3021     }
3022     function_tests++;
3023 #endif
3024 
3025     return(test_ret);
3026 }
3027 
3028 
3029 static int
test_htmlDocDumpMemoryFormat(void)3030 test_htmlDocDumpMemoryFormat(void) {
3031     int test_ret = 0;
3032 
3033 #if defined(LIBXML_HTML_ENABLED) && defined(LIBXML_OUTPUT_ENABLED)
3034     int mem_base;
3035     xmlDocPtr cur; /* the document */
3036     int n_cur;
3037     xmlChar ** mem; /* OUT: the memory pointer */
3038     int n_mem;
3039     int * size; /* OUT: the memory length */
3040     int n_size;
3041     int format; /* should formatting spaces been added */
3042     int n_format;
3043 
3044     for (n_cur = 0;n_cur < gen_nb_xmlDocPtr;n_cur++) {
3045     for (n_mem = 0;n_mem < gen_nb_xmlChar_ptr_ptr;n_mem++) {
3046     for (n_size = 0;n_size < gen_nb_int_ptr;n_size++) {
3047     for (n_format = 0;n_format < gen_nb_int;n_format++) {
3048         mem_base = xmlMemBlocks();
3049         cur = gen_xmlDocPtr(n_cur, 0);
3050         mem = gen_xmlChar_ptr_ptr(n_mem, 1);
3051         size = gen_int_ptr(n_size, 2);
3052         format = gen_int(n_format, 3);
3053 
3054         htmlDocDumpMemoryFormat(cur, mem, size, format);
3055         call_tests++;
3056         des_xmlDocPtr(n_cur, cur, 0);
3057         des_xmlChar_ptr_ptr(n_mem, mem, 1);
3058         des_int_ptr(n_size, size, 2);
3059         des_int(n_format, format, 3);
3060         xmlResetLastError();
3061         if (mem_base != xmlMemBlocks()) {
3062             printf("Leak of %d blocks found in htmlDocDumpMemoryFormat",
3063 	           xmlMemBlocks() - mem_base);
3064 	    test_ret++;
3065             printf(" %d", n_cur);
3066             printf(" %d", n_mem);
3067             printf(" %d", n_size);
3068             printf(" %d", n_format);
3069             printf("\n");
3070         }
3071     }
3072     }
3073     }
3074     }
3075     function_tests++;
3076 #endif
3077 
3078     return(test_ret);
3079 }
3080 
3081 
3082 static int
test_htmlGetMetaEncoding(void)3083 test_htmlGetMetaEncoding(void) {
3084     int test_ret = 0;
3085 
3086 #if defined(LIBXML_HTML_ENABLED)
3087     int mem_base;
3088     const xmlChar * ret_val;
3089     htmlDocPtr doc; /* the document */
3090     int n_doc;
3091 
3092     for (n_doc = 0;n_doc < gen_nb_htmlDocPtr;n_doc++) {
3093         mem_base = xmlMemBlocks();
3094         doc = gen_htmlDocPtr(n_doc, 0);
3095 
3096         ret_val = htmlGetMetaEncoding(doc);
3097         desret_const_xmlChar_ptr(ret_val);
3098         call_tests++;
3099         des_htmlDocPtr(n_doc, doc, 0);
3100         xmlResetLastError();
3101         if (mem_base != xmlMemBlocks()) {
3102             printf("Leak of %d blocks found in htmlGetMetaEncoding",
3103 	           xmlMemBlocks() - mem_base);
3104 	    test_ret++;
3105             printf(" %d", n_doc);
3106             printf("\n");
3107         }
3108     }
3109     function_tests++;
3110 #endif
3111 
3112     return(test_ret);
3113 }
3114 
3115 
3116 static int
test_htmlIsBooleanAttr(void)3117 test_htmlIsBooleanAttr(void) {
3118     int test_ret = 0;
3119 
3120 #if defined(LIBXML_HTML_ENABLED)
3121     int mem_base;
3122     int ret_val;
3123     xmlChar * name; /* the name of the attribute to check */
3124     int n_name;
3125 
3126     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
3127         mem_base = xmlMemBlocks();
3128         name = gen_const_xmlChar_ptr(n_name, 0);
3129 
3130         ret_val = htmlIsBooleanAttr((const xmlChar *)name);
3131         desret_int(ret_val);
3132         call_tests++;
3133         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 0);
3134         xmlResetLastError();
3135         if (mem_base != xmlMemBlocks()) {
3136             printf("Leak of %d blocks found in htmlIsBooleanAttr",
3137 	           xmlMemBlocks() - mem_base);
3138 	    test_ret++;
3139             printf(" %d", n_name);
3140             printf("\n");
3141         }
3142     }
3143     function_tests++;
3144 #endif
3145 
3146     return(test_ret);
3147 }
3148 
3149 
3150 static int
test_htmlNewDoc(void)3151 test_htmlNewDoc(void) {
3152     int test_ret = 0;
3153 
3154 #if defined(LIBXML_HTML_ENABLED)
3155     int mem_base;
3156     htmlDocPtr ret_val;
3157     xmlChar * URI; /* URI for the dtd, or NULL */
3158     int n_URI;
3159     xmlChar * ExternalID; /* the external ID of the DTD, or NULL */
3160     int n_ExternalID;
3161 
3162     for (n_URI = 0;n_URI < gen_nb_const_xmlChar_ptr;n_URI++) {
3163     for (n_ExternalID = 0;n_ExternalID < gen_nb_const_xmlChar_ptr;n_ExternalID++) {
3164         mem_base = xmlMemBlocks();
3165         URI = gen_const_xmlChar_ptr(n_URI, 0);
3166         ExternalID = gen_const_xmlChar_ptr(n_ExternalID, 1);
3167 
3168         ret_val = htmlNewDoc((const xmlChar *)URI, (const xmlChar *)ExternalID);
3169         desret_htmlDocPtr(ret_val);
3170         call_tests++;
3171         des_const_xmlChar_ptr(n_URI, (const xmlChar *)URI, 0);
3172         des_const_xmlChar_ptr(n_ExternalID, (const xmlChar *)ExternalID, 1);
3173         xmlResetLastError();
3174         if (mem_base != xmlMemBlocks()) {
3175             printf("Leak of %d blocks found in htmlNewDoc",
3176 	           xmlMemBlocks() - mem_base);
3177 	    test_ret++;
3178             printf(" %d", n_URI);
3179             printf(" %d", n_ExternalID);
3180             printf("\n");
3181         }
3182     }
3183     }
3184     function_tests++;
3185 #endif
3186 
3187     return(test_ret);
3188 }
3189 
3190 
3191 static int
test_htmlNewDocNoDtD(void)3192 test_htmlNewDocNoDtD(void) {
3193     int test_ret = 0;
3194 
3195 #if defined(LIBXML_HTML_ENABLED)
3196     int mem_base;
3197     htmlDocPtr ret_val;
3198     xmlChar * URI; /* URI for the dtd, or NULL */
3199     int n_URI;
3200     xmlChar * ExternalID; /* the external ID of the DTD, or NULL */
3201     int n_ExternalID;
3202 
3203     for (n_URI = 0;n_URI < gen_nb_const_xmlChar_ptr;n_URI++) {
3204     for (n_ExternalID = 0;n_ExternalID < gen_nb_const_xmlChar_ptr;n_ExternalID++) {
3205         mem_base = xmlMemBlocks();
3206         URI = gen_const_xmlChar_ptr(n_URI, 0);
3207         ExternalID = gen_const_xmlChar_ptr(n_ExternalID, 1);
3208 
3209         ret_val = htmlNewDocNoDtD((const xmlChar *)URI, (const xmlChar *)ExternalID);
3210         desret_htmlDocPtr(ret_val);
3211         call_tests++;
3212         des_const_xmlChar_ptr(n_URI, (const xmlChar *)URI, 0);
3213         des_const_xmlChar_ptr(n_ExternalID, (const xmlChar *)ExternalID, 1);
3214         xmlResetLastError();
3215         if (mem_base != xmlMemBlocks()) {
3216             printf("Leak of %d blocks found in htmlNewDocNoDtD",
3217 	           xmlMemBlocks() - mem_base);
3218 	    test_ret++;
3219             printf(" %d", n_URI);
3220             printf(" %d", n_ExternalID);
3221             printf("\n");
3222         }
3223     }
3224     }
3225     function_tests++;
3226 #endif
3227 
3228     return(test_ret);
3229 }
3230 
3231 
3232 static int
test_htmlNodeDump(void)3233 test_htmlNodeDump(void) {
3234     int test_ret = 0;
3235 
3236 #if defined(LIBXML_HTML_ENABLED) && defined(LIBXML_OUTPUT_ENABLED)
3237     int mem_base;
3238     int ret_val;
3239     xmlBufferPtr buf; /* the HTML buffer output */
3240     int n_buf;
3241     xmlDocPtr doc; /* the document */
3242     int n_doc;
3243     xmlNodePtr cur; /* the current node */
3244     int n_cur;
3245 
3246     for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
3247     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
3248     for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
3249         mem_base = xmlMemBlocks();
3250         buf = gen_xmlBufferPtr(n_buf, 0);
3251         doc = gen_xmlDocPtr(n_doc, 1);
3252         cur = gen_xmlNodePtr(n_cur, 2);
3253 
3254         ret_val = htmlNodeDump(buf, doc, cur);
3255         desret_int(ret_val);
3256         call_tests++;
3257         des_xmlBufferPtr(n_buf, buf, 0);
3258         des_xmlDocPtr(n_doc, doc, 1);
3259         des_xmlNodePtr(n_cur, cur, 2);
3260         xmlResetLastError();
3261         if (mem_base != xmlMemBlocks()) {
3262             printf("Leak of %d blocks found in htmlNodeDump",
3263 	           xmlMemBlocks() - mem_base);
3264 	    test_ret++;
3265             printf(" %d", n_buf);
3266             printf(" %d", n_doc);
3267             printf(" %d", n_cur);
3268             printf("\n");
3269         }
3270     }
3271     }
3272     }
3273     function_tests++;
3274 #endif
3275 
3276     return(test_ret);
3277 }
3278 
3279 
3280 static int
test_htmlNodeDumpFile(void)3281 test_htmlNodeDumpFile(void) {
3282     int test_ret = 0;
3283 
3284 #if defined(LIBXML_HTML_ENABLED) && defined(LIBXML_OUTPUT_ENABLED)
3285     int mem_base;
3286     FILE * out; /* the FILE pointer */
3287     int n_out;
3288     xmlDocPtr doc; /* the document */
3289     int n_doc;
3290     xmlNodePtr cur; /* the current node */
3291     int n_cur;
3292 
3293     for (n_out = 0;n_out < gen_nb_FILE_ptr;n_out++) {
3294     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
3295     for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
3296         mem_base = xmlMemBlocks();
3297         out = gen_FILE_ptr(n_out, 0);
3298         doc = gen_xmlDocPtr(n_doc, 1);
3299         cur = gen_xmlNodePtr(n_cur, 2);
3300 
3301         htmlNodeDumpFile(out, doc, cur);
3302         call_tests++;
3303         des_FILE_ptr(n_out, out, 0);
3304         des_xmlDocPtr(n_doc, doc, 1);
3305         des_xmlNodePtr(n_cur, cur, 2);
3306         xmlResetLastError();
3307         if (mem_base != xmlMemBlocks()) {
3308             printf("Leak of %d blocks found in htmlNodeDumpFile",
3309 	           xmlMemBlocks() - mem_base);
3310 	    test_ret++;
3311             printf(" %d", n_out);
3312             printf(" %d", n_doc);
3313             printf(" %d", n_cur);
3314             printf("\n");
3315         }
3316     }
3317     }
3318     }
3319     function_tests++;
3320 #endif
3321 
3322     return(test_ret);
3323 }
3324 
3325 
3326 static int
test_htmlNodeDumpFileFormat(void)3327 test_htmlNodeDumpFileFormat(void) {
3328     int test_ret = 0;
3329 
3330 #if defined(LIBXML_HTML_ENABLED) && defined(LIBXML_OUTPUT_ENABLED)
3331     int mem_base;
3332     int ret_val;
3333     FILE * out; /* the FILE pointer */
3334     int n_out;
3335     xmlDocPtr doc; /* the document */
3336     int n_doc;
3337     xmlNodePtr cur; /* the current node */
3338     int n_cur;
3339     char * encoding; /* the document encoding */
3340     int n_encoding;
3341     int format; /* should formatting spaces been added */
3342     int n_format;
3343 
3344     for (n_out = 0;n_out < gen_nb_FILE_ptr;n_out++) {
3345     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
3346     for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
3347     for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
3348     for (n_format = 0;n_format < gen_nb_int;n_format++) {
3349         mem_base = xmlMemBlocks();
3350         out = gen_FILE_ptr(n_out, 0);
3351         doc = gen_xmlDocPtr(n_doc, 1);
3352         cur = gen_xmlNodePtr(n_cur, 2);
3353         encoding = gen_const_char_ptr(n_encoding, 3);
3354         format = gen_int(n_format, 4);
3355 
3356         ret_val = htmlNodeDumpFileFormat(out, doc, cur, (const char *)encoding, format);
3357         desret_int(ret_val);
3358         call_tests++;
3359         des_FILE_ptr(n_out, out, 0);
3360         des_xmlDocPtr(n_doc, doc, 1);
3361         des_xmlNodePtr(n_cur, cur, 2);
3362         des_const_char_ptr(n_encoding, (const char *)encoding, 3);
3363         des_int(n_format, format, 4);
3364         xmlResetLastError();
3365         if (mem_base != xmlMemBlocks()) {
3366             printf("Leak of %d blocks found in htmlNodeDumpFileFormat",
3367 	           xmlMemBlocks() - mem_base);
3368 	    test_ret++;
3369             printf(" %d", n_out);
3370             printf(" %d", n_doc);
3371             printf(" %d", n_cur);
3372             printf(" %d", n_encoding);
3373             printf(" %d", n_format);
3374             printf("\n");
3375         }
3376     }
3377     }
3378     }
3379     }
3380     }
3381     function_tests++;
3382 #endif
3383 
3384     return(test_ret);
3385 }
3386 
3387 
3388 static int
test_htmlNodeDumpFormatOutput(void)3389 test_htmlNodeDumpFormatOutput(void) {
3390     int test_ret = 0;
3391 
3392 #if defined(LIBXML_HTML_ENABLED) && defined(LIBXML_OUTPUT_ENABLED)
3393     int mem_base;
3394     xmlOutputBufferPtr buf; /* the HTML buffer output */
3395     int n_buf;
3396     xmlDocPtr doc; /* the document */
3397     int n_doc;
3398     xmlNodePtr cur; /* the current node */
3399     int n_cur;
3400     char * encoding; /* the encoding string */
3401     int n_encoding;
3402     int format; /* should formatting spaces been added */
3403     int n_format;
3404 
3405     for (n_buf = 0;n_buf < gen_nb_xmlOutputBufferPtr;n_buf++) {
3406     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
3407     for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
3408     for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
3409     for (n_format = 0;n_format < gen_nb_int;n_format++) {
3410         mem_base = xmlMemBlocks();
3411         buf = gen_xmlOutputBufferPtr(n_buf, 0);
3412         doc = gen_xmlDocPtr(n_doc, 1);
3413         cur = gen_xmlNodePtr(n_cur, 2);
3414         encoding = gen_const_char_ptr(n_encoding, 3);
3415         format = gen_int(n_format, 4);
3416 
3417         htmlNodeDumpFormatOutput(buf, doc, cur, (const char *)encoding, format);
3418         call_tests++;
3419         des_xmlOutputBufferPtr(n_buf, buf, 0);
3420         des_xmlDocPtr(n_doc, doc, 1);
3421         des_xmlNodePtr(n_cur, cur, 2);
3422         des_const_char_ptr(n_encoding, (const char *)encoding, 3);
3423         des_int(n_format, format, 4);
3424         xmlResetLastError();
3425         if (mem_base != xmlMemBlocks()) {
3426             printf("Leak of %d blocks found in htmlNodeDumpFormatOutput",
3427 	           xmlMemBlocks() - mem_base);
3428 	    test_ret++;
3429             printf(" %d", n_buf);
3430             printf(" %d", n_doc);
3431             printf(" %d", n_cur);
3432             printf(" %d", n_encoding);
3433             printf(" %d", n_format);
3434             printf("\n");
3435         }
3436     }
3437     }
3438     }
3439     }
3440     }
3441     function_tests++;
3442 #endif
3443 
3444     return(test_ret);
3445 }
3446 
3447 
3448 static int
test_htmlNodeDumpOutput(void)3449 test_htmlNodeDumpOutput(void) {
3450     int test_ret = 0;
3451 
3452 #if defined(LIBXML_HTML_ENABLED) && defined(LIBXML_OUTPUT_ENABLED)
3453     int mem_base;
3454     xmlOutputBufferPtr buf; /* the HTML buffer output */
3455     int n_buf;
3456     xmlDocPtr doc; /* the document */
3457     int n_doc;
3458     xmlNodePtr cur; /* the current node */
3459     int n_cur;
3460     char * encoding; /* the encoding string */
3461     int n_encoding;
3462 
3463     for (n_buf = 0;n_buf < gen_nb_xmlOutputBufferPtr;n_buf++) {
3464     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
3465     for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
3466     for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
3467         mem_base = xmlMemBlocks();
3468         buf = gen_xmlOutputBufferPtr(n_buf, 0);
3469         doc = gen_xmlDocPtr(n_doc, 1);
3470         cur = gen_xmlNodePtr(n_cur, 2);
3471         encoding = gen_const_char_ptr(n_encoding, 3);
3472 
3473         htmlNodeDumpOutput(buf, doc, cur, (const char *)encoding);
3474         call_tests++;
3475         des_xmlOutputBufferPtr(n_buf, buf, 0);
3476         des_xmlDocPtr(n_doc, doc, 1);
3477         des_xmlNodePtr(n_cur, cur, 2);
3478         des_const_char_ptr(n_encoding, (const char *)encoding, 3);
3479         xmlResetLastError();
3480         if (mem_base != xmlMemBlocks()) {
3481             printf("Leak of %d blocks found in htmlNodeDumpOutput",
3482 	           xmlMemBlocks() - mem_base);
3483 	    test_ret++;
3484             printf(" %d", n_buf);
3485             printf(" %d", n_doc);
3486             printf(" %d", n_cur);
3487             printf(" %d", n_encoding);
3488             printf("\n");
3489         }
3490     }
3491     }
3492     }
3493     }
3494     function_tests++;
3495 #endif
3496 
3497     return(test_ret);
3498 }
3499 
3500 
3501 static int
test_htmlSaveFile(void)3502 test_htmlSaveFile(void) {
3503     int test_ret = 0;
3504 
3505 #if defined(LIBXML_HTML_ENABLED) && defined(LIBXML_OUTPUT_ENABLED)
3506     int mem_base;
3507     int ret_val;
3508     const char * filename; /* the filename (or URL) */
3509     int n_filename;
3510     xmlDocPtr cur; /* the document */
3511     int n_cur;
3512 
3513     for (n_filename = 0;n_filename < gen_nb_fileoutput;n_filename++) {
3514     for (n_cur = 0;n_cur < gen_nb_xmlDocPtr;n_cur++) {
3515         mem_base = xmlMemBlocks();
3516         filename = gen_fileoutput(n_filename, 0);
3517         cur = gen_xmlDocPtr(n_cur, 1);
3518 
3519         ret_val = htmlSaveFile(filename, cur);
3520         desret_int(ret_val);
3521         call_tests++;
3522         des_fileoutput(n_filename, filename, 0);
3523         des_xmlDocPtr(n_cur, cur, 1);
3524         xmlResetLastError();
3525         if (mem_base != xmlMemBlocks()) {
3526             printf("Leak of %d blocks found in htmlSaveFile",
3527 	           xmlMemBlocks() - mem_base);
3528 	    test_ret++;
3529             printf(" %d", n_filename);
3530             printf(" %d", n_cur);
3531             printf("\n");
3532         }
3533     }
3534     }
3535     function_tests++;
3536 #endif
3537 
3538     return(test_ret);
3539 }
3540 
3541 
3542 static int
test_htmlSaveFileEnc(void)3543 test_htmlSaveFileEnc(void) {
3544     int test_ret = 0;
3545 
3546 #if defined(LIBXML_HTML_ENABLED) && defined(LIBXML_OUTPUT_ENABLED)
3547     int mem_base;
3548     int ret_val;
3549     const char * filename; /* the filename */
3550     int n_filename;
3551     xmlDocPtr cur; /* the document */
3552     int n_cur;
3553     char * encoding; /* the document encoding */
3554     int n_encoding;
3555 
3556     for (n_filename = 0;n_filename < gen_nb_fileoutput;n_filename++) {
3557     for (n_cur = 0;n_cur < gen_nb_xmlDocPtr;n_cur++) {
3558     for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
3559         mem_base = xmlMemBlocks();
3560         filename = gen_fileoutput(n_filename, 0);
3561         cur = gen_xmlDocPtr(n_cur, 1);
3562         encoding = gen_const_char_ptr(n_encoding, 2);
3563 
3564         ret_val = htmlSaveFileEnc(filename, cur, (const char *)encoding);
3565         desret_int(ret_val);
3566         call_tests++;
3567         des_fileoutput(n_filename, filename, 0);
3568         des_xmlDocPtr(n_cur, cur, 1);
3569         des_const_char_ptr(n_encoding, (const char *)encoding, 2);
3570         xmlResetLastError();
3571         if (mem_base != xmlMemBlocks()) {
3572             printf("Leak of %d blocks found in htmlSaveFileEnc",
3573 	           xmlMemBlocks() - mem_base);
3574 	    test_ret++;
3575             printf(" %d", n_filename);
3576             printf(" %d", n_cur);
3577             printf(" %d", n_encoding);
3578             printf("\n");
3579         }
3580     }
3581     }
3582     }
3583     function_tests++;
3584 #endif
3585 
3586     return(test_ret);
3587 }
3588 
3589 
3590 static int
test_htmlSaveFileFormat(void)3591 test_htmlSaveFileFormat(void) {
3592     int test_ret = 0;
3593 
3594 #if defined(LIBXML_HTML_ENABLED) && defined(LIBXML_OUTPUT_ENABLED)
3595     int mem_base;
3596     int ret_val;
3597     const char * filename; /* the filename */
3598     int n_filename;
3599     xmlDocPtr cur; /* the document */
3600     int n_cur;
3601     char * encoding; /* the document encoding */
3602     int n_encoding;
3603     int format; /* should formatting spaces been added */
3604     int n_format;
3605 
3606     for (n_filename = 0;n_filename < gen_nb_fileoutput;n_filename++) {
3607     for (n_cur = 0;n_cur < gen_nb_xmlDocPtr;n_cur++) {
3608     for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
3609     for (n_format = 0;n_format < gen_nb_int;n_format++) {
3610         mem_base = xmlMemBlocks();
3611         filename = gen_fileoutput(n_filename, 0);
3612         cur = gen_xmlDocPtr(n_cur, 1);
3613         encoding = gen_const_char_ptr(n_encoding, 2);
3614         format = gen_int(n_format, 3);
3615 
3616         ret_val = htmlSaveFileFormat(filename, cur, (const char *)encoding, format);
3617         desret_int(ret_val);
3618         call_tests++;
3619         des_fileoutput(n_filename, filename, 0);
3620         des_xmlDocPtr(n_cur, cur, 1);
3621         des_const_char_ptr(n_encoding, (const char *)encoding, 2);
3622         des_int(n_format, format, 3);
3623         xmlResetLastError();
3624         if (mem_base != xmlMemBlocks()) {
3625             printf("Leak of %d blocks found in htmlSaveFileFormat",
3626 	           xmlMemBlocks() - mem_base);
3627 	    test_ret++;
3628             printf(" %d", n_filename);
3629             printf(" %d", n_cur);
3630             printf(" %d", n_encoding);
3631             printf(" %d", n_format);
3632             printf("\n");
3633         }
3634     }
3635     }
3636     }
3637     }
3638     function_tests++;
3639 #endif
3640 
3641     return(test_ret);
3642 }
3643 
3644 
3645 static int
test_htmlSetMetaEncoding(void)3646 test_htmlSetMetaEncoding(void) {
3647     int test_ret = 0;
3648 
3649 #if defined(LIBXML_HTML_ENABLED)
3650     int mem_base;
3651     int ret_val;
3652     htmlDocPtr doc; /* the document */
3653     int n_doc;
3654     xmlChar * encoding; /* the encoding string */
3655     int n_encoding;
3656 
3657     for (n_doc = 0;n_doc < gen_nb_htmlDocPtr;n_doc++) {
3658     for (n_encoding = 0;n_encoding < gen_nb_const_xmlChar_ptr;n_encoding++) {
3659         mem_base = xmlMemBlocks();
3660         doc = gen_htmlDocPtr(n_doc, 0);
3661         encoding = gen_const_xmlChar_ptr(n_encoding, 1);
3662 
3663         ret_val = htmlSetMetaEncoding(doc, (const xmlChar *)encoding);
3664         desret_int(ret_val);
3665         call_tests++;
3666         des_htmlDocPtr(n_doc, doc, 0);
3667         des_const_xmlChar_ptr(n_encoding, (const xmlChar *)encoding, 1);
3668         xmlResetLastError();
3669         if (mem_base != xmlMemBlocks()) {
3670             printf("Leak of %d blocks found in htmlSetMetaEncoding",
3671 	           xmlMemBlocks() - mem_base);
3672 	    test_ret++;
3673             printf(" %d", n_doc);
3674             printf(" %d", n_encoding);
3675             printf("\n");
3676         }
3677     }
3678     }
3679     function_tests++;
3680 #endif
3681 
3682     return(test_ret);
3683 }
3684 
3685 static int
test_HTMLtree(void)3686 test_HTMLtree(void) {
3687     int test_ret = 0;
3688 
3689     if (quiet == 0) printf("Testing HTMLtree : 18 of 18 functions ...\n");
3690     test_ret += test_htmlDocContentDumpFormatOutput();
3691     test_ret += test_htmlDocContentDumpOutput();
3692     test_ret += test_htmlDocDump();
3693     test_ret += test_htmlDocDumpMemory();
3694     test_ret += test_htmlDocDumpMemoryFormat();
3695     test_ret += test_htmlGetMetaEncoding();
3696     test_ret += test_htmlIsBooleanAttr();
3697     test_ret += test_htmlNewDoc();
3698     test_ret += test_htmlNewDocNoDtD();
3699     test_ret += test_htmlNodeDump();
3700     test_ret += test_htmlNodeDumpFile();
3701     test_ret += test_htmlNodeDumpFileFormat();
3702     test_ret += test_htmlNodeDumpFormatOutput();
3703     test_ret += test_htmlNodeDumpOutput();
3704     test_ret += test_htmlSaveFile();
3705     test_ret += test_htmlSaveFileEnc();
3706     test_ret += test_htmlSaveFileFormat();
3707     test_ret += test_htmlSetMetaEncoding();
3708 
3709     if (test_ret != 0)
3710 	printf("Module HTMLtree: %d errors\n", test_ret);
3711     return(test_ret);
3712 }
3713 
3714 static int
test_docbDefaultSAXHandlerInit(void)3715 test_docbDefaultSAXHandlerInit(void) {
3716     int test_ret = 0;
3717 
3718 #if defined(LIBXML_DOCB_ENABLED)
3719 #ifdef LIBXML_DOCB_ENABLED
3720     int mem_base;
3721 
3722         mem_base = xmlMemBlocks();
3723 
3724         docbDefaultSAXHandlerInit();
3725         call_tests++;
3726         xmlResetLastError();
3727         if (mem_base != xmlMemBlocks()) {
3728             printf("Leak of %d blocks found in docbDefaultSAXHandlerInit",
3729 	           xmlMemBlocks() - mem_base);
3730 	    test_ret++;
3731             printf("\n");
3732         }
3733     function_tests++;
3734 #endif
3735 #endif
3736 
3737     return(test_ret);
3738 }
3739 
3740 
3741 static int
test_htmlDefaultSAXHandlerInit(void)3742 test_htmlDefaultSAXHandlerInit(void) {
3743     int test_ret = 0;
3744 
3745 #if defined(LIBXML_HTML_ENABLED)
3746 #ifdef LIBXML_HTML_ENABLED
3747     int mem_base;
3748 
3749         mem_base = xmlMemBlocks();
3750 
3751         htmlDefaultSAXHandlerInit();
3752         call_tests++;
3753         xmlResetLastError();
3754         if (mem_base != xmlMemBlocks()) {
3755             printf("Leak of %d blocks found in htmlDefaultSAXHandlerInit",
3756 	           xmlMemBlocks() - mem_base);
3757 	    test_ret++;
3758             printf("\n");
3759         }
3760     function_tests++;
3761 #endif
3762 #endif
3763 
3764     return(test_ret);
3765 }
3766 
3767 
3768 static int
test_xmlDefaultSAXHandlerInit(void)3769 test_xmlDefaultSAXHandlerInit(void) {
3770     int test_ret = 0;
3771 
3772     int mem_base;
3773 
3774         mem_base = xmlMemBlocks();
3775 
3776         xmlDefaultSAXHandlerInit();
3777         call_tests++;
3778         xmlResetLastError();
3779         if (mem_base != xmlMemBlocks()) {
3780             printf("Leak of %d blocks found in xmlDefaultSAXHandlerInit",
3781 	           xmlMemBlocks() - mem_base);
3782 	    test_ret++;
3783             printf("\n");
3784         }
3785     function_tests++;
3786 
3787     return(test_ret);
3788 }
3789 
3790 
3791 #define gen_nb_xmlEnumerationPtr 1
gen_xmlEnumerationPtr(int no ATTRIBUTE_UNUSED,int nr ATTRIBUTE_UNUSED)3792 static xmlEnumerationPtr gen_xmlEnumerationPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
3793     return(NULL);
3794 }
des_xmlEnumerationPtr(int no ATTRIBUTE_UNUSED,xmlEnumerationPtr val ATTRIBUTE_UNUSED,int nr ATTRIBUTE_UNUSED)3795 static void des_xmlEnumerationPtr(int no ATTRIBUTE_UNUSED, xmlEnumerationPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
3796 }
3797 
3798 static int
test_xmlSAX2AttributeDecl(void)3799 test_xmlSAX2AttributeDecl(void) {
3800     int test_ret = 0;
3801 
3802     int mem_base;
3803     void * ctx; /* the user data (XML parser context) */
3804     int n_ctx;
3805     xmlChar * elem; /* the name of the element */
3806     int n_elem;
3807     xmlChar * fullname; /* the attribute name */
3808     int n_fullname;
3809     int type; /* the attribute type */
3810     int n_type;
3811     int def; /* the type of default value */
3812     int n_def;
3813     xmlChar * defaultValue; /* the attribute default value */
3814     int n_defaultValue;
3815     xmlEnumerationPtr tree; /* the tree of enumerated value set */
3816     int n_tree;
3817 
3818     for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
3819     for (n_elem = 0;n_elem < gen_nb_const_xmlChar_ptr;n_elem++) {
3820     for (n_fullname = 0;n_fullname < gen_nb_const_xmlChar_ptr;n_fullname++) {
3821     for (n_type = 0;n_type < gen_nb_int;n_type++) {
3822     for (n_def = 0;n_def < gen_nb_int;n_def++) {
3823     for (n_defaultValue = 0;n_defaultValue < gen_nb_const_xmlChar_ptr;n_defaultValue++) {
3824     for (n_tree = 0;n_tree < gen_nb_xmlEnumerationPtr;n_tree++) {
3825         mem_base = xmlMemBlocks();
3826         ctx = gen_void_ptr(n_ctx, 0);
3827         elem = gen_const_xmlChar_ptr(n_elem, 1);
3828         fullname = gen_const_xmlChar_ptr(n_fullname, 2);
3829         type = gen_int(n_type, 3);
3830         def = gen_int(n_def, 4);
3831         defaultValue = gen_const_xmlChar_ptr(n_defaultValue, 5);
3832         tree = gen_xmlEnumerationPtr(n_tree, 6);
3833 
3834         xmlSAX2AttributeDecl(ctx, (const xmlChar *)elem, (const xmlChar *)fullname, type, def, (const xmlChar *)defaultValue, tree);
3835         call_tests++;
3836         des_void_ptr(n_ctx, ctx, 0);
3837         des_const_xmlChar_ptr(n_elem, (const xmlChar *)elem, 1);
3838         des_const_xmlChar_ptr(n_fullname, (const xmlChar *)fullname, 2);
3839         des_int(n_type, type, 3);
3840         des_int(n_def, def, 4);
3841         des_const_xmlChar_ptr(n_defaultValue, (const xmlChar *)defaultValue, 5);
3842         des_xmlEnumerationPtr(n_tree, tree, 6);
3843         xmlResetLastError();
3844         if (mem_base != xmlMemBlocks()) {
3845             printf("Leak of %d blocks found in xmlSAX2AttributeDecl",
3846 	           xmlMemBlocks() - mem_base);
3847 	    test_ret++;
3848             printf(" %d", n_ctx);
3849             printf(" %d", n_elem);
3850             printf(" %d", n_fullname);
3851             printf(" %d", n_type);
3852             printf(" %d", n_def);
3853             printf(" %d", n_defaultValue);
3854             printf(" %d", n_tree);
3855             printf("\n");
3856         }
3857     }
3858     }
3859     }
3860     }
3861     }
3862     }
3863     }
3864     function_tests++;
3865 
3866     return(test_ret);
3867 }
3868 
3869 
3870 static int
test_xmlSAX2CDataBlock(void)3871 test_xmlSAX2CDataBlock(void) {
3872     int test_ret = 0;
3873 
3874     int mem_base;
3875     void * ctx; /* the user data (XML parser context) */
3876     int n_ctx;
3877     xmlChar * value; /* The pcdata content */
3878     int n_value;
3879     int len; /* the block length */
3880     int n_len;
3881 
3882     for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
3883     for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
3884     for (n_len = 0;n_len < gen_nb_int;n_len++) {
3885         mem_base = xmlMemBlocks();
3886         ctx = gen_void_ptr(n_ctx, 0);
3887         value = gen_const_xmlChar_ptr(n_value, 1);
3888         len = gen_int(n_len, 2);
3889         if ((value != NULL) &&
3890             (len > (int) strlen((const char *) value) + 1))
3891             continue;
3892 
3893         xmlSAX2CDataBlock(ctx, (const xmlChar *)value, len);
3894         call_tests++;
3895         des_void_ptr(n_ctx, ctx, 0);
3896         des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 1);
3897         des_int(n_len, len, 2);
3898         xmlResetLastError();
3899         if (mem_base != xmlMemBlocks()) {
3900             printf("Leak of %d blocks found in xmlSAX2CDataBlock",
3901 	           xmlMemBlocks() - mem_base);
3902 	    test_ret++;
3903             printf(" %d", n_ctx);
3904             printf(" %d", n_value);
3905             printf(" %d", n_len);
3906             printf("\n");
3907         }
3908     }
3909     }
3910     }
3911     function_tests++;
3912 
3913     return(test_ret);
3914 }
3915 
3916 
3917 static int
test_xmlSAX2Characters(void)3918 test_xmlSAX2Characters(void) {
3919     int test_ret = 0;
3920 
3921     int mem_base;
3922     void * ctx; /* the user data (XML parser context) */
3923     int n_ctx;
3924     xmlChar * ch; /* a xmlChar string */
3925     int n_ch;
3926     int len; /* the number of xmlChar */
3927     int n_len;
3928 
3929     for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
3930     for (n_ch = 0;n_ch < gen_nb_const_xmlChar_ptr;n_ch++) {
3931     for (n_len = 0;n_len < gen_nb_int;n_len++) {
3932         mem_base = xmlMemBlocks();
3933         ctx = gen_void_ptr(n_ctx, 0);
3934         ch = gen_const_xmlChar_ptr(n_ch, 1);
3935         len = gen_int(n_len, 2);
3936         if ((ch != NULL) &&
3937             (len > (int) strlen((const char *) ch) + 1))
3938             continue;
3939 
3940         xmlSAX2Characters(ctx, (const xmlChar *)ch, len);
3941         call_tests++;
3942         des_void_ptr(n_ctx, ctx, 0);
3943         des_const_xmlChar_ptr(n_ch, (const xmlChar *)ch, 1);
3944         des_int(n_len, len, 2);
3945         xmlResetLastError();
3946         if (mem_base != xmlMemBlocks()) {
3947             printf("Leak of %d blocks found in xmlSAX2Characters",
3948 	           xmlMemBlocks() - mem_base);
3949 	    test_ret++;
3950             printf(" %d", n_ctx);
3951             printf(" %d", n_ch);
3952             printf(" %d", n_len);
3953             printf("\n");
3954         }
3955     }
3956     }
3957     }
3958     function_tests++;
3959 
3960     return(test_ret);
3961 }
3962 
3963 
3964 static int
test_xmlSAX2Comment(void)3965 test_xmlSAX2Comment(void) {
3966     int test_ret = 0;
3967 
3968     int mem_base;
3969     void * ctx; /* the user data (XML parser context) */
3970     int n_ctx;
3971     xmlChar * value; /* the xmlSAX2Comment content */
3972     int n_value;
3973 
3974     for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
3975     for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
3976         mem_base = xmlMemBlocks();
3977         ctx = gen_void_ptr(n_ctx, 0);
3978         value = gen_const_xmlChar_ptr(n_value, 1);
3979 
3980         xmlSAX2Comment(ctx, (const xmlChar *)value);
3981         call_tests++;
3982         des_void_ptr(n_ctx, ctx, 0);
3983         des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 1);
3984         xmlResetLastError();
3985         if (mem_base != xmlMemBlocks()) {
3986             printf("Leak of %d blocks found in xmlSAX2Comment",
3987 	           xmlMemBlocks() - mem_base);
3988 	    test_ret++;
3989             printf(" %d", n_ctx);
3990             printf(" %d", n_value);
3991             printf("\n");
3992         }
3993     }
3994     }
3995     function_tests++;
3996 
3997     return(test_ret);
3998 }
3999 
4000 
4001 static int
test_xmlSAX2ElementDecl(void)4002 test_xmlSAX2ElementDecl(void) {
4003     int test_ret = 0;
4004 
4005     int mem_base;
4006     void * ctx; /* the user data (XML parser context) */
4007     int n_ctx;
4008     xmlChar * name; /* the element name */
4009     int n_name;
4010     int type; /* the element type */
4011     int n_type;
4012     xmlElementContentPtr content; /* the element value tree */
4013     int n_content;
4014 
4015     for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
4016     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
4017     for (n_type = 0;n_type < gen_nb_int;n_type++) {
4018     for (n_content = 0;n_content < gen_nb_xmlElementContentPtr;n_content++) {
4019         mem_base = xmlMemBlocks();
4020         ctx = gen_void_ptr(n_ctx, 0);
4021         name = gen_const_xmlChar_ptr(n_name, 1);
4022         type = gen_int(n_type, 2);
4023         content = gen_xmlElementContentPtr(n_content, 3);
4024 
4025         xmlSAX2ElementDecl(ctx, (const xmlChar *)name, type, content);
4026         call_tests++;
4027         des_void_ptr(n_ctx, ctx, 0);
4028         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
4029         des_int(n_type, type, 2);
4030         des_xmlElementContentPtr(n_content, content, 3);
4031         xmlResetLastError();
4032         if (mem_base != xmlMemBlocks()) {
4033             printf("Leak of %d blocks found in xmlSAX2ElementDecl",
4034 	           xmlMemBlocks() - mem_base);
4035 	    test_ret++;
4036             printf(" %d", n_ctx);
4037             printf(" %d", n_name);
4038             printf(" %d", n_type);
4039             printf(" %d", n_content);
4040             printf("\n");
4041         }
4042     }
4043     }
4044     }
4045     }
4046     function_tests++;
4047 
4048     return(test_ret);
4049 }
4050 
4051 
4052 static int
test_xmlSAX2EndDocument(void)4053 test_xmlSAX2EndDocument(void) {
4054     int test_ret = 0;
4055 
4056     int mem_base;
4057     void * ctx; /* the user data (XML parser context) */
4058     int n_ctx;
4059 
4060     for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
4061         mem_base = xmlMemBlocks();
4062         ctx = gen_void_ptr(n_ctx, 0);
4063 
4064         xmlSAX2EndDocument(ctx);
4065         call_tests++;
4066         des_void_ptr(n_ctx, ctx, 0);
4067         xmlResetLastError();
4068         if (mem_base != xmlMemBlocks()) {
4069             printf("Leak of %d blocks found in xmlSAX2EndDocument",
4070 	           xmlMemBlocks() - mem_base);
4071 	    test_ret++;
4072             printf(" %d", n_ctx);
4073             printf("\n");
4074         }
4075     }
4076     function_tests++;
4077 
4078     return(test_ret);
4079 }
4080 
4081 
4082 static int
test_xmlSAX2EndElement(void)4083 test_xmlSAX2EndElement(void) {
4084     int test_ret = 0;
4085 
4086 #if defined(LIBXML_SAX1_ENABLED) || defined(LIBXML_HTML_ENABLED) || defined(LIBXML_WRITER_ENABLED) || defined(LIBXML_DOCB_ENABLED) || defined(LIBXML_LEGACY_ENABLED)
4087 #ifdef LIBXML_SAX1_ENABLED
4088     int mem_base;
4089     void * ctx; /* the user data (XML parser context) */
4090     int n_ctx;
4091     xmlChar * name; /* The element name */
4092     int n_name;
4093 
4094     for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
4095     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
4096         mem_base = xmlMemBlocks();
4097         ctx = gen_void_ptr(n_ctx, 0);
4098         name = gen_const_xmlChar_ptr(n_name, 1);
4099 
4100         xmlSAX2EndElement(ctx, (const xmlChar *)name);
4101         call_tests++;
4102         des_void_ptr(n_ctx, ctx, 0);
4103         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
4104         xmlResetLastError();
4105         if (mem_base != xmlMemBlocks()) {
4106             printf("Leak of %d blocks found in xmlSAX2EndElement",
4107 	           xmlMemBlocks() - mem_base);
4108 	    test_ret++;
4109             printf(" %d", n_ctx);
4110             printf(" %d", n_name);
4111             printf("\n");
4112         }
4113     }
4114     }
4115     function_tests++;
4116 #endif
4117 #endif
4118 
4119     return(test_ret);
4120 }
4121 
4122 
4123 static int
test_xmlSAX2EndElementNs(void)4124 test_xmlSAX2EndElementNs(void) {
4125     int test_ret = 0;
4126 
4127     int mem_base;
4128     void * ctx; /* the user data (XML parser context) */
4129     int n_ctx;
4130     xmlChar * localname; /* the local name of the element */
4131     int n_localname;
4132     xmlChar * prefix; /* the element namespace prefix if available */
4133     int n_prefix;
4134     xmlChar * URI; /* the element namespace name if available */
4135     int n_URI;
4136 
4137     for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
4138     for (n_localname = 0;n_localname < gen_nb_const_xmlChar_ptr;n_localname++) {
4139     for (n_prefix = 0;n_prefix < gen_nb_const_xmlChar_ptr;n_prefix++) {
4140     for (n_URI = 0;n_URI < gen_nb_const_xmlChar_ptr;n_URI++) {
4141         mem_base = xmlMemBlocks();
4142         ctx = gen_void_ptr(n_ctx, 0);
4143         localname = gen_const_xmlChar_ptr(n_localname, 1);
4144         prefix = gen_const_xmlChar_ptr(n_prefix, 2);
4145         URI = gen_const_xmlChar_ptr(n_URI, 3);
4146 
4147         xmlSAX2EndElementNs(ctx, (const xmlChar *)localname, (const xmlChar *)prefix, (const xmlChar *)URI);
4148         call_tests++;
4149         des_void_ptr(n_ctx, ctx, 0);
4150         des_const_xmlChar_ptr(n_localname, (const xmlChar *)localname, 1);
4151         des_const_xmlChar_ptr(n_prefix, (const xmlChar *)prefix, 2);
4152         des_const_xmlChar_ptr(n_URI, (const xmlChar *)URI, 3);
4153         xmlResetLastError();
4154         if (mem_base != xmlMemBlocks()) {
4155             printf("Leak of %d blocks found in xmlSAX2EndElementNs",
4156 	           xmlMemBlocks() - mem_base);
4157 	    test_ret++;
4158             printf(" %d", n_ctx);
4159             printf(" %d", n_localname);
4160             printf(" %d", n_prefix);
4161             printf(" %d", n_URI);
4162             printf("\n");
4163         }
4164     }
4165     }
4166     }
4167     }
4168     function_tests++;
4169 
4170     return(test_ret);
4171 }
4172 
4173 
4174 static int
test_xmlSAX2EntityDecl(void)4175 test_xmlSAX2EntityDecl(void) {
4176     int test_ret = 0;
4177 
4178     int mem_base;
4179     void * ctx; /* the user data (XML parser context) */
4180     int n_ctx;
4181     xmlChar * name; /* the entity name */
4182     int n_name;
4183     int type; /* the entity type */
4184     int n_type;
4185     xmlChar * publicId; /* The public ID of the entity */
4186     int n_publicId;
4187     xmlChar * systemId; /* The system ID of the entity */
4188     int n_systemId;
4189     xmlChar * content; /* the entity value (without processing). */
4190     int n_content;
4191 
4192     for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
4193     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
4194     for (n_type = 0;n_type < gen_nb_int;n_type++) {
4195     for (n_publicId = 0;n_publicId < gen_nb_const_xmlChar_ptr;n_publicId++) {
4196     for (n_systemId = 0;n_systemId < gen_nb_const_xmlChar_ptr;n_systemId++) {
4197     for (n_content = 0;n_content < gen_nb_xmlChar_ptr;n_content++) {
4198         mem_base = xmlMemBlocks();
4199         ctx = gen_void_ptr(n_ctx, 0);
4200         name = gen_const_xmlChar_ptr(n_name, 1);
4201         type = gen_int(n_type, 2);
4202         publicId = gen_const_xmlChar_ptr(n_publicId, 3);
4203         systemId = gen_const_xmlChar_ptr(n_systemId, 4);
4204         content = gen_xmlChar_ptr(n_content, 5);
4205 
4206         xmlSAX2EntityDecl(ctx, (const xmlChar *)name, type, (const xmlChar *)publicId, (const xmlChar *)systemId, content);
4207         call_tests++;
4208         des_void_ptr(n_ctx, ctx, 0);
4209         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
4210         des_int(n_type, type, 2);
4211         des_const_xmlChar_ptr(n_publicId, (const xmlChar *)publicId, 3);
4212         des_const_xmlChar_ptr(n_systemId, (const xmlChar *)systemId, 4);
4213         des_xmlChar_ptr(n_content, content, 5);
4214         xmlResetLastError();
4215         if (mem_base != xmlMemBlocks()) {
4216             printf("Leak of %d blocks found in xmlSAX2EntityDecl",
4217 	           xmlMemBlocks() - mem_base);
4218 	    test_ret++;
4219             printf(" %d", n_ctx);
4220             printf(" %d", n_name);
4221             printf(" %d", n_type);
4222             printf(" %d", n_publicId);
4223             printf(" %d", n_systemId);
4224             printf(" %d", n_content);
4225             printf("\n");
4226         }
4227     }
4228     }
4229     }
4230     }
4231     }
4232     }
4233     function_tests++;
4234 
4235     return(test_ret);
4236 }
4237 
4238 
4239 static int
test_xmlSAX2ExternalSubset(void)4240 test_xmlSAX2ExternalSubset(void) {
4241     int test_ret = 0;
4242 
4243     int mem_base;
4244     void * ctx; /* the user data (XML parser context) */
4245     int n_ctx;
4246     xmlChar * name; /* the root element name */
4247     int n_name;
4248     xmlChar * ExternalID; /* the external ID */
4249     int n_ExternalID;
4250     xmlChar * SystemID; /* the SYSTEM ID (e.g. filename or URL) */
4251     int n_SystemID;
4252 
4253     for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
4254     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
4255     for (n_ExternalID = 0;n_ExternalID < gen_nb_const_xmlChar_ptr;n_ExternalID++) {
4256     for (n_SystemID = 0;n_SystemID < gen_nb_const_xmlChar_ptr;n_SystemID++) {
4257         mem_base = xmlMemBlocks();
4258         ctx = gen_void_ptr(n_ctx, 0);
4259         name = gen_const_xmlChar_ptr(n_name, 1);
4260         ExternalID = gen_const_xmlChar_ptr(n_ExternalID, 2);
4261         SystemID = gen_const_xmlChar_ptr(n_SystemID, 3);
4262 
4263         xmlSAX2ExternalSubset(ctx, (const xmlChar *)name, (const xmlChar *)ExternalID, (const xmlChar *)SystemID);
4264         call_tests++;
4265         des_void_ptr(n_ctx, ctx, 0);
4266         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
4267         des_const_xmlChar_ptr(n_ExternalID, (const xmlChar *)ExternalID, 2);
4268         des_const_xmlChar_ptr(n_SystemID, (const xmlChar *)SystemID, 3);
4269         xmlResetLastError();
4270         if (mem_base != xmlMemBlocks()) {
4271             printf("Leak of %d blocks found in xmlSAX2ExternalSubset",
4272 	           xmlMemBlocks() - mem_base);
4273 	    test_ret++;
4274             printf(" %d", n_ctx);
4275             printf(" %d", n_name);
4276             printf(" %d", n_ExternalID);
4277             printf(" %d", n_SystemID);
4278             printf("\n");
4279         }
4280     }
4281     }
4282     }
4283     }
4284     function_tests++;
4285 
4286     return(test_ret);
4287 }
4288 
4289 
4290 static int
test_xmlSAX2GetColumnNumber(void)4291 test_xmlSAX2GetColumnNumber(void) {
4292     int test_ret = 0;
4293 
4294     int mem_base;
4295     int ret_val;
4296     void * ctx; /* the user data (XML parser context) */
4297     int n_ctx;
4298 
4299     for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
4300         mem_base = xmlMemBlocks();
4301         ctx = gen_void_ptr(n_ctx, 0);
4302 
4303         ret_val = xmlSAX2GetColumnNumber(ctx);
4304         desret_int(ret_val);
4305         call_tests++;
4306         des_void_ptr(n_ctx, ctx, 0);
4307         xmlResetLastError();
4308         if (mem_base != xmlMemBlocks()) {
4309             printf("Leak of %d blocks found in xmlSAX2GetColumnNumber",
4310 	           xmlMemBlocks() - mem_base);
4311 	    test_ret++;
4312             printf(" %d", n_ctx);
4313             printf("\n");
4314         }
4315     }
4316     function_tests++;
4317 
4318     return(test_ret);
4319 }
4320 
4321 
4322 static int
test_xmlSAX2GetEntity(void)4323 test_xmlSAX2GetEntity(void) {
4324     int test_ret = 0;
4325 
4326     int mem_base;
4327     xmlEntityPtr ret_val;
4328     void * ctx; /* the user data (XML parser context) */
4329     int n_ctx;
4330     xmlChar * name; /* The entity name */
4331     int n_name;
4332 
4333     for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
4334     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
4335         mem_base = xmlMemBlocks();
4336         ctx = gen_void_ptr(n_ctx, 0);
4337         name = gen_const_xmlChar_ptr(n_name, 1);
4338 
4339         ret_val = xmlSAX2GetEntity(ctx, (const xmlChar *)name);
4340         desret_xmlEntityPtr(ret_val);
4341         call_tests++;
4342         des_void_ptr(n_ctx, ctx, 0);
4343         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
4344         xmlResetLastError();
4345         if (mem_base != xmlMemBlocks()) {
4346             printf("Leak of %d blocks found in xmlSAX2GetEntity",
4347 	           xmlMemBlocks() - mem_base);
4348 	    test_ret++;
4349             printf(" %d", n_ctx);
4350             printf(" %d", n_name);
4351             printf("\n");
4352         }
4353     }
4354     }
4355     function_tests++;
4356 
4357     return(test_ret);
4358 }
4359 
4360 
4361 static int
test_xmlSAX2GetLineNumber(void)4362 test_xmlSAX2GetLineNumber(void) {
4363     int test_ret = 0;
4364 
4365     int mem_base;
4366     int ret_val;
4367     void * ctx; /* the user data (XML parser context) */
4368     int n_ctx;
4369 
4370     for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
4371         mem_base = xmlMemBlocks();
4372         ctx = gen_void_ptr(n_ctx, 0);
4373 
4374         ret_val = xmlSAX2GetLineNumber(ctx);
4375         desret_int(ret_val);
4376         call_tests++;
4377         des_void_ptr(n_ctx, ctx, 0);
4378         xmlResetLastError();
4379         if (mem_base != xmlMemBlocks()) {
4380             printf("Leak of %d blocks found in xmlSAX2GetLineNumber",
4381 	           xmlMemBlocks() - mem_base);
4382 	    test_ret++;
4383             printf(" %d", n_ctx);
4384             printf("\n");
4385         }
4386     }
4387     function_tests++;
4388 
4389     return(test_ret);
4390 }
4391 
4392 
4393 static int
test_xmlSAX2GetParameterEntity(void)4394 test_xmlSAX2GetParameterEntity(void) {
4395     int test_ret = 0;
4396 
4397     int mem_base;
4398     xmlEntityPtr ret_val;
4399     void * ctx; /* the user data (XML parser context) */
4400     int n_ctx;
4401     xmlChar * name; /* The entity name */
4402     int n_name;
4403 
4404     for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
4405     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
4406         mem_base = xmlMemBlocks();
4407         ctx = gen_void_ptr(n_ctx, 0);
4408         name = gen_const_xmlChar_ptr(n_name, 1);
4409 
4410         ret_val = xmlSAX2GetParameterEntity(ctx, (const xmlChar *)name);
4411         desret_xmlEntityPtr(ret_val);
4412         call_tests++;
4413         des_void_ptr(n_ctx, ctx, 0);
4414         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
4415         xmlResetLastError();
4416         if (mem_base != xmlMemBlocks()) {
4417             printf("Leak of %d blocks found in xmlSAX2GetParameterEntity",
4418 	           xmlMemBlocks() - mem_base);
4419 	    test_ret++;
4420             printf(" %d", n_ctx);
4421             printf(" %d", n_name);
4422             printf("\n");
4423         }
4424     }
4425     }
4426     function_tests++;
4427 
4428     return(test_ret);
4429 }
4430 
4431 
4432 static int
test_xmlSAX2GetPublicId(void)4433 test_xmlSAX2GetPublicId(void) {
4434     int test_ret = 0;
4435 
4436     int mem_base;
4437     const xmlChar * ret_val;
4438     void * ctx; /* the user data (XML parser context) */
4439     int n_ctx;
4440 
4441     for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
4442         mem_base = xmlMemBlocks();
4443         ctx = gen_void_ptr(n_ctx, 0);
4444 
4445         ret_val = xmlSAX2GetPublicId(ctx);
4446         desret_const_xmlChar_ptr(ret_val);
4447         call_tests++;
4448         des_void_ptr(n_ctx, ctx, 0);
4449         xmlResetLastError();
4450         if (mem_base != xmlMemBlocks()) {
4451             printf("Leak of %d blocks found in xmlSAX2GetPublicId",
4452 	           xmlMemBlocks() - mem_base);
4453 	    test_ret++;
4454             printf(" %d", n_ctx);
4455             printf("\n");
4456         }
4457     }
4458     function_tests++;
4459 
4460     return(test_ret);
4461 }
4462 
4463 
4464 static int
test_xmlSAX2GetSystemId(void)4465 test_xmlSAX2GetSystemId(void) {
4466     int test_ret = 0;
4467 
4468     int mem_base;
4469     const xmlChar * ret_val;
4470     void * ctx; /* the user data (XML parser context) */
4471     int n_ctx;
4472 
4473     for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
4474         mem_base = xmlMemBlocks();
4475         ctx = gen_void_ptr(n_ctx, 0);
4476 
4477         ret_val = xmlSAX2GetSystemId(ctx);
4478         desret_const_xmlChar_ptr(ret_val);
4479         call_tests++;
4480         des_void_ptr(n_ctx, ctx, 0);
4481         xmlResetLastError();
4482         if (mem_base != xmlMemBlocks()) {
4483             printf("Leak of %d blocks found in xmlSAX2GetSystemId",
4484 	           xmlMemBlocks() - mem_base);
4485 	    test_ret++;
4486             printf(" %d", n_ctx);
4487             printf("\n");
4488         }
4489     }
4490     function_tests++;
4491 
4492     return(test_ret);
4493 }
4494 
4495 
4496 static int
test_xmlSAX2HasExternalSubset(void)4497 test_xmlSAX2HasExternalSubset(void) {
4498     int test_ret = 0;
4499 
4500     int mem_base;
4501     int ret_val;
4502     void * ctx; /* the user data (XML parser context) */
4503     int n_ctx;
4504 
4505     for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
4506         mem_base = xmlMemBlocks();
4507         ctx = gen_void_ptr(n_ctx, 0);
4508 
4509         ret_val = xmlSAX2HasExternalSubset(ctx);
4510         desret_int(ret_val);
4511         call_tests++;
4512         des_void_ptr(n_ctx, ctx, 0);
4513         xmlResetLastError();
4514         if (mem_base != xmlMemBlocks()) {
4515             printf("Leak of %d blocks found in xmlSAX2HasExternalSubset",
4516 	           xmlMemBlocks() - mem_base);
4517 	    test_ret++;
4518             printf(" %d", n_ctx);
4519             printf("\n");
4520         }
4521     }
4522     function_tests++;
4523 
4524     return(test_ret);
4525 }
4526 
4527 
4528 static int
test_xmlSAX2HasInternalSubset(void)4529 test_xmlSAX2HasInternalSubset(void) {
4530     int test_ret = 0;
4531 
4532     int mem_base;
4533     int ret_val;
4534     void * ctx; /* the user data (XML parser context) */
4535     int n_ctx;
4536 
4537     for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
4538         mem_base = xmlMemBlocks();
4539         ctx = gen_void_ptr(n_ctx, 0);
4540 
4541         ret_val = xmlSAX2HasInternalSubset(ctx);
4542         desret_int(ret_val);
4543         call_tests++;
4544         des_void_ptr(n_ctx, ctx, 0);
4545         xmlResetLastError();
4546         if (mem_base != xmlMemBlocks()) {
4547             printf("Leak of %d blocks found in xmlSAX2HasInternalSubset",
4548 	           xmlMemBlocks() - mem_base);
4549 	    test_ret++;
4550             printf(" %d", n_ctx);
4551             printf("\n");
4552         }
4553     }
4554     function_tests++;
4555 
4556     return(test_ret);
4557 }
4558 
4559 
4560 static int
test_xmlSAX2IgnorableWhitespace(void)4561 test_xmlSAX2IgnorableWhitespace(void) {
4562     int test_ret = 0;
4563 
4564     int mem_base;
4565     void * ctx; /* the user data (XML parser context) */
4566     int n_ctx;
4567     xmlChar * ch; /* a xmlChar string */
4568     int n_ch;
4569     int len; /* the number of xmlChar */
4570     int n_len;
4571 
4572     for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
4573     for (n_ch = 0;n_ch < gen_nb_const_xmlChar_ptr;n_ch++) {
4574     for (n_len = 0;n_len < gen_nb_int;n_len++) {
4575         mem_base = xmlMemBlocks();
4576         ctx = gen_void_ptr(n_ctx, 0);
4577         ch = gen_const_xmlChar_ptr(n_ch, 1);
4578         len = gen_int(n_len, 2);
4579         if ((ch != NULL) &&
4580             (len > (int) strlen((const char *) ch) + 1))
4581             continue;
4582 
4583         xmlSAX2IgnorableWhitespace(ctx, (const xmlChar *)ch, len);
4584         call_tests++;
4585         des_void_ptr(n_ctx, ctx, 0);
4586         des_const_xmlChar_ptr(n_ch, (const xmlChar *)ch, 1);
4587         des_int(n_len, len, 2);
4588         xmlResetLastError();
4589         if (mem_base != xmlMemBlocks()) {
4590             printf("Leak of %d blocks found in xmlSAX2IgnorableWhitespace",
4591 	           xmlMemBlocks() - mem_base);
4592 	    test_ret++;
4593             printf(" %d", n_ctx);
4594             printf(" %d", n_ch);
4595             printf(" %d", n_len);
4596             printf("\n");
4597         }
4598     }
4599     }
4600     }
4601     function_tests++;
4602 
4603     return(test_ret);
4604 }
4605 
4606 
4607 #define gen_nb_xmlSAXHandler_ptr 1
gen_xmlSAXHandler_ptr(int no ATTRIBUTE_UNUSED,int nr ATTRIBUTE_UNUSED)4608 static xmlSAXHandler * gen_xmlSAXHandler_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
4609     return(NULL);
4610 }
des_xmlSAXHandler_ptr(int no ATTRIBUTE_UNUSED,xmlSAXHandler * val ATTRIBUTE_UNUSED,int nr ATTRIBUTE_UNUSED)4611 static void des_xmlSAXHandler_ptr(int no ATTRIBUTE_UNUSED, xmlSAXHandler * val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
4612 }
4613 
4614 static int
test_xmlSAX2InitDefaultSAXHandler(void)4615 test_xmlSAX2InitDefaultSAXHandler(void) {
4616     int test_ret = 0;
4617 
4618     int mem_base;
4619     xmlSAXHandler * hdlr; /* the SAX handler */
4620     int n_hdlr;
4621     int warning; /* flag if non-zero sets the handler warning procedure */
4622     int n_warning;
4623 
4624     for (n_hdlr = 0;n_hdlr < gen_nb_xmlSAXHandler_ptr;n_hdlr++) {
4625     for (n_warning = 0;n_warning < gen_nb_int;n_warning++) {
4626         mem_base = xmlMemBlocks();
4627         hdlr = gen_xmlSAXHandler_ptr(n_hdlr, 0);
4628         warning = gen_int(n_warning, 1);
4629 
4630         xmlSAX2InitDefaultSAXHandler(hdlr, warning);
4631         call_tests++;
4632         des_xmlSAXHandler_ptr(n_hdlr, hdlr, 0);
4633         des_int(n_warning, warning, 1);
4634         xmlResetLastError();
4635         if (mem_base != xmlMemBlocks()) {
4636             printf("Leak of %d blocks found in xmlSAX2InitDefaultSAXHandler",
4637 	           xmlMemBlocks() - mem_base);
4638 	    test_ret++;
4639             printf(" %d", n_hdlr);
4640             printf(" %d", n_warning);
4641             printf("\n");
4642         }
4643     }
4644     }
4645     function_tests++;
4646 
4647     return(test_ret);
4648 }
4649 
4650 
4651 static int
test_xmlSAX2InitDocbDefaultSAXHandler(void)4652 test_xmlSAX2InitDocbDefaultSAXHandler(void) {
4653     int test_ret = 0;
4654 
4655 #if defined(LIBXML_DOCB_ENABLED)
4656     int mem_base;
4657     xmlSAXHandler * hdlr; /* the SAX handler */
4658     int n_hdlr;
4659 
4660     for (n_hdlr = 0;n_hdlr < gen_nb_xmlSAXHandler_ptr;n_hdlr++) {
4661         mem_base = xmlMemBlocks();
4662         hdlr = gen_xmlSAXHandler_ptr(n_hdlr, 0);
4663 
4664         xmlSAX2InitDocbDefaultSAXHandler(hdlr);
4665         call_tests++;
4666         des_xmlSAXHandler_ptr(n_hdlr, hdlr, 0);
4667         xmlResetLastError();
4668         if (mem_base != xmlMemBlocks()) {
4669             printf("Leak of %d blocks found in xmlSAX2InitDocbDefaultSAXHandler",
4670 	           xmlMemBlocks() - mem_base);
4671 	    test_ret++;
4672             printf(" %d", n_hdlr);
4673             printf("\n");
4674         }
4675     }
4676     function_tests++;
4677 #endif
4678 
4679     return(test_ret);
4680 }
4681 
4682 
4683 static int
test_xmlSAX2InitHtmlDefaultSAXHandler(void)4684 test_xmlSAX2InitHtmlDefaultSAXHandler(void) {
4685     int test_ret = 0;
4686 
4687 #if defined(LIBXML_HTML_ENABLED)
4688     int mem_base;
4689     xmlSAXHandler * hdlr; /* the SAX handler */
4690     int n_hdlr;
4691 
4692     for (n_hdlr = 0;n_hdlr < gen_nb_xmlSAXHandler_ptr;n_hdlr++) {
4693         mem_base = xmlMemBlocks();
4694         hdlr = gen_xmlSAXHandler_ptr(n_hdlr, 0);
4695 
4696         xmlSAX2InitHtmlDefaultSAXHandler(hdlr);
4697         call_tests++;
4698         des_xmlSAXHandler_ptr(n_hdlr, hdlr, 0);
4699         xmlResetLastError();
4700         if (mem_base != xmlMemBlocks()) {
4701             printf("Leak of %d blocks found in xmlSAX2InitHtmlDefaultSAXHandler",
4702 	           xmlMemBlocks() - mem_base);
4703 	    test_ret++;
4704             printf(" %d", n_hdlr);
4705             printf("\n");
4706         }
4707     }
4708     function_tests++;
4709 #endif
4710 
4711     return(test_ret);
4712 }
4713 
4714 
4715 static int
test_xmlSAX2InternalSubset(void)4716 test_xmlSAX2InternalSubset(void) {
4717     int test_ret = 0;
4718 
4719     int mem_base;
4720     void * ctx; /* the user data (XML parser context) */
4721     int n_ctx;
4722     xmlChar * name; /* the root element name */
4723     int n_name;
4724     xmlChar * ExternalID; /* the external ID */
4725     int n_ExternalID;
4726     xmlChar * SystemID; /* the SYSTEM ID (e.g. filename or URL) */
4727     int n_SystemID;
4728 
4729     for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
4730     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
4731     for (n_ExternalID = 0;n_ExternalID < gen_nb_const_xmlChar_ptr;n_ExternalID++) {
4732     for (n_SystemID = 0;n_SystemID < gen_nb_const_xmlChar_ptr;n_SystemID++) {
4733         mem_base = xmlMemBlocks();
4734         ctx = gen_void_ptr(n_ctx, 0);
4735         name = gen_const_xmlChar_ptr(n_name, 1);
4736         ExternalID = gen_const_xmlChar_ptr(n_ExternalID, 2);
4737         SystemID = gen_const_xmlChar_ptr(n_SystemID, 3);
4738 
4739         xmlSAX2InternalSubset(ctx, (const xmlChar *)name, (const xmlChar *)ExternalID, (const xmlChar *)SystemID);
4740         call_tests++;
4741         des_void_ptr(n_ctx, ctx, 0);
4742         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
4743         des_const_xmlChar_ptr(n_ExternalID, (const xmlChar *)ExternalID, 2);
4744         des_const_xmlChar_ptr(n_SystemID, (const xmlChar *)SystemID, 3);
4745         xmlResetLastError();
4746         if (mem_base != xmlMemBlocks()) {
4747             printf("Leak of %d blocks found in xmlSAX2InternalSubset",
4748 	           xmlMemBlocks() - mem_base);
4749 	    test_ret++;
4750             printf(" %d", n_ctx);
4751             printf(" %d", n_name);
4752             printf(" %d", n_ExternalID);
4753             printf(" %d", n_SystemID);
4754             printf("\n");
4755         }
4756     }
4757     }
4758     }
4759     }
4760     function_tests++;
4761 
4762     return(test_ret);
4763 }
4764 
4765 
4766 static int
test_xmlSAX2IsStandalone(void)4767 test_xmlSAX2IsStandalone(void) {
4768     int test_ret = 0;
4769 
4770     int mem_base;
4771     int ret_val;
4772     void * ctx; /* the user data (XML parser context) */
4773     int n_ctx;
4774 
4775     for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
4776         mem_base = xmlMemBlocks();
4777         ctx = gen_void_ptr(n_ctx, 0);
4778 
4779         ret_val = xmlSAX2IsStandalone(ctx);
4780         desret_int(ret_val);
4781         call_tests++;
4782         des_void_ptr(n_ctx, ctx, 0);
4783         xmlResetLastError();
4784         if (mem_base != xmlMemBlocks()) {
4785             printf("Leak of %d blocks found in xmlSAX2IsStandalone",
4786 	           xmlMemBlocks() - mem_base);
4787 	    test_ret++;
4788             printf(" %d", n_ctx);
4789             printf("\n");
4790         }
4791     }
4792     function_tests++;
4793 
4794     return(test_ret);
4795 }
4796 
4797 
4798 static int
test_xmlSAX2NotationDecl(void)4799 test_xmlSAX2NotationDecl(void) {
4800     int test_ret = 0;
4801 
4802     int mem_base;
4803     void * ctx; /* the user data (XML parser context) */
4804     int n_ctx;
4805     xmlChar * name; /* The name of the notation */
4806     int n_name;
4807     xmlChar * publicId; /* The public ID of the entity */
4808     int n_publicId;
4809     xmlChar * systemId; /* The system ID of the entity */
4810     int n_systemId;
4811 
4812     for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
4813     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
4814     for (n_publicId = 0;n_publicId < gen_nb_const_xmlChar_ptr;n_publicId++) {
4815     for (n_systemId = 0;n_systemId < gen_nb_const_xmlChar_ptr;n_systemId++) {
4816         mem_base = xmlMemBlocks();
4817         ctx = gen_void_ptr(n_ctx, 0);
4818         name = gen_const_xmlChar_ptr(n_name, 1);
4819         publicId = gen_const_xmlChar_ptr(n_publicId, 2);
4820         systemId = gen_const_xmlChar_ptr(n_systemId, 3);
4821 
4822         xmlSAX2NotationDecl(ctx, (const xmlChar *)name, (const xmlChar *)publicId, (const xmlChar *)systemId);
4823         call_tests++;
4824         des_void_ptr(n_ctx, ctx, 0);
4825         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
4826         des_const_xmlChar_ptr(n_publicId, (const xmlChar *)publicId, 2);
4827         des_const_xmlChar_ptr(n_systemId, (const xmlChar *)systemId, 3);
4828         xmlResetLastError();
4829         if (mem_base != xmlMemBlocks()) {
4830             printf("Leak of %d blocks found in xmlSAX2NotationDecl",
4831 	           xmlMemBlocks() - mem_base);
4832 	    test_ret++;
4833             printf(" %d", n_ctx);
4834             printf(" %d", n_name);
4835             printf(" %d", n_publicId);
4836             printf(" %d", n_systemId);
4837             printf("\n");
4838         }
4839     }
4840     }
4841     }
4842     }
4843     function_tests++;
4844 
4845     return(test_ret);
4846 }
4847 
4848 
4849 static int
test_xmlSAX2ProcessingInstruction(void)4850 test_xmlSAX2ProcessingInstruction(void) {
4851     int test_ret = 0;
4852 
4853     int mem_base;
4854     void * ctx; /* the user data (XML parser context) */
4855     int n_ctx;
4856     xmlChar * target; /* the target name */
4857     int n_target;
4858     xmlChar * data; /* the PI data's */
4859     int n_data;
4860 
4861     for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
4862     for (n_target = 0;n_target < gen_nb_const_xmlChar_ptr;n_target++) {
4863     for (n_data = 0;n_data < gen_nb_const_xmlChar_ptr;n_data++) {
4864         mem_base = xmlMemBlocks();
4865         ctx = gen_void_ptr(n_ctx, 0);
4866         target = gen_const_xmlChar_ptr(n_target, 1);
4867         data = gen_const_xmlChar_ptr(n_data, 2);
4868 
4869         xmlSAX2ProcessingInstruction(ctx, (const xmlChar *)target, (const xmlChar *)data);
4870         call_tests++;
4871         des_void_ptr(n_ctx, ctx, 0);
4872         des_const_xmlChar_ptr(n_target, (const xmlChar *)target, 1);
4873         des_const_xmlChar_ptr(n_data, (const xmlChar *)data, 2);
4874         xmlResetLastError();
4875         if (mem_base != xmlMemBlocks()) {
4876             printf("Leak of %d blocks found in xmlSAX2ProcessingInstruction",
4877 	           xmlMemBlocks() - mem_base);
4878 	    test_ret++;
4879             printf(" %d", n_ctx);
4880             printf(" %d", n_target);
4881             printf(" %d", n_data);
4882             printf("\n");
4883         }
4884     }
4885     }
4886     }
4887     function_tests++;
4888 
4889     return(test_ret);
4890 }
4891 
4892 
4893 static int
test_xmlSAX2Reference(void)4894 test_xmlSAX2Reference(void) {
4895     int test_ret = 0;
4896 
4897     int mem_base;
4898     void * ctx; /* the user data (XML parser context) */
4899     int n_ctx;
4900     xmlChar * name; /* The entity name */
4901     int n_name;
4902 
4903     for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
4904     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
4905         mem_base = xmlMemBlocks();
4906         ctx = gen_void_ptr(n_ctx, 0);
4907         name = gen_const_xmlChar_ptr(n_name, 1);
4908 
4909         xmlSAX2Reference(ctx, (const xmlChar *)name);
4910         call_tests++;
4911         des_void_ptr(n_ctx, ctx, 0);
4912         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
4913         xmlResetLastError();
4914         if (mem_base != xmlMemBlocks()) {
4915             printf("Leak of %d blocks found in xmlSAX2Reference",
4916 	           xmlMemBlocks() - mem_base);
4917 	    test_ret++;
4918             printf(" %d", n_ctx);
4919             printf(" %d", n_name);
4920             printf("\n");
4921         }
4922     }
4923     }
4924     function_tests++;
4925 
4926     return(test_ret);
4927 }
4928 
4929 
4930 static int
test_xmlSAX2ResolveEntity(void)4931 test_xmlSAX2ResolveEntity(void) {
4932     int test_ret = 0;
4933 
4934     int mem_base;
4935     xmlParserInputPtr ret_val;
4936     void * ctx; /* the user data (XML parser context) */
4937     int n_ctx;
4938     xmlChar * publicId; /* The public ID of the entity */
4939     int n_publicId;
4940     xmlChar * systemId; /* The system ID of the entity */
4941     int n_systemId;
4942 
4943     for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
4944     for (n_publicId = 0;n_publicId < gen_nb_const_xmlChar_ptr;n_publicId++) {
4945     for (n_systemId = 0;n_systemId < gen_nb_const_xmlChar_ptr;n_systemId++) {
4946         mem_base = xmlMemBlocks();
4947         ctx = gen_void_ptr(n_ctx, 0);
4948         publicId = gen_const_xmlChar_ptr(n_publicId, 1);
4949         systemId = gen_const_xmlChar_ptr(n_systemId, 2);
4950 
4951         ret_val = xmlSAX2ResolveEntity(ctx, (const xmlChar *)publicId, (const xmlChar *)systemId);
4952         desret_xmlParserInputPtr(ret_val);
4953         call_tests++;
4954         des_void_ptr(n_ctx, ctx, 0);
4955         des_const_xmlChar_ptr(n_publicId, (const xmlChar *)publicId, 1);
4956         des_const_xmlChar_ptr(n_systemId, (const xmlChar *)systemId, 2);
4957         xmlResetLastError();
4958         if (mem_base != xmlMemBlocks()) {
4959             printf("Leak of %d blocks found in xmlSAX2ResolveEntity",
4960 	           xmlMemBlocks() - mem_base);
4961 	    test_ret++;
4962             printf(" %d", n_ctx);
4963             printf(" %d", n_publicId);
4964             printf(" %d", n_systemId);
4965             printf("\n");
4966         }
4967     }
4968     }
4969     }
4970     function_tests++;
4971 
4972     return(test_ret);
4973 }
4974 
4975 
4976 #define gen_nb_xmlSAXLocatorPtr 1
gen_xmlSAXLocatorPtr(int no ATTRIBUTE_UNUSED,int nr ATTRIBUTE_UNUSED)4977 static xmlSAXLocatorPtr gen_xmlSAXLocatorPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
4978     return(NULL);
4979 }
des_xmlSAXLocatorPtr(int no ATTRIBUTE_UNUSED,xmlSAXLocatorPtr val ATTRIBUTE_UNUSED,int nr ATTRIBUTE_UNUSED)4980 static void des_xmlSAXLocatorPtr(int no ATTRIBUTE_UNUSED, xmlSAXLocatorPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
4981 }
4982 
4983 static int
test_xmlSAX2SetDocumentLocator(void)4984 test_xmlSAX2SetDocumentLocator(void) {
4985     int test_ret = 0;
4986 
4987     int mem_base;
4988     void * ctx; /* the user data (XML parser context) */
4989     int n_ctx;
4990     xmlSAXLocatorPtr loc; /* A SAX Locator */
4991     int n_loc;
4992 
4993     for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
4994     for (n_loc = 0;n_loc < gen_nb_xmlSAXLocatorPtr;n_loc++) {
4995         mem_base = xmlMemBlocks();
4996         ctx = gen_void_ptr(n_ctx, 0);
4997         loc = gen_xmlSAXLocatorPtr(n_loc, 1);
4998 
4999         xmlSAX2SetDocumentLocator(ctx, loc);
5000         call_tests++;
5001         des_void_ptr(n_ctx, ctx, 0);
5002         des_xmlSAXLocatorPtr(n_loc, loc, 1);
5003         xmlResetLastError();
5004         if (mem_base != xmlMemBlocks()) {
5005             printf("Leak of %d blocks found in xmlSAX2SetDocumentLocator",
5006 	           xmlMemBlocks() - mem_base);
5007 	    test_ret++;
5008             printf(" %d", n_ctx);
5009             printf(" %d", n_loc);
5010             printf("\n");
5011         }
5012     }
5013     }
5014     function_tests++;
5015 
5016     return(test_ret);
5017 }
5018 
5019 
5020 static int
test_xmlSAX2StartDocument(void)5021 test_xmlSAX2StartDocument(void) {
5022     int test_ret = 0;
5023 
5024     int mem_base;
5025     void * ctx; /* the user data (XML parser context) */
5026     int n_ctx;
5027 
5028     for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
5029         mem_base = xmlMemBlocks();
5030         ctx = gen_void_ptr(n_ctx, 0);
5031 
5032         xmlSAX2StartDocument(ctx);
5033         call_tests++;
5034         des_void_ptr(n_ctx, ctx, 0);
5035         xmlResetLastError();
5036         if (mem_base != xmlMemBlocks()) {
5037             printf("Leak of %d blocks found in xmlSAX2StartDocument",
5038 	           xmlMemBlocks() - mem_base);
5039 	    test_ret++;
5040             printf(" %d", n_ctx);
5041             printf("\n");
5042         }
5043     }
5044     function_tests++;
5045 
5046     return(test_ret);
5047 }
5048 
5049 
5050 static int
test_xmlSAX2StartElement(void)5051 test_xmlSAX2StartElement(void) {
5052     int test_ret = 0;
5053 
5054 #if defined(LIBXML_SAX1_ENABLED) || defined(LIBXML_HTML_ENABLED) || defined(LIBXML_WRITER_ENABLED) || defined(LIBXML_DOCB_ENABLED) || defined(LIBXML_LEGACY_ENABLED)
5055 #ifdef LIBXML_SAX1_ENABLED
5056     int mem_base;
5057     void * ctx; /* the user data (XML parser context) */
5058     int n_ctx;
5059     xmlChar * fullname; /* The element name, including namespace prefix */
5060     int n_fullname;
5061     xmlChar ** atts; /* An array of name/value attributes pairs, NULL terminated */
5062     int n_atts;
5063 
5064     for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
5065     for (n_fullname = 0;n_fullname < gen_nb_const_xmlChar_ptr;n_fullname++) {
5066     for (n_atts = 0;n_atts < gen_nb_const_xmlChar_ptr_ptr;n_atts++) {
5067         mem_base = xmlMemBlocks();
5068         ctx = gen_void_ptr(n_ctx, 0);
5069         fullname = gen_const_xmlChar_ptr(n_fullname, 1);
5070         atts = gen_const_xmlChar_ptr_ptr(n_atts, 2);
5071 
5072         xmlSAX2StartElement(ctx, (const xmlChar *)fullname, (const xmlChar **)atts);
5073         call_tests++;
5074         des_void_ptr(n_ctx, ctx, 0);
5075         des_const_xmlChar_ptr(n_fullname, (const xmlChar *)fullname, 1);
5076         des_const_xmlChar_ptr_ptr(n_atts, (const xmlChar **)atts, 2);
5077         xmlResetLastError();
5078         if (mem_base != xmlMemBlocks()) {
5079             printf("Leak of %d blocks found in xmlSAX2StartElement",
5080 	           xmlMemBlocks() - mem_base);
5081 	    test_ret++;
5082             printf(" %d", n_ctx);
5083             printf(" %d", n_fullname);
5084             printf(" %d", n_atts);
5085             printf("\n");
5086         }
5087     }
5088     }
5089     }
5090     function_tests++;
5091 #endif
5092 #endif
5093 
5094     return(test_ret);
5095 }
5096 
5097 
5098 static int
test_xmlSAX2StartElementNs(void)5099 test_xmlSAX2StartElementNs(void) {
5100     int test_ret = 0;
5101 
5102     int mem_base;
5103     void * ctx; /* the user data (XML parser context) */
5104     int n_ctx;
5105     xmlChar * localname; /* the local name of the element */
5106     int n_localname;
5107     xmlChar * prefix; /* the element namespace prefix if available */
5108     int n_prefix;
5109     xmlChar * URI; /* the element namespace name if available */
5110     int n_URI;
5111     int nb_namespaces; /* number of namespace definitions on that node */
5112     int n_nb_namespaces;
5113     xmlChar ** namespaces; /* pointer to the array of prefix/URI pairs namespace definitions */
5114     int n_namespaces;
5115     int nb_attributes; /* the number of attributes on that node */
5116     int n_nb_attributes;
5117     int nb_defaulted; /* the number of defaulted attributes. */
5118     int n_nb_defaulted;
5119     xmlChar ** attributes; /* pointer to the array of (localname/prefix/URI/value/end) attribute values. */
5120     int n_attributes;
5121 
5122     for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
5123     for (n_localname = 0;n_localname < gen_nb_const_xmlChar_ptr;n_localname++) {
5124     for (n_prefix = 0;n_prefix < gen_nb_const_xmlChar_ptr;n_prefix++) {
5125     for (n_URI = 0;n_URI < gen_nb_const_xmlChar_ptr;n_URI++) {
5126     for (n_nb_namespaces = 0;n_nb_namespaces < gen_nb_int;n_nb_namespaces++) {
5127     for (n_namespaces = 0;n_namespaces < gen_nb_const_xmlChar_ptr_ptr;n_namespaces++) {
5128     for (n_nb_attributes = 0;n_nb_attributes < gen_nb_int;n_nb_attributes++) {
5129     for (n_nb_defaulted = 0;n_nb_defaulted < gen_nb_int;n_nb_defaulted++) {
5130     for (n_attributes = 0;n_attributes < gen_nb_const_xmlChar_ptr_ptr;n_attributes++) {
5131         mem_base = xmlMemBlocks();
5132         ctx = gen_void_ptr(n_ctx, 0);
5133         localname = gen_const_xmlChar_ptr(n_localname, 1);
5134         prefix = gen_const_xmlChar_ptr(n_prefix, 2);
5135         URI = gen_const_xmlChar_ptr(n_URI, 3);
5136         nb_namespaces = gen_int(n_nb_namespaces, 4);
5137         namespaces = gen_const_xmlChar_ptr_ptr(n_namespaces, 5);
5138         nb_attributes = gen_int(n_nb_attributes, 6);
5139         nb_defaulted = gen_int(n_nb_defaulted, 7);
5140         attributes = gen_const_xmlChar_ptr_ptr(n_attributes, 8);
5141 
5142         xmlSAX2StartElementNs(ctx, (const xmlChar *)localname, (const xmlChar *)prefix, (const xmlChar *)URI, nb_namespaces, (const xmlChar **)namespaces, nb_attributes, nb_defaulted, (const xmlChar **)attributes);
5143         call_tests++;
5144         des_void_ptr(n_ctx, ctx, 0);
5145         des_const_xmlChar_ptr(n_localname, (const xmlChar *)localname, 1);
5146         des_const_xmlChar_ptr(n_prefix, (const xmlChar *)prefix, 2);
5147         des_const_xmlChar_ptr(n_URI, (const xmlChar *)URI, 3);
5148         des_int(n_nb_namespaces, nb_namespaces, 4);
5149         des_const_xmlChar_ptr_ptr(n_namespaces, (const xmlChar **)namespaces, 5);
5150         des_int(n_nb_attributes, nb_attributes, 6);
5151         des_int(n_nb_defaulted, nb_defaulted, 7);
5152         des_const_xmlChar_ptr_ptr(n_attributes, (const xmlChar **)attributes, 8);
5153         xmlResetLastError();
5154         if (mem_base != xmlMemBlocks()) {
5155             printf("Leak of %d blocks found in xmlSAX2StartElementNs",
5156 	           xmlMemBlocks() - mem_base);
5157 	    test_ret++;
5158             printf(" %d", n_ctx);
5159             printf(" %d", n_localname);
5160             printf(" %d", n_prefix);
5161             printf(" %d", n_URI);
5162             printf(" %d", n_nb_namespaces);
5163             printf(" %d", n_namespaces);
5164             printf(" %d", n_nb_attributes);
5165             printf(" %d", n_nb_defaulted);
5166             printf(" %d", n_attributes);
5167             printf("\n");
5168         }
5169     }
5170     }
5171     }
5172     }
5173     }
5174     }
5175     }
5176     }
5177     }
5178     function_tests++;
5179 
5180     return(test_ret);
5181 }
5182 
5183 
5184 static int
test_xmlSAX2UnparsedEntityDecl(void)5185 test_xmlSAX2UnparsedEntityDecl(void) {
5186     int test_ret = 0;
5187 
5188     int mem_base;
5189     void * ctx; /* the user data (XML parser context) */
5190     int n_ctx;
5191     xmlChar * name; /* The name of the entity */
5192     int n_name;
5193     xmlChar * publicId; /* The public ID of the entity */
5194     int n_publicId;
5195     xmlChar * systemId; /* The system ID of the entity */
5196     int n_systemId;
5197     xmlChar * notationName; /* the name of the notation */
5198     int n_notationName;
5199 
5200     for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
5201     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
5202     for (n_publicId = 0;n_publicId < gen_nb_const_xmlChar_ptr;n_publicId++) {
5203     for (n_systemId = 0;n_systemId < gen_nb_const_xmlChar_ptr;n_systemId++) {
5204     for (n_notationName = 0;n_notationName < gen_nb_const_xmlChar_ptr;n_notationName++) {
5205         mem_base = xmlMemBlocks();
5206         ctx = gen_void_ptr(n_ctx, 0);
5207         name = gen_const_xmlChar_ptr(n_name, 1);
5208         publicId = gen_const_xmlChar_ptr(n_publicId, 2);
5209         systemId = gen_const_xmlChar_ptr(n_systemId, 3);
5210         notationName = gen_const_xmlChar_ptr(n_notationName, 4);
5211 
5212         xmlSAX2UnparsedEntityDecl(ctx, (const xmlChar *)name, (const xmlChar *)publicId, (const xmlChar *)systemId, (const xmlChar *)notationName);
5213         call_tests++;
5214         des_void_ptr(n_ctx, ctx, 0);
5215         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
5216         des_const_xmlChar_ptr(n_publicId, (const xmlChar *)publicId, 2);
5217         des_const_xmlChar_ptr(n_systemId, (const xmlChar *)systemId, 3);
5218         des_const_xmlChar_ptr(n_notationName, (const xmlChar *)notationName, 4);
5219         xmlResetLastError();
5220         if (mem_base != xmlMemBlocks()) {
5221             printf("Leak of %d blocks found in xmlSAX2UnparsedEntityDecl",
5222 	           xmlMemBlocks() - mem_base);
5223 	    test_ret++;
5224             printf(" %d", n_ctx);
5225             printf(" %d", n_name);
5226             printf(" %d", n_publicId);
5227             printf(" %d", n_systemId);
5228             printf(" %d", n_notationName);
5229             printf("\n");
5230         }
5231     }
5232     }
5233     }
5234     }
5235     }
5236     function_tests++;
5237 
5238     return(test_ret);
5239 }
5240 
5241 
5242 static int
test_xmlSAXDefaultVersion(void)5243 test_xmlSAXDefaultVersion(void) {
5244     int test_ret = 0;
5245 
5246 #if defined(LIBXML_SAX1_ENABLED)
5247 #ifdef LIBXML_SAX1_ENABLED
5248     int mem_base;
5249     int ret_val;
5250     int version; /* the version, 1 or 2 */
5251     int n_version;
5252 
5253     for (n_version = 0;n_version < gen_nb_int;n_version++) {
5254         mem_base = xmlMemBlocks();
5255         version = gen_int(n_version, 0);
5256 
5257         ret_val = xmlSAXDefaultVersion(version);
5258         desret_int(ret_val);
5259         call_tests++;
5260         des_int(n_version, version, 0);
5261         xmlResetLastError();
5262         if (mem_base != xmlMemBlocks()) {
5263             printf("Leak of %d blocks found in xmlSAXDefaultVersion",
5264 	           xmlMemBlocks() - mem_base);
5265 	    test_ret++;
5266             printf(" %d", n_version);
5267             printf("\n");
5268         }
5269     }
5270     function_tests++;
5271 #endif
5272 #endif
5273 
5274     return(test_ret);
5275 }
5276 
5277 
5278 static int
test_xmlSAXVersion(void)5279 test_xmlSAXVersion(void) {
5280     int test_ret = 0;
5281 
5282     int mem_base;
5283     int ret_val;
5284     xmlSAXHandler * hdlr; /* the SAX handler */
5285     int n_hdlr;
5286     int version; /* the version, 1 or 2 */
5287     int n_version;
5288 
5289     for (n_hdlr = 0;n_hdlr < gen_nb_xmlSAXHandler_ptr;n_hdlr++) {
5290     for (n_version = 0;n_version < gen_nb_int;n_version++) {
5291         mem_base = xmlMemBlocks();
5292         hdlr = gen_xmlSAXHandler_ptr(n_hdlr, 0);
5293         version = gen_int(n_version, 1);
5294 
5295         ret_val = xmlSAXVersion(hdlr, version);
5296         desret_int(ret_val);
5297         call_tests++;
5298         des_xmlSAXHandler_ptr(n_hdlr, hdlr, 0);
5299         des_int(n_version, version, 1);
5300         xmlResetLastError();
5301         if (mem_base != xmlMemBlocks()) {
5302             printf("Leak of %d blocks found in xmlSAXVersion",
5303 	           xmlMemBlocks() - mem_base);
5304 	    test_ret++;
5305             printf(" %d", n_hdlr);
5306             printf(" %d", n_version);
5307             printf("\n");
5308         }
5309     }
5310     }
5311     function_tests++;
5312 
5313     return(test_ret);
5314 }
5315 
5316 static int
test_SAX2(void)5317 test_SAX2(void) {
5318     int test_ret = 0;
5319 
5320     if (quiet == 0) printf("Testing SAX2 : 38 of 38 functions ...\n");
5321     test_ret += test_docbDefaultSAXHandlerInit();
5322     test_ret += test_htmlDefaultSAXHandlerInit();
5323     test_ret += test_xmlDefaultSAXHandlerInit();
5324     test_ret += test_xmlSAX2AttributeDecl();
5325     test_ret += test_xmlSAX2CDataBlock();
5326     test_ret += test_xmlSAX2Characters();
5327     test_ret += test_xmlSAX2Comment();
5328     test_ret += test_xmlSAX2ElementDecl();
5329     test_ret += test_xmlSAX2EndDocument();
5330     test_ret += test_xmlSAX2EndElement();
5331     test_ret += test_xmlSAX2EndElementNs();
5332     test_ret += test_xmlSAX2EntityDecl();
5333     test_ret += test_xmlSAX2ExternalSubset();
5334     test_ret += test_xmlSAX2GetColumnNumber();
5335     test_ret += test_xmlSAX2GetEntity();
5336     test_ret += test_xmlSAX2GetLineNumber();
5337     test_ret += test_xmlSAX2GetParameterEntity();
5338     test_ret += test_xmlSAX2GetPublicId();
5339     test_ret += test_xmlSAX2GetSystemId();
5340     test_ret += test_xmlSAX2HasExternalSubset();
5341     test_ret += test_xmlSAX2HasInternalSubset();
5342     test_ret += test_xmlSAX2IgnorableWhitespace();
5343     test_ret += test_xmlSAX2InitDefaultSAXHandler();
5344     test_ret += test_xmlSAX2InitDocbDefaultSAXHandler();
5345     test_ret += test_xmlSAX2InitHtmlDefaultSAXHandler();
5346     test_ret += test_xmlSAX2InternalSubset();
5347     test_ret += test_xmlSAX2IsStandalone();
5348     test_ret += test_xmlSAX2NotationDecl();
5349     test_ret += test_xmlSAX2ProcessingInstruction();
5350     test_ret += test_xmlSAX2Reference();
5351     test_ret += test_xmlSAX2ResolveEntity();
5352     test_ret += test_xmlSAX2SetDocumentLocator();
5353     test_ret += test_xmlSAX2StartDocument();
5354     test_ret += test_xmlSAX2StartElement();
5355     test_ret += test_xmlSAX2StartElementNs();
5356     test_ret += test_xmlSAX2UnparsedEntityDecl();
5357     test_ret += test_xmlSAXDefaultVersion();
5358     test_ret += test_xmlSAXVersion();
5359 
5360     if (test_ret != 0)
5361 	printf("Module SAX2: %d errors\n", test_ret);
5362     return(test_ret);
5363 }
5364 
5365 static int
test_xmlC14NDocDumpMemory(void)5366 test_xmlC14NDocDumpMemory(void) {
5367     int test_ret = 0;
5368 
5369 #if defined(LIBXML_C14N_ENABLED) && defined(LIBXML_OUTPUT_ENABLED)
5370     int mem_base;
5371     int ret_val;
5372     xmlDocPtr doc; /* the XML document for canonization */
5373     int n_doc;
5374     xmlNodeSetPtr nodes; /* the nodes set to be included in the canonized image or NULL if all document nodes should be included */
5375     int n_nodes;
5376     int mode; /* the c14n mode (see @xmlC14NMode) */
5377     int n_mode;
5378     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) */
5379     int n_inclusive_ns_prefixes;
5380     int with_comments; /* include comments in the result (!=0) or not (==0) */
5381     int n_with_comments;
5382     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 */
5383     int n_doc_txt_ptr;
5384 
5385     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
5386     for (n_nodes = 0;n_nodes < gen_nb_xmlNodeSetPtr;n_nodes++) {
5387     for (n_mode = 0;n_mode < gen_nb_int;n_mode++) {
5388     for (n_inclusive_ns_prefixes = 0;n_inclusive_ns_prefixes < gen_nb_xmlChar_ptr_ptr;n_inclusive_ns_prefixes++) {
5389     for (n_with_comments = 0;n_with_comments < gen_nb_int;n_with_comments++) {
5390     for (n_doc_txt_ptr = 0;n_doc_txt_ptr < gen_nb_xmlChar_ptr_ptr;n_doc_txt_ptr++) {
5391         mem_base = xmlMemBlocks();
5392         doc = gen_xmlDocPtr(n_doc, 0);
5393         nodes = gen_xmlNodeSetPtr(n_nodes, 1);
5394         mode = gen_int(n_mode, 2);
5395         inclusive_ns_prefixes = gen_xmlChar_ptr_ptr(n_inclusive_ns_prefixes, 3);
5396         with_comments = gen_int(n_with_comments, 4);
5397         doc_txt_ptr = gen_xmlChar_ptr_ptr(n_doc_txt_ptr, 5);
5398 
5399         ret_val = xmlC14NDocDumpMemory(doc, nodes, mode, inclusive_ns_prefixes, with_comments, doc_txt_ptr);
5400         desret_int(ret_val);
5401         call_tests++;
5402         des_xmlDocPtr(n_doc, doc, 0);
5403         des_xmlNodeSetPtr(n_nodes, nodes, 1);
5404         des_int(n_mode, mode, 2);
5405         des_xmlChar_ptr_ptr(n_inclusive_ns_prefixes, inclusive_ns_prefixes, 3);
5406         des_int(n_with_comments, with_comments, 4);
5407         des_xmlChar_ptr_ptr(n_doc_txt_ptr, doc_txt_ptr, 5);
5408         xmlResetLastError();
5409         if (mem_base != xmlMemBlocks()) {
5410             printf("Leak of %d blocks found in xmlC14NDocDumpMemory",
5411 	           xmlMemBlocks() - mem_base);
5412 	    test_ret++;
5413             printf(" %d", n_doc);
5414             printf(" %d", n_nodes);
5415             printf(" %d", n_mode);
5416             printf(" %d", n_inclusive_ns_prefixes);
5417             printf(" %d", n_with_comments);
5418             printf(" %d", n_doc_txt_ptr);
5419             printf("\n");
5420         }
5421     }
5422     }
5423     }
5424     }
5425     }
5426     }
5427     function_tests++;
5428 #endif
5429 
5430     return(test_ret);
5431 }
5432 
5433 
5434 static int
test_xmlC14NDocSave(void)5435 test_xmlC14NDocSave(void) {
5436     int test_ret = 0;
5437 
5438 #if defined(LIBXML_C14N_ENABLED) && defined(LIBXML_OUTPUT_ENABLED)
5439     int mem_base;
5440     int ret_val;
5441     xmlDocPtr doc; /* the XML document for canonization */
5442     int n_doc;
5443     xmlNodeSetPtr nodes; /* the nodes set to be included in the canonized image or NULL if all document nodes should be included */
5444     int n_nodes;
5445     int mode; /* the c14n mode (see @xmlC14NMode) */
5446     int n_mode;
5447     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) */
5448     int n_inclusive_ns_prefixes;
5449     int with_comments; /* include comments in the result (!=0) or not (==0) */
5450     int n_with_comments;
5451     const char * filename; /* the filename to store canonical XML image */
5452     int n_filename;
5453     int compression; /* the compression level (zlib requred): -1 - libxml default, 0 - uncompressed, >0 - compression level */
5454     int n_compression;
5455 
5456     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
5457     for (n_nodes = 0;n_nodes < gen_nb_xmlNodeSetPtr;n_nodes++) {
5458     for (n_mode = 0;n_mode < gen_nb_int;n_mode++) {
5459     for (n_inclusive_ns_prefixes = 0;n_inclusive_ns_prefixes < gen_nb_xmlChar_ptr_ptr;n_inclusive_ns_prefixes++) {
5460     for (n_with_comments = 0;n_with_comments < gen_nb_int;n_with_comments++) {
5461     for (n_filename = 0;n_filename < gen_nb_fileoutput;n_filename++) {
5462     for (n_compression = 0;n_compression < gen_nb_int;n_compression++) {
5463         mem_base = xmlMemBlocks();
5464         doc = gen_xmlDocPtr(n_doc, 0);
5465         nodes = gen_xmlNodeSetPtr(n_nodes, 1);
5466         mode = gen_int(n_mode, 2);
5467         inclusive_ns_prefixes = gen_xmlChar_ptr_ptr(n_inclusive_ns_prefixes, 3);
5468         with_comments = gen_int(n_with_comments, 4);
5469         filename = gen_fileoutput(n_filename, 5);
5470         compression = gen_int(n_compression, 6);
5471 
5472         ret_val = xmlC14NDocSave(doc, nodes, mode, inclusive_ns_prefixes, with_comments, filename, compression);
5473         desret_int(ret_val);
5474         call_tests++;
5475         des_xmlDocPtr(n_doc, doc, 0);
5476         des_xmlNodeSetPtr(n_nodes, nodes, 1);
5477         des_int(n_mode, mode, 2);
5478         des_xmlChar_ptr_ptr(n_inclusive_ns_prefixes, inclusive_ns_prefixes, 3);
5479         des_int(n_with_comments, with_comments, 4);
5480         des_fileoutput(n_filename, filename, 5);
5481         des_int(n_compression, compression, 6);
5482         xmlResetLastError();
5483         if (mem_base != xmlMemBlocks()) {
5484             printf("Leak of %d blocks found in xmlC14NDocSave",
5485 	           xmlMemBlocks() - mem_base);
5486 	    test_ret++;
5487             printf(" %d", n_doc);
5488             printf(" %d", n_nodes);
5489             printf(" %d", n_mode);
5490             printf(" %d", n_inclusive_ns_prefixes);
5491             printf(" %d", n_with_comments);
5492             printf(" %d", n_filename);
5493             printf(" %d", n_compression);
5494             printf("\n");
5495         }
5496     }
5497     }
5498     }
5499     }
5500     }
5501     }
5502     }
5503     function_tests++;
5504 #endif
5505 
5506     return(test_ret);
5507 }
5508 
5509 
5510 static int
test_xmlC14NDocSaveTo(void)5511 test_xmlC14NDocSaveTo(void) {
5512     int test_ret = 0;
5513 
5514 #if defined(LIBXML_C14N_ENABLED) && defined(LIBXML_OUTPUT_ENABLED)
5515     int mem_base;
5516     int ret_val;
5517     xmlDocPtr doc; /* the XML document for canonization */
5518     int n_doc;
5519     xmlNodeSetPtr nodes; /* the nodes set to be included in the canonized image or NULL if all document nodes should be included */
5520     int n_nodes;
5521     int mode; /* the c14n mode (see @xmlC14NMode) */
5522     int n_mode;
5523     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) */
5524     int n_inclusive_ns_prefixes;
5525     int with_comments; /* include comments in the result (!=0) or not (==0) */
5526     int n_with_comments;
5527     xmlOutputBufferPtr buf; /* the output buffer to store canonical XML; this buffer MUST have encoder==NULL because C14N requires UTF-8 output */
5528     int n_buf;
5529 
5530     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
5531     for (n_nodes = 0;n_nodes < gen_nb_xmlNodeSetPtr;n_nodes++) {
5532     for (n_mode = 0;n_mode < gen_nb_int;n_mode++) {
5533     for (n_inclusive_ns_prefixes = 0;n_inclusive_ns_prefixes < gen_nb_xmlChar_ptr_ptr;n_inclusive_ns_prefixes++) {
5534     for (n_with_comments = 0;n_with_comments < gen_nb_int;n_with_comments++) {
5535     for (n_buf = 0;n_buf < gen_nb_xmlOutputBufferPtr;n_buf++) {
5536         mem_base = xmlMemBlocks();
5537         doc = gen_xmlDocPtr(n_doc, 0);
5538         nodes = gen_xmlNodeSetPtr(n_nodes, 1);
5539         mode = gen_int(n_mode, 2);
5540         inclusive_ns_prefixes = gen_xmlChar_ptr_ptr(n_inclusive_ns_prefixes, 3);
5541         with_comments = gen_int(n_with_comments, 4);
5542         buf = gen_xmlOutputBufferPtr(n_buf, 5);
5543 
5544         ret_val = xmlC14NDocSaveTo(doc, nodes, mode, inclusive_ns_prefixes, with_comments, buf);
5545         desret_int(ret_val);
5546         call_tests++;
5547         des_xmlDocPtr(n_doc, doc, 0);
5548         des_xmlNodeSetPtr(n_nodes, nodes, 1);
5549         des_int(n_mode, mode, 2);
5550         des_xmlChar_ptr_ptr(n_inclusive_ns_prefixes, inclusive_ns_prefixes, 3);
5551         des_int(n_with_comments, with_comments, 4);
5552         des_xmlOutputBufferPtr(n_buf, buf, 5);
5553         xmlResetLastError();
5554         if (mem_base != xmlMemBlocks()) {
5555             printf("Leak of %d blocks found in xmlC14NDocSaveTo",
5556 	           xmlMemBlocks() - mem_base);
5557 	    test_ret++;
5558             printf(" %d", n_doc);
5559             printf(" %d", n_nodes);
5560             printf(" %d", n_mode);
5561             printf(" %d", n_inclusive_ns_prefixes);
5562             printf(" %d", n_with_comments);
5563             printf(" %d", n_buf);
5564             printf("\n");
5565         }
5566     }
5567     }
5568     }
5569     }
5570     }
5571     }
5572     function_tests++;
5573 #endif
5574 
5575     return(test_ret);
5576 }
5577 
5578 
5579 static int
test_xmlC14NExecute(void)5580 test_xmlC14NExecute(void) {
5581     int test_ret = 0;
5582 
5583 
5584     /* missing type support */
5585     return(test_ret);
5586 }
5587 
5588 static int
test_c14n(void)5589 test_c14n(void) {
5590     int test_ret = 0;
5591 
5592     if (quiet == 0) printf("Testing c14n : 3 of 4 functions ...\n");
5593     test_ret += test_xmlC14NDocDumpMemory();
5594     test_ret += test_xmlC14NDocSave();
5595     test_ret += test_xmlC14NDocSaveTo();
5596     test_ret += test_xmlC14NExecute();
5597 
5598     if (test_ret != 0)
5599 	printf("Module c14n: %d errors\n", test_ret);
5600     return(test_ret);
5601 }
5602 #ifdef LIBXML_CATALOG_ENABLED
5603 
5604 #define gen_nb_xmlCatalogPtr 1
gen_xmlCatalogPtr(int no ATTRIBUTE_UNUSED,int nr ATTRIBUTE_UNUSED)5605 static xmlCatalogPtr gen_xmlCatalogPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
5606     return(NULL);
5607 }
des_xmlCatalogPtr(int no ATTRIBUTE_UNUSED,xmlCatalogPtr val ATTRIBUTE_UNUSED,int nr ATTRIBUTE_UNUSED)5608 static void des_xmlCatalogPtr(int no ATTRIBUTE_UNUSED, xmlCatalogPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
5609 }
5610 #endif
5611 
5612 
5613 static int
test_xmlACatalogAdd(void)5614 test_xmlACatalogAdd(void) {
5615     int test_ret = 0;
5616 
5617 #if defined(LIBXML_CATALOG_ENABLED)
5618     int mem_base;
5619     int ret_val;
5620     xmlCatalogPtr catal; /* a Catalog */
5621     int n_catal;
5622     xmlChar * type; /* the type of record to add to the catalog */
5623     int n_type;
5624     xmlChar * orig; /* the system, public or prefix to match */
5625     int n_orig;
5626     xmlChar * replace; /* the replacement value for the match */
5627     int n_replace;
5628 
5629     for (n_catal = 0;n_catal < gen_nb_xmlCatalogPtr;n_catal++) {
5630     for (n_type = 0;n_type < gen_nb_const_xmlChar_ptr;n_type++) {
5631     for (n_orig = 0;n_orig < gen_nb_const_xmlChar_ptr;n_orig++) {
5632     for (n_replace = 0;n_replace < gen_nb_const_xmlChar_ptr;n_replace++) {
5633         mem_base = xmlMemBlocks();
5634         catal = gen_xmlCatalogPtr(n_catal, 0);
5635         type = gen_const_xmlChar_ptr(n_type, 1);
5636         orig = gen_const_xmlChar_ptr(n_orig, 2);
5637         replace = gen_const_xmlChar_ptr(n_replace, 3);
5638 
5639         ret_val = xmlACatalogAdd(catal, (const xmlChar *)type, (const xmlChar *)orig, (const xmlChar *)replace);
5640         desret_int(ret_val);
5641         call_tests++;
5642         des_xmlCatalogPtr(n_catal, catal, 0);
5643         des_const_xmlChar_ptr(n_type, (const xmlChar *)type, 1);
5644         des_const_xmlChar_ptr(n_orig, (const xmlChar *)orig, 2);
5645         des_const_xmlChar_ptr(n_replace, (const xmlChar *)replace, 3);
5646         xmlResetLastError();
5647         if (mem_base != xmlMemBlocks()) {
5648             printf("Leak of %d blocks found in xmlACatalogAdd",
5649 	           xmlMemBlocks() - mem_base);
5650 	    test_ret++;
5651             printf(" %d", n_catal);
5652             printf(" %d", n_type);
5653             printf(" %d", n_orig);
5654             printf(" %d", n_replace);
5655             printf("\n");
5656         }
5657     }
5658     }
5659     }
5660     }
5661     function_tests++;
5662 #endif
5663 
5664     return(test_ret);
5665 }
5666 
5667 
5668 static int
test_xmlACatalogDump(void)5669 test_xmlACatalogDump(void) {
5670     int test_ret = 0;
5671 
5672 #if defined(LIBXML_CATALOG_ENABLED) && defined(LIBXML_OUTPUT_ENABLED)
5673     int mem_base;
5674     xmlCatalogPtr catal; /* a Catalog */
5675     int n_catal;
5676     FILE * out; /* the file. */
5677     int n_out;
5678 
5679     for (n_catal = 0;n_catal < gen_nb_xmlCatalogPtr;n_catal++) {
5680     for (n_out = 0;n_out < gen_nb_FILE_ptr;n_out++) {
5681         mem_base = xmlMemBlocks();
5682         catal = gen_xmlCatalogPtr(n_catal, 0);
5683         out = gen_FILE_ptr(n_out, 1);
5684 
5685         xmlACatalogDump(catal, out);
5686         call_tests++;
5687         des_xmlCatalogPtr(n_catal, catal, 0);
5688         des_FILE_ptr(n_out, out, 1);
5689         xmlResetLastError();
5690         if (mem_base != xmlMemBlocks()) {
5691             printf("Leak of %d blocks found in xmlACatalogDump",
5692 	           xmlMemBlocks() - mem_base);
5693 	    test_ret++;
5694             printf(" %d", n_catal);
5695             printf(" %d", n_out);
5696             printf("\n");
5697         }
5698     }
5699     }
5700     function_tests++;
5701 #endif
5702 
5703     return(test_ret);
5704 }
5705 
5706 
5707 static int
test_xmlACatalogRemove(void)5708 test_xmlACatalogRemove(void) {
5709     int test_ret = 0;
5710 
5711 #if defined(LIBXML_CATALOG_ENABLED)
5712     int mem_base;
5713     int ret_val;
5714     xmlCatalogPtr catal; /* a Catalog */
5715     int n_catal;
5716     xmlChar * value; /* the value to remove */
5717     int n_value;
5718 
5719     for (n_catal = 0;n_catal < gen_nb_xmlCatalogPtr;n_catal++) {
5720     for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
5721         mem_base = xmlMemBlocks();
5722         catal = gen_xmlCatalogPtr(n_catal, 0);
5723         value = gen_const_xmlChar_ptr(n_value, 1);
5724 
5725         ret_val = xmlACatalogRemove(catal, (const xmlChar *)value);
5726         desret_int(ret_val);
5727         call_tests++;
5728         des_xmlCatalogPtr(n_catal, catal, 0);
5729         des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 1);
5730         xmlResetLastError();
5731         if (mem_base != xmlMemBlocks()) {
5732             printf("Leak of %d blocks found in xmlACatalogRemove",
5733 	           xmlMemBlocks() - mem_base);
5734 	    test_ret++;
5735             printf(" %d", n_catal);
5736             printf(" %d", n_value);
5737             printf("\n");
5738         }
5739     }
5740     }
5741     function_tests++;
5742 #endif
5743 
5744     return(test_ret);
5745 }
5746 
5747 
5748 static int
test_xmlACatalogResolve(void)5749 test_xmlACatalogResolve(void) {
5750     int test_ret = 0;
5751 
5752 #if defined(LIBXML_CATALOG_ENABLED)
5753     int mem_base;
5754     xmlChar * ret_val;
5755     xmlCatalogPtr catal; /* a Catalog */
5756     int n_catal;
5757     xmlChar * pubID; /* the public ID string */
5758     int n_pubID;
5759     xmlChar * sysID; /* the system ID string */
5760     int n_sysID;
5761 
5762     for (n_catal = 0;n_catal < gen_nb_xmlCatalogPtr;n_catal++) {
5763     for (n_pubID = 0;n_pubID < gen_nb_const_xmlChar_ptr;n_pubID++) {
5764     for (n_sysID = 0;n_sysID < gen_nb_const_xmlChar_ptr;n_sysID++) {
5765         mem_base = xmlMemBlocks();
5766         catal = gen_xmlCatalogPtr(n_catal, 0);
5767         pubID = gen_const_xmlChar_ptr(n_pubID, 1);
5768         sysID = gen_const_xmlChar_ptr(n_sysID, 2);
5769 
5770         ret_val = xmlACatalogResolve(catal, (const xmlChar *)pubID, (const xmlChar *)sysID);
5771         desret_xmlChar_ptr(ret_val);
5772         call_tests++;
5773         des_xmlCatalogPtr(n_catal, catal, 0);
5774         des_const_xmlChar_ptr(n_pubID, (const xmlChar *)pubID, 1);
5775         des_const_xmlChar_ptr(n_sysID, (const xmlChar *)sysID, 2);
5776         xmlResetLastError();
5777         if (mem_base != xmlMemBlocks()) {
5778             printf("Leak of %d blocks found in xmlACatalogResolve",
5779 	           xmlMemBlocks() - mem_base);
5780 	    test_ret++;
5781             printf(" %d", n_catal);
5782             printf(" %d", n_pubID);
5783             printf(" %d", n_sysID);
5784             printf("\n");
5785         }
5786     }
5787     }
5788     }
5789     function_tests++;
5790 #endif
5791 
5792     return(test_ret);
5793 }
5794 
5795 
5796 static int
test_xmlACatalogResolvePublic(void)5797 test_xmlACatalogResolvePublic(void) {
5798     int test_ret = 0;
5799 
5800 #if defined(LIBXML_CATALOG_ENABLED)
5801     int mem_base;
5802     xmlChar * ret_val;
5803     xmlCatalogPtr catal; /* a Catalog */
5804     int n_catal;
5805     xmlChar * pubID; /* the public ID string */
5806     int n_pubID;
5807 
5808     for (n_catal = 0;n_catal < gen_nb_xmlCatalogPtr;n_catal++) {
5809     for (n_pubID = 0;n_pubID < gen_nb_const_xmlChar_ptr;n_pubID++) {
5810         mem_base = xmlMemBlocks();
5811         catal = gen_xmlCatalogPtr(n_catal, 0);
5812         pubID = gen_const_xmlChar_ptr(n_pubID, 1);
5813 
5814         ret_val = xmlACatalogResolvePublic(catal, (const xmlChar *)pubID);
5815         desret_xmlChar_ptr(ret_val);
5816         call_tests++;
5817         des_xmlCatalogPtr(n_catal, catal, 0);
5818         des_const_xmlChar_ptr(n_pubID, (const xmlChar *)pubID, 1);
5819         xmlResetLastError();
5820         if (mem_base != xmlMemBlocks()) {
5821             printf("Leak of %d blocks found in xmlACatalogResolvePublic",
5822 	           xmlMemBlocks() - mem_base);
5823 	    test_ret++;
5824             printf(" %d", n_catal);
5825             printf(" %d", n_pubID);
5826             printf("\n");
5827         }
5828     }
5829     }
5830     function_tests++;
5831 #endif
5832 
5833     return(test_ret);
5834 }
5835 
5836 
5837 static int
test_xmlACatalogResolveSystem(void)5838 test_xmlACatalogResolveSystem(void) {
5839     int test_ret = 0;
5840 
5841 #if defined(LIBXML_CATALOG_ENABLED)
5842     int mem_base;
5843     xmlChar * ret_val;
5844     xmlCatalogPtr catal; /* a Catalog */
5845     int n_catal;
5846     xmlChar * sysID; /* the system ID string */
5847     int n_sysID;
5848 
5849     for (n_catal = 0;n_catal < gen_nb_xmlCatalogPtr;n_catal++) {
5850     for (n_sysID = 0;n_sysID < gen_nb_const_xmlChar_ptr;n_sysID++) {
5851         mem_base = xmlMemBlocks();
5852         catal = gen_xmlCatalogPtr(n_catal, 0);
5853         sysID = gen_const_xmlChar_ptr(n_sysID, 1);
5854 
5855         ret_val = xmlACatalogResolveSystem(catal, (const xmlChar *)sysID);
5856         desret_xmlChar_ptr(ret_val);
5857         call_tests++;
5858         des_xmlCatalogPtr(n_catal, catal, 0);
5859         des_const_xmlChar_ptr(n_sysID, (const xmlChar *)sysID, 1);
5860         xmlResetLastError();
5861         if (mem_base != xmlMemBlocks()) {
5862             printf("Leak of %d blocks found in xmlACatalogResolveSystem",
5863 	           xmlMemBlocks() - mem_base);
5864 	    test_ret++;
5865             printf(" %d", n_catal);
5866             printf(" %d", n_sysID);
5867             printf("\n");
5868         }
5869     }
5870     }
5871     function_tests++;
5872 #endif
5873 
5874     return(test_ret);
5875 }
5876 
5877 
5878 static int
test_xmlACatalogResolveURI(void)5879 test_xmlACatalogResolveURI(void) {
5880     int test_ret = 0;
5881 
5882 #if defined(LIBXML_CATALOG_ENABLED)
5883     int mem_base;
5884     xmlChar * ret_val;
5885     xmlCatalogPtr catal; /* a Catalog */
5886     int n_catal;
5887     xmlChar * URI; /* the URI */
5888     int n_URI;
5889 
5890     for (n_catal = 0;n_catal < gen_nb_xmlCatalogPtr;n_catal++) {
5891     for (n_URI = 0;n_URI < gen_nb_const_xmlChar_ptr;n_URI++) {
5892         mem_base = xmlMemBlocks();
5893         catal = gen_xmlCatalogPtr(n_catal, 0);
5894         URI = gen_const_xmlChar_ptr(n_URI, 1);
5895 
5896         ret_val = xmlACatalogResolveURI(catal, (const xmlChar *)URI);
5897         desret_xmlChar_ptr(ret_val);
5898         call_tests++;
5899         des_xmlCatalogPtr(n_catal, catal, 0);
5900         des_const_xmlChar_ptr(n_URI, (const xmlChar *)URI, 1);
5901         xmlResetLastError();
5902         if (mem_base != xmlMemBlocks()) {
5903             printf("Leak of %d blocks found in xmlACatalogResolveURI",
5904 	           xmlMemBlocks() - mem_base);
5905 	    test_ret++;
5906             printf(" %d", n_catal);
5907             printf(" %d", n_URI);
5908             printf("\n");
5909         }
5910     }
5911     }
5912     function_tests++;
5913 #endif
5914 
5915     return(test_ret);
5916 }
5917 
5918 
5919 static int
test_xmlCatalogAdd(void)5920 test_xmlCatalogAdd(void) {
5921     int test_ret = 0;
5922 
5923 #if defined(LIBXML_CATALOG_ENABLED)
5924     int mem_base;
5925     int ret_val;
5926     xmlChar * type; /* the type of record to add to the catalog */
5927     int n_type;
5928     xmlChar * orig; /* the system, public or prefix to match */
5929     int n_orig;
5930     xmlChar * replace; /* the replacement value for the match */
5931     int n_replace;
5932 
5933     for (n_type = 0;n_type < gen_nb_const_xmlChar_ptr;n_type++) {
5934     for (n_orig = 0;n_orig < gen_nb_const_xmlChar_ptr;n_orig++) {
5935     for (n_replace = 0;n_replace < gen_nb_const_xmlChar_ptr;n_replace++) {
5936         mem_base = xmlMemBlocks();
5937         type = gen_const_xmlChar_ptr(n_type, 0);
5938         orig = gen_const_xmlChar_ptr(n_orig, 1);
5939         replace = gen_const_xmlChar_ptr(n_replace, 2);
5940 
5941         ret_val = xmlCatalogAdd((const xmlChar *)type, (const xmlChar *)orig, (const xmlChar *)replace);
5942         desret_int(ret_val);
5943         call_tests++;
5944         des_const_xmlChar_ptr(n_type, (const xmlChar *)type, 0);
5945         des_const_xmlChar_ptr(n_orig, (const xmlChar *)orig, 1);
5946         des_const_xmlChar_ptr(n_replace, (const xmlChar *)replace, 2);
5947         xmlResetLastError();
5948         if (mem_base != xmlMemBlocks()) {
5949             printf("Leak of %d blocks found in xmlCatalogAdd",
5950 	           xmlMemBlocks() - mem_base);
5951 	    test_ret++;
5952             printf(" %d", n_type);
5953             printf(" %d", n_orig);
5954             printf(" %d", n_replace);
5955             printf("\n");
5956         }
5957     }
5958     }
5959     }
5960     function_tests++;
5961 #endif
5962 
5963     return(test_ret);
5964 }
5965 
5966 
5967 static int
test_xmlCatalogCleanup(void)5968 test_xmlCatalogCleanup(void) {
5969     int test_ret = 0;
5970 
5971 #if defined(LIBXML_CATALOG_ENABLED)
5972 
5973 
5974         xmlCatalogCleanup();
5975         call_tests++;
5976         xmlResetLastError();
5977     function_tests++;
5978 #endif
5979 
5980     return(test_ret);
5981 }
5982 
5983 
5984 static int
test_xmlCatalogConvert(void)5985 test_xmlCatalogConvert(void) {
5986     int test_ret = 0;
5987 
5988 #if defined(LIBXML_CATALOG_ENABLED)
5989     int ret_val;
5990 
5991 
5992         ret_val = xmlCatalogConvert();
5993         desret_int(ret_val);
5994         call_tests++;
5995         xmlResetLastError();
5996     function_tests++;
5997 #endif
5998 
5999     return(test_ret);
6000 }
6001 
6002 
6003 static int
test_xmlCatalogDump(void)6004 test_xmlCatalogDump(void) {
6005     int test_ret = 0;
6006 
6007 #if defined(LIBXML_CATALOG_ENABLED) && defined(LIBXML_OUTPUT_ENABLED)
6008     int mem_base;
6009     FILE * out; /* the file. */
6010     int n_out;
6011 
6012     for (n_out = 0;n_out < gen_nb_FILE_ptr;n_out++) {
6013         mem_base = xmlMemBlocks();
6014         out = gen_FILE_ptr(n_out, 0);
6015 
6016         xmlCatalogDump(out);
6017         call_tests++;
6018         des_FILE_ptr(n_out, out, 0);
6019         xmlResetLastError();
6020         if (mem_base != xmlMemBlocks()) {
6021             printf("Leak of %d blocks found in xmlCatalogDump",
6022 	           xmlMemBlocks() - mem_base);
6023 	    test_ret++;
6024             printf(" %d", n_out);
6025             printf("\n");
6026         }
6027     }
6028     function_tests++;
6029 #endif
6030 
6031     return(test_ret);
6032 }
6033 
6034 
6035 static int
test_xmlCatalogGetDefaults(void)6036 test_xmlCatalogGetDefaults(void) {
6037     int test_ret = 0;
6038 
6039 #if defined(LIBXML_CATALOG_ENABLED)
6040     int mem_base;
6041     xmlCatalogAllow ret_val;
6042 
6043         mem_base = xmlMemBlocks();
6044 
6045         ret_val = xmlCatalogGetDefaults();
6046         desret_xmlCatalogAllow(ret_val);
6047         call_tests++;
6048         xmlResetLastError();
6049         if (mem_base != xmlMemBlocks()) {
6050             printf("Leak of %d blocks found in xmlCatalogGetDefaults",
6051 	           xmlMemBlocks() - mem_base);
6052 	    test_ret++;
6053             printf("\n");
6054         }
6055     function_tests++;
6056 #endif
6057 
6058     return(test_ret);
6059 }
6060 
6061 
6062 static int
test_xmlCatalogIsEmpty(void)6063 test_xmlCatalogIsEmpty(void) {
6064     int test_ret = 0;
6065 
6066 #if defined(LIBXML_CATALOG_ENABLED)
6067     int mem_base;
6068     int ret_val;
6069     xmlCatalogPtr catal; /* should this create an SGML catalog */
6070     int n_catal;
6071 
6072     for (n_catal = 0;n_catal < gen_nb_xmlCatalogPtr;n_catal++) {
6073         mem_base = xmlMemBlocks();
6074         catal = gen_xmlCatalogPtr(n_catal, 0);
6075 
6076         ret_val = xmlCatalogIsEmpty(catal);
6077         desret_int(ret_val);
6078         call_tests++;
6079         des_xmlCatalogPtr(n_catal, catal, 0);
6080         xmlResetLastError();
6081         if (mem_base != xmlMemBlocks()) {
6082             printf("Leak of %d blocks found in xmlCatalogIsEmpty",
6083 	           xmlMemBlocks() - mem_base);
6084 	    test_ret++;
6085             printf(" %d", n_catal);
6086             printf("\n");
6087         }
6088     }
6089     function_tests++;
6090 #endif
6091 
6092     return(test_ret);
6093 }
6094 
6095 
6096 static int
test_xmlCatalogLocalResolve(void)6097 test_xmlCatalogLocalResolve(void) {
6098     int test_ret = 0;
6099 
6100 #if defined(LIBXML_CATALOG_ENABLED)
6101     int mem_base;
6102     xmlChar * ret_val;
6103     void * catalogs; /* a document's list of catalogs */
6104     int n_catalogs;
6105     xmlChar * pubID; /* the public ID string */
6106     int n_pubID;
6107     xmlChar * sysID; /* the system ID string */
6108     int n_sysID;
6109 
6110     for (n_catalogs = 0;n_catalogs < gen_nb_void_ptr;n_catalogs++) {
6111     for (n_pubID = 0;n_pubID < gen_nb_const_xmlChar_ptr;n_pubID++) {
6112     for (n_sysID = 0;n_sysID < gen_nb_const_xmlChar_ptr;n_sysID++) {
6113         mem_base = xmlMemBlocks();
6114         catalogs = gen_void_ptr(n_catalogs, 0);
6115         pubID = gen_const_xmlChar_ptr(n_pubID, 1);
6116         sysID = gen_const_xmlChar_ptr(n_sysID, 2);
6117 
6118         ret_val = xmlCatalogLocalResolve(catalogs, (const xmlChar *)pubID, (const xmlChar *)sysID);
6119         desret_xmlChar_ptr(ret_val);
6120         call_tests++;
6121         des_void_ptr(n_catalogs, catalogs, 0);
6122         des_const_xmlChar_ptr(n_pubID, (const xmlChar *)pubID, 1);
6123         des_const_xmlChar_ptr(n_sysID, (const xmlChar *)sysID, 2);
6124         xmlResetLastError();
6125         if (mem_base != xmlMemBlocks()) {
6126             printf("Leak of %d blocks found in xmlCatalogLocalResolve",
6127 	           xmlMemBlocks() - mem_base);
6128 	    test_ret++;
6129             printf(" %d", n_catalogs);
6130             printf(" %d", n_pubID);
6131             printf(" %d", n_sysID);
6132             printf("\n");
6133         }
6134     }
6135     }
6136     }
6137     function_tests++;
6138 #endif
6139 
6140     return(test_ret);
6141 }
6142 
6143 
6144 static int
test_xmlCatalogLocalResolveURI(void)6145 test_xmlCatalogLocalResolveURI(void) {
6146     int test_ret = 0;
6147 
6148 #if defined(LIBXML_CATALOG_ENABLED)
6149     int mem_base;
6150     xmlChar * ret_val;
6151     void * catalogs; /* a document's list of catalogs */
6152     int n_catalogs;
6153     xmlChar * URI; /* the URI */
6154     int n_URI;
6155 
6156     for (n_catalogs = 0;n_catalogs < gen_nb_void_ptr;n_catalogs++) {
6157     for (n_URI = 0;n_URI < gen_nb_const_xmlChar_ptr;n_URI++) {
6158         mem_base = xmlMemBlocks();
6159         catalogs = gen_void_ptr(n_catalogs, 0);
6160         URI = gen_const_xmlChar_ptr(n_URI, 1);
6161 
6162         ret_val = xmlCatalogLocalResolveURI(catalogs, (const xmlChar *)URI);
6163         desret_xmlChar_ptr(ret_val);
6164         call_tests++;
6165         des_void_ptr(n_catalogs, catalogs, 0);
6166         des_const_xmlChar_ptr(n_URI, (const xmlChar *)URI, 1);
6167         xmlResetLastError();
6168         if (mem_base != xmlMemBlocks()) {
6169             printf("Leak of %d blocks found in xmlCatalogLocalResolveURI",
6170 	           xmlMemBlocks() - mem_base);
6171 	    test_ret++;
6172             printf(" %d", n_catalogs);
6173             printf(" %d", n_URI);
6174             printf("\n");
6175         }
6176     }
6177     }
6178     function_tests++;
6179 #endif
6180 
6181     return(test_ret);
6182 }
6183 
6184 
6185 static int
test_xmlCatalogRemove(void)6186 test_xmlCatalogRemove(void) {
6187     int test_ret = 0;
6188 
6189 #if defined(LIBXML_CATALOG_ENABLED)
6190     int ret_val;
6191     xmlChar * value; /* the value to remove */
6192     int n_value;
6193 
6194     for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
6195         value = gen_const_xmlChar_ptr(n_value, 0);
6196 
6197         ret_val = xmlCatalogRemove((const xmlChar *)value);
6198         desret_int(ret_val);
6199         call_tests++;
6200         des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 0);
6201         xmlResetLastError();
6202     }
6203     function_tests++;
6204 #endif
6205 
6206     return(test_ret);
6207 }
6208 
6209 
6210 static int
test_xmlCatalogResolve(void)6211 test_xmlCatalogResolve(void) {
6212     int test_ret = 0;
6213 
6214 #if defined(LIBXML_CATALOG_ENABLED)
6215     xmlChar * ret_val;
6216     xmlChar * pubID; /* the public ID string */
6217     int n_pubID;
6218     xmlChar * sysID; /* the system ID string */
6219     int n_sysID;
6220 
6221     for (n_pubID = 0;n_pubID < gen_nb_const_xmlChar_ptr;n_pubID++) {
6222     for (n_sysID = 0;n_sysID < gen_nb_const_xmlChar_ptr;n_sysID++) {
6223         pubID = gen_const_xmlChar_ptr(n_pubID, 0);
6224         sysID = gen_const_xmlChar_ptr(n_sysID, 1);
6225 
6226         ret_val = xmlCatalogResolve((const xmlChar *)pubID, (const xmlChar *)sysID);
6227         desret_xmlChar_ptr(ret_val);
6228         call_tests++;
6229         des_const_xmlChar_ptr(n_pubID, (const xmlChar *)pubID, 0);
6230         des_const_xmlChar_ptr(n_sysID, (const xmlChar *)sysID, 1);
6231         xmlResetLastError();
6232     }
6233     }
6234     function_tests++;
6235 #endif
6236 
6237     return(test_ret);
6238 }
6239 
6240 
6241 static int
test_xmlCatalogResolvePublic(void)6242 test_xmlCatalogResolvePublic(void) {
6243     int test_ret = 0;
6244 
6245 #if defined(LIBXML_CATALOG_ENABLED)
6246     int mem_base;
6247     xmlChar * ret_val;
6248     xmlChar * pubID; /* the public ID string */
6249     int n_pubID;
6250 
6251     for (n_pubID = 0;n_pubID < gen_nb_const_xmlChar_ptr;n_pubID++) {
6252         mem_base = xmlMemBlocks();
6253         pubID = gen_const_xmlChar_ptr(n_pubID, 0);
6254 
6255         ret_val = xmlCatalogResolvePublic((const xmlChar *)pubID);
6256         desret_xmlChar_ptr(ret_val);
6257         call_tests++;
6258         des_const_xmlChar_ptr(n_pubID, (const xmlChar *)pubID, 0);
6259         xmlResetLastError();
6260         if (mem_base != xmlMemBlocks()) {
6261             printf("Leak of %d blocks found in xmlCatalogResolvePublic",
6262 	           xmlMemBlocks() - mem_base);
6263 	    test_ret++;
6264             printf(" %d", n_pubID);
6265             printf("\n");
6266         }
6267     }
6268     function_tests++;
6269 #endif
6270 
6271     return(test_ret);
6272 }
6273 
6274 
6275 static int
test_xmlCatalogResolveSystem(void)6276 test_xmlCatalogResolveSystem(void) {
6277     int test_ret = 0;
6278 
6279 #if defined(LIBXML_CATALOG_ENABLED)
6280     int mem_base;
6281     xmlChar * ret_val;
6282     xmlChar * sysID; /* the system ID string */
6283     int n_sysID;
6284 
6285     for (n_sysID = 0;n_sysID < gen_nb_const_xmlChar_ptr;n_sysID++) {
6286         mem_base = xmlMemBlocks();
6287         sysID = gen_const_xmlChar_ptr(n_sysID, 0);
6288 
6289         ret_val = xmlCatalogResolveSystem((const xmlChar *)sysID);
6290         desret_xmlChar_ptr(ret_val);
6291         call_tests++;
6292         des_const_xmlChar_ptr(n_sysID, (const xmlChar *)sysID, 0);
6293         xmlResetLastError();
6294         if (mem_base != xmlMemBlocks()) {
6295             printf("Leak of %d blocks found in xmlCatalogResolveSystem",
6296 	           xmlMemBlocks() - mem_base);
6297 	    test_ret++;
6298             printf(" %d", n_sysID);
6299             printf("\n");
6300         }
6301     }
6302     function_tests++;
6303 #endif
6304 
6305     return(test_ret);
6306 }
6307 
6308 
6309 static int
test_xmlCatalogResolveURI(void)6310 test_xmlCatalogResolveURI(void) {
6311     int test_ret = 0;
6312 
6313 #if defined(LIBXML_CATALOG_ENABLED)
6314     int mem_base;
6315     xmlChar * ret_val;
6316     xmlChar * URI; /* the URI */
6317     int n_URI;
6318 
6319     for (n_URI = 0;n_URI < gen_nb_const_xmlChar_ptr;n_URI++) {
6320         mem_base = xmlMemBlocks();
6321         URI = gen_const_xmlChar_ptr(n_URI, 0);
6322 
6323         ret_val = xmlCatalogResolveURI((const xmlChar *)URI);
6324         desret_xmlChar_ptr(ret_val);
6325         call_tests++;
6326         des_const_xmlChar_ptr(n_URI, (const xmlChar *)URI, 0);
6327         xmlResetLastError();
6328         if (mem_base != xmlMemBlocks()) {
6329             printf("Leak of %d blocks found in xmlCatalogResolveURI",
6330 	           xmlMemBlocks() - mem_base);
6331 	    test_ret++;
6332             printf(" %d", n_URI);
6333             printf("\n");
6334         }
6335     }
6336     function_tests++;
6337 #endif
6338 
6339     return(test_ret);
6340 }
6341 
6342 
6343 static int
test_xmlCatalogSetDefaultPrefer(void)6344 test_xmlCatalogSetDefaultPrefer(void) {
6345     int test_ret = 0;
6346 
6347 #if defined(LIBXML_CATALOG_ENABLED)
6348     int mem_base;
6349     xmlCatalogPrefer ret_val;
6350     xmlCatalogPrefer prefer; /* the default preference for delegation */
6351     int n_prefer;
6352 
6353     for (n_prefer = 0;n_prefer < gen_nb_xmlCatalogPrefer;n_prefer++) {
6354         mem_base = xmlMemBlocks();
6355         prefer = gen_xmlCatalogPrefer(n_prefer, 0);
6356 
6357         ret_val = xmlCatalogSetDefaultPrefer(prefer);
6358         desret_xmlCatalogPrefer(ret_val);
6359         call_tests++;
6360         des_xmlCatalogPrefer(n_prefer, prefer, 0);
6361         xmlResetLastError();
6362         if (mem_base != xmlMemBlocks()) {
6363             printf("Leak of %d blocks found in xmlCatalogSetDefaultPrefer",
6364 	           xmlMemBlocks() - mem_base);
6365 	    test_ret++;
6366             printf(" %d", n_prefer);
6367             printf("\n");
6368         }
6369     }
6370     function_tests++;
6371 #endif
6372 
6373     return(test_ret);
6374 }
6375 
6376 
6377 static int
test_xmlCatalogSetDefaults(void)6378 test_xmlCatalogSetDefaults(void) {
6379     int test_ret = 0;
6380 
6381 #if defined(LIBXML_CATALOG_ENABLED)
6382     int mem_base;
6383     xmlCatalogAllow allow; /* what catalogs should be accepted */
6384     int n_allow;
6385 
6386     for (n_allow = 0;n_allow < gen_nb_xmlCatalogAllow;n_allow++) {
6387         mem_base = xmlMemBlocks();
6388         allow = gen_xmlCatalogAllow(n_allow, 0);
6389 
6390         xmlCatalogSetDefaults(allow);
6391         call_tests++;
6392         des_xmlCatalogAllow(n_allow, allow, 0);
6393         xmlResetLastError();
6394         if (mem_base != xmlMemBlocks()) {
6395             printf("Leak of %d blocks found in xmlCatalogSetDefaults",
6396 	           xmlMemBlocks() - mem_base);
6397 	    test_ret++;
6398             printf(" %d", n_allow);
6399             printf("\n");
6400         }
6401     }
6402     function_tests++;
6403 #endif
6404 
6405     return(test_ret);
6406 }
6407 
6408 
6409 static int
test_xmlConvertSGMLCatalog(void)6410 test_xmlConvertSGMLCatalog(void) {
6411     int test_ret = 0;
6412 
6413 #if defined(LIBXML_CATALOG_ENABLED)
6414     int mem_base;
6415     int ret_val;
6416     xmlCatalogPtr catal; /* the catalog */
6417     int n_catal;
6418 
6419     for (n_catal = 0;n_catal < gen_nb_xmlCatalogPtr;n_catal++) {
6420         mem_base = xmlMemBlocks();
6421         catal = gen_xmlCatalogPtr(n_catal, 0);
6422 
6423         ret_val = xmlConvertSGMLCatalog(catal);
6424         desret_int(ret_val);
6425         call_tests++;
6426         des_xmlCatalogPtr(n_catal, catal, 0);
6427         xmlResetLastError();
6428         if (mem_base != xmlMemBlocks()) {
6429             printf("Leak of %d blocks found in xmlConvertSGMLCatalog",
6430 	           xmlMemBlocks() - mem_base);
6431 	    test_ret++;
6432             printf(" %d", n_catal);
6433             printf("\n");
6434         }
6435     }
6436     function_tests++;
6437 #endif
6438 
6439     return(test_ret);
6440 }
6441 
6442 
6443 static int
test_xmlInitializeCatalog(void)6444 test_xmlInitializeCatalog(void) {
6445     int test_ret = 0;
6446 
6447 #if defined(LIBXML_CATALOG_ENABLED)
6448     int mem_base;
6449 
6450         mem_base = xmlMemBlocks();
6451 
6452         xmlInitializeCatalog();
6453         call_tests++;
6454         xmlResetLastError();
6455         if (mem_base != xmlMemBlocks()) {
6456             printf("Leak of %d blocks found in xmlInitializeCatalog",
6457 	           xmlMemBlocks() - mem_base);
6458 	    test_ret++;
6459             printf("\n");
6460         }
6461     function_tests++;
6462 #endif
6463 
6464     return(test_ret);
6465 }
6466 
6467 
6468 static int
test_xmlLoadACatalog(void)6469 test_xmlLoadACatalog(void) {
6470     int test_ret = 0;
6471 
6472 
6473     /* missing type support */
6474     return(test_ret);
6475 }
6476 
6477 
6478 static int
test_xmlLoadCatalog(void)6479 test_xmlLoadCatalog(void) {
6480     int test_ret = 0;
6481 
6482 #if defined(LIBXML_CATALOG_ENABLED)
6483     int ret_val;
6484     const char * filename; /* a file path */
6485     int n_filename;
6486 
6487     for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
6488         filename = gen_filepath(n_filename, 0);
6489 
6490         ret_val = xmlLoadCatalog(filename);
6491         desret_int(ret_val);
6492         call_tests++;
6493         des_filepath(n_filename, filename, 0);
6494         xmlResetLastError();
6495     }
6496     function_tests++;
6497 #endif
6498 
6499     return(test_ret);
6500 }
6501 
6502 
6503 static int
test_xmlLoadCatalogs(void)6504 test_xmlLoadCatalogs(void) {
6505     int test_ret = 0;
6506 
6507 #if defined(LIBXML_CATALOG_ENABLED)
6508     char * pathss; /* a list of directories separated by a colon or a space. */
6509     int n_pathss;
6510 
6511     for (n_pathss = 0;n_pathss < gen_nb_const_char_ptr;n_pathss++) {
6512         pathss = gen_const_char_ptr(n_pathss, 0);
6513 
6514         xmlLoadCatalogs((const char *)pathss);
6515         call_tests++;
6516         des_const_char_ptr(n_pathss, (const char *)pathss, 0);
6517         xmlResetLastError();
6518     }
6519     function_tests++;
6520 #endif
6521 
6522     return(test_ret);
6523 }
6524 
6525 
6526 static int
test_xmlLoadSGMLSuperCatalog(void)6527 test_xmlLoadSGMLSuperCatalog(void) {
6528     int test_ret = 0;
6529 
6530 
6531     /* missing type support */
6532     return(test_ret);
6533 }
6534 
6535 
6536 static int
test_xmlNewCatalog(void)6537 test_xmlNewCatalog(void) {
6538     int test_ret = 0;
6539 
6540 
6541     /* missing type support */
6542     return(test_ret);
6543 }
6544 
6545 
6546 static int
test_xmlParseCatalogFile(void)6547 test_xmlParseCatalogFile(void) {
6548     int test_ret = 0;
6549 
6550 #if defined(LIBXML_CATALOG_ENABLED)
6551     int mem_base;
6552     xmlDocPtr ret_val;
6553     const char * filename; /* the filename */
6554     int n_filename;
6555 
6556     for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
6557         mem_base = xmlMemBlocks();
6558         filename = gen_filepath(n_filename, 0);
6559 
6560         ret_val = xmlParseCatalogFile(filename);
6561         desret_xmlDocPtr(ret_val);
6562         call_tests++;
6563         des_filepath(n_filename, filename, 0);
6564         xmlResetLastError();
6565         if (mem_base != xmlMemBlocks()) {
6566             printf("Leak of %d blocks found in xmlParseCatalogFile",
6567 	           xmlMemBlocks() - mem_base);
6568 	    test_ret++;
6569             printf(" %d", n_filename);
6570             printf("\n");
6571         }
6572     }
6573     function_tests++;
6574 #endif
6575 
6576     return(test_ret);
6577 }
6578 
6579 static int
test_catalog(void)6580 test_catalog(void) {
6581     int test_ret = 0;
6582 
6583     if (quiet == 0) printf("Testing catalog : 27 of 36 functions ...\n");
6584     test_ret += test_xmlACatalogAdd();
6585     test_ret += test_xmlACatalogDump();
6586     test_ret += test_xmlACatalogRemove();
6587     test_ret += test_xmlACatalogResolve();
6588     test_ret += test_xmlACatalogResolvePublic();
6589     test_ret += test_xmlACatalogResolveSystem();
6590     test_ret += test_xmlACatalogResolveURI();
6591     test_ret += test_xmlCatalogAdd();
6592     test_ret += test_xmlCatalogCleanup();
6593     test_ret += test_xmlCatalogConvert();
6594     test_ret += test_xmlCatalogDump();
6595     test_ret += test_xmlCatalogGetDefaults();
6596     test_ret += test_xmlCatalogIsEmpty();
6597     test_ret += test_xmlCatalogLocalResolve();
6598     test_ret += test_xmlCatalogLocalResolveURI();
6599     test_ret += test_xmlCatalogRemove();
6600     test_ret += test_xmlCatalogResolve();
6601     test_ret += test_xmlCatalogResolvePublic();
6602     test_ret += test_xmlCatalogResolveSystem();
6603     test_ret += test_xmlCatalogResolveURI();
6604     test_ret += test_xmlCatalogSetDefaultPrefer();
6605     test_ret += test_xmlCatalogSetDefaults();
6606     test_ret += test_xmlConvertSGMLCatalog();
6607     test_ret += test_xmlInitializeCatalog();
6608     test_ret += test_xmlLoadACatalog();
6609     test_ret += test_xmlLoadCatalog();
6610     test_ret += test_xmlLoadCatalogs();
6611     test_ret += test_xmlLoadSGMLSuperCatalog();
6612     test_ret += test_xmlNewCatalog();
6613     test_ret += test_xmlParseCatalogFile();
6614 
6615     if (test_ret != 0)
6616 	printf("Module catalog: %d errors\n", test_ret);
6617     return(test_ret);
6618 }
6619 
6620 #define gen_nb_const_xmlChRangeGroup_ptr 1
gen_const_xmlChRangeGroup_ptr(int no ATTRIBUTE_UNUSED,int nr ATTRIBUTE_UNUSED)6621 static xmlChRangeGroup * gen_const_xmlChRangeGroup_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
6622     return(NULL);
6623 }
des_const_xmlChRangeGroup_ptr(int no ATTRIBUTE_UNUSED,const xmlChRangeGroup * val ATTRIBUTE_UNUSED,int nr ATTRIBUTE_UNUSED)6624 static void des_const_xmlChRangeGroup_ptr(int no ATTRIBUTE_UNUSED, const xmlChRangeGroup * val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
6625 }
6626 
6627 static int
test_xmlCharInRange(void)6628 test_xmlCharInRange(void) {
6629     int test_ret = 0;
6630 
6631     int mem_base;
6632     int ret_val;
6633     unsigned int val; /* character to be validated */
6634     int n_val;
6635     xmlChRangeGroup * rptr; /* pointer to range to be used to validate */
6636     int n_rptr;
6637 
6638     for (n_val = 0;n_val < gen_nb_unsigned_int;n_val++) {
6639     for (n_rptr = 0;n_rptr < gen_nb_const_xmlChRangeGroup_ptr;n_rptr++) {
6640         mem_base = xmlMemBlocks();
6641         val = gen_unsigned_int(n_val, 0);
6642         rptr = gen_const_xmlChRangeGroup_ptr(n_rptr, 1);
6643 
6644         ret_val = xmlCharInRange(val, (const xmlChRangeGroup *)rptr);
6645         desret_int(ret_val);
6646         call_tests++;
6647         des_unsigned_int(n_val, val, 0);
6648         des_const_xmlChRangeGroup_ptr(n_rptr, (const xmlChRangeGroup *)rptr, 1);
6649         xmlResetLastError();
6650         if (mem_base != xmlMemBlocks()) {
6651             printf("Leak of %d blocks found in xmlCharInRange",
6652 	           xmlMemBlocks() - mem_base);
6653 	    test_ret++;
6654             printf(" %d", n_val);
6655             printf(" %d", n_rptr);
6656             printf("\n");
6657         }
6658     }
6659     }
6660     function_tests++;
6661 
6662     return(test_ret);
6663 }
6664 
6665 
6666 static int
test_xmlIsBaseChar(void)6667 test_xmlIsBaseChar(void) {
6668     int test_ret = 0;
6669 
6670     int mem_base;
6671     int ret_val;
6672     unsigned int ch; /* character to validate */
6673     int n_ch;
6674 
6675     for (n_ch = 0;n_ch < gen_nb_unsigned_int;n_ch++) {
6676         mem_base = xmlMemBlocks();
6677         ch = gen_unsigned_int(n_ch, 0);
6678 
6679         ret_val = xmlIsBaseChar(ch);
6680         desret_int(ret_val);
6681         call_tests++;
6682         des_unsigned_int(n_ch, ch, 0);
6683         xmlResetLastError();
6684         if (mem_base != xmlMemBlocks()) {
6685             printf("Leak of %d blocks found in xmlIsBaseChar",
6686 	           xmlMemBlocks() - mem_base);
6687 	    test_ret++;
6688             printf(" %d", n_ch);
6689             printf("\n");
6690         }
6691     }
6692     function_tests++;
6693 
6694     return(test_ret);
6695 }
6696 
6697 
6698 static int
test_xmlIsBlank(void)6699 test_xmlIsBlank(void) {
6700     int test_ret = 0;
6701 
6702     int mem_base;
6703     int ret_val;
6704     unsigned int ch; /* character to validate */
6705     int n_ch;
6706 
6707     for (n_ch = 0;n_ch < gen_nb_unsigned_int;n_ch++) {
6708         mem_base = xmlMemBlocks();
6709         ch = gen_unsigned_int(n_ch, 0);
6710 
6711         ret_val = xmlIsBlank(ch);
6712         desret_int(ret_val);
6713         call_tests++;
6714         des_unsigned_int(n_ch, ch, 0);
6715         xmlResetLastError();
6716         if (mem_base != xmlMemBlocks()) {
6717             printf("Leak of %d blocks found in xmlIsBlank",
6718 	           xmlMemBlocks() - mem_base);
6719 	    test_ret++;
6720             printf(" %d", n_ch);
6721             printf("\n");
6722         }
6723     }
6724     function_tests++;
6725 
6726     return(test_ret);
6727 }
6728 
6729 
6730 static int
test_xmlIsChar(void)6731 test_xmlIsChar(void) {
6732     int test_ret = 0;
6733 
6734     int mem_base;
6735     int ret_val;
6736     unsigned int ch; /* character to validate */
6737     int n_ch;
6738 
6739     for (n_ch = 0;n_ch < gen_nb_unsigned_int;n_ch++) {
6740         mem_base = xmlMemBlocks();
6741         ch = gen_unsigned_int(n_ch, 0);
6742 
6743         ret_val = xmlIsChar(ch);
6744         desret_int(ret_val);
6745         call_tests++;
6746         des_unsigned_int(n_ch, ch, 0);
6747         xmlResetLastError();
6748         if (mem_base != xmlMemBlocks()) {
6749             printf("Leak of %d blocks found in xmlIsChar",
6750 	           xmlMemBlocks() - mem_base);
6751 	    test_ret++;
6752             printf(" %d", n_ch);
6753             printf("\n");
6754         }
6755     }
6756     function_tests++;
6757 
6758     return(test_ret);
6759 }
6760 
6761 
6762 static int
test_xmlIsCombining(void)6763 test_xmlIsCombining(void) {
6764     int test_ret = 0;
6765 
6766     int mem_base;
6767     int ret_val;
6768     unsigned int ch; /* character to validate */
6769     int n_ch;
6770 
6771     for (n_ch = 0;n_ch < gen_nb_unsigned_int;n_ch++) {
6772         mem_base = xmlMemBlocks();
6773         ch = gen_unsigned_int(n_ch, 0);
6774 
6775         ret_val = xmlIsCombining(ch);
6776         desret_int(ret_val);
6777         call_tests++;
6778         des_unsigned_int(n_ch, ch, 0);
6779         xmlResetLastError();
6780         if (mem_base != xmlMemBlocks()) {
6781             printf("Leak of %d blocks found in xmlIsCombining",
6782 	           xmlMemBlocks() - mem_base);
6783 	    test_ret++;
6784             printf(" %d", n_ch);
6785             printf("\n");
6786         }
6787     }
6788     function_tests++;
6789 
6790     return(test_ret);
6791 }
6792 
6793 
6794 static int
test_xmlIsDigit(void)6795 test_xmlIsDigit(void) {
6796     int test_ret = 0;
6797 
6798     int mem_base;
6799     int ret_val;
6800     unsigned int ch; /* character to validate */
6801     int n_ch;
6802 
6803     for (n_ch = 0;n_ch < gen_nb_unsigned_int;n_ch++) {
6804         mem_base = xmlMemBlocks();
6805         ch = gen_unsigned_int(n_ch, 0);
6806 
6807         ret_val = xmlIsDigit(ch);
6808         desret_int(ret_val);
6809         call_tests++;
6810         des_unsigned_int(n_ch, ch, 0);
6811         xmlResetLastError();
6812         if (mem_base != xmlMemBlocks()) {
6813             printf("Leak of %d blocks found in xmlIsDigit",
6814 	           xmlMemBlocks() - mem_base);
6815 	    test_ret++;
6816             printf(" %d", n_ch);
6817             printf("\n");
6818         }
6819     }
6820     function_tests++;
6821 
6822     return(test_ret);
6823 }
6824 
6825 
6826 static int
test_xmlIsExtender(void)6827 test_xmlIsExtender(void) {
6828     int test_ret = 0;
6829 
6830     int mem_base;
6831     int ret_val;
6832     unsigned int ch; /* character to validate */
6833     int n_ch;
6834 
6835     for (n_ch = 0;n_ch < gen_nb_unsigned_int;n_ch++) {
6836         mem_base = xmlMemBlocks();
6837         ch = gen_unsigned_int(n_ch, 0);
6838 
6839         ret_val = xmlIsExtender(ch);
6840         desret_int(ret_val);
6841         call_tests++;
6842         des_unsigned_int(n_ch, ch, 0);
6843         xmlResetLastError();
6844         if (mem_base != xmlMemBlocks()) {
6845             printf("Leak of %d blocks found in xmlIsExtender",
6846 	           xmlMemBlocks() - mem_base);
6847 	    test_ret++;
6848             printf(" %d", n_ch);
6849             printf("\n");
6850         }
6851     }
6852     function_tests++;
6853 
6854     return(test_ret);
6855 }
6856 
6857 
6858 static int
test_xmlIsIdeographic(void)6859 test_xmlIsIdeographic(void) {
6860     int test_ret = 0;
6861 
6862     int mem_base;
6863     int ret_val;
6864     unsigned int ch; /* character to validate */
6865     int n_ch;
6866 
6867     for (n_ch = 0;n_ch < gen_nb_unsigned_int;n_ch++) {
6868         mem_base = xmlMemBlocks();
6869         ch = gen_unsigned_int(n_ch, 0);
6870 
6871         ret_val = xmlIsIdeographic(ch);
6872         desret_int(ret_val);
6873         call_tests++;
6874         des_unsigned_int(n_ch, ch, 0);
6875         xmlResetLastError();
6876         if (mem_base != xmlMemBlocks()) {
6877             printf("Leak of %d blocks found in xmlIsIdeographic",
6878 	           xmlMemBlocks() - mem_base);
6879 	    test_ret++;
6880             printf(" %d", n_ch);
6881             printf("\n");
6882         }
6883     }
6884     function_tests++;
6885 
6886     return(test_ret);
6887 }
6888 
6889 
6890 static int
test_xmlIsPubidChar(void)6891 test_xmlIsPubidChar(void) {
6892     int test_ret = 0;
6893 
6894     int mem_base;
6895     int ret_val;
6896     unsigned int ch; /* character to validate */
6897     int n_ch;
6898 
6899     for (n_ch = 0;n_ch < gen_nb_unsigned_int;n_ch++) {
6900         mem_base = xmlMemBlocks();
6901         ch = gen_unsigned_int(n_ch, 0);
6902 
6903         ret_val = xmlIsPubidChar(ch);
6904         desret_int(ret_val);
6905         call_tests++;
6906         des_unsigned_int(n_ch, ch, 0);
6907         xmlResetLastError();
6908         if (mem_base != xmlMemBlocks()) {
6909             printf("Leak of %d blocks found in xmlIsPubidChar",
6910 	           xmlMemBlocks() - mem_base);
6911 	    test_ret++;
6912             printf(" %d", n_ch);
6913             printf("\n");
6914         }
6915     }
6916     function_tests++;
6917 
6918     return(test_ret);
6919 }
6920 
6921 static int
test_chvalid(void)6922 test_chvalid(void) {
6923     int test_ret = 0;
6924 
6925     if (quiet == 0) printf("Testing chvalid : 9 of 9 functions ...\n");
6926     test_ret += test_xmlCharInRange();
6927     test_ret += test_xmlIsBaseChar();
6928     test_ret += test_xmlIsBlank();
6929     test_ret += test_xmlIsChar();
6930     test_ret += test_xmlIsCombining();
6931     test_ret += test_xmlIsDigit();
6932     test_ret += test_xmlIsExtender();
6933     test_ret += test_xmlIsIdeographic();
6934     test_ret += test_xmlIsPubidChar();
6935 
6936     if (test_ret != 0)
6937 	printf("Module chvalid: %d errors\n", test_ret);
6938     return(test_ret);
6939 }
6940 
6941 static int
test_xmlBoolToText(void)6942 test_xmlBoolToText(void) {
6943     int test_ret = 0;
6944 
6945 #if defined(LIBXML_DEBUG_ENABLED)
6946     int mem_base;
6947     const char * ret_val;
6948     int boolval; /* a bool to turn into text */
6949     int n_boolval;
6950 
6951     for (n_boolval = 0;n_boolval < gen_nb_int;n_boolval++) {
6952         mem_base = xmlMemBlocks();
6953         boolval = gen_int(n_boolval, 0);
6954 
6955         ret_val = xmlBoolToText(boolval);
6956         desret_const_char_ptr(ret_val);
6957         call_tests++;
6958         des_int(n_boolval, boolval, 0);
6959         xmlResetLastError();
6960         if (mem_base != xmlMemBlocks()) {
6961             printf("Leak of %d blocks found in xmlBoolToText",
6962 	           xmlMemBlocks() - mem_base);
6963 	    test_ret++;
6964             printf(" %d", n_boolval);
6965             printf("\n");
6966         }
6967     }
6968     function_tests++;
6969 #endif
6970 
6971     return(test_ret);
6972 }
6973 
6974 
6975 static int
test_xmlDebugCheckDocument(void)6976 test_xmlDebugCheckDocument(void) {
6977     int test_ret = 0;
6978 
6979 #if defined(LIBXML_DEBUG_ENABLED)
6980     int mem_base;
6981     int ret_val;
6982     FILE * output; /* the FILE * for the output */
6983     int n_output;
6984     xmlDocPtr doc; /* the document */
6985     int n_doc;
6986 
6987     for (n_output = 0;n_output < gen_nb_debug_FILE_ptr;n_output++) {
6988     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
6989         mem_base = xmlMemBlocks();
6990         output = gen_debug_FILE_ptr(n_output, 0);
6991         doc = gen_xmlDocPtr(n_doc, 1);
6992 
6993         ret_val = xmlDebugCheckDocument(output, doc);
6994         desret_int(ret_val);
6995         call_tests++;
6996         des_debug_FILE_ptr(n_output, output, 0);
6997         des_xmlDocPtr(n_doc, doc, 1);
6998         xmlResetLastError();
6999         if (mem_base != xmlMemBlocks()) {
7000             printf("Leak of %d blocks found in xmlDebugCheckDocument",
7001 	           xmlMemBlocks() - mem_base);
7002 	    test_ret++;
7003             printf(" %d", n_output);
7004             printf(" %d", n_doc);
7005             printf("\n");
7006         }
7007     }
7008     }
7009     function_tests++;
7010 #endif
7011 
7012     return(test_ret);
7013 }
7014 
7015 
7016 static int
test_xmlDebugDumpAttr(void)7017 test_xmlDebugDumpAttr(void) {
7018     int test_ret = 0;
7019 
7020 #if defined(LIBXML_DEBUG_ENABLED)
7021     int mem_base;
7022     FILE * output; /* the FILE * for the output */
7023     int n_output;
7024     xmlAttrPtr attr; /* the attribute */
7025     int n_attr;
7026     int depth; /* the indentation level. */
7027     int n_depth;
7028 
7029     for (n_output = 0;n_output < gen_nb_debug_FILE_ptr;n_output++) {
7030     for (n_attr = 0;n_attr < gen_nb_xmlAttrPtr;n_attr++) {
7031     for (n_depth = 0;n_depth < gen_nb_int;n_depth++) {
7032         mem_base = xmlMemBlocks();
7033         output = gen_debug_FILE_ptr(n_output, 0);
7034         attr = gen_xmlAttrPtr(n_attr, 1);
7035         depth = gen_int(n_depth, 2);
7036 
7037         xmlDebugDumpAttr(output, attr, depth);
7038         call_tests++;
7039         des_debug_FILE_ptr(n_output, output, 0);
7040         des_xmlAttrPtr(n_attr, attr, 1);
7041         des_int(n_depth, depth, 2);
7042         xmlResetLastError();
7043         if (mem_base != xmlMemBlocks()) {
7044             printf("Leak of %d blocks found in xmlDebugDumpAttr",
7045 	           xmlMemBlocks() - mem_base);
7046 	    test_ret++;
7047             printf(" %d", n_output);
7048             printf(" %d", n_attr);
7049             printf(" %d", n_depth);
7050             printf("\n");
7051         }
7052     }
7053     }
7054     }
7055     function_tests++;
7056 #endif
7057 
7058     return(test_ret);
7059 }
7060 
7061 
7062 static int
test_xmlDebugDumpAttrList(void)7063 test_xmlDebugDumpAttrList(void) {
7064     int test_ret = 0;
7065 
7066 #if defined(LIBXML_DEBUG_ENABLED)
7067     int mem_base;
7068     FILE * output; /* the FILE * for the output */
7069     int n_output;
7070     xmlAttrPtr attr; /* the attribute list */
7071     int n_attr;
7072     int depth; /* the indentation level. */
7073     int n_depth;
7074 
7075     for (n_output = 0;n_output < gen_nb_debug_FILE_ptr;n_output++) {
7076     for (n_attr = 0;n_attr < gen_nb_xmlAttrPtr;n_attr++) {
7077     for (n_depth = 0;n_depth < gen_nb_int;n_depth++) {
7078         mem_base = xmlMemBlocks();
7079         output = gen_debug_FILE_ptr(n_output, 0);
7080         attr = gen_xmlAttrPtr(n_attr, 1);
7081         depth = gen_int(n_depth, 2);
7082 
7083         xmlDebugDumpAttrList(output, attr, depth);
7084         call_tests++;
7085         des_debug_FILE_ptr(n_output, output, 0);
7086         des_xmlAttrPtr(n_attr, attr, 1);
7087         des_int(n_depth, depth, 2);
7088         xmlResetLastError();
7089         if (mem_base != xmlMemBlocks()) {
7090             printf("Leak of %d blocks found in xmlDebugDumpAttrList",
7091 	           xmlMemBlocks() - mem_base);
7092 	    test_ret++;
7093             printf(" %d", n_output);
7094             printf(" %d", n_attr);
7095             printf(" %d", n_depth);
7096             printf("\n");
7097         }
7098     }
7099     }
7100     }
7101     function_tests++;
7102 #endif
7103 
7104     return(test_ret);
7105 }
7106 
7107 
7108 static int
test_xmlDebugDumpDTD(void)7109 test_xmlDebugDumpDTD(void) {
7110     int test_ret = 0;
7111 
7112 #if defined(LIBXML_DEBUG_ENABLED)
7113     int mem_base;
7114     FILE * output; /* the FILE * for the output */
7115     int n_output;
7116     xmlDtdPtr dtd; /* the DTD */
7117     int n_dtd;
7118 
7119     for (n_output = 0;n_output < gen_nb_debug_FILE_ptr;n_output++) {
7120     for (n_dtd = 0;n_dtd < gen_nb_xmlDtdPtr;n_dtd++) {
7121         mem_base = xmlMemBlocks();
7122         output = gen_debug_FILE_ptr(n_output, 0);
7123         dtd = gen_xmlDtdPtr(n_dtd, 1);
7124 
7125         xmlDebugDumpDTD(output, dtd);
7126         call_tests++;
7127         des_debug_FILE_ptr(n_output, output, 0);
7128         des_xmlDtdPtr(n_dtd, dtd, 1);
7129         xmlResetLastError();
7130         if (mem_base != xmlMemBlocks()) {
7131             printf("Leak of %d blocks found in xmlDebugDumpDTD",
7132 	           xmlMemBlocks() - mem_base);
7133 	    test_ret++;
7134             printf(" %d", n_output);
7135             printf(" %d", n_dtd);
7136             printf("\n");
7137         }
7138     }
7139     }
7140     function_tests++;
7141 #endif
7142 
7143     return(test_ret);
7144 }
7145 
7146 
7147 static int
test_xmlDebugDumpDocument(void)7148 test_xmlDebugDumpDocument(void) {
7149     int test_ret = 0;
7150 
7151 #if defined(LIBXML_DEBUG_ENABLED)
7152     int mem_base;
7153     FILE * output; /* the FILE * for the output */
7154     int n_output;
7155     xmlDocPtr doc; /* the document */
7156     int n_doc;
7157 
7158     for (n_output = 0;n_output < gen_nb_debug_FILE_ptr;n_output++) {
7159     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
7160         mem_base = xmlMemBlocks();
7161         output = gen_debug_FILE_ptr(n_output, 0);
7162         doc = gen_xmlDocPtr(n_doc, 1);
7163 
7164         xmlDebugDumpDocument(output, doc);
7165         call_tests++;
7166         des_debug_FILE_ptr(n_output, output, 0);
7167         des_xmlDocPtr(n_doc, doc, 1);
7168         xmlResetLastError();
7169         if (mem_base != xmlMemBlocks()) {
7170             printf("Leak of %d blocks found in xmlDebugDumpDocument",
7171 	           xmlMemBlocks() - mem_base);
7172 	    test_ret++;
7173             printf(" %d", n_output);
7174             printf(" %d", n_doc);
7175             printf("\n");
7176         }
7177     }
7178     }
7179     function_tests++;
7180 #endif
7181 
7182     return(test_ret);
7183 }
7184 
7185 
7186 static int
test_xmlDebugDumpDocumentHead(void)7187 test_xmlDebugDumpDocumentHead(void) {
7188     int test_ret = 0;
7189 
7190 #if defined(LIBXML_DEBUG_ENABLED)
7191     int mem_base;
7192     FILE * output; /* the FILE * for the output */
7193     int n_output;
7194     xmlDocPtr doc; /* the document */
7195     int n_doc;
7196 
7197     for (n_output = 0;n_output < gen_nb_debug_FILE_ptr;n_output++) {
7198     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
7199         mem_base = xmlMemBlocks();
7200         output = gen_debug_FILE_ptr(n_output, 0);
7201         doc = gen_xmlDocPtr(n_doc, 1);
7202 
7203         xmlDebugDumpDocumentHead(output, doc);
7204         call_tests++;
7205         des_debug_FILE_ptr(n_output, output, 0);
7206         des_xmlDocPtr(n_doc, doc, 1);
7207         xmlResetLastError();
7208         if (mem_base != xmlMemBlocks()) {
7209             printf("Leak of %d blocks found in xmlDebugDumpDocumentHead",
7210 	           xmlMemBlocks() - mem_base);
7211 	    test_ret++;
7212             printf(" %d", n_output);
7213             printf(" %d", n_doc);
7214             printf("\n");
7215         }
7216     }
7217     }
7218     function_tests++;
7219 #endif
7220 
7221     return(test_ret);
7222 }
7223 
7224 
7225 static int
test_xmlDebugDumpEntities(void)7226 test_xmlDebugDumpEntities(void) {
7227     int test_ret = 0;
7228 
7229 #if defined(LIBXML_DEBUG_ENABLED)
7230     int mem_base;
7231     FILE * output; /* the FILE * for the output */
7232     int n_output;
7233     xmlDocPtr doc; /* the document */
7234     int n_doc;
7235 
7236     for (n_output = 0;n_output < gen_nb_debug_FILE_ptr;n_output++) {
7237     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
7238         mem_base = xmlMemBlocks();
7239         output = gen_debug_FILE_ptr(n_output, 0);
7240         doc = gen_xmlDocPtr(n_doc, 1);
7241 
7242         xmlDebugDumpEntities(output, doc);
7243         call_tests++;
7244         des_debug_FILE_ptr(n_output, output, 0);
7245         des_xmlDocPtr(n_doc, doc, 1);
7246         xmlResetLastError();
7247         if (mem_base != xmlMemBlocks()) {
7248             printf("Leak of %d blocks found in xmlDebugDumpEntities",
7249 	           xmlMemBlocks() - mem_base);
7250 	    test_ret++;
7251             printf(" %d", n_output);
7252             printf(" %d", n_doc);
7253             printf("\n");
7254         }
7255     }
7256     }
7257     function_tests++;
7258 #endif
7259 
7260     return(test_ret);
7261 }
7262 
7263 
7264 static int
test_xmlDebugDumpNode(void)7265 test_xmlDebugDumpNode(void) {
7266     int test_ret = 0;
7267 
7268 #if defined(LIBXML_DEBUG_ENABLED)
7269     int mem_base;
7270     FILE * output; /* the FILE * for the output */
7271     int n_output;
7272     xmlNodePtr node; /* the node */
7273     int n_node;
7274     int depth; /* the indentation level. */
7275     int n_depth;
7276 
7277     for (n_output = 0;n_output < gen_nb_debug_FILE_ptr;n_output++) {
7278     for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
7279     for (n_depth = 0;n_depth < gen_nb_int;n_depth++) {
7280         mem_base = xmlMemBlocks();
7281         output = gen_debug_FILE_ptr(n_output, 0);
7282         node = gen_xmlNodePtr(n_node, 1);
7283         depth = gen_int(n_depth, 2);
7284 
7285         xmlDebugDumpNode(output, node, depth);
7286         call_tests++;
7287         des_debug_FILE_ptr(n_output, output, 0);
7288         des_xmlNodePtr(n_node, node, 1);
7289         des_int(n_depth, depth, 2);
7290         xmlResetLastError();
7291         if (mem_base != xmlMemBlocks()) {
7292             printf("Leak of %d blocks found in xmlDebugDumpNode",
7293 	           xmlMemBlocks() - mem_base);
7294 	    test_ret++;
7295             printf(" %d", n_output);
7296             printf(" %d", n_node);
7297             printf(" %d", n_depth);
7298             printf("\n");
7299         }
7300     }
7301     }
7302     }
7303     function_tests++;
7304 #endif
7305 
7306     return(test_ret);
7307 }
7308 
7309 
7310 static int
test_xmlDebugDumpNodeList(void)7311 test_xmlDebugDumpNodeList(void) {
7312     int test_ret = 0;
7313 
7314 #if defined(LIBXML_DEBUG_ENABLED)
7315     int mem_base;
7316     FILE * output; /* the FILE * for the output */
7317     int n_output;
7318     xmlNodePtr node; /* the node list */
7319     int n_node;
7320     int depth; /* the indentation level. */
7321     int n_depth;
7322 
7323     for (n_output = 0;n_output < gen_nb_debug_FILE_ptr;n_output++) {
7324     for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
7325     for (n_depth = 0;n_depth < gen_nb_int;n_depth++) {
7326         mem_base = xmlMemBlocks();
7327         output = gen_debug_FILE_ptr(n_output, 0);
7328         node = gen_xmlNodePtr(n_node, 1);
7329         depth = gen_int(n_depth, 2);
7330 
7331         xmlDebugDumpNodeList(output, node, depth);
7332         call_tests++;
7333         des_debug_FILE_ptr(n_output, output, 0);
7334         des_xmlNodePtr(n_node, node, 1);
7335         des_int(n_depth, depth, 2);
7336         xmlResetLastError();
7337         if (mem_base != xmlMemBlocks()) {
7338             printf("Leak of %d blocks found in xmlDebugDumpNodeList",
7339 	           xmlMemBlocks() - mem_base);
7340 	    test_ret++;
7341             printf(" %d", n_output);
7342             printf(" %d", n_node);
7343             printf(" %d", n_depth);
7344             printf("\n");
7345         }
7346     }
7347     }
7348     }
7349     function_tests++;
7350 #endif
7351 
7352     return(test_ret);
7353 }
7354 
7355 
7356 static int
test_xmlDebugDumpOneNode(void)7357 test_xmlDebugDumpOneNode(void) {
7358     int test_ret = 0;
7359 
7360 #if defined(LIBXML_DEBUG_ENABLED)
7361     int mem_base;
7362     FILE * output; /* the FILE * for the output */
7363     int n_output;
7364     xmlNodePtr node; /* the node */
7365     int n_node;
7366     int depth; /* the indentation level. */
7367     int n_depth;
7368 
7369     for (n_output = 0;n_output < gen_nb_debug_FILE_ptr;n_output++) {
7370     for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
7371     for (n_depth = 0;n_depth < gen_nb_int;n_depth++) {
7372         mem_base = xmlMemBlocks();
7373         output = gen_debug_FILE_ptr(n_output, 0);
7374         node = gen_xmlNodePtr(n_node, 1);
7375         depth = gen_int(n_depth, 2);
7376 
7377         xmlDebugDumpOneNode(output, node, depth);
7378         call_tests++;
7379         des_debug_FILE_ptr(n_output, output, 0);
7380         des_xmlNodePtr(n_node, node, 1);
7381         des_int(n_depth, depth, 2);
7382         xmlResetLastError();
7383         if (mem_base != xmlMemBlocks()) {
7384             printf("Leak of %d blocks found in xmlDebugDumpOneNode",
7385 	           xmlMemBlocks() - mem_base);
7386 	    test_ret++;
7387             printf(" %d", n_output);
7388             printf(" %d", n_node);
7389             printf(" %d", n_depth);
7390             printf("\n");
7391         }
7392     }
7393     }
7394     }
7395     function_tests++;
7396 #endif
7397 
7398     return(test_ret);
7399 }
7400 
7401 
7402 static int
test_xmlDebugDumpString(void)7403 test_xmlDebugDumpString(void) {
7404     int test_ret = 0;
7405 
7406 #if defined(LIBXML_DEBUG_ENABLED)
7407     int mem_base;
7408     FILE * output; /* the FILE * for the output */
7409     int n_output;
7410     xmlChar * str; /* the string */
7411     int n_str;
7412 
7413     for (n_output = 0;n_output < gen_nb_debug_FILE_ptr;n_output++) {
7414     for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) {
7415         mem_base = xmlMemBlocks();
7416         output = gen_debug_FILE_ptr(n_output, 0);
7417         str = gen_const_xmlChar_ptr(n_str, 1);
7418 
7419         xmlDebugDumpString(output, (const xmlChar *)str);
7420         call_tests++;
7421         des_debug_FILE_ptr(n_output, output, 0);
7422         des_const_xmlChar_ptr(n_str, (const xmlChar *)str, 1);
7423         xmlResetLastError();
7424         if (mem_base != xmlMemBlocks()) {
7425             printf("Leak of %d blocks found in xmlDebugDumpString",
7426 	           xmlMemBlocks() - mem_base);
7427 	    test_ret++;
7428             printf(" %d", n_output);
7429             printf(" %d", n_str);
7430             printf("\n");
7431         }
7432     }
7433     }
7434     function_tests++;
7435 #endif
7436 
7437     return(test_ret);
7438 }
7439 
7440 
7441 static int
test_xmlLsCountNode(void)7442 test_xmlLsCountNode(void) {
7443     int test_ret = 0;
7444 
7445 #if defined(LIBXML_DEBUG_ENABLED)
7446     int mem_base;
7447     int ret_val;
7448     xmlNodePtr node; /* the node to count */
7449     int n_node;
7450 
7451     for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
7452         mem_base = xmlMemBlocks();
7453         node = gen_xmlNodePtr(n_node, 0);
7454 
7455         ret_val = xmlLsCountNode(node);
7456         desret_int(ret_val);
7457         call_tests++;
7458         des_xmlNodePtr(n_node, node, 0);
7459         xmlResetLastError();
7460         if (mem_base != xmlMemBlocks()) {
7461             printf("Leak of %d blocks found in xmlLsCountNode",
7462 	           xmlMemBlocks() - mem_base);
7463 	    test_ret++;
7464             printf(" %d", n_node);
7465             printf("\n");
7466         }
7467     }
7468     function_tests++;
7469 #endif
7470 
7471     return(test_ret);
7472 }
7473 
7474 
7475 static int
test_xmlLsOneNode(void)7476 test_xmlLsOneNode(void) {
7477     int test_ret = 0;
7478 
7479 #if defined(LIBXML_DEBUG_ENABLED)
7480     int mem_base;
7481     FILE * output; /* the FILE * for the output */
7482     int n_output;
7483     xmlNodePtr node; /* the node to dump */
7484     int n_node;
7485 
7486     for (n_output = 0;n_output < gen_nb_debug_FILE_ptr;n_output++) {
7487     for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
7488         mem_base = xmlMemBlocks();
7489         output = gen_debug_FILE_ptr(n_output, 0);
7490         node = gen_xmlNodePtr(n_node, 1);
7491 
7492         xmlLsOneNode(output, node);
7493         call_tests++;
7494         des_debug_FILE_ptr(n_output, output, 0);
7495         des_xmlNodePtr(n_node, node, 1);
7496         xmlResetLastError();
7497         if (mem_base != xmlMemBlocks()) {
7498             printf("Leak of %d blocks found in xmlLsOneNode",
7499 	           xmlMemBlocks() - mem_base);
7500 	    test_ret++;
7501             printf(" %d", n_output);
7502             printf(" %d", n_node);
7503             printf("\n");
7504         }
7505     }
7506     }
7507     function_tests++;
7508 #endif
7509 
7510     return(test_ret);
7511 }
7512 
7513 
7514 static int
test_xmlShell(void)7515 test_xmlShell(void) {
7516     int test_ret = 0;
7517 
7518 
7519     /* missing type support */
7520     return(test_ret);
7521 }
7522 
7523 
7524 #define gen_nb_char_ptr 1
gen_char_ptr(int no ATTRIBUTE_UNUSED,int nr ATTRIBUTE_UNUSED)7525 static char * gen_char_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
7526     return(NULL);
7527 }
des_char_ptr(int no ATTRIBUTE_UNUSED,char * val ATTRIBUTE_UNUSED,int nr ATTRIBUTE_UNUSED)7528 static void des_char_ptr(int no ATTRIBUTE_UNUSED, char * val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
7529 }
7530 
7531 static int
test_xmlShellBase(void)7532 test_xmlShellBase(void) {
7533     int test_ret = 0;
7534 
7535 #if defined(LIBXML_DEBUG_ENABLED) && defined(LIBXML_XPATH_ENABLED)
7536     int mem_base;
7537     int ret_val;
7538     xmlShellCtxtPtr ctxt; /* the shell context */
7539     int n_ctxt;
7540     char * arg; /* unused */
7541     int n_arg;
7542     xmlNodePtr node; /* a node */
7543     int n_node;
7544     xmlNodePtr node2; /* unused */
7545     int n_node2;
7546 
7547     for (n_ctxt = 0;n_ctxt < gen_nb_xmlShellCtxtPtr;n_ctxt++) {
7548     for (n_arg = 0;n_arg < gen_nb_char_ptr;n_arg++) {
7549     for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
7550     for (n_node2 = 0;n_node2 < gen_nb_xmlNodePtr;n_node2++) {
7551         mem_base = xmlMemBlocks();
7552         ctxt = gen_xmlShellCtxtPtr(n_ctxt, 0);
7553         arg = gen_char_ptr(n_arg, 1);
7554         node = gen_xmlNodePtr(n_node, 2);
7555         node2 = gen_xmlNodePtr(n_node2, 3);
7556 
7557         ret_val = xmlShellBase(ctxt, arg, node, node2);
7558         desret_int(ret_val);
7559         call_tests++;
7560         des_xmlShellCtxtPtr(n_ctxt, ctxt, 0);
7561         des_char_ptr(n_arg, arg, 1);
7562         des_xmlNodePtr(n_node, node, 2);
7563         des_xmlNodePtr(n_node2, node2, 3);
7564         xmlResetLastError();
7565         if (mem_base != xmlMemBlocks()) {
7566             printf("Leak of %d blocks found in xmlShellBase",
7567 	           xmlMemBlocks() - mem_base);
7568 	    test_ret++;
7569             printf(" %d", n_ctxt);
7570             printf(" %d", n_arg);
7571             printf(" %d", n_node);
7572             printf(" %d", n_node2);
7573             printf("\n");
7574         }
7575     }
7576     }
7577     }
7578     }
7579     function_tests++;
7580 #endif
7581 
7582     return(test_ret);
7583 }
7584 
7585 
7586 static int
test_xmlShellCat(void)7587 test_xmlShellCat(void) {
7588     int test_ret = 0;
7589 
7590 #if defined(LIBXML_DEBUG_ENABLED) && defined(LIBXML_XPATH_ENABLED) && defined(LIBXML_OUTPUT_ENABLED)
7591     int mem_base;
7592     int ret_val;
7593     xmlShellCtxtPtr ctxt; /* the shell context */
7594     int n_ctxt;
7595     char * arg; /* unused */
7596     int n_arg;
7597     xmlNodePtr node; /* a node */
7598     int n_node;
7599     xmlNodePtr node2; /* unused */
7600     int n_node2;
7601 
7602     for (n_ctxt = 0;n_ctxt < gen_nb_xmlShellCtxtPtr;n_ctxt++) {
7603     for (n_arg = 0;n_arg < gen_nb_char_ptr;n_arg++) {
7604     for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
7605     for (n_node2 = 0;n_node2 < gen_nb_xmlNodePtr;n_node2++) {
7606         mem_base = xmlMemBlocks();
7607         ctxt = gen_xmlShellCtxtPtr(n_ctxt, 0);
7608         arg = gen_char_ptr(n_arg, 1);
7609         node = gen_xmlNodePtr(n_node, 2);
7610         node2 = gen_xmlNodePtr(n_node2, 3);
7611 
7612         ret_val = xmlShellCat(ctxt, arg, node, node2);
7613         desret_int(ret_val);
7614         call_tests++;
7615         des_xmlShellCtxtPtr(n_ctxt, ctxt, 0);
7616         des_char_ptr(n_arg, arg, 1);
7617         des_xmlNodePtr(n_node, node, 2);
7618         des_xmlNodePtr(n_node2, node2, 3);
7619         xmlResetLastError();
7620         if (mem_base != xmlMemBlocks()) {
7621             printf("Leak of %d blocks found in xmlShellCat",
7622 	           xmlMemBlocks() - mem_base);
7623 	    test_ret++;
7624             printf(" %d", n_ctxt);
7625             printf(" %d", n_arg);
7626             printf(" %d", n_node);
7627             printf(" %d", n_node2);
7628             printf("\n");
7629         }
7630     }
7631     }
7632     }
7633     }
7634     function_tests++;
7635 #endif
7636 
7637     return(test_ret);
7638 }
7639 
7640 
7641 static int
test_xmlShellDir(void)7642 test_xmlShellDir(void) {
7643     int test_ret = 0;
7644 
7645 #if defined(LIBXML_DEBUG_ENABLED) && defined(LIBXML_XPATH_ENABLED)
7646     int mem_base;
7647     int ret_val;
7648     xmlShellCtxtPtr ctxt; /* the shell context */
7649     int n_ctxt;
7650     char * arg; /* unused */
7651     int n_arg;
7652     xmlNodePtr node; /* a node */
7653     int n_node;
7654     xmlNodePtr node2; /* unused */
7655     int n_node2;
7656 
7657     for (n_ctxt = 0;n_ctxt < gen_nb_xmlShellCtxtPtr;n_ctxt++) {
7658     for (n_arg = 0;n_arg < gen_nb_char_ptr;n_arg++) {
7659     for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
7660     for (n_node2 = 0;n_node2 < gen_nb_xmlNodePtr;n_node2++) {
7661         mem_base = xmlMemBlocks();
7662         ctxt = gen_xmlShellCtxtPtr(n_ctxt, 0);
7663         arg = gen_char_ptr(n_arg, 1);
7664         node = gen_xmlNodePtr(n_node, 2);
7665         node2 = gen_xmlNodePtr(n_node2, 3);
7666 
7667         ret_val = xmlShellDir(ctxt, arg, node, node2);
7668         desret_int(ret_val);
7669         call_tests++;
7670         des_xmlShellCtxtPtr(n_ctxt, ctxt, 0);
7671         des_char_ptr(n_arg, arg, 1);
7672         des_xmlNodePtr(n_node, node, 2);
7673         des_xmlNodePtr(n_node2, node2, 3);
7674         xmlResetLastError();
7675         if (mem_base != xmlMemBlocks()) {
7676             printf("Leak of %d blocks found in xmlShellDir",
7677 	           xmlMemBlocks() - mem_base);
7678 	    test_ret++;
7679             printf(" %d", n_ctxt);
7680             printf(" %d", n_arg);
7681             printf(" %d", n_node);
7682             printf(" %d", n_node2);
7683             printf("\n");
7684         }
7685     }
7686     }
7687     }
7688     }
7689     function_tests++;
7690 #endif
7691 
7692     return(test_ret);
7693 }
7694 
7695 
7696 static int
test_xmlShellDu(void)7697 test_xmlShellDu(void) {
7698     int test_ret = 0;
7699 
7700 #if defined(LIBXML_DEBUG_ENABLED) && defined(LIBXML_XPATH_ENABLED)
7701     int mem_base;
7702     int ret_val;
7703     xmlShellCtxtPtr ctxt; /* the shell context */
7704     int n_ctxt;
7705     char * arg; /* unused */
7706     int n_arg;
7707     xmlNodePtr tree; /* a node defining a subtree */
7708     int n_tree;
7709     xmlNodePtr node2; /* unused */
7710     int n_node2;
7711 
7712     for (n_ctxt = 0;n_ctxt < gen_nb_xmlShellCtxtPtr;n_ctxt++) {
7713     for (n_arg = 0;n_arg < gen_nb_char_ptr;n_arg++) {
7714     for (n_tree = 0;n_tree < gen_nb_xmlNodePtr;n_tree++) {
7715     for (n_node2 = 0;n_node2 < gen_nb_xmlNodePtr;n_node2++) {
7716         mem_base = xmlMemBlocks();
7717         ctxt = gen_xmlShellCtxtPtr(n_ctxt, 0);
7718         arg = gen_char_ptr(n_arg, 1);
7719         tree = gen_xmlNodePtr(n_tree, 2);
7720         node2 = gen_xmlNodePtr(n_node2, 3);
7721 
7722         ret_val = xmlShellDu(ctxt, arg, tree, node2);
7723         desret_int(ret_val);
7724         call_tests++;
7725         des_xmlShellCtxtPtr(n_ctxt, ctxt, 0);
7726         des_char_ptr(n_arg, arg, 1);
7727         des_xmlNodePtr(n_tree, tree, 2);
7728         des_xmlNodePtr(n_node2, node2, 3);
7729         xmlResetLastError();
7730         if (mem_base != xmlMemBlocks()) {
7731             printf("Leak of %d blocks found in xmlShellDu",
7732 	           xmlMemBlocks() - mem_base);
7733 	    test_ret++;
7734             printf(" %d", n_ctxt);
7735             printf(" %d", n_arg);
7736             printf(" %d", n_tree);
7737             printf(" %d", n_node2);
7738             printf("\n");
7739         }
7740     }
7741     }
7742     }
7743     }
7744     function_tests++;
7745 #endif
7746 
7747     return(test_ret);
7748 }
7749 
7750 
7751 static int
test_xmlShellList(void)7752 test_xmlShellList(void) {
7753     int test_ret = 0;
7754 
7755 #if defined(LIBXML_DEBUG_ENABLED) && defined(LIBXML_XPATH_ENABLED)
7756     int mem_base;
7757     int ret_val;
7758     xmlShellCtxtPtr ctxt; /* the shell context */
7759     int n_ctxt;
7760     char * arg; /* unused */
7761     int n_arg;
7762     xmlNodePtr node; /* a node */
7763     int n_node;
7764     xmlNodePtr node2; /* unused */
7765     int n_node2;
7766 
7767     for (n_ctxt = 0;n_ctxt < gen_nb_xmlShellCtxtPtr;n_ctxt++) {
7768     for (n_arg = 0;n_arg < gen_nb_char_ptr;n_arg++) {
7769     for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
7770     for (n_node2 = 0;n_node2 < gen_nb_xmlNodePtr;n_node2++) {
7771         mem_base = xmlMemBlocks();
7772         ctxt = gen_xmlShellCtxtPtr(n_ctxt, 0);
7773         arg = gen_char_ptr(n_arg, 1);
7774         node = gen_xmlNodePtr(n_node, 2);
7775         node2 = gen_xmlNodePtr(n_node2, 3);
7776 
7777         ret_val = xmlShellList(ctxt, arg, node, node2);
7778         desret_int(ret_val);
7779         call_tests++;
7780         des_xmlShellCtxtPtr(n_ctxt, ctxt, 0);
7781         des_char_ptr(n_arg, arg, 1);
7782         des_xmlNodePtr(n_node, node, 2);
7783         des_xmlNodePtr(n_node2, node2, 3);
7784         xmlResetLastError();
7785         if (mem_base != xmlMemBlocks()) {
7786             printf("Leak of %d blocks found in xmlShellList",
7787 	           xmlMemBlocks() - mem_base);
7788 	    test_ret++;
7789             printf(" %d", n_ctxt);
7790             printf(" %d", n_arg);
7791             printf(" %d", n_node);
7792             printf(" %d", n_node2);
7793             printf("\n");
7794         }
7795     }
7796     }
7797     }
7798     }
7799     function_tests++;
7800 #endif
7801 
7802     return(test_ret);
7803 }
7804 
7805 
7806 static int
test_xmlShellLoad(void)7807 test_xmlShellLoad(void) {
7808     int test_ret = 0;
7809 
7810 #if defined(LIBXML_DEBUG_ENABLED) && defined(LIBXML_XPATH_ENABLED)
7811     int mem_base;
7812     int ret_val;
7813     xmlShellCtxtPtr ctxt; /* the shell context */
7814     int n_ctxt;
7815     char * filename; /* the file name */
7816     int n_filename;
7817     xmlNodePtr node; /* unused */
7818     int n_node;
7819     xmlNodePtr node2; /* unused */
7820     int n_node2;
7821 
7822     for (n_ctxt = 0;n_ctxt < gen_nb_xmlShellCtxtPtr;n_ctxt++) {
7823     for (n_filename = 0;n_filename < gen_nb_char_ptr;n_filename++) {
7824     for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
7825     for (n_node2 = 0;n_node2 < gen_nb_xmlNodePtr;n_node2++) {
7826         mem_base = xmlMemBlocks();
7827         ctxt = gen_xmlShellCtxtPtr(n_ctxt, 0);
7828         filename = gen_char_ptr(n_filename, 1);
7829         node = gen_xmlNodePtr(n_node, 2);
7830         node2 = gen_xmlNodePtr(n_node2, 3);
7831 
7832         ret_val = xmlShellLoad(ctxt, filename, node, node2);
7833         desret_int(ret_val);
7834         call_tests++;
7835         des_xmlShellCtxtPtr(n_ctxt, ctxt, 0);
7836         des_char_ptr(n_filename, filename, 1);
7837         des_xmlNodePtr(n_node, node, 2);
7838         des_xmlNodePtr(n_node2, node2, 3);
7839         xmlResetLastError();
7840         if (mem_base != xmlMemBlocks()) {
7841             printf("Leak of %d blocks found in xmlShellLoad",
7842 	           xmlMemBlocks() - mem_base);
7843 	    test_ret++;
7844             printf(" %d", n_ctxt);
7845             printf(" %d", n_filename);
7846             printf(" %d", n_node);
7847             printf(" %d", n_node2);
7848             printf("\n");
7849         }
7850     }
7851     }
7852     }
7853     }
7854     function_tests++;
7855 #endif
7856 
7857     return(test_ret);
7858 }
7859 
7860 
7861 static int
test_xmlShellPrintXPathResult(void)7862 test_xmlShellPrintXPathResult(void) {
7863     int test_ret = 0;
7864 
7865 #if defined(LIBXML_DEBUG_ENABLED) && defined(LIBXML_XPATH_ENABLED)
7866     int mem_base;
7867     xmlXPathObjectPtr list; /* a valid result generated by an xpath evaluation */
7868     int n_list;
7869 
7870     for (n_list = 0;n_list < gen_nb_xmlXPathObjectPtr;n_list++) {
7871         mem_base = xmlMemBlocks();
7872         list = gen_xmlXPathObjectPtr(n_list, 0);
7873 
7874         xmlShellPrintXPathResult(list);
7875         call_tests++;
7876         des_xmlXPathObjectPtr(n_list, list, 0);
7877         xmlResetLastError();
7878         if (mem_base != xmlMemBlocks()) {
7879             printf("Leak of %d blocks found in xmlShellPrintXPathResult",
7880 	           xmlMemBlocks() - mem_base);
7881 	    test_ret++;
7882             printf(" %d", n_list);
7883             printf("\n");
7884         }
7885     }
7886     function_tests++;
7887 #endif
7888 
7889     return(test_ret);
7890 }
7891 
7892 
7893 static int
test_xmlShellPwd(void)7894 test_xmlShellPwd(void) {
7895     int test_ret = 0;
7896 
7897 #if defined(LIBXML_DEBUG_ENABLED) && defined(LIBXML_XPATH_ENABLED)
7898     int mem_base;
7899     int ret_val;
7900     xmlShellCtxtPtr ctxt; /* the shell context */
7901     int n_ctxt;
7902     char * buffer; /* the output buffer */
7903     int n_buffer;
7904     xmlNodePtr node; /* a node */
7905     int n_node;
7906     xmlNodePtr node2; /* unused */
7907     int n_node2;
7908 
7909     for (n_ctxt = 0;n_ctxt < gen_nb_xmlShellCtxtPtr;n_ctxt++) {
7910     for (n_buffer = 0;n_buffer < gen_nb_char_ptr;n_buffer++) {
7911     for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
7912     for (n_node2 = 0;n_node2 < gen_nb_xmlNodePtr;n_node2++) {
7913         mem_base = xmlMemBlocks();
7914         ctxt = gen_xmlShellCtxtPtr(n_ctxt, 0);
7915         buffer = gen_char_ptr(n_buffer, 1);
7916         node = gen_xmlNodePtr(n_node, 2);
7917         node2 = gen_xmlNodePtr(n_node2, 3);
7918 
7919         ret_val = xmlShellPwd(ctxt, buffer, node, node2);
7920         desret_int(ret_val);
7921         call_tests++;
7922         des_xmlShellCtxtPtr(n_ctxt, ctxt, 0);
7923         des_char_ptr(n_buffer, buffer, 1);
7924         des_xmlNodePtr(n_node, node, 2);
7925         des_xmlNodePtr(n_node2, node2, 3);
7926         xmlResetLastError();
7927         if (mem_base != xmlMemBlocks()) {
7928             printf("Leak of %d blocks found in xmlShellPwd",
7929 	           xmlMemBlocks() - mem_base);
7930 	    test_ret++;
7931             printf(" %d", n_ctxt);
7932             printf(" %d", n_buffer);
7933             printf(" %d", n_node);
7934             printf(" %d", n_node2);
7935             printf("\n");
7936         }
7937     }
7938     }
7939     }
7940     }
7941     function_tests++;
7942 #endif
7943 
7944     return(test_ret);
7945 }
7946 
7947 
7948 static int
test_xmlShellSave(void)7949 test_xmlShellSave(void) {
7950     int test_ret = 0;
7951 
7952 #if defined(LIBXML_DEBUG_ENABLED) && defined(LIBXML_XPATH_ENABLED) && defined(LIBXML_OUTPUT_ENABLED)
7953     int mem_base;
7954     int ret_val;
7955     xmlShellCtxtPtr ctxt; /* the shell context */
7956     int n_ctxt;
7957     char * filename; /* the file name (optional) */
7958     int n_filename;
7959     xmlNodePtr node; /* unused */
7960     int n_node;
7961     xmlNodePtr node2; /* unused */
7962     int n_node2;
7963 
7964     for (n_ctxt = 0;n_ctxt < gen_nb_xmlShellCtxtPtr;n_ctxt++) {
7965     for (n_filename = 0;n_filename < gen_nb_char_ptr;n_filename++) {
7966     for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
7967     for (n_node2 = 0;n_node2 < gen_nb_xmlNodePtr;n_node2++) {
7968         mem_base = xmlMemBlocks();
7969         ctxt = gen_xmlShellCtxtPtr(n_ctxt, 0);
7970         filename = gen_char_ptr(n_filename, 1);
7971         node = gen_xmlNodePtr(n_node, 2);
7972         node2 = gen_xmlNodePtr(n_node2, 3);
7973 
7974         ret_val = xmlShellSave(ctxt, filename, node, node2);
7975         desret_int(ret_val);
7976         call_tests++;
7977         des_xmlShellCtxtPtr(n_ctxt, ctxt, 0);
7978         des_char_ptr(n_filename, filename, 1);
7979         des_xmlNodePtr(n_node, node, 2);
7980         des_xmlNodePtr(n_node2, node2, 3);
7981         xmlResetLastError();
7982         if (mem_base != xmlMemBlocks()) {
7983             printf("Leak of %d blocks found in xmlShellSave",
7984 	           xmlMemBlocks() - mem_base);
7985 	    test_ret++;
7986             printf(" %d", n_ctxt);
7987             printf(" %d", n_filename);
7988             printf(" %d", n_node);
7989             printf(" %d", n_node2);
7990             printf("\n");
7991         }
7992     }
7993     }
7994     }
7995     }
7996     function_tests++;
7997 #endif
7998 
7999     return(test_ret);
8000 }
8001 
8002 
8003 static int
test_xmlShellValidate(void)8004 test_xmlShellValidate(void) {
8005     int test_ret = 0;
8006 
8007 #if defined(LIBXML_DEBUG_ENABLED) && defined(LIBXML_XPATH_ENABLED) && defined(LIBXML_VALID_ENABLED)
8008     int mem_base;
8009     int ret_val;
8010     xmlShellCtxtPtr ctxt; /* the shell context */
8011     int n_ctxt;
8012     char * dtd; /* the DTD URI (optional) */
8013     int n_dtd;
8014     xmlNodePtr node; /* unused */
8015     int n_node;
8016     xmlNodePtr node2; /* unused */
8017     int n_node2;
8018 
8019     for (n_ctxt = 0;n_ctxt < gen_nb_xmlShellCtxtPtr;n_ctxt++) {
8020     for (n_dtd = 0;n_dtd < gen_nb_char_ptr;n_dtd++) {
8021     for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
8022     for (n_node2 = 0;n_node2 < gen_nb_xmlNodePtr;n_node2++) {
8023         mem_base = xmlMemBlocks();
8024         ctxt = gen_xmlShellCtxtPtr(n_ctxt, 0);
8025         dtd = gen_char_ptr(n_dtd, 1);
8026         node = gen_xmlNodePtr(n_node, 2);
8027         node2 = gen_xmlNodePtr(n_node2, 3);
8028 
8029         ret_val = xmlShellValidate(ctxt, dtd, node, node2);
8030         desret_int(ret_val);
8031         call_tests++;
8032         des_xmlShellCtxtPtr(n_ctxt, ctxt, 0);
8033         des_char_ptr(n_dtd, dtd, 1);
8034         des_xmlNodePtr(n_node, node, 2);
8035         des_xmlNodePtr(n_node2, node2, 3);
8036         xmlResetLastError();
8037         if (mem_base != xmlMemBlocks()) {
8038             printf("Leak of %d blocks found in xmlShellValidate",
8039 	           xmlMemBlocks() - mem_base);
8040 	    test_ret++;
8041             printf(" %d", n_ctxt);
8042             printf(" %d", n_dtd);
8043             printf(" %d", n_node);
8044             printf(" %d", n_node2);
8045             printf("\n");
8046         }
8047     }
8048     }
8049     }
8050     }
8051     function_tests++;
8052 #endif
8053 
8054     return(test_ret);
8055 }
8056 
8057 
8058 static int
test_xmlShellWrite(void)8059 test_xmlShellWrite(void) {
8060     int test_ret = 0;
8061 
8062 #if defined(LIBXML_DEBUG_ENABLED) && defined(LIBXML_XPATH_ENABLED) && defined(LIBXML_OUTPUT_ENABLED)
8063     int mem_base;
8064     int ret_val;
8065     xmlShellCtxtPtr ctxt; /* the shell context */
8066     int n_ctxt;
8067     char * filename; /* the file name */
8068     int n_filename;
8069     xmlNodePtr node; /* a node in the tree */
8070     int n_node;
8071     xmlNodePtr node2; /* unused */
8072     int n_node2;
8073 
8074     for (n_ctxt = 0;n_ctxt < gen_nb_xmlShellCtxtPtr;n_ctxt++) {
8075     for (n_filename = 0;n_filename < gen_nb_char_ptr;n_filename++) {
8076     for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
8077     for (n_node2 = 0;n_node2 < gen_nb_xmlNodePtr;n_node2++) {
8078         mem_base = xmlMemBlocks();
8079         ctxt = gen_xmlShellCtxtPtr(n_ctxt, 0);
8080         filename = gen_char_ptr(n_filename, 1);
8081         node = gen_xmlNodePtr(n_node, 2);
8082         node2 = gen_xmlNodePtr(n_node2, 3);
8083 
8084         ret_val = xmlShellWrite(ctxt, filename, node, node2);
8085         desret_int(ret_val);
8086         call_tests++;
8087         des_xmlShellCtxtPtr(n_ctxt, ctxt, 0);
8088         des_char_ptr(n_filename, filename, 1);
8089         des_xmlNodePtr(n_node, node, 2);
8090         des_xmlNodePtr(n_node2, node2, 3);
8091         xmlResetLastError();
8092         if (mem_base != xmlMemBlocks()) {
8093             printf("Leak of %d blocks found in xmlShellWrite",
8094 	           xmlMemBlocks() - mem_base);
8095 	    test_ret++;
8096             printf(" %d", n_ctxt);
8097             printf(" %d", n_filename);
8098             printf(" %d", n_node);
8099             printf(" %d", n_node2);
8100             printf("\n");
8101         }
8102     }
8103     }
8104     }
8105     }
8106     function_tests++;
8107 #endif
8108 
8109     return(test_ret);
8110 }
8111 
8112 static int
test_debugXML(void)8113 test_debugXML(void) {
8114     int test_ret = 0;
8115 
8116     if (quiet == 0) printf("Testing debugXML : 25 of 28 functions ...\n");
8117     test_ret += test_xmlBoolToText();
8118     test_ret += test_xmlDebugCheckDocument();
8119     test_ret += test_xmlDebugDumpAttr();
8120     test_ret += test_xmlDebugDumpAttrList();
8121     test_ret += test_xmlDebugDumpDTD();
8122     test_ret += test_xmlDebugDumpDocument();
8123     test_ret += test_xmlDebugDumpDocumentHead();
8124     test_ret += test_xmlDebugDumpEntities();
8125     test_ret += test_xmlDebugDumpNode();
8126     test_ret += test_xmlDebugDumpNodeList();
8127     test_ret += test_xmlDebugDumpOneNode();
8128     test_ret += test_xmlDebugDumpString();
8129     test_ret += test_xmlLsCountNode();
8130     test_ret += test_xmlLsOneNode();
8131     test_ret += test_xmlShell();
8132     test_ret += test_xmlShellBase();
8133     test_ret += test_xmlShellCat();
8134     test_ret += test_xmlShellDir();
8135     test_ret += test_xmlShellDu();
8136     test_ret += test_xmlShellList();
8137     test_ret += test_xmlShellLoad();
8138     test_ret += test_xmlShellPrintXPathResult();
8139     test_ret += test_xmlShellPwd();
8140     test_ret += test_xmlShellSave();
8141     test_ret += test_xmlShellValidate();
8142     test_ret += test_xmlShellWrite();
8143 
8144     if (test_ret != 0)
8145 	printf("Module debugXML: %d errors\n", test_ret);
8146     return(test_ret);
8147 }
8148 
8149 static int
test_xmlDictCleanup(void)8150 test_xmlDictCleanup(void) {
8151     int test_ret = 0;
8152 
8153     int mem_base;
8154 
8155         mem_base = xmlMemBlocks();
8156 
8157         xmlDictCleanup();
8158         call_tests++;
8159         xmlResetLastError();
8160         if (mem_base != xmlMemBlocks()) {
8161             printf("Leak of %d blocks found in xmlDictCleanup",
8162 	           xmlMemBlocks() - mem_base);
8163 	    test_ret++;
8164             printf("\n");
8165         }
8166     function_tests++;
8167 
8168     return(test_ret);
8169 }
8170 
8171 
8172 static int
test_xmlDictCreate(void)8173 test_xmlDictCreate(void) {
8174     int test_ret = 0;
8175 
8176     int mem_base;
8177     xmlDictPtr ret_val;
8178 
8179         mem_base = xmlMemBlocks();
8180 
8181         ret_val = xmlDictCreate();
8182         desret_xmlDictPtr(ret_val);
8183         call_tests++;
8184         xmlResetLastError();
8185         if (mem_base != xmlMemBlocks()) {
8186             printf("Leak of %d blocks found in xmlDictCreate",
8187 	           xmlMemBlocks() - mem_base);
8188 	    test_ret++;
8189             printf("\n");
8190         }
8191     function_tests++;
8192 
8193     return(test_ret);
8194 }
8195 
8196 
8197 static int
test_xmlDictCreateSub(void)8198 test_xmlDictCreateSub(void) {
8199     int test_ret = 0;
8200 
8201     int mem_base;
8202     xmlDictPtr ret_val;
8203     xmlDictPtr sub; /* an existing dictionary */
8204     int n_sub;
8205 
8206     for (n_sub = 0;n_sub < gen_nb_xmlDictPtr;n_sub++) {
8207         mem_base = xmlMemBlocks();
8208         sub = gen_xmlDictPtr(n_sub, 0);
8209 
8210         ret_val = xmlDictCreateSub(sub);
8211         desret_xmlDictPtr(ret_val);
8212         call_tests++;
8213         des_xmlDictPtr(n_sub, sub, 0);
8214         xmlResetLastError();
8215         if (mem_base != xmlMemBlocks()) {
8216             printf("Leak of %d blocks found in xmlDictCreateSub",
8217 	           xmlMemBlocks() - mem_base);
8218 	    test_ret++;
8219             printf(" %d", n_sub);
8220             printf("\n");
8221         }
8222     }
8223     function_tests++;
8224 
8225     return(test_ret);
8226 }
8227 
8228 
8229 static int
test_xmlDictExists(void)8230 test_xmlDictExists(void) {
8231     int test_ret = 0;
8232 
8233     int mem_base;
8234     const xmlChar * ret_val;
8235     xmlDictPtr dict; /* the dictionary */
8236     int n_dict;
8237     xmlChar * name; /* the name of the userdata */
8238     int n_name;
8239     int len; /* the length of the name, if -1 it is recomputed */
8240     int n_len;
8241 
8242     for (n_dict = 0;n_dict < gen_nb_xmlDictPtr;n_dict++) {
8243     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
8244     for (n_len = 0;n_len < gen_nb_int;n_len++) {
8245         mem_base = xmlMemBlocks();
8246         dict = gen_xmlDictPtr(n_dict, 0);
8247         name = gen_const_xmlChar_ptr(n_name, 1);
8248         len = gen_int(n_len, 2);
8249         if ((name != NULL) &&
8250             (len > (int) strlen((const char *) name) + 1))
8251             continue;
8252 
8253         ret_val = xmlDictExists(dict, (const xmlChar *)name, len);
8254         desret_const_xmlChar_ptr(ret_val);
8255         call_tests++;
8256         des_xmlDictPtr(n_dict, dict, 0);
8257         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
8258         des_int(n_len, len, 2);
8259         xmlResetLastError();
8260         if (mem_base != xmlMemBlocks()) {
8261             printf("Leak of %d blocks found in xmlDictExists",
8262 	           xmlMemBlocks() - mem_base);
8263 	    test_ret++;
8264             printf(" %d", n_dict);
8265             printf(" %d", n_name);
8266             printf(" %d", n_len);
8267             printf("\n");
8268         }
8269     }
8270     }
8271     }
8272     function_tests++;
8273 
8274     return(test_ret);
8275 }
8276 
8277 
8278 static int
test_xmlDictGetUsage(void)8279 test_xmlDictGetUsage(void) {
8280     int test_ret = 0;
8281 
8282 
8283     /* missing type support */
8284     return(test_ret);
8285 }
8286 
8287 
8288 static int
test_xmlDictLookup(void)8289 test_xmlDictLookup(void) {
8290     int test_ret = 0;
8291 
8292     int mem_base;
8293     const xmlChar * ret_val;
8294     xmlDictPtr dict; /* the dictionary */
8295     int n_dict;
8296     xmlChar * name; /* the name of the userdata */
8297     int n_name;
8298     int len; /* the length of the name, if -1 it is recomputed */
8299     int n_len;
8300 
8301     for (n_dict = 0;n_dict < gen_nb_xmlDictPtr;n_dict++) {
8302     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
8303     for (n_len = 0;n_len < gen_nb_int;n_len++) {
8304         mem_base = xmlMemBlocks();
8305         dict = gen_xmlDictPtr(n_dict, 0);
8306         name = gen_const_xmlChar_ptr(n_name, 1);
8307         len = gen_int(n_len, 2);
8308         if ((name != NULL) &&
8309             (len > (int) strlen((const char *) name) + 1))
8310             continue;
8311 
8312         ret_val = xmlDictLookup(dict, (const xmlChar *)name, len);
8313         desret_const_xmlChar_ptr(ret_val);
8314         call_tests++;
8315         des_xmlDictPtr(n_dict, dict, 0);
8316         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
8317         des_int(n_len, len, 2);
8318         xmlResetLastError();
8319         if (mem_base != xmlMemBlocks()) {
8320             printf("Leak of %d blocks found in xmlDictLookup",
8321 	           xmlMemBlocks() - mem_base);
8322 	    test_ret++;
8323             printf(" %d", n_dict);
8324             printf(" %d", n_name);
8325             printf(" %d", n_len);
8326             printf("\n");
8327         }
8328     }
8329     }
8330     }
8331     function_tests++;
8332 
8333     return(test_ret);
8334 }
8335 
8336 
8337 static int
test_xmlDictOwns(void)8338 test_xmlDictOwns(void) {
8339     int test_ret = 0;
8340 
8341     int mem_base;
8342     int ret_val;
8343     xmlDictPtr dict; /* the dictionary */
8344     int n_dict;
8345     xmlChar * str; /* the string */
8346     int n_str;
8347 
8348     for (n_dict = 0;n_dict < gen_nb_xmlDictPtr;n_dict++) {
8349     for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) {
8350         mem_base = xmlMemBlocks();
8351         dict = gen_xmlDictPtr(n_dict, 0);
8352         str = gen_const_xmlChar_ptr(n_str, 1);
8353 
8354         ret_val = xmlDictOwns(dict, (const xmlChar *)str);
8355         desret_int(ret_val);
8356         call_tests++;
8357         des_xmlDictPtr(n_dict, dict, 0);
8358         des_const_xmlChar_ptr(n_str, (const xmlChar *)str, 1);
8359         xmlResetLastError();
8360         if (mem_base != xmlMemBlocks()) {
8361             printf("Leak of %d blocks found in xmlDictOwns",
8362 	           xmlMemBlocks() - mem_base);
8363 	    test_ret++;
8364             printf(" %d", n_dict);
8365             printf(" %d", n_str);
8366             printf("\n");
8367         }
8368     }
8369     }
8370     function_tests++;
8371 
8372     return(test_ret);
8373 }
8374 
8375 
8376 static int
test_xmlDictQLookup(void)8377 test_xmlDictQLookup(void) {
8378     int test_ret = 0;
8379 
8380     int mem_base;
8381     const xmlChar * ret_val;
8382     xmlDictPtr dict; /* the dictionary */
8383     int n_dict;
8384     xmlChar * prefix; /* the prefix */
8385     int n_prefix;
8386     xmlChar * name; /* the name */
8387     int n_name;
8388 
8389     for (n_dict = 0;n_dict < gen_nb_xmlDictPtr;n_dict++) {
8390     for (n_prefix = 0;n_prefix < gen_nb_const_xmlChar_ptr;n_prefix++) {
8391     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
8392         mem_base = xmlMemBlocks();
8393         dict = gen_xmlDictPtr(n_dict, 0);
8394         prefix = gen_const_xmlChar_ptr(n_prefix, 1);
8395         name = gen_const_xmlChar_ptr(n_name, 2);
8396 
8397         ret_val = xmlDictQLookup(dict, (const xmlChar *)prefix, (const xmlChar *)name);
8398         desret_const_xmlChar_ptr(ret_val);
8399         call_tests++;
8400         des_xmlDictPtr(n_dict, dict, 0);
8401         des_const_xmlChar_ptr(n_prefix, (const xmlChar *)prefix, 1);
8402         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 2);
8403         xmlResetLastError();
8404         if (mem_base != xmlMemBlocks()) {
8405             printf("Leak of %d blocks found in xmlDictQLookup",
8406 	           xmlMemBlocks() - mem_base);
8407 	    test_ret++;
8408             printf(" %d", n_dict);
8409             printf(" %d", n_prefix);
8410             printf(" %d", n_name);
8411             printf("\n");
8412         }
8413     }
8414     }
8415     }
8416     function_tests++;
8417 
8418     return(test_ret);
8419 }
8420 
8421 
8422 static int
test_xmlDictReference(void)8423 test_xmlDictReference(void) {
8424     int test_ret = 0;
8425 
8426     int mem_base;
8427     int ret_val;
8428     xmlDictPtr dict; /* the dictionary */
8429     int n_dict;
8430 
8431     for (n_dict = 0;n_dict < gen_nb_xmlDictPtr;n_dict++) {
8432         mem_base = xmlMemBlocks();
8433         dict = gen_xmlDictPtr(n_dict, 0);
8434 
8435         ret_val = xmlDictReference(dict);
8436         xmlDictFree(dict);
8437         desret_int(ret_val);
8438         call_tests++;
8439         des_xmlDictPtr(n_dict, dict, 0);
8440         xmlResetLastError();
8441         if (mem_base != xmlMemBlocks()) {
8442             printf("Leak of %d blocks found in xmlDictReference",
8443 	           xmlMemBlocks() - mem_base);
8444 	    test_ret++;
8445             printf(" %d", n_dict);
8446             printf("\n");
8447         }
8448     }
8449     function_tests++;
8450 
8451     return(test_ret);
8452 }
8453 
8454 
8455 static int
test_xmlDictSetLimit(void)8456 test_xmlDictSetLimit(void) {
8457     int test_ret = 0;
8458 
8459 
8460     /* missing type support */
8461     return(test_ret);
8462 }
8463 
8464 
8465 static int
test_xmlDictSize(void)8466 test_xmlDictSize(void) {
8467     int test_ret = 0;
8468 
8469     int mem_base;
8470     int ret_val;
8471     xmlDictPtr dict; /* the dictionary */
8472     int n_dict;
8473 
8474     for (n_dict = 0;n_dict < gen_nb_xmlDictPtr;n_dict++) {
8475         mem_base = xmlMemBlocks();
8476         dict = gen_xmlDictPtr(n_dict, 0);
8477 
8478         ret_val = xmlDictSize(dict);
8479         desret_int(ret_val);
8480         call_tests++;
8481         des_xmlDictPtr(n_dict, dict, 0);
8482         xmlResetLastError();
8483         if (mem_base != xmlMemBlocks()) {
8484             printf("Leak of %d blocks found in xmlDictSize",
8485 	           xmlMemBlocks() - mem_base);
8486 	    test_ret++;
8487             printf(" %d", n_dict);
8488             printf("\n");
8489         }
8490     }
8491     function_tests++;
8492 
8493     return(test_ret);
8494 }
8495 
8496 
8497 static int
test_xmlInitializeDict(void)8498 test_xmlInitializeDict(void) {
8499     int test_ret = 0;
8500 
8501     int mem_base;
8502     int ret_val;
8503 
8504         mem_base = xmlMemBlocks();
8505 
8506         ret_val = xmlInitializeDict();
8507         desret_int(ret_val);
8508         call_tests++;
8509         xmlResetLastError();
8510         if (mem_base != xmlMemBlocks()) {
8511             printf("Leak of %d blocks found in xmlInitializeDict",
8512 	           xmlMemBlocks() - mem_base);
8513 	    test_ret++;
8514             printf("\n");
8515         }
8516     function_tests++;
8517 
8518     return(test_ret);
8519 }
8520 
8521 static int
test_dict(void)8522 test_dict(void) {
8523     int test_ret = 0;
8524 
8525     if (quiet == 0) printf("Testing dict : 10 of 13 functions ...\n");
8526     test_ret += test_xmlDictCleanup();
8527     test_ret += test_xmlDictCreate();
8528     test_ret += test_xmlDictCreateSub();
8529     test_ret += test_xmlDictExists();
8530     test_ret += test_xmlDictGetUsage();
8531     test_ret += test_xmlDictLookup();
8532     test_ret += test_xmlDictOwns();
8533     test_ret += test_xmlDictQLookup();
8534     test_ret += test_xmlDictReference();
8535     test_ret += test_xmlDictSetLimit();
8536     test_ret += test_xmlDictSize();
8537     test_ret += test_xmlInitializeDict();
8538 
8539     if (test_ret != 0)
8540 	printf("Module dict: %d errors\n", test_ret);
8541     return(test_ret);
8542 }
8543 
8544 static int
test_UTF8Toisolat1(void)8545 test_UTF8Toisolat1(void) {
8546     int test_ret = 0;
8547 
8548 #if defined(LIBXML_OUTPUT_ENABLED)
8549 #ifdef LIBXML_OUTPUT_ENABLED
8550     int mem_base;
8551     int ret_val;
8552     unsigned char * out; /* a pointer to an array of bytes to store the result */
8553     int n_out;
8554     int * outlen; /* the length of @out */
8555     int n_outlen;
8556     unsigned char * in; /* a pointer to an array of UTF-8 chars */
8557     int n_in;
8558     int * inlen; /* the length of @in */
8559     int n_inlen;
8560 
8561     for (n_out = 0;n_out < gen_nb_unsigned_char_ptr;n_out++) {
8562     for (n_outlen = 0;n_outlen < gen_nb_int_ptr;n_outlen++) {
8563     for (n_in = 0;n_in < gen_nb_const_unsigned_char_ptr;n_in++) {
8564     for (n_inlen = 0;n_inlen < gen_nb_int_ptr;n_inlen++) {
8565         mem_base = xmlMemBlocks();
8566         out = gen_unsigned_char_ptr(n_out, 0);
8567         outlen = gen_int_ptr(n_outlen, 1);
8568         in = gen_const_unsigned_char_ptr(n_in, 2);
8569         inlen = gen_int_ptr(n_inlen, 3);
8570 
8571         ret_val = UTF8Toisolat1(out, outlen, (const unsigned char *)in, inlen);
8572         desret_int(ret_val);
8573         call_tests++;
8574         des_unsigned_char_ptr(n_out, out, 0);
8575         des_int_ptr(n_outlen, outlen, 1);
8576         des_const_unsigned_char_ptr(n_in, (const unsigned char *)in, 2);
8577         des_int_ptr(n_inlen, inlen, 3);
8578         xmlResetLastError();
8579         if (mem_base != xmlMemBlocks()) {
8580             printf("Leak of %d blocks found in UTF8Toisolat1",
8581 	           xmlMemBlocks() - mem_base);
8582 	    test_ret++;
8583             printf(" %d", n_out);
8584             printf(" %d", n_outlen);
8585             printf(" %d", n_in);
8586             printf(" %d", n_inlen);
8587             printf("\n");
8588         }
8589     }
8590     }
8591     }
8592     }
8593     function_tests++;
8594 #endif
8595 #endif
8596 
8597     return(test_ret);
8598 }
8599 
8600 
8601 static int
test_isolat1ToUTF8(void)8602 test_isolat1ToUTF8(void) {
8603     int test_ret = 0;
8604 
8605     int mem_base;
8606     int ret_val;
8607     unsigned char * out; /* a pointer to an array of bytes to store the result */
8608     int n_out;
8609     int * outlen; /* the length of @out */
8610     int n_outlen;
8611     unsigned char * in; /* a pointer to an array of ISO Latin 1 chars */
8612     int n_in;
8613     int * inlen; /* the length of @in */
8614     int n_inlen;
8615 
8616     for (n_out = 0;n_out < gen_nb_unsigned_char_ptr;n_out++) {
8617     for (n_outlen = 0;n_outlen < gen_nb_int_ptr;n_outlen++) {
8618     for (n_in = 0;n_in < gen_nb_const_unsigned_char_ptr;n_in++) {
8619     for (n_inlen = 0;n_inlen < gen_nb_int_ptr;n_inlen++) {
8620         mem_base = xmlMemBlocks();
8621         out = gen_unsigned_char_ptr(n_out, 0);
8622         outlen = gen_int_ptr(n_outlen, 1);
8623         in = gen_const_unsigned_char_ptr(n_in, 2);
8624         inlen = gen_int_ptr(n_inlen, 3);
8625 
8626         ret_val = isolat1ToUTF8(out, outlen, (const unsigned char *)in, inlen);
8627         desret_int(ret_val);
8628         call_tests++;
8629         des_unsigned_char_ptr(n_out, out, 0);
8630         des_int_ptr(n_outlen, outlen, 1);
8631         des_const_unsigned_char_ptr(n_in, (const unsigned char *)in, 2);
8632         des_int_ptr(n_inlen, inlen, 3);
8633         xmlResetLastError();
8634         if (mem_base != xmlMemBlocks()) {
8635             printf("Leak of %d blocks found in isolat1ToUTF8",
8636 	           xmlMemBlocks() - mem_base);
8637 	    test_ret++;
8638             printf(" %d", n_out);
8639             printf(" %d", n_outlen);
8640             printf(" %d", n_in);
8641             printf(" %d", n_inlen);
8642             printf("\n");
8643         }
8644     }
8645     }
8646     }
8647     }
8648     function_tests++;
8649 
8650     return(test_ret);
8651 }
8652 
8653 
8654 static int
test_xmlAddEncodingAlias(void)8655 test_xmlAddEncodingAlias(void) {
8656     int test_ret = 0;
8657 
8658     int ret_val;
8659     char * name; /* the encoding name as parsed, in UTF-8 format (ASCII actually) */
8660     int n_name;
8661     char * alias; /* the alias name as parsed, in UTF-8 format (ASCII actually) */
8662     int n_alias;
8663 
8664     for (n_name = 0;n_name < gen_nb_const_char_ptr;n_name++) {
8665     for (n_alias = 0;n_alias < gen_nb_const_char_ptr;n_alias++) {
8666         name = gen_const_char_ptr(n_name, 0);
8667         alias = gen_const_char_ptr(n_alias, 1);
8668 
8669         ret_val = xmlAddEncodingAlias((const char *)name, (const char *)alias);
8670         desret_int(ret_val);
8671         call_tests++;
8672         des_const_char_ptr(n_name, (const char *)name, 0);
8673         des_const_char_ptr(n_alias, (const char *)alias, 1);
8674         xmlResetLastError();
8675     }
8676     }
8677     function_tests++;
8678 
8679     return(test_ret);
8680 }
8681 
8682 
8683 #define gen_nb_xmlCharEncodingHandler_ptr 1
gen_xmlCharEncodingHandler_ptr(int no ATTRIBUTE_UNUSED,int nr ATTRIBUTE_UNUSED)8684 static xmlCharEncodingHandler * gen_xmlCharEncodingHandler_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
8685     return(NULL);
8686 }
des_xmlCharEncodingHandler_ptr(int no ATTRIBUTE_UNUSED,xmlCharEncodingHandler * val ATTRIBUTE_UNUSED,int nr ATTRIBUTE_UNUSED)8687 static void des_xmlCharEncodingHandler_ptr(int no ATTRIBUTE_UNUSED, xmlCharEncodingHandler * val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
8688 }
8689 
8690 static int
test_xmlCharEncCloseFunc(void)8691 test_xmlCharEncCloseFunc(void) {
8692     int test_ret = 0;
8693 
8694     int mem_base;
8695     int ret_val;
8696     xmlCharEncodingHandler * handler; /* char enconding transformation data structure */
8697     int n_handler;
8698 
8699     for (n_handler = 0;n_handler < gen_nb_xmlCharEncodingHandler_ptr;n_handler++) {
8700         mem_base = xmlMemBlocks();
8701         handler = gen_xmlCharEncodingHandler_ptr(n_handler, 0);
8702 
8703         ret_val = xmlCharEncCloseFunc(handler);
8704         desret_int(ret_val);
8705         call_tests++;
8706         des_xmlCharEncodingHandler_ptr(n_handler, handler, 0);
8707         xmlResetLastError();
8708         if (mem_base != xmlMemBlocks()) {
8709             printf("Leak of %d blocks found in xmlCharEncCloseFunc",
8710 	           xmlMemBlocks() - mem_base);
8711 	    test_ret++;
8712             printf(" %d", n_handler);
8713             printf("\n");
8714         }
8715     }
8716     function_tests++;
8717 
8718     return(test_ret);
8719 }
8720 
8721 
8722 static int
test_xmlCharEncFirstLine(void)8723 test_xmlCharEncFirstLine(void) {
8724     int test_ret = 0;
8725 
8726     int mem_base;
8727     int ret_val;
8728     xmlCharEncodingHandler * handler; /* char enconding transformation data structure */
8729     int n_handler;
8730     xmlBufferPtr out; /* an xmlBuffer for the output. */
8731     int n_out;
8732     xmlBufferPtr in; /* an xmlBuffer for the input */
8733     int n_in;
8734 
8735     for (n_handler = 0;n_handler < gen_nb_xmlCharEncodingHandler_ptr;n_handler++) {
8736     for (n_out = 0;n_out < gen_nb_xmlBufferPtr;n_out++) {
8737     for (n_in = 0;n_in < gen_nb_xmlBufferPtr;n_in++) {
8738         mem_base = xmlMemBlocks();
8739         handler = gen_xmlCharEncodingHandler_ptr(n_handler, 0);
8740         out = gen_xmlBufferPtr(n_out, 1);
8741         in = gen_xmlBufferPtr(n_in, 2);
8742 
8743         ret_val = xmlCharEncFirstLine(handler, out, in);
8744         desret_int(ret_val);
8745         call_tests++;
8746         des_xmlCharEncodingHandler_ptr(n_handler, handler, 0);
8747         des_xmlBufferPtr(n_out, out, 1);
8748         des_xmlBufferPtr(n_in, in, 2);
8749         xmlResetLastError();
8750         if (mem_base != xmlMemBlocks()) {
8751             printf("Leak of %d blocks found in xmlCharEncFirstLine",
8752 	           xmlMemBlocks() - mem_base);
8753 	    test_ret++;
8754             printf(" %d", n_handler);
8755             printf(" %d", n_out);
8756             printf(" %d", n_in);
8757             printf("\n");
8758         }
8759     }
8760     }
8761     }
8762     function_tests++;
8763 
8764     return(test_ret);
8765 }
8766 
8767 
8768 static int
test_xmlCharEncInFunc(void)8769 test_xmlCharEncInFunc(void) {
8770     int test_ret = 0;
8771 
8772     int mem_base;
8773     int ret_val;
8774     xmlCharEncodingHandler * handler; /* char encoding transformation data structure */
8775     int n_handler;
8776     xmlBufferPtr out; /* an xmlBuffer for the output. */
8777     int n_out;
8778     xmlBufferPtr in; /* an xmlBuffer for the input */
8779     int n_in;
8780 
8781     for (n_handler = 0;n_handler < gen_nb_xmlCharEncodingHandler_ptr;n_handler++) {
8782     for (n_out = 0;n_out < gen_nb_xmlBufferPtr;n_out++) {
8783     for (n_in = 0;n_in < gen_nb_xmlBufferPtr;n_in++) {
8784         mem_base = xmlMemBlocks();
8785         handler = gen_xmlCharEncodingHandler_ptr(n_handler, 0);
8786         out = gen_xmlBufferPtr(n_out, 1);
8787         in = gen_xmlBufferPtr(n_in, 2);
8788 
8789         ret_val = xmlCharEncInFunc(handler, out, in);
8790         desret_int(ret_val);
8791         call_tests++;
8792         des_xmlCharEncodingHandler_ptr(n_handler, handler, 0);
8793         des_xmlBufferPtr(n_out, out, 1);
8794         des_xmlBufferPtr(n_in, in, 2);
8795         xmlResetLastError();
8796         if (mem_base != xmlMemBlocks()) {
8797             printf("Leak of %d blocks found in xmlCharEncInFunc",
8798 	           xmlMemBlocks() - mem_base);
8799 	    test_ret++;
8800             printf(" %d", n_handler);
8801             printf(" %d", n_out);
8802             printf(" %d", n_in);
8803             printf("\n");
8804         }
8805     }
8806     }
8807     }
8808     function_tests++;
8809 
8810     return(test_ret);
8811 }
8812 
8813 
8814 static int
test_xmlCharEncOutFunc(void)8815 test_xmlCharEncOutFunc(void) {
8816     int test_ret = 0;
8817 
8818     int mem_base;
8819     int ret_val;
8820     xmlCharEncodingHandler * handler; /* char enconding transformation data structure */
8821     int n_handler;
8822     xmlBufferPtr out; /* an xmlBuffer for the output. */
8823     int n_out;
8824     xmlBufferPtr in; /* an xmlBuffer for the input */
8825     int n_in;
8826 
8827     for (n_handler = 0;n_handler < gen_nb_xmlCharEncodingHandler_ptr;n_handler++) {
8828     for (n_out = 0;n_out < gen_nb_xmlBufferPtr;n_out++) {
8829     for (n_in = 0;n_in < gen_nb_xmlBufferPtr;n_in++) {
8830         mem_base = xmlMemBlocks();
8831         handler = gen_xmlCharEncodingHandler_ptr(n_handler, 0);
8832         out = gen_xmlBufferPtr(n_out, 1);
8833         in = gen_xmlBufferPtr(n_in, 2);
8834 
8835         ret_val = xmlCharEncOutFunc(handler, out, in);
8836         desret_int(ret_val);
8837         call_tests++;
8838         des_xmlCharEncodingHandler_ptr(n_handler, handler, 0);
8839         des_xmlBufferPtr(n_out, out, 1);
8840         des_xmlBufferPtr(n_in, in, 2);
8841         xmlResetLastError();
8842         if (mem_base != xmlMemBlocks()) {
8843             printf("Leak of %d blocks found in xmlCharEncOutFunc",
8844 	           xmlMemBlocks() - mem_base);
8845 	    test_ret++;
8846             printf(" %d", n_handler);
8847             printf(" %d", n_out);
8848             printf(" %d", n_in);
8849             printf("\n");
8850         }
8851     }
8852     }
8853     }
8854     function_tests++;
8855 
8856     return(test_ret);
8857 }
8858 
8859 
8860 static int
test_xmlCleanupCharEncodingHandlers(void)8861 test_xmlCleanupCharEncodingHandlers(void) {
8862     int test_ret = 0;
8863 
8864 
8865 
8866         xmlCleanupCharEncodingHandlers();
8867         call_tests++;
8868         xmlResetLastError();
8869     function_tests++;
8870 
8871     return(test_ret);
8872 }
8873 
8874 
8875 static int
test_xmlCleanupEncodingAliases(void)8876 test_xmlCleanupEncodingAliases(void) {
8877     int test_ret = 0;
8878 
8879     int mem_base;
8880 
8881         mem_base = xmlMemBlocks();
8882 
8883         xmlCleanupEncodingAliases();
8884         call_tests++;
8885         xmlResetLastError();
8886         if (mem_base != xmlMemBlocks()) {
8887             printf("Leak of %d blocks found in xmlCleanupEncodingAliases",
8888 	           xmlMemBlocks() - mem_base);
8889 	    test_ret++;
8890             printf("\n");
8891         }
8892     function_tests++;
8893 
8894     return(test_ret);
8895 }
8896 
8897 
8898 static int
test_xmlDelEncodingAlias(void)8899 test_xmlDelEncodingAlias(void) {
8900     int test_ret = 0;
8901 
8902     int mem_base;
8903     int ret_val;
8904     char * alias; /* the alias name as parsed, in UTF-8 format (ASCII actually) */
8905     int n_alias;
8906 
8907     for (n_alias = 0;n_alias < gen_nb_const_char_ptr;n_alias++) {
8908         mem_base = xmlMemBlocks();
8909         alias = gen_const_char_ptr(n_alias, 0);
8910 
8911         ret_val = xmlDelEncodingAlias((const char *)alias);
8912         desret_int(ret_val);
8913         call_tests++;
8914         des_const_char_ptr(n_alias, (const char *)alias, 0);
8915         xmlResetLastError();
8916         if (mem_base != xmlMemBlocks()) {
8917             printf("Leak of %d blocks found in xmlDelEncodingAlias",
8918 	           xmlMemBlocks() - mem_base);
8919 	    test_ret++;
8920             printf(" %d", n_alias);
8921             printf("\n");
8922         }
8923     }
8924     function_tests++;
8925 
8926     return(test_ret);
8927 }
8928 
8929 
8930 static int
test_xmlDetectCharEncoding(void)8931 test_xmlDetectCharEncoding(void) {
8932     int test_ret = 0;
8933 
8934     int mem_base;
8935     xmlCharEncoding ret_val;
8936     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). */
8937     int n_in;
8938     int len; /* pointer to the length of the buffer */
8939     int n_len;
8940 
8941     for (n_in = 0;n_in < gen_nb_const_unsigned_char_ptr;n_in++) {
8942     for (n_len = 0;n_len < gen_nb_int;n_len++) {
8943         mem_base = xmlMemBlocks();
8944         in = gen_const_unsigned_char_ptr(n_in, 0);
8945         len = gen_int(n_len, 1);
8946 
8947         ret_val = xmlDetectCharEncoding((const unsigned char *)in, len);
8948         desret_xmlCharEncoding(ret_val);
8949         call_tests++;
8950         des_const_unsigned_char_ptr(n_in, (const unsigned char *)in, 0);
8951         des_int(n_len, len, 1);
8952         xmlResetLastError();
8953         if (mem_base != xmlMemBlocks()) {
8954             printf("Leak of %d blocks found in xmlDetectCharEncoding",
8955 	           xmlMemBlocks() - mem_base);
8956 	    test_ret++;
8957             printf(" %d", n_in);
8958             printf(" %d", n_len);
8959             printf("\n");
8960         }
8961     }
8962     }
8963     function_tests++;
8964 
8965     return(test_ret);
8966 }
8967 
8968 
8969 static int
test_xmlFindCharEncodingHandler(void)8970 test_xmlFindCharEncodingHandler(void) {
8971     int test_ret = 0;
8972 
8973 
8974     /* missing type support */
8975     return(test_ret);
8976 }
8977 
8978 
8979 static int
test_xmlGetCharEncodingHandler(void)8980 test_xmlGetCharEncodingHandler(void) {
8981     int test_ret = 0;
8982 
8983 
8984     /* missing type support */
8985     return(test_ret);
8986 }
8987 
8988 
8989 static int
test_xmlGetCharEncodingName(void)8990 test_xmlGetCharEncodingName(void) {
8991     int test_ret = 0;
8992 
8993     int mem_base;
8994     const char * ret_val;
8995     xmlCharEncoding enc; /* the encoding */
8996     int n_enc;
8997 
8998     for (n_enc = 0;n_enc < gen_nb_xmlCharEncoding;n_enc++) {
8999         mem_base = xmlMemBlocks();
9000         enc = gen_xmlCharEncoding(n_enc, 0);
9001 
9002         ret_val = xmlGetCharEncodingName(enc);
9003         desret_const_char_ptr(ret_val);
9004         call_tests++;
9005         des_xmlCharEncoding(n_enc, enc, 0);
9006         xmlResetLastError();
9007         if (mem_base != xmlMemBlocks()) {
9008             printf("Leak of %d blocks found in xmlGetCharEncodingName",
9009 	           xmlMemBlocks() - mem_base);
9010 	    test_ret++;
9011             printf(" %d", n_enc);
9012             printf("\n");
9013         }
9014     }
9015     function_tests++;
9016 
9017     return(test_ret);
9018 }
9019 
9020 
9021 static int
test_xmlGetEncodingAlias(void)9022 test_xmlGetEncodingAlias(void) {
9023     int test_ret = 0;
9024 
9025     int mem_base;
9026     const char * ret_val;
9027     char * alias; /* the alias name as parsed, in UTF-8 format (ASCII actually) */
9028     int n_alias;
9029 
9030     for (n_alias = 0;n_alias < gen_nb_const_char_ptr;n_alias++) {
9031         mem_base = xmlMemBlocks();
9032         alias = gen_const_char_ptr(n_alias, 0);
9033 
9034         ret_val = xmlGetEncodingAlias((const char *)alias);
9035         desret_const_char_ptr(ret_val);
9036         call_tests++;
9037         des_const_char_ptr(n_alias, (const char *)alias, 0);
9038         xmlResetLastError();
9039         if (mem_base != xmlMemBlocks()) {
9040             printf("Leak of %d blocks found in xmlGetEncodingAlias",
9041 	           xmlMemBlocks() - mem_base);
9042 	    test_ret++;
9043             printf(" %d", n_alias);
9044             printf("\n");
9045         }
9046     }
9047     function_tests++;
9048 
9049     return(test_ret);
9050 }
9051 
9052 
9053 static int
test_xmlInitCharEncodingHandlers(void)9054 test_xmlInitCharEncodingHandlers(void) {
9055     int test_ret = 0;
9056 
9057 
9058 
9059         xmlInitCharEncodingHandlers();
9060         call_tests++;
9061         xmlResetLastError();
9062     function_tests++;
9063 
9064     return(test_ret);
9065 }
9066 
9067 
9068 static int
test_xmlNewCharEncodingHandler(void)9069 test_xmlNewCharEncodingHandler(void) {
9070     int test_ret = 0;
9071 
9072 
9073     /* missing type support */
9074     return(test_ret);
9075 }
9076 
9077 
9078 static int
test_xmlParseCharEncoding(void)9079 test_xmlParseCharEncoding(void) {
9080     int test_ret = 0;
9081 
9082     int mem_base;
9083     xmlCharEncoding ret_val;
9084     char * name; /* the encoding name as parsed, in UTF-8 format (ASCII actually) */
9085     int n_name;
9086 
9087     for (n_name = 0;n_name < gen_nb_const_char_ptr;n_name++) {
9088         mem_base = xmlMemBlocks();
9089         name = gen_const_char_ptr(n_name, 0);
9090 
9091         ret_val = xmlParseCharEncoding((const char *)name);
9092         desret_xmlCharEncoding(ret_val);
9093         call_tests++;
9094         des_const_char_ptr(n_name, (const char *)name, 0);
9095         xmlResetLastError();
9096         if (mem_base != xmlMemBlocks()) {
9097             printf("Leak of %d blocks found in xmlParseCharEncoding",
9098 	           xmlMemBlocks() - mem_base);
9099 	    test_ret++;
9100             printf(" %d", n_name);
9101             printf("\n");
9102         }
9103     }
9104     function_tests++;
9105 
9106     return(test_ret);
9107 }
9108 
9109 
9110 #define gen_nb_xmlCharEncodingHandlerPtr 1
gen_xmlCharEncodingHandlerPtr(int no ATTRIBUTE_UNUSED,int nr ATTRIBUTE_UNUSED)9111 static xmlCharEncodingHandlerPtr gen_xmlCharEncodingHandlerPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
9112     return(NULL);
9113 }
des_xmlCharEncodingHandlerPtr(int no ATTRIBUTE_UNUSED,xmlCharEncodingHandlerPtr val ATTRIBUTE_UNUSED,int nr ATTRIBUTE_UNUSED)9114 static void des_xmlCharEncodingHandlerPtr(int no ATTRIBUTE_UNUSED, xmlCharEncodingHandlerPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
9115 }
9116 
9117 static int
test_xmlRegisterCharEncodingHandler(void)9118 test_xmlRegisterCharEncodingHandler(void) {
9119     int test_ret = 0;
9120 
9121     int mem_base;
9122     xmlCharEncodingHandlerPtr handler; /* the xmlCharEncodingHandlerPtr handler block */
9123     int n_handler;
9124 
9125     for (n_handler = 0;n_handler < gen_nb_xmlCharEncodingHandlerPtr;n_handler++) {
9126         mem_base = xmlMemBlocks();
9127         handler = gen_xmlCharEncodingHandlerPtr(n_handler, 0);
9128 
9129         xmlRegisterCharEncodingHandler(handler);
9130         call_tests++;
9131         des_xmlCharEncodingHandlerPtr(n_handler, handler, 0);
9132         xmlResetLastError();
9133         if (mem_base != xmlMemBlocks()) {
9134             printf("Leak of %d blocks found in xmlRegisterCharEncodingHandler",
9135 	           xmlMemBlocks() - mem_base);
9136 	    test_ret++;
9137             printf(" %d", n_handler);
9138             printf("\n");
9139         }
9140     }
9141     function_tests++;
9142 
9143     return(test_ret);
9144 }
9145 
9146 static int
test_encoding(void)9147 test_encoding(void) {
9148     int test_ret = 0;
9149 
9150     if (quiet == 0) printf("Testing encoding : 16 of 19 functions ...\n");
9151     test_ret += test_UTF8Toisolat1();
9152     test_ret += test_isolat1ToUTF8();
9153     test_ret += test_xmlAddEncodingAlias();
9154     test_ret += test_xmlCharEncCloseFunc();
9155     test_ret += test_xmlCharEncFirstLine();
9156     test_ret += test_xmlCharEncInFunc();
9157     test_ret += test_xmlCharEncOutFunc();
9158     test_ret += test_xmlCleanupCharEncodingHandlers();
9159     test_ret += test_xmlCleanupEncodingAliases();
9160     test_ret += test_xmlDelEncodingAlias();
9161     test_ret += test_xmlDetectCharEncoding();
9162     test_ret += test_xmlFindCharEncodingHandler();
9163     test_ret += test_xmlGetCharEncodingHandler();
9164     test_ret += test_xmlGetCharEncodingName();
9165     test_ret += test_xmlGetEncodingAlias();
9166     test_ret += test_xmlInitCharEncodingHandlers();
9167     test_ret += test_xmlNewCharEncodingHandler();
9168     test_ret += test_xmlParseCharEncoding();
9169     test_ret += test_xmlRegisterCharEncodingHandler();
9170 
9171     if (test_ret != 0)
9172 	printf("Module encoding: %d errors\n", test_ret);
9173     return(test_ret);
9174 }
9175 
9176 static int
test_xmlAddDocEntity(void)9177 test_xmlAddDocEntity(void) {
9178     int test_ret = 0;
9179 
9180     int mem_base;
9181     xmlEntityPtr ret_val;
9182     xmlDocPtr doc; /* the document */
9183     int n_doc;
9184     xmlChar * name; /* the entity name */
9185     int n_name;
9186     int type; /* the entity type XML_xxx_yyy_ENTITY */
9187     int n_type;
9188     xmlChar * ExternalID; /* the entity external ID if available */
9189     int n_ExternalID;
9190     xmlChar * SystemID; /* the entity system ID if available */
9191     int n_SystemID;
9192     xmlChar * content; /* the entity content */
9193     int n_content;
9194 
9195     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
9196     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
9197     for (n_type = 0;n_type < gen_nb_int;n_type++) {
9198     for (n_ExternalID = 0;n_ExternalID < gen_nb_const_xmlChar_ptr;n_ExternalID++) {
9199     for (n_SystemID = 0;n_SystemID < gen_nb_const_xmlChar_ptr;n_SystemID++) {
9200     for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
9201         mem_base = xmlMemBlocks();
9202         doc = gen_xmlDocPtr(n_doc, 0);
9203         name = gen_const_xmlChar_ptr(n_name, 1);
9204         type = gen_int(n_type, 2);
9205         ExternalID = gen_const_xmlChar_ptr(n_ExternalID, 3);
9206         SystemID = gen_const_xmlChar_ptr(n_SystemID, 4);
9207         content = gen_const_xmlChar_ptr(n_content, 5);
9208 
9209         ret_val = xmlAddDocEntity(doc, (const xmlChar *)name, type, (const xmlChar *)ExternalID, (const xmlChar *)SystemID, (const xmlChar *)content);
9210         desret_xmlEntityPtr(ret_val);
9211         call_tests++;
9212         des_xmlDocPtr(n_doc, doc, 0);
9213         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
9214         des_int(n_type, type, 2);
9215         des_const_xmlChar_ptr(n_ExternalID, (const xmlChar *)ExternalID, 3);
9216         des_const_xmlChar_ptr(n_SystemID, (const xmlChar *)SystemID, 4);
9217         des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 5);
9218         xmlResetLastError();
9219         if (mem_base != xmlMemBlocks()) {
9220             printf("Leak of %d blocks found in xmlAddDocEntity",
9221 	           xmlMemBlocks() - mem_base);
9222 	    test_ret++;
9223             printf(" %d", n_doc);
9224             printf(" %d", n_name);
9225             printf(" %d", n_type);
9226             printf(" %d", n_ExternalID);
9227             printf(" %d", n_SystemID);
9228             printf(" %d", n_content);
9229             printf("\n");
9230         }
9231     }
9232     }
9233     }
9234     }
9235     }
9236     }
9237     function_tests++;
9238 
9239     return(test_ret);
9240 }
9241 
9242 
9243 static int
test_xmlAddDtdEntity(void)9244 test_xmlAddDtdEntity(void) {
9245     int test_ret = 0;
9246 
9247     int mem_base;
9248     xmlEntityPtr ret_val;
9249     xmlDocPtr doc; /* the document */
9250     int n_doc;
9251     xmlChar * name; /* the entity name */
9252     int n_name;
9253     int type; /* the entity type XML_xxx_yyy_ENTITY */
9254     int n_type;
9255     xmlChar * ExternalID; /* the entity external ID if available */
9256     int n_ExternalID;
9257     xmlChar * SystemID; /* the entity system ID if available */
9258     int n_SystemID;
9259     xmlChar * content; /* the entity content */
9260     int n_content;
9261 
9262     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
9263     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
9264     for (n_type = 0;n_type < gen_nb_int;n_type++) {
9265     for (n_ExternalID = 0;n_ExternalID < gen_nb_const_xmlChar_ptr;n_ExternalID++) {
9266     for (n_SystemID = 0;n_SystemID < gen_nb_const_xmlChar_ptr;n_SystemID++) {
9267     for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
9268         mem_base = xmlMemBlocks();
9269         doc = gen_xmlDocPtr(n_doc, 0);
9270         name = gen_const_xmlChar_ptr(n_name, 1);
9271         type = gen_int(n_type, 2);
9272         ExternalID = gen_const_xmlChar_ptr(n_ExternalID, 3);
9273         SystemID = gen_const_xmlChar_ptr(n_SystemID, 4);
9274         content = gen_const_xmlChar_ptr(n_content, 5);
9275 
9276         ret_val = xmlAddDtdEntity(doc, (const xmlChar *)name, type, (const xmlChar *)ExternalID, (const xmlChar *)SystemID, (const xmlChar *)content);
9277         desret_xmlEntityPtr(ret_val);
9278         call_tests++;
9279         des_xmlDocPtr(n_doc, doc, 0);
9280         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
9281         des_int(n_type, type, 2);
9282         des_const_xmlChar_ptr(n_ExternalID, (const xmlChar *)ExternalID, 3);
9283         des_const_xmlChar_ptr(n_SystemID, (const xmlChar *)SystemID, 4);
9284         des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 5);
9285         xmlResetLastError();
9286         if (mem_base != xmlMemBlocks()) {
9287             printf("Leak of %d blocks found in xmlAddDtdEntity",
9288 	           xmlMemBlocks() - mem_base);
9289 	    test_ret++;
9290             printf(" %d", n_doc);
9291             printf(" %d", n_name);
9292             printf(" %d", n_type);
9293             printf(" %d", n_ExternalID);
9294             printf(" %d", n_SystemID);
9295             printf(" %d", n_content);
9296             printf("\n");
9297         }
9298     }
9299     }
9300     }
9301     }
9302     }
9303     }
9304     function_tests++;
9305 
9306     return(test_ret);
9307 }
9308 
9309 
9310 static int
test_xmlCleanupPredefinedEntities(void)9311 test_xmlCleanupPredefinedEntities(void) {
9312     int test_ret = 0;
9313 
9314 #if defined(LIBXML_LEGACY_ENABLED)
9315 #ifdef LIBXML_LEGACY_ENABLED
9316     int mem_base;
9317 
9318         mem_base = xmlMemBlocks();
9319 
9320         xmlCleanupPredefinedEntities();
9321         call_tests++;
9322         xmlResetLastError();
9323         if (mem_base != xmlMemBlocks()) {
9324             printf("Leak of %d blocks found in xmlCleanupPredefinedEntities",
9325 	           xmlMemBlocks() - mem_base);
9326 	    test_ret++;
9327             printf("\n");
9328         }
9329     function_tests++;
9330 #endif
9331 #endif
9332 
9333     return(test_ret);
9334 }
9335 
9336 
9337 static int
test_xmlCopyEntitiesTable(void)9338 test_xmlCopyEntitiesTable(void) {
9339     int test_ret = 0;
9340 
9341 
9342     /* missing type support */
9343     return(test_ret);
9344 }
9345 
9346 
9347 static int
test_xmlCreateEntitiesTable(void)9348 test_xmlCreateEntitiesTable(void) {
9349     int test_ret = 0;
9350 
9351 
9352     /* missing type support */
9353     return(test_ret);
9354 }
9355 
9356 
9357 #define gen_nb_xmlEntitiesTablePtr 1
gen_xmlEntitiesTablePtr(int no ATTRIBUTE_UNUSED,int nr ATTRIBUTE_UNUSED)9358 static xmlEntitiesTablePtr gen_xmlEntitiesTablePtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
9359     return(NULL);
9360 }
des_xmlEntitiesTablePtr(int no ATTRIBUTE_UNUSED,xmlEntitiesTablePtr val ATTRIBUTE_UNUSED,int nr ATTRIBUTE_UNUSED)9361 static void des_xmlEntitiesTablePtr(int no ATTRIBUTE_UNUSED, xmlEntitiesTablePtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
9362 }
9363 
9364 static int
test_xmlDumpEntitiesTable(void)9365 test_xmlDumpEntitiesTable(void) {
9366     int test_ret = 0;
9367 
9368 #if defined(LIBXML_OUTPUT_ENABLED)
9369     int mem_base;
9370     xmlBufferPtr buf; /* An XML buffer. */
9371     int n_buf;
9372     xmlEntitiesTablePtr table; /* An entity table */
9373     int n_table;
9374 
9375     for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
9376     for (n_table = 0;n_table < gen_nb_xmlEntitiesTablePtr;n_table++) {
9377         mem_base = xmlMemBlocks();
9378         buf = gen_xmlBufferPtr(n_buf, 0);
9379         table = gen_xmlEntitiesTablePtr(n_table, 1);
9380 
9381         xmlDumpEntitiesTable(buf, table);
9382         call_tests++;
9383         des_xmlBufferPtr(n_buf, buf, 0);
9384         des_xmlEntitiesTablePtr(n_table, table, 1);
9385         xmlResetLastError();
9386         if (mem_base != xmlMemBlocks()) {
9387             printf("Leak of %d blocks found in xmlDumpEntitiesTable",
9388 	           xmlMemBlocks() - mem_base);
9389 	    test_ret++;
9390             printf(" %d", n_buf);
9391             printf(" %d", n_table);
9392             printf("\n");
9393         }
9394     }
9395     }
9396     function_tests++;
9397 #endif
9398 
9399     return(test_ret);
9400 }
9401 
9402 
9403 #define gen_nb_xmlEntityPtr 1
gen_xmlEntityPtr(int no ATTRIBUTE_UNUSED,int nr ATTRIBUTE_UNUSED)9404 static xmlEntityPtr gen_xmlEntityPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
9405     return(NULL);
9406 }
des_xmlEntityPtr(int no ATTRIBUTE_UNUSED,xmlEntityPtr val ATTRIBUTE_UNUSED,int nr ATTRIBUTE_UNUSED)9407 static void des_xmlEntityPtr(int no ATTRIBUTE_UNUSED, xmlEntityPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
9408 }
9409 
9410 static int
test_xmlDumpEntityDecl(void)9411 test_xmlDumpEntityDecl(void) {
9412     int test_ret = 0;
9413 
9414 #if defined(LIBXML_OUTPUT_ENABLED)
9415     int mem_base;
9416     xmlBufferPtr buf; /* An XML buffer. */
9417     int n_buf;
9418     xmlEntityPtr ent; /* An entity table */
9419     int n_ent;
9420 
9421     for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
9422     for (n_ent = 0;n_ent < gen_nb_xmlEntityPtr;n_ent++) {
9423         mem_base = xmlMemBlocks();
9424         buf = gen_xmlBufferPtr(n_buf, 0);
9425         ent = gen_xmlEntityPtr(n_ent, 1);
9426 
9427         xmlDumpEntityDecl(buf, ent);
9428         call_tests++;
9429         des_xmlBufferPtr(n_buf, buf, 0);
9430         des_xmlEntityPtr(n_ent, ent, 1);
9431         xmlResetLastError();
9432         if (mem_base != xmlMemBlocks()) {
9433             printf("Leak of %d blocks found in xmlDumpEntityDecl",
9434 	           xmlMemBlocks() - mem_base);
9435 	    test_ret++;
9436             printf(" %d", n_buf);
9437             printf(" %d", n_ent);
9438             printf("\n");
9439         }
9440     }
9441     }
9442     function_tests++;
9443 #endif
9444 
9445     return(test_ret);
9446 }
9447 
9448 
9449 static int
test_xmlEncodeEntitiesReentrant(void)9450 test_xmlEncodeEntitiesReentrant(void) {
9451     int test_ret = 0;
9452 
9453     int mem_base;
9454     xmlChar * ret_val;
9455     xmlDocPtr doc; /* the document containing the string */
9456     int n_doc;
9457     xmlChar * input; /* A string to convert to XML. */
9458     int n_input;
9459 
9460     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
9461     for (n_input = 0;n_input < gen_nb_const_xmlChar_ptr;n_input++) {
9462         mem_base = xmlMemBlocks();
9463         doc = gen_xmlDocPtr(n_doc, 0);
9464         input = gen_const_xmlChar_ptr(n_input, 1);
9465 
9466         ret_val = xmlEncodeEntitiesReentrant(doc, (const xmlChar *)input);
9467         desret_xmlChar_ptr(ret_val);
9468         call_tests++;
9469         des_xmlDocPtr(n_doc, doc, 0);
9470         des_const_xmlChar_ptr(n_input, (const xmlChar *)input, 1);
9471         xmlResetLastError();
9472         if (mem_base != xmlMemBlocks()) {
9473             printf("Leak of %d blocks found in xmlEncodeEntitiesReentrant",
9474 	           xmlMemBlocks() - mem_base);
9475 	    test_ret++;
9476             printf(" %d", n_doc);
9477             printf(" %d", n_input);
9478             printf("\n");
9479         }
9480     }
9481     }
9482     function_tests++;
9483 
9484     return(test_ret);
9485 }
9486 
9487 
9488 #define gen_nb_const_xmlDoc_ptr 1
gen_const_xmlDoc_ptr(int no ATTRIBUTE_UNUSED,int nr ATTRIBUTE_UNUSED)9489 static xmlDoc * gen_const_xmlDoc_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
9490     return(NULL);
9491 }
des_const_xmlDoc_ptr(int no ATTRIBUTE_UNUSED,const xmlDoc * val ATTRIBUTE_UNUSED,int nr ATTRIBUTE_UNUSED)9492 static void des_const_xmlDoc_ptr(int no ATTRIBUTE_UNUSED, const xmlDoc * val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
9493 }
9494 
9495 static int
test_xmlEncodeSpecialChars(void)9496 test_xmlEncodeSpecialChars(void) {
9497     int test_ret = 0;
9498 
9499     int mem_base;
9500     xmlChar * ret_val;
9501     xmlDoc * doc; /* the document containing the string */
9502     int n_doc;
9503     xmlChar * input; /* A string to convert to XML. */
9504     int n_input;
9505 
9506     for (n_doc = 0;n_doc < gen_nb_const_xmlDoc_ptr;n_doc++) {
9507     for (n_input = 0;n_input < gen_nb_const_xmlChar_ptr;n_input++) {
9508         mem_base = xmlMemBlocks();
9509         doc = gen_const_xmlDoc_ptr(n_doc, 0);
9510         input = gen_const_xmlChar_ptr(n_input, 1);
9511 
9512         ret_val = xmlEncodeSpecialChars((const xmlDoc *)doc, (const xmlChar *)input);
9513         desret_xmlChar_ptr(ret_val);
9514         call_tests++;
9515         des_const_xmlDoc_ptr(n_doc, (const xmlDoc *)doc, 0);
9516         des_const_xmlChar_ptr(n_input, (const xmlChar *)input, 1);
9517         xmlResetLastError();
9518         if (mem_base != xmlMemBlocks()) {
9519             printf("Leak of %d blocks found in xmlEncodeSpecialChars",
9520 	           xmlMemBlocks() - mem_base);
9521 	    test_ret++;
9522             printf(" %d", n_doc);
9523             printf(" %d", n_input);
9524             printf("\n");
9525         }
9526     }
9527     }
9528     function_tests++;
9529 
9530     return(test_ret);
9531 }
9532 
9533 
9534 static int
test_xmlGetDocEntity(void)9535 test_xmlGetDocEntity(void) {
9536     int test_ret = 0;
9537 
9538     int mem_base;
9539     xmlEntityPtr ret_val;
9540     xmlDoc * doc; /* the document referencing the entity */
9541     int n_doc;
9542     xmlChar * name; /* the entity name */
9543     int n_name;
9544 
9545     for (n_doc = 0;n_doc < gen_nb_const_xmlDoc_ptr;n_doc++) {
9546     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
9547         mem_base = xmlMemBlocks();
9548         doc = gen_const_xmlDoc_ptr(n_doc, 0);
9549         name = gen_const_xmlChar_ptr(n_name, 1);
9550 
9551         ret_val = xmlGetDocEntity((const xmlDoc *)doc, (const xmlChar *)name);
9552         desret_xmlEntityPtr(ret_val);
9553         call_tests++;
9554         des_const_xmlDoc_ptr(n_doc, (const xmlDoc *)doc, 0);
9555         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
9556         xmlResetLastError();
9557         if (mem_base != xmlMemBlocks()) {
9558             printf("Leak of %d blocks found in xmlGetDocEntity",
9559 	           xmlMemBlocks() - mem_base);
9560 	    test_ret++;
9561             printf(" %d", n_doc);
9562             printf(" %d", n_name);
9563             printf("\n");
9564         }
9565     }
9566     }
9567     function_tests++;
9568 
9569     return(test_ret);
9570 }
9571 
9572 
9573 static int
test_xmlGetDtdEntity(void)9574 test_xmlGetDtdEntity(void) {
9575     int test_ret = 0;
9576 
9577     int mem_base;
9578     xmlEntityPtr ret_val;
9579     xmlDocPtr doc; /* the document referencing the entity */
9580     int n_doc;
9581     xmlChar * name; /* the entity name */
9582     int n_name;
9583 
9584     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
9585     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
9586         mem_base = xmlMemBlocks();
9587         doc = gen_xmlDocPtr(n_doc, 0);
9588         name = gen_const_xmlChar_ptr(n_name, 1);
9589 
9590         ret_val = xmlGetDtdEntity(doc, (const xmlChar *)name);
9591         desret_xmlEntityPtr(ret_val);
9592         call_tests++;
9593         des_xmlDocPtr(n_doc, doc, 0);
9594         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
9595         xmlResetLastError();
9596         if (mem_base != xmlMemBlocks()) {
9597             printf("Leak of %d blocks found in xmlGetDtdEntity",
9598 	           xmlMemBlocks() - mem_base);
9599 	    test_ret++;
9600             printf(" %d", n_doc);
9601             printf(" %d", n_name);
9602             printf("\n");
9603         }
9604     }
9605     }
9606     function_tests++;
9607 
9608     return(test_ret);
9609 }
9610 
9611 
9612 static int
test_xmlGetParameterEntity(void)9613 test_xmlGetParameterEntity(void) {
9614     int test_ret = 0;
9615 
9616     int mem_base;
9617     xmlEntityPtr ret_val;
9618     xmlDocPtr doc; /* the document referencing the entity */
9619     int n_doc;
9620     xmlChar * name; /* the entity name */
9621     int n_name;
9622 
9623     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
9624     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
9625         mem_base = xmlMemBlocks();
9626         doc = gen_xmlDocPtr(n_doc, 0);
9627         name = gen_const_xmlChar_ptr(n_name, 1);
9628 
9629         ret_val = xmlGetParameterEntity(doc, (const xmlChar *)name);
9630         desret_xmlEntityPtr(ret_val);
9631         call_tests++;
9632         des_xmlDocPtr(n_doc, doc, 0);
9633         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
9634         xmlResetLastError();
9635         if (mem_base != xmlMemBlocks()) {
9636             printf("Leak of %d blocks found in xmlGetParameterEntity",
9637 	           xmlMemBlocks() - mem_base);
9638 	    test_ret++;
9639             printf(" %d", n_doc);
9640             printf(" %d", n_name);
9641             printf("\n");
9642         }
9643     }
9644     }
9645     function_tests++;
9646 
9647     return(test_ret);
9648 }
9649 
9650 
9651 static int
test_xmlGetPredefinedEntity(void)9652 test_xmlGetPredefinedEntity(void) {
9653     int test_ret = 0;
9654 
9655     int mem_base;
9656     xmlEntityPtr ret_val;
9657     xmlChar * name; /* the entity name */
9658     int n_name;
9659 
9660     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
9661         mem_base = xmlMemBlocks();
9662         name = gen_const_xmlChar_ptr(n_name, 0);
9663 
9664         ret_val = xmlGetPredefinedEntity((const xmlChar *)name);
9665         desret_xmlEntityPtr(ret_val);
9666         call_tests++;
9667         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 0);
9668         xmlResetLastError();
9669         if (mem_base != xmlMemBlocks()) {
9670             printf("Leak of %d blocks found in xmlGetPredefinedEntity",
9671 	           xmlMemBlocks() - mem_base);
9672 	    test_ret++;
9673             printf(" %d", n_name);
9674             printf("\n");
9675         }
9676     }
9677     function_tests++;
9678 
9679     return(test_ret);
9680 }
9681 
9682 
9683 static int
test_xmlInitializePredefinedEntities(void)9684 test_xmlInitializePredefinedEntities(void) {
9685     int test_ret = 0;
9686 
9687 #if defined(LIBXML_LEGACY_ENABLED)
9688 #ifdef LIBXML_LEGACY_ENABLED
9689     int mem_base;
9690 
9691         mem_base = xmlMemBlocks();
9692 
9693         xmlInitializePredefinedEntities();
9694         call_tests++;
9695         xmlResetLastError();
9696         if (mem_base != xmlMemBlocks()) {
9697             printf("Leak of %d blocks found in xmlInitializePredefinedEntities",
9698 	           xmlMemBlocks() - mem_base);
9699 	    test_ret++;
9700             printf("\n");
9701         }
9702     function_tests++;
9703 #endif
9704 #endif
9705 
9706     return(test_ret);
9707 }
9708 
9709 
9710 static int
test_xmlNewEntity(void)9711 test_xmlNewEntity(void) {
9712     int test_ret = 0;
9713 
9714     int mem_base;
9715     xmlEntityPtr ret_val;
9716     xmlDocPtr doc; /* the document */
9717     int n_doc;
9718     xmlChar * name; /* the entity name */
9719     int n_name;
9720     int type; /* the entity type XML_xxx_yyy_ENTITY */
9721     int n_type;
9722     xmlChar * ExternalID; /* the entity external ID if available */
9723     int n_ExternalID;
9724     xmlChar * SystemID; /* the entity system ID if available */
9725     int n_SystemID;
9726     xmlChar * content; /* the entity content */
9727     int n_content;
9728 
9729     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
9730     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
9731     for (n_type = 0;n_type < gen_nb_int;n_type++) {
9732     for (n_ExternalID = 0;n_ExternalID < gen_nb_const_xmlChar_ptr;n_ExternalID++) {
9733     for (n_SystemID = 0;n_SystemID < gen_nb_const_xmlChar_ptr;n_SystemID++) {
9734     for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
9735         mem_base = xmlMemBlocks();
9736         doc = gen_xmlDocPtr(n_doc, 0);
9737         name = gen_const_xmlChar_ptr(n_name, 1);
9738         type = gen_int(n_type, 2);
9739         ExternalID = gen_const_xmlChar_ptr(n_ExternalID, 3);
9740         SystemID = gen_const_xmlChar_ptr(n_SystemID, 4);
9741         content = gen_const_xmlChar_ptr(n_content, 5);
9742 
9743         ret_val = xmlNewEntity(doc, (const xmlChar *)name, type, (const xmlChar *)ExternalID, (const xmlChar *)SystemID, (const xmlChar *)content);
9744         desret_xmlEntityPtr(ret_val);
9745         call_tests++;
9746         des_xmlDocPtr(n_doc, doc, 0);
9747         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
9748         des_int(n_type, type, 2);
9749         des_const_xmlChar_ptr(n_ExternalID, (const xmlChar *)ExternalID, 3);
9750         des_const_xmlChar_ptr(n_SystemID, (const xmlChar *)SystemID, 4);
9751         des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 5);
9752         xmlResetLastError();
9753         if (mem_base != xmlMemBlocks()) {
9754             printf("Leak of %d blocks found in xmlNewEntity",
9755 	           xmlMemBlocks() - mem_base);
9756 	    test_ret++;
9757             printf(" %d", n_doc);
9758             printf(" %d", n_name);
9759             printf(" %d", n_type);
9760             printf(" %d", n_ExternalID);
9761             printf(" %d", n_SystemID);
9762             printf(" %d", n_content);
9763             printf("\n");
9764         }
9765     }
9766     }
9767     }
9768     }
9769     }
9770     }
9771     function_tests++;
9772 
9773     return(test_ret);
9774 }
9775 
9776 static int
test_entities(void)9777 test_entities(void) {
9778     int test_ret = 0;
9779 
9780     if (quiet == 0) printf("Testing entities : 13 of 17 functions ...\n");
9781     test_ret += test_xmlAddDocEntity();
9782     test_ret += test_xmlAddDtdEntity();
9783     test_ret += test_xmlCleanupPredefinedEntities();
9784     test_ret += test_xmlCopyEntitiesTable();
9785     test_ret += test_xmlCreateEntitiesTable();
9786     test_ret += test_xmlDumpEntitiesTable();
9787     test_ret += test_xmlDumpEntityDecl();
9788     test_ret += test_xmlEncodeEntitiesReentrant();
9789     test_ret += test_xmlEncodeSpecialChars();
9790     test_ret += test_xmlGetDocEntity();
9791     test_ret += test_xmlGetDtdEntity();
9792     test_ret += test_xmlGetParameterEntity();
9793     test_ret += test_xmlGetPredefinedEntity();
9794     test_ret += test_xmlInitializePredefinedEntities();
9795     test_ret += test_xmlNewEntity();
9796 
9797     if (test_ret != 0)
9798 	printf("Module entities: %d errors\n", test_ret);
9799     return(test_ret);
9800 }
9801 
9802 static int
test_xmlHashAddEntry(void)9803 test_xmlHashAddEntry(void) {
9804     int test_ret = 0;
9805 
9806     int mem_base;
9807     int ret_val;
9808     xmlHashTablePtr table; /* the hash table */
9809     int n_table;
9810     xmlChar * name; /* the name of the userdata */
9811     int n_name;
9812     void * userdata; /* a pointer to the userdata */
9813     int n_userdata;
9814 
9815     for (n_table = 0;n_table < gen_nb_xmlHashTablePtr;n_table++) {
9816     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
9817     for (n_userdata = 0;n_userdata < gen_nb_userdata;n_userdata++) {
9818         mem_base = xmlMemBlocks();
9819         table = gen_xmlHashTablePtr(n_table, 0);
9820         name = gen_const_xmlChar_ptr(n_name, 1);
9821         userdata = gen_userdata(n_userdata, 2);
9822 
9823         ret_val = xmlHashAddEntry(table, (const xmlChar *)name, userdata);
9824         desret_int(ret_val);
9825         call_tests++;
9826         des_xmlHashTablePtr(n_table, table, 0);
9827         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
9828         des_userdata(n_userdata, userdata, 2);
9829         xmlResetLastError();
9830         if (mem_base != xmlMemBlocks()) {
9831             printf("Leak of %d blocks found in xmlHashAddEntry",
9832 	           xmlMemBlocks() - mem_base);
9833 	    test_ret++;
9834             printf(" %d", n_table);
9835             printf(" %d", n_name);
9836             printf(" %d", n_userdata);
9837             printf("\n");
9838         }
9839     }
9840     }
9841     }
9842     function_tests++;
9843 
9844     return(test_ret);
9845 }
9846 
9847 
9848 static int
test_xmlHashAddEntry2(void)9849 test_xmlHashAddEntry2(void) {
9850     int test_ret = 0;
9851 
9852     int mem_base;
9853     int ret_val;
9854     xmlHashTablePtr table; /* the hash table */
9855     int n_table;
9856     xmlChar * name; /* the name of the userdata */
9857     int n_name;
9858     xmlChar * name2; /* a second name of the userdata */
9859     int n_name2;
9860     void * userdata; /* a pointer to the userdata */
9861     int n_userdata;
9862 
9863     for (n_table = 0;n_table < gen_nb_xmlHashTablePtr;n_table++) {
9864     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
9865     for (n_name2 = 0;n_name2 < gen_nb_const_xmlChar_ptr;n_name2++) {
9866     for (n_userdata = 0;n_userdata < gen_nb_userdata;n_userdata++) {
9867         mem_base = xmlMemBlocks();
9868         table = gen_xmlHashTablePtr(n_table, 0);
9869         name = gen_const_xmlChar_ptr(n_name, 1);
9870         name2 = gen_const_xmlChar_ptr(n_name2, 2);
9871         userdata = gen_userdata(n_userdata, 3);
9872 
9873         ret_val = xmlHashAddEntry2(table, (const xmlChar *)name, (const xmlChar *)name2, userdata);
9874         desret_int(ret_val);
9875         call_tests++;
9876         des_xmlHashTablePtr(n_table, table, 0);
9877         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
9878         des_const_xmlChar_ptr(n_name2, (const xmlChar *)name2, 2);
9879         des_userdata(n_userdata, userdata, 3);
9880         xmlResetLastError();
9881         if (mem_base != xmlMemBlocks()) {
9882             printf("Leak of %d blocks found in xmlHashAddEntry2",
9883 	           xmlMemBlocks() - mem_base);
9884 	    test_ret++;
9885             printf(" %d", n_table);
9886             printf(" %d", n_name);
9887             printf(" %d", n_name2);
9888             printf(" %d", n_userdata);
9889             printf("\n");
9890         }
9891     }
9892     }
9893     }
9894     }
9895     function_tests++;
9896 
9897     return(test_ret);
9898 }
9899 
9900 
9901 static int
test_xmlHashAddEntry3(void)9902 test_xmlHashAddEntry3(void) {
9903     int test_ret = 0;
9904 
9905     int mem_base;
9906     int ret_val;
9907     xmlHashTablePtr table; /* the hash table */
9908     int n_table;
9909     xmlChar * name; /* the name of the userdata */
9910     int n_name;
9911     xmlChar * name2; /* a second name of the userdata */
9912     int n_name2;
9913     xmlChar * name3; /* a third name of the userdata */
9914     int n_name3;
9915     void * userdata; /* a pointer to the userdata */
9916     int n_userdata;
9917 
9918     for (n_table = 0;n_table < gen_nb_xmlHashTablePtr;n_table++) {
9919     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
9920     for (n_name2 = 0;n_name2 < gen_nb_const_xmlChar_ptr;n_name2++) {
9921     for (n_name3 = 0;n_name3 < gen_nb_const_xmlChar_ptr;n_name3++) {
9922     for (n_userdata = 0;n_userdata < gen_nb_userdata;n_userdata++) {
9923         mem_base = xmlMemBlocks();
9924         table = gen_xmlHashTablePtr(n_table, 0);
9925         name = gen_const_xmlChar_ptr(n_name, 1);
9926         name2 = gen_const_xmlChar_ptr(n_name2, 2);
9927         name3 = gen_const_xmlChar_ptr(n_name3, 3);
9928         userdata = gen_userdata(n_userdata, 4);
9929 
9930         ret_val = xmlHashAddEntry3(table, (const xmlChar *)name, (const xmlChar *)name2, (const xmlChar *)name3, userdata);
9931         desret_int(ret_val);
9932         call_tests++;
9933         des_xmlHashTablePtr(n_table, table, 0);
9934         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
9935         des_const_xmlChar_ptr(n_name2, (const xmlChar *)name2, 2);
9936         des_const_xmlChar_ptr(n_name3, (const xmlChar *)name3, 3);
9937         des_userdata(n_userdata, userdata, 4);
9938         xmlResetLastError();
9939         if (mem_base != xmlMemBlocks()) {
9940             printf("Leak of %d blocks found in xmlHashAddEntry3",
9941 	           xmlMemBlocks() - mem_base);
9942 	    test_ret++;
9943             printf(" %d", n_table);
9944             printf(" %d", n_name);
9945             printf(" %d", n_name2);
9946             printf(" %d", n_name3);
9947             printf(" %d", n_userdata);
9948             printf("\n");
9949         }
9950     }
9951     }
9952     }
9953     }
9954     }
9955     function_tests++;
9956 
9957     return(test_ret);
9958 }
9959 
9960 
9961 static int
test_xmlHashCopy(void)9962 test_xmlHashCopy(void) {
9963     int test_ret = 0;
9964 
9965 
9966     /* missing type support */
9967     return(test_ret);
9968 }
9969 
9970 
9971 static int
test_xmlHashCreate(void)9972 test_xmlHashCreate(void) {
9973     int test_ret = 0;
9974 
9975 
9976     /* missing type support */
9977     return(test_ret);
9978 }
9979 
9980 
9981 static int
test_xmlHashCreateDict(void)9982 test_xmlHashCreateDict(void) {
9983     int test_ret = 0;
9984 
9985 
9986     /* missing type support */
9987     return(test_ret);
9988 }
9989 
9990 
9991 static int
test_xmlHashDefaultDeallocator(void)9992 test_xmlHashDefaultDeallocator(void) {
9993     int test_ret = 0;
9994 
9995     int mem_base;
9996     void * entry; /* the hash table entry */
9997     int n_entry;
9998     xmlChar * name; /* the entry's name */
9999     int n_name;
10000 
10001     for (n_entry = 0;n_entry < gen_nb_void_ptr;n_entry++) {
10002     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
10003         mem_base = xmlMemBlocks();
10004         entry = gen_void_ptr(n_entry, 0);
10005         name = gen_const_xmlChar_ptr(n_name, 1);
10006 
10007         xmlHashDefaultDeallocator(entry, (const xmlChar *)name);
10008         call_tests++;
10009         des_void_ptr(n_entry, entry, 0);
10010         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
10011         xmlResetLastError();
10012         if (mem_base != xmlMemBlocks()) {
10013             printf("Leak of %d blocks found in xmlHashDefaultDeallocator",
10014 	           xmlMemBlocks() - mem_base);
10015 	    test_ret++;
10016             printf(" %d", n_entry);
10017             printf(" %d", n_name);
10018             printf("\n");
10019         }
10020     }
10021     }
10022     function_tests++;
10023 
10024     return(test_ret);
10025 }
10026 
10027 
10028 static int
test_xmlHashLookup(void)10029 test_xmlHashLookup(void) {
10030     int test_ret = 0;
10031 
10032     int mem_base;
10033     void * ret_val;
10034     xmlHashTablePtr table; /* the hash table */
10035     int n_table;
10036     xmlChar * name; /* the name of the userdata */
10037     int n_name;
10038 
10039     for (n_table = 0;n_table < gen_nb_xmlHashTablePtr;n_table++) {
10040     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
10041         mem_base = xmlMemBlocks();
10042         table = gen_xmlHashTablePtr(n_table, 0);
10043         name = gen_const_xmlChar_ptr(n_name, 1);
10044 
10045         ret_val = xmlHashLookup(table, (const xmlChar *)name);
10046         desret_void_ptr(ret_val);
10047         call_tests++;
10048         des_xmlHashTablePtr(n_table, table, 0);
10049         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
10050         xmlResetLastError();
10051         if (mem_base != xmlMemBlocks()) {
10052             printf("Leak of %d blocks found in xmlHashLookup",
10053 	           xmlMemBlocks() - mem_base);
10054 	    test_ret++;
10055             printf(" %d", n_table);
10056             printf(" %d", n_name);
10057             printf("\n");
10058         }
10059     }
10060     }
10061     function_tests++;
10062 
10063     return(test_ret);
10064 }
10065 
10066 
10067 static int
test_xmlHashLookup2(void)10068 test_xmlHashLookup2(void) {
10069     int test_ret = 0;
10070 
10071     int mem_base;
10072     void * ret_val;
10073     xmlHashTablePtr table; /* the hash table */
10074     int n_table;
10075     xmlChar * name; /* the name of the userdata */
10076     int n_name;
10077     xmlChar * name2; /* a second name of the userdata */
10078     int n_name2;
10079 
10080     for (n_table = 0;n_table < gen_nb_xmlHashTablePtr;n_table++) {
10081     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
10082     for (n_name2 = 0;n_name2 < gen_nb_const_xmlChar_ptr;n_name2++) {
10083         mem_base = xmlMemBlocks();
10084         table = gen_xmlHashTablePtr(n_table, 0);
10085         name = gen_const_xmlChar_ptr(n_name, 1);
10086         name2 = gen_const_xmlChar_ptr(n_name2, 2);
10087 
10088         ret_val = xmlHashLookup2(table, (const xmlChar *)name, (const xmlChar *)name2);
10089         desret_void_ptr(ret_val);
10090         call_tests++;
10091         des_xmlHashTablePtr(n_table, table, 0);
10092         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
10093         des_const_xmlChar_ptr(n_name2, (const xmlChar *)name2, 2);
10094         xmlResetLastError();
10095         if (mem_base != xmlMemBlocks()) {
10096             printf("Leak of %d blocks found in xmlHashLookup2",
10097 	           xmlMemBlocks() - mem_base);
10098 	    test_ret++;
10099             printf(" %d", n_table);
10100             printf(" %d", n_name);
10101             printf(" %d", n_name2);
10102             printf("\n");
10103         }
10104     }
10105     }
10106     }
10107     function_tests++;
10108 
10109     return(test_ret);
10110 }
10111 
10112 
10113 static int
test_xmlHashLookup3(void)10114 test_xmlHashLookup3(void) {
10115     int test_ret = 0;
10116 
10117     int mem_base;
10118     void * ret_val;
10119     xmlHashTablePtr table; /* the hash table */
10120     int n_table;
10121     xmlChar * name; /* the name of the userdata */
10122     int n_name;
10123     xmlChar * name2; /* a second name of the userdata */
10124     int n_name2;
10125     xmlChar * name3; /* a third name of the userdata */
10126     int n_name3;
10127 
10128     for (n_table = 0;n_table < gen_nb_xmlHashTablePtr;n_table++) {
10129     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
10130     for (n_name2 = 0;n_name2 < gen_nb_const_xmlChar_ptr;n_name2++) {
10131     for (n_name3 = 0;n_name3 < gen_nb_const_xmlChar_ptr;n_name3++) {
10132         mem_base = xmlMemBlocks();
10133         table = gen_xmlHashTablePtr(n_table, 0);
10134         name = gen_const_xmlChar_ptr(n_name, 1);
10135         name2 = gen_const_xmlChar_ptr(n_name2, 2);
10136         name3 = gen_const_xmlChar_ptr(n_name3, 3);
10137 
10138         ret_val = xmlHashLookup3(table, (const xmlChar *)name, (const xmlChar *)name2, (const xmlChar *)name3);
10139         desret_void_ptr(ret_val);
10140         call_tests++;
10141         des_xmlHashTablePtr(n_table, table, 0);
10142         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
10143         des_const_xmlChar_ptr(n_name2, (const xmlChar *)name2, 2);
10144         des_const_xmlChar_ptr(n_name3, (const xmlChar *)name3, 3);
10145         xmlResetLastError();
10146         if (mem_base != xmlMemBlocks()) {
10147             printf("Leak of %d blocks found in xmlHashLookup3",
10148 	           xmlMemBlocks() - mem_base);
10149 	    test_ret++;
10150             printf(" %d", n_table);
10151             printf(" %d", n_name);
10152             printf(" %d", n_name2);
10153             printf(" %d", n_name3);
10154             printf("\n");
10155         }
10156     }
10157     }
10158     }
10159     }
10160     function_tests++;
10161 
10162     return(test_ret);
10163 }
10164 
10165 
10166 static int
test_xmlHashQLookup(void)10167 test_xmlHashQLookup(void) {
10168     int test_ret = 0;
10169 
10170     int mem_base;
10171     void * ret_val;
10172     xmlHashTablePtr table; /* the hash table */
10173     int n_table;
10174     xmlChar * prefix; /* the prefix of the userdata */
10175     int n_prefix;
10176     xmlChar * name; /* the name of the userdata */
10177     int n_name;
10178 
10179     for (n_table = 0;n_table < gen_nb_xmlHashTablePtr;n_table++) {
10180     for (n_prefix = 0;n_prefix < gen_nb_const_xmlChar_ptr;n_prefix++) {
10181     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
10182         mem_base = xmlMemBlocks();
10183         table = gen_xmlHashTablePtr(n_table, 0);
10184         prefix = gen_const_xmlChar_ptr(n_prefix, 1);
10185         name = gen_const_xmlChar_ptr(n_name, 2);
10186 
10187         ret_val = xmlHashQLookup(table, (const xmlChar *)prefix, (const xmlChar *)name);
10188         desret_void_ptr(ret_val);
10189         call_tests++;
10190         des_xmlHashTablePtr(n_table, table, 0);
10191         des_const_xmlChar_ptr(n_prefix, (const xmlChar *)prefix, 1);
10192         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 2);
10193         xmlResetLastError();
10194         if (mem_base != xmlMemBlocks()) {
10195             printf("Leak of %d blocks found in xmlHashQLookup",
10196 	           xmlMemBlocks() - mem_base);
10197 	    test_ret++;
10198             printf(" %d", n_table);
10199             printf(" %d", n_prefix);
10200             printf(" %d", n_name);
10201             printf("\n");
10202         }
10203     }
10204     }
10205     }
10206     function_tests++;
10207 
10208     return(test_ret);
10209 }
10210 
10211 
10212 static int
test_xmlHashQLookup2(void)10213 test_xmlHashQLookup2(void) {
10214     int test_ret = 0;
10215 
10216     int mem_base;
10217     void * ret_val;
10218     xmlHashTablePtr table; /* the hash table */
10219     int n_table;
10220     xmlChar * prefix; /* the prefix of the userdata */
10221     int n_prefix;
10222     xmlChar * name; /* the name of the userdata */
10223     int n_name;
10224     xmlChar * prefix2; /* the second prefix of the userdata */
10225     int n_prefix2;
10226     xmlChar * name2; /* a second name of the userdata */
10227     int n_name2;
10228 
10229     for (n_table = 0;n_table < gen_nb_xmlHashTablePtr;n_table++) {
10230     for (n_prefix = 0;n_prefix < gen_nb_const_xmlChar_ptr;n_prefix++) {
10231     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
10232     for (n_prefix2 = 0;n_prefix2 < gen_nb_const_xmlChar_ptr;n_prefix2++) {
10233     for (n_name2 = 0;n_name2 < gen_nb_const_xmlChar_ptr;n_name2++) {
10234         mem_base = xmlMemBlocks();
10235         table = gen_xmlHashTablePtr(n_table, 0);
10236         prefix = gen_const_xmlChar_ptr(n_prefix, 1);
10237         name = gen_const_xmlChar_ptr(n_name, 2);
10238         prefix2 = gen_const_xmlChar_ptr(n_prefix2, 3);
10239         name2 = gen_const_xmlChar_ptr(n_name2, 4);
10240 
10241         ret_val = xmlHashQLookup2(table, (const xmlChar *)prefix, (const xmlChar *)name, (const xmlChar *)prefix2, (const xmlChar *)name2);
10242         desret_void_ptr(ret_val);
10243         call_tests++;
10244         des_xmlHashTablePtr(n_table, table, 0);
10245         des_const_xmlChar_ptr(n_prefix, (const xmlChar *)prefix, 1);
10246         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 2);
10247         des_const_xmlChar_ptr(n_prefix2, (const xmlChar *)prefix2, 3);
10248         des_const_xmlChar_ptr(n_name2, (const xmlChar *)name2, 4);
10249         xmlResetLastError();
10250         if (mem_base != xmlMemBlocks()) {
10251             printf("Leak of %d blocks found in xmlHashQLookup2",
10252 	           xmlMemBlocks() - mem_base);
10253 	    test_ret++;
10254             printf(" %d", n_table);
10255             printf(" %d", n_prefix);
10256             printf(" %d", n_name);
10257             printf(" %d", n_prefix2);
10258             printf(" %d", n_name2);
10259             printf("\n");
10260         }
10261     }
10262     }
10263     }
10264     }
10265     }
10266     function_tests++;
10267 
10268     return(test_ret);
10269 }
10270 
10271 
10272 static int
test_xmlHashQLookup3(void)10273 test_xmlHashQLookup3(void) {
10274     int test_ret = 0;
10275 
10276     int mem_base;
10277     void * ret_val;
10278     xmlHashTablePtr table; /* the hash table */
10279     int n_table;
10280     xmlChar * prefix; /* the prefix of the userdata */
10281     int n_prefix;
10282     xmlChar * name; /* the name of the userdata */
10283     int n_name;
10284     xmlChar * prefix2; /* the second prefix of the userdata */
10285     int n_prefix2;
10286     xmlChar * name2; /* a second name of the userdata */
10287     int n_name2;
10288     xmlChar * prefix3; /* the third prefix of the userdata */
10289     int n_prefix3;
10290     xmlChar * name3; /* a third name of the userdata */
10291     int n_name3;
10292 
10293     for (n_table = 0;n_table < gen_nb_xmlHashTablePtr;n_table++) {
10294     for (n_prefix = 0;n_prefix < gen_nb_const_xmlChar_ptr;n_prefix++) {
10295     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
10296     for (n_prefix2 = 0;n_prefix2 < gen_nb_const_xmlChar_ptr;n_prefix2++) {
10297     for (n_name2 = 0;n_name2 < gen_nb_const_xmlChar_ptr;n_name2++) {
10298     for (n_prefix3 = 0;n_prefix3 < gen_nb_const_xmlChar_ptr;n_prefix3++) {
10299     for (n_name3 = 0;n_name3 < gen_nb_const_xmlChar_ptr;n_name3++) {
10300         mem_base = xmlMemBlocks();
10301         table = gen_xmlHashTablePtr(n_table, 0);
10302         prefix = gen_const_xmlChar_ptr(n_prefix, 1);
10303         name = gen_const_xmlChar_ptr(n_name, 2);
10304         prefix2 = gen_const_xmlChar_ptr(n_prefix2, 3);
10305         name2 = gen_const_xmlChar_ptr(n_name2, 4);
10306         prefix3 = gen_const_xmlChar_ptr(n_prefix3, 5);
10307         name3 = gen_const_xmlChar_ptr(n_name3, 6);
10308 
10309         ret_val = xmlHashQLookup3(table, (const xmlChar *)prefix, (const xmlChar *)name, (const xmlChar *)prefix2, (const xmlChar *)name2, (const xmlChar *)prefix3, (const xmlChar *)name3);
10310         desret_void_ptr(ret_val);
10311         call_tests++;
10312         des_xmlHashTablePtr(n_table, table, 0);
10313         des_const_xmlChar_ptr(n_prefix, (const xmlChar *)prefix, 1);
10314         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 2);
10315         des_const_xmlChar_ptr(n_prefix2, (const xmlChar *)prefix2, 3);
10316         des_const_xmlChar_ptr(n_name2, (const xmlChar *)name2, 4);
10317         des_const_xmlChar_ptr(n_prefix3, (const xmlChar *)prefix3, 5);
10318         des_const_xmlChar_ptr(n_name3, (const xmlChar *)name3, 6);
10319         xmlResetLastError();
10320         if (mem_base != xmlMemBlocks()) {
10321             printf("Leak of %d blocks found in xmlHashQLookup3",
10322 	           xmlMemBlocks() - mem_base);
10323 	    test_ret++;
10324             printf(" %d", n_table);
10325             printf(" %d", n_prefix);
10326             printf(" %d", n_name);
10327             printf(" %d", n_prefix2);
10328             printf(" %d", n_name2);
10329             printf(" %d", n_prefix3);
10330             printf(" %d", n_name3);
10331             printf("\n");
10332         }
10333     }
10334     }
10335     }
10336     }
10337     }
10338     }
10339     }
10340     function_tests++;
10341 
10342     return(test_ret);
10343 }
10344 
10345 
10346 static int
test_xmlHashRemoveEntry(void)10347 test_xmlHashRemoveEntry(void) {
10348     int test_ret = 0;
10349 
10350     int mem_base;
10351     int ret_val;
10352     xmlHashTablePtr table; /* the hash table */
10353     int n_table;
10354     xmlChar * name; /* the name of the userdata */
10355     int n_name;
10356     xmlHashDeallocator f; /* the deallocator function for removed item (if any) */
10357     int n_f;
10358 
10359     for (n_table = 0;n_table < gen_nb_xmlHashTablePtr;n_table++) {
10360     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
10361     for (n_f = 0;n_f < gen_nb_xmlHashDeallocator;n_f++) {
10362         mem_base = xmlMemBlocks();
10363         table = gen_xmlHashTablePtr(n_table, 0);
10364         name = gen_const_xmlChar_ptr(n_name, 1);
10365         f = gen_xmlHashDeallocator(n_f, 2);
10366 
10367         ret_val = xmlHashRemoveEntry(table, (const xmlChar *)name, f);
10368         desret_int(ret_val);
10369         call_tests++;
10370         des_xmlHashTablePtr(n_table, table, 0);
10371         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
10372         des_xmlHashDeallocator(n_f, f, 2);
10373         xmlResetLastError();
10374         if (mem_base != xmlMemBlocks()) {
10375             printf("Leak of %d blocks found in xmlHashRemoveEntry",
10376 	           xmlMemBlocks() - mem_base);
10377 	    test_ret++;
10378             printf(" %d", n_table);
10379             printf(" %d", n_name);
10380             printf(" %d", n_f);
10381             printf("\n");
10382         }
10383     }
10384     }
10385     }
10386     function_tests++;
10387 
10388     return(test_ret);
10389 }
10390 
10391 
10392 static int
test_xmlHashRemoveEntry2(void)10393 test_xmlHashRemoveEntry2(void) {
10394     int test_ret = 0;
10395 
10396     int mem_base;
10397     int ret_val;
10398     xmlHashTablePtr table; /* the hash table */
10399     int n_table;
10400     xmlChar * name; /* the name of the userdata */
10401     int n_name;
10402     xmlChar * name2; /* a second name of the userdata */
10403     int n_name2;
10404     xmlHashDeallocator f; /* the deallocator function for removed item (if any) */
10405     int n_f;
10406 
10407     for (n_table = 0;n_table < gen_nb_xmlHashTablePtr;n_table++) {
10408     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
10409     for (n_name2 = 0;n_name2 < gen_nb_const_xmlChar_ptr;n_name2++) {
10410     for (n_f = 0;n_f < gen_nb_xmlHashDeallocator;n_f++) {
10411         mem_base = xmlMemBlocks();
10412         table = gen_xmlHashTablePtr(n_table, 0);
10413         name = gen_const_xmlChar_ptr(n_name, 1);
10414         name2 = gen_const_xmlChar_ptr(n_name2, 2);
10415         f = gen_xmlHashDeallocator(n_f, 3);
10416 
10417         ret_val = xmlHashRemoveEntry2(table, (const xmlChar *)name, (const xmlChar *)name2, f);
10418         desret_int(ret_val);
10419         call_tests++;
10420         des_xmlHashTablePtr(n_table, table, 0);
10421         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
10422         des_const_xmlChar_ptr(n_name2, (const xmlChar *)name2, 2);
10423         des_xmlHashDeallocator(n_f, f, 3);
10424         xmlResetLastError();
10425         if (mem_base != xmlMemBlocks()) {
10426             printf("Leak of %d blocks found in xmlHashRemoveEntry2",
10427 	           xmlMemBlocks() - mem_base);
10428 	    test_ret++;
10429             printf(" %d", n_table);
10430             printf(" %d", n_name);
10431             printf(" %d", n_name2);
10432             printf(" %d", n_f);
10433             printf("\n");
10434         }
10435     }
10436     }
10437     }
10438     }
10439     function_tests++;
10440 
10441     return(test_ret);
10442 }
10443 
10444 
10445 static int
test_xmlHashRemoveEntry3(void)10446 test_xmlHashRemoveEntry3(void) {
10447     int test_ret = 0;
10448 
10449     int mem_base;
10450     int ret_val;
10451     xmlHashTablePtr table; /* the hash table */
10452     int n_table;
10453     xmlChar * name; /* the name of the userdata */
10454     int n_name;
10455     xmlChar * name2; /* a second name of the userdata */
10456     int n_name2;
10457     xmlChar * name3; /* a third name of the userdata */
10458     int n_name3;
10459     xmlHashDeallocator f; /* the deallocator function for removed item (if any) */
10460     int n_f;
10461 
10462     for (n_table = 0;n_table < gen_nb_xmlHashTablePtr;n_table++) {
10463     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
10464     for (n_name2 = 0;n_name2 < gen_nb_const_xmlChar_ptr;n_name2++) {
10465     for (n_name3 = 0;n_name3 < gen_nb_const_xmlChar_ptr;n_name3++) {
10466     for (n_f = 0;n_f < gen_nb_xmlHashDeallocator;n_f++) {
10467         mem_base = xmlMemBlocks();
10468         table = gen_xmlHashTablePtr(n_table, 0);
10469         name = gen_const_xmlChar_ptr(n_name, 1);
10470         name2 = gen_const_xmlChar_ptr(n_name2, 2);
10471         name3 = gen_const_xmlChar_ptr(n_name3, 3);
10472         f = gen_xmlHashDeallocator(n_f, 4);
10473 
10474         ret_val = xmlHashRemoveEntry3(table, (const xmlChar *)name, (const xmlChar *)name2, (const xmlChar *)name3, f);
10475         desret_int(ret_val);
10476         call_tests++;
10477         des_xmlHashTablePtr(n_table, table, 0);
10478         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
10479         des_const_xmlChar_ptr(n_name2, (const xmlChar *)name2, 2);
10480         des_const_xmlChar_ptr(n_name3, (const xmlChar *)name3, 3);
10481         des_xmlHashDeallocator(n_f, f, 4);
10482         xmlResetLastError();
10483         if (mem_base != xmlMemBlocks()) {
10484             printf("Leak of %d blocks found in xmlHashRemoveEntry3",
10485 	           xmlMemBlocks() - mem_base);
10486 	    test_ret++;
10487             printf(" %d", n_table);
10488             printf(" %d", n_name);
10489             printf(" %d", n_name2);
10490             printf(" %d", n_name3);
10491             printf(" %d", n_f);
10492             printf("\n");
10493         }
10494     }
10495     }
10496     }
10497     }
10498     }
10499     function_tests++;
10500 
10501     return(test_ret);
10502 }
10503 
10504 
10505 static int
test_xmlHashScan(void)10506 test_xmlHashScan(void) {
10507     int test_ret = 0;
10508 
10509 
10510     /* missing type support */
10511     return(test_ret);
10512 }
10513 
10514 
10515 static int
test_xmlHashScan3(void)10516 test_xmlHashScan3(void) {
10517     int test_ret = 0;
10518 
10519 
10520     /* missing type support */
10521     return(test_ret);
10522 }
10523 
10524 
10525 static int
test_xmlHashScanFull(void)10526 test_xmlHashScanFull(void) {
10527     int test_ret = 0;
10528 
10529 
10530     /* missing type support */
10531     return(test_ret);
10532 }
10533 
10534 
10535 static int
test_xmlHashScanFull3(void)10536 test_xmlHashScanFull3(void) {
10537     int test_ret = 0;
10538 
10539 
10540     /* missing type support */
10541     return(test_ret);
10542 }
10543 
10544 
10545 static int
test_xmlHashSize(void)10546 test_xmlHashSize(void) {
10547     int test_ret = 0;
10548 
10549     int mem_base;
10550     int ret_val;
10551     xmlHashTablePtr table; /* the hash table */
10552     int n_table;
10553 
10554     for (n_table = 0;n_table < gen_nb_xmlHashTablePtr;n_table++) {
10555         mem_base = xmlMemBlocks();
10556         table = gen_xmlHashTablePtr(n_table, 0);
10557 
10558         ret_val = xmlHashSize(table);
10559         desret_int(ret_val);
10560         call_tests++;
10561         des_xmlHashTablePtr(n_table, table, 0);
10562         xmlResetLastError();
10563         if (mem_base != xmlMemBlocks()) {
10564             printf("Leak of %d blocks found in xmlHashSize",
10565 	           xmlMemBlocks() - mem_base);
10566 	    test_ret++;
10567             printf(" %d", n_table);
10568             printf("\n");
10569         }
10570     }
10571     function_tests++;
10572 
10573     return(test_ret);
10574 }
10575 
10576 
10577 static int
test_xmlHashUpdateEntry(void)10578 test_xmlHashUpdateEntry(void) {
10579     int test_ret = 0;
10580 
10581     int mem_base;
10582     int ret_val;
10583     xmlHashTablePtr table; /* the hash table */
10584     int n_table;
10585     xmlChar * name; /* the name of the userdata */
10586     int n_name;
10587     void * userdata; /* a pointer to the userdata */
10588     int n_userdata;
10589     xmlHashDeallocator f; /* the deallocator function for replaced item (if any) */
10590     int n_f;
10591 
10592     for (n_table = 0;n_table < gen_nb_xmlHashTablePtr;n_table++) {
10593     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
10594     for (n_userdata = 0;n_userdata < gen_nb_userdata;n_userdata++) {
10595     for (n_f = 0;n_f < gen_nb_xmlHashDeallocator;n_f++) {
10596         mem_base = xmlMemBlocks();
10597         table = gen_xmlHashTablePtr(n_table, 0);
10598         name = gen_const_xmlChar_ptr(n_name, 1);
10599         userdata = gen_userdata(n_userdata, 2);
10600         f = gen_xmlHashDeallocator(n_f, 3);
10601 
10602         ret_val = xmlHashUpdateEntry(table, (const xmlChar *)name, userdata, f);
10603         desret_int(ret_val);
10604         call_tests++;
10605         des_xmlHashTablePtr(n_table, table, 0);
10606         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
10607         des_userdata(n_userdata, userdata, 2);
10608         des_xmlHashDeallocator(n_f, f, 3);
10609         xmlResetLastError();
10610         if (mem_base != xmlMemBlocks()) {
10611             printf("Leak of %d blocks found in xmlHashUpdateEntry",
10612 	           xmlMemBlocks() - mem_base);
10613 	    test_ret++;
10614             printf(" %d", n_table);
10615             printf(" %d", n_name);
10616             printf(" %d", n_userdata);
10617             printf(" %d", n_f);
10618             printf("\n");
10619         }
10620     }
10621     }
10622     }
10623     }
10624     function_tests++;
10625 
10626     return(test_ret);
10627 }
10628 
10629 
10630 static int
test_xmlHashUpdateEntry2(void)10631 test_xmlHashUpdateEntry2(void) {
10632     int test_ret = 0;
10633 
10634     int mem_base;
10635     int ret_val;
10636     xmlHashTablePtr table; /* the hash table */
10637     int n_table;
10638     xmlChar * name; /* the name of the userdata */
10639     int n_name;
10640     xmlChar * name2; /* a second name of the userdata */
10641     int n_name2;
10642     void * userdata; /* a pointer to the userdata */
10643     int n_userdata;
10644     xmlHashDeallocator f; /* the deallocator function for replaced item (if any) */
10645     int n_f;
10646 
10647     for (n_table = 0;n_table < gen_nb_xmlHashTablePtr;n_table++) {
10648     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
10649     for (n_name2 = 0;n_name2 < gen_nb_const_xmlChar_ptr;n_name2++) {
10650     for (n_userdata = 0;n_userdata < gen_nb_userdata;n_userdata++) {
10651     for (n_f = 0;n_f < gen_nb_xmlHashDeallocator;n_f++) {
10652         mem_base = xmlMemBlocks();
10653         table = gen_xmlHashTablePtr(n_table, 0);
10654         name = gen_const_xmlChar_ptr(n_name, 1);
10655         name2 = gen_const_xmlChar_ptr(n_name2, 2);
10656         userdata = gen_userdata(n_userdata, 3);
10657         f = gen_xmlHashDeallocator(n_f, 4);
10658 
10659         ret_val = xmlHashUpdateEntry2(table, (const xmlChar *)name, (const xmlChar *)name2, userdata, f);
10660         desret_int(ret_val);
10661         call_tests++;
10662         des_xmlHashTablePtr(n_table, table, 0);
10663         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
10664         des_const_xmlChar_ptr(n_name2, (const xmlChar *)name2, 2);
10665         des_userdata(n_userdata, userdata, 3);
10666         des_xmlHashDeallocator(n_f, f, 4);
10667         xmlResetLastError();
10668         if (mem_base != xmlMemBlocks()) {
10669             printf("Leak of %d blocks found in xmlHashUpdateEntry2",
10670 	           xmlMemBlocks() - mem_base);
10671 	    test_ret++;
10672             printf(" %d", n_table);
10673             printf(" %d", n_name);
10674             printf(" %d", n_name2);
10675             printf(" %d", n_userdata);
10676             printf(" %d", n_f);
10677             printf("\n");
10678         }
10679     }
10680     }
10681     }
10682     }
10683     }
10684     function_tests++;
10685 
10686     return(test_ret);
10687 }
10688 
10689 
10690 static int
test_xmlHashUpdateEntry3(void)10691 test_xmlHashUpdateEntry3(void) {
10692     int test_ret = 0;
10693 
10694     int mem_base;
10695     int ret_val;
10696     xmlHashTablePtr table; /* the hash table */
10697     int n_table;
10698     xmlChar * name; /* the name of the userdata */
10699     int n_name;
10700     xmlChar * name2; /* a second name of the userdata */
10701     int n_name2;
10702     xmlChar * name3; /* a third name of the userdata */
10703     int n_name3;
10704     void * userdata; /* a pointer to the userdata */
10705     int n_userdata;
10706     xmlHashDeallocator f; /* the deallocator function for replaced item (if any) */
10707     int n_f;
10708 
10709     for (n_table = 0;n_table < gen_nb_xmlHashTablePtr;n_table++) {
10710     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
10711     for (n_name2 = 0;n_name2 < gen_nb_const_xmlChar_ptr;n_name2++) {
10712     for (n_name3 = 0;n_name3 < gen_nb_const_xmlChar_ptr;n_name3++) {
10713     for (n_userdata = 0;n_userdata < gen_nb_userdata;n_userdata++) {
10714     for (n_f = 0;n_f < gen_nb_xmlHashDeallocator;n_f++) {
10715         mem_base = xmlMemBlocks();
10716         table = gen_xmlHashTablePtr(n_table, 0);
10717         name = gen_const_xmlChar_ptr(n_name, 1);
10718         name2 = gen_const_xmlChar_ptr(n_name2, 2);
10719         name3 = gen_const_xmlChar_ptr(n_name3, 3);
10720         userdata = gen_userdata(n_userdata, 4);
10721         f = gen_xmlHashDeallocator(n_f, 5);
10722 
10723         ret_val = xmlHashUpdateEntry3(table, (const xmlChar *)name, (const xmlChar *)name2, (const xmlChar *)name3, userdata, f);
10724         desret_int(ret_val);
10725         call_tests++;
10726         des_xmlHashTablePtr(n_table, table, 0);
10727         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
10728         des_const_xmlChar_ptr(n_name2, (const xmlChar *)name2, 2);
10729         des_const_xmlChar_ptr(n_name3, (const xmlChar *)name3, 3);
10730         des_userdata(n_userdata, userdata, 4);
10731         des_xmlHashDeallocator(n_f, f, 5);
10732         xmlResetLastError();
10733         if (mem_base != xmlMemBlocks()) {
10734             printf("Leak of %d blocks found in xmlHashUpdateEntry3",
10735 	           xmlMemBlocks() - mem_base);
10736 	    test_ret++;
10737             printf(" %d", n_table);
10738             printf(" %d", n_name);
10739             printf(" %d", n_name2);
10740             printf(" %d", n_name3);
10741             printf(" %d", n_userdata);
10742             printf(" %d", n_f);
10743             printf("\n");
10744         }
10745     }
10746     }
10747     }
10748     }
10749     }
10750     }
10751     function_tests++;
10752 
10753     return(test_ret);
10754 }
10755 
10756 static int
test_hash(void)10757 test_hash(void) {
10758     int test_ret = 0;
10759 
10760     if (quiet == 0) printf("Testing hash : 17 of 25 functions ...\n");
10761     test_ret += test_xmlHashAddEntry();
10762     test_ret += test_xmlHashAddEntry2();
10763     test_ret += test_xmlHashAddEntry3();
10764     test_ret += test_xmlHashCopy();
10765     test_ret += test_xmlHashCreate();
10766     test_ret += test_xmlHashCreateDict();
10767     test_ret += test_xmlHashDefaultDeallocator();
10768     test_ret += test_xmlHashLookup();
10769     test_ret += test_xmlHashLookup2();
10770     test_ret += test_xmlHashLookup3();
10771     test_ret += test_xmlHashQLookup();
10772     test_ret += test_xmlHashQLookup2();
10773     test_ret += test_xmlHashQLookup3();
10774     test_ret += test_xmlHashRemoveEntry();
10775     test_ret += test_xmlHashRemoveEntry2();
10776     test_ret += test_xmlHashRemoveEntry3();
10777     test_ret += test_xmlHashScan();
10778     test_ret += test_xmlHashScan3();
10779     test_ret += test_xmlHashScanFull();
10780     test_ret += test_xmlHashScanFull3();
10781     test_ret += test_xmlHashSize();
10782     test_ret += test_xmlHashUpdateEntry();
10783     test_ret += test_xmlHashUpdateEntry2();
10784     test_ret += test_xmlHashUpdateEntry3();
10785 
10786     if (test_ret != 0)
10787 	printf("Module hash: %d errors\n", test_ret);
10788     return(test_ret);
10789 }
10790 
10791 #define gen_nb_xmlLinkPtr 1
gen_xmlLinkPtr(int no ATTRIBUTE_UNUSED,int nr ATTRIBUTE_UNUSED)10792 static xmlLinkPtr gen_xmlLinkPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
10793     return(NULL);
10794 }
des_xmlLinkPtr(int no ATTRIBUTE_UNUSED,xmlLinkPtr val ATTRIBUTE_UNUSED,int nr ATTRIBUTE_UNUSED)10795 static void des_xmlLinkPtr(int no ATTRIBUTE_UNUSED, xmlLinkPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
10796 }
10797 
10798 static int
test_xmlLinkGetData(void)10799 test_xmlLinkGetData(void) {
10800     int test_ret = 0;
10801 
10802     int mem_base;
10803     void * ret_val;
10804     xmlLinkPtr lk; /* a link */
10805     int n_lk;
10806 
10807     for (n_lk = 0;n_lk < gen_nb_xmlLinkPtr;n_lk++) {
10808         mem_base = xmlMemBlocks();
10809         lk = gen_xmlLinkPtr(n_lk, 0);
10810 
10811         ret_val = xmlLinkGetData(lk);
10812         desret_void_ptr(ret_val);
10813         call_tests++;
10814         des_xmlLinkPtr(n_lk, lk, 0);
10815         xmlResetLastError();
10816         if (mem_base != xmlMemBlocks()) {
10817             printf("Leak of %d blocks found in xmlLinkGetData",
10818 	           xmlMemBlocks() - mem_base);
10819 	    test_ret++;
10820             printf(" %d", n_lk);
10821             printf("\n");
10822         }
10823     }
10824     function_tests++;
10825 
10826     return(test_ret);
10827 }
10828 
10829 
10830 static int
test_xmlListAppend(void)10831 test_xmlListAppend(void) {
10832     int test_ret = 0;
10833 
10834     int mem_base;
10835     int ret_val;
10836     xmlListPtr l; /* a list */
10837     int n_l;
10838     void * data; /* the data */
10839     int n_data;
10840 
10841     for (n_l = 0;n_l < gen_nb_xmlListPtr;n_l++) {
10842     for (n_data = 0;n_data < gen_nb_userdata;n_data++) {
10843         mem_base = xmlMemBlocks();
10844         l = gen_xmlListPtr(n_l, 0);
10845         data = gen_userdata(n_data, 1);
10846 
10847         ret_val = xmlListAppend(l, data);
10848         desret_int(ret_val);
10849         call_tests++;
10850         des_xmlListPtr(n_l, l, 0);
10851         des_userdata(n_data, data, 1);
10852         xmlResetLastError();
10853         if (mem_base != xmlMemBlocks()) {
10854             printf("Leak of %d blocks found in xmlListAppend",
10855 	           xmlMemBlocks() - mem_base);
10856 	    test_ret++;
10857             printf(" %d", n_l);
10858             printf(" %d", n_data);
10859             printf("\n");
10860         }
10861     }
10862     }
10863     function_tests++;
10864 
10865     return(test_ret);
10866 }
10867 
10868 
10869 static int
test_xmlListClear(void)10870 test_xmlListClear(void) {
10871     int test_ret = 0;
10872 
10873     int mem_base;
10874     xmlListPtr l; /* a list */
10875     int n_l;
10876 
10877     for (n_l = 0;n_l < gen_nb_xmlListPtr;n_l++) {
10878         mem_base = xmlMemBlocks();
10879         l = gen_xmlListPtr(n_l, 0);
10880 
10881         xmlListClear(l);
10882         call_tests++;
10883         des_xmlListPtr(n_l, l, 0);
10884         xmlResetLastError();
10885         if (mem_base != xmlMemBlocks()) {
10886             printf("Leak of %d blocks found in xmlListClear",
10887 	           xmlMemBlocks() - mem_base);
10888 	    test_ret++;
10889             printf(" %d", n_l);
10890             printf("\n");
10891         }
10892     }
10893     function_tests++;
10894 
10895     return(test_ret);
10896 }
10897 
10898 
10899 #define gen_nb_const_xmlListPtr 1
gen_const_xmlListPtr(int no ATTRIBUTE_UNUSED,int nr ATTRIBUTE_UNUSED)10900 static xmlListPtr gen_const_xmlListPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
10901     return(NULL);
10902 }
des_const_xmlListPtr(int no ATTRIBUTE_UNUSED,const xmlListPtr val ATTRIBUTE_UNUSED,int nr ATTRIBUTE_UNUSED)10903 static void des_const_xmlListPtr(int no ATTRIBUTE_UNUSED, const xmlListPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
10904 }
10905 
10906 static int
test_xmlListCopy(void)10907 test_xmlListCopy(void) {
10908     int test_ret = 0;
10909 
10910     int mem_base;
10911     int ret_val;
10912     xmlListPtr cur; /* the new list */
10913     int n_cur;
10914     xmlListPtr old; /* the old list */
10915     int n_old;
10916 
10917     for (n_cur = 0;n_cur < gen_nb_xmlListPtr;n_cur++) {
10918     for (n_old = 0;n_old < gen_nb_const_xmlListPtr;n_old++) {
10919         mem_base = xmlMemBlocks();
10920         cur = gen_xmlListPtr(n_cur, 0);
10921         old = gen_const_xmlListPtr(n_old, 1);
10922 
10923         ret_val = xmlListCopy(cur, (const xmlListPtr)old);
10924         desret_int(ret_val);
10925         call_tests++;
10926         des_xmlListPtr(n_cur, cur, 0);
10927         des_const_xmlListPtr(n_old, (const xmlListPtr)old, 1);
10928         xmlResetLastError();
10929         if (mem_base != xmlMemBlocks()) {
10930             printf("Leak of %d blocks found in xmlListCopy",
10931 	           xmlMemBlocks() - mem_base);
10932 	    test_ret++;
10933             printf(" %d", n_cur);
10934             printf(" %d", n_old);
10935             printf("\n");
10936         }
10937     }
10938     }
10939     function_tests++;
10940 
10941     return(test_ret);
10942 }
10943 
10944 
10945 static int
test_xmlListCreate(void)10946 test_xmlListCreate(void) {
10947     int test_ret = 0;
10948 
10949 
10950     /* missing type support */
10951     return(test_ret);
10952 }
10953 
10954 
10955 static int
test_xmlListDup(void)10956 test_xmlListDup(void) {
10957     int test_ret = 0;
10958 
10959 
10960     /* missing type support */
10961     return(test_ret);
10962 }
10963 
10964 
10965 static int
test_xmlListEmpty(void)10966 test_xmlListEmpty(void) {
10967     int test_ret = 0;
10968 
10969     int mem_base;
10970     int ret_val;
10971     xmlListPtr l; /* a list */
10972     int n_l;
10973 
10974     for (n_l = 0;n_l < gen_nb_xmlListPtr;n_l++) {
10975         mem_base = xmlMemBlocks();
10976         l = gen_xmlListPtr(n_l, 0);
10977 
10978         ret_val = xmlListEmpty(l);
10979         desret_int(ret_val);
10980         call_tests++;
10981         des_xmlListPtr(n_l, l, 0);
10982         xmlResetLastError();
10983         if (mem_base != xmlMemBlocks()) {
10984             printf("Leak of %d blocks found in xmlListEmpty",
10985 	           xmlMemBlocks() - mem_base);
10986 	    test_ret++;
10987             printf(" %d", n_l);
10988             printf("\n");
10989         }
10990     }
10991     function_tests++;
10992 
10993     return(test_ret);
10994 }
10995 
10996 
10997 static int
test_xmlListEnd(void)10998 test_xmlListEnd(void) {
10999     int test_ret = 0;
11000 
11001 
11002     /* missing type support */
11003     return(test_ret);
11004 }
11005 
11006 
11007 static int
test_xmlListFront(void)11008 test_xmlListFront(void) {
11009     int test_ret = 0;
11010 
11011 
11012     /* missing type support */
11013     return(test_ret);
11014 }
11015 
11016 
11017 static int
test_xmlListInsert(void)11018 test_xmlListInsert(void) {
11019     int test_ret = 0;
11020 
11021     int mem_base;
11022     int ret_val;
11023     xmlListPtr l; /* a list */
11024     int n_l;
11025     void * data; /* the data */
11026     int n_data;
11027 
11028     for (n_l = 0;n_l < gen_nb_xmlListPtr;n_l++) {
11029     for (n_data = 0;n_data < gen_nb_userdata;n_data++) {
11030         mem_base = xmlMemBlocks();
11031         l = gen_xmlListPtr(n_l, 0);
11032         data = gen_userdata(n_data, 1);
11033 
11034         ret_val = xmlListInsert(l, data);
11035         desret_int(ret_val);
11036         call_tests++;
11037         des_xmlListPtr(n_l, l, 0);
11038         des_userdata(n_data, data, 1);
11039         xmlResetLastError();
11040         if (mem_base != xmlMemBlocks()) {
11041             printf("Leak of %d blocks found in xmlListInsert",
11042 	           xmlMemBlocks() - mem_base);
11043 	    test_ret++;
11044             printf(" %d", n_l);
11045             printf(" %d", n_data);
11046             printf("\n");
11047         }
11048     }
11049     }
11050     function_tests++;
11051 
11052     return(test_ret);
11053 }
11054 
11055 
11056 static int
test_xmlListMerge(void)11057 test_xmlListMerge(void) {
11058     int test_ret = 0;
11059 
11060     int mem_base;
11061     xmlListPtr l1; /* the original list */
11062     int n_l1;
11063     xmlListPtr l2; /* the new list */
11064     int n_l2;
11065 
11066     for (n_l1 = 0;n_l1 < gen_nb_xmlListPtr;n_l1++) {
11067     for (n_l2 = 0;n_l2 < gen_nb_xmlListPtr;n_l2++) {
11068         mem_base = xmlMemBlocks();
11069         l1 = gen_xmlListPtr(n_l1, 0);
11070         l2 = gen_xmlListPtr(n_l2, 1);
11071 
11072         xmlListMerge(l1, l2);
11073         call_tests++;
11074         des_xmlListPtr(n_l1, l1, 0);
11075         des_xmlListPtr(n_l2, l2, 1);
11076         xmlResetLastError();
11077         if (mem_base != xmlMemBlocks()) {
11078             printf("Leak of %d blocks found in xmlListMerge",
11079 	           xmlMemBlocks() - mem_base);
11080 	    test_ret++;
11081             printf(" %d", n_l1);
11082             printf(" %d", n_l2);
11083             printf("\n");
11084         }
11085     }
11086     }
11087     function_tests++;
11088 
11089     return(test_ret);
11090 }
11091 
11092 
11093 static int
test_xmlListPopBack(void)11094 test_xmlListPopBack(void) {
11095     int test_ret = 0;
11096 
11097     int mem_base;
11098     xmlListPtr l; /* a list */
11099     int n_l;
11100 
11101     for (n_l = 0;n_l < gen_nb_xmlListPtr;n_l++) {
11102         mem_base = xmlMemBlocks();
11103         l = gen_xmlListPtr(n_l, 0);
11104 
11105         xmlListPopBack(l);
11106         call_tests++;
11107         des_xmlListPtr(n_l, l, 0);
11108         xmlResetLastError();
11109         if (mem_base != xmlMemBlocks()) {
11110             printf("Leak of %d blocks found in xmlListPopBack",
11111 	           xmlMemBlocks() - mem_base);
11112 	    test_ret++;
11113             printf(" %d", n_l);
11114             printf("\n");
11115         }
11116     }
11117     function_tests++;
11118 
11119     return(test_ret);
11120 }
11121 
11122 
11123 static int
test_xmlListPopFront(void)11124 test_xmlListPopFront(void) {
11125     int test_ret = 0;
11126 
11127     int mem_base;
11128     xmlListPtr l; /* a list */
11129     int n_l;
11130 
11131     for (n_l = 0;n_l < gen_nb_xmlListPtr;n_l++) {
11132         mem_base = xmlMemBlocks();
11133         l = gen_xmlListPtr(n_l, 0);
11134 
11135         xmlListPopFront(l);
11136         call_tests++;
11137         des_xmlListPtr(n_l, l, 0);
11138         xmlResetLastError();
11139         if (mem_base != xmlMemBlocks()) {
11140             printf("Leak of %d blocks found in xmlListPopFront",
11141 	           xmlMemBlocks() - mem_base);
11142 	    test_ret++;
11143             printf(" %d", n_l);
11144             printf("\n");
11145         }
11146     }
11147     function_tests++;
11148 
11149     return(test_ret);
11150 }
11151 
11152 
11153 static int
test_xmlListPushBack(void)11154 test_xmlListPushBack(void) {
11155     int test_ret = 0;
11156 
11157     int mem_base;
11158     int ret_val;
11159     xmlListPtr l; /* a list */
11160     int n_l;
11161     void * data; /* new data */
11162     int n_data;
11163 
11164     for (n_l = 0;n_l < gen_nb_xmlListPtr;n_l++) {
11165     for (n_data = 0;n_data < gen_nb_userdata;n_data++) {
11166         mem_base = xmlMemBlocks();
11167         l = gen_xmlListPtr(n_l, 0);
11168         data = gen_userdata(n_data, 1);
11169 
11170         ret_val = xmlListPushBack(l, data);
11171         desret_int(ret_val);
11172         call_tests++;
11173         des_xmlListPtr(n_l, l, 0);
11174         des_userdata(n_data, data, 1);
11175         xmlResetLastError();
11176         if (mem_base != xmlMemBlocks()) {
11177             printf("Leak of %d blocks found in xmlListPushBack",
11178 	           xmlMemBlocks() - mem_base);
11179 	    test_ret++;
11180             printf(" %d", n_l);
11181             printf(" %d", n_data);
11182             printf("\n");
11183         }
11184     }
11185     }
11186     function_tests++;
11187 
11188     return(test_ret);
11189 }
11190 
11191 
11192 static int
test_xmlListPushFront(void)11193 test_xmlListPushFront(void) {
11194     int test_ret = 0;
11195 
11196     int mem_base;
11197     int ret_val;
11198     xmlListPtr l; /* a list */
11199     int n_l;
11200     void * data; /* new data */
11201     int n_data;
11202 
11203     for (n_l = 0;n_l < gen_nb_xmlListPtr;n_l++) {
11204     for (n_data = 0;n_data < gen_nb_userdata;n_data++) {
11205         mem_base = xmlMemBlocks();
11206         l = gen_xmlListPtr(n_l, 0);
11207         data = gen_userdata(n_data, 1);
11208 
11209         ret_val = xmlListPushFront(l, data);
11210         desret_int(ret_val);
11211         call_tests++;
11212         des_xmlListPtr(n_l, l, 0);
11213         des_userdata(n_data, data, 1);
11214         xmlResetLastError();
11215         if (mem_base != xmlMemBlocks()) {
11216             printf("Leak of %d blocks found in xmlListPushFront",
11217 	           xmlMemBlocks() - mem_base);
11218 	    test_ret++;
11219             printf(" %d", n_l);
11220             printf(" %d", n_data);
11221             printf("\n");
11222         }
11223     }
11224     }
11225     function_tests++;
11226 
11227     return(test_ret);
11228 }
11229 
11230 
11231 static int
test_xmlListRemoveAll(void)11232 test_xmlListRemoveAll(void) {
11233     int test_ret = 0;
11234 
11235     int mem_base;
11236     int ret_val;
11237     xmlListPtr l; /* a list */
11238     int n_l;
11239     void * data; /* list data */
11240     int n_data;
11241 
11242     for (n_l = 0;n_l < gen_nb_xmlListPtr;n_l++) {
11243     for (n_data = 0;n_data < gen_nb_userdata;n_data++) {
11244         mem_base = xmlMemBlocks();
11245         l = gen_xmlListPtr(n_l, 0);
11246         data = gen_userdata(n_data, 1);
11247 
11248         ret_val = xmlListRemoveAll(l, data);
11249         desret_int(ret_val);
11250         call_tests++;
11251         des_xmlListPtr(n_l, l, 0);
11252         des_userdata(n_data, data, 1);
11253         xmlResetLastError();
11254         if (mem_base != xmlMemBlocks()) {
11255             printf("Leak of %d blocks found in xmlListRemoveAll",
11256 	           xmlMemBlocks() - mem_base);
11257 	    test_ret++;
11258             printf(" %d", n_l);
11259             printf(" %d", n_data);
11260             printf("\n");
11261         }
11262     }
11263     }
11264     function_tests++;
11265 
11266     return(test_ret);
11267 }
11268 
11269 
11270 static int
test_xmlListRemoveFirst(void)11271 test_xmlListRemoveFirst(void) {
11272     int test_ret = 0;
11273 
11274     int mem_base;
11275     int ret_val;
11276     xmlListPtr l; /* a list */
11277     int n_l;
11278     void * data; /* list data */
11279     int n_data;
11280 
11281     for (n_l = 0;n_l < gen_nb_xmlListPtr;n_l++) {
11282     for (n_data = 0;n_data < gen_nb_userdata;n_data++) {
11283         mem_base = xmlMemBlocks();
11284         l = gen_xmlListPtr(n_l, 0);
11285         data = gen_userdata(n_data, 1);
11286 
11287         ret_val = xmlListRemoveFirst(l, data);
11288         desret_int(ret_val);
11289         call_tests++;
11290         des_xmlListPtr(n_l, l, 0);
11291         des_userdata(n_data, data, 1);
11292         xmlResetLastError();
11293         if (mem_base != xmlMemBlocks()) {
11294             printf("Leak of %d blocks found in xmlListRemoveFirst",
11295 	           xmlMemBlocks() - mem_base);
11296 	    test_ret++;
11297             printf(" %d", n_l);
11298             printf(" %d", n_data);
11299             printf("\n");
11300         }
11301     }
11302     }
11303     function_tests++;
11304 
11305     return(test_ret);
11306 }
11307 
11308 
11309 static int
test_xmlListRemoveLast(void)11310 test_xmlListRemoveLast(void) {
11311     int test_ret = 0;
11312 
11313     int mem_base;
11314     int ret_val;
11315     xmlListPtr l; /* a list */
11316     int n_l;
11317     void * data; /* list data */
11318     int n_data;
11319 
11320     for (n_l = 0;n_l < gen_nb_xmlListPtr;n_l++) {
11321     for (n_data = 0;n_data < gen_nb_userdata;n_data++) {
11322         mem_base = xmlMemBlocks();
11323         l = gen_xmlListPtr(n_l, 0);
11324         data = gen_userdata(n_data, 1);
11325 
11326         ret_val = xmlListRemoveLast(l, data);
11327         desret_int(ret_val);
11328         call_tests++;
11329         des_xmlListPtr(n_l, l, 0);
11330         des_userdata(n_data, data, 1);
11331         xmlResetLastError();
11332         if (mem_base != xmlMemBlocks()) {
11333             printf("Leak of %d blocks found in xmlListRemoveLast",
11334 	           xmlMemBlocks() - mem_base);
11335 	    test_ret++;
11336             printf(" %d", n_l);
11337             printf(" %d", n_data);
11338             printf("\n");
11339         }
11340     }
11341     }
11342     function_tests++;
11343 
11344     return(test_ret);
11345 }
11346 
11347 
11348 static int
test_xmlListReverse(void)11349 test_xmlListReverse(void) {
11350     int test_ret = 0;
11351 
11352     int mem_base;
11353     xmlListPtr l; /* a list */
11354     int n_l;
11355 
11356     for (n_l = 0;n_l < gen_nb_xmlListPtr;n_l++) {
11357         mem_base = xmlMemBlocks();
11358         l = gen_xmlListPtr(n_l, 0);
11359 
11360         xmlListReverse(l);
11361         call_tests++;
11362         des_xmlListPtr(n_l, l, 0);
11363         xmlResetLastError();
11364         if (mem_base != xmlMemBlocks()) {
11365             printf("Leak of %d blocks found in xmlListReverse",
11366 	           xmlMemBlocks() - mem_base);
11367 	    test_ret++;
11368             printf(" %d", n_l);
11369             printf("\n");
11370         }
11371     }
11372     function_tests++;
11373 
11374     return(test_ret);
11375 }
11376 
11377 
11378 static int
test_xmlListReverseSearch(void)11379 test_xmlListReverseSearch(void) {
11380     int test_ret = 0;
11381 
11382     int mem_base;
11383     void * ret_val;
11384     xmlListPtr l; /* a list */
11385     int n_l;
11386     void * data; /* a search value */
11387     int n_data;
11388 
11389     for (n_l = 0;n_l < gen_nb_xmlListPtr;n_l++) {
11390     for (n_data = 0;n_data < gen_nb_userdata;n_data++) {
11391         mem_base = xmlMemBlocks();
11392         l = gen_xmlListPtr(n_l, 0);
11393         data = gen_userdata(n_data, 1);
11394 
11395         ret_val = xmlListReverseSearch(l, data);
11396         desret_void_ptr(ret_val);
11397         call_tests++;
11398         des_xmlListPtr(n_l, l, 0);
11399         des_userdata(n_data, data, 1);
11400         xmlResetLastError();
11401         if (mem_base != xmlMemBlocks()) {
11402             printf("Leak of %d blocks found in xmlListReverseSearch",
11403 	           xmlMemBlocks() - mem_base);
11404 	    test_ret++;
11405             printf(" %d", n_l);
11406             printf(" %d", n_data);
11407             printf("\n");
11408         }
11409     }
11410     }
11411     function_tests++;
11412 
11413     return(test_ret);
11414 }
11415 
11416 
11417 static int
test_xmlListReverseWalk(void)11418 test_xmlListReverseWalk(void) {
11419     int test_ret = 0;
11420 
11421 
11422     /* missing type support */
11423     return(test_ret);
11424 }
11425 
11426 
11427 static int
test_xmlListSearch(void)11428 test_xmlListSearch(void) {
11429     int test_ret = 0;
11430 
11431     int mem_base;
11432     void * ret_val;
11433     xmlListPtr l; /* a list */
11434     int n_l;
11435     void * data; /* a search value */
11436     int n_data;
11437 
11438     for (n_l = 0;n_l < gen_nb_xmlListPtr;n_l++) {
11439     for (n_data = 0;n_data < gen_nb_userdata;n_data++) {
11440         mem_base = xmlMemBlocks();
11441         l = gen_xmlListPtr(n_l, 0);
11442         data = gen_userdata(n_data, 1);
11443 
11444         ret_val = xmlListSearch(l, data);
11445         desret_void_ptr(ret_val);
11446         call_tests++;
11447         des_xmlListPtr(n_l, l, 0);
11448         des_userdata(n_data, data, 1);
11449         xmlResetLastError();
11450         if (mem_base != xmlMemBlocks()) {
11451             printf("Leak of %d blocks found in xmlListSearch",
11452 	           xmlMemBlocks() - mem_base);
11453 	    test_ret++;
11454             printf(" %d", n_l);
11455             printf(" %d", n_data);
11456             printf("\n");
11457         }
11458     }
11459     }
11460     function_tests++;
11461 
11462     return(test_ret);
11463 }
11464 
11465 
11466 static int
test_xmlListSize(void)11467 test_xmlListSize(void) {
11468     int test_ret = 0;
11469 
11470     int mem_base;
11471     int ret_val;
11472     xmlListPtr l; /* a list */
11473     int n_l;
11474 
11475     for (n_l = 0;n_l < gen_nb_xmlListPtr;n_l++) {
11476         mem_base = xmlMemBlocks();
11477         l = gen_xmlListPtr(n_l, 0);
11478 
11479         ret_val = xmlListSize(l);
11480         desret_int(ret_val);
11481         call_tests++;
11482         des_xmlListPtr(n_l, l, 0);
11483         xmlResetLastError();
11484         if (mem_base != xmlMemBlocks()) {
11485             printf("Leak of %d blocks found in xmlListSize",
11486 	           xmlMemBlocks() - mem_base);
11487 	    test_ret++;
11488             printf(" %d", n_l);
11489             printf("\n");
11490         }
11491     }
11492     function_tests++;
11493 
11494     return(test_ret);
11495 }
11496 
11497 
11498 static int
test_xmlListSort(void)11499 test_xmlListSort(void) {
11500     int test_ret = 0;
11501 
11502     int mem_base;
11503     xmlListPtr l; /* a list */
11504     int n_l;
11505 
11506     for (n_l = 0;n_l < gen_nb_xmlListPtr;n_l++) {
11507         mem_base = xmlMemBlocks();
11508         l = gen_xmlListPtr(n_l, 0);
11509 
11510         xmlListSort(l);
11511         call_tests++;
11512         des_xmlListPtr(n_l, l, 0);
11513         xmlResetLastError();
11514         if (mem_base != xmlMemBlocks()) {
11515             printf("Leak of %d blocks found in xmlListSort",
11516 	           xmlMemBlocks() - mem_base);
11517 	    test_ret++;
11518             printf(" %d", n_l);
11519             printf("\n");
11520         }
11521     }
11522     function_tests++;
11523 
11524     return(test_ret);
11525 }
11526 
11527 
11528 static int
test_xmlListWalk(void)11529 test_xmlListWalk(void) {
11530     int test_ret = 0;
11531 
11532 
11533     /* missing type support */
11534     return(test_ret);
11535 }
11536 
11537 static int
test_list(void)11538 test_list(void) {
11539     int test_ret = 0;
11540 
11541     if (quiet == 0) printf("Testing list : 19 of 26 functions ...\n");
11542     test_ret += test_xmlLinkGetData();
11543     test_ret += test_xmlListAppend();
11544     test_ret += test_xmlListClear();
11545     test_ret += test_xmlListCopy();
11546     test_ret += test_xmlListCreate();
11547     test_ret += test_xmlListDup();
11548     test_ret += test_xmlListEmpty();
11549     test_ret += test_xmlListEnd();
11550     test_ret += test_xmlListFront();
11551     test_ret += test_xmlListInsert();
11552     test_ret += test_xmlListMerge();
11553     test_ret += test_xmlListPopBack();
11554     test_ret += test_xmlListPopFront();
11555     test_ret += test_xmlListPushBack();
11556     test_ret += test_xmlListPushFront();
11557     test_ret += test_xmlListRemoveAll();
11558     test_ret += test_xmlListRemoveFirst();
11559     test_ret += test_xmlListRemoveLast();
11560     test_ret += test_xmlListReverse();
11561     test_ret += test_xmlListReverseSearch();
11562     test_ret += test_xmlListReverseWalk();
11563     test_ret += test_xmlListSearch();
11564     test_ret += test_xmlListSize();
11565     test_ret += test_xmlListSort();
11566     test_ret += test_xmlListWalk();
11567 
11568     if (test_ret != 0)
11569 	printf("Module list: %d errors\n", test_ret);
11570     return(test_ret);
11571 }
11572 
11573 static int
test_xmlNanoFTPCheckResponse(void)11574 test_xmlNanoFTPCheckResponse(void) {
11575     int test_ret = 0;
11576 
11577 #if defined(LIBXML_FTP_ENABLED)
11578     int mem_base;
11579     int ret_val;
11580     void * ctx; /* an FTP context */
11581     int n_ctx;
11582 
11583     for (n_ctx = 0;n_ctx < gen_nb_xmlNanoFTPCtxtPtr;n_ctx++) {
11584         mem_base = xmlMemBlocks();
11585         ctx = gen_xmlNanoFTPCtxtPtr(n_ctx, 0);
11586 
11587         ret_val = xmlNanoFTPCheckResponse(ctx);
11588         desret_int(ret_val);
11589         call_tests++;
11590         des_xmlNanoFTPCtxtPtr(n_ctx, ctx, 0);
11591         xmlResetLastError();
11592         if (mem_base != xmlMemBlocks()) {
11593             printf("Leak of %d blocks found in xmlNanoFTPCheckResponse",
11594 	           xmlMemBlocks() - mem_base);
11595 	    test_ret++;
11596             printf(" %d", n_ctx);
11597             printf("\n");
11598         }
11599     }
11600     function_tests++;
11601 #endif
11602 
11603     return(test_ret);
11604 }
11605 
11606 
11607 static int
test_xmlNanoFTPCleanup(void)11608 test_xmlNanoFTPCleanup(void) {
11609     int test_ret = 0;
11610 
11611 #if defined(LIBXML_FTP_ENABLED)
11612     int mem_base;
11613 
11614         mem_base = xmlMemBlocks();
11615 
11616         xmlNanoFTPCleanup();
11617         call_tests++;
11618         xmlResetLastError();
11619         if (mem_base != xmlMemBlocks()) {
11620             printf("Leak of %d blocks found in xmlNanoFTPCleanup",
11621 	           xmlMemBlocks() - mem_base);
11622 	    test_ret++;
11623             printf("\n");
11624         }
11625     function_tests++;
11626 #endif
11627 
11628     return(test_ret);
11629 }
11630 
11631 
11632 static int
test_xmlNanoFTPCloseConnection(void)11633 test_xmlNanoFTPCloseConnection(void) {
11634     int test_ret = 0;
11635 
11636 #if defined(LIBXML_FTP_ENABLED)
11637     int mem_base;
11638     int ret_val;
11639     void * ctx; /* an FTP context */
11640     int n_ctx;
11641 
11642     for (n_ctx = 0;n_ctx < gen_nb_xmlNanoFTPCtxtPtr;n_ctx++) {
11643         mem_base = xmlMemBlocks();
11644         ctx = gen_xmlNanoFTPCtxtPtr(n_ctx, 0);
11645 
11646         ret_val = xmlNanoFTPCloseConnection(ctx);
11647         desret_int(ret_val);
11648         call_tests++;
11649         des_xmlNanoFTPCtxtPtr(n_ctx, ctx, 0);
11650         xmlResetLastError();
11651         if (mem_base != xmlMemBlocks()) {
11652             printf("Leak of %d blocks found in xmlNanoFTPCloseConnection",
11653 	           xmlMemBlocks() - mem_base);
11654 	    test_ret++;
11655             printf(" %d", n_ctx);
11656             printf("\n");
11657         }
11658     }
11659     function_tests++;
11660 #endif
11661 
11662     return(test_ret);
11663 }
11664 
11665 
11666 static int
test_xmlNanoFTPCwd(void)11667 test_xmlNanoFTPCwd(void) {
11668     int test_ret = 0;
11669 
11670 #if defined(LIBXML_FTP_ENABLED)
11671     int mem_base;
11672     int ret_val;
11673     void * ctx; /* an FTP context */
11674     int n_ctx;
11675     char * directory; /* a directory on the server */
11676     int n_directory;
11677 
11678     for (n_ctx = 0;n_ctx < gen_nb_xmlNanoFTPCtxtPtr;n_ctx++) {
11679     for (n_directory = 0;n_directory < gen_nb_const_char_ptr;n_directory++) {
11680         mem_base = xmlMemBlocks();
11681         ctx = gen_xmlNanoFTPCtxtPtr(n_ctx, 0);
11682         directory = gen_const_char_ptr(n_directory, 1);
11683 
11684         ret_val = xmlNanoFTPCwd(ctx, (const char *)directory);
11685         desret_int(ret_val);
11686         call_tests++;
11687         des_xmlNanoFTPCtxtPtr(n_ctx, ctx, 0);
11688         des_const_char_ptr(n_directory, (const char *)directory, 1);
11689         xmlResetLastError();
11690         if (mem_base != xmlMemBlocks()) {
11691             printf("Leak of %d blocks found in xmlNanoFTPCwd",
11692 	           xmlMemBlocks() - mem_base);
11693 	    test_ret++;
11694             printf(" %d", n_ctx);
11695             printf(" %d", n_directory);
11696             printf("\n");
11697         }
11698     }
11699     }
11700     function_tests++;
11701 #endif
11702 
11703     return(test_ret);
11704 }
11705 
11706 
11707 static int
test_xmlNanoFTPDele(void)11708 test_xmlNanoFTPDele(void) {
11709     int test_ret = 0;
11710 
11711 #if defined(LIBXML_FTP_ENABLED)
11712     int mem_base;
11713     int ret_val;
11714     void * ctx; /* an FTP context */
11715     int n_ctx;
11716     const char * file; /* a file or directory on the server */
11717     int n_file;
11718 
11719     for (n_ctx = 0;n_ctx < gen_nb_xmlNanoFTPCtxtPtr;n_ctx++) {
11720     for (n_file = 0;n_file < gen_nb_filepath;n_file++) {
11721         mem_base = xmlMemBlocks();
11722         ctx = gen_xmlNanoFTPCtxtPtr(n_ctx, 0);
11723         file = gen_filepath(n_file, 1);
11724 
11725         ret_val = xmlNanoFTPDele(ctx, file);
11726         desret_int(ret_val);
11727         call_tests++;
11728         des_xmlNanoFTPCtxtPtr(n_ctx, ctx, 0);
11729         des_filepath(n_file, file, 1);
11730         xmlResetLastError();
11731         if (mem_base != xmlMemBlocks()) {
11732             printf("Leak of %d blocks found in xmlNanoFTPDele",
11733 	           xmlMemBlocks() - mem_base);
11734 	    test_ret++;
11735             printf(" %d", n_ctx);
11736             printf(" %d", n_file);
11737             printf("\n");
11738         }
11739     }
11740     }
11741     function_tests++;
11742 #endif
11743 
11744     return(test_ret);
11745 }
11746 
11747 
11748 static int
test_xmlNanoFTPGet(void)11749 test_xmlNanoFTPGet(void) {
11750     int test_ret = 0;
11751 
11752 
11753     /* missing type support */
11754     return(test_ret);
11755 }
11756 
11757 
11758 static int
test_xmlNanoFTPGetConnection(void)11759 test_xmlNanoFTPGetConnection(void) {
11760     int test_ret = 0;
11761 
11762 
11763     /* missing type support */
11764     return(test_ret);
11765 }
11766 
11767 
11768 static int
test_xmlNanoFTPGetResponse(void)11769 test_xmlNanoFTPGetResponse(void) {
11770     int test_ret = 0;
11771 
11772 #if defined(LIBXML_FTP_ENABLED)
11773     int mem_base;
11774     int ret_val;
11775     void * ctx; /* an FTP context */
11776     int n_ctx;
11777 
11778     for (n_ctx = 0;n_ctx < gen_nb_xmlNanoFTPCtxtPtr;n_ctx++) {
11779         mem_base = xmlMemBlocks();
11780         ctx = gen_xmlNanoFTPCtxtPtr(n_ctx, 0);
11781 
11782         ret_val = xmlNanoFTPGetResponse(ctx);
11783         desret_int(ret_val);
11784         call_tests++;
11785         des_xmlNanoFTPCtxtPtr(n_ctx, ctx, 0);
11786         xmlResetLastError();
11787         if (mem_base != xmlMemBlocks()) {
11788             printf("Leak of %d blocks found in xmlNanoFTPGetResponse",
11789 	           xmlMemBlocks() - mem_base);
11790 	    test_ret++;
11791             printf(" %d", n_ctx);
11792             printf("\n");
11793         }
11794     }
11795     function_tests++;
11796 #endif
11797 
11798     return(test_ret);
11799 }
11800 
11801 
11802 static int
test_xmlNanoFTPGetSocket(void)11803 test_xmlNanoFTPGetSocket(void) {
11804     int test_ret = 0;
11805 
11806 
11807     /* missing type support */
11808     return(test_ret);
11809 }
11810 
11811 
11812 static int
test_xmlNanoFTPInit(void)11813 test_xmlNanoFTPInit(void) {
11814     int test_ret = 0;
11815 
11816 #if defined(LIBXML_FTP_ENABLED)
11817     int mem_base;
11818 
11819         mem_base = xmlMemBlocks();
11820 
11821         xmlNanoFTPInit();
11822         call_tests++;
11823         xmlResetLastError();
11824         if (mem_base != xmlMemBlocks()) {
11825             printf("Leak of %d blocks found in xmlNanoFTPInit",
11826 	           xmlMemBlocks() - mem_base);
11827 	    test_ret++;
11828             printf("\n");
11829         }
11830     function_tests++;
11831 #endif
11832 
11833     return(test_ret);
11834 }
11835 
11836 
11837 static int
test_xmlNanoFTPList(void)11838 test_xmlNanoFTPList(void) {
11839     int test_ret = 0;
11840 
11841 
11842     /* missing type support */
11843     return(test_ret);
11844 }
11845 
11846 
11847 static int
test_xmlNanoFTPNewCtxt(void)11848 test_xmlNanoFTPNewCtxt(void) {
11849     int test_ret = 0;
11850 
11851 #if defined(LIBXML_FTP_ENABLED)
11852     int mem_base;
11853     void * ret_val;
11854     const char * URL; /* The URL used to initialize the context */
11855     int n_URL;
11856 
11857     for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) {
11858         mem_base = xmlMemBlocks();
11859         URL = gen_filepath(n_URL, 0);
11860 
11861         ret_val = xmlNanoFTPNewCtxt(URL);
11862         desret_xmlNanoFTPCtxtPtr(ret_val);
11863         call_tests++;
11864         des_filepath(n_URL, URL, 0);
11865         xmlResetLastError();
11866         if (mem_base != xmlMemBlocks()) {
11867             printf("Leak of %d blocks found in xmlNanoFTPNewCtxt",
11868 	           xmlMemBlocks() - mem_base);
11869 	    test_ret++;
11870             printf(" %d", n_URL);
11871             printf("\n");
11872         }
11873     }
11874     function_tests++;
11875 #endif
11876 
11877     return(test_ret);
11878 }
11879 
11880 
11881 static int
test_xmlNanoFTPOpen(void)11882 test_xmlNanoFTPOpen(void) {
11883     int test_ret = 0;
11884 
11885 #if defined(LIBXML_FTP_ENABLED)
11886     int mem_base;
11887     void * ret_val;
11888     const char * URL; /* the URL to the resource */
11889     int n_URL;
11890 
11891     for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) {
11892         mem_base = xmlMemBlocks();
11893         URL = gen_filepath(n_URL, 0);
11894 
11895         ret_val = xmlNanoFTPOpen(URL);
11896         desret_xmlNanoFTPCtxtPtr(ret_val);
11897         call_tests++;
11898         des_filepath(n_URL, URL, 0);
11899         xmlResetLastError();
11900         if (mem_base != xmlMemBlocks()) {
11901             printf("Leak of %d blocks found in xmlNanoFTPOpen",
11902 	           xmlMemBlocks() - mem_base);
11903 	    test_ret++;
11904             printf(" %d", n_URL);
11905             printf("\n");
11906         }
11907     }
11908     function_tests++;
11909 #endif
11910 
11911     return(test_ret);
11912 }
11913 
11914 
11915 static int
test_xmlNanoFTPProxy(void)11916 test_xmlNanoFTPProxy(void) {
11917     int test_ret = 0;
11918 
11919 #if defined(LIBXML_FTP_ENABLED)
11920     char * host; /* the proxy host name */
11921     int n_host;
11922     int port; /* the proxy port */
11923     int n_port;
11924     char * user; /* the proxy user name */
11925     int n_user;
11926     char * passwd; /* the proxy password */
11927     int n_passwd;
11928     int type; /* the type of proxy 1 for using SITE, 2 for USER a@b */
11929     int n_type;
11930 
11931     for (n_host = 0;n_host < gen_nb_const_char_ptr;n_host++) {
11932     for (n_port = 0;n_port < gen_nb_int;n_port++) {
11933     for (n_user = 0;n_user < gen_nb_const_char_ptr;n_user++) {
11934     for (n_passwd = 0;n_passwd < gen_nb_const_char_ptr;n_passwd++) {
11935     for (n_type = 0;n_type < gen_nb_int;n_type++) {
11936         host = gen_const_char_ptr(n_host, 0);
11937         port = gen_int(n_port, 1);
11938         user = gen_const_char_ptr(n_user, 2);
11939         passwd = gen_const_char_ptr(n_passwd, 3);
11940         type = gen_int(n_type, 4);
11941 
11942         xmlNanoFTPProxy((const char *)host, port, (const char *)user, (const char *)passwd, type);
11943         call_tests++;
11944         des_const_char_ptr(n_host, (const char *)host, 0);
11945         des_int(n_port, port, 1);
11946         des_const_char_ptr(n_user, (const char *)user, 2);
11947         des_const_char_ptr(n_passwd, (const char *)passwd, 3);
11948         des_int(n_type, type, 4);
11949         xmlResetLastError();
11950     }
11951     }
11952     }
11953     }
11954     }
11955     function_tests++;
11956 #endif
11957 
11958     return(test_ret);
11959 }
11960 
11961 
11962 static int
test_xmlNanoFTPQuit(void)11963 test_xmlNanoFTPQuit(void) {
11964     int test_ret = 0;
11965 
11966 #if defined(LIBXML_FTP_ENABLED)
11967     int mem_base;
11968     int ret_val;
11969     void * ctx; /* an FTP context */
11970     int n_ctx;
11971 
11972     for (n_ctx = 0;n_ctx < gen_nb_xmlNanoFTPCtxtPtr;n_ctx++) {
11973         mem_base = xmlMemBlocks();
11974         ctx = gen_xmlNanoFTPCtxtPtr(n_ctx, 0);
11975 
11976         ret_val = xmlNanoFTPQuit(ctx);
11977         desret_int(ret_val);
11978         call_tests++;
11979         des_xmlNanoFTPCtxtPtr(n_ctx, ctx, 0);
11980         xmlResetLastError();
11981         if (mem_base != xmlMemBlocks()) {
11982             printf("Leak of %d blocks found in xmlNanoFTPQuit",
11983 	           xmlMemBlocks() - mem_base);
11984 	    test_ret++;
11985             printf(" %d", n_ctx);
11986             printf("\n");
11987         }
11988     }
11989     function_tests++;
11990 #endif
11991 
11992     return(test_ret);
11993 }
11994 
11995 
11996 static int
test_xmlNanoFTPRead(void)11997 test_xmlNanoFTPRead(void) {
11998     int test_ret = 0;
11999 
12000 #if defined(LIBXML_FTP_ENABLED)
12001     int mem_base;
12002     int ret_val;
12003     void * ctx; /* the FTP context */
12004     int n_ctx;
12005     void * dest; /* a buffer */
12006     int n_dest;
12007     int len; /* the buffer length */
12008     int n_len;
12009 
12010     for (n_ctx = 0;n_ctx < gen_nb_xmlNanoFTPCtxtPtr;n_ctx++) {
12011     for (n_dest = 0;n_dest < gen_nb_void_ptr;n_dest++) {
12012     for (n_len = 0;n_len < gen_nb_int;n_len++) {
12013         mem_base = xmlMemBlocks();
12014         ctx = gen_xmlNanoFTPCtxtPtr(n_ctx, 0);
12015         dest = gen_void_ptr(n_dest, 1);
12016         len = gen_int(n_len, 2);
12017 
12018         ret_val = xmlNanoFTPRead(ctx, dest, len);
12019         desret_int(ret_val);
12020         call_tests++;
12021         des_xmlNanoFTPCtxtPtr(n_ctx, ctx, 0);
12022         des_void_ptr(n_dest, dest, 1);
12023         des_int(n_len, len, 2);
12024         xmlResetLastError();
12025         if (mem_base != xmlMemBlocks()) {
12026             printf("Leak of %d blocks found in xmlNanoFTPRead",
12027 	           xmlMemBlocks() - mem_base);
12028 	    test_ret++;
12029             printf(" %d", n_ctx);
12030             printf(" %d", n_dest);
12031             printf(" %d", n_len);
12032             printf("\n");
12033         }
12034     }
12035     }
12036     }
12037     function_tests++;
12038 #endif
12039 
12040     return(test_ret);
12041 }
12042 
12043 
12044 static int
test_xmlNanoFTPScanProxy(void)12045 test_xmlNanoFTPScanProxy(void) {
12046     int test_ret = 0;
12047 
12048 #if defined(LIBXML_FTP_ENABLED)
12049     const char * URL; /* The proxy URL used to initialize the proxy context */
12050     int n_URL;
12051 
12052     for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) {
12053         URL = gen_filepath(n_URL, 0);
12054 
12055         xmlNanoFTPScanProxy(URL);
12056         call_tests++;
12057         des_filepath(n_URL, URL, 0);
12058         xmlResetLastError();
12059     }
12060     function_tests++;
12061 #endif
12062 
12063     return(test_ret);
12064 }
12065 
12066 
12067 static int
test_xmlNanoFTPUpdateURL(void)12068 test_xmlNanoFTPUpdateURL(void) {
12069     int test_ret = 0;
12070 
12071 #if defined(LIBXML_FTP_ENABLED)
12072     int mem_base;
12073     int ret_val;
12074     void * ctx; /* an FTP context */
12075     int n_ctx;
12076     const char * URL; /* The URL used to update the context */
12077     int n_URL;
12078 
12079     for (n_ctx = 0;n_ctx < gen_nb_xmlNanoFTPCtxtPtr;n_ctx++) {
12080     for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) {
12081         mem_base = xmlMemBlocks();
12082         ctx = gen_xmlNanoFTPCtxtPtr(n_ctx, 0);
12083         URL = gen_filepath(n_URL, 1);
12084 
12085         ret_val = xmlNanoFTPUpdateURL(ctx, URL);
12086         desret_int(ret_val);
12087         call_tests++;
12088         des_xmlNanoFTPCtxtPtr(n_ctx, ctx, 0);
12089         des_filepath(n_URL, URL, 1);
12090         xmlResetLastError();
12091         if (mem_base != xmlMemBlocks()) {
12092             printf("Leak of %d blocks found in xmlNanoFTPUpdateURL",
12093 	           xmlMemBlocks() - mem_base);
12094 	    test_ret++;
12095             printf(" %d", n_ctx);
12096             printf(" %d", n_URL);
12097             printf("\n");
12098         }
12099     }
12100     }
12101     function_tests++;
12102 #endif
12103 
12104     return(test_ret);
12105 }
12106 
12107 static int
test_nanoftp(void)12108 test_nanoftp(void) {
12109     int test_ret = 0;
12110 
12111     if (quiet == 0) printf("Testing nanoftp : 14 of 22 functions ...\n");
12112     test_ret += test_xmlNanoFTPCheckResponse();
12113     test_ret += test_xmlNanoFTPCleanup();
12114     test_ret += test_xmlNanoFTPCloseConnection();
12115     test_ret += test_xmlNanoFTPCwd();
12116     test_ret += test_xmlNanoFTPDele();
12117     test_ret += test_xmlNanoFTPGet();
12118     test_ret += test_xmlNanoFTPGetConnection();
12119     test_ret += test_xmlNanoFTPGetResponse();
12120     test_ret += test_xmlNanoFTPGetSocket();
12121     test_ret += test_xmlNanoFTPInit();
12122     test_ret += test_xmlNanoFTPList();
12123     test_ret += test_xmlNanoFTPNewCtxt();
12124     test_ret += test_xmlNanoFTPOpen();
12125     test_ret += test_xmlNanoFTPProxy();
12126     test_ret += test_xmlNanoFTPQuit();
12127     test_ret += test_xmlNanoFTPRead();
12128     test_ret += test_xmlNanoFTPScanProxy();
12129     test_ret += test_xmlNanoFTPUpdateURL();
12130 
12131     if (test_ret != 0)
12132 	printf("Module nanoftp: %d errors\n", test_ret);
12133     return(test_ret);
12134 }
12135 
12136 static int
test_xmlNanoHTTPAuthHeader(void)12137 test_xmlNanoHTTPAuthHeader(void) {
12138     int test_ret = 0;
12139 
12140 #if defined(LIBXML_HTTP_ENABLED)
12141     int mem_base;
12142     const char * ret_val;
12143     void * ctx; /* the HTTP context */
12144     int n_ctx;
12145 
12146     for (n_ctx = 0;n_ctx < gen_nb_xmlNanoHTTPCtxtPtr;n_ctx++) {
12147         mem_base = xmlMemBlocks();
12148         ctx = gen_xmlNanoHTTPCtxtPtr(n_ctx, 0);
12149 
12150         ret_val = xmlNanoHTTPAuthHeader(ctx);
12151         desret_const_char_ptr(ret_val);
12152         call_tests++;
12153         des_xmlNanoHTTPCtxtPtr(n_ctx, ctx, 0);
12154         xmlResetLastError();
12155         if (mem_base != xmlMemBlocks()) {
12156             printf("Leak of %d blocks found in xmlNanoHTTPAuthHeader",
12157 	           xmlMemBlocks() - mem_base);
12158 	    test_ret++;
12159             printf(" %d", n_ctx);
12160             printf("\n");
12161         }
12162     }
12163     function_tests++;
12164 #endif
12165 
12166     return(test_ret);
12167 }
12168 
12169 
12170 static int
test_xmlNanoHTTPCleanup(void)12171 test_xmlNanoHTTPCleanup(void) {
12172     int test_ret = 0;
12173 
12174 #if defined(LIBXML_HTTP_ENABLED)
12175     int mem_base;
12176 
12177         mem_base = xmlMemBlocks();
12178 
12179         xmlNanoHTTPCleanup();
12180         call_tests++;
12181         xmlResetLastError();
12182         if (mem_base != xmlMemBlocks()) {
12183             printf("Leak of %d blocks found in xmlNanoHTTPCleanup",
12184 	           xmlMemBlocks() - mem_base);
12185 	    test_ret++;
12186             printf("\n");
12187         }
12188     function_tests++;
12189 #endif
12190 
12191     return(test_ret);
12192 }
12193 
12194 
12195 static int
test_xmlNanoHTTPContentLength(void)12196 test_xmlNanoHTTPContentLength(void) {
12197     int test_ret = 0;
12198 
12199 #if defined(LIBXML_HTTP_ENABLED)
12200     int mem_base;
12201     int ret_val;
12202     void * ctx; /* the HTTP context */
12203     int n_ctx;
12204 
12205     for (n_ctx = 0;n_ctx < gen_nb_xmlNanoHTTPCtxtPtr;n_ctx++) {
12206         mem_base = xmlMemBlocks();
12207         ctx = gen_xmlNanoHTTPCtxtPtr(n_ctx, 0);
12208 
12209         ret_val = xmlNanoHTTPContentLength(ctx);
12210         desret_int(ret_val);
12211         call_tests++;
12212         des_xmlNanoHTTPCtxtPtr(n_ctx, ctx, 0);
12213         xmlResetLastError();
12214         if (mem_base != xmlMemBlocks()) {
12215             printf("Leak of %d blocks found in xmlNanoHTTPContentLength",
12216 	           xmlMemBlocks() - mem_base);
12217 	    test_ret++;
12218             printf(" %d", n_ctx);
12219             printf("\n");
12220         }
12221     }
12222     function_tests++;
12223 #endif
12224 
12225     return(test_ret);
12226 }
12227 
12228 
12229 static int
test_xmlNanoHTTPEncoding(void)12230 test_xmlNanoHTTPEncoding(void) {
12231     int test_ret = 0;
12232 
12233 #if defined(LIBXML_HTTP_ENABLED)
12234     int mem_base;
12235     const char * ret_val;
12236     void * ctx; /* the HTTP context */
12237     int n_ctx;
12238 
12239     for (n_ctx = 0;n_ctx < gen_nb_xmlNanoHTTPCtxtPtr;n_ctx++) {
12240         mem_base = xmlMemBlocks();
12241         ctx = gen_xmlNanoHTTPCtxtPtr(n_ctx, 0);
12242 
12243         ret_val = xmlNanoHTTPEncoding(ctx);
12244         desret_const_char_ptr(ret_val);
12245         call_tests++;
12246         des_xmlNanoHTTPCtxtPtr(n_ctx, ctx, 0);
12247         xmlResetLastError();
12248         if (mem_base != xmlMemBlocks()) {
12249             printf("Leak of %d blocks found in xmlNanoHTTPEncoding",
12250 	           xmlMemBlocks() - mem_base);
12251 	    test_ret++;
12252             printf(" %d", n_ctx);
12253             printf("\n");
12254         }
12255     }
12256     function_tests++;
12257 #endif
12258 
12259     return(test_ret);
12260 }
12261 
12262 
12263 #define gen_nb_char_ptr_ptr 1
gen_char_ptr_ptr(int no ATTRIBUTE_UNUSED,int nr ATTRIBUTE_UNUSED)12264 static char ** gen_char_ptr_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
12265     return(NULL);
12266 }
des_char_ptr_ptr(int no ATTRIBUTE_UNUSED,char ** val ATTRIBUTE_UNUSED,int nr ATTRIBUTE_UNUSED)12267 static void des_char_ptr_ptr(int no ATTRIBUTE_UNUSED, char ** val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
12268 }
12269 
12270 static int
test_xmlNanoHTTPFetch(void)12271 test_xmlNanoHTTPFetch(void) {
12272     int test_ret = 0;
12273 
12274 #if defined(LIBXML_HTTP_ENABLED)
12275     int mem_base;
12276     int ret_val;
12277     const char * URL; /* The URL to load */
12278     int n_URL;
12279     const char * filename; /* the filename where the content should be saved */
12280     int n_filename;
12281     char ** contentType; /* if available the Content-Type information will be returned at that location */
12282     int n_contentType;
12283 
12284     for (n_URL = 0;n_URL < gen_nb_fileoutput;n_URL++) {
12285     for (n_filename = 0;n_filename < gen_nb_fileoutput;n_filename++) {
12286     for (n_contentType = 0;n_contentType < gen_nb_char_ptr_ptr;n_contentType++) {
12287         mem_base = xmlMemBlocks();
12288         URL = gen_fileoutput(n_URL, 0);
12289         filename = gen_fileoutput(n_filename, 1);
12290         contentType = gen_char_ptr_ptr(n_contentType, 2);
12291 
12292         ret_val = xmlNanoHTTPFetch(URL, filename, contentType);
12293         desret_int(ret_val);
12294         call_tests++;
12295         des_fileoutput(n_URL, URL, 0);
12296         des_fileoutput(n_filename, filename, 1);
12297         des_char_ptr_ptr(n_contentType, contentType, 2);
12298         xmlResetLastError();
12299         if (mem_base != xmlMemBlocks()) {
12300             printf("Leak of %d blocks found in xmlNanoHTTPFetch",
12301 	           xmlMemBlocks() - mem_base);
12302 	    test_ret++;
12303             printf(" %d", n_URL);
12304             printf(" %d", n_filename);
12305             printf(" %d", n_contentType);
12306             printf("\n");
12307         }
12308     }
12309     }
12310     }
12311     function_tests++;
12312 #endif
12313 
12314     return(test_ret);
12315 }
12316 
12317 
12318 static int
test_xmlNanoHTTPInit(void)12319 test_xmlNanoHTTPInit(void) {
12320     int test_ret = 0;
12321 
12322 #if defined(LIBXML_HTTP_ENABLED)
12323     int mem_base;
12324 
12325         mem_base = xmlMemBlocks();
12326 
12327         xmlNanoHTTPInit();
12328         call_tests++;
12329         xmlResetLastError();
12330         if (mem_base != xmlMemBlocks()) {
12331             printf("Leak of %d blocks found in xmlNanoHTTPInit",
12332 	           xmlMemBlocks() - mem_base);
12333 	    test_ret++;
12334             printf("\n");
12335         }
12336     function_tests++;
12337 #endif
12338 
12339     return(test_ret);
12340 }
12341 
12342 
12343 static int
test_xmlNanoHTTPMimeType(void)12344 test_xmlNanoHTTPMimeType(void) {
12345     int test_ret = 0;
12346 
12347 #if defined(LIBXML_HTTP_ENABLED)
12348     int mem_base;
12349     const char * ret_val;
12350     void * ctx; /* the HTTP context */
12351     int n_ctx;
12352 
12353     for (n_ctx = 0;n_ctx < gen_nb_xmlNanoHTTPCtxtPtr;n_ctx++) {
12354         mem_base = xmlMemBlocks();
12355         ctx = gen_xmlNanoHTTPCtxtPtr(n_ctx, 0);
12356 
12357         ret_val = xmlNanoHTTPMimeType(ctx);
12358         desret_const_char_ptr(ret_val);
12359         call_tests++;
12360         des_xmlNanoHTTPCtxtPtr(n_ctx, ctx, 0);
12361         xmlResetLastError();
12362         if (mem_base != xmlMemBlocks()) {
12363             printf("Leak of %d blocks found in xmlNanoHTTPMimeType",
12364 	           xmlMemBlocks() - mem_base);
12365 	    test_ret++;
12366             printf(" %d", n_ctx);
12367             printf("\n");
12368         }
12369     }
12370     function_tests++;
12371 #endif
12372 
12373     return(test_ret);
12374 }
12375 
12376 
12377 static int
test_xmlNanoHTTPOpen(void)12378 test_xmlNanoHTTPOpen(void) {
12379     int test_ret = 0;
12380 
12381 #if defined(LIBXML_HTTP_ENABLED)
12382     int mem_base;
12383     void * ret_val;
12384     const char * URL; /* The URL to load */
12385     int n_URL;
12386     char ** contentType; /* if available the Content-Type information will be returned at that location */
12387     int n_contentType;
12388 
12389     for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) {
12390     for (n_contentType = 0;n_contentType < gen_nb_char_ptr_ptr;n_contentType++) {
12391         mem_base = xmlMemBlocks();
12392         URL = gen_filepath(n_URL, 0);
12393         contentType = gen_char_ptr_ptr(n_contentType, 1);
12394 
12395         ret_val = xmlNanoHTTPOpen(URL, contentType);
12396         desret_xmlNanoHTTPCtxtPtr(ret_val);
12397         call_tests++;
12398         des_filepath(n_URL, URL, 0);
12399         des_char_ptr_ptr(n_contentType, contentType, 1);
12400         xmlResetLastError();
12401         if (mem_base != xmlMemBlocks()) {
12402             printf("Leak of %d blocks found in xmlNanoHTTPOpen",
12403 	           xmlMemBlocks() - mem_base);
12404 	    test_ret++;
12405             printf(" %d", n_URL);
12406             printf(" %d", n_contentType);
12407             printf("\n");
12408         }
12409     }
12410     }
12411     function_tests++;
12412 #endif
12413 
12414     return(test_ret);
12415 }
12416 
12417 
12418 static int
test_xmlNanoHTTPOpenRedir(void)12419 test_xmlNanoHTTPOpenRedir(void) {
12420     int test_ret = 0;
12421 
12422 #if defined(LIBXML_HTTP_ENABLED)
12423     int mem_base;
12424     void * ret_val;
12425     const char * URL; /* The URL to load */
12426     int n_URL;
12427     char ** contentType; /* if available the Content-Type information will be returned at that location */
12428     int n_contentType;
12429     char ** redir; /* if available the redirected URL will be returned */
12430     int n_redir;
12431 
12432     for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) {
12433     for (n_contentType = 0;n_contentType < gen_nb_char_ptr_ptr;n_contentType++) {
12434     for (n_redir = 0;n_redir < gen_nb_char_ptr_ptr;n_redir++) {
12435         mem_base = xmlMemBlocks();
12436         URL = gen_filepath(n_URL, 0);
12437         contentType = gen_char_ptr_ptr(n_contentType, 1);
12438         redir = gen_char_ptr_ptr(n_redir, 2);
12439 
12440         ret_val = xmlNanoHTTPOpenRedir(URL, contentType, redir);
12441         desret_xmlNanoHTTPCtxtPtr(ret_val);
12442         call_tests++;
12443         des_filepath(n_URL, URL, 0);
12444         des_char_ptr_ptr(n_contentType, contentType, 1);
12445         des_char_ptr_ptr(n_redir, redir, 2);
12446         xmlResetLastError();
12447         if (mem_base != xmlMemBlocks()) {
12448             printf("Leak of %d blocks found in xmlNanoHTTPOpenRedir",
12449 	           xmlMemBlocks() - mem_base);
12450 	    test_ret++;
12451             printf(" %d", n_URL);
12452             printf(" %d", n_contentType);
12453             printf(" %d", n_redir);
12454             printf("\n");
12455         }
12456     }
12457     }
12458     }
12459     function_tests++;
12460 #endif
12461 
12462     return(test_ret);
12463 }
12464 
12465 
12466 static int
test_xmlNanoHTTPRead(void)12467 test_xmlNanoHTTPRead(void) {
12468     int test_ret = 0;
12469 
12470 #if defined(LIBXML_HTTP_ENABLED)
12471     int mem_base;
12472     int ret_val;
12473     void * ctx; /* the HTTP context */
12474     int n_ctx;
12475     void * dest; /* a buffer */
12476     int n_dest;
12477     int len; /* the buffer length */
12478     int n_len;
12479 
12480     for (n_ctx = 0;n_ctx < gen_nb_xmlNanoHTTPCtxtPtr;n_ctx++) {
12481     for (n_dest = 0;n_dest < gen_nb_void_ptr;n_dest++) {
12482     for (n_len = 0;n_len < gen_nb_int;n_len++) {
12483         mem_base = xmlMemBlocks();
12484         ctx = gen_xmlNanoHTTPCtxtPtr(n_ctx, 0);
12485         dest = gen_void_ptr(n_dest, 1);
12486         len = gen_int(n_len, 2);
12487 
12488         ret_val = xmlNanoHTTPRead(ctx, dest, len);
12489         desret_int(ret_val);
12490         call_tests++;
12491         des_xmlNanoHTTPCtxtPtr(n_ctx, ctx, 0);
12492         des_void_ptr(n_dest, dest, 1);
12493         des_int(n_len, len, 2);
12494         xmlResetLastError();
12495         if (mem_base != xmlMemBlocks()) {
12496             printf("Leak of %d blocks found in xmlNanoHTTPRead",
12497 	           xmlMemBlocks() - mem_base);
12498 	    test_ret++;
12499             printf(" %d", n_ctx);
12500             printf(" %d", n_dest);
12501             printf(" %d", n_len);
12502             printf("\n");
12503         }
12504     }
12505     }
12506     }
12507     function_tests++;
12508 #endif
12509 
12510     return(test_ret);
12511 }
12512 
12513 
12514 static int
test_xmlNanoHTTPRedir(void)12515 test_xmlNanoHTTPRedir(void) {
12516     int test_ret = 0;
12517 
12518 
12519     /* missing type support */
12520     return(test_ret);
12521 }
12522 
12523 
12524 static int
test_xmlNanoHTTPReturnCode(void)12525 test_xmlNanoHTTPReturnCode(void) {
12526     int test_ret = 0;
12527 
12528 #if defined(LIBXML_HTTP_ENABLED)
12529     int mem_base;
12530     int ret_val;
12531     void * ctx; /* the HTTP context */
12532     int n_ctx;
12533 
12534     for (n_ctx = 0;n_ctx < gen_nb_xmlNanoHTTPCtxtPtr;n_ctx++) {
12535         mem_base = xmlMemBlocks();
12536         ctx = gen_xmlNanoHTTPCtxtPtr(n_ctx, 0);
12537 
12538         ret_val = xmlNanoHTTPReturnCode(ctx);
12539         desret_int(ret_val);
12540         call_tests++;
12541         des_xmlNanoHTTPCtxtPtr(n_ctx, ctx, 0);
12542         xmlResetLastError();
12543         if (mem_base != xmlMemBlocks()) {
12544             printf("Leak of %d blocks found in xmlNanoHTTPReturnCode",
12545 	           xmlMemBlocks() - mem_base);
12546 	    test_ret++;
12547             printf(" %d", n_ctx);
12548             printf("\n");
12549         }
12550     }
12551     function_tests++;
12552 #endif
12553 
12554     return(test_ret);
12555 }
12556 
12557 
12558 static int
test_xmlNanoHTTPSave(void)12559 test_xmlNanoHTTPSave(void) {
12560     int test_ret = 0;
12561 
12562 #if defined(LIBXML_HTTP_ENABLED) && defined(LIBXML_OUTPUT_ENABLED)
12563     int mem_base;
12564     int ret_val;
12565     void * ctxt; /* the HTTP context */
12566     int n_ctxt;
12567     const char * filename; /* the filename where the content should be saved */
12568     int n_filename;
12569 
12570     for (n_ctxt = 0;n_ctxt < gen_nb_void_ptr;n_ctxt++) {
12571     for (n_filename = 0;n_filename < gen_nb_fileoutput;n_filename++) {
12572         mem_base = xmlMemBlocks();
12573         ctxt = gen_void_ptr(n_ctxt, 0);
12574         filename = gen_fileoutput(n_filename, 1);
12575 
12576         ret_val = xmlNanoHTTPSave(ctxt, filename);
12577         desret_int(ret_val);
12578         call_tests++;
12579         des_void_ptr(n_ctxt, ctxt, 0);
12580         des_fileoutput(n_filename, filename, 1);
12581         xmlResetLastError();
12582         if (mem_base != xmlMemBlocks()) {
12583             printf("Leak of %d blocks found in xmlNanoHTTPSave",
12584 	           xmlMemBlocks() - mem_base);
12585 	    test_ret++;
12586             printf(" %d", n_ctxt);
12587             printf(" %d", n_filename);
12588             printf("\n");
12589         }
12590     }
12591     }
12592     function_tests++;
12593 #endif
12594 
12595     return(test_ret);
12596 }
12597 
12598 
12599 static int
test_xmlNanoHTTPScanProxy(void)12600 test_xmlNanoHTTPScanProxy(void) {
12601     int test_ret = 0;
12602 
12603 #if defined(LIBXML_HTTP_ENABLED)
12604     const char * URL; /* The proxy URL used to initialize the proxy context */
12605     int n_URL;
12606 
12607     for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) {
12608         URL = gen_filepath(n_URL, 0);
12609 
12610         xmlNanoHTTPScanProxy(URL);
12611         call_tests++;
12612         des_filepath(n_URL, URL, 0);
12613         xmlResetLastError();
12614     }
12615     function_tests++;
12616 #endif
12617 
12618     return(test_ret);
12619 }
12620 
12621 static int
test_nanohttp(void)12622 test_nanohttp(void) {
12623     int test_ret = 0;
12624 
12625     if (quiet == 0) printf("Testing nanohttp : 13 of 17 functions ...\n");
12626     test_ret += test_xmlNanoHTTPAuthHeader();
12627     test_ret += test_xmlNanoHTTPCleanup();
12628     test_ret += test_xmlNanoHTTPContentLength();
12629     test_ret += test_xmlNanoHTTPEncoding();
12630     test_ret += test_xmlNanoHTTPFetch();
12631     test_ret += test_xmlNanoHTTPInit();
12632     test_ret += test_xmlNanoHTTPMimeType();
12633     test_ret += test_xmlNanoHTTPOpen();
12634     test_ret += test_xmlNanoHTTPOpenRedir();
12635     test_ret += test_xmlNanoHTTPRead();
12636     test_ret += test_xmlNanoHTTPRedir();
12637     test_ret += test_xmlNanoHTTPReturnCode();
12638     test_ret += test_xmlNanoHTTPSave();
12639     test_ret += test_xmlNanoHTTPScanProxy();
12640 
12641     if (test_ret != 0)
12642 	printf("Module nanohttp: %d errors\n", test_ret);
12643     return(test_ret);
12644 }
12645 
12646 static int
test_xmlByteConsumed(void)12647 test_xmlByteConsumed(void) {
12648     int test_ret = 0;
12649 
12650     int mem_base;
12651     long ret_val;
12652     xmlParserCtxtPtr ctxt; /* an XML parser context */
12653     int n_ctxt;
12654 
12655     for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
12656         mem_base = xmlMemBlocks();
12657         ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
12658 
12659         ret_val = xmlByteConsumed(ctxt);
12660         desret_long(ret_val);
12661         call_tests++;
12662         des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
12663         xmlResetLastError();
12664         if (mem_base != xmlMemBlocks()) {
12665             printf("Leak of %d blocks found in xmlByteConsumed",
12666 	           xmlMemBlocks() - mem_base);
12667 	    test_ret++;
12668             printf(" %d", n_ctxt);
12669             printf("\n");
12670         }
12671     }
12672     function_tests++;
12673 
12674     return(test_ret);
12675 }
12676 
12677 
12678 static int
test_xmlClearNodeInfoSeq(void)12679 test_xmlClearNodeInfoSeq(void) {
12680     int test_ret = 0;
12681 
12682     int mem_base;
12683     xmlParserNodeInfoSeqPtr seq; /* a node info sequence pointer */
12684     int n_seq;
12685 
12686     for (n_seq = 0;n_seq < gen_nb_xmlParserNodeInfoSeqPtr;n_seq++) {
12687         mem_base = xmlMemBlocks();
12688         seq = gen_xmlParserNodeInfoSeqPtr(n_seq, 0);
12689 
12690         xmlClearNodeInfoSeq(seq);
12691         call_tests++;
12692         des_xmlParserNodeInfoSeqPtr(n_seq, seq, 0);
12693         xmlResetLastError();
12694         if (mem_base != xmlMemBlocks()) {
12695             printf("Leak of %d blocks found in xmlClearNodeInfoSeq",
12696 	           xmlMemBlocks() - mem_base);
12697 	    test_ret++;
12698             printf(" %d", n_seq);
12699             printf("\n");
12700         }
12701     }
12702     function_tests++;
12703 
12704     return(test_ret);
12705 }
12706 
12707 
12708 static int
test_xmlClearParserCtxt(void)12709 test_xmlClearParserCtxt(void) {
12710     int test_ret = 0;
12711 
12712     int mem_base;
12713     xmlParserCtxtPtr ctxt; /* an XML parser context */
12714     int n_ctxt;
12715 
12716     for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
12717         mem_base = xmlMemBlocks();
12718         ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
12719 
12720         xmlClearParserCtxt(ctxt);
12721         call_tests++;
12722         des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
12723         xmlResetLastError();
12724         if (mem_base != xmlMemBlocks()) {
12725             printf("Leak of %d blocks found in xmlClearParserCtxt",
12726 	           xmlMemBlocks() - mem_base);
12727 	    test_ret++;
12728             printf(" %d", n_ctxt);
12729             printf("\n");
12730         }
12731     }
12732     function_tests++;
12733 
12734     return(test_ret);
12735 }
12736 
12737 
12738 static int
test_xmlCreateDocParserCtxt(void)12739 test_xmlCreateDocParserCtxt(void) {
12740     int test_ret = 0;
12741 
12742     int mem_base;
12743     xmlParserCtxtPtr ret_val;
12744     xmlChar * cur; /* a pointer to an array of xmlChar */
12745     int n_cur;
12746 
12747     for (n_cur = 0;n_cur < gen_nb_const_xmlChar_ptr;n_cur++) {
12748         mem_base = xmlMemBlocks();
12749         cur = gen_const_xmlChar_ptr(n_cur, 0);
12750 
12751         ret_val = xmlCreateDocParserCtxt((const xmlChar *)cur);
12752         desret_xmlParserCtxtPtr(ret_val);
12753         call_tests++;
12754         des_const_xmlChar_ptr(n_cur, (const xmlChar *)cur, 0);
12755         xmlResetLastError();
12756         if (mem_base != xmlMemBlocks()) {
12757             printf("Leak of %d blocks found in xmlCreateDocParserCtxt",
12758 	           xmlMemBlocks() - mem_base);
12759 	    test_ret++;
12760             printf(" %d", n_cur);
12761             printf("\n");
12762         }
12763     }
12764     function_tests++;
12765 
12766     return(test_ret);
12767 }
12768 
12769 
12770 static int
test_xmlCreatePushParserCtxt(void)12771 test_xmlCreatePushParserCtxt(void) {
12772     int test_ret = 0;
12773 
12774 #if defined(LIBXML_PUSH_ENABLED)
12775     int mem_base;
12776     xmlParserCtxtPtr ret_val;
12777     xmlSAXHandlerPtr sax; /* a SAX handler */
12778     int n_sax;
12779     void * user_data; /* The user data returned on SAX callbacks */
12780     int n_user_data;
12781     char * chunk; /* a pointer to an array of chars */
12782     int n_chunk;
12783     int size; /* number of chars in the array */
12784     int n_size;
12785     const char * filename; /* an optional file name or URI */
12786     int n_filename;
12787 
12788     for (n_sax = 0;n_sax < gen_nb_xmlSAXHandlerPtr;n_sax++) {
12789     for (n_user_data = 0;n_user_data < gen_nb_userdata;n_user_data++) {
12790     for (n_chunk = 0;n_chunk < gen_nb_const_char_ptr;n_chunk++) {
12791     for (n_size = 0;n_size < gen_nb_int;n_size++) {
12792     for (n_filename = 0;n_filename < gen_nb_fileoutput;n_filename++) {
12793         mem_base = xmlMemBlocks();
12794         sax = gen_xmlSAXHandlerPtr(n_sax, 0);
12795         user_data = gen_userdata(n_user_data, 1);
12796         chunk = gen_const_char_ptr(n_chunk, 2);
12797         size = gen_int(n_size, 3);
12798         filename = gen_fileoutput(n_filename, 4);
12799         if ((chunk != NULL) &&
12800             (size > (int) strlen((const char *) chunk) + 1))
12801             continue;
12802 
12803         ret_val = xmlCreatePushParserCtxt(sax, user_data, (const char *)chunk, size, filename);
12804         desret_xmlParserCtxtPtr(ret_val);
12805         call_tests++;
12806         des_xmlSAXHandlerPtr(n_sax, sax, 0);
12807         des_userdata(n_user_data, user_data, 1);
12808         des_const_char_ptr(n_chunk, (const char *)chunk, 2);
12809         des_int(n_size, size, 3);
12810         des_fileoutput(n_filename, filename, 4);
12811         xmlResetLastError();
12812         if (mem_base != xmlMemBlocks()) {
12813             printf("Leak of %d blocks found in xmlCreatePushParserCtxt",
12814 	           xmlMemBlocks() - mem_base);
12815 	    test_ret++;
12816             printf(" %d", n_sax);
12817             printf(" %d", n_user_data);
12818             printf(" %d", n_chunk);
12819             printf(" %d", n_size);
12820             printf(" %d", n_filename);
12821             printf("\n");
12822         }
12823     }
12824     }
12825     }
12826     }
12827     }
12828     function_tests++;
12829 #endif
12830 
12831     return(test_ret);
12832 }
12833 
12834 
12835 static int
test_xmlCtxtReadDoc(void)12836 test_xmlCtxtReadDoc(void) {
12837     int test_ret = 0;
12838 
12839     int mem_base;
12840     xmlDocPtr ret_val;
12841     xmlParserCtxtPtr ctxt; /* an XML parser context */
12842     int n_ctxt;
12843     xmlChar * cur; /* a pointer to a zero terminated string */
12844     int n_cur;
12845     const char * URL; /* the base URL to use for the document */
12846     int n_URL;
12847     char * encoding; /* the document encoding, or NULL */
12848     int n_encoding;
12849     int options; /* a combination of xmlParserOption */
12850     int n_options;
12851 
12852     for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
12853     for (n_cur = 0;n_cur < gen_nb_const_xmlChar_ptr;n_cur++) {
12854     for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) {
12855     for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
12856     for (n_options = 0;n_options < gen_nb_parseroptions;n_options++) {
12857         mem_base = xmlMemBlocks();
12858         ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
12859         cur = gen_const_xmlChar_ptr(n_cur, 1);
12860         URL = gen_filepath(n_URL, 2);
12861         encoding = gen_const_char_ptr(n_encoding, 3);
12862         options = gen_parseroptions(n_options, 4);
12863 
12864         ret_val = xmlCtxtReadDoc(ctxt, (const xmlChar *)cur, URL, (const char *)encoding, options);
12865         desret_xmlDocPtr(ret_val);
12866         call_tests++;
12867         des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
12868         des_const_xmlChar_ptr(n_cur, (const xmlChar *)cur, 1);
12869         des_filepath(n_URL, URL, 2);
12870         des_const_char_ptr(n_encoding, (const char *)encoding, 3);
12871         des_parseroptions(n_options, options, 4);
12872         xmlResetLastError();
12873         if (mem_base != xmlMemBlocks()) {
12874             printf("Leak of %d blocks found in xmlCtxtReadDoc",
12875 	           xmlMemBlocks() - mem_base);
12876 	    test_ret++;
12877             printf(" %d", n_ctxt);
12878             printf(" %d", n_cur);
12879             printf(" %d", n_URL);
12880             printf(" %d", n_encoding);
12881             printf(" %d", n_options);
12882             printf("\n");
12883         }
12884     }
12885     }
12886     }
12887     }
12888     }
12889     function_tests++;
12890 
12891     return(test_ret);
12892 }
12893 
12894 
12895 static int
test_xmlCtxtReadFile(void)12896 test_xmlCtxtReadFile(void) {
12897     int test_ret = 0;
12898 
12899     int mem_base;
12900     xmlDocPtr ret_val;
12901     xmlParserCtxtPtr ctxt; /* an XML parser context */
12902     int n_ctxt;
12903     const char * filename; /* a file or URL */
12904     int n_filename;
12905     char * encoding; /* the document encoding, or NULL */
12906     int n_encoding;
12907     int options; /* a combination of xmlParserOption */
12908     int n_options;
12909 
12910     for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
12911     for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
12912     for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
12913     for (n_options = 0;n_options < gen_nb_parseroptions;n_options++) {
12914         mem_base = xmlMemBlocks();
12915         ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
12916         filename = gen_filepath(n_filename, 1);
12917         encoding = gen_const_char_ptr(n_encoding, 2);
12918         options = gen_parseroptions(n_options, 3);
12919 
12920         ret_val = xmlCtxtReadFile(ctxt, filename, (const char *)encoding, options);
12921         desret_xmlDocPtr(ret_val);
12922         call_tests++;
12923         des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
12924         des_filepath(n_filename, filename, 1);
12925         des_const_char_ptr(n_encoding, (const char *)encoding, 2);
12926         des_parseroptions(n_options, options, 3);
12927         xmlResetLastError();
12928         if (mem_base != xmlMemBlocks()) {
12929             printf("Leak of %d blocks found in xmlCtxtReadFile",
12930 	           xmlMemBlocks() - mem_base);
12931 	    test_ret++;
12932             printf(" %d", n_ctxt);
12933             printf(" %d", n_filename);
12934             printf(" %d", n_encoding);
12935             printf(" %d", n_options);
12936             printf("\n");
12937         }
12938     }
12939     }
12940     }
12941     }
12942     function_tests++;
12943 
12944     return(test_ret);
12945 }
12946 
12947 
12948 static int
test_xmlCtxtReadMemory(void)12949 test_xmlCtxtReadMemory(void) {
12950     int test_ret = 0;
12951 
12952     int mem_base;
12953     xmlDocPtr ret_val;
12954     xmlParserCtxtPtr ctxt; /* an XML parser context */
12955     int n_ctxt;
12956     char * buffer; /* a pointer to a char array */
12957     int n_buffer;
12958     int size; /* the size of the array */
12959     int n_size;
12960     const char * URL; /* the base URL to use for the document */
12961     int n_URL;
12962     char * encoding; /* the document encoding, or NULL */
12963     int n_encoding;
12964     int options; /* a combination of xmlParserOption */
12965     int n_options;
12966 
12967     for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
12968     for (n_buffer = 0;n_buffer < gen_nb_const_char_ptr;n_buffer++) {
12969     for (n_size = 0;n_size < gen_nb_int;n_size++) {
12970     for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) {
12971     for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
12972     for (n_options = 0;n_options < gen_nb_parseroptions;n_options++) {
12973         mem_base = xmlMemBlocks();
12974         ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
12975         buffer = gen_const_char_ptr(n_buffer, 1);
12976         size = gen_int(n_size, 2);
12977         URL = gen_filepath(n_URL, 3);
12978         encoding = gen_const_char_ptr(n_encoding, 4);
12979         options = gen_parseroptions(n_options, 5);
12980         if ((buffer != NULL) &&
12981             (size > (int) strlen((const char *) buffer) + 1))
12982             continue;
12983 
12984         ret_val = xmlCtxtReadMemory(ctxt, (const char *)buffer, size, URL, (const char *)encoding, options);
12985         desret_xmlDocPtr(ret_val);
12986         call_tests++;
12987         des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
12988         des_const_char_ptr(n_buffer, (const char *)buffer, 1);
12989         des_int(n_size, size, 2);
12990         des_filepath(n_URL, URL, 3);
12991         des_const_char_ptr(n_encoding, (const char *)encoding, 4);
12992         des_parseroptions(n_options, options, 5);
12993         xmlResetLastError();
12994         if (mem_base != xmlMemBlocks()) {
12995             printf("Leak of %d blocks found in xmlCtxtReadMemory",
12996 	           xmlMemBlocks() - mem_base);
12997 	    test_ret++;
12998             printf(" %d", n_ctxt);
12999             printf(" %d", n_buffer);
13000             printf(" %d", n_size);
13001             printf(" %d", n_URL);
13002             printf(" %d", n_encoding);
13003             printf(" %d", n_options);
13004             printf("\n");
13005         }
13006     }
13007     }
13008     }
13009     }
13010     }
13011     }
13012     function_tests++;
13013 
13014     return(test_ret);
13015 }
13016 
13017 
13018 static int
test_xmlCtxtReset(void)13019 test_xmlCtxtReset(void) {
13020     int test_ret = 0;
13021 
13022     int mem_base;
13023     xmlParserCtxtPtr ctxt; /* an XML parser context */
13024     int n_ctxt;
13025 
13026     for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
13027         mem_base = xmlMemBlocks();
13028         ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
13029 
13030         xmlCtxtReset(ctxt);
13031         call_tests++;
13032         des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
13033         xmlResetLastError();
13034         if (mem_base != xmlMemBlocks()) {
13035             printf("Leak of %d blocks found in xmlCtxtReset",
13036 	           xmlMemBlocks() - mem_base);
13037 	    test_ret++;
13038             printf(" %d", n_ctxt);
13039             printf("\n");
13040         }
13041     }
13042     function_tests++;
13043 
13044     return(test_ret);
13045 }
13046 
13047 
13048 static int
test_xmlCtxtResetPush(void)13049 test_xmlCtxtResetPush(void) {
13050     int test_ret = 0;
13051 
13052     int mem_base;
13053     int ret_val;
13054     xmlParserCtxtPtr ctxt; /* an XML parser context */
13055     int n_ctxt;
13056     char * chunk; /* a pointer to an array of chars */
13057     int n_chunk;
13058     int size; /* number of chars in the array */
13059     int n_size;
13060     const char * filename; /* an optional file name or URI */
13061     int n_filename;
13062     char * encoding; /* the document encoding, or NULL */
13063     int n_encoding;
13064 
13065     for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
13066     for (n_chunk = 0;n_chunk < gen_nb_const_char_ptr;n_chunk++) {
13067     for (n_size = 0;n_size < gen_nb_int;n_size++) {
13068     for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
13069     for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
13070         mem_base = xmlMemBlocks();
13071         ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
13072         chunk = gen_const_char_ptr(n_chunk, 1);
13073         size = gen_int(n_size, 2);
13074         filename = gen_filepath(n_filename, 3);
13075         encoding = gen_const_char_ptr(n_encoding, 4);
13076         if ((chunk != NULL) &&
13077             (size > (int) strlen((const char *) chunk) + 1))
13078             continue;
13079 
13080         ret_val = xmlCtxtResetPush(ctxt, (const char *)chunk, size, filename, (const char *)encoding);
13081         desret_int(ret_val);
13082         call_tests++;
13083         des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
13084         des_const_char_ptr(n_chunk, (const char *)chunk, 1);
13085         des_int(n_size, size, 2);
13086         des_filepath(n_filename, filename, 3);
13087         des_const_char_ptr(n_encoding, (const char *)encoding, 4);
13088         xmlResetLastError();
13089         if (mem_base != xmlMemBlocks()) {
13090             printf("Leak of %d blocks found in xmlCtxtResetPush",
13091 	           xmlMemBlocks() - mem_base);
13092 	    test_ret++;
13093             printf(" %d", n_ctxt);
13094             printf(" %d", n_chunk);
13095             printf(" %d", n_size);
13096             printf(" %d", n_filename);
13097             printf(" %d", n_encoding);
13098             printf("\n");
13099         }
13100     }
13101     }
13102     }
13103     }
13104     }
13105     function_tests++;
13106 
13107     return(test_ret);
13108 }
13109 
13110 
13111 static int
test_xmlCtxtUseOptions(void)13112 test_xmlCtxtUseOptions(void) {
13113     int test_ret = 0;
13114 
13115     int mem_base;
13116     int ret_val;
13117     xmlParserCtxtPtr ctxt; /* an XML parser context */
13118     int n_ctxt;
13119     int options; /* a combination of xmlParserOption */
13120     int n_options;
13121 
13122     for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
13123     for (n_options = 0;n_options < gen_nb_parseroptions;n_options++) {
13124         mem_base = xmlMemBlocks();
13125         ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
13126         options = gen_parseroptions(n_options, 1);
13127 
13128         ret_val = xmlCtxtUseOptions(ctxt, options);
13129         desret_int(ret_val);
13130         call_tests++;
13131         des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
13132         des_parseroptions(n_options, options, 1);
13133         xmlResetLastError();
13134         if (mem_base != xmlMemBlocks()) {
13135             printf("Leak of %d blocks found in xmlCtxtUseOptions",
13136 	           xmlMemBlocks() - mem_base);
13137 	    test_ret++;
13138             printf(" %d", n_ctxt);
13139             printf(" %d", n_options);
13140             printf("\n");
13141         }
13142     }
13143     }
13144     function_tests++;
13145 
13146     return(test_ret);
13147 }
13148 
13149 
13150 static int
test_xmlGetExternalEntityLoader(void)13151 test_xmlGetExternalEntityLoader(void) {
13152     int test_ret = 0;
13153 
13154 
13155     /* missing type support */
13156     return(test_ret);
13157 }
13158 
13159 
13160 static int
test_xmlGetFeature(void)13161 test_xmlGetFeature(void) {
13162     int test_ret = 0;
13163 
13164 #if defined(LIBXML_LEGACY_ENABLED)
13165 #ifdef LIBXML_LEGACY_ENABLED
13166     int mem_base;
13167     int ret_val;
13168     xmlParserCtxtPtr ctxt; /* an XML/HTML parser context */
13169     int n_ctxt;
13170     char * name; /* the feature name */
13171     int n_name;
13172     void * result; /* location to store the result */
13173     int n_result;
13174 
13175     for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
13176     for (n_name = 0;n_name < gen_nb_const_char_ptr;n_name++) {
13177     for (n_result = 0;n_result < gen_nb_void_ptr;n_result++) {
13178         mem_base = xmlMemBlocks();
13179         ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
13180         name = gen_const_char_ptr(n_name, 1);
13181         result = gen_void_ptr(n_result, 2);
13182 
13183         ret_val = xmlGetFeature(ctxt, (const char *)name, result);
13184         desret_int(ret_val);
13185         call_tests++;
13186         des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
13187         des_const_char_ptr(n_name, (const char *)name, 1);
13188         des_void_ptr(n_result, result, 2);
13189         xmlResetLastError();
13190         if (mem_base != xmlMemBlocks()) {
13191             printf("Leak of %d blocks found in xmlGetFeature",
13192 	           xmlMemBlocks() - mem_base);
13193 	    test_ret++;
13194             printf(" %d", n_ctxt);
13195             printf(" %d", n_name);
13196             printf(" %d", n_result);
13197             printf("\n");
13198         }
13199     }
13200     }
13201     }
13202     function_tests++;
13203 #endif
13204 #endif
13205 
13206     return(test_ret);
13207 }
13208 
13209 
13210 #define gen_nb_const_char_ptr_ptr 1
gen_const_char_ptr_ptr(int no ATTRIBUTE_UNUSED,int nr ATTRIBUTE_UNUSED)13211 static char ** gen_const_char_ptr_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
13212     return(NULL);
13213 }
des_const_char_ptr_ptr(int no ATTRIBUTE_UNUSED,const char ** val ATTRIBUTE_UNUSED,int nr ATTRIBUTE_UNUSED)13214 static void des_const_char_ptr_ptr(int no ATTRIBUTE_UNUSED, const char ** val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
13215 }
13216 
13217 static int
test_xmlGetFeaturesList(void)13218 test_xmlGetFeaturesList(void) {
13219     int test_ret = 0;
13220 
13221 #if defined(LIBXML_LEGACY_ENABLED)
13222 #ifdef LIBXML_LEGACY_ENABLED
13223     int mem_base;
13224     int ret_val;
13225     int * len; /* the length of the features name array (input/output) */
13226     int n_len;
13227     char ** result; /* an array of string to be filled with the features name. */
13228     int n_result;
13229 
13230     for (n_len = 0;n_len < gen_nb_int_ptr;n_len++) {
13231     for (n_result = 0;n_result < gen_nb_const_char_ptr_ptr;n_result++) {
13232         mem_base = xmlMemBlocks();
13233         len = gen_int_ptr(n_len, 0);
13234         result = gen_const_char_ptr_ptr(n_result, 1);
13235 
13236         ret_val = xmlGetFeaturesList(len, (const char **)result);
13237         desret_int(ret_val);
13238         call_tests++;
13239         des_int_ptr(n_len, len, 0);
13240         des_const_char_ptr_ptr(n_result, (const char **)result, 1);
13241         xmlResetLastError();
13242         if (mem_base != xmlMemBlocks()) {
13243             printf("Leak of %d blocks found in xmlGetFeaturesList",
13244 	           xmlMemBlocks() - mem_base);
13245 	    test_ret++;
13246             printf(" %d", n_len);
13247             printf(" %d", n_result);
13248             printf("\n");
13249         }
13250     }
13251     }
13252     function_tests++;
13253 #endif
13254 #endif
13255 
13256     return(test_ret);
13257 }
13258 
13259 
13260 static int
test_xmlHasFeature(void)13261 test_xmlHasFeature(void) {
13262     int test_ret = 0;
13263 
13264     int mem_base;
13265     int ret_val;
13266     xmlFeature feature; /* the feature to be examined */
13267     int n_feature;
13268 
13269     for (n_feature = 0;n_feature < gen_nb_xmlFeature;n_feature++) {
13270         mem_base = xmlMemBlocks();
13271         feature = gen_xmlFeature(n_feature, 0);
13272 
13273         ret_val = xmlHasFeature(feature);
13274         desret_int(ret_val);
13275         call_tests++;
13276         des_xmlFeature(n_feature, feature, 0);
13277         xmlResetLastError();
13278         if (mem_base != xmlMemBlocks()) {
13279             printf("Leak of %d blocks found in xmlHasFeature",
13280 	           xmlMemBlocks() - mem_base);
13281 	    test_ret++;
13282             printf(" %d", n_feature);
13283             printf("\n");
13284         }
13285     }
13286     function_tests++;
13287 
13288     return(test_ret);
13289 }
13290 
13291 
13292 static int
test_xmlIOParseDTD(void)13293 test_xmlIOParseDTD(void) {
13294     int test_ret = 0;
13295 
13296 #if defined(LIBXML_VALID_ENABLED)
13297 #ifdef LIBXML_VALID_ENABLED
13298     xmlDtdPtr ret_val;
13299     xmlSAXHandlerPtr sax; /* the SAX handler block or NULL */
13300     int n_sax;
13301     xmlParserInputBufferPtr input; /* an Input Buffer */
13302     int n_input;
13303     xmlCharEncoding enc; /* the charset encoding if known */
13304     int n_enc;
13305 
13306     for (n_sax = 0;n_sax < gen_nb_xmlSAXHandlerPtr;n_sax++) {
13307     for (n_input = 0;n_input < gen_nb_xmlParserInputBufferPtr;n_input++) {
13308     for (n_enc = 0;n_enc < gen_nb_xmlCharEncoding;n_enc++) {
13309         sax = gen_xmlSAXHandlerPtr(n_sax, 0);
13310         input = gen_xmlParserInputBufferPtr(n_input, 1);
13311         enc = gen_xmlCharEncoding(n_enc, 2);
13312 
13313         ret_val = xmlIOParseDTD(sax, input, enc);
13314         input = NULL;
13315         desret_xmlDtdPtr(ret_val);
13316         call_tests++;
13317         des_xmlSAXHandlerPtr(n_sax, sax, 0);
13318         des_xmlParserInputBufferPtr(n_input, input, 1);
13319         des_xmlCharEncoding(n_enc, enc, 2);
13320         xmlResetLastError();
13321     }
13322     }
13323     }
13324     function_tests++;
13325 #endif
13326 #endif
13327 
13328     return(test_ret);
13329 }
13330 
13331 
13332 static int
test_xmlInitNodeInfoSeq(void)13333 test_xmlInitNodeInfoSeq(void) {
13334     int test_ret = 0;
13335 
13336     int mem_base;
13337     xmlParserNodeInfoSeqPtr seq; /* a node info sequence pointer */
13338     int n_seq;
13339 
13340     for (n_seq = 0;n_seq < gen_nb_xmlParserNodeInfoSeqPtr;n_seq++) {
13341         mem_base = xmlMemBlocks();
13342         seq = gen_xmlParserNodeInfoSeqPtr(n_seq, 0);
13343 
13344         xmlInitNodeInfoSeq(seq);
13345         call_tests++;
13346         des_xmlParserNodeInfoSeqPtr(n_seq, seq, 0);
13347         xmlResetLastError();
13348         if (mem_base != xmlMemBlocks()) {
13349             printf("Leak of %d blocks found in xmlInitNodeInfoSeq",
13350 	           xmlMemBlocks() - mem_base);
13351 	    test_ret++;
13352             printf(" %d", n_seq);
13353             printf("\n");
13354         }
13355     }
13356     function_tests++;
13357 
13358     return(test_ret);
13359 }
13360 
13361 
13362 static int
test_xmlInitParser(void)13363 test_xmlInitParser(void) {
13364     int test_ret = 0;
13365 
13366     int mem_base;
13367 
13368         mem_base = xmlMemBlocks();
13369 
13370         xmlInitParser();
13371         call_tests++;
13372         xmlResetLastError();
13373         if (mem_base != xmlMemBlocks()) {
13374             printf("Leak of %d blocks found in xmlInitParser",
13375 	           xmlMemBlocks() - mem_base);
13376 	    test_ret++;
13377             printf("\n");
13378         }
13379     function_tests++;
13380 
13381     return(test_ret);
13382 }
13383 
13384 
13385 static int
test_xmlInitParserCtxt(void)13386 test_xmlInitParserCtxt(void) {
13387     int test_ret = 0;
13388 
13389     int mem_base;
13390     int ret_val;
13391     xmlParserCtxtPtr ctxt; /* an XML parser context */
13392     int n_ctxt;
13393 
13394     for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
13395         mem_base = xmlMemBlocks();
13396         ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
13397 
13398         ret_val = xmlInitParserCtxt(ctxt);
13399         desret_int(ret_val);
13400         call_tests++;
13401         des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
13402         xmlResetLastError();
13403         if (mem_base != xmlMemBlocks()) {
13404             printf("Leak of %d blocks found in xmlInitParserCtxt",
13405 	           xmlMemBlocks() - mem_base);
13406 	    test_ret++;
13407             printf(" %d", n_ctxt);
13408             printf("\n");
13409         }
13410     }
13411     function_tests++;
13412 
13413     return(test_ret);
13414 }
13415 
13416 
13417 static int
test_xmlKeepBlanksDefault(void)13418 test_xmlKeepBlanksDefault(void) {
13419     int test_ret = 0;
13420 
13421     int mem_base;
13422     int ret_val;
13423     int val; /* int 0 or 1 */
13424     int n_val;
13425 
13426     for (n_val = 0;n_val < gen_nb_int;n_val++) {
13427         mem_base = xmlMemBlocks();
13428         val = gen_int(n_val, 0);
13429 
13430         ret_val = xmlKeepBlanksDefault(val);
13431         desret_int(ret_val);
13432         call_tests++;
13433         des_int(n_val, val, 0);
13434         xmlResetLastError();
13435         if (mem_base != xmlMemBlocks()) {
13436             printf("Leak of %d blocks found in xmlKeepBlanksDefault",
13437 	           xmlMemBlocks() - mem_base);
13438 	    test_ret++;
13439             printf(" %d", n_val);
13440             printf("\n");
13441         }
13442     }
13443     function_tests++;
13444 
13445     return(test_ret);
13446 }
13447 
13448 
13449 static int
test_xmlLineNumbersDefault(void)13450 test_xmlLineNumbersDefault(void) {
13451     int test_ret = 0;
13452 
13453     int mem_base;
13454     int ret_val;
13455     int val; /* int 0 or 1 */
13456     int n_val;
13457 
13458     for (n_val = 0;n_val < gen_nb_int;n_val++) {
13459         mem_base = xmlMemBlocks();
13460         val = gen_int(n_val, 0);
13461 
13462         ret_val = xmlLineNumbersDefault(val);
13463         desret_int(ret_val);
13464         call_tests++;
13465         des_int(n_val, val, 0);
13466         xmlResetLastError();
13467         if (mem_base != xmlMemBlocks()) {
13468             printf("Leak of %d blocks found in xmlLineNumbersDefault",
13469 	           xmlMemBlocks() - mem_base);
13470 	    test_ret++;
13471             printf(" %d", n_val);
13472             printf("\n");
13473         }
13474     }
13475     function_tests++;
13476 
13477     return(test_ret);
13478 }
13479 
13480 
13481 static int
test_xmlLoadExternalEntity(void)13482 test_xmlLoadExternalEntity(void) {
13483     int test_ret = 0;
13484 
13485     int mem_base;
13486     xmlParserInputPtr ret_val;
13487     const char * URL; /* the URL for the entity to load */
13488     int n_URL;
13489     char * ID; /* the Public ID for the entity to load */
13490     int n_ID;
13491     xmlParserCtxtPtr ctxt; /* the context in which the entity is called or NULL */
13492     int n_ctxt;
13493 
13494     for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) {
13495     for (n_ID = 0;n_ID < gen_nb_const_char_ptr;n_ID++) {
13496     for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
13497         mem_base = xmlMemBlocks();
13498         URL = gen_filepath(n_URL, 0);
13499         ID = gen_const_char_ptr(n_ID, 1);
13500         ctxt = gen_xmlParserCtxtPtr(n_ctxt, 2);
13501 
13502         ret_val = xmlLoadExternalEntity(URL, (const char *)ID, ctxt);
13503         desret_xmlParserInputPtr(ret_val);
13504         call_tests++;
13505         des_filepath(n_URL, URL, 0);
13506         des_const_char_ptr(n_ID, (const char *)ID, 1);
13507         des_xmlParserCtxtPtr(n_ctxt, ctxt, 2);
13508         xmlResetLastError();
13509         if (mem_base != xmlMemBlocks()) {
13510             printf("Leak of %d blocks found in xmlLoadExternalEntity",
13511 	           xmlMemBlocks() - mem_base);
13512 	    test_ret++;
13513             printf(" %d", n_URL);
13514             printf(" %d", n_ID);
13515             printf(" %d", n_ctxt);
13516             printf("\n");
13517         }
13518     }
13519     }
13520     }
13521     function_tests++;
13522 
13523     return(test_ret);
13524 }
13525 
13526 
13527 static int
test_xmlNewIOInputStream(void)13528 test_xmlNewIOInputStream(void) {
13529     int test_ret = 0;
13530 
13531     int mem_base;
13532     xmlParserInputPtr ret_val;
13533     xmlParserCtxtPtr ctxt; /* an XML parser context */
13534     int n_ctxt;
13535     xmlParserInputBufferPtr input; /* an I/O Input */
13536     int n_input;
13537     xmlCharEncoding enc; /* the charset encoding if known */
13538     int n_enc;
13539 
13540     for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
13541     for (n_input = 0;n_input < gen_nb_xmlParserInputBufferPtr;n_input++) {
13542     for (n_enc = 0;n_enc < gen_nb_xmlCharEncoding;n_enc++) {
13543         mem_base = xmlMemBlocks();
13544         ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
13545         input = gen_xmlParserInputBufferPtr(n_input, 1);
13546         enc = gen_xmlCharEncoding(n_enc, 2);
13547 
13548         ret_val = xmlNewIOInputStream(ctxt, input, enc);
13549         if (ret_val != NULL) input = NULL;
13550         desret_xmlParserInputPtr(ret_val);
13551         call_tests++;
13552         des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
13553         des_xmlParserInputBufferPtr(n_input, input, 1);
13554         des_xmlCharEncoding(n_enc, enc, 2);
13555         xmlResetLastError();
13556         if (mem_base != xmlMemBlocks()) {
13557             printf("Leak of %d blocks found in xmlNewIOInputStream",
13558 	           xmlMemBlocks() - mem_base);
13559 	    test_ret++;
13560             printf(" %d", n_ctxt);
13561             printf(" %d", n_input);
13562             printf(" %d", n_enc);
13563             printf("\n");
13564         }
13565     }
13566     }
13567     }
13568     function_tests++;
13569 
13570     return(test_ret);
13571 }
13572 
13573 
13574 static int
test_xmlNewParserCtxt(void)13575 test_xmlNewParserCtxt(void) {
13576     int test_ret = 0;
13577 
13578     int mem_base;
13579     xmlParserCtxtPtr ret_val;
13580 
13581         mem_base = xmlMemBlocks();
13582 
13583         ret_val = xmlNewParserCtxt();
13584         desret_xmlParserCtxtPtr(ret_val);
13585         call_tests++;
13586         xmlResetLastError();
13587         if (mem_base != xmlMemBlocks()) {
13588             printf("Leak of %d blocks found in xmlNewParserCtxt",
13589 	           xmlMemBlocks() - mem_base);
13590 	    test_ret++;
13591             printf("\n");
13592         }
13593     function_tests++;
13594 
13595     return(test_ret);
13596 }
13597 
13598 
13599 #define gen_nb_xmlNodePtr_ptr 1
gen_xmlNodePtr_ptr(int no ATTRIBUTE_UNUSED,int nr ATTRIBUTE_UNUSED)13600 static xmlNodePtr * gen_xmlNodePtr_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
13601     return(NULL);
13602 }
des_xmlNodePtr_ptr(int no ATTRIBUTE_UNUSED,xmlNodePtr * val ATTRIBUTE_UNUSED,int nr ATTRIBUTE_UNUSED)13603 static void des_xmlNodePtr_ptr(int no ATTRIBUTE_UNUSED, xmlNodePtr * val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
13604 }
13605 
13606 static int
test_xmlParseBalancedChunkMemory(void)13607 test_xmlParseBalancedChunkMemory(void) {
13608     int test_ret = 0;
13609 
13610 #if defined(LIBXML_SAX1_ENABLED)
13611 #ifdef LIBXML_SAX1_ENABLED
13612     int mem_base;
13613     int ret_val;
13614     xmlDocPtr doc; /* the document the chunk pertains to */
13615     int n_doc;
13616     xmlSAXHandlerPtr sax; /* the SAX handler bloc (possibly NULL) */
13617     int n_sax;
13618     void * user_data; /* The user data returned on SAX callbacks (possibly NULL) */
13619     int n_user_data;
13620     int depth; /* Used for loop detection, use 0 */
13621     int n_depth;
13622     xmlChar * string; /* the input string in UTF8 or ISO-Latin (zero terminated) */
13623     int n_string;
13624     xmlNodePtr * lst; /* the return value for the set of parsed nodes */
13625     int n_lst;
13626 
13627     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
13628     for (n_sax = 0;n_sax < gen_nb_xmlSAXHandlerPtr;n_sax++) {
13629     for (n_user_data = 0;n_user_data < gen_nb_userdata;n_user_data++) {
13630     for (n_depth = 0;n_depth < gen_nb_int;n_depth++) {
13631     for (n_string = 0;n_string < gen_nb_const_xmlChar_ptr;n_string++) {
13632     for (n_lst = 0;n_lst < gen_nb_xmlNodePtr_ptr;n_lst++) {
13633         mem_base = xmlMemBlocks();
13634         doc = gen_xmlDocPtr(n_doc, 0);
13635         sax = gen_xmlSAXHandlerPtr(n_sax, 1);
13636         user_data = gen_userdata(n_user_data, 2);
13637         depth = gen_int(n_depth, 3);
13638         string = gen_const_xmlChar_ptr(n_string, 4);
13639         lst = gen_xmlNodePtr_ptr(n_lst, 5);
13640 
13641 #ifdef LIBXML_SAX1_ENABLED
13642         if (sax == (xmlSAXHandlerPtr)&xmlDefaultSAXHandler) user_data = NULL;
13643 #endif
13644 
13645 
13646         ret_val = xmlParseBalancedChunkMemory(doc, sax, user_data, depth, (const xmlChar *)string, lst);
13647         desret_int(ret_val);
13648         call_tests++;
13649         des_xmlDocPtr(n_doc, doc, 0);
13650         des_xmlSAXHandlerPtr(n_sax, sax, 1);
13651         des_userdata(n_user_data, user_data, 2);
13652         des_int(n_depth, depth, 3);
13653         des_const_xmlChar_ptr(n_string, (const xmlChar *)string, 4);
13654         des_xmlNodePtr_ptr(n_lst, lst, 5);
13655         xmlResetLastError();
13656         if (mem_base != xmlMemBlocks()) {
13657             printf("Leak of %d blocks found in xmlParseBalancedChunkMemory",
13658 	           xmlMemBlocks() - mem_base);
13659 	    test_ret++;
13660             printf(" %d", n_doc);
13661             printf(" %d", n_sax);
13662             printf(" %d", n_user_data);
13663             printf(" %d", n_depth);
13664             printf(" %d", n_string);
13665             printf(" %d", n_lst);
13666             printf("\n");
13667         }
13668     }
13669     }
13670     }
13671     }
13672     }
13673     }
13674     function_tests++;
13675 #endif
13676 #endif
13677 
13678     return(test_ret);
13679 }
13680 
13681 
13682 static int
test_xmlParseBalancedChunkMemoryRecover(void)13683 test_xmlParseBalancedChunkMemoryRecover(void) {
13684     int test_ret = 0;
13685 
13686 #if defined(LIBXML_SAX1_ENABLED)
13687 #ifdef LIBXML_SAX1_ENABLED
13688     int mem_base;
13689     int ret_val;
13690     xmlDocPtr doc; /* the document the chunk pertains to */
13691     int n_doc;
13692     xmlSAXHandlerPtr sax; /* the SAX handler bloc (possibly NULL) */
13693     int n_sax;
13694     void * user_data; /* The user data returned on SAX callbacks (possibly NULL) */
13695     int n_user_data;
13696     int depth; /* Used for loop detection, use 0 */
13697     int n_depth;
13698     xmlChar * string; /* the input string in UTF8 or ISO-Latin (zero terminated) */
13699     int n_string;
13700     xmlNodePtr * lst; /* the return value for the set of parsed nodes */
13701     int n_lst;
13702     int recover; /* return nodes even if the data is broken (use 0) */
13703     int n_recover;
13704 
13705     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
13706     for (n_sax = 0;n_sax < gen_nb_xmlSAXHandlerPtr;n_sax++) {
13707     for (n_user_data = 0;n_user_data < gen_nb_userdata;n_user_data++) {
13708     for (n_depth = 0;n_depth < gen_nb_int;n_depth++) {
13709     for (n_string = 0;n_string < gen_nb_const_xmlChar_ptr;n_string++) {
13710     for (n_lst = 0;n_lst < gen_nb_xmlNodePtr_ptr;n_lst++) {
13711     for (n_recover = 0;n_recover < gen_nb_int;n_recover++) {
13712         mem_base = xmlMemBlocks();
13713         doc = gen_xmlDocPtr(n_doc, 0);
13714         sax = gen_xmlSAXHandlerPtr(n_sax, 1);
13715         user_data = gen_userdata(n_user_data, 2);
13716         depth = gen_int(n_depth, 3);
13717         string = gen_const_xmlChar_ptr(n_string, 4);
13718         lst = gen_xmlNodePtr_ptr(n_lst, 5);
13719         recover = gen_int(n_recover, 6);
13720 
13721 #ifdef LIBXML_SAX1_ENABLED
13722         if (sax == (xmlSAXHandlerPtr)&xmlDefaultSAXHandler) user_data = NULL;
13723 #endif
13724 
13725 
13726         ret_val = xmlParseBalancedChunkMemoryRecover(doc, sax, user_data, depth, (const xmlChar *)string, lst, recover);
13727         desret_int(ret_val);
13728         call_tests++;
13729         des_xmlDocPtr(n_doc, doc, 0);
13730         des_xmlSAXHandlerPtr(n_sax, sax, 1);
13731         des_userdata(n_user_data, user_data, 2);
13732         des_int(n_depth, depth, 3);
13733         des_const_xmlChar_ptr(n_string, (const xmlChar *)string, 4);
13734         des_xmlNodePtr_ptr(n_lst, lst, 5);
13735         des_int(n_recover, recover, 6);
13736         xmlResetLastError();
13737         if (mem_base != xmlMemBlocks()) {
13738             printf("Leak of %d blocks found in xmlParseBalancedChunkMemoryRecover",
13739 	           xmlMemBlocks() - mem_base);
13740 	    test_ret++;
13741             printf(" %d", n_doc);
13742             printf(" %d", n_sax);
13743             printf(" %d", n_user_data);
13744             printf(" %d", n_depth);
13745             printf(" %d", n_string);
13746             printf(" %d", n_lst);
13747             printf(" %d", n_recover);
13748             printf("\n");
13749         }
13750     }
13751     }
13752     }
13753     }
13754     }
13755     }
13756     }
13757     function_tests++;
13758 #endif
13759 #endif
13760 
13761     return(test_ret);
13762 }
13763 
13764 
13765 static int
test_xmlParseChunk(void)13766 test_xmlParseChunk(void) {
13767     int test_ret = 0;
13768 
13769 #if defined(LIBXML_PUSH_ENABLED)
13770     int mem_base;
13771     int ret_val;
13772     xmlParserCtxtPtr ctxt; /* an XML parser context */
13773     int n_ctxt;
13774     char * chunk; /* an char array */
13775     int n_chunk;
13776     int size; /* the size in byte of the chunk */
13777     int n_size;
13778     int terminate; /* last chunk indicator */
13779     int n_terminate;
13780 
13781     for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
13782     for (n_chunk = 0;n_chunk < gen_nb_const_char_ptr;n_chunk++) {
13783     for (n_size = 0;n_size < gen_nb_int;n_size++) {
13784     for (n_terminate = 0;n_terminate < gen_nb_int;n_terminate++) {
13785         mem_base = xmlMemBlocks();
13786         ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
13787         chunk = gen_const_char_ptr(n_chunk, 1);
13788         size = gen_int(n_size, 2);
13789         terminate = gen_int(n_terminate, 3);
13790         if ((chunk != NULL) &&
13791             (size > (int) strlen((const char *) chunk) + 1))
13792             continue;
13793 
13794         ret_val = xmlParseChunk(ctxt, (const char *)chunk, size, terminate);
13795         if (ctxt != NULL) {xmlFreeDoc(ctxt->myDoc); ctxt->myDoc = NULL;}
13796         desret_int(ret_val);
13797         call_tests++;
13798         des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
13799         des_const_char_ptr(n_chunk, (const char *)chunk, 1);
13800         des_int(n_size, size, 2);
13801         des_int(n_terminate, terminate, 3);
13802         xmlResetLastError();
13803         if (mem_base != xmlMemBlocks()) {
13804             printf("Leak of %d blocks found in xmlParseChunk",
13805 	           xmlMemBlocks() - mem_base);
13806 	    test_ret++;
13807             printf(" %d", n_ctxt);
13808             printf(" %d", n_chunk);
13809             printf(" %d", n_size);
13810             printf(" %d", n_terminate);
13811             printf("\n");
13812         }
13813     }
13814     }
13815     }
13816     }
13817     function_tests++;
13818 #endif
13819 
13820     return(test_ret);
13821 }
13822 
13823 
13824 static int
test_xmlParseCtxtExternalEntity(void)13825 test_xmlParseCtxtExternalEntity(void) {
13826     int test_ret = 0;
13827 
13828     int mem_base;
13829     int ret_val;
13830     xmlParserCtxtPtr ctx; /* the existing parsing context */
13831     int n_ctx;
13832     xmlChar * URL; /* the URL for the entity to load */
13833     int n_URL;
13834     xmlChar * ID; /* the System ID for the entity to load */
13835     int n_ID;
13836     xmlNodePtr * lst; /* the return value for the set of parsed nodes */
13837     int n_lst;
13838 
13839     for (n_ctx = 0;n_ctx < gen_nb_xmlParserCtxtPtr;n_ctx++) {
13840     for (n_URL = 0;n_URL < gen_nb_const_xmlChar_ptr;n_URL++) {
13841     for (n_ID = 0;n_ID < gen_nb_const_xmlChar_ptr;n_ID++) {
13842     for (n_lst = 0;n_lst < gen_nb_xmlNodePtr_ptr;n_lst++) {
13843         mem_base = xmlMemBlocks();
13844         ctx = gen_xmlParserCtxtPtr(n_ctx, 0);
13845         URL = gen_const_xmlChar_ptr(n_URL, 1);
13846         ID = gen_const_xmlChar_ptr(n_ID, 2);
13847         lst = gen_xmlNodePtr_ptr(n_lst, 3);
13848 
13849         ret_val = xmlParseCtxtExternalEntity(ctx, (const xmlChar *)URL, (const xmlChar *)ID, lst);
13850         desret_int(ret_val);
13851         call_tests++;
13852         des_xmlParserCtxtPtr(n_ctx, ctx, 0);
13853         des_const_xmlChar_ptr(n_URL, (const xmlChar *)URL, 1);
13854         des_const_xmlChar_ptr(n_ID, (const xmlChar *)ID, 2);
13855         des_xmlNodePtr_ptr(n_lst, lst, 3);
13856         xmlResetLastError();
13857         if (mem_base != xmlMemBlocks()) {
13858             printf("Leak of %d blocks found in xmlParseCtxtExternalEntity",
13859 	           xmlMemBlocks() - mem_base);
13860 	    test_ret++;
13861             printf(" %d", n_ctx);
13862             printf(" %d", n_URL);
13863             printf(" %d", n_ID);
13864             printf(" %d", n_lst);
13865             printf("\n");
13866         }
13867     }
13868     }
13869     }
13870     }
13871     function_tests++;
13872 
13873     return(test_ret);
13874 }
13875 
13876 
13877 static int
test_xmlParseDTD(void)13878 test_xmlParseDTD(void) {
13879     int test_ret = 0;
13880 
13881 #if defined(LIBXML_VALID_ENABLED)
13882 #ifdef LIBXML_VALID_ENABLED
13883     int mem_base;
13884     xmlDtdPtr ret_val;
13885     xmlChar * ExternalID; /* a NAME* containing the External ID of the DTD */
13886     int n_ExternalID;
13887     xmlChar * SystemID; /* a NAME* containing the URL to the DTD */
13888     int n_SystemID;
13889 
13890     for (n_ExternalID = 0;n_ExternalID < gen_nb_const_xmlChar_ptr;n_ExternalID++) {
13891     for (n_SystemID = 0;n_SystemID < gen_nb_const_xmlChar_ptr;n_SystemID++) {
13892         mem_base = xmlMemBlocks();
13893         ExternalID = gen_const_xmlChar_ptr(n_ExternalID, 0);
13894         SystemID = gen_const_xmlChar_ptr(n_SystemID, 1);
13895 
13896         ret_val = xmlParseDTD((const xmlChar *)ExternalID, (const xmlChar *)SystemID);
13897         desret_xmlDtdPtr(ret_val);
13898         call_tests++;
13899         des_const_xmlChar_ptr(n_ExternalID, (const xmlChar *)ExternalID, 0);
13900         des_const_xmlChar_ptr(n_SystemID, (const xmlChar *)SystemID, 1);
13901         xmlResetLastError();
13902         if (mem_base != xmlMemBlocks()) {
13903             printf("Leak of %d blocks found in xmlParseDTD",
13904 	           xmlMemBlocks() - mem_base);
13905 	    test_ret++;
13906             printf(" %d", n_ExternalID);
13907             printf(" %d", n_SystemID);
13908             printf("\n");
13909         }
13910     }
13911     }
13912     function_tests++;
13913 #endif
13914 #endif
13915 
13916     return(test_ret);
13917 }
13918 
13919 
13920 static int
test_xmlParseDoc(void)13921 test_xmlParseDoc(void) {
13922     int test_ret = 0;
13923 
13924 #if defined(LIBXML_SAX1_ENABLED)
13925 #ifdef LIBXML_SAX1_ENABLED
13926     int mem_base;
13927     xmlDocPtr ret_val;
13928     xmlChar * cur; /* a pointer to an array of xmlChar */
13929     int n_cur;
13930 
13931     for (n_cur = 0;n_cur < gen_nb_const_xmlChar_ptr;n_cur++) {
13932         mem_base = xmlMemBlocks();
13933         cur = gen_const_xmlChar_ptr(n_cur, 0);
13934 
13935         ret_val = xmlParseDoc((const xmlChar *)cur);
13936         desret_xmlDocPtr(ret_val);
13937         call_tests++;
13938         des_const_xmlChar_ptr(n_cur, (const xmlChar *)cur, 0);
13939         xmlResetLastError();
13940         if (mem_base != xmlMemBlocks()) {
13941             printf("Leak of %d blocks found in xmlParseDoc",
13942 	           xmlMemBlocks() - mem_base);
13943 	    test_ret++;
13944             printf(" %d", n_cur);
13945             printf("\n");
13946         }
13947     }
13948     function_tests++;
13949 #endif
13950 #endif
13951 
13952     return(test_ret);
13953 }
13954 
13955 
13956 static int
test_xmlParseDocument(void)13957 test_xmlParseDocument(void) {
13958     int test_ret = 0;
13959 
13960     int mem_base;
13961     int ret_val;
13962     xmlParserCtxtPtr ctxt; /* an XML parser context */
13963     int n_ctxt;
13964 
13965     for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
13966         mem_base = xmlMemBlocks();
13967         ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
13968 
13969         ret_val = xmlParseDocument(ctxt);
13970         if (ctxt != NULL) {xmlFreeDoc(ctxt->myDoc); ctxt->myDoc = NULL;}
13971         desret_int(ret_val);
13972         call_tests++;
13973         des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
13974         xmlResetLastError();
13975         if (mem_base != xmlMemBlocks()) {
13976             printf("Leak of %d blocks found in xmlParseDocument",
13977 	           xmlMemBlocks() - mem_base);
13978 	    test_ret++;
13979             printf(" %d", n_ctxt);
13980             printf("\n");
13981         }
13982     }
13983     function_tests++;
13984 
13985     return(test_ret);
13986 }
13987 
13988 
13989 static int
test_xmlParseEntity(void)13990 test_xmlParseEntity(void) {
13991     int test_ret = 0;
13992 
13993 #if defined(LIBXML_SAX1_ENABLED)
13994 #ifdef LIBXML_SAX1_ENABLED
13995     int mem_base;
13996     xmlDocPtr ret_val;
13997     const char * filename; /* the filename */
13998     int n_filename;
13999 
14000     for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
14001         mem_base = xmlMemBlocks();
14002         filename = gen_filepath(n_filename, 0);
14003 
14004         ret_val = xmlParseEntity(filename);
14005         desret_xmlDocPtr(ret_val);
14006         call_tests++;
14007         des_filepath(n_filename, filename, 0);
14008         xmlResetLastError();
14009         if (mem_base != xmlMemBlocks()) {
14010             printf("Leak of %d blocks found in xmlParseEntity",
14011 	           xmlMemBlocks() - mem_base);
14012 	    test_ret++;
14013             printf(" %d", n_filename);
14014             printf("\n");
14015         }
14016     }
14017     function_tests++;
14018 #endif
14019 #endif
14020 
14021     return(test_ret);
14022 }
14023 
14024 
14025 static int
test_xmlParseExtParsedEnt(void)14026 test_xmlParseExtParsedEnt(void) {
14027     int test_ret = 0;
14028 
14029     int mem_base;
14030     int ret_val;
14031     xmlParserCtxtPtr ctxt; /* an XML parser context */
14032     int n_ctxt;
14033 
14034     for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
14035         mem_base = xmlMemBlocks();
14036         ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
14037 
14038         ret_val = xmlParseExtParsedEnt(ctxt);
14039         if (ctxt != NULL) {xmlFreeDoc(ctxt->myDoc); ctxt->myDoc = NULL;}
14040         desret_int(ret_val);
14041         call_tests++;
14042         des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
14043         xmlResetLastError();
14044         if (mem_base != xmlMemBlocks()) {
14045             printf("Leak of %d blocks found in xmlParseExtParsedEnt",
14046 	           xmlMemBlocks() - mem_base);
14047 	    test_ret++;
14048             printf(" %d", n_ctxt);
14049             printf("\n");
14050         }
14051     }
14052     function_tests++;
14053 
14054     return(test_ret);
14055 }
14056 
14057 
14058 static int
test_xmlParseExternalEntity(void)14059 test_xmlParseExternalEntity(void) {
14060     int test_ret = 0;
14061 
14062 #if defined(LIBXML_SAX1_ENABLED)
14063 #ifdef LIBXML_SAX1_ENABLED
14064     int mem_base;
14065     int ret_val;
14066     xmlDocPtr doc; /* the document the chunk pertains to */
14067     int n_doc;
14068     xmlSAXHandlerPtr sax; /* the SAX handler bloc (possibly NULL) */
14069     int n_sax;
14070     void * user_data; /* The user data returned on SAX callbacks (possibly NULL) */
14071     int n_user_data;
14072     int depth; /* Used for loop detection, use 0 */
14073     int n_depth;
14074     xmlChar * URL; /* the URL for the entity to load */
14075     int n_URL;
14076     xmlChar * ID; /* the System ID for the entity to load */
14077     int n_ID;
14078     xmlNodePtr * lst; /* the return value for the set of parsed nodes */
14079     int n_lst;
14080 
14081     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
14082     for (n_sax = 0;n_sax < gen_nb_xmlSAXHandlerPtr;n_sax++) {
14083     for (n_user_data = 0;n_user_data < gen_nb_userdata;n_user_data++) {
14084     for (n_depth = 0;n_depth < gen_nb_int;n_depth++) {
14085     for (n_URL = 0;n_URL < gen_nb_const_xmlChar_ptr;n_URL++) {
14086     for (n_ID = 0;n_ID < gen_nb_const_xmlChar_ptr;n_ID++) {
14087     for (n_lst = 0;n_lst < gen_nb_xmlNodePtr_ptr;n_lst++) {
14088         mem_base = xmlMemBlocks();
14089         doc = gen_xmlDocPtr(n_doc, 0);
14090         sax = gen_xmlSAXHandlerPtr(n_sax, 1);
14091         user_data = gen_userdata(n_user_data, 2);
14092         depth = gen_int(n_depth, 3);
14093         URL = gen_const_xmlChar_ptr(n_URL, 4);
14094         ID = gen_const_xmlChar_ptr(n_ID, 5);
14095         lst = gen_xmlNodePtr_ptr(n_lst, 6);
14096 
14097         ret_val = xmlParseExternalEntity(doc, sax, user_data, depth, (const xmlChar *)URL, (const xmlChar *)ID, lst);
14098         desret_int(ret_val);
14099         call_tests++;
14100         des_xmlDocPtr(n_doc, doc, 0);
14101         des_xmlSAXHandlerPtr(n_sax, sax, 1);
14102         des_userdata(n_user_data, user_data, 2);
14103         des_int(n_depth, depth, 3);
14104         des_const_xmlChar_ptr(n_URL, (const xmlChar *)URL, 4);
14105         des_const_xmlChar_ptr(n_ID, (const xmlChar *)ID, 5);
14106         des_xmlNodePtr_ptr(n_lst, lst, 6);
14107         xmlResetLastError();
14108         if (mem_base != xmlMemBlocks()) {
14109             printf("Leak of %d blocks found in xmlParseExternalEntity",
14110 	           xmlMemBlocks() - mem_base);
14111 	    test_ret++;
14112             printf(" %d", n_doc);
14113             printf(" %d", n_sax);
14114             printf(" %d", n_user_data);
14115             printf(" %d", n_depth);
14116             printf(" %d", n_URL);
14117             printf(" %d", n_ID);
14118             printf(" %d", n_lst);
14119             printf("\n");
14120         }
14121     }
14122     }
14123     }
14124     }
14125     }
14126     }
14127     }
14128     function_tests++;
14129 #endif
14130 #endif
14131 
14132     return(test_ret);
14133 }
14134 
14135 
14136 static int
test_xmlParseFile(void)14137 test_xmlParseFile(void) {
14138     int test_ret = 0;
14139 
14140 #if defined(LIBXML_SAX1_ENABLED)
14141 #ifdef LIBXML_SAX1_ENABLED
14142     int mem_base;
14143     xmlDocPtr ret_val;
14144     const char * filename; /* the filename */
14145     int n_filename;
14146 
14147     for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
14148         mem_base = xmlMemBlocks();
14149         filename = gen_filepath(n_filename, 0);
14150 
14151         ret_val = xmlParseFile(filename);
14152         desret_xmlDocPtr(ret_val);
14153         call_tests++;
14154         des_filepath(n_filename, filename, 0);
14155         xmlResetLastError();
14156         if (mem_base != xmlMemBlocks()) {
14157             printf("Leak of %d blocks found in xmlParseFile",
14158 	           xmlMemBlocks() - mem_base);
14159 	    test_ret++;
14160             printf(" %d", n_filename);
14161             printf("\n");
14162         }
14163     }
14164     function_tests++;
14165 #endif
14166 #endif
14167 
14168     return(test_ret);
14169 }
14170 
14171 
14172 static int
test_xmlParseInNodeContext(void)14173 test_xmlParseInNodeContext(void) {
14174     int test_ret = 0;
14175 
14176     int mem_base;
14177     xmlParserErrors ret_val;
14178     xmlNodePtr node; /* the context node */
14179     int n_node;
14180     char * data; /* the input string */
14181     int n_data;
14182     int datalen; /* the input string length in bytes */
14183     int n_datalen;
14184     int options; /* a combination of xmlParserOption */
14185     int n_options;
14186     xmlNodePtr * lst; /* the return value for the set of parsed nodes */
14187     int n_lst;
14188 
14189     for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
14190     for (n_data = 0;n_data < gen_nb_const_char_ptr;n_data++) {
14191     for (n_datalen = 0;n_datalen < gen_nb_int;n_datalen++) {
14192     for (n_options = 0;n_options < gen_nb_parseroptions;n_options++) {
14193     for (n_lst = 0;n_lst < gen_nb_xmlNodePtr_ptr;n_lst++) {
14194         mem_base = xmlMemBlocks();
14195         node = gen_xmlNodePtr(n_node, 0);
14196         data = gen_const_char_ptr(n_data, 1);
14197         datalen = gen_int(n_datalen, 2);
14198         options = gen_parseroptions(n_options, 3);
14199         lst = gen_xmlNodePtr_ptr(n_lst, 4);
14200 
14201         ret_val = xmlParseInNodeContext(node, (const char *)data, datalen, options, lst);
14202         desret_xmlParserErrors(ret_val);
14203         call_tests++;
14204         des_xmlNodePtr(n_node, node, 0);
14205         des_const_char_ptr(n_data, (const char *)data, 1);
14206         des_int(n_datalen, datalen, 2);
14207         des_parseroptions(n_options, options, 3);
14208         des_xmlNodePtr_ptr(n_lst, lst, 4);
14209         xmlResetLastError();
14210         if (mem_base != xmlMemBlocks()) {
14211             printf("Leak of %d blocks found in xmlParseInNodeContext",
14212 	           xmlMemBlocks() - mem_base);
14213 	    test_ret++;
14214             printf(" %d", n_node);
14215             printf(" %d", n_data);
14216             printf(" %d", n_datalen);
14217             printf(" %d", n_options);
14218             printf(" %d", n_lst);
14219             printf("\n");
14220         }
14221     }
14222     }
14223     }
14224     }
14225     }
14226     function_tests++;
14227 
14228     return(test_ret);
14229 }
14230 
14231 
14232 static int
test_xmlParseMemory(void)14233 test_xmlParseMemory(void) {
14234     int test_ret = 0;
14235 
14236 #if defined(LIBXML_SAX1_ENABLED)
14237 #ifdef LIBXML_SAX1_ENABLED
14238     int mem_base;
14239     xmlDocPtr ret_val;
14240     char * buffer; /* an pointer to a char array */
14241     int n_buffer;
14242     int size; /* the size of the array */
14243     int n_size;
14244 
14245     for (n_buffer = 0;n_buffer < gen_nb_const_char_ptr;n_buffer++) {
14246     for (n_size = 0;n_size < gen_nb_int;n_size++) {
14247         mem_base = xmlMemBlocks();
14248         buffer = gen_const_char_ptr(n_buffer, 0);
14249         size = gen_int(n_size, 1);
14250         if ((buffer != NULL) &&
14251             (size > (int) strlen((const char *) buffer) + 1))
14252             continue;
14253 
14254         ret_val = xmlParseMemory((const char *)buffer, size);
14255         desret_xmlDocPtr(ret_val);
14256         call_tests++;
14257         des_const_char_ptr(n_buffer, (const char *)buffer, 0);
14258         des_int(n_size, size, 1);
14259         xmlResetLastError();
14260         if (mem_base != xmlMemBlocks()) {
14261             printf("Leak of %d blocks found in xmlParseMemory",
14262 	           xmlMemBlocks() - mem_base);
14263 	    test_ret++;
14264             printf(" %d", n_buffer);
14265             printf(" %d", n_size);
14266             printf("\n");
14267         }
14268     }
14269     }
14270     function_tests++;
14271 #endif
14272 #endif
14273 
14274     return(test_ret);
14275 }
14276 
14277 
14278 #define gen_nb_const_xmlParserNodeInfoPtr 1
gen_const_xmlParserNodeInfoPtr(int no ATTRIBUTE_UNUSED,int nr ATTRIBUTE_UNUSED)14279 static xmlParserNodeInfoPtr gen_const_xmlParserNodeInfoPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
14280     return(NULL);
14281 }
des_const_xmlParserNodeInfoPtr(int no ATTRIBUTE_UNUSED,const xmlParserNodeInfoPtr val ATTRIBUTE_UNUSED,int nr ATTRIBUTE_UNUSED)14282 static void des_const_xmlParserNodeInfoPtr(int no ATTRIBUTE_UNUSED, const xmlParserNodeInfoPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
14283 }
14284 
14285 static int
test_xmlParserAddNodeInfo(void)14286 test_xmlParserAddNodeInfo(void) {
14287     int test_ret = 0;
14288 
14289     int mem_base;
14290     xmlParserCtxtPtr ctxt; /* an XML parser context */
14291     int n_ctxt;
14292     xmlParserNodeInfoPtr info; /* a node info sequence pointer */
14293     int n_info;
14294 
14295     for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
14296     for (n_info = 0;n_info < gen_nb_const_xmlParserNodeInfoPtr;n_info++) {
14297         mem_base = xmlMemBlocks();
14298         ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
14299         info = gen_const_xmlParserNodeInfoPtr(n_info, 1);
14300 
14301         xmlParserAddNodeInfo(ctxt, (const xmlParserNodeInfoPtr)info);
14302         call_tests++;
14303         des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
14304         des_const_xmlParserNodeInfoPtr(n_info, (const xmlParserNodeInfoPtr)info, 1);
14305         xmlResetLastError();
14306         if (mem_base != xmlMemBlocks()) {
14307             printf("Leak of %d blocks found in xmlParserAddNodeInfo",
14308 	           xmlMemBlocks() - mem_base);
14309 	    test_ret++;
14310             printf(" %d", n_ctxt);
14311             printf(" %d", n_info);
14312             printf("\n");
14313         }
14314     }
14315     }
14316     function_tests++;
14317 
14318     return(test_ret);
14319 }
14320 
14321 
14322 #define gen_nb_const_xmlParserCtxtPtr 1
gen_const_xmlParserCtxtPtr(int no ATTRIBUTE_UNUSED,int nr ATTRIBUTE_UNUSED)14323 static xmlParserCtxtPtr gen_const_xmlParserCtxtPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
14324     return(NULL);
14325 }
des_const_xmlParserCtxtPtr(int no ATTRIBUTE_UNUSED,const xmlParserCtxtPtr val ATTRIBUTE_UNUSED,int nr ATTRIBUTE_UNUSED)14326 static void des_const_xmlParserCtxtPtr(int no ATTRIBUTE_UNUSED, const xmlParserCtxtPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
14327 }
14328 
14329 #define gen_nb_const_xmlNodePtr 1
gen_const_xmlNodePtr(int no ATTRIBUTE_UNUSED,int nr ATTRIBUTE_UNUSED)14330 static xmlNodePtr gen_const_xmlNodePtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
14331     return(NULL);
14332 }
des_const_xmlNodePtr(int no ATTRIBUTE_UNUSED,const xmlNodePtr val ATTRIBUTE_UNUSED,int nr ATTRIBUTE_UNUSED)14333 static void des_const_xmlNodePtr(int no ATTRIBUTE_UNUSED, const xmlNodePtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
14334 }
14335 
14336 static int
test_xmlParserFindNodeInfo(void)14337 test_xmlParserFindNodeInfo(void) {
14338     int test_ret = 0;
14339 
14340     int mem_base;
14341     const xmlParserNodeInfo * ret_val;
14342     xmlParserCtxtPtr ctx; /* an XML parser context */
14343     int n_ctx;
14344     xmlNodePtr node; /* an XML node within the tree */
14345     int n_node;
14346 
14347     for (n_ctx = 0;n_ctx < gen_nb_const_xmlParserCtxtPtr;n_ctx++) {
14348     for (n_node = 0;n_node < gen_nb_const_xmlNodePtr;n_node++) {
14349         mem_base = xmlMemBlocks();
14350         ctx = gen_const_xmlParserCtxtPtr(n_ctx, 0);
14351         node = gen_const_xmlNodePtr(n_node, 1);
14352 
14353         ret_val = xmlParserFindNodeInfo((const xmlParserCtxtPtr)ctx, (const xmlNodePtr)node);
14354         desret_const_xmlParserNodeInfo_ptr(ret_val);
14355         call_tests++;
14356         des_const_xmlParserCtxtPtr(n_ctx, (const xmlParserCtxtPtr)ctx, 0);
14357         des_const_xmlNodePtr(n_node, (const xmlNodePtr)node, 1);
14358         xmlResetLastError();
14359         if (mem_base != xmlMemBlocks()) {
14360             printf("Leak of %d blocks found in xmlParserFindNodeInfo",
14361 	           xmlMemBlocks() - mem_base);
14362 	    test_ret++;
14363             printf(" %d", n_ctx);
14364             printf(" %d", n_node);
14365             printf("\n");
14366         }
14367     }
14368     }
14369     function_tests++;
14370 
14371     return(test_ret);
14372 }
14373 
14374 
14375 #define gen_nb_const_xmlParserNodeInfoSeqPtr 1
gen_const_xmlParserNodeInfoSeqPtr(int no ATTRIBUTE_UNUSED,int nr ATTRIBUTE_UNUSED)14376 static xmlParserNodeInfoSeqPtr gen_const_xmlParserNodeInfoSeqPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
14377     return(NULL);
14378 }
des_const_xmlParserNodeInfoSeqPtr(int no ATTRIBUTE_UNUSED,const xmlParserNodeInfoSeqPtr val ATTRIBUTE_UNUSED,int nr ATTRIBUTE_UNUSED)14379 static void des_const_xmlParserNodeInfoSeqPtr(int no ATTRIBUTE_UNUSED, const xmlParserNodeInfoSeqPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
14380 }
14381 
14382 static int
test_xmlParserFindNodeInfoIndex(void)14383 test_xmlParserFindNodeInfoIndex(void) {
14384     int test_ret = 0;
14385 
14386     int mem_base;
14387     unsigned long ret_val;
14388     xmlParserNodeInfoSeqPtr seq; /* a node info sequence pointer */
14389     int n_seq;
14390     xmlNodePtr node; /* an XML node pointer */
14391     int n_node;
14392 
14393     for (n_seq = 0;n_seq < gen_nb_const_xmlParserNodeInfoSeqPtr;n_seq++) {
14394     for (n_node = 0;n_node < gen_nb_const_xmlNodePtr;n_node++) {
14395         mem_base = xmlMemBlocks();
14396         seq = gen_const_xmlParserNodeInfoSeqPtr(n_seq, 0);
14397         node = gen_const_xmlNodePtr(n_node, 1);
14398 
14399         ret_val = xmlParserFindNodeInfoIndex((const xmlParserNodeInfoSeqPtr)seq, (const xmlNodePtr)node);
14400         desret_unsigned_long(ret_val);
14401         call_tests++;
14402         des_const_xmlParserNodeInfoSeqPtr(n_seq, (const xmlParserNodeInfoSeqPtr)seq, 0);
14403         des_const_xmlNodePtr(n_node, (const xmlNodePtr)node, 1);
14404         xmlResetLastError();
14405         if (mem_base != xmlMemBlocks()) {
14406             printf("Leak of %d blocks found in xmlParserFindNodeInfoIndex",
14407 	           xmlMemBlocks() - mem_base);
14408 	    test_ret++;
14409             printf(" %d", n_seq);
14410             printf(" %d", n_node);
14411             printf("\n");
14412         }
14413     }
14414     }
14415     function_tests++;
14416 
14417     return(test_ret);
14418 }
14419 
14420 
14421 #define gen_nb_xmlParserInputPtr 1
gen_xmlParserInputPtr(int no ATTRIBUTE_UNUSED,int nr ATTRIBUTE_UNUSED)14422 static xmlParserInputPtr gen_xmlParserInputPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
14423     return(NULL);
14424 }
des_xmlParserInputPtr(int no ATTRIBUTE_UNUSED,xmlParserInputPtr val ATTRIBUTE_UNUSED,int nr ATTRIBUTE_UNUSED)14425 static void des_xmlParserInputPtr(int no ATTRIBUTE_UNUSED, xmlParserInputPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
14426 }
14427 
14428 static int
test_xmlParserInputGrow(void)14429 test_xmlParserInputGrow(void) {
14430     int test_ret = 0;
14431 
14432     int mem_base;
14433     int ret_val;
14434     xmlParserInputPtr in; /* an XML parser input */
14435     int n_in;
14436     int len; /* an indicative size for the lookahead */
14437     int n_len;
14438 
14439     for (n_in = 0;n_in < gen_nb_xmlParserInputPtr;n_in++) {
14440     for (n_len = 0;n_len < gen_nb_int;n_len++) {
14441         mem_base = xmlMemBlocks();
14442         in = gen_xmlParserInputPtr(n_in, 0);
14443         len = gen_int(n_len, 1);
14444 
14445         ret_val = xmlParserInputGrow(in, len);
14446         desret_int(ret_val);
14447         call_tests++;
14448         des_xmlParserInputPtr(n_in, in, 0);
14449         des_int(n_len, len, 1);
14450         xmlResetLastError();
14451         if (mem_base != xmlMemBlocks()) {
14452             printf("Leak of %d blocks found in xmlParserInputGrow",
14453 	           xmlMemBlocks() - mem_base);
14454 	    test_ret++;
14455             printf(" %d", n_in);
14456             printf(" %d", n_len);
14457             printf("\n");
14458         }
14459     }
14460     }
14461     function_tests++;
14462 
14463     return(test_ret);
14464 }
14465 
14466 
14467 static int
test_xmlParserInputRead(void)14468 test_xmlParserInputRead(void) {
14469     int test_ret = 0;
14470 
14471     int mem_base;
14472     int ret_val;
14473     xmlParserInputPtr in; /* an XML parser input */
14474     int n_in;
14475     int len; /* an indicative size for the lookahead */
14476     int n_len;
14477 
14478     for (n_in = 0;n_in < gen_nb_xmlParserInputPtr;n_in++) {
14479     for (n_len = 0;n_len < gen_nb_int;n_len++) {
14480         mem_base = xmlMemBlocks();
14481         in = gen_xmlParserInputPtr(n_in, 0);
14482         len = gen_int(n_len, 1);
14483 
14484         ret_val = xmlParserInputRead(in, len);
14485         desret_int(ret_val);
14486         call_tests++;
14487         des_xmlParserInputPtr(n_in, in, 0);
14488         des_int(n_len, len, 1);
14489         xmlResetLastError();
14490         if (mem_base != xmlMemBlocks()) {
14491             printf("Leak of %d blocks found in xmlParserInputRead",
14492 	           xmlMemBlocks() - mem_base);
14493 	    test_ret++;
14494             printf(" %d", n_in);
14495             printf(" %d", n_len);
14496             printf("\n");
14497         }
14498     }
14499     }
14500     function_tests++;
14501 
14502     return(test_ret);
14503 }
14504 
14505 
14506 static int
test_xmlPedanticParserDefault(void)14507 test_xmlPedanticParserDefault(void) {
14508     int test_ret = 0;
14509 
14510     int mem_base;
14511     int ret_val;
14512     int val; /* int 0 or 1 */
14513     int n_val;
14514 
14515     for (n_val = 0;n_val < gen_nb_int;n_val++) {
14516         mem_base = xmlMemBlocks();
14517         val = gen_int(n_val, 0);
14518 
14519         ret_val = xmlPedanticParserDefault(val);
14520         desret_int(ret_val);
14521         call_tests++;
14522         des_int(n_val, val, 0);
14523         xmlResetLastError();
14524         if (mem_base != xmlMemBlocks()) {
14525             printf("Leak of %d blocks found in xmlPedanticParserDefault",
14526 	           xmlMemBlocks() - mem_base);
14527 	    test_ret++;
14528             printf(" %d", n_val);
14529             printf("\n");
14530         }
14531     }
14532     function_tests++;
14533 
14534     return(test_ret);
14535 }
14536 
14537 
14538 static int
test_xmlReadDoc(void)14539 test_xmlReadDoc(void) {
14540     int test_ret = 0;
14541 
14542     int mem_base;
14543     xmlDocPtr ret_val;
14544     xmlChar * cur; /* a pointer to a zero terminated string */
14545     int n_cur;
14546     const char * URL; /* the base URL to use for the document */
14547     int n_URL;
14548     char * encoding; /* the document encoding, or NULL */
14549     int n_encoding;
14550     int options; /* a combination of xmlParserOption */
14551     int n_options;
14552 
14553     for (n_cur = 0;n_cur < gen_nb_const_xmlChar_ptr;n_cur++) {
14554     for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) {
14555     for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
14556     for (n_options = 0;n_options < gen_nb_parseroptions;n_options++) {
14557         mem_base = xmlMemBlocks();
14558         cur = gen_const_xmlChar_ptr(n_cur, 0);
14559         URL = gen_filepath(n_URL, 1);
14560         encoding = gen_const_char_ptr(n_encoding, 2);
14561         options = gen_parseroptions(n_options, 3);
14562 
14563         ret_val = xmlReadDoc((const xmlChar *)cur, URL, (const char *)encoding, options);
14564         desret_xmlDocPtr(ret_val);
14565         call_tests++;
14566         des_const_xmlChar_ptr(n_cur, (const xmlChar *)cur, 0);
14567         des_filepath(n_URL, URL, 1);
14568         des_const_char_ptr(n_encoding, (const char *)encoding, 2);
14569         des_parseroptions(n_options, options, 3);
14570         xmlResetLastError();
14571         if (mem_base != xmlMemBlocks()) {
14572             printf("Leak of %d blocks found in xmlReadDoc",
14573 	           xmlMemBlocks() - mem_base);
14574 	    test_ret++;
14575             printf(" %d", n_cur);
14576             printf(" %d", n_URL);
14577             printf(" %d", n_encoding);
14578             printf(" %d", n_options);
14579             printf("\n");
14580         }
14581     }
14582     }
14583     }
14584     }
14585     function_tests++;
14586 
14587     return(test_ret);
14588 }
14589 
14590 
14591 static int
test_xmlReadFile(void)14592 test_xmlReadFile(void) {
14593     int test_ret = 0;
14594 
14595     int mem_base;
14596     xmlDocPtr ret_val;
14597     const char * filename; /* a file or URL */
14598     int n_filename;
14599     char * encoding; /* the document encoding, or NULL */
14600     int n_encoding;
14601     int options; /* a combination of xmlParserOption */
14602     int n_options;
14603 
14604     for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
14605     for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
14606     for (n_options = 0;n_options < gen_nb_parseroptions;n_options++) {
14607         mem_base = xmlMemBlocks();
14608         filename = gen_filepath(n_filename, 0);
14609         encoding = gen_const_char_ptr(n_encoding, 1);
14610         options = gen_parseroptions(n_options, 2);
14611 
14612         ret_val = xmlReadFile(filename, (const char *)encoding, options);
14613         desret_xmlDocPtr(ret_val);
14614         call_tests++;
14615         des_filepath(n_filename, filename, 0);
14616         des_const_char_ptr(n_encoding, (const char *)encoding, 1);
14617         des_parseroptions(n_options, options, 2);
14618         xmlResetLastError();
14619         if (mem_base != xmlMemBlocks()) {
14620             printf("Leak of %d blocks found in xmlReadFile",
14621 	           xmlMemBlocks() - mem_base);
14622 	    test_ret++;
14623             printf(" %d", n_filename);
14624             printf(" %d", n_encoding);
14625             printf(" %d", n_options);
14626             printf("\n");
14627         }
14628     }
14629     }
14630     }
14631     function_tests++;
14632 
14633     return(test_ret);
14634 }
14635 
14636 
14637 static int
test_xmlReadMemory(void)14638 test_xmlReadMemory(void) {
14639     int test_ret = 0;
14640 
14641     int mem_base;
14642     xmlDocPtr ret_val;
14643     char * buffer; /* a pointer to a char array */
14644     int n_buffer;
14645     int size; /* the size of the array */
14646     int n_size;
14647     const char * URL; /* the base URL to use for the document */
14648     int n_URL;
14649     char * encoding; /* the document encoding, or NULL */
14650     int n_encoding;
14651     int options; /* a combination of xmlParserOption */
14652     int n_options;
14653 
14654     for (n_buffer = 0;n_buffer < gen_nb_const_char_ptr;n_buffer++) {
14655     for (n_size = 0;n_size < gen_nb_int;n_size++) {
14656     for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) {
14657     for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
14658     for (n_options = 0;n_options < gen_nb_parseroptions;n_options++) {
14659         mem_base = xmlMemBlocks();
14660         buffer = gen_const_char_ptr(n_buffer, 0);
14661         size = gen_int(n_size, 1);
14662         URL = gen_filepath(n_URL, 2);
14663         encoding = gen_const_char_ptr(n_encoding, 3);
14664         options = gen_parseroptions(n_options, 4);
14665         if ((buffer != NULL) &&
14666             (size > (int) strlen((const char *) buffer) + 1))
14667             continue;
14668 
14669         ret_val = xmlReadMemory((const char *)buffer, size, URL, (const char *)encoding, options);
14670         desret_xmlDocPtr(ret_val);
14671         call_tests++;
14672         des_const_char_ptr(n_buffer, (const char *)buffer, 0);
14673         des_int(n_size, size, 1);
14674         des_filepath(n_URL, URL, 2);
14675         des_const_char_ptr(n_encoding, (const char *)encoding, 3);
14676         des_parseroptions(n_options, options, 4);
14677         xmlResetLastError();
14678         if (mem_base != xmlMemBlocks()) {
14679             printf("Leak of %d blocks found in xmlReadMemory",
14680 	           xmlMemBlocks() - mem_base);
14681 	    test_ret++;
14682             printf(" %d", n_buffer);
14683             printf(" %d", n_size);
14684             printf(" %d", n_URL);
14685             printf(" %d", n_encoding);
14686             printf(" %d", n_options);
14687             printf("\n");
14688         }
14689     }
14690     }
14691     }
14692     }
14693     }
14694     function_tests++;
14695 
14696     return(test_ret);
14697 }
14698 
14699 
14700 static int
test_xmlRecoverDoc(void)14701 test_xmlRecoverDoc(void) {
14702     int test_ret = 0;
14703 
14704 #if defined(LIBXML_SAX1_ENABLED)
14705 #ifdef LIBXML_SAX1_ENABLED
14706     int mem_base;
14707     xmlDocPtr ret_val;
14708     xmlChar * cur; /* a pointer to an array of xmlChar */
14709     int n_cur;
14710 
14711     for (n_cur = 0;n_cur < gen_nb_const_xmlChar_ptr;n_cur++) {
14712         mem_base = xmlMemBlocks();
14713         cur = gen_const_xmlChar_ptr(n_cur, 0);
14714 
14715         ret_val = xmlRecoverDoc((const xmlChar *)cur);
14716         desret_xmlDocPtr(ret_val);
14717         call_tests++;
14718         des_const_xmlChar_ptr(n_cur, (const xmlChar *)cur, 0);
14719         xmlResetLastError();
14720         if (mem_base != xmlMemBlocks()) {
14721             printf("Leak of %d blocks found in xmlRecoverDoc",
14722 	           xmlMemBlocks() - mem_base);
14723 	    test_ret++;
14724             printf(" %d", n_cur);
14725             printf("\n");
14726         }
14727     }
14728     function_tests++;
14729 #endif
14730 #endif
14731 
14732     return(test_ret);
14733 }
14734 
14735 
14736 static int
test_xmlRecoverFile(void)14737 test_xmlRecoverFile(void) {
14738     int test_ret = 0;
14739 
14740 #if defined(LIBXML_SAX1_ENABLED)
14741 #ifdef LIBXML_SAX1_ENABLED
14742     int mem_base;
14743     xmlDocPtr ret_val;
14744     const char * filename; /* the filename */
14745     int n_filename;
14746 
14747     for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
14748         mem_base = xmlMemBlocks();
14749         filename = gen_filepath(n_filename, 0);
14750 
14751         ret_val = xmlRecoverFile(filename);
14752         desret_xmlDocPtr(ret_val);
14753         call_tests++;
14754         des_filepath(n_filename, filename, 0);
14755         xmlResetLastError();
14756         if (mem_base != xmlMemBlocks()) {
14757             printf("Leak of %d blocks found in xmlRecoverFile",
14758 	           xmlMemBlocks() - mem_base);
14759 	    test_ret++;
14760             printf(" %d", n_filename);
14761             printf("\n");
14762         }
14763     }
14764     function_tests++;
14765 #endif
14766 #endif
14767 
14768     return(test_ret);
14769 }
14770 
14771 
14772 static int
test_xmlRecoverMemory(void)14773 test_xmlRecoverMemory(void) {
14774     int test_ret = 0;
14775 
14776 #if defined(LIBXML_SAX1_ENABLED)
14777 #ifdef LIBXML_SAX1_ENABLED
14778     int mem_base;
14779     xmlDocPtr ret_val;
14780     char * buffer; /* an pointer to a char array */
14781     int n_buffer;
14782     int size; /* the size of the array */
14783     int n_size;
14784 
14785     for (n_buffer = 0;n_buffer < gen_nb_const_char_ptr;n_buffer++) {
14786     for (n_size = 0;n_size < gen_nb_int;n_size++) {
14787         mem_base = xmlMemBlocks();
14788         buffer = gen_const_char_ptr(n_buffer, 0);
14789         size = gen_int(n_size, 1);
14790         if ((buffer != NULL) &&
14791             (size > (int) strlen((const char *) buffer) + 1))
14792             continue;
14793 
14794         ret_val = xmlRecoverMemory((const char *)buffer, size);
14795         desret_xmlDocPtr(ret_val);
14796         call_tests++;
14797         des_const_char_ptr(n_buffer, (const char *)buffer, 0);
14798         des_int(n_size, size, 1);
14799         xmlResetLastError();
14800         if (mem_base != xmlMemBlocks()) {
14801             printf("Leak of %d blocks found in xmlRecoverMemory",
14802 	           xmlMemBlocks() - mem_base);
14803 	    test_ret++;
14804             printf(" %d", n_buffer);
14805             printf(" %d", n_size);
14806             printf("\n");
14807         }
14808     }
14809     }
14810     function_tests++;
14811 #endif
14812 #endif
14813 
14814     return(test_ret);
14815 }
14816 
14817 
14818 static int
test_xmlSAXParseDTD(void)14819 test_xmlSAXParseDTD(void) {
14820     int test_ret = 0;
14821 
14822 #if defined(LIBXML_VALID_ENABLED)
14823 #ifdef LIBXML_SAX1_ENABLED
14824     int mem_base;
14825     xmlDtdPtr ret_val;
14826     xmlSAXHandlerPtr sax; /* the SAX handler block */
14827     int n_sax;
14828     xmlChar * ExternalID; /* a NAME* containing the External ID of the DTD */
14829     int n_ExternalID;
14830     xmlChar * SystemID; /* a NAME* containing the URL to the DTD */
14831     int n_SystemID;
14832 
14833     for (n_sax = 0;n_sax < gen_nb_xmlSAXHandlerPtr;n_sax++) {
14834     for (n_ExternalID = 0;n_ExternalID < gen_nb_const_xmlChar_ptr;n_ExternalID++) {
14835     for (n_SystemID = 0;n_SystemID < gen_nb_const_xmlChar_ptr;n_SystemID++) {
14836         mem_base = xmlMemBlocks();
14837         sax = gen_xmlSAXHandlerPtr(n_sax, 0);
14838         ExternalID = gen_const_xmlChar_ptr(n_ExternalID, 1);
14839         SystemID = gen_const_xmlChar_ptr(n_SystemID, 2);
14840 
14841         ret_val = xmlSAXParseDTD(sax, (const xmlChar *)ExternalID, (const xmlChar *)SystemID);
14842         desret_xmlDtdPtr(ret_val);
14843         call_tests++;
14844         des_xmlSAXHandlerPtr(n_sax, sax, 0);
14845         des_const_xmlChar_ptr(n_ExternalID, (const xmlChar *)ExternalID, 1);
14846         des_const_xmlChar_ptr(n_SystemID, (const xmlChar *)SystemID, 2);
14847         xmlResetLastError();
14848         if (mem_base != xmlMemBlocks()) {
14849             printf("Leak of %d blocks found in xmlSAXParseDTD",
14850 	           xmlMemBlocks() - mem_base);
14851 	    test_ret++;
14852             printf(" %d", n_sax);
14853             printf(" %d", n_ExternalID);
14854             printf(" %d", n_SystemID);
14855             printf("\n");
14856         }
14857     }
14858     }
14859     }
14860     function_tests++;
14861 #endif
14862 #endif
14863 
14864     return(test_ret);
14865 }
14866 
14867 
14868 static int
test_xmlSAXParseDoc(void)14869 test_xmlSAXParseDoc(void) {
14870     int test_ret = 0;
14871 
14872 #if defined(LIBXML_SAX1_ENABLED)
14873 #ifdef LIBXML_SAX1_ENABLED
14874     int mem_base;
14875     xmlDocPtr ret_val;
14876     xmlSAXHandlerPtr sax; /* the SAX handler block */
14877     int n_sax;
14878     xmlChar * cur; /* a pointer to an array of xmlChar */
14879     int n_cur;
14880     int recovery; /* work in recovery mode, i.e. tries to read no Well Formed documents */
14881     int n_recovery;
14882 
14883     for (n_sax = 0;n_sax < gen_nb_xmlSAXHandlerPtr;n_sax++) {
14884     for (n_cur = 0;n_cur < gen_nb_const_xmlChar_ptr;n_cur++) {
14885     for (n_recovery = 0;n_recovery < gen_nb_int;n_recovery++) {
14886         mem_base = xmlMemBlocks();
14887         sax = gen_xmlSAXHandlerPtr(n_sax, 0);
14888         cur = gen_const_xmlChar_ptr(n_cur, 1);
14889         recovery = gen_int(n_recovery, 2);
14890 
14891         ret_val = xmlSAXParseDoc(sax, (const xmlChar *)cur, recovery);
14892         desret_xmlDocPtr(ret_val);
14893         call_tests++;
14894         des_xmlSAXHandlerPtr(n_sax, sax, 0);
14895         des_const_xmlChar_ptr(n_cur, (const xmlChar *)cur, 1);
14896         des_int(n_recovery, recovery, 2);
14897         xmlResetLastError();
14898         if (mem_base != xmlMemBlocks()) {
14899             printf("Leak of %d blocks found in xmlSAXParseDoc",
14900 	           xmlMemBlocks() - mem_base);
14901 	    test_ret++;
14902             printf(" %d", n_sax);
14903             printf(" %d", n_cur);
14904             printf(" %d", n_recovery);
14905             printf("\n");
14906         }
14907     }
14908     }
14909     }
14910     function_tests++;
14911 #endif
14912 #endif
14913 
14914     return(test_ret);
14915 }
14916 
14917 
14918 static int
test_xmlSAXParseEntity(void)14919 test_xmlSAXParseEntity(void) {
14920     int test_ret = 0;
14921 
14922 #if defined(LIBXML_SAX1_ENABLED)
14923 #ifdef LIBXML_SAX1_ENABLED
14924     int mem_base;
14925     xmlDocPtr ret_val;
14926     xmlSAXHandlerPtr sax; /* the SAX handler block */
14927     int n_sax;
14928     const char * filename; /* the filename */
14929     int n_filename;
14930 
14931     for (n_sax = 0;n_sax < gen_nb_xmlSAXHandlerPtr;n_sax++) {
14932     for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
14933         mem_base = xmlMemBlocks();
14934         sax = gen_xmlSAXHandlerPtr(n_sax, 0);
14935         filename = gen_filepath(n_filename, 1);
14936 
14937         ret_val = xmlSAXParseEntity(sax, filename);
14938         desret_xmlDocPtr(ret_val);
14939         call_tests++;
14940         des_xmlSAXHandlerPtr(n_sax, sax, 0);
14941         des_filepath(n_filename, filename, 1);
14942         xmlResetLastError();
14943         if (mem_base != xmlMemBlocks()) {
14944             printf("Leak of %d blocks found in xmlSAXParseEntity",
14945 	           xmlMemBlocks() - mem_base);
14946 	    test_ret++;
14947             printf(" %d", n_sax);
14948             printf(" %d", n_filename);
14949             printf("\n");
14950         }
14951     }
14952     }
14953     function_tests++;
14954 #endif
14955 #endif
14956 
14957     return(test_ret);
14958 }
14959 
14960 
14961 static int
test_xmlSAXParseFile(void)14962 test_xmlSAXParseFile(void) {
14963     int test_ret = 0;
14964 
14965 #if defined(LIBXML_SAX1_ENABLED)
14966 #ifdef LIBXML_SAX1_ENABLED
14967     int mem_base;
14968     xmlDocPtr ret_val;
14969     xmlSAXHandlerPtr sax; /* the SAX handler block */
14970     int n_sax;
14971     const char * filename; /* the filename */
14972     int n_filename;
14973     int recovery; /* work in recovery mode, i.e. tries to read no Well Formed documents */
14974     int n_recovery;
14975 
14976     for (n_sax = 0;n_sax < gen_nb_xmlSAXHandlerPtr;n_sax++) {
14977     for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
14978     for (n_recovery = 0;n_recovery < gen_nb_int;n_recovery++) {
14979         mem_base = xmlMemBlocks();
14980         sax = gen_xmlSAXHandlerPtr(n_sax, 0);
14981         filename = gen_filepath(n_filename, 1);
14982         recovery = gen_int(n_recovery, 2);
14983 
14984         ret_val = xmlSAXParseFile(sax, filename, recovery);
14985         desret_xmlDocPtr(ret_val);
14986         call_tests++;
14987         des_xmlSAXHandlerPtr(n_sax, sax, 0);
14988         des_filepath(n_filename, filename, 1);
14989         des_int(n_recovery, recovery, 2);
14990         xmlResetLastError();
14991         if (mem_base != xmlMemBlocks()) {
14992             printf("Leak of %d blocks found in xmlSAXParseFile",
14993 	           xmlMemBlocks() - mem_base);
14994 	    test_ret++;
14995             printf(" %d", n_sax);
14996             printf(" %d", n_filename);
14997             printf(" %d", n_recovery);
14998             printf("\n");
14999         }
15000     }
15001     }
15002     }
15003     function_tests++;
15004 #endif
15005 #endif
15006 
15007     return(test_ret);
15008 }
15009 
15010 
15011 static int
test_xmlSAXParseFileWithData(void)15012 test_xmlSAXParseFileWithData(void) {
15013     int test_ret = 0;
15014 
15015 #if defined(LIBXML_SAX1_ENABLED)
15016 #ifdef LIBXML_SAX1_ENABLED
15017     int mem_base;
15018     xmlDocPtr ret_val;
15019     xmlSAXHandlerPtr sax; /* the SAX handler block */
15020     int n_sax;
15021     const char * filename; /* the filename */
15022     int n_filename;
15023     int recovery; /* work in recovery mode, i.e. tries to read no Well Formed documents */
15024     int n_recovery;
15025     void * data; /* the userdata */
15026     int n_data;
15027 
15028     for (n_sax = 0;n_sax < gen_nb_xmlSAXHandlerPtr;n_sax++) {
15029     for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
15030     for (n_recovery = 0;n_recovery < gen_nb_int;n_recovery++) {
15031     for (n_data = 0;n_data < gen_nb_userdata;n_data++) {
15032         mem_base = xmlMemBlocks();
15033         sax = gen_xmlSAXHandlerPtr(n_sax, 0);
15034         filename = gen_filepath(n_filename, 1);
15035         recovery = gen_int(n_recovery, 2);
15036         data = gen_userdata(n_data, 3);
15037 
15038         ret_val = xmlSAXParseFileWithData(sax, filename, recovery, data);
15039         desret_xmlDocPtr(ret_val);
15040         call_tests++;
15041         des_xmlSAXHandlerPtr(n_sax, sax, 0);
15042         des_filepath(n_filename, filename, 1);
15043         des_int(n_recovery, recovery, 2);
15044         des_userdata(n_data, data, 3);
15045         xmlResetLastError();
15046         if (mem_base != xmlMemBlocks()) {
15047             printf("Leak of %d blocks found in xmlSAXParseFileWithData",
15048 	           xmlMemBlocks() - mem_base);
15049 	    test_ret++;
15050             printf(" %d", n_sax);
15051             printf(" %d", n_filename);
15052             printf(" %d", n_recovery);
15053             printf(" %d", n_data);
15054             printf("\n");
15055         }
15056     }
15057     }
15058     }
15059     }
15060     function_tests++;
15061 #endif
15062 #endif
15063 
15064     return(test_ret);
15065 }
15066 
15067 
15068 static int
test_xmlSAXParseMemory(void)15069 test_xmlSAXParseMemory(void) {
15070     int test_ret = 0;
15071 
15072 #if defined(LIBXML_SAX1_ENABLED)
15073 #ifdef LIBXML_SAX1_ENABLED
15074     int mem_base;
15075     xmlDocPtr ret_val;
15076     xmlSAXHandlerPtr sax; /* the SAX handler block */
15077     int n_sax;
15078     char * buffer; /* an pointer to a char array */
15079     int n_buffer;
15080     int size; /* the size of the array */
15081     int n_size;
15082     int recovery; /* work in recovery mode, i.e. tries to read not Well Formed documents */
15083     int n_recovery;
15084 
15085     for (n_sax = 0;n_sax < gen_nb_xmlSAXHandlerPtr;n_sax++) {
15086     for (n_buffer = 0;n_buffer < gen_nb_const_char_ptr;n_buffer++) {
15087     for (n_size = 0;n_size < gen_nb_int;n_size++) {
15088     for (n_recovery = 0;n_recovery < gen_nb_int;n_recovery++) {
15089         mem_base = xmlMemBlocks();
15090         sax = gen_xmlSAXHandlerPtr(n_sax, 0);
15091         buffer = gen_const_char_ptr(n_buffer, 1);
15092         size = gen_int(n_size, 2);
15093         recovery = gen_int(n_recovery, 3);
15094         if ((buffer != NULL) &&
15095             (size > (int) strlen((const char *) buffer) + 1))
15096             continue;
15097 
15098         ret_val = xmlSAXParseMemory(sax, (const char *)buffer, size, recovery);
15099         desret_xmlDocPtr(ret_val);
15100         call_tests++;
15101         des_xmlSAXHandlerPtr(n_sax, sax, 0);
15102         des_const_char_ptr(n_buffer, (const char *)buffer, 1);
15103         des_int(n_size, size, 2);
15104         des_int(n_recovery, recovery, 3);
15105         xmlResetLastError();
15106         if (mem_base != xmlMemBlocks()) {
15107             printf("Leak of %d blocks found in xmlSAXParseMemory",
15108 	           xmlMemBlocks() - mem_base);
15109 	    test_ret++;
15110             printf(" %d", n_sax);
15111             printf(" %d", n_buffer);
15112             printf(" %d", n_size);
15113             printf(" %d", n_recovery);
15114             printf("\n");
15115         }
15116     }
15117     }
15118     }
15119     }
15120     function_tests++;
15121 #endif
15122 #endif
15123 
15124     return(test_ret);
15125 }
15126 
15127 
15128 static int
test_xmlSAXParseMemoryWithData(void)15129 test_xmlSAXParseMemoryWithData(void) {
15130     int test_ret = 0;
15131 
15132 #if defined(LIBXML_SAX1_ENABLED)
15133 #ifdef LIBXML_SAX1_ENABLED
15134     int mem_base;
15135     xmlDocPtr ret_val;
15136     xmlSAXHandlerPtr sax; /* the SAX handler block */
15137     int n_sax;
15138     char * buffer; /* an pointer to a char array */
15139     int n_buffer;
15140     int size; /* the size of the array */
15141     int n_size;
15142     int recovery; /* work in recovery mode, i.e. tries to read no Well Formed documents */
15143     int n_recovery;
15144     void * data; /* the userdata */
15145     int n_data;
15146 
15147     for (n_sax = 0;n_sax < gen_nb_xmlSAXHandlerPtr;n_sax++) {
15148     for (n_buffer = 0;n_buffer < gen_nb_const_char_ptr;n_buffer++) {
15149     for (n_size = 0;n_size < gen_nb_int;n_size++) {
15150     for (n_recovery = 0;n_recovery < gen_nb_int;n_recovery++) {
15151     for (n_data = 0;n_data < gen_nb_userdata;n_data++) {
15152         mem_base = xmlMemBlocks();
15153         sax = gen_xmlSAXHandlerPtr(n_sax, 0);
15154         buffer = gen_const_char_ptr(n_buffer, 1);
15155         size = gen_int(n_size, 2);
15156         recovery = gen_int(n_recovery, 3);
15157         data = gen_userdata(n_data, 4);
15158         if ((buffer != NULL) &&
15159             (size > (int) strlen((const char *) buffer) + 1))
15160             continue;
15161 
15162         ret_val = xmlSAXParseMemoryWithData(sax, (const char *)buffer, size, recovery, data);
15163         desret_xmlDocPtr(ret_val);
15164         call_tests++;
15165         des_xmlSAXHandlerPtr(n_sax, sax, 0);
15166         des_const_char_ptr(n_buffer, (const char *)buffer, 1);
15167         des_int(n_size, size, 2);
15168         des_int(n_recovery, recovery, 3);
15169         des_userdata(n_data, data, 4);
15170         xmlResetLastError();
15171         if (mem_base != xmlMemBlocks()) {
15172             printf("Leak of %d blocks found in xmlSAXParseMemoryWithData",
15173 	           xmlMemBlocks() - mem_base);
15174 	    test_ret++;
15175             printf(" %d", n_sax);
15176             printf(" %d", n_buffer);
15177             printf(" %d", n_size);
15178             printf(" %d", n_recovery);
15179             printf(" %d", n_data);
15180             printf("\n");
15181         }
15182     }
15183     }
15184     }
15185     }
15186     }
15187     function_tests++;
15188 #endif
15189 #endif
15190 
15191     return(test_ret);
15192 }
15193 
15194 
15195 static int
test_xmlSAXUserParseFile(void)15196 test_xmlSAXUserParseFile(void) {
15197     int test_ret = 0;
15198 
15199 #if defined(LIBXML_SAX1_ENABLED)
15200 #ifdef LIBXML_SAX1_ENABLED
15201     int mem_base;
15202     int ret_val;
15203     xmlSAXHandlerPtr sax; /* a SAX handler */
15204     int n_sax;
15205     void * user_data; /* The user data returned on SAX callbacks */
15206     int n_user_data;
15207     const char * filename; /* a file name */
15208     int n_filename;
15209 
15210     for (n_sax = 0;n_sax < gen_nb_xmlSAXHandlerPtr;n_sax++) {
15211     for (n_user_data = 0;n_user_data < gen_nb_userdata;n_user_data++) {
15212     for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
15213         mem_base = xmlMemBlocks();
15214         sax = gen_xmlSAXHandlerPtr(n_sax, 0);
15215         user_data = gen_userdata(n_user_data, 1);
15216         filename = gen_filepath(n_filename, 2);
15217 
15218 #ifdef LIBXML_SAX1_ENABLED
15219         if (sax == (xmlSAXHandlerPtr)&xmlDefaultSAXHandler) user_data = NULL;
15220 #endif
15221 
15222 
15223         ret_val = xmlSAXUserParseFile(sax, user_data, filename);
15224         desret_int(ret_val);
15225         call_tests++;
15226         des_xmlSAXHandlerPtr(n_sax, sax, 0);
15227         des_userdata(n_user_data, user_data, 1);
15228         des_filepath(n_filename, filename, 2);
15229         xmlResetLastError();
15230         if (mem_base != xmlMemBlocks()) {
15231             printf("Leak of %d blocks found in xmlSAXUserParseFile",
15232 	           xmlMemBlocks() - mem_base);
15233 	    test_ret++;
15234             printf(" %d", n_sax);
15235             printf(" %d", n_user_data);
15236             printf(" %d", n_filename);
15237             printf("\n");
15238         }
15239     }
15240     }
15241     }
15242     function_tests++;
15243 #endif
15244 #endif
15245 
15246     return(test_ret);
15247 }
15248 
15249 
15250 static int
test_xmlSAXUserParseMemory(void)15251 test_xmlSAXUserParseMemory(void) {
15252     int test_ret = 0;
15253 
15254 #if defined(LIBXML_SAX1_ENABLED)
15255 #ifdef LIBXML_SAX1_ENABLED
15256     int mem_base;
15257     int ret_val;
15258     xmlSAXHandlerPtr sax; /* a SAX handler */
15259     int n_sax;
15260     void * user_data; /* The user data returned on SAX callbacks */
15261     int n_user_data;
15262     char * buffer; /* an in-memory XML document input */
15263     int n_buffer;
15264     int size; /* the length of the XML document in bytes */
15265     int n_size;
15266 
15267     for (n_sax = 0;n_sax < gen_nb_xmlSAXHandlerPtr;n_sax++) {
15268     for (n_user_data = 0;n_user_data < gen_nb_userdata;n_user_data++) {
15269     for (n_buffer = 0;n_buffer < gen_nb_const_char_ptr;n_buffer++) {
15270     for (n_size = 0;n_size < gen_nb_int;n_size++) {
15271         mem_base = xmlMemBlocks();
15272         sax = gen_xmlSAXHandlerPtr(n_sax, 0);
15273         user_data = gen_userdata(n_user_data, 1);
15274         buffer = gen_const_char_ptr(n_buffer, 2);
15275         size = gen_int(n_size, 3);
15276         if ((buffer != NULL) &&
15277             (size > (int) strlen((const char *) buffer) + 1))
15278             continue;
15279 
15280 #ifdef LIBXML_SAX1_ENABLED
15281         if (sax == (xmlSAXHandlerPtr)&xmlDefaultSAXHandler) user_data = NULL;
15282 #endif
15283 
15284 
15285         ret_val = xmlSAXUserParseMemory(sax, user_data, (const char *)buffer, size);
15286         desret_int(ret_val);
15287         call_tests++;
15288         des_xmlSAXHandlerPtr(n_sax, sax, 0);
15289         des_userdata(n_user_data, user_data, 1);
15290         des_const_char_ptr(n_buffer, (const char *)buffer, 2);
15291         des_int(n_size, size, 3);
15292         xmlResetLastError();
15293         if (mem_base != xmlMemBlocks()) {
15294             printf("Leak of %d blocks found in xmlSAXUserParseMemory",
15295 	           xmlMemBlocks() - mem_base);
15296 	    test_ret++;
15297             printf(" %d", n_sax);
15298             printf(" %d", n_user_data);
15299             printf(" %d", n_buffer);
15300             printf(" %d", n_size);
15301             printf("\n");
15302         }
15303     }
15304     }
15305     }
15306     }
15307     function_tests++;
15308 #endif
15309 #endif
15310 
15311     return(test_ret);
15312 }
15313 
15314 
15315 static int
test_xmlSetExternalEntityLoader(void)15316 test_xmlSetExternalEntityLoader(void) {
15317     int test_ret = 0;
15318 
15319 
15320     /* missing type support */
15321     return(test_ret);
15322 }
15323 
15324 
15325 static int
test_xmlSetFeature(void)15326 test_xmlSetFeature(void) {
15327     int test_ret = 0;
15328 
15329 #if defined(LIBXML_LEGACY_ENABLED)
15330 #ifdef LIBXML_LEGACY_ENABLED
15331     int mem_base;
15332     int ret_val;
15333     xmlParserCtxtPtr ctxt; /* an XML/HTML parser context */
15334     int n_ctxt;
15335     char * name; /* the feature name */
15336     int n_name;
15337     void * value; /* pointer to the location of the new value */
15338     int n_value;
15339 
15340     for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
15341     for (n_name = 0;n_name < gen_nb_const_char_ptr;n_name++) {
15342     for (n_value = 0;n_value < gen_nb_void_ptr;n_value++) {
15343         mem_base = xmlMemBlocks();
15344         ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
15345         name = gen_const_char_ptr(n_name, 1);
15346         value = gen_void_ptr(n_value, 2);
15347 
15348         ret_val = xmlSetFeature(ctxt, (const char *)name, value);
15349         desret_int(ret_val);
15350         call_tests++;
15351         des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
15352         des_const_char_ptr(n_name, (const char *)name, 1);
15353         des_void_ptr(n_value, value, 2);
15354         xmlResetLastError();
15355         if (mem_base != xmlMemBlocks()) {
15356             printf("Leak of %d blocks found in xmlSetFeature",
15357 	           xmlMemBlocks() - mem_base);
15358 	    test_ret++;
15359             printf(" %d", n_ctxt);
15360             printf(" %d", n_name);
15361             printf(" %d", n_value);
15362             printf("\n");
15363         }
15364     }
15365     }
15366     }
15367     function_tests++;
15368 #endif
15369 #endif
15370 
15371     return(test_ret);
15372 }
15373 
15374 
15375 static int
test_xmlSetupParserForBuffer(void)15376 test_xmlSetupParserForBuffer(void) {
15377     int test_ret = 0;
15378 
15379 #if defined(LIBXML_SAX1_ENABLED)
15380 #ifdef LIBXML_SAX1_ENABLED
15381     int mem_base;
15382     xmlParserCtxtPtr ctxt; /* an XML parser context */
15383     int n_ctxt;
15384     xmlChar * buffer; /* a xmlChar * buffer */
15385     int n_buffer;
15386     const char * filename; /* a file name */
15387     int n_filename;
15388 
15389     for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
15390     for (n_buffer = 0;n_buffer < gen_nb_const_xmlChar_ptr;n_buffer++) {
15391     for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
15392         mem_base = xmlMemBlocks();
15393         ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
15394         buffer = gen_const_xmlChar_ptr(n_buffer, 1);
15395         filename = gen_filepath(n_filename, 2);
15396 
15397         xmlSetupParserForBuffer(ctxt, (const xmlChar *)buffer, filename);
15398         call_tests++;
15399         des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
15400         des_const_xmlChar_ptr(n_buffer, (const xmlChar *)buffer, 1);
15401         des_filepath(n_filename, filename, 2);
15402         xmlResetLastError();
15403         if (mem_base != xmlMemBlocks()) {
15404             printf("Leak of %d blocks found in xmlSetupParserForBuffer",
15405 	           xmlMemBlocks() - mem_base);
15406 	    test_ret++;
15407             printf(" %d", n_ctxt);
15408             printf(" %d", n_buffer);
15409             printf(" %d", n_filename);
15410             printf("\n");
15411         }
15412     }
15413     }
15414     }
15415     function_tests++;
15416 #endif
15417 #endif
15418 
15419     return(test_ret);
15420 }
15421 
15422 
15423 static int
test_xmlStopParser(void)15424 test_xmlStopParser(void) {
15425     int test_ret = 0;
15426 
15427 #ifdef LIBXML_PUSH_ENABLED
15428     int mem_base;
15429     xmlParserCtxtPtr ctxt; /* an XML parser context */
15430     int n_ctxt;
15431 
15432     for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
15433         mem_base = xmlMemBlocks();
15434         ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
15435 
15436         xmlStopParser(ctxt);
15437         call_tests++;
15438         des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
15439         xmlResetLastError();
15440         if (mem_base != xmlMemBlocks()) {
15441             printf("Leak of %d blocks found in xmlStopParser",
15442 	           xmlMemBlocks() - mem_base);
15443 	    test_ret++;
15444             printf(" %d", n_ctxt);
15445             printf("\n");
15446         }
15447     }
15448     function_tests++;
15449 #endif
15450 
15451     return(test_ret);
15452 }
15453 
15454 
15455 static int
test_xmlSubstituteEntitiesDefault(void)15456 test_xmlSubstituteEntitiesDefault(void) {
15457     int test_ret = 0;
15458 
15459     int mem_base;
15460     int ret_val;
15461     int val; /* int 0 or 1 */
15462     int n_val;
15463 
15464     for (n_val = 0;n_val < gen_nb_int;n_val++) {
15465         mem_base = xmlMemBlocks();
15466         val = gen_int(n_val, 0);
15467 
15468         ret_val = xmlSubstituteEntitiesDefault(val);
15469         desret_int(ret_val);
15470         call_tests++;
15471         des_int(n_val, val, 0);
15472         xmlResetLastError();
15473         if (mem_base != xmlMemBlocks()) {
15474             printf("Leak of %d blocks found in xmlSubstituteEntitiesDefault",
15475 	           xmlMemBlocks() - mem_base);
15476 	    test_ret++;
15477             printf(" %d", n_val);
15478             printf("\n");
15479         }
15480     }
15481     function_tests++;
15482 
15483     return(test_ret);
15484 }
15485 
15486 static int
test_parser(void)15487 test_parser(void) {
15488     int test_ret = 0;
15489 
15490     if (quiet == 0) printf("Testing parser : 61 of 70 functions ...\n");
15491     test_ret += test_xmlByteConsumed();
15492     test_ret += test_xmlClearNodeInfoSeq();
15493     test_ret += test_xmlClearParserCtxt();
15494     test_ret += test_xmlCreateDocParserCtxt();
15495     test_ret += test_xmlCreatePushParserCtxt();
15496     test_ret += test_xmlCtxtReadDoc();
15497     test_ret += test_xmlCtxtReadFile();
15498     test_ret += test_xmlCtxtReadMemory();
15499     test_ret += test_xmlCtxtReset();
15500     test_ret += test_xmlCtxtResetPush();
15501     test_ret += test_xmlCtxtUseOptions();
15502     test_ret += test_xmlGetExternalEntityLoader();
15503     test_ret += test_xmlGetFeature();
15504     test_ret += test_xmlGetFeaturesList();
15505     test_ret += test_xmlHasFeature();
15506     test_ret += test_xmlIOParseDTD();
15507     test_ret += test_xmlInitNodeInfoSeq();
15508     test_ret += test_xmlInitParser();
15509     test_ret += test_xmlInitParserCtxt();
15510     test_ret += test_xmlKeepBlanksDefault();
15511     test_ret += test_xmlLineNumbersDefault();
15512     test_ret += test_xmlLoadExternalEntity();
15513     test_ret += test_xmlNewIOInputStream();
15514     test_ret += test_xmlNewParserCtxt();
15515     test_ret += test_xmlParseBalancedChunkMemory();
15516     test_ret += test_xmlParseBalancedChunkMemoryRecover();
15517     test_ret += test_xmlParseChunk();
15518     test_ret += test_xmlParseCtxtExternalEntity();
15519     test_ret += test_xmlParseDTD();
15520     test_ret += test_xmlParseDoc();
15521     test_ret += test_xmlParseDocument();
15522     test_ret += test_xmlParseEntity();
15523     test_ret += test_xmlParseExtParsedEnt();
15524     test_ret += test_xmlParseExternalEntity();
15525     test_ret += test_xmlParseFile();
15526     test_ret += test_xmlParseInNodeContext();
15527     test_ret += test_xmlParseMemory();
15528     test_ret += test_xmlParserAddNodeInfo();
15529     test_ret += test_xmlParserFindNodeInfo();
15530     test_ret += test_xmlParserFindNodeInfoIndex();
15531     test_ret += test_xmlParserInputGrow();
15532     test_ret += test_xmlParserInputRead();
15533     test_ret += test_xmlPedanticParserDefault();
15534     test_ret += test_xmlReadDoc();
15535     test_ret += test_xmlReadFile();
15536     test_ret += test_xmlReadMemory();
15537     test_ret += test_xmlRecoverDoc();
15538     test_ret += test_xmlRecoverFile();
15539     test_ret += test_xmlRecoverMemory();
15540     test_ret += test_xmlSAXParseDTD();
15541     test_ret += test_xmlSAXParseDoc();
15542     test_ret += test_xmlSAXParseEntity();
15543     test_ret += test_xmlSAXParseFile();
15544     test_ret += test_xmlSAXParseFileWithData();
15545     test_ret += test_xmlSAXParseMemory();
15546     test_ret += test_xmlSAXParseMemoryWithData();
15547     test_ret += test_xmlSAXUserParseFile();
15548     test_ret += test_xmlSAXUserParseMemory();
15549     test_ret += test_xmlSetExternalEntityLoader();
15550     test_ret += test_xmlSetFeature();
15551     test_ret += test_xmlSetupParserForBuffer();
15552     test_ret += test_xmlStopParser();
15553     test_ret += test_xmlSubstituteEntitiesDefault();
15554 
15555     if (test_ret != 0)
15556 	printf("Module parser: %d errors\n", test_ret);
15557     return(test_ret);
15558 }
15559 
15560 static int
test_htmlCreateFileParserCtxt(void)15561 test_htmlCreateFileParserCtxt(void) {
15562     int test_ret = 0;
15563 
15564 #if defined(LIBXML_HTML_ENABLED)
15565     int mem_base;
15566     htmlParserCtxtPtr ret_val;
15567     const char * filename; /* the filename */
15568     int n_filename;
15569     char * encoding; /* a free form C string describing the HTML document encoding, or NULL */
15570     int n_encoding;
15571 
15572     for (n_filename = 0;n_filename < gen_nb_fileoutput;n_filename++) {
15573     for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
15574         mem_base = xmlMemBlocks();
15575         filename = gen_fileoutput(n_filename, 0);
15576         encoding = gen_const_char_ptr(n_encoding, 1);
15577 
15578         ret_val = htmlCreateFileParserCtxt(filename, (const char *)encoding);
15579         desret_htmlParserCtxtPtr(ret_val);
15580         call_tests++;
15581         des_fileoutput(n_filename, filename, 0);
15582         des_const_char_ptr(n_encoding, (const char *)encoding, 1);
15583         xmlResetLastError();
15584         if (mem_base != xmlMemBlocks()) {
15585             printf("Leak of %d blocks found in htmlCreateFileParserCtxt",
15586 	           xmlMemBlocks() - mem_base);
15587 	    test_ret++;
15588             printf(" %d", n_filename);
15589             printf(" %d", n_encoding);
15590             printf("\n");
15591         }
15592     }
15593     }
15594     function_tests++;
15595 #endif
15596 
15597     return(test_ret);
15598 }
15599 
15600 
15601 static int
test_htmlInitAutoClose(void)15602 test_htmlInitAutoClose(void) {
15603     int test_ret = 0;
15604 
15605 #if defined(LIBXML_HTML_ENABLED)
15606     int mem_base;
15607 
15608         mem_base = xmlMemBlocks();
15609 
15610         htmlInitAutoClose();
15611         call_tests++;
15612         xmlResetLastError();
15613         if (mem_base != xmlMemBlocks()) {
15614             printf("Leak of %d blocks found in htmlInitAutoClose",
15615 	           xmlMemBlocks() - mem_base);
15616 	    test_ret++;
15617             printf("\n");
15618         }
15619     function_tests++;
15620 #endif
15621 
15622     return(test_ret);
15623 }
15624 
15625 
15626 static int
test_inputPop(void)15627 test_inputPop(void) {
15628     int test_ret = 0;
15629 
15630     int mem_base;
15631     xmlParserInputPtr ret_val;
15632     xmlParserCtxtPtr ctxt; /* an XML parser context */
15633     int n_ctxt;
15634 
15635     for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
15636         mem_base = xmlMemBlocks();
15637         ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
15638 
15639         ret_val = inputPop(ctxt);
15640         desret_xmlParserInputPtr(ret_val);
15641         call_tests++;
15642         des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
15643         xmlResetLastError();
15644         if (mem_base != xmlMemBlocks()) {
15645             printf("Leak of %d blocks found in inputPop",
15646 	           xmlMemBlocks() - mem_base);
15647 	    test_ret++;
15648             printf(" %d", n_ctxt);
15649             printf("\n");
15650         }
15651     }
15652     function_tests++;
15653 
15654     return(test_ret);
15655 }
15656 
15657 
15658 static int
test_inputPush(void)15659 test_inputPush(void) {
15660     int test_ret = 0;
15661 
15662     int mem_base;
15663     int ret_val;
15664     xmlParserCtxtPtr ctxt; /* an XML parser context */
15665     int n_ctxt;
15666     xmlParserInputPtr value; /* the parser input */
15667     int n_value;
15668 
15669     for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
15670     for (n_value = 0;n_value < gen_nb_xmlParserInputPtr;n_value++) {
15671         mem_base = xmlMemBlocks();
15672         ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
15673         value = gen_xmlParserInputPtr(n_value, 1);
15674 
15675         ret_val = inputPush(ctxt, value);
15676         desret_int(ret_val);
15677         call_tests++;
15678         des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
15679         des_xmlParserInputPtr(n_value, value, 1);
15680         xmlResetLastError();
15681         if (mem_base != xmlMemBlocks()) {
15682             printf("Leak of %d blocks found in inputPush",
15683 	           xmlMemBlocks() - mem_base);
15684 	    test_ret++;
15685             printf(" %d", n_ctxt);
15686             printf(" %d", n_value);
15687             printf("\n");
15688         }
15689     }
15690     }
15691     function_tests++;
15692 
15693     return(test_ret);
15694 }
15695 
15696 
15697 static int
test_namePop(void)15698 test_namePop(void) {
15699     int test_ret = 0;
15700 
15701     int mem_base;
15702     const xmlChar * ret_val;
15703     xmlParserCtxtPtr ctxt; /* an XML parser context */
15704     int n_ctxt;
15705 
15706     for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
15707         mem_base = xmlMemBlocks();
15708         ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
15709 
15710         ret_val = namePop(ctxt);
15711         desret_const_xmlChar_ptr(ret_val);
15712         call_tests++;
15713         des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
15714         xmlResetLastError();
15715         if (mem_base != xmlMemBlocks()) {
15716             printf("Leak of %d blocks found in namePop",
15717 	           xmlMemBlocks() - mem_base);
15718 	    test_ret++;
15719             printf(" %d", n_ctxt);
15720             printf("\n");
15721         }
15722     }
15723     function_tests++;
15724 
15725     return(test_ret);
15726 }
15727 
15728 
15729 static int
test_namePush(void)15730 test_namePush(void) {
15731     int test_ret = 0;
15732 
15733     int mem_base;
15734     int ret_val;
15735     xmlParserCtxtPtr ctxt; /* an XML parser context */
15736     int n_ctxt;
15737     xmlChar * value; /* the element name */
15738     int n_value;
15739 
15740     for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
15741     for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
15742         mem_base = xmlMemBlocks();
15743         ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
15744         value = gen_const_xmlChar_ptr(n_value, 1);
15745 
15746         ret_val = namePush(ctxt, (const xmlChar *)value);
15747         desret_int(ret_val);
15748         call_tests++;
15749         des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
15750         des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 1);
15751         xmlResetLastError();
15752         if (mem_base != xmlMemBlocks()) {
15753             printf("Leak of %d blocks found in namePush",
15754 	           xmlMemBlocks() - mem_base);
15755 	    test_ret++;
15756             printf(" %d", n_ctxt);
15757             printf(" %d", n_value);
15758             printf("\n");
15759         }
15760     }
15761     }
15762     function_tests++;
15763 
15764     return(test_ret);
15765 }
15766 
15767 
15768 static int
test_nodePop(void)15769 test_nodePop(void) {
15770     int test_ret = 0;
15771 
15772     int mem_base;
15773     xmlNodePtr ret_val;
15774     xmlParserCtxtPtr ctxt; /* an XML parser context */
15775     int n_ctxt;
15776 
15777     for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
15778         mem_base = xmlMemBlocks();
15779         ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
15780 
15781         ret_val = nodePop(ctxt);
15782         desret_xmlNodePtr(ret_val);
15783         call_tests++;
15784         des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
15785         xmlResetLastError();
15786         if (mem_base != xmlMemBlocks()) {
15787             printf("Leak of %d blocks found in nodePop",
15788 	           xmlMemBlocks() - mem_base);
15789 	    test_ret++;
15790             printf(" %d", n_ctxt);
15791             printf("\n");
15792         }
15793     }
15794     function_tests++;
15795 
15796     return(test_ret);
15797 }
15798 
15799 
15800 static int
test_nodePush(void)15801 test_nodePush(void) {
15802     int test_ret = 0;
15803 
15804     int mem_base;
15805     int ret_val;
15806     xmlParserCtxtPtr ctxt; /* an XML parser context */
15807     int n_ctxt;
15808     xmlNodePtr value; /* the element node */
15809     int n_value;
15810 
15811     for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
15812     for (n_value = 0;n_value < gen_nb_xmlNodePtr;n_value++) {
15813         mem_base = xmlMemBlocks();
15814         ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
15815         value = gen_xmlNodePtr(n_value, 1);
15816 
15817         ret_val = nodePush(ctxt, value);
15818         desret_int(ret_val);
15819         call_tests++;
15820         des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
15821         des_xmlNodePtr(n_value, value, 1);
15822         xmlResetLastError();
15823         if (mem_base != xmlMemBlocks()) {
15824             printf("Leak of %d blocks found in nodePush",
15825 	           xmlMemBlocks() - mem_base);
15826 	    test_ret++;
15827             printf(" %d", n_ctxt);
15828             printf(" %d", n_value);
15829             printf("\n");
15830         }
15831     }
15832     }
15833     function_tests++;
15834 
15835     return(test_ret);
15836 }
15837 
15838 
15839 static int
test_xmlCheckLanguageID(void)15840 test_xmlCheckLanguageID(void) {
15841     int test_ret = 0;
15842 
15843     int mem_base;
15844     int ret_val;
15845     xmlChar * lang; /* pointer to the string value */
15846     int n_lang;
15847 
15848     for (n_lang = 0;n_lang < gen_nb_const_xmlChar_ptr;n_lang++) {
15849         mem_base = xmlMemBlocks();
15850         lang = gen_const_xmlChar_ptr(n_lang, 0);
15851 
15852         ret_val = xmlCheckLanguageID((const xmlChar *)lang);
15853         desret_int(ret_val);
15854         call_tests++;
15855         des_const_xmlChar_ptr(n_lang, (const xmlChar *)lang, 0);
15856         xmlResetLastError();
15857         if (mem_base != xmlMemBlocks()) {
15858             printf("Leak of %d blocks found in xmlCheckLanguageID",
15859 	           xmlMemBlocks() - mem_base);
15860 	    test_ret++;
15861             printf(" %d", n_lang);
15862             printf("\n");
15863         }
15864     }
15865     function_tests++;
15866 
15867     return(test_ret);
15868 }
15869 
15870 
15871 static int
test_xmlCopyChar(void)15872 test_xmlCopyChar(void) {
15873     int test_ret = 0;
15874 
15875     int mem_base;
15876     int ret_val;
15877     int len; /* Ignored, compatibility */
15878     int n_len;
15879     xmlChar * out; /* pointer to an array of xmlChar */
15880     int n_out;
15881     int val; /* the char value */
15882     int n_val;
15883 
15884     for (n_len = 0;n_len < gen_nb_int;n_len++) {
15885     for (n_out = 0;n_out < gen_nb_xmlChar_ptr;n_out++) {
15886     for (n_val = 0;n_val < gen_nb_int;n_val++) {
15887         mem_base = xmlMemBlocks();
15888         len = gen_int(n_len, 0);
15889         out = gen_xmlChar_ptr(n_out, 1);
15890         val = gen_int(n_val, 2);
15891 
15892         ret_val = xmlCopyChar(len, out, val);
15893         desret_int(ret_val);
15894         call_tests++;
15895         des_int(n_len, len, 0);
15896         des_xmlChar_ptr(n_out, out, 1);
15897         des_int(n_val, val, 2);
15898         xmlResetLastError();
15899         if (mem_base != xmlMemBlocks()) {
15900             printf("Leak of %d blocks found in xmlCopyChar",
15901 	           xmlMemBlocks() - mem_base);
15902 	    test_ret++;
15903             printf(" %d", n_len);
15904             printf(" %d", n_out);
15905             printf(" %d", n_val);
15906             printf("\n");
15907         }
15908     }
15909     }
15910     }
15911     function_tests++;
15912 
15913     return(test_ret);
15914 }
15915 
15916 
15917 static int
test_xmlCopyCharMultiByte(void)15918 test_xmlCopyCharMultiByte(void) {
15919     int test_ret = 0;
15920 
15921     int mem_base;
15922     int ret_val;
15923     xmlChar * out; /* pointer to an array of xmlChar */
15924     int n_out;
15925     int val; /* the char value */
15926     int n_val;
15927 
15928     for (n_out = 0;n_out < gen_nb_xmlChar_ptr;n_out++) {
15929     for (n_val = 0;n_val < gen_nb_int;n_val++) {
15930         mem_base = xmlMemBlocks();
15931         out = gen_xmlChar_ptr(n_out, 0);
15932         val = gen_int(n_val, 1);
15933 
15934         ret_val = xmlCopyCharMultiByte(out, val);
15935         desret_int(ret_val);
15936         call_tests++;
15937         des_xmlChar_ptr(n_out, out, 0);
15938         des_int(n_val, val, 1);
15939         xmlResetLastError();
15940         if (mem_base != xmlMemBlocks()) {
15941             printf("Leak of %d blocks found in xmlCopyCharMultiByte",
15942 	           xmlMemBlocks() - mem_base);
15943 	    test_ret++;
15944             printf(" %d", n_out);
15945             printf(" %d", n_val);
15946             printf("\n");
15947         }
15948     }
15949     }
15950     function_tests++;
15951 
15952     return(test_ret);
15953 }
15954 
15955 
15956 static int
test_xmlCreateEntityParserCtxt(void)15957 test_xmlCreateEntityParserCtxt(void) {
15958     int test_ret = 0;
15959 
15960     int mem_base;
15961     xmlParserCtxtPtr ret_val;
15962     xmlChar * URL; /* the entity URL */
15963     int n_URL;
15964     xmlChar * ID; /* the entity PUBLIC ID */
15965     int n_ID;
15966     xmlChar * base; /* a possible base for the target URI */
15967     int n_base;
15968 
15969     for (n_URL = 0;n_URL < gen_nb_const_xmlChar_ptr;n_URL++) {
15970     for (n_ID = 0;n_ID < gen_nb_const_xmlChar_ptr;n_ID++) {
15971     for (n_base = 0;n_base < gen_nb_const_xmlChar_ptr;n_base++) {
15972         mem_base = xmlMemBlocks();
15973         URL = gen_const_xmlChar_ptr(n_URL, 0);
15974         ID = gen_const_xmlChar_ptr(n_ID, 1);
15975         base = gen_const_xmlChar_ptr(n_base, 2);
15976 
15977         ret_val = xmlCreateEntityParserCtxt((const xmlChar *)URL, (const xmlChar *)ID, (const xmlChar *)base);
15978         desret_xmlParserCtxtPtr(ret_val);
15979         call_tests++;
15980         des_const_xmlChar_ptr(n_URL, (const xmlChar *)URL, 0);
15981         des_const_xmlChar_ptr(n_ID, (const xmlChar *)ID, 1);
15982         des_const_xmlChar_ptr(n_base, (const xmlChar *)base, 2);
15983         xmlResetLastError();
15984         if (mem_base != xmlMemBlocks()) {
15985             printf("Leak of %d blocks found in xmlCreateEntityParserCtxt",
15986 	           xmlMemBlocks() - mem_base);
15987 	    test_ret++;
15988             printf(" %d", n_URL);
15989             printf(" %d", n_ID);
15990             printf(" %d", n_base);
15991             printf("\n");
15992         }
15993     }
15994     }
15995     }
15996     function_tests++;
15997 
15998     return(test_ret);
15999 }
16000 
16001 
16002 static int
test_xmlCreateFileParserCtxt(void)16003 test_xmlCreateFileParserCtxt(void) {
16004     int test_ret = 0;
16005 
16006     int mem_base;
16007     xmlParserCtxtPtr ret_val;
16008     const char * filename; /* the filename */
16009     int n_filename;
16010 
16011     for (n_filename = 0;n_filename < gen_nb_fileoutput;n_filename++) {
16012         mem_base = xmlMemBlocks();
16013         filename = gen_fileoutput(n_filename, 0);
16014 
16015         ret_val = xmlCreateFileParserCtxt(filename);
16016         desret_xmlParserCtxtPtr(ret_val);
16017         call_tests++;
16018         des_fileoutput(n_filename, filename, 0);
16019         xmlResetLastError();
16020         if (mem_base != xmlMemBlocks()) {
16021             printf("Leak of %d blocks found in xmlCreateFileParserCtxt",
16022 	           xmlMemBlocks() - mem_base);
16023 	    test_ret++;
16024             printf(" %d", n_filename);
16025             printf("\n");
16026         }
16027     }
16028     function_tests++;
16029 
16030     return(test_ret);
16031 }
16032 
16033 
16034 static int
test_xmlCreateMemoryParserCtxt(void)16035 test_xmlCreateMemoryParserCtxt(void) {
16036     int test_ret = 0;
16037 
16038     int mem_base;
16039     xmlParserCtxtPtr ret_val;
16040     char * buffer; /* a pointer to a char array */
16041     int n_buffer;
16042     int size; /* the size of the array */
16043     int n_size;
16044 
16045     for (n_buffer = 0;n_buffer < gen_nb_const_char_ptr;n_buffer++) {
16046     for (n_size = 0;n_size < gen_nb_int;n_size++) {
16047         mem_base = xmlMemBlocks();
16048         buffer = gen_const_char_ptr(n_buffer, 0);
16049         size = gen_int(n_size, 1);
16050         if ((buffer != NULL) &&
16051             (size > (int) strlen((const char *) buffer) + 1))
16052             continue;
16053 
16054         ret_val = xmlCreateMemoryParserCtxt((const char *)buffer, size);
16055         desret_xmlParserCtxtPtr(ret_val);
16056         call_tests++;
16057         des_const_char_ptr(n_buffer, (const char *)buffer, 0);
16058         des_int(n_size, size, 1);
16059         xmlResetLastError();
16060         if (mem_base != xmlMemBlocks()) {
16061             printf("Leak of %d blocks found in xmlCreateMemoryParserCtxt",
16062 	           xmlMemBlocks() - mem_base);
16063 	    test_ret++;
16064             printf(" %d", n_buffer);
16065             printf(" %d", n_size);
16066             printf("\n");
16067         }
16068     }
16069     }
16070     function_tests++;
16071 
16072     return(test_ret);
16073 }
16074 
16075 
16076 static int
test_xmlCreateURLParserCtxt(void)16077 test_xmlCreateURLParserCtxt(void) {
16078     int test_ret = 0;
16079 
16080     int mem_base;
16081     xmlParserCtxtPtr ret_val;
16082     const char * filename; /* the filename or URL */
16083     int n_filename;
16084     int options; /* a combination of xmlParserOption */
16085     int n_options;
16086 
16087     for (n_filename = 0;n_filename < gen_nb_fileoutput;n_filename++) {
16088     for (n_options = 0;n_options < gen_nb_int;n_options++) {
16089         mem_base = xmlMemBlocks();
16090         filename = gen_fileoutput(n_filename, 0);
16091         options = gen_int(n_options, 1);
16092 
16093         ret_val = xmlCreateURLParserCtxt(filename, options);
16094         desret_xmlParserCtxtPtr(ret_val);
16095         call_tests++;
16096         des_fileoutput(n_filename, filename, 0);
16097         des_int(n_options, options, 1);
16098         xmlResetLastError();
16099         if (mem_base != xmlMemBlocks()) {
16100             printf("Leak of %d blocks found in xmlCreateURLParserCtxt",
16101 	           xmlMemBlocks() - mem_base);
16102 	    test_ret++;
16103             printf(" %d", n_filename);
16104             printf(" %d", n_options);
16105             printf("\n");
16106         }
16107     }
16108     }
16109     function_tests++;
16110 
16111     return(test_ret);
16112 }
16113 
16114 
16115 static int
test_xmlCurrentChar(void)16116 test_xmlCurrentChar(void) {
16117     int test_ret = 0;
16118 
16119     int mem_base;
16120     int ret_val;
16121     xmlParserCtxtPtr ctxt; /* the XML parser context */
16122     int n_ctxt;
16123     int * len; /* pointer to the length of the char read */
16124     int n_len;
16125 
16126     for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
16127     for (n_len = 0;n_len < gen_nb_int_ptr;n_len++) {
16128         mem_base = xmlMemBlocks();
16129         ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
16130         len = gen_int_ptr(n_len, 1);
16131 
16132         ret_val = xmlCurrentChar(ctxt, len);
16133         desret_int(ret_val);
16134         call_tests++;
16135         des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
16136         des_int_ptr(n_len, len, 1);
16137         xmlResetLastError();
16138         if (mem_base != xmlMemBlocks()) {
16139             printf("Leak of %d blocks found in xmlCurrentChar",
16140 	           xmlMemBlocks() - mem_base);
16141 	    test_ret++;
16142             printf(" %d", n_ctxt);
16143             printf(" %d", n_len);
16144             printf("\n");
16145         }
16146     }
16147     }
16148     function_tests++;
16149 
16150     return(test_ret);
16151 }
16152 
16153 
16154 static int
test_xmlErrMemory(void)16155 test_xmlErrMemory(void) {
16156     int test_ret = 0;
16157 
16158     int mem_base;
16159     xmlParserCtxtPtr ctxt; /* an XML parser context */
16160     int n_ctxt;
16161     char * extra; /* extra informations */
16162     int n_extra;
16163 
16164     for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
16165     for (n_extra = 0;n_extra < gen_nb_const_char_ptr;n_extra++) {
16166         mem_base = xmlMemBlocks();
16167         ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
16168         extra = gen_const_char_ptr(n_extra, 1);
16169 
16170         xmlErrMemory(ctxt, (const char *)extra);
16171         call_tests++;
16172         des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
16173         des_const_char_ptr(n_extra, (const char *)extra, 1);
16174         xmlResetLastError();
16175         if (mem_base != xmlMemBlocks()) {
16176             printf("Leak of %d blocks found in xmlErrMemory",
16177 	           xmlMemBlocks() - mem_base);
16178 	    test_ret++;
16179             printf(" %d", n_ctxt);
16180             printf(" %d", n_extra);
16181             printf("\n");
16182         }
16183     }
16184     }
16185     function_tests++;
16186 
16187     return(test_ret);
16188 }
16189 
16190 
16191 static int
test_xmlIsLetter(void)16192 test_xmlIsLetter(void) {
16193     int test_ret = 0;
16194 
16195     int mem_base;
16196     int ret_val;
16197     int c; /* an unicode character (int) */
16198     int n_c;
16199 
16200     for (n_c = 0;n_c < gen_nb_int;n_c++) {
16201         mem_base = xmlMemBlocks();
16202         c = gen_int(n_c, 0);
16203 
16204         ret_val = xmlIsLetter(c);
16205         desret_int(ret_val);
16206         call_tests++;
16207         des_int(n_c, c, 0);
16208         xmlResetLastError();
16209         if (mem_base != xmlMemBlocks()) {
16210             printf("Leak of %d blocks found in xmlIsLetter",
16211 	           xmlMemBlocks() - mem_base);
16212 	    test_ret++;
16213             printf(" %d", n_c);
16214             printf("\n");
16215         }
16216     }
16217     function_tests++;
16218 
16219     return(test_ret);
16220 }
16221 
16222 
16223 static int
test_xmlNewEntityInputStream(void)16224 test_xmlNewEntityInputStream(void) {
16225     int test_ret = 0;
16226 
16227     int mem_base;
16228     xmlParserInputPtr ret_val;
16229     xmlParserCtxtPtr ctxt; /* an XML parser context */
16230     int n_ctxt;
16231     xmlEntityPtr entity; /* an Entity pointer */
16232     int n_entity;
16233 
16234     for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
16235     for (n_entity = 0;n_entity < gen_nb_xmlEntityPtr;n_entity++) {
16236         mem_base = xmlMemBlocks();
16237         ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
16238         entity = gen_xmlEntityPtr(n_entity, 1);
16239 
16240         ret_val = xmlNewEntityInputStream(ctxt, entity);
16241         desret_xmlParserInputPtr(ret_val);
16242         call_tests++;
16243         des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
16244         des_xmlEntityPtr(n_entity, entity, 1);
16245         xmlResetLastError();
16246         if (mem_base != xmlMemBlocks()) {
16247             printf("Leak of %d blocks found in xmlNewEntityInputStream",
16248 	           xmlMemBlocks() - mem_base);
16249 	    test_ret++;
16250             printf(" %d", n_ctxt);
16251             printf(" %d", n_entity);
16252             printf("\n");
16253         }
16254     }
16255     }
16256     function_tests++;
16257 
16258     return(test_ret);
16259 }
16260 
16261 
16262 static int
test_xmlNewInputFromFile(void)16263 test_xmlNewInputFromFile(void) {
16264     int test_ret = 0;
16265 
16266     int mem_base;
16267     xmlParserInputPtr ret_val;
16268     xmlParserCtxtPtr ctxt; /* an XML parser context */
16269     int n_ctxt;
16270     const char * filename; /* the filename to use as entity */
16271     int n_filename;
16272 
16273     for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
16274     for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
16275         mem_base = xmlMemBlocks();
16276         ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
16277         filename = gen_filepath(n_filename, 1);
16278 
16279         ret_val = xmlNewInputFromFile(ctxt, filename);
16280         desret_xmlParserInputPtr(ret_val);
16281         call_tests++;
16282         des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
16283         des_filepath(n_filename, filename, 1);
16284         xmlResetLastError();
16285         if (mem_base != xmlMemBlocks()) {
16286             printf("Leak of %d blocks found in xmlNewInputFromFile",
16287 	           xmlMemBlocks() - mem_base);
16288 	    test_ret++;
16289             printf(" %d", n_ctxt);
16290             printf(" %d", n_filename);
16291             printf("\n");
16292         }
16293     }
16294     }
16295     function_tests++;
16296 
16297     return(test_ret);
16298 }
16299 
16300 
16301 static int
test_xmlNewInputStream(void)16302 test_xmlNewInputStream(void) {
16303     int test_ret = 0;
16304 
16305     int mem_base;
16306     xmlParserInputPtr ret_val;
16307     xmlParserCtxtPtr ctxt; /* an XML parser context */
16308     int n_ctxt;
16309 
16310     for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
16311         mem_base = xmlMemBlocks();
16312         ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
16313 
16314         ret_val = xmlNewInputStream(ctxt);
16315         desret_xmlParserInputPtr(ret_val);
16316         call_tests++;
16317         des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
16318         xmlResetLastError();
16319         if (mem_base != xmlMemBlocks()) {
16320             printf("Leak of %d blocks found in xmlNewInputStream",
16321 	           xmlMemBlocks() - mem_base);
16322 	    test_ret++;
16323             printf(" %d", n_ctxt);
16324             printf("\n");
16325         }
16326     }
16327     function_tests++;
16328 
16329     return(test_ret);
16330 }
16331 
16332 
16333 static int
test_xmlNewStringInputStream(void)16334 test_xmlNewStringInputStream(void) {
16335     int test_ret = 0;
16336 
16337     int mem_base;
16338     xmlParserInputPtr ret_val;
16339     xmlParserCtxtPtr ctxt; /* an XML parser context */
16340     int n_ctxt;
16341     xmlChar * buffer; /* an memory buffer */
16342     int n_buffer;
16343 
16344     for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
16345     for (n_buffer = 0;n_buffer < gen_nb_const_xmlChar_ptr;n_buffer++) {
16346         mem_base = xmlMemBlocks();
16347         ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
16348         buffer = gen_const_xmlChar_ptr(n_buffer, 1);
16349 
16350         ret_val = xmlNewStringInputStream(ctxt, (const xmlChar *)buffer);
16351         desret_xmlParserInputPtr(ret_val);
16352         call_tests++;
16353         des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
16354         des_const_xmlChar_ptr(n_buffer, (const xmlChar *)buffer, 1);
16355         xmlResetLastError();
16356         if (mem_base != xmlMemBlocks()) {
16357             printf("Leak of %d blocks found in xmlNewStringInputStream",
16358 	           xmlMemBlocks() - mem_base);
16359 	    test_ret++;
16360             printf(" %d", n_ctxt);
16361             printf(" %d", n_buffer);
16362             printf("\n");
16363         }
16364     }
16365     }
16366     function_tests++;
16367 
16368     return(test_ret);
16369 }
16370 
16371 
16372 static int
test_xmlNextChar(void)16373 test_xmlNextChar(void) {
16374     int test_ret = 0;
16375 
16376     int mem_base;
16377     xmlParserCtxtPtr ctxt; /* the XML parser context */
16378     int n_ctxt;
16379 
16380     for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
16381         mem_base = xmlMemBlocks();
16382         ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
16383 
16384         xmlNextChar(ctxt);
16385         call_tests++;
16386         des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
16387         xmlResetLastError();
16388         if (mem_base != xmlMemBlocks()) {
16389             printf("Leak of %d blocks found in xmlNextChar",
16390 	           xmlMemBlocks() - mem_base);
16391 	    test_ret++;
16392             printf(" %d", n_ctxt);
16393             printf("\n");
16394         }
16395     }
16396     function_tests++;
16397 
16398     return(test_ret);
16399 }
16400 
16401 
16402 static int
test_xmlParserInputShrink(void)16403 test_xmlParserInputShrink(void) {
16404     int test_ret = 0;
16405 
16406     int mem_base;
16407     xmlParserInputPtr in; /* an XML parser input */
16408     int n_in;
16409 
16410     for (n_in = 0;n_in < gen_nb_xmlParserInputPtr;n_in++) {
16411         mem_base = xmlMemBlocks();
16412         in = gen_xmlParserInputPtr(n_in, 0);
16413 
16414         xmlParserInputShrink(in);
16415         call_tests++;
16416         des_xmlParserInputPtr(n_in, in, 0);
16417         xmlResetLastError();
16418         if (mem_base != xmlMemBlocks()) {
16419             printf("Leak of %d blocks found in xmlParserInputShrink",
16420 	           xmlMemBlocks() - mem_base);
16421 	    test_ret++;
16422             printf(" %d", n_in);
16423             printf("\n");
16424         }
16425     }
16426     function_tests++;
16427 
16428     return(test_ret);
16429 }
16430 
16431 
16432 static int
test_xmlPopInput(void)16433 test_xmlPopInput(void) {
16434     int test_ret = 0;
16435 
16436     int mem_base;
16437     xmlChar ret_val;
16438     xmlParserCtxtPtr ctxt; /* an XML parser context */
16439     int n_ctxt;
16440 
16441     for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
16442         mem_base = xmlMemBlocks();
16443         ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
16444 
16445         ret_val = xmlPopInput(ctxt);
16446         desret_xmlChar(ret_val);
16447         call_tests++;
16448         des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
16449         xmlResetLastError();
16450         if (mem_base != xmlMemBlocks()) {
16451             printf("Leak of %d blocks found in xmlPopInput",
16452 	           xmlMemBlocks() - mem_base);
16453 	    test_ret++;
16454             printf(" %d", n_ctxt);
16455             printf("\n");
16456         }
16457     }
16458     function_tests++;
16459 
16460     return(test_ret);
16461 }
16462 
16463 
16464 static int
test_xmlPushInput(void)16465 test_xmlPushInput(void) {
16466     int test_ret = 0;
16467 
16468     int mem_base;
16469     int ret_val;
16470     xmlParserCtxtPtr ctxt; /* an XML parser context */
16471     int n_ctxt;
16472     xmlParserInputPtr input; /* an XML parser input fragment (entity, XML fragment ...). */
16473     int n_input;
16474 
16475     for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
16476     for (n_input = 0;n_input < gen_nb_xmlParserInputPtr;n_input++) {
16477         mem_base = xmlMemBlocks();
16478         ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
16479         input = gen_xmlParserInputPtr(n_input, 1);
16480 
16481         ret_val = xmlPushInput(ctxt, input);
16482         desret_int(ret_val);
16483         call_tests++;
16484         des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
16485         des_xmlParserInputPtr(n_input, input, 1);
16486         xmlResetLastError();
16487         if (mem_base != xmlMemBlocks()) {
16488             printf("Leak of %d blocks found in xmlPushInput",
16489 	           xmlMemBlocks() - mem_base);
16490 	    test_ret++;
16491             printf(" %d", n_ctxt);
16492             printf(" %d", n_input);
16493             printf("\n");
16494         }
16495     }
16496     }
16497     function_tests++;
16498 
16499     return(test_ret);
16500 }
16501 
16502 
16503 static int
test_xmlSetEntityReferenceFunc(void)16504 test_xmlSetEntityReferenceFunc(void) {
16505     int test_ret = 0;
16506 
16507 
16508     /* missing type support */
16509     return(test_ret);
16510 }
16511 
16512 
16513 static int
test_xmlSplitQName(void)16514 test_xmlSplitQName(void) {
16515     int test_ret = 0;
16516 
16517     int mem_base;
16518     xmlChar * ret_val;
16519     xmlParserCtxtPtr ctxt; /* an XML parser context */
16520     int n_ctxt;
16521     xmlChar * name; /* an XML parser context */
16522     int n_name;
16523     xmlChar ** prefix; /* a xmlChar ** */
16524     int n_prefix;
16525 
16526     for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
16527     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
16528     for (n_prefix = 0;n_prefix < gen_nb_xmlChar_ptr_ptr;n_prefix++) {
16529         mem_base = xmlMemBlocks();
16530         ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
16531         name = gen_const_xmlChar_ptr(n_name, 1);
16532         prefix = gen_xmlChar_ptr_ptr(n_prefix, 2);
16533 
16534         ret_val = xmlSplitQName(ctxt, (const xmlChar *)name, prefix);
16535         desret_xmlChar_ptr(ret_val);
16536         call_tests++;
16537         des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
16538         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
16539         des_xmlChar_ptr_ptr(n_prefix, prefix, 2);
16540         xmlResetLastError();
16541         if (mem_base != xmlMemBlocks()) {
16542             printf("Leak of %d blocks found in xmlSplitQName",
16543 	           xmlMemBlocks() - mem_base);
16544 	    test_ret++;
16545             printf(" %d", n_ctxt);
16546             printf(" %d", n_name);
16547             printf(" %d", n_prefix);
16548             printf("\n");
16549         }
16550     }
16551     }
16552     }
16553     function_tests++;
16554 
16555     return(test_ret);
16556 }
16557 
16558 
16559 static int
test_xmlStringCurrentChar(void)16560 test_xmlStringCurrentChar(void) {
16561     int test_ret = 0;
16562 
16563     int mem_base;
16564     int ret_val;
16565     xmlParserCtxtPtr ctxt; /* the XML parser context */
16566     int n_ctxt;
16567     xmlChar * cur; /* pointer to the beginning of the char */
16568     int n_cur;
16569     int * len; /* pointer to the length of the char read */
16570     int n_len;
16571 
16572     for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
16573     for (n_cur = 0;n_cur < gen_nb_const_xmlChar_ptr;n_cur++) {
16574     for (n_len = 0;n_len < gen_nb_int_ptr;n_len++) {
16575         mem_base = xmlMemBlocks();
16576         ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
16577         cur = gen_const_xmlChar_ptr(n_cur, 1);
16578         len = gen_int_ptr(n_len, 2);
16579 
16580         ret_val = xmlStringCurrentChar(ctxt, (const xmlChar *)cur, len);
16581         desret_int(ret_val);
16582         call_tests++;
16583         des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
16584         des_const_xmlChar_ptr(n_cur, (const xmlChar *)cur, 1);
16585         des_int_ptr(n_len, len, 2);
16586         xmlResetLastError();
16587         if (mem_base != xmlMemBlocks()) {
16588             printf("Leak of %d blocks found in xmlStringCurrentChar",
16589 	           xmlMemBlocks() - mem_base);
16590 	    test_ret++;
16591             printf(" %d", n_ctxt);
16592             printf(" %d", n_cur);
16593             printf(" %d", n_len);
16594             printf("\n");
16595         }
16596     }
16597     }
16598     }
16599     function_tests++;
16600 
16601     return(test_ret);
16602 }
16603 
16604 
16605 static int
test_xmlStringDecodeEntities(void)16606 test_xmlStringDecodeEntities(void) {
16607     int test_ret = 0;
16608 
16609     int mem_base;
16610     xmlChar * ret_val;
16611     xmlParserCtxtPtr ctxt; /* the parser context */
16612     int n_ctxt;
16613     xmlChar * str; /* the input string */
16614     int n_str;
16615     int what; /* combination of XML_SUBSTITUTE_REF and XML_SUBSTITUTE_PEREF */
16616     int n_what;
16617     xmlChar end; /* an end marker xmlChar, 0 if none */
16618     int n_end;
16619     xmlChar end2; /* an end marker xmlChar, 0 if none */
16620     int n_end2;
16621     xmlChar end3; /* an end marker xmlChar, 0 if none */
16622     int n_end3;
16623 
16624     for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
16625     for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) {
16626     for (n_what = 0;n_what < gen_nb_int;n_what++) {
16627     for (n_end = 0;n_end < gen_nb_xmlChar;n_end++) {
16628     for (n_end2 = 0;n_end2 < gen_nb_xmlChar;n_end2++) {
16629     for (n_end3 = 0;n_end3 < gen_nb_xmlChar;n_end3++) {
16630         mem_base = xmlMemBlocks();
16631         ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
16632         str = gen_const_xmlChar_ptr(n_str, 1);
16633         what = gen_int(n_what, 2);
16634         end = gen_xmlChar(n_end, 3);
16635         end2 = gen_xmlChar(n_end2, 4);
16636         end3 = gen_xmlChar(n_end3, 5);
16637 
16638         ret_val = xmlStringDecodeEntities(ctxt, (const xmlChar *)str, what, end, end2, end3);
16639         desret_xmlChar_ptr(ret_val);
16640         call_tests++;
16641         des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
16642         des_const_xmlChar_ptr(n_str, (const xmlChar *)str, 1);
16643         des_int(n_what, what, 2);
16644         des_xmlChar(n_end, end, 3);
16645         des_xmlChar(n_end2, end2, 4);
16646         des_xmlChar(n_end3, end3, 5);
16647         xmlResetLastError();
16648         if (mem_base != xmlMemBlocks()) {
16649             printf("Leak of %d blocks found in xmlStringDecodeEntities",
16650 	           xmlMemBlocks() - mem_base);
16651 	    test_ret++;
16652             printf(" %d", n_ctxt);
16653             printf(" %d", n_str);
16654             printf(" %d", n_what);
16655             printf(" %d", n_end);
16656             printf(" %d", n_end2);
16657             printf(" %d", n_end3);
16658             printf("\n");
16659         }
16660     }
16661     }
16662     }
16663     }
16664     }
16665     }
16666     function_tests++;
16667 
16668     return(test_ret);
16669 }
16670 
16671 
16672 static int
test_xmlStringLenDecodeEntities(void)16673 test_xmlStringLenDecodeEntities(void) {
16674     int test_ret = 0;
16675 
16676     int mem_base;
16677     xmlChar * ret_val;
16678     xmlParserCtxtPtr ctxt; /* the parser context */
16679     int n_ctxt;
16680     xmlChar * str; /* the input string */
16681     int n_str;
16682     int len; /* the string length */
16683     int n_len;
16684     int what; /* combination of XML_SUBSTITUTE_REF and XML_SUBSTITUTE_PEREF */
16685     int n_what;
16686     xmlChar end; /* an end marker xmlChar, 0 if none */
16687     int n_end;
16688     xmlChar end2; /* an end marker xmlChar, 0 if none */
16689     int n_end2;
16690     xmlChar end3; /* an end marker xmlChar, 0 if none */
16691     int n_end3;
16692 
16693     for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
16694     for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) {
16695     for (n_len = 0;n_len < gen_nb_int;n_len++) {
16696     for (n_what = 0;n_what < gen_nb_int;n_what++) {
16697     for (n_end = 0;n_end < gen_nb_xmlChar;n_end++) {
16698     for (n_end2 = 0;n_end2 < gen_nb_xmlChar;n_end2++) {
16699     for (n_end3 = 0;n_end3 < gen_nb_xmlChar;n_end3++) {
16700         mem_base = xmlMemBlocks();
16701         ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
16702         str = gen_const_xmlChar_ptr(n_str, 1);
16703         len = gen_int(n_len, 2);
16704         what = gen_int(n_what, 3);
16705         end = gen_xmlChar(n_end, 4);
16706         end2 = gen_xmlChar(n_end2, 5);
16707         end3 = gen_xmlChar(n_end3, 6);
16708         if ((str != NULL) &&
16709             (len > (int) strlen((const char *) str) + 1))
16710             continue;
16711 
16712         ret_val = xmlStringLenDecodeEntities(ctxt, (const xmlChar *)str, len, what, end, end2, end3);
16713         desret_xmlChar_ptr(ret_val);
16714         call_tests++;
16715         des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
16716         des_const_xmlChar_ptr(n_str, (const xmlChar *)str, 1);
16717         des_int(n_len, len, 2);
16718         des_int(n_what, what, 3);
16719         des_xmlChar(n_end, end, 4);
16720         des_xmlChar(n_end2, end2, 5);
16721         des_xmlChar(n_end3, end3, 6);
16722         xmlResetLastError();
16723         if (mem_base != xmlMemBlocks()) {
16724             printf("Leak of %d blocks found in xmlStringLenDecodeEntities",
16725 	           xmlMemBlocks() - mem_base);
16726 	    test_ret++;
16727             printf(" %d", n_ctxt);
16728             printf(" %d", n_str);
16729             printf(" %d", n_len);
16730             printf(" %d", n_what);
16731             printf(" %d", n_end);
16732             printf(" %d", n_end2);
16733             printf(" %d", n_end3);
16734             printf("\n");
16735         }
16736     }
16737     }
16738     }
16739     }
16740     }
16741     }
16742     }
16743     function_tests++;
16744 
16745     return(test_ret);
16746 }
16747 
16748 
16749 static int
test_xmlSwitchEncoding(void)16750 test_xmlSwitchEncoding(void) {
16751     int test_ret = 0;
16752 
16753     int mem_base;
16754     int ret_val;
16755     xmlParserCtxtPtr ctxt; /* the parser context */
16756     int n_ctxt;
16757     xmlCharEncoding enc; /* the encoding value (number) */
16758     int n_enc;
16759 
16760     for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
16761     for (n_enc = 0;n_enc < gen_nb_xmlCharEncoding;n_enc++) {
16762         mem_base = xmlMemBlocks();
16763         ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
16764         enc = gen_xmlCharEncoding(n_enc, 1);
16765 
16766         ret_val = xmlSwitchEncoding(ctxt, enc);
16767         desret_int(ret_val);
16768         call_tests++;
16769         des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
16770         des_xmlCharEncoding(n_enc, enc, 1);
16771         xmlResetLastError();
16772         if (mem_base != xmlMemBlocks()) {
16773             printf("Leak of %d blocks found in xmlSwitchEncoding",
16774 	           xmlMemBlocks() - mem_base);
16775 	    test_ret++;
16776             printf(" %d", n_ctxt);
16777             printf(" %d", n_enc);
16778             printf("\n");
16779         }
16780     }
16781     }
16782     function_tests++;
16783 
16784     return(test_ret);
16785 }
16786 
16787 
16788 static int
test_xmlSwitchInputEncoding(void)16789 test_xmlSwitchInputEncoding(void) {
16790     int test_ret = 0;
16791 
16792     int mem_base;
16793     int ret_val;
16794     xmlParserCtxtPtr ctxt; /* the parser context */
16795     int n_ctxt;
16796     xmlParserInputPtr input; /* the input stream */
16797     int n_input;
16798     xmlCharEncodingHandlerPtr handler; /* the encoding handler */
16799     int n_handler;
16800 
16801     for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
16802     for (n_input = 0;n_input < gen_nb_xmlParserInputPtr;n_input++) {
16803     for (n_handler = 0;n_handler < gen_nb_xmlCharEncodingHandlerPtr;n_handler++) {
16804         mem_base = xmlMemBlocks();
16805         ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
16806         input = gen_xmlParserInputPtr(n_input, 1);
16807         handler = gen_xmlCharEncodingHandlerPtr(n_handler, 2);
16808 
16809         ret_val = xmlSwitchInputEncoding(ctxt, input, handler);
16810         desret_int(ret_val);
16811         call_tests++;
16812         des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
16813         des_xmlParserInputPtr(n_input, input, 1);
16814         des_xmlCharEncodingHandlerPtr(n_handler, handler, 2);
16815         xmlResetLastError();
16816         if (mem_base != xmlMemBlocks()) {
16817             printf("Leak of %d blocks found in xmlSwitchInputEncoding",
16818 	           xmlMemBlocks() - mem_base);
16819 	    test_ret++;
16820             printf(" %d", n_ctxt);
16821             printf(" %d", n_input);
16822             printf(" %d", n_handler);
16823             printf("\n");
16824         }
16825     }
16826     }
16827     }
16828     function_tests++;
16829 
16830     return(test_ret);
16831 }
16832 
16833 
16834 static int
test_xmlSwitchToEncoding(void)16835 test_xmlSwitchToEncoding(void) {
16836     int test_ret = 0;
16837 
16838     int mem_base;
16839     int ret_val;
16840     xmlParserCtxtPtr ctxt; /* the parser context */
16841     int n_ctxt;
16842     xmlCharEncodingHandlerPtr handler; /* the encoding handler */
16843     int n_handler;
16844 
16845     for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
16846     for (n_handler = 0;n_handler < gen_nb_xmlCharEncodingHandlerPtr;n_handler++) {
16847         mem_base = xmlMemBlocks();
16848         ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
16849         handler = gen_xmlCharEncodingHandlerPtr(n_handler, 1);
16850 
16851         ret_val = xmlSwitchToEncoding(ctxt, handler);
16852         desret_int(ret_val);
16853         call_tests++;
16854         des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
16855         des_xmlCharEncodingHandlerPtr(n_handler, handler, 1);
16856         xmlResetLastError();
16857         if (mem_base != xmlMemBlocks()) {
16858             printf("Leak of %d blocks found in xmlSwitchToEncoding",
16859 	           xmlMemBlocks() - mem_base);
16860 	    test_ret++;
16861             printf(" %d", n_ctxt);
16862             printf(" %d", n_handler);
16863             printf("\n");
16864         }
16865     }
16866     }
16867     function_tests++;
16868 
16869     return(test_ret);
16870 }
16871 
16872 static int
test_parserInternals(void)16873 test_parserInternals(void) {
16874     int test_ret = 0;
16875 
16876     if (quiet == 0) printf("Testing parserInternals : 33 of 90 functions ...\n");
16877     test_ret += test_htmlCreateFileParserCtxt();
16878     test_ret += test_htmlInitAutoClose();
16879     test_ret += test_inputPop();
16880     test_ret += test_inputPush();
16881     test_ret += test_namePop();
16882     test_ret += test_namePush();
16883     test_ret += test_nodePop();
16884     test_ret += test_nodePush();
16885     test_ret += test_xmlCheckLanguageID();
16886     test_ret += test_xmlCopyChar();
16887     test_ret += test_xmlCopyCharMultiByte();
16888     test_ret += test_xmlCreateEntityParserCtxt();
16889     test_ret += test_xmlCreateFileParserCtxt();
16890     test_ret += test_xmlCreateMemoryParserCtxt();
16891     test_ret += test_xmlCreateURLParserCtxt();
16892     test_ret += test_xmlCurrentChar();
16893     test_ret += test_xmlErrMemory();
16894     test_ret += test_xmlIsLetter();
16895     test_ret += test_xmlNewEntityInputStream();
16896     test_ret += test_xmlNewInputFromFile();
16897     test_ret += test_xmlNewInputStream();
16898     test_ret += test_xmlNewStringInputStream();
16899     test_ret += test_xmlNextChar();
16900     test_ret += test_xmlParserInputShrink();
16901     test_ret += test_xmlPopInput();
16902     test_ret += test_xmlPushInput();
16903     test_ret += test_xmlSetEntityReferenceFunc();
16904     test_ret += test_xmlSplitQName();
16905     test_ret += test_xmlStringCurrentChar();
16906     test_ret += test_xmlStringDecodeEntities();
16907     test_ret += test_xmlStringLenDecodeEntities();
16908     test_ret += test_xmlSwitchEncoding();
16909     test_ret += test_xmlSwitchInputEncoding();
16910     test_ret += test_xmlSwitchToEncoding();
16911 
16912     if (test_ret != 0)
16913 	printf("Module parserInternals: %d errors\n", test_ret);
16914     return(test_ret);
16915 }
16916 
16917 static int
test_xmlPatternFromRoot(void)16918 test_xmlPatternFromRoot(void) {
16919     int test_ret = 0;
16920 
16921 #if defined(LIBXML_PATTERN_ENABLED)
16922     int mem_base;
16923     int ret_val;
16924     xmlPatternPtr comp; /* the precompiled pattern */
16925     int n_comp;
16926 
16927     for (n_comp = 0;n_comp < gen_nb_xmlPatternPtr;n_comp++) {
16928         mem_base = xmlMemBlocks();
16929         comp = gen_xmlPatternPtr(n_comp, 0);
16930 
16931         ret_val = xmlPatternFromRoot(comp);
16932         desret_int(ret_val);
16933         call_tests++;
16934         des_xmlPatternPtr(n_comp, comp, 0);
16935         xmlResetLastError();
16936         if (mem_base != xmlMemBlocks()) {
16937             printf("Leak of %d blocks found in xmlPatternFromRoot",
16938 	           xmlMemBlocks() - mem_base);
16939 	    test_ret++;
16940             printf(" %d", n_comp);
16941             printf("\n");
16942         }
16943     }
16944     function_tests++;
16945 #endif
16946 
16947     return(test_ret);
16948 }
16949 
16950 
16951 static int
test_xmlPatternGetStreamCtxt(void)16952 test_xmlPatternGetStreamCtxt(void) {
16953     int test_ret = 0;
16954 
16955 
16956     /* missing type support */
16957     return(test_ret);
16958 }
16959 
16960 
16961 static int
test_xmlPatternMatch(void)16962 test_xmlPatternMatch(void) {
16963     int test_ret = 0;
16964 
16965 #if defined(LIBXML_PATTERN_ENABLED)
16966     int mem_base;
16967     int ret_val;
16968     xmlPatternPtr comp; /* the precompiled pattern */
16969     int n_comp;
16970     xmlNodePtr node; /* a node */
16971     int n_node;
16972 
16973     for (n_comp = 0;n_comp < gen_nb_xmlPatternPtr;n_comp++) {
16974     for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
16975         mem_base = xmlMemBlocks();
16976         comp = gen_xmlPatternPtr(n_comp, 0);
16977         node = gen_xmlNodePtr(n_node, 1);
16978 
16979         ret_val = xmlPatternMatch(comp, node);
16980         desret_int(ret_val);
16981         call_tests++;
16982         des_xmlPatternPtr(n_comp, comp, 0);
16983         des_xmlNodePtr(n_node, node, 1);
16984         xmlResetLastError();
16985         if (mem_base != xmlMemBlocks()) {
16986             printf("Leak of %d blocks found in xmlPatternMatch",
16987 	           xmlMemBlocks() - mem_base);
16988 	    test_ret++;
16989             printf(" %d", n_comp);
16990             printf(" %d", n_node);
16991             printf("\n");
16992         }
16993     }
16994     }
16995     function_tests++;
16996 #endif
16997 
16998     return(test_ret);
16999 }
17000 
17001 
17002 static int
test_xmlPatternMaxDepth(void)17003 test_xmlPatternMaxDepth(void) {
17004     int test_ret = 0;
17005 
17006 #if defined(LIBXML_PATTERN_ENABLED)
17007     int mem_base;
17008     int ret_val;
17009     xmlPatternPtr comp; /* the precompiled pattern */
17010     int n_comp;
17011 
17012     for (n_comp = 0;n_comp < gen_nb_xmlPatternPtr;n_comp++) {
17013         mem_base = xmlMemBlocks();
17014         comp = gen_xmlPatternPtr(n_comp, 0);
17015 
17016         ret_val = xmlPatternMaxDepth(comp);
17017         desret_int(ret_val);
17018         call_tests++;
17019         des_xmlPatternPtr(n_comp, comp, 0);
17020         xmlResetLastError();
17021         if (mem_base != xmlMemBlocks()) {
17022             printf("Leak of %d blocks found in xmlPatternMaxDepth",
17023 	           xmlMemBlocks() - mem_base);
17024 	    test_ret++;
17025             printf(" %d", n_comp);
17026             printf("\n");
17027         }
17028     }
17029     function_tests++;
17030 #endif
17031 
17032     return(test_ret);
17033 }
17034 
17035 
17036 static int
test_xmlPatternMinDepth(void)17037 test_xmlPatternMinDepth(void) {
17038     int test_ret = 0;
17039 
17040 #if defined(LIBXML_PATTERN_ENABLED)
17041     int mem_base;
17042     int ret_val;
17043     xmlPatternPtr comp; /* the precompiled pattern */
17044     int n_comp;
17045 
17046     for (n_comp = 0;n_comp < gen_nb_xmlPatternPtr;n_comp++) {
17047         mem_base = xmlMemBlocks();
17048         comp = gen_xmlPatternPtr(n_comp, 0);
17049 
17050         ret_val = xmlPatternMinDepth(comp);
17051         desret_int(ret_val);
17052         call_tests++;
17053         des_xmlPatternPtr(n_comp, comp, 0);
17054         xmlResetLastError();
17055         if (mem_base != xmlMemBlocks()) {
17056             printf("Leak of %d blocks found in xmlPatternMinDepth",
17057 	           xmlMemBlocks() - mem_base);
17058 	    test_ret++;
17059             printf(" %d", n_comp);
17060             printf("\n");
17061         }
17062     }
17063     function_tests++;
17064 #endif
17065 
17066     return(test_ret);
17067 }
17068 
17069 
17070 static int
test_xmlPatternStreamable(void)17071 test_xmlPatternStreamable(void) {
17072     int test_ret = 0;
17073 
17074 #if defined(LIBXML_PATTERN_ENABLED)
17075     int mem_base;
17076     int ret_val;
17077     xmlPatternPtr comp; /* the precompiled pattern */
17078     int n_comp;
17079 
17080     for (n_comp = 0;n_comp < gen_nb_xmlPatternPtr;n_comp++) {
17081         mem_base = xmlMemBlocks();
17082         comp = gen_xmlPatternPtr(n_comp, 0);
17083 
17084         ret_val = xmlPatternStreamable(comp);
17085         desret_int(ret_val);
17086         call_tests++;
17087         des_xmlPatternPtr(n_comp, comp, 0);
17088         xmlResetLastError();
17089         if (mem_base != xmlMemBlocks()) {
17090             printf("Leak of %d blocks found in xmlPatternStreamable",
17091 	           xmlMemBlocks() - mem_base);
17092 	    test_ret++;
17093             printf(" %d", n_comp);
17094             printf("\n");
17095         }
17096     }
17097     function_tests++;
17098 #endif
17099 
17100     return(test_ret);
17101 }
17102 
17103 
17104 static int
test_xmlPatterncompile(void)17105 test_xmlPatterncompile(void) {
17106     int test_ret = 0;
17107 
17108 
17109     /* missing type support */
17110     return(test_ret);
17111 }
17112 
17113 #ifdef LIBXML_PATTERN_ENABLED
17114 
17115 #define gen_nb_xmlStreamCtxtPtr 1
gen_xmlStreamCtxtPtr(int no ATTRIBUTE_UNUSED,int nr ATTRIBUTE_UNUSED)17116 static xmlStreamCtxtPtr gen_xmlStreamCtxtPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
17117     return(NULL);
17118 }
des_xmlStreamCtxtPtr(int no ATTRIBUTE_UNUSED,xmlStreamCtxtPtr val ATTRIBUTE_UNUSED,int nr ATTRIBUTE_UNUSED)17119 static void des_xmlStreamCtxtPtr(int no ATTRIBUTE_UNUSED, xmlStreamCtxtPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
17120 }
17121 #endif
17122 
17123 
17124 static int
test_xmlStreamPop(void)17125 test_xmlStreamPop(void) {
17126     int test_ret = 0;
17127 
17128 #if defined(LIBXML_PATTERN_ENABLED)
17129     int mem_base;
17130     int ret_val;
17131     xmlStreamCtxtPtr stream; /* the stream context */
17132     int n_stream;
17133 
17134     for (n_stream = 0;n_stream < gen_nb_xmlStreamCtxtPtr;n_stream++) {
17135         mem_base = xmlMemBlocks();
17136         stream = gen_xmlStreamCtxtPtr(n_stream, 0);
17137 
17138         ret_val = xmlStreamPop(stream);
17139         desret_int(ret_val);
17140         call_tests++;
17141         des_xmlStreamCtxtPtr(n_stream, stream, 0);
17142         xmlResetLastError();
17143         if (mem_base != xmlMemBlocks()) {
17144             printf("Leak of %d blocks found in xmlStreamPop",
17145 	           xmlMemBlocks() - mem_base);
17146 	    test_ret++;
17147             printf(" %d", n_stream);
17148             printf("\n");
17149         }
17150     }
17151     function_tests++;
17152 #endif
17153 
17154     return(test_ret);
17155 }
17156 
17157 
17158 static int
test_xmlStreamPush(void)17159 test_xmlStreamPush(void) {
17160     int test_ret = 0;
17161 
17162 #if defined(LIBXML_PATTERN_ENABLED)
17163     int mem_base;
17164     int ret_val;
17165     xmlStreamCtxtPtr stream; /* the stream context */
17166     int n_stream;
17167     xmlChar * name; /* the current name */
17168     int n_name;
17169     xmlChar * ns; /* the namespace name */
17170     int n_ns;
17171 
17172     for (n_stream = 0;n_stream < gen_nb_xmlStreamCtxtPtr;n_stream++) {
17173     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
17174     for (n_ns = 0;n_ns < gen_nb_const_xmlChar_ptr;n_ns++) {
17175         mem_base = xmlMemBlocks();
17176         stream = gen_xmlStreamCtxtPtr(n_stream, 0);
17177         name = gen_const_xmlChar_ptr(n_name, 1);
17178         ns = gen_const_xmlChar_ptr(n_ns, 2);
17179 
17180         ret_val = xmlStreamPush(stream, (const xmlChar *)name, (const xmlChar *)ns);
17181         desret_int(ret_val);
17182         call_tests++;
17183         des_xmlStreamCtxtPtr(n_stream, stream, 0);
17184         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
17185         des_const_xmlChar_ptr(n_ns, (const xmlChar *)ns, 2);
17186         xmlResetLastError();
17187         if (mem_base != xmlMemBlocks()) {
17188             printf("Leak of %d blocks found in xmlStreamPush",
17189 	           xmlMemBlocks() - mem_base);
17190 	    test_ret++;
17191             printf(" %d", n_stream);
17192             printf(" %d", n_name);
17193             printf(" %d", n_ns);
17194             printf("\n");
17195         }
17196     }
17197     }
17198     }
17199     function_tests++;
17200 #endif
17201 
17202     return(test_ret);
17203 }
17204 
17205 
17206 static int
test_xmlStreamPushAttr(void)17207 test_xmlStreamPushAttr(void) {
17208     int test_ret = 0;
17209 
17210 #if defined(LIBXML_PATTERN_ENABLED)
17211     int mem_base;
17212     int ret_val;
17213     xmlStreamCtxtPtr stream; /* the stream context */
17214     int n_stream;
17215     xmlChar * name; /* the current name */
17216     int n_name;
17217     xmlChar * ns; /* the namespace name */
17218     int n_ns;
17219 
17220     for (n_stream = 0;n_stream < gen_nb_xmlStreamCtxtPtr;n_stream++) {
17221     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
17222     for (n_ns = 0;n_ns < gen_nb_const_xmlChar_ptr;n_ns++) {
17223         mem_base = xmlMemBlocks();
17224         stream = gen_xmlStreamCtxtPtr(n_stream, 0);
17225         name = gen_const_xmlChar_ptr(n_name, 1);
17226         ns = gen_const_xmlChar_ptr(n_ns, 2);
17227 
17228         ret_val = xmlStreamPushAttr(stream, (const xmlChar *)name, (const xmlChar *)ns);
17229         desret_int(ret_val);
17230         call_tests++;
17231         des_xmlStreamCtxtPtr(n_stream, stream, 0);
17232         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
17233         des_const_xmlChar_ptr(n_ns, (const xmlChar *)ns, 2);
17234         xmlResetLastError();
17235         if (mem_base != xmlMemBlocks()) {
17236             printf("Leak of %d blocks found in xmlStreamPushAttr",
17237 	           xmlMemBlocks() - mem_base);
17238 	    test_ret++;
17239             printf(" %d", n_stream);
17240             printf(" %d", n_name);
17241             printf(" %d", n_ns);
17242             printf("\n");
17243         }
17244     }
17245     }
17246     }
17247     function_tests++;
17248 #endif
17249 
17250     return(test_ret);
17251 }
17252 
17253 
17254 static int
test_xmlStreamPushNode(void)17255 test_xmlStreamPushNode(void) {
17256     int test_ret = 0;
17257 
17258 #if defined(LIBXML_PATTERN_ENABLED)
17259     int mem_base;
17260     int ret_val;
17261     xmlStreamCtxtPtr stream; /* the stream context */
17262     int n_stream;
17263     xmlChar * name; /* the current name */
17264     int n_name;
17265     xmlChar * ns; /* the namespace name */
17266     int n_ns;
17267     int nodeType; /* the type of the node being pushed */
17268     int n_nodeType;
17269 
17270     for (n_stream = 0;n_stream < gen_nb_xmlStreamCtxtPtr;n_stream++) {
17271     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
17272     for (n_ns = 0;n_ns < gen_nb_const_xmlChar_ptr;n_ns++) {
17273     for (n_nodeType = 0;n_nodeType < gen_nb_int;n_nodeType++) {
17274         mem_base = xmlMemBlocks();
17275         stream = gen_xmlStreamCtxtPtr(n_stream, 0);
17276         name = gen_const_xmlChar_ptr(n_name, 1);
17277         ns = gen_const_xmlChar_ptr(n_ns, 2);
17278         nodeType = gen_int(n_nodeType, 3);
17279 
17280         ret_val = xmlStreamPushNode(stream, (const xmlChar *)name, (const xmlChar *)ns, nodeType);
17281         desret_int(ret_val);
17282         call_tests++;
17283         des_xmlStreamCtxtPtr(n_stream, stream, 0);
17284         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
17285         des_const_xmlChar_ptr(n_ns, (const xmlChar *)ns, 2);
17286         des_int(n_nodeType, nodeType, 3);
17287         xmlResetLastError();
17288         if (mem_base != xmlMemBlocks()) {
17289             printf("Leak of %d blocks found in xmlStreamPushNode",
17290 	           xmlMemBlocks() - mem_base);
17291 	    test_ret++;
17292             printf(" %d", n_stream);
17293             printf(" %d", n_name);
17294             printf(" %d", n_ns);
17295             printf(" %d", n_nodeType);
17296             printf("\n");
17297         }
17298     }
17299     }
17300     }
17301     }
17302     function_tests++;
17303 #endif
17304 
17305     return(test_ret);
17306 }
17307 
17308 
17309 static int
test_xmlStreamWantsAnyNode(void)17310 test_xmlStreamWantsAnyNode(void) {
17311     int test_ret = 0;
17312 
17313 #if defined(LIBXML_PATTERN_ENABLED)
17314     int mem_base;
17315     int ret_val;
17316     xmlStreamCtxtPtr streamCtxt; /* the stream context */
17317     int n_streamCtxt;
17318 
17319     for (n_streamCtxt = 0;n_streamCtxt < gen_nb_xmlStreamCtxtPtr;n_streamCtxt++) {
17320         mem_base = xmlMemBlocks();
17321         streamCtxt = gen_xmlStreamCtxtPtr(n_streamCtxt, 0);
17322 
17323         ret_val = xmlStreamWantsAnyNode(streamCtxt);
17324         desret_int(ret_val);
17325         call_tests++;
17326         des_xmlStreamCtxtPtr(n_streamCtxt, streamCtxt, 0);
17327         xmlResetLastError();
17328         if (mem_base != xmlMemBlocks()) {
17329             printf("Leak of %d blocks found in xmlStreamWantsAnyNode",
17330 	           xmlMemBlocks() - mem_base);
17331 	    test_ret++;
17332             printf(" %d", n_streamCtxt);
17333             printf("\n");
17334         }
17335     }
17336     function_tests++;
17337 #endif
17338 
17339     return(test_ret);
17340 }
17341 
17342 static int
test_pattern(void)17343 test_pattern(void) {
17344     int test_ret = 0;
17345 
17346     if (quiet == 0) printf("Testing pattern : 10 of 15 functions ...\n");
17347     test_ret += test_xmlPatternFromRoot();
17348     test_ret += test_xmlPatternGetStreamCtxt();
17349     test_ret += test_xmlPatternMatch();
17350     test_ret += test_xmlPatternMaxDepth();
17351     test_ret += test_xmlPatternMinDepth();
17352     test_ret += test_xmlPatternStreamable();
17353     test_ret += test_xmlPatterncompile();
17354     test_ret += test_xmlStreamPop();
17355     test_ret += test_xmlStreamPush();
17356     test_ret += test_xmlStreamPushAttr();
17357     test_ret += test_xmlStreamPushNode();
17358     test_ret += test_xmlStreamWantsAnyNode();
17359 
17360     if (test_ret != 0)
17361 	printf("Module pattern: %d errors\n", test_ret);
17362     return(test_ret);
17363 }
17364 #ifdef LIBXML_SCHEMAS_ENABLED
17365 
17366 #define gen_nb_xmlRelaxNGPtr 1
gen_xmlRelaxNGPtr(int no ATTRIBUTE_UNUSED,int nr ATTRIBUTE_UNUSED)17367 static xmlRelaxNGPtr gen_xmlRelaxNGPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
17368     return(NULL);
17369 }
des_xmlRelaxNGPtr(int no ATTRIBUTE_UNUSED,xmlRelaxNGPtr val ATTRIBUTE_UNUSED,int nr ATTRIBUTE_UNUSED)17370 static void des_xmlRelaxNGPtr(int no ATTRIBUTE_UNUSED, xmlRelaxNGPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
17371 }
17372 #endif
17373 
17374 
17375 static int
test_xmlRelaxNGDump(void)17376 test_xmlRelaxNGDump(void) {
17377     int test_ret = 0;
17378 
17379 #if defined(LIBXML_SCHEMAS_ENABLED) && defined(LIBXML_OUTPUT_ENABLED)
17380     int mem_base;
17381     FILE * output; /* the file output */
17382     int n_output;
17383     xmlRelaxNGPtr schema; /* a schema structure */
17384     int n_schema;
17385 
17386     for (n_output = 0;n_output < gen_nb_FILE_ptr;n_output++) {
17387     for (n_schema = 0;n_schema < gen_nb_xmlRelaxNGPtr;n_schema++) {
17388         mem_base = xmlMemBlocks();
17389         output = gen_FILE_ptr(n_output, 0);
17390         schema = gen_xmlRelaxNGPtr(n_schema, 1);
17391 
17392         xmlRelaxNGDump(output, schema);
17393         call_tests++;
17394         des_FILE_ptr(n_output, output, 0);
17395         des_xmlRelaxNGPtr(n_schema, schema, 1);
17396         xmlResetLastError();
17397         if (mem_base != xmlMemBlocks()) {
17398             printf("Leak of %d blocks found in xmlRelaxNGDump",
17399 	           xmlMemBlocks() - mem_base);
17400 	    test_ret++;
17401             printf(" %d", n_output);
17402             printf(" %d", n_schema);
17403             printf("\n");
17404         }
17405     }
17406     }
17407     function_tests++;
17408 #endif
17409 
17410     return(test_ret);
17411 }
17412 
17413 
17414 static int
test_xmlRelaxNGDumpTree(void)17415 test_xmlRelaxNGDumpTree(void) {
17416     int test_ret = 0;
17417 
17418 #if defined(LIBXML_SCHEMAS_ENABLED) && defined(LIBXML_OUTPUT_ENABLED)
17419     int mem_base;
17420     FILE * output; /* the file output */
17421     int n_output;
17422     xmlRelaxNGPtr schema; /* a schema structure */
17423     int n_schema;
17424 
17425     for (n_output = 0;n_output < gen_nb_FILE_ptr;n_output++) {
17426     for (n_schema = 0;n_schema < gen_nb_xmlRelaxNGPtr;n_schema++) {
17427         mem_base = xmlMemBlocks();
17428         output = gen_FILE_ptr(n_output, 0);
17429         schema = gen_xmlRelaxNGPtr(n_schema, 1);
17430 
17431         xmlRelaxNGDumpTree(output, schema);
17432         call_tests++;
17433         des_FILE_ptr(n_output, output, 0);
17434         des_xmlRelaxNGPtr(n_schema, schema, 1);
17435         xmlResetLastError();
17436         if (mem_base != xmlMemBlocks()) {
17437             printf("Leak of %d blocks found in xmlRelaxNGDumpTree",
17438 	           xmlMemBlocks() - mem_base);
17439 	    test_ret++;
17440             printf(" %d", n_output);
17441             printf(" %d", n_schema);
17442             printf("\n");
17443         }
17444     }
17445     }
17446     function_tests++;
17447 #endif
17448 
17449     return(test_ret);
17450 }
17451 
17452 #ifdef LIBXML_SCHEMAS_ENABLED
17453 
17454 #define gen_nb_xmlRelaxNGParserCtxtPtr 1
gen_xmlRelaxNGParserCtxtPtr(int no ATTRIBUTE_UNUSED,int nr ATTRIBUTE_UNUSED)17455 static xmlRelaxNGParserCtxtPtr gen_xmlRelaxNGParserCtxtPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
17456     return(NULL);
17457 }
des_xmlRelaxNGParserCtxtPtr(int no ATTRIBUTE_UNUSED,xmlRelaxNGParserCtxtPtr val ATTRIBUTE_UNUSED,int nr ATTRIBUTE_UNUSED)17458 static void des_xmlRelaxNGParserCtxtPtr(int no ATTRIBUTE_UNUSED, xmlRelaxNGParserCtxtPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
17459 }
17460 #endif
17461 
17462 #ifdef LIBXML_SCHEMAS_ENABLED
17463 
17464 #define gen_nb_xmlRelaxNGValidityErrorFunc_ptr 1
gen_xmlRelaxNGValidityErrorFunc_ptr(int no ATTRIBUTE_UNUSED,int nr ATTRIBUTE_UNUSED)17465 static xmlRelaxNGValidityErrorFunc * gen_xmlRelaxNGValidityErrorFunc_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
17466     return(NULL);
17467 }
des_xmlRelaxNGValidityErrorFunc_ptr(int no ATTRIBUTE_UNUSED,xmlRelaxNGValidityErrorFunc * val ATTRIBUTE_UNUSED,int nr ATTRIBUTE_UNUSED)17468 static void des_xmlRelaxNGValidityErrorFunc_ptr(int no ATTRIBUTE_UNUSED, xmlRelaxNGValidityErrorFunc * val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
17469 }
17470 #endif
17471 
17472 #ifdef LIBXML_SCHEMAS_ENABLED
17473 
17474 #define gen_nb_xmlRelaxNGValidityWarningFunc_ptr 1
gen_xmlRelaxNGValidityWarningFunc_ptr(int no ATTRIBUTE_UNUSED,int nr ATTRIBUTE_UNUSED)17475 static xmlRelaxNGValidityWarningFunc * gen_xmlRelaxNGValidityWarningFunc_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
17476     return(NULL);
17477 }
des_xmlRelaxNGValidityWarningFunc_ptr(int no ATTRIBUTE_UNUSED,xmlRelaxNGValidityWarningFunc * val ATTRIBUTE_UNUSED,int nr ATTRIBUTE_UNUSED)17478 static void des_xmlRelaxNGValidityWarningFunc_ptr(int no ATTRIBUTE_UNUSED, xmlRelaxNGValidityWarningFunc * val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
17479 }
17480 #endif
17481 
17482 
17483 static int
test_xmlRelaxNGGetParserErrors(void)17484 test_xmlRelaxNGGetParserErrors(void) {
17485     int test_ret = 0;
17486 
17487 #if defined(LIBXML_SCHEMAS_ENABLED)
17488     int mem_base;
17489     int ret_val;
17490     xmlRelaxNGParserCtxtPtr ctxt; /* a Relax-NG validation context */
17491     int n_ctxt;
17492     xmlRelaxNGValidityErrorFunc * err; /* the error callback result */
17493     int n_err;
17494     xmlRelaxNGValidityWarningFunc * warn; /* the warning callback result */
17495     int n_warn;
17496     void ** ctx; /* contextual data for the callbacks result */
17497     int n_ctx;
17498 
17499     for (n_ctxt = 0;n_ctxt < gen_nb_xmlRelaxNGParserCtxtPtr;n_ctxt++) {
17500     for (n_err = 0;n_err < gen_nb_xmlRelaxNGValidityErrorFunc_ptr;n_err++) {
17501     for (n_warn = 0;n_warn < gen_nb_xmlRelaxNGValidityWarningFunc_ptr;n_warn++) {
17502     for (n_ctx = 0;n_ctx < gen_nb_void_ptr_ptr;n_ctx++) {
17503         mem_base = xmlMemBlocks();
17504         ctxt = gen_xmlRelaxNGParserCtxtPtr(n_ctxt, 0);
17505         err = gen_xmlRelaxNGValidityErrorFunc_ptr(n_err, 1);
17506         warn = gen_xmlRelaxNGValidityWarningFunc_ptr(n_warn, 2);
17507         ctx = gen_void_ptr_ptr(n_ctx, 3);
17508 
17509         ret_val = xmlRelaxNGGetParserErrors(ctxt, err, warn, ctx);
17510         desret_int(ret_val);
17511         call_tests++;
17512         des_xmlRelaxNGParserCtxtPtr(n_ctxt, ctxt, 0);
17513         des_xmlRelaxNGValidityErrorFunc_ptr(n_err, err, 1);
17514         des_xmlRelaxNGValidityWarningFunc_ptr(n_warn, warn, 2);
17515         des_void_ptr_ptr(n_ctx, ctx, 3);
17516         xmlResetLastError();
17517         if (mem_base != xmlMemBlocks()) {
17518             printf("Leak of %d blocks found in xmlRelaxNGGetParserErrors",
17519 	           xmlMemBlocks() - mem_base);
17520 	    test_ret++;
17521             printf(" %d", n_ctxt);
17522             printf(" %d", n_err);
17523             printf(" %d", n_warn);
17524             printf(" %d", n_ctx);
17525             printf("\n");
17526         }
17527     }
17528     }
17529     }
17530     }
17531     function_tests++;
17532 #endif
17533 
17534     return(test_ret);
17535 }
17536 
17537 #ifdef LIBXML_SCHEMAS_ENABLED
17538 
17539 #define gen_nb_xmlRelaxNGValidCtxtPtr 1
gen_xmlRelaxNGValidCtxtPtr(int no ATTRIBUTE_UNUSED,int nr ATTRIBUTE_UNUSED)17540 static xmlRelaxNGValidCtxtPtr gen_xmlRelaxNGValidCtxtPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
17541     return(NULL);
17542 }
des_xmlRelaxNGValidCtxtPtr(int no ATTRIBUTE_UNUSED,xmlRelaxNGValidCtxtPtr val ATTRIBUTE_UNUSED,int nr ATTRIBUTE_UNUSED)17543 static void des_xmlRelaxNGValidCtxtPtr(int no ATTRIBUTE_UNUSED, xmlRelaxNGValidCtxtPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
17544 }
17545 #endif
17546 
17547 
17548 static int
test_xmlRelaxNGGetValidErrors(void)17549 test_xmlRelaxNGGetValidErrors(void) {
17550     int test_ret = 0;
17551 
17552 #if defined(LIBXML_SCHEMAS_ENABLED)
17553     int mem_base;
17554     int ret_val;
17555     xmlRelaxNGValidCtxtPtr ctxt; /* a Relax-NG validation context */
17556     int n_ctxt;
17557     xmlRelaxNGValidityErrorFunc * err; /* the error function result */
17558     int n_err;
17559     xmlRelaxNGValidityWarningFunc * warn; /* the warning function result */
17560     int n_warn;
17561     void ** ctx; /* the functions context result */
17562     int n_ctx;
17563 
17564     for (n_ctxt = 0;n_ctxt < gen_nb_xmlRelaxNGValidCtxtPtr;n_ctxt++) {
17565     for (n_err = 0;n_err < gen_nb_xmlRelaxNGValidityErrorFunc_ptr;n_err++) {
17566     for (n_warn = 0;n_warn < gen_nb_xmlRelaxNGValidityWarningFunc_ptr;n_warn++) {
17567     for (n_ctx = 0;n_ctx < gen_nb_void_ptr_ptr;n_ctx++) {
17568         mem_base = xmlMemBlocks();
17569         ctxt = gen_xmlRelaxNGValidCtxtPtr(n_ctxt, 0);
17570         err = gen_xmlRelaxNGValidityErrorFunc_ptr(n_err, 1);
17571         warn = gen_xmlRelaxNGValidityWarningFunc_ptr(n_warn, 2);
17572         ctx = gen_void_ptr_ptr(n_ctx, 3);
17573 
17574         ret_val = xmlRelaxNGGetValidErrors(ctxt, err, warn, ctx);
17575         desret_int(ret_val);
17576         call_tests++;
17577         des_xmlRelaxNGValidCtxtPtr(n_ctxt, ctxt, 0);
17578         des_xmlRelaxNGValidityErrorFunc_ptr(n_err, err, 1);
17579         des_xmlRelaxNGValidityWarningFunc_ptr(n_warn, warn, 2);
17580         des_void_ptr_ptr(n_ctx, ctx, 3);
17581         xmlResetLastError();
17582         if (mem_base != xmlMemBlocks()) {
17583             printf("Leak of %d blocks found in xmlRelaxNGGetValidErrors",
17584 	           xmlMemBlocks() - mem_base);
17585 	    test_ret++;
17586             printf(" %d", n_ctxt);
17587             printf(" %d", n_err);
17588             printf(" %d", n_warn);
17589             printf(" %d", n_ctx);
17590             printf("\n");
17591         }
17592     }
17593     }
17594     }
17595     }
17596     function_tests++;
17597 #endif
17598 
17599     return(test_ret);
17600 }
17601 
17602 
17603 static int
test_xmlRelaxNGInitTypes(void)17604 test_xmlRelaxNGInitTypes(void) {
17605     int test_ret = 0;
17606 
17607 #if defined(LIBXML_SCHEMAS_ENABLED)
17608     int mem_base;
17609     int ret_val;
17610 
17611         mem_base = xmlMemBlocks();
17612 
17613         ret_val = xmlRelaxNGInitTypes();
17614         desret_int(ret_val);
17615         call_tests++;
17616         xmlResetLastError();
17617         if (mem_base != xmlMemBlocks()) {
17618             printf("Leak of %d blocks found in xmlRelaxNGInitTypes",
17619 	           xmlMemBlocks() - mem_base);
17620 	    test_ret++;
17621             printf("\n");
17622         }
17623     function_tests++;
17624 #endif
17625 
17626     return(test_ret);
17627 }
17628 
17629 
17630 static int
test_xmlRelaxNGNewDocParserCtxt(void)17631 test_xmlRelaxNGNewDocParserCtxt(void) {
17632     int test_ret = 0;
17633 
17634 #if defined(LIBXML_SCHEMAS_ENABLED)
17635     int mem_base;
17636     xmlRelaxNGParserCtxtPtr ret_val;
17637     xmlDocPtr doc; /* a preparsed document tree */
17638     int n_doc;
17639 
17640     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
17641         mem_base = xmlMemBlocks();
17642         doc = gen_xmlDocPtr(n_doc, 0);
17643 
17644         ret_val = xmlRelaxNGNewDocParserCtxt(doc);
17645         desret_xmlRelaxNGParserCtxtPtr(ret_val);
17646         call_tests++;
17647         des_xmlDocPtr(n_doc, doc, 0);
17648         xmlResetLastError();
17649         if (mem_base != xmlMemBlocks()) {
17650             printf("Leak of %d blocks found in xmlRelaxNGNewDocParserCtxt",
17651 	           xmlMemBlocks() - mem_base);
17652 	    test_ret++;
17653             printf(" %d", n_doc);
17654             printf("\n");
17655         }
17656     }
17657     function_tests++;
17658 #endif
17659 
17660     return(test_ret);
17661 }
17662 
17663 
17664 static int
test_xmlRelaxNGNewMemParserCtxt(void)17665 test_xmlRelaxNGNewMemParserCtxt(void) {
17666     int test_ret = 0;
17667 
17668 #if defined(LIBXML_SCHEMAS_ENABLED)
17669     int mem_base;
17670     xmlRelaxNGParserCtxtPtr ret_val;
17671     char * buffer; /* a pointer to a char array containing the schemas */
17672     int n_buffer;
17673     int size; /* the size of the array */
17674     int n_size;
17675 
17676     for (n_buffer = 0;n_buffer < gen_nb_const_char_ptr;n_buffer++) {
17677     for (n_size = 0;n_size < gen_nb_int;n_size++) {
17678         mem_base = xmlMemBlocks();
17679         buffer = gen_const_char_ptr(n_buffer, 0);
17680         size = gen_int(n_size, 1);
17681         if ((buffer != NULL) &&
17682             (size > (int) strlen((const char *) buffer) + 1))
17683             continue;
17684 
17685         ret_val = xmlRelaxNGNewMemParserCtxt((const char *)buffer, size);
17686         desret_xmlRelaxNGParserCtxtPtr(ret_val);
17687         call_tests++;
17688         des_const_char_ptr(n_buffer, (const char *)buffer, 0);
17689         des_int(n_size, size, 1);
17690         xmlResetLastError();
17691         if (mem_base != xmlMemBlocks()) {
17692             printf("Leak of %d blocks found in xmlRelaxNGNewMemParserCtxt",
17693 	           xmlMemBlocks() - mem_base);
17694 	    test_ret++;
17695             printf(" %d", n_buffer);
17696             printf(" %d", n_size);
17697             printf("\n");
17698         }
17699     }
17700     }
17701     function_tests++;
17702 #endif
17703 
17704     return(test_ret);
17705 }
17706 
17707 
17708 static int
test_xmlRelaxNGNewParserCtxt(void)17709 test_xmlRelaxNGNewParserCtxt(void) {
17710     int test_ret = 0;
17711 
17712 #if defined(LIBXML_SCHEMAS_ENABLED)
17713     int mem_base;
17714     xmlRelaxNGParserCtxtPtr ret_val;
17715     char * URL; /* the location of the schema */
17716     int n_URL;
17717 
17718     for (n_URL = 0;n_URL < gen_nb_const_char_ptr;n_URL++) {
17719         mem_base = xmlMemBlocks();
17720         URL = gen_const_char_ptr(n_URL, 0);
17721 
17722         ret_val = xmlRelaxNGNewParserCtxt((const char *)URL);
17723         desret_xmlRelaxNGParserCtxtPtr(ret_val);
17724         call_tests++;
17725         des_const_char_ptr(n_URL, (const char *)URL, 0);
17726         xmlResetLastError();
17727         if (mem_base != xmlMemBlocks()) {
17728             printf("Leak of %d blocks found in xmlRelaxNGNewParserCtxt",
17729 	           xmlMemBlocks() - mem_base);
17730 	    test_ret++;
17731             printf(" %d", n_URL);
17732             printf("\n");
17733         }
17734     }
17735     function_tests++;
17736 #endif
17737 
17738     return(test_ret);
17739 }
17740 
17741 
17742 static int
test_xmlRelaxNGNewValidCtxt(void)17743 test_xmlRelaxNGNewValidCtxt(void) {
17744     int test_ret = 0;
17745 
17746 
17747     /* missing type support */
17748     return(test_ret);
17749 }
17750 
17751 
17752 static int
test_xmlRelaxNGParse(void)17753 test_xmlRelaxNGParse(void) {
17754     int test_ret = 0;
17755 
17756 
17757     /* missing type support */
17758     return(test_ret);
17759 }
17760 
17761 
17762 static int
test_xmlRelaxNGSetParserErrors(void)17763 test_xmlRelaxNGSetParserErrors(void) {
17764     int test_ret = 0;
17765 
17766 
17767     /* missing type support */
17768     return(test_ret);
17769 }
17770 
17771 
17772 static int
test_xmlRelaxNGSetParserStructuredErrors(void)17773 test_xmlRelaxNGSetParserStructuredErrors(void) {
17774     int test_ret = 0;
17775 
17776 
17777     /* missing type support */
17778     return(test_ret);
17779 }
17780 
17781 
17782 static int
test_xmlRelaxNGSetValidErrors(void)17783 test_xmlRelaxNGSetValidErrors(void) {
17784     int test_ret = 0;
17785 
17786 
17787     /* missing type support */
17788     return(test_ret);
17789 }
17790 
17791 
17792 static int
test_xmlRelaxNGSetValidStructuredErrors(void)17793 test_xmlRelaxNGSetValidStructuredErrors(void) {
17794     int test_ret = 0;
17795 
17796 
17797     /* missing type support */
17798     return(test_ret);
17799 }
17800 
17801 
17802 static int
test_xmlRelaxNGValidateDoc(void)17803 test_xmlRelaxNGValidateDoc(void) {
17804     int test_ret = 0;
17805 
17806 #if defined(LIBXML_SCHEMAS_ENABLED)
17807     int mem_base;
17808     int ret_val;
17809     xmlRelaxNGValidCtxtPtr ctxt; /* a Relax-NG validation context */
17810     int n_ctxt;
17811     xmlDocPtr doc; /* a parsed document tree */
17812     int n_doc;
17813 
17814     for (n_ctxt = 0;n_ctxt < gen_nb_xmlRelaxNGValidCtxtPtr;n_ctxt++) {
17815     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
17816         mem_base = xmlMemBlocks();
17817         ctxt = gen_xmlRelaxNGValidCtxtPtr(n_ctxt, 0);
17818         doc = gen_xmlDocPtr(n_doc, 1);
17819 
17820         ret_val = xmlRelaxNGValidateDoc(ctxt, doc);
17821         desret_int(ret_val);
17822         call_tests++;
17823         des_xmlRelaxNGValidCtxtPtr(n_ctxt, ctxt, 0);
17824         des_xmlDocPtr(n_doc, doc, 1);
17825         xmlResetLastError();
17826         if (mem_base != xmlMemBlocks()) {
17827             printf("Leak of %d blocks found in xmlRelaxNGValidateDoc",
17828 	           xmlMemBlocks() - mem_base);
17829 	    test_ret++;
17830             printf(" %d", n_ctxt);
17831             printf(" %d", n_doc);
17832             printf("\n");
17833         }
17834     }
17835     }
17836     function_tests++;
17837 #endif
17838 
17839     return(test_ret);
17840 }
17841 
17842 
17843 static int
test_xmlRelaxNGValidateFullElement(void)17844 test_xmlRelaxNGValidateFullElement(void) {
17845     int test_ret = 0;
17846 
17847 #if defined(LIBXML_SCHEMAS_ENABLED)
17848     int mem_base;
17849     int ret_val;
17850     xmlRelaxNGValidCtxtPtr ctxt; /* the validation context */
17851     int n_ctxt;
17852     xmlDocPtr doc; /* a document instance */
17853     int n_doc;
17854     xmlNodePtr elem; /* an element instance */
17855     int n_elem;
17856 
17857     for (n_ctxt = 0;n_ctxt < gen_nb_xmlRelaxNGValidCtxtPtr;n_ctxt++) {
17858     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
17859     for (n_elem = 0;n_elem < gen_nb_xmlNodePtr;n_elem++) {
17860         mem_base = xmlMemBlocks();
17861         ctxt = gen_xmlRelaxNGValidCtxtPtr(n_ctxt, 0);
17862         doc = gen_xmlDocPtr(n_doc, 1);
17863         elem = gen_xmlNodePtr(n_elem, 2);
17864 
17865         ret_val = xmlRelaxNGValidateFullElement(ctxt, doc, elem);
17866         desret_int(ret_val);
17867         call_tests++;
17868         des_xmlRelaxNGValidCtxtPtr(n_ctxt, ctxt, 0);
17869         des_xmlDocPtr(n_doc, doc, 1);
17870         des_xmlNodePtr(n_elem, elem, 2);
17871         xmlResetLastError();
17872         if (mem_base != xmlMemBlocks()) {
17873             printf("Leak of %d blocks found in xmlRelaxNGValidateFullElement",
17874 	           xmlMemBlocks() - mem_base);
17875 	    test_ret++;
17876             printf(" %d", n_ctxt);
17877             printf(" %d", n_doc);
17878             printf(" %d", n_elem);
17879             printf("\n");
17880         }
17881     }
17882     }
17883     }
17884     function_tests++;
17885 #endif
17886 
17887     return(test_ret);
17888 }
17889 
17890 
17891 static int
test_xmlRelaxNGValidatePopElement(void)17892 test_xmlRelaxNGValidatePopElement(void) {
17893     int test_ret = 0;
17894 
17895 #if defined(LIBXML_SCHEMAS_ENABLED)
17896     int mem_base;
17897     int ret_val;
17898     xmlRelaxNGValidCtxtPtr ctxt; /* the RelaxNG validation context */
17899     int n_ctxt;
17900     xmlDocPtr doc; /* a document instance */
17901     int n_doc;
17902     xmlNodePtr elem; /* an element instance */
17903     int n_elem;
17904 
17905     for (n_ctxt = 0;n_ctxt < gen_nb_xmlRelaxNGValidCtxtPtr;n_ctxt++) {
17906     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
17907     for (n_elem = 0;n_elem < gen_nb_xmlNodePtr;n_elem++) {
17908         mem_base = xmlMemBlocks();
17909         ctxt = gen_xmlRelaxNGValidCtxtPtr(n_ctxt, 0);
17910         doc = gen_xmlDocPtr(n_doc, 1);
17911         elem = gen_xmlNodePtr(n_elem, 2);
17912 
17913         ret_val = xmlRelaxNGValidatePopElement(ctxt, doc, elem);
17914         desret_int(ret_val);
17915         call_tests++;
17916         des_xmlRelaxNGValidCtxtPtr(n_ctxt, ctxt, 0);
17917         des_xmlDocPtr(n_doc, doc, 1);
17918         des_xmlNodePtr(n_elem, elem, 2);
17919         xmlResetLastError();
17920         if (mem_base != xmlMemBlocks()) {
17921             printf("Leak of %d blocks found in xmlRelaxNGValidatePopElement",
17922 	           xmlMemBlocks() - mem_base);
17923 	    test_ret++;
17924             printf(" %d", n_ctxt);
17925             printf(" %d", n_doc);
17926             printf(" %d", n_elem);
17927             printf("\n");
17928         }
17929     }
17930     }
17931     }
17932     function_tests++;
17933 #endif
17934 
17935     return(test_ret);
17936 }
17937 
17938 
17939 static int
test_xmlRelaxNGValidatePushCData(void)17940 test_xmlRelaxNGValidatePushCData(void) {
17941     int test_ret = 0;
17942 
17943 #if defined(LIBXML_SCHEMAS_ENABLED)
17944     int mem_base;
17945     int ret_val;
17946     xmlRelaxNGValidCtxtPtr ctxt; /* the RelaxNG validation context */
17947     int n_ctxt;
17948     xmlChar * data; /* some character data read */
17949     int n_data;
17950     int len; /* the length of the data */
17951     int n_len;
17952 
17953     for (n_ctxt = 0;n_ctxt < gen_nb_xmlRelaxNGValidCtxtPtr;n_ctxt++) {
17954     for (n_data = 0;n_data < gen_nb_const_xmlChar_ptr;n_data++) {
17955     for (n_len = 0;n_len < gen_nb_int;n_len++) {
17956         mem_base = xmlMemBlocks();
17957         ctxt = gen_xmlRelaxNGValidCtxtPtr(n_ctxt, 0);
17958         data = gen_const_xmlChar_ptr(n_data, 1);
17959         len = gen_int(n_len, 2);
17960         if ((data != NULL) &&
17961             (len > (int) strlen((const char *) data) + 1))
17962             continue;
17963 
17964         ret_val = xmlRelaxNGValidatePushCData(ctxt, (const xmlChar *)data, len);
17965         desret_int(ret_val);
17966         call_tests++;
17967         des_xmlRelaxNGValidCtxtPtr(n_ctxt, ctxt, 0);
17968         des_const_xmlChar_ptr(n_data, (const xmlChar *)data, 1);
17969         des_int(n_len, len, 2);
17970         xmlResetLastError();
17971         if (mem_base != xmlMemBlocks()) {
17972             printf("Leak of %d blocks found in xmlRelaxNGValidatePushCData",
17973 	           xmlMemBlocks() - mem_base);
17974 	    test_ret++;
17975             printf(" %d", n_ctxt);
17976             printf(" %d", n_data);
17977             printf(" %d", n_len);
17978             printf("\n");
17979         }
17980     }
17981     }
17982     }
17983     function_tests++;
17984 #endif
17985 
17986     return(test_ret);
17987 }
17988 
17989 
17990 static int
test_xmlRelaxNGValidatePushElement(void)17991 test_xmlRelaxNGValidatePushElement(void) {
17992     int test_ret = 0;
17993 
17994 #if defined(LIBXML_SCHEMAS_ENABLED)
17995     int mem_base;
17996     int ret_val;
17997     xmlRelaxNGValidCtxtPtr ctxt; /* the validation context */
17998     int n_ctxt;
17999     xmlDocPtr doc; /* a document instance */
18000     int n_doc;
18001     xmlNodePtr elem; /* an element instance */
18002     int n_elem;
18003 
18004     for (n_ctxt = 0;n_ctxt < gen_nb_xmlRelaxNGValidCtxtPtr;n_ctxt++) {
18005     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
18006     for (n_elem = 0;n_elem < gen_nb_xmlNodePtr;n_elem++) {
18007         mem_base = xmlMemBlocks();
18008         ctxt = gen_xmlRelaxNGValidCtxtPtr(n_ctxt, 0);
18009         doc = gen_xmlDocPtr(n_doc, 1);
18010         elem = gen_xmlNodePtr(n_elem, 2);
18011 
18012         ret_val = xmlRelaxNGValidatePushElement(ctxt, doc, elem);
18013         desret_int(ret_val);
18014         call_tests++;
18015         des_xmlRelaxNGValidCtxtPtr(n_ctxt, ctxt, 0);
18016         des_xmlDocPtr(n_doc, doc, 1);
18017         des_xmlNodePtr(n_elem, elem, 2);
18018         xmlResetLastError();
18019         if (mem_base != xmlMemBlocks()) {
18020             printf("Leak of %d blocks found in xmlRelaxNGValidatePushElement",
18021 	           xmlMemBlocks() - mem_base);
18022 	    test_ret++;
18023             printf(" %d", n_ctxt);
18024             printf(" %d", n_doc);
18025             printf(" %d", n_elem);
18026             printf("\n");
18027         }
18028     }
18029     }
18030     }
18031     function_tests++;
18032 #endif
18033 
18034     return(test_ret);
18035 }
18036 
18037 
18038 static int
test_xmlRelaxParserSetFlag(void)18039 test_xmlRelaxParserSetFlag(void) {
18040     int test_ret = 0;
18041 
18042 #if defined(LIBXML_SCHEMAS_ENABLED)
18043     int mem_base;
18044     int ret_val;
18045     xmlRelaxNGParserCtxtPtr ctxt; /* a RelaxNG parser context */
18046     int n_ctxt;
18047     int flags; /* a set of flags values */
18048     int n_flags;
18049 
18050     for (n_ctxt = 0;n_ctxt < gen_nb_xmlRelaxNGParserCtxtPtr;n_ctxt++) {
18051     for (n_flags = 0;n_flags < gen_nb_int;n_flags++) {
18052         mem_base = xmlMemBlocks();
18053         ctxt = gen_xmlRelaxNGParserCtxtPtr(n_ctxt, 0);
18054         flags = gen_int(n_flags, 1);
18055 
18056         ret_val = xmlRelaxParserSetFlag(ctxt, flags);
18057         desret_int(ret_val);
18058         call_tests++;
18059         des_xmlRelaxNGParserCtxtPtr(n_ctxt, ctxt, 0);
18060         des_int(n_flags, flags, 1);
18061         xmlResetLastError();
18062         if (mem_base != xmlMemBlocks()) {
18063             printf("Leak of %d blocks found in xmlRelaxParserSetFlag",
18064 	           xmlMemBlocks() - mem_base);
18065 	    test_ret++;
18066             printf(" %d", n_ctxt);
18067             printf(" %d", n_flags);
18068             printf("\n");
18069         }
18070     }
18071     }
18072     function_tests++;
18073 #endif
18074 
18075     return(test_ret);
18076 }
18077 
18078 static int
test_relaxng(void)18079 test_relaxng(void) {
18080     int test_ret = 0;
18081 
18082     if (quiet == 0) printf("Testing relaxng : 14 of 24 functions ...\n");
18083     test_ret += test_xmlRelaxNGDump();
18084     test_ret += test_xmlRelaxNGDumpTree();
18085     test_ret += test_xmlRelaxNGGetParserErrors();
18086     test_ret += test_xmlRelaxNGGetValidErrors();
18087     test_ret += test_xmlRelaxNGInitTypes();
18088     test_ret += test_xmlRelaxNGNewDocParserCtxt();
18089     test_ret += test_xmlRelaxNGNewMemParserCtxt();
18090     test_ret += test_xmlRelaxNGNewParserCtxt();
18091     test_ret += test_xmlRelaxNGNewValidCtxt();
18092     test_ret += test_xmlRelaxNGParse();
18093     test_ret += test_xmlRelaxNGSetParserErrors();
18094     test_ret += test_xmlRelaxNGSetParserStructuredErrors();
18095     test_ret += test_xmlRelaxNGSetValidErrors();
18096     test_ret += test_xmlRelaxNGSetValidStructuredErrors();
18097     test_ret += test_xmlRelaxNGValidateDoc();
18098     test_ret += test_xmlRelaxNGValidateFullElement();
18099     test_ret += test_xmlRelaxNGValidatePopElement();
18100     test_ret += test_xmlRelaxNGValidatePushCData();
18101     test_ret += test_xmlRelaxNGValidatePushElement();
18102     test_ret += test_xmlRelaxParserSetFlag();
18103 
18104     if (test_ret != 0)
18105 	printf("Module relaxng: %d errors\n", test_ret);
18106     return(test_ret);
18107 }
18108 static int
test_schemasInternals(void)18109 test_schemasInternals(void) {
18110     int test_ret = 0;
18111 
18112     if (quiet == 0) printf("Testing schemasInternals : 0 of 2 functions ...\n");
18113 
18114     if (test_ret != 0)
18115 	printf("Module schemasInternals: %d errors\n", test_ret);
18116     return(test_ret);
18117 }
18118 
18119 static int
test_xmlSchematronNewDocParserCtxt(void)18120 test_xmlSchematronNewDocParserCtxt(void) {
18121     int test_ret = 0;
18122 
18123 
18124     /* missing type support */
18125     return(test_ret);
18126 }
18127 
18128 
18129 static int
test_xmlSchematronNewMemParserCtxt(void)18130 test_xmlSchematronNewMemParserCtxt(void) {
18131     int test_ret = 0;
18132 
18133 
18134     /* missing type support */
18135     return(test_ret);
18136 }
18137 
18138 
18139 static int
test_xmlSchematronNewParserCtxt(void)18140 test_xmlSchematronNewParserCtxt(void) {
18141     int test_ret = 0;
18142 
18143 
18144     /* missing type support */
18145     return(test_ret);
18146 }
18147 
18148 
18149 static int
test_xmlSchematronNewValidCtxt(void)18150 test_xmlSchematronNewValidCtxt(void) {
18151     int test_ret = 0;
18152 
18153 
18154     /* missing type support */
18155     return(test_ret);
18156 }
18157 
18158 
18159 static int
test_xmlSchematronParse(void)18160 test_xmlSchematronParse(void) {
18161     int test_ret = 0;
18162 
18163 
18164     /* missing type support */
18165     return(test_ret);
18166 }
18167 
18168 
18169 static int
test_xmlSchematronSetValidStructuredErrors(void)18170 test_xmlSchematronSetValidStructuredErrors(void) {
18171     int test_ret = 0;
18172 
18173 
18174     /* missing type support */
18175     return(test_ret);
18176 }
18177 
18178 #ifdef LIBXML_SCHEMATRON_ENABLED
18179 
18180 #define gen_nb_xmlSchematronValidCtxtPtr 1
gen_xmlSchematronValidCtxtPtr(int no ATTRIBUTE_UNUSED,int nr ATTRIBUTE_UNUSED)18181 static xmlSchematronValidCtxtPtr gen_xmlSchematronValidCtxtPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
18182     return(NULL);
18183 }
des_xmlSchematronValidCtxtPtr(int no ATTRIBUTE_UNUSED,xmlSchematronValidCtxtPtr val ATTRIBUTE_UNUSED,int nr ATTRIBUTE_UNUSED)18184 static void des_xmlSchematronValidCtxtPtr(int no ATTRIBUTE_UNUSED, xmlSchematronValidCtxtPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
18185 }
18186 #endif
18187 
18188 
18189 static int
test_xmlSchematronValidateDoc(void)18190 test_xmlSchematronValidateDoc(void) {
18191     int test_ret = 0;
18192 
18193 #if defined(LIBXML_SCHEMATRON_ENABLED)
18194     int mem_base;
18195     int ret_val;
18196     xmlSchematronValidCtxtPtr ctxt; /* the schema validation context */
18197     int n_ctxt;
18198     xmlDocPtr instance; /* the document instace tree */
18199     int n_instance;
18200 
18201     for (n_ctxt = 0;n_ctxt < gen_nb_xmlSchematronValidCtxtPtr;n_ctxt++) {
18202     for (n_instance = 0;n_instance < gen_nb_xmlDocPtr;n_instance++) {
18203         mem_base = xmlMemBlocks();
18204         ctxt = gen_xmlSchematronValidCtxtPtr(n_ctxt, 0);
18205         instance = gen_xmlDocPtr(n_instance, 1);
18206 
18207         ret_val = xmlSchematronValidateDoc(ctxt, instance);
18208         desret_int(ret_val);
18209         call_tests++;
18210         des_xmlSchematronValidCtxtPtr(n_ctxt, ctxt, 0);
18211         des_xmlDocPtr(n_instance, instance, 1);
18212         xmlResetLastError();
18213         if (mem_base != xmlMemBlocks()) {
18214             printf("Leak of %d blocks found in xmlSchematronValidateDoc",
18215 	           xmlMemBlocks() - mem_base);
18216 	    test_ret++;
18217             printf(" %d", n_ctxt);
18218             printf(" %d", n_instance);
18219             printf("\n");
18220         }
18221     }
18222     }
18223     function_tests++;
18224 #endif
18225 
18226     return(test_ret);
18227 }
18228 
18229 static int
test_schematron(void)18230 test_schematron(void) {
18231     int test_ret = 0;
18232 
18233     if (quiet == 0) printf("Testing schematron : 1 of 10 functions ...\n");
18234     test_ret += test_xmlSchematronNewDocParserCtxt();
18235     test_ret += test_xmlSchematronNewMemParserCtxt();
18236     test_ret += test_xmlSchematronNewParserCtxt();
18237     test_ret += test_xmlSchematronNewValidCtxt();
18238     test_ret += test_xmlSchematronParse();
18239     test_ret += test_xmlSchematronSetValidStructuredErrors();
18240     test_ret += test_xmlSchematronValidateDoc();
18241 
18242     if (test_ret != 0)
18243 	printf("Module schematron: %d errors\n", test_ret);
18244     return(test_ret);
18245 }
18246 
18247 static int
test_xmlAddChild(void)18248 test_xmlAddChild(void) {
18249     int test_ret = 0;
18250 
18251     int mem_base;
18252     xmlNodePtr ret_val;
18253     xmlNodePtr parent; /* the parent node */
18254     int n_parent;
18255     xmlNodePtr cur; /* the child node */
18256     int n_cur;
18257 
18258     for (n_parent = 0;n_parent < gen_nb_xmlNodePtr;n_parent++) {
18259     for (n_cur = 0;n_cur < gen_nb_xmlNodePtr_in;n_cur++) {
18260         mem_base = xmlMemBlocks();
18261         parent = gen_xmlNodePtr(n_parent, 0);
18262         cur = gen_xmlNodePtr_in(n_cur, 1);
18263 
18264         ret_val = xmlAddChild(parent, cur);
18265         if (ret_val == NULL) { xmlFreeNode(cur) ; cur = NULL ; }
18266         desret_xmlNodePtr(ret_val);
18267         call_tests++;
18268         des_xmlNodePtr(n_parent, parent, 0);
18269         des_xmlNodePtr_in(n_cur, cur, 1);
18270         xmlResetLastError();
18271         if (mem_base != xmlMemBlocks()) {
18272             printf("Leak of %d blocks found in xmlAddChild",
18273 	           xmlMemBlocks() - mem_base);
18274 	    test_ret++;
18275             printf(" %d", n_parent);
18276             printf(" %d", n_cur);
18277             printf("\n");
18278         }
18279     }
18280     }
18281     function_tests++;
18282 
18283     return(test_ret);
18284 }
18285 
18286 
18287 static int
test_xmlAddChildList(void)18288 test_xmlAddChildList(void) {
18289     int test_ret = 0;
18290 
18291     int mem_base;
18292     xmlNodePtr ret_val;
18293     xmlNodePtr parent; /* the parent node */
18294     int n_parent;
18295     xmlNodePtr cur; /* the first node in the list */
18296     int n_cur;
18297 
18298     for (n_parent = 0;n_parent < gen_nb_xmlNodePtr;n_parent++) {
18299     for (n_cur = 0;n_cur < gen_nb_xmlNodePtr_in;n_cur++) {
18300         mem_base = xmlMemBlocks();
18301         parent = gen_xmlNodePtr(n_parent, 0);
18302         cur = gen_xmlNodePtr_in(n_cur, 1);
18303 
18304         ret_val = xmlAddChildList(parent, cur);
18305         if (ret_val == NULL) { xmlFreeNodeList(cur) ; cur = NULL ; }
18306         desret_xmlNodePtr(ret_val);
18307         call_tests++;
18308         des_xmlNodePtr(n_parent, parent, 0);
18309         des_xmlNodePtr_in(n_cur, cur, 1);
18310         xmlResetLastError();
18311         if (mem_base != xmlMemBlocks()) {
18312             printf("Leak of %d blocks found in xmlAddChildList",
18313 	           xmlMemBlocks() - mem_base);
18314 	    test_ret++;
18315             printf(" %d", n_parent);
18316             printf(" %d", n_cur);
18317             printf("\n");
18318         }
18319     }
18320     }
18321     function_tests++;
18322 
18323     return(test_ret);
18324 }
18325 
18326 
18327 static int
test_xmlAddNextSibling(void)18328 test_xmlAddNextSibling(void) {
18329     int test_ret = 0;
18330 
18331     int mem_base;
18332     xmlNodePtr ret_val;
18333     xmlNodePtr cur; /* the child node */
18334     int n_cur;
18335     xmlNodePtr elem; /* the new node */
18336     int n_elem;
18337 
18338     for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
18339     for (n_elem = 0;n_elem < gen_nb_xmlNodePtr_in;n_elem++) {
18340         mem_base = xmlMemBlocks();
18341         cur = gen_xmlNodePtr(n_cur, 0);
18342         elem = gen_xmlNodePtr_in(n_elem, 1);
18343 
18344         ret_val = xmlAddNextSibling(cur, elem);
18345         if (ret_val == NULL) { xmlFreeNode(elem) ; elem = NULL ; }
18346         desret_xmlNodePtr(ret_val);
18347         call_tests++;
18348         des_xmlNodePtr(n_cur, cur, 0);
18349         des_xmlNodePtr_in(n_elem, elem, 1);
18350         xmlResetLastError();
18351         if (mem_base != xmlMemBlocks()) {
18352             printf("Leak of %d blocks found in xmlAddNextSibling",
18353 	           xmlMemBlocks() - mem_base);
18354 	    test_ret++;
18355             printf(" %d", n_cur);
18356             printf(" %d", n_elem);
18357             printf("\n");
18358         }
18359     }
18360     }
18361     function_tests++;
18362 
18363     return(test_ret);
18364 }
18365 
18366 
18367 static int
test_xmlAddPrevSibling(void)18368 test_xmlAddPrevSibling(void) {
18369     int test_ret = 0;
18370 
18371 #if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_HTML_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED) || defined(LIBXML_XINCLUDE_ENABLED)
18372     int mem_base;
18373     xmlNodePtr ret_val;
18374     xmlNodePtr cur; /* the child node */
18375     int n_cur;
18376     xmlNodePtr elem; /* the new node */
18377     int n_elem;
18378 
18379     for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
18380     for (n_elem = 0;n_elem < gen_nb_xmlNodePtr_in;n_elem++) {
18381         mem_base = xmlMemBlocks();
18382         cur = gen_xmlNodePtr(n_cur, 0);
18383         elem = gen_xmlNodePtr_in(n_elem, 1);
18384 
18385         ret_val = xmlAddPrevSibling(cur, elem);
18386         if (ret_val == NULL) { xmlFreeNode(elem) ; elem = NULL ; }
18387         desret_xmlNodePtr(ret_val);
18388         call_tests++;
18389         des_xmlNodePtr(n_cur, cur, 0);
18390         des_xmlNodePtr_in(n_elem, elem, 1);
18391         xmlResetLastError();
18392         if (mem_base != xmlMemBlocks()) {
18393             printf("Leak of %d blocks found in xmlAddPrevSibling",
18394 	           xmlMemBlocks() - mem_base);
18395 	    test_ret++;
18396             printf(" %d", n_cur);
18397             printf(" %d", n_elem);
18398             printf("\n");
18399         }
18400     }
18401     }
18402     function_tests++;
18403 #endif
18404 
18405     return(test_ret);
18406 }
18407 
18408 
18409 static int
test_xmlAddSibling(void)18410 test_xmlAddSibling(void) {
18411     int test_ret = 0;
18412 
18413     int mem_base;
18414     xmlNodePtr ret_val;
18415     xmlNodePtr cur; /* the child node */
18416     int n_cur;
18417     xmlNodePtr elem; /* the new node */
18418     int n_elem;
18419 
18420     for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
18421     for (n_elem = 0;n_elem < gen_nb_xmlNodePtr_in;n_elem++) {
18422         mem_base = xmlMemBlocks();
18423         cur = gen_xmlNodePtr(n_cur, 0);
18424         elem = gen_xmlNodePtr_in(n_elem, 1);
18425 
18426         ret_val = xmlAddSibling(cur, elem);
18427         if (ret_val == NULL) { xmlFreeNode(elem) ; elem = NULL ; }
18428         desret_xmlNodePtr(ret_val);
18429         call_tests++;
18430         des_xmlNodePtr(n_cur, cur, 0);
18431         des_xmlNodePtr_in(n_elem, elem, 1);
18432         xmlResetLastError();
18433         if (mem_base != xmlMemBlocks()) {
18434             printf("Leak of %d blocks found in xmlAddSibling",
18435 	           xmlMemBlocks() - mem_base);
18436 	    test_ret++;
18437             printf(" %d", n_cur);
18438             printf(" %d", n_elem);
18439             printf("\n");
18440         }
18441     }
18442     }
18443     function_tests++;
18444 
18445     return(test_ret);
18446 }
18447 
18448 
18449 static int
test_xmlAttrSerializeTxtContent(void)18450 test_xmlAttrSerializeTxtContent(void) {
18451     int test_ret = 0;
18452 
18453 #if defined(LIBXML_OUTPUT_ENABLED)
18454 #ifdef LIBXML_OUTPUT_ENABLED
18455     int mem_base;
18456     xmlBufferPtr buf; /* the XML buffer output */
18457     int n_buf;
18458     xmlDocPtr doc; /* the document */
18459     int n_doc;
18460     xmlAttrPtr attr; /* the attribute node */
18461     int n_attr;
18462     xmlChar * string; /* the text content */
18463     int n_string;
18464 
18465     for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
18466     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
18467     for (n_attr = 0;n_attr < gen_nb_xmlAttrPtr;n_attr++) {
18468     for (n_string = 0;n_string < gen_nb_const_xmlChar_ptr;n_string++) {
18469         mem_base = xmlMemBlocks();
18470         buf = gen_xmlBufferPtr(n_buf, 0);
18471         doc = gen_xmlDocPtr(n_doc, 1);
18472         attr = gen_xmlAttrPtr(n_attr, 2);
18473         string = gen_const_xmlChar_ptr(n_string, 3);
18474 
18475         xmlAttrSerializeTxtContent(buf, doc, attr, (const xmlChar *)string);
18476         call_tests++;
18477         des_xmlBufferPtr(n_buf, buf, 0);
18478         des_xmlDocPtr(n_doc, doc, 1);
18479         des_xmlAttrPtr(n_attr, attr, 2);
18480         des_const_xmlChar_ptr(n_string, (const xmlChar *)string, 3);
18481         xmlResetLastError();
18482         if (mem_base != xmlMemBlocks()) {
18483             printf("Leak of %d blocks found in xmlAttrSerializeTxtContent",
18484 	           xmlMemBlocks() - mem_base);
18485 	    test_ret++;
18486             printf(" %d", n_buf);
18487             printf(" %d", n_doc);
18488             printf(" %d", n_attr);
18489             printf(" %d", n_string);
18490             printf("\n");
18491         }
18492     }
18493     }
18494     }
18495     }
18496     function_tests++;
18497 #endif
18498 #endif
18499 
18500     return(test_ret);
18501 }
18502 
18503 
18504 #define gen_nb_const_xmlBuf_ptr 1
gen_const_xmlBuf_ptr(int no ATTRIBUTE_UNUSED,int nr ATTRIBUTE_UNUSED)18505 static xmlBuf * gen_const_xmlBuf_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
18506     return(NULL);
18507 }
des_const_xmlBuf_ptr(int no ATTRIBUTE_UNUSED,const xmlBuf * val ATTRIBUTE_UNUSED,int nr ATTRIBUTE_UNUSED)18508 static void des_const_xmlBuf_ptr(int no ATTRIBUTE_UNUSED, const xmlBuf * val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
18509 }
18510 
18511 static int
test_xmlBufContent(void)18512 test_xmlBufContent(void) {
18513     int test_ret = 0;
18514 
18515     int mem_base;
18516     xmlChar * ret_val;
18517     xmlBuf * buf; /* the buffer */
18518     int n_buf;
18519 
18520     for (n_buf = 0;n_buf < gen_nb_const_xmlBuf_ptr;n_buf++) {
18521         mem_base = xmlMemBlocks();
18522         buf = gen_const_xmlBuf_ptr(n_buf, 0);
18523 
18524         ret_val = xmlBufContent((const xmlBuf *)buf);
18525         desret_xmlChar_ptr(ret_val);
18526         call_tests++;
18527         des_const_xmlBuf_ptr(n_buf, (const xmlBuf *)buf, 0);
18528         xmlResetLastError();
18529         if (mem_base != xmlMemBlocks()) {
18530             printf("Leak of %d blocks found in xmlBufContent",
18531 	           xmlMemBlocks() - mem_base);
18532 	    test_ret++;
18533             printf(" %d", n_buf);
18534             printf("\n");
18535         }
18536     }
18537     function_tests++;
18538 
18539     return(test_ret);
18540 }
18541 
18542 
18543 #define gen_nb_xmlBufPtr 1
gen_xmlBufPtr(int no ATTRIBUTE_UNUSED,int nr ATTRIBUTE_UNUSED)18544 static xmlBufPtr gen_xmlBufPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
18545     return(NULL);
18546 }
des_xmlBufPtr(int no ATTRIBUTE_UNUSED,xmlBufPtr val ATTRIBUTE_UNUSED,int nr ATTRIBUTE_UNUSED)18547 static void des_xmlBufPtr(int no ATTRIBUTE_UNUSED, xmlBufPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
18548 }
18549 
18550 static int
test_xmlBufEnd(void)18551 test_xmlBufEnd(void) {
18552     int test_ret = 0;
18553 
18554     int mem_base;
18555     xmlChar * ret_val;
18556     xmlBufPtr buf; /* the buffer */
18557     int n_buf;
18558 
18559     for (n_buf = 0;n_buf < gen_nb_xmlBufPtr;n_buf++) {
18560         mem_base = xmlMemBlocks();
18561         buf = gen_xmlBufPtr(n_buf, 0);
18562 
18563         ret_val = xmlBufEnd(buf);
18564         desret_xmlChar_ptr(ret_val);
18565         call_tests++;
18566         des_xmlBufPtr(n_buf, buf, 0);
18567         xmlResetLastError();
18568         if (mem_base != xmlMemBlocks()) {
18569             printf("Leak of %d blocks found in xmlBufEnd",
18570 	           xmlMemBlocks() - mem_base);
18571 	    test_ret++;
18572             printf(" %d", n_buf);
18573             printf("\n");
18574         }
18575     }
18576     function_tests++;
18577 
18578     return(test_ret);
18579 }
18580 
18581 
18582 #define gen_nb_const_xmlNode_ptr 1
gen_const_xmlNode_ptr(int no ATTRIBUTE_UNUSED,int nr ATTRIBUTE_UNUSED)18583 static xmlNode * gen_const_xmlNode_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
18584     return(NULL);
18585 }
des_const_xmlNode_ptr(int no ATTRIBUTE_UNUSED,const xmlNode * val ATTRIBUTE_UNUSED,int nr ATTRIBUTE_UNUSED)18586 static void des_const_xmlNode_ptr(int no ATTRIBUTE_UNUSED, const xmlNode * val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
18587 }
18588 
18589 static int
test_xmlBufGetNodeContent(void)18590 test_xmlBufGetNodeContent(void) {
18591     int test_ret = 0;
18592 
18593     int mem_base;
18594     int ret_val;
18595     xmlBufPtr buf; /* a buffer xmlBufPtr */
18596     int n_buf;
18597     xmlNode * cur; /* the node being read */
18598     int n_cur;
18599 
18600     for (n_buf = 0;n_buf < gen_nb_xmlBufPtr;n_buf++) {
18601     for (n_cur = 0;n_cur < gen_nb_const_xmlNode_ptr;n_cur++) {
18602         mem_base = xmlMemBlocks();
18603         buf = gen_xmlBufPtr(n_buf, 0);
18604         cur = gen_const_xmlNode_ptr(n_cur, 1);
18605 
18606         ret_val = xmlBufGetNodeContent(buf, (const xmlNode *)cur);
18607         desret_int(ret_val);
18608         call_tests++;
18609         des_xmlBufPtr(n_buf, buf, 0);
18610         des_const_xmlNode_ptr(n_cur, (const xmlNode *)cur, 1);
18611         xmlResetLastError();
18612         if (mem_base != xmlMemBlocks()) {
18613             printf("Leak of %d blocks found in xmlBufGetNodeContent",
18614 	           xmlMemBlocks() - mem_base);
18615 	    test_ret++;
18616             printf(" %d", n_buf);
18617             printf(" %d", n_cur);
18618             printf("\n");
18619         }
18620     }
18621     }
18622     function_tests++;
18623 
18624     return(test_ret);
18625 }
18626 
18627 
18628 static int
test_xmlBufNodeDump(void)18629 test_xmlBufNodeDump(void) {
18630     int test_ret = 0;
18631 
18632 
18633     /* missing type support */
18634     return(test_ret);
18635 }
18636 
18637 
18638 static int
test_xmlBufShrink(void)18639 test_xmlBufShrink(void) {
18640     int test_ret = 0;
18641 
18642 
18643     /* missing type support */
18644     return(test_ret);
18645 }
18646 
18647 
18648 static int
test_xmlBufUse(void)18649 test_xmlBufUse(void) {
18650     int test_ret = 0;
18651 
18652 
18653     /* missing type support */
18654     return(test_ret);
18655 }
18656 
18657 
18658 static int
test_xmlBufferAdd(void)18659 test_xmlBufferAdd(void) {
18660     int test_ret = 0;
18661 
18662     int mem_base;
18663     int ret_val;
18664     xmlBufferPtr buf; /* the buffer to dump */
18665     int n_buf;
18666     xmlChar * str; /* the #xmlChar string */
18667     int n_str;
18668     int len; /* the number of #xmlChar to add */
18669     int n_len;
18670 
18671     for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
18672     for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) {
18673     for (n_len = 0;n_len < gen_nb_int;n_len++) {
18674         mem_base = xmlMemBlocks();
18675         buf = gen_xmlBufferPtr(n_buf, 0);
18676         str = gen_const_xmlChar_ptr(n_str, 1);
18677         len = gen_int(n_len, 2);
18678         if ((str != NULL) &&
18679             (len > (int) strlen((const char *) str) + 1))
18680             continue;
18681 
18682         ret_val = xmlBufferAdd(buf, (const xmlChar *)str, len);
18683         desret_int(ret_val);
18684         call_tests++;
18685         des_xmlBufferPtr(n_buf, buf, 0);
18686         des_const_xmlChar_ptr(n_str, (const xmlChar *)str, 1);
18687         des_int(n_len, len, 2);
18688         xmlResetLastError();
18689         if (mem_base != xmlMemBlocks()) {
18690             printf("Leak of %d blocks found in xmlBufferAdd",
18691 	           xmlMemBlocks() - mem_base);
18692 	    test_ret++;
18693             printf(" %d", n_buf);
18694             printf(" %d", n_str);
18695             printf(" %d", n_len);
18696             printf("\n");
18697         }
18698     }
18699     }
18700     }
18701     function_tests++;
18702 
18703     return(test_ret);
18704 }
18705 
18706 
18707 static int
test_xmlBufferAddHead(void)18708 test_xmlBufferAddHead(void) {
18709     int test_ret = 0;
18710 
18711     int mem_base;
18712     int ret_val;
18713     xmlBufferPtr buf; /* the buffer */
18714     int n_buf;
18715     xmlChar * str; /* the #xmlChar string */
18716     int n_str;
18717     int len; /* the number of #xmlChar to add */
18718     int n_len;
18719 
18720     for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
18721     for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) {
18722     for (n_len = 0;n_len < gen_nb_int;n_len++) {
18723         mem_base = xmlMemBlocks();
18724         buf = gen_xmlBufferPtr(n_buf, 0);
18725         str = gen_const_xmlChar_ptr(n_str, 1);
18726         len = gen_int(n_len, 2);
18727         if ((str != NULL) &&
18728             (len > (int) strlen((const char *) str) + 1))
18729             continue;
18730 
18731         ret_val = xmlBufferAddHead(buf, (const xmlChar *)str, len);
18732         desret_int(ret_val);
18733         call_tests++;
18734         des_xmlBufferPtr(n_buf, buf, 0);
18735         des_const_xmlChar_ptr(n_str, (const xmlChar *)str, 1);
18736         des_int(n_len, len, 2);
18737         xmlResetLastError();
18738         if (mem_base != xmlMemBlocks()) {
18739             printf("Leak of %d blocks found in xmlBufferAddHead",
18740 	           xmlMemBlocks() - mem_base);
18741 	    test_ret++;
18742             printf(" %d", n_buf);
18743             printf(" %d", n_str);
18744             printf(" %d", n_len);
18745             printf("\n");
18746         }
18747     }
18748     }
18749     }
18750     function_tests++;
18751 
18752     return(test_ret);
18753 }
18754 
18755 
18756 static int
test_xmlBufferCCat(void)18757 test_xmlBufferCCat(void) {
18758     int test_ret = 0;
18759 
18760     int mem_base;
18761     int ret_val;
18762     xmlBufferPtr buf; /* the buffer to dump */
18763     int n_buf;
18764     char * str; /* the C char string */
18765     int n_str;
18766 
18767     for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
18768     for (n_str = 0;n_str < gen_nb_const_char_ptr;n_str++) {
18769         mem_base = xmlMemBlocks();
18770         buf = gen_xmlBufferPtr(n_buf, 0);
18771         str = gen_const_char_ptr(n_str, 1);
18772 
18773         ret_val = xmlBufferCCat(buf, (const char *)str);
18774         desret_int(ret_val);
18775         call_tests++;
18776         des_xmlBufferPtr(n_buf, buf, 0);
18777         des_const_char_ptr(n_str, (const char *)str, 1);
18778         xmlResetLastError();
18779         if (mem_base != xmlMemBlocks()) {
18780             printf("Leak of %d blocks found in xmlBufferCCat",
18781 	           xmlMemBlocks() - mem_base);
18782 	    test_ret++;
18783             printf(" %d", n_buf);
18784             printf(" %d", n_str);
18785             printf("\n");
18786         }
18787     }
18788     }
18789     function_tests++;
18790 
18791     return(test_ret);
18792 }
18793 
18794 
18795 static int
test_xmlBufferCat(void)18796 test_xmlBufferCat(void) {
18797     int test_ret = 0;
18798 
18799     int mem_base;
18800     int ret_val;
18801     xmlBufferPtr buf; /* the buffer to add to */
18802     int n_buf;
18803     xmlChar * str; /* the #xmlChar string */
18804     int n_str;
18805 
18806     for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
18807     for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) {
18808         mem_base = xmlMemBlocks();
18809         buf = gen_xmlBufferPtr(n_buf, 0);
18810         str = gen_const_xmlChar_ptr(n_str, 1);
18811 
18812         ret_val = xmlBufferCat(buf, (const xmlChar *)str);
18813         desret_int(ret_val);
18814         call_tests++;
18815         des_xmlBufferPtr(n_buf, buf, 0);
18816         des_const_xmlChar_ptr(n_str, (const xmlChar *)str, 1);
18817         xmlResetLastError();
18818         if (mem_base != xmlMemBlocks()) {
18819             printf("Leak of %d blocks found in xmlBufferCat",
18820 	           xmlMemBlocks() - mem_base);
18821 	    test_ret++;
18822             printf(" %d", n_buf);
18823             printf(" %d", n_str);
18824             printf("\n");
18825         }
18826     }
18827     }
18828     function_tests++;
18829 
18830     return(test_ret);
18831 }
18832 
18833 
18834 #define gen_nb_const_xmlBuffer_ptr 1
gen_const_xmlBuffer_ptr(int no ATTRIBUTE_UNUSED,int nr ATTRIBUTE_UNUSED)18835 static xmlBuffer * gen_const_xmlBuffer_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
18836     return(NULL);
18837 }
des_const_xmlBuffer_ptr(int no ATTRIBUTE_UNUSED,const xmlBuffer * val ATTRIBUTE_UNUSED,int nr ATTRIBUTE_UNUSED)18838 static void des_const_xmlBuffer_ptr(int no ATTRIBUTE_UNUSED, const xmlBuffer * val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
18839 }
18840 
18841 static int
test_xmlBufferContent(void)18842 test_xmlBufferContent(void) {
18843     int test_ret = 0;
18844 
18845     int mem_base;
18846     const xmlChar * ret_val;
18847     xmlBuffer * buf; /* the buffer */
18848     int n_buf;
18849 
18850     for (n_buf = 0;n_buf < gen_nb_const_xmlBuffer_ptr;n_buf++) {
18851         mem_base = xmlMemBlocks();
18852         buf = gen_const_xmlBuffer_ptr(n_buf, 0);
18853 
18854         ret_val = xmlBufferContent((const xmlBuffer *)buf);
18855         desret_const_xmlChar_ptr(ret_val);
18856         call_tests++;
18857         des_const_xmlBuffer_ptr(n_buf, (const xmlBuffer *)buf, 0);
18858         xmlResetLastError();
18859         if (mem_base != xmlMemBlocks()) {
18860             printf("Leak of %d blocks found in xmlBufferContent",
18861 	           xmlMemBlocks() - mem_base);
18862 	    test_ret++;
18863             printf(" %d", n_buf);
18864             printf("\n");
18865         }
18866     }
18867     function_tests++;
18868 
18869     return(test_ret);
18870 }
18871 
18872 
18873 static int
test_xmlBufferCreate(void)18874 test_xmlBufferCreate(void) {
18875     int test_ret = 0;
18876 
18877     int mem_base;
18878     xmlBufferPtr ret_val;
18879 
18880         mem_base = xmlMemBlocks();
18881 
18882         ret_val = xmlBufferCreate();
18883         desret_xmlBufferPtr(ret_val);
18884         call_tests++;
18885         xmlResetLastError();
18886         if (mem_base != xmlMemBlocks()) {
18887             printf("Leak of %d blocks found in xmlBufferCreate",
18888 	           xmlMemBlocks() - mem_base);
18889 	    test_ret++;
18890             printf("\n");
18891         }
18892     function_tests++;
18893 
18894     return(test_ret);
18895 }
18896 
18897 
18898 static int
test_xmlBufferCreateSize(void)18899 test_xmlBufferCreateSize(void) {
18900     int test_ret = 0;
18901 
18902 
18903     /* missing type support */
18904     return(test_ret);
18905 }
18906 
18907 
18908 static int
test_xmlBufferCreateStatic(void)18909 test_xmlBufferCreateStatic(void) {
18910     int test_ret = 0;
18911 
18912 
18913     /* missing type support */
18914     return(test_ret);
18915 }
18916 
18917 
18918 static int
test_xmlBufferDetach(void)18919 test_xmlBufferDetach(void) {
18920     int test_ret = 0;
18921 
18922     int mem_base;
18923     xmlChar * ret_val;
18924     xmlBufferPtr buf; /* the buffer */
18925     int n_buf;
18926 
18927     for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
18928         mem_base = xmlMemBlocks();
18929         buf = gen_xmlBufferPtr(n_buf, 0);
18930 
18931         ret_val = xmlBufferDetach(buf);
18932         desret_xmlChar_ptr(ret_val);
18933         call_tests++;
18934         des_xmlBufferPtr(n_buf, buf, 0);
18935         xmlResetLastError();
18936         if (mem_base != xmlMemBlocks()) {
18937             printf("Leak of %d blocks found in xmlBufferDetach",
18938 	           xmlMemBlocks() - mem_base);
18939 	    test_ret++;
18940             printf(" %d", n_buf);
18941             printf("\n");
18942         }
18943     }
18944     function_tests++;
18945 
18946     return(test_ret);
18947 }
18948 
18949 
18950 static int
test_xmlBufferEmpty(void)18951 test_xmlBufferEmpty(void) {
18952     int test_ret = 0;
18953 
18954     int mem_base;
18955     xmlBufferPtr buf; /* the buffer */
18956     int n_buf;
18957 
18958     for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
18959         mem_base = xmlMemBlocks();
18960         buf = gen_xmlBufferPtr(n_buf, 0);
18961 
18962         xmlBufferEmpty(buf);
18963         call_tests++;
18964         des_xmlBufferPtr(n_buf, buf, 0);
18965         xmlResetLastError();
18966         if (mem_base != xmlMemBlocks()) {
18967             printf("Leak of %d blocks found in xmlBufferEmpty",
18968 	           xmlMemBlocks() - mem_base);
18969 	    test_ret++;
18970             printf(" %d", n_buf);
18971             printf("\n");
18972         }
18973     }
18974     function_tests++;
18975 
18976     return(test_ret);
18977 }
18978 
18979 
18980 static int
test_xmlBufferGrow(void)18981 test_xmlBufferGrow(void) {
18982     int test_ret = 0;
18983 
18984     int mem_base;
18985     int ret_val;
18986     xmlBufferPtr buf; /* the buffer */
18987     int n_buf;
18988     unsigned int len; /* the minimum free size to allocate */
18989     int n_len;
18990 
18991     for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
18992     for (n_len = 0;n_len < gen_nb_unsigned_int;n_len++) {
18993         mem_base = xmlMemBlocks();
18994         buf = gen_xmlBufferPtr(n_buf, 0);
18995         len = gen_unsigned_int(n_len, 1);
18996 
18997         ret_val = xmlBufferGrow(buf, len);
18998         desret_int(ret_val);
18999         call_tests++;
19000         des_xmlBufferPtr(n_buf, buf, 0);
19001         des_unsigned_int(n_len, len, 1);
19002         xmlResetLastError();
19003         if (mem_base != xmlMemBlocks()) {
19004             printf("Leak of %d blocks found in xmlBufferGrow",
19005 	           xmlMemBlocks() - mem_base);
19006 	    test_ret++;
19007             printf(" %d", n_buf);
19008             printf(" %d", n_len);
19009             printf("\n");
19010         }
19011     }
19012     }
19013     function_tests++;
19014 
19015     return(test_ret);
19016 }
19017 
19018 
19019 static int
test_xmlBufferLength(void)19020 test_xmlBufferLength(void) {
19021     int test_ret = 0;
19022 
19023     int mem_base;
19024     int ret_val;
19025     xmlBuffer * buf; /* the buffer */
19026     int n_buf;
19027 
19028     for (n_buf = 0;n_buf < gen_nb_const_xmlBuffer_ptr;n_buf++) {
19029         mem_base = xmlMemBlocks();
19030         buf = gen_const_xmlBuffer_ptr(n_buf, 0);
19031 
19032         ret_val = xmlBufferLength((const xmlBuffer *)buf);
19033         desret_int(ret_val);
19034         call_tests++;
19035         des_const_xmlBuffer_ptr(n_buf, (const xmlBuffer *)buf, 0);
19036         xmlResetLastError();
19037         if (mem_base != xmlMemBlocks()) {
19038             printf("Leak of %d blocks found in xmlBufferLength",
19039 	           xmlMemBlocks() - mem_base);
19040 	    test_ret++;
19041             printf(" %d", n_buf);
19042             printf("\n");
19043         }
19044     }
19045     function_tests++;
19046 
19047     return(test_ret);
19048 }
19049 
19050 
19051 static int
test_xmlBufferResize(void)19052 test_xmlBufferResize(void) {
19053     int test_ret = 0;
19054 
19055     int mem_base;
19056     int ret_val;
19057     xmlBufferPtr buf; /* the buffer to resize */
19058     int n_buf;
19059     unsigned int size; /* the desired size */
19060     int n_size;
19061 
19062     for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
19063     for (n_size = 0;n_size < gen_nb_unsigned_int;n_size++) {
19064         mem_base = xmlMemBlocks();
19065         buf = gen_xmlBufferPtr(n_buf, 0);
19066         size = gen_unsigned_int(n_size, 1);
19067 
19068         ret_val = xmlBufferResize(buf, size);
19069         desret_int(ret_val);
19070         call_tests++;
19071         des_xmlBufferPtr(n_buf, buf, 0);
19072         des_unsigned_int(n_size, size, 1);
19073         xmlResetLastError();
19074         if (mem_base != xmlMemBlocks()) {
19075             printf("Leak of %d blocks found in xmlBufferResize",
19076 	           xmlMemBlocks() - mem_base);
19077 	    test_ret++;
19078             printf(" %d", n_buf);
19079             printf(" %d", n_size);
19080             printf("\n");
19081         }
19082     }
19083     }
19084     function_tests++;
19085 
19086     return(test_ret);
19087 }
19088 
19089 
19090 static int
test_xmlBufferSetAllocationScheme(void)19091 test_xmlBufferSetAllocationScheme(void) {
19092     int test_ret = 0;
19093 
19094     int mem_base;
19095     xmlBufferPtr buf; /* the buffer to tune */
19096     int n_buf;
19097     xmlBufferAllocationScheme scheme; /* allocation scheme to use */
19098     int n_scheme;
19099 
19100     for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
19101     for (n_scheme = 0;n_scheme < gen_nb_xmlBufferAllocationScheme;n_scheme++) {
19102         mem_base = xmlMemBlocks();
19103         buf = gen_xmlBufferPtr(n_buf, 0);
19104         scheme = gen_xmlBufferAllocationScheme(n_scheme, 1);
19105 
19106         xmlBufferSetAllocationScheme(buf, scheme);
19107         if ((buf != NULL) && (scheme == XML_BUFFER_ALLOC_IMMUTABLE) && (buf->content != NULL) && (buf->content != static_buf_content)) { xmlFree(buf->content); buf->content = NULL;}
19108         call_tests++;
19109         des_xmlBufferPtr(n_buf, buf, 0);
19110         des_xmlBufferAllocationScheme(n_scheme, scheme, 1);
19111         xmlResetLastError();
19112         if (mem_base != xmlMemBlocks()) {
19113             printf("Leak of %d blocks found in xmlBufferSetAllocationScheme",
19114 	           xmlMemBlocks() - mem_base);
19115 	    test_ret++;
19116             printf(" %d", n_buf);
19117             printf(" %d", n_scheme);
19118             printf("\n");
19119         }
19120     }
19121     }
19122     function_tests++;
19123 
19124     return(test_ret);
19125 }
19126 
19127 
19128 static int
test_xmlBufferShrink(void)19129 test_xmlBufferShrink(void) {
19130     int test_ret = 0;
19131 
19132     int mem_base;
19133     int ret_val;
19134     xmlBufferPtr buf; /* the buffer to dump */
19135     int n_buf;
19136     unsigned int len; /* the number of xmlChar to remove */
19137     int n_len;
19138 
19139     for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
19140     for (n_len = 0;n_len < gen_nb_unsigned_int;n_len++) {
19141         mem_base = xmlMemBlocks();
19142         buf = gen_xmlBufferPtr(n_buf, 0);
19143         len = gen_unsigned_int(n_len, 1);
19144 
19145         ret_val = xmlBufferShrink(buf, len);
19146         desret_int(ret_val);
19147         call_tests++;
19148         des_xmlBufferPtr(n_buf, buf, 0);
19149         des_unsigned_int(n_len, len, 1);
19150         xmlResetLastError();
19151         if (mem_base != xmlMemBlocks()) {
19152             printf("Leak of %d blocks found in xmlBufferShrink",
19153 	           xmlMemBlocks() - mem_base);
19154 	    test_ret++;
19155             printf(" %d", n_buf);
19156             printf(" %d", n_len);
19157             printf("\n");
19158         }
19159     }
19160     }
19161     function_tests++;
19162 
19163     return(test_ret);
19164 }
19165 
19166 
19167 static int
test_xmlBufferWriteCHAR(void)19168 test_xmlBufferWriteCHAR(void) {
19169     int test_ret = 0;
19170 
19171     int mem_base;
19172     xmlBufferPtr buf; /* the XML buffer */
19173     int n_buf;
19174     xmlChar * string; /* the string to add */
19175     int n_string;
19176 
19177     for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
19178     for (n_string = 0;n_string < gen_nb_const_xmlChar_ptr;n_string++) {
19179         mem_base = xmlMemBlocks();
19180         buf = gen_xmlBufferPtr(n_buf, 0);
19181         string = gen_const_xmlChar_ptr(n_string, 1);
19182 
19183         xmlBufferWriteCHAR(buf, (const xmlChar *)string);
19184         call_tests++;
19185         des_xmlBufferPtr(n_buf, buf, 0);
19186         des_const_xmlChar_ptr(n_string, (const xmlChar *)string, 1);
19187         xmlResetLastError();
19188         if (mem_base != xmlMemBlocks()) {
19189             printf("Leak of %d blocks found in xmlBufferWriteCHAR",
19190 	           xmlMemBlocks() - mem_base);
19191 	    test_ret++;
19192             printf(" %d", n_buf);
19193             printf(" %d", n_string);
19194             printf("\n");
19195         }
19196     }
19197     }
19198     function_tests++;
19199 
19200     return(test_ret);
19201 }
19202 
19203 
19204 static int
test_xmlBufferWriteChar(void)19205 test_xmlBufferWriteChar(void) {
19206     int test_ret = 0;
19207 
19208     int mem_base;
19209     xmlBufferPtr buf; /* the XML buffer output */
19210     int n_buf;
19211     char * string; /* the string to add */
19212     int n_string;
19213 
19214     for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
19215     for (n_string = 0;n_string < gen_nb_const_char_ptr;n_string++) {
19216         mem_base = xmlMemBlocks();
19217         buf = gen_xmlBufferPtr(n_buf, 0);
19218         string = gen_const_char_ptr(n_string, 1);
19219 
19220         xmlBufferWriteChar(buf, (const char *)string);
19221         call_tests++;
19222         des_xmlBufferPtr(n_buf, buf, 0);
19223         des_const_char_ptr(n_string, (const char *)string, 1);
19224         xmlResetLastError();
19225         if (mem_base != xmlMemBlocks()) {
19226             printf("Leak of %d blocks found in xmlBufferWriteChar",
19227 	           xmlMemBlocks() - mem_base);
19228 	    test_ret++;
19229             printf(" %d", n_buf);
19230             printf(" %d", n_string);
19231             printf("\n");
19232         }
19233     }
19234     }
19235     function_tests++;
19236 
19237     return(test_ret);
19238 }
19239 
19240 
19241 static int
test_xmlBufferWriteQuotedString(void)19242 test_xmlBufferWriteQuotedString(void) {
19243     int test_ret = 0;
19244 
19245     int mem_base;
19246     xmlBufferPtr buf; /* the XML buffer output */
19247     int n_buf;
19248     xmlChar * string; /* the string to add */
19249     int n_string;
19250 
19251     for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
19252     for (n_string = 0;n_string < gen_nb_const_xmlChar_ptr;n_string++) {
19253         mem_base = xmlMemBlocks();
19254         buf = gen_xmlBufferPtr(n_buf, 0);
19255         string = gen_const_xmlChar_ptr(n_string, 1);
19256 
19257         xmlBufferWriteQuotedString(buf, (const xmlChar *)string);
19258         call_tests++;
19259         des_xmlBufferPtr(n_buf, buf, 0);
19260         des_const_xmlChar_ptr(n_string, (const xmlChar *)string, 1);
19261         xmlResetLastError();
19262         if (mem_base != xmlMemBlocks()) {
19263             printf("Leak of %d blocks found in xmlBufferWriteQuotedString",
19264 	           xmlMemBlocks() - mem_base);
19265 	    test_ret++;
19266             printf(" %d", n_buf);
19267             printf(" %d", n_string);
19268             printf("\n");
19269         }
19270     }
19271     }
19272     function_tests++;
19273 
19274     return(test_ret);
19275 }
19276 
19277 
19278 static int
test_xmlBuildQName(void)19279 test_xmlBuildQName(void) {
19280     int test_ret = 0;
19281 
19282     int mem_base;
19283     xmlChar * ret_val;
19284     xmlChar * ncname; /* the Name */
19285     int n_ncname;
19286     xmlChar * prefix; /* the prefix */
19287     int n_prefix;
19288     xmlChar * memory; /* preallocated memory */
19289     int n_memory;
19290     int len; /* preallocated memory length */
19291     int n_len;
19292 
19293     for (n_ncname = 0;n_ncname < gen_nb_const_xmlChar_ptr;n_ncname++) {
19294     for (n_prefix = 0;n_prefix < gen_nb_const_xmlChar_ptr;n_prefix++) {
19295     for (n_memory = 0;n_memory < gen_nb_xmlChar_ptr;n_memory++) {
19296     for (n_len = 0;n_len < gen_nb_int;n_len++) {
19297         mem_base = xmlMemBlocks();
19298         ncname = gen_const_xmlChar_ptr(n_ncname, 0);
19299         prefix = gen_const_xmlChar_ptr(n_prefix, 1);
19300         memory = gen_xmlChar_ptr(n_memory, 2);
19301         len = gen_int(n_len, 3);
19302         if ((prefix != NULL) &&
19303             (len > (int) strlen((const char *) prefix) + 1))
19304             continue;
19305 
19306         ret_val = xmlBuildQName((const xmlChar *)ncname, (const xmlChar *)prefix, memory, len);
19307         if ((ret_val != NULL) && (ret_val != ncname) &&
19308               (ret_val != prefix) && (ret_val != memory))
19309               xmlFree(ret_val);
19310 	  ret_val = NULL;
19311         desret_xmlChar_ptr(ret_val);
19312         call_tests++;
19313         des_const_xmlChar_ptr(n_ncname, (const xmlChar *)ncname, 0);
19314         des_const_xmlChar_ptr(n_prefix, (const xmlChar *)prefix, 1);
19315         des_xmlChar_ptr(n_memory, memory, 2);
19316         des_int(n_len, len, 3);
19317         xmlResetLastError();
19318         if (mem_base != xmlMemBlocks()) {
19319             printf("Leak of %d blocks found in xmlBuildQName",
19320 	           xmlMemBlocks() - mem_base);
19321 	    test_ret++;
19322             printf(" %d", n_ncname);
19323             printf(" %d", n_prefix);
19324             printf(" %d", n_memory);
19325             printf(" %d", n_len);
19326             printf("\n");
19327         }
19328     }
19329     }
19330     }
19331     }
19332     function_tests++;
19333 
19334     return(test_ret);
19335 }
19336 
19337 
19338 static int
test_xmlChildElementCount(void)19339 test_xmlChildElementCount(void) {
19340     int test_ret = 0;
19341 
19342 #if defined(LIBXML_TREE_ENABLED)
19343     int mem_base;
19344     unsigned long ret_val;
19345     xmlNodePtr parent; /* the parent node */
19346     int n_parent;
19347 
19348     for (n_parent = 0;n_parent < gen_nb_xmlNodePtr;n_parent++) {
19349         mem_base = xmlMemBlocks();
19350         parent = gen_xmlNodePtr(n_parent, 0);
19351 
19352         ret_val = xmlChildElementCount(parent);
19353         desret_unsigned_long(ret_val);
19354         call_tests++;
19355         des_xmlNodePtr(n_parent, parent, 0);
19356         xmlResetLastError();
19357         if (mem_base != xmlMemBlocks()) {
19358             printf("Leak of %d blocks found in xmlChildElementCount",
19359 	           xmlMemBlocks() - mem_base);
19360 	    test_ret++;
19361             printf(" %d", n_parent);
19362             printf("\n");
19363         }
19364     }
19365     function_tests++;
19366 #endif
19367 
19368     return(test_ret);
19369 }
19370 
19371 
19372 static int
test_xmlCopyDoc(void)19373 test_xmlCopyDoc(void) {
19374     int test_ret = 0;
19375 
19376 #if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED)
19377     int mem_base;
19378     xmlDocPtr ret_val;
19379     xmlDocPtr doc; /* the document */
19380     int n_doc;
19381     int recursive; /* if not zero do a recursive copy. */
19382     int n_recursive;
19383 
19384     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
19385     for (n_recursive = 0;n_recursive < gen_nb_int;n_recursive++) {
19386         mem_base = xmlMemBlocks();
19387         doc = gen_xmlDocPtr(n_doc, 0);
19388         recursive = gen_int(n_recursive, 1);
19389 
19390         ret_val = xmlCopyDoc(doc, recursive);
19391         desret_xmlDocPtr(ret_val);
19392         call_tests++;
19393         des_xmlDocPtr(n_doc, doc, 0);
19394         des_int(n_recursive, recursive, 1);
19395         xmlResetLastError();
19396         if (mem_base != xmlMemBlocks()) {
19397             printf("Leak of %d blocks found in xmlCopyDoc",
19398 	           xmlMemBlocks() - mem_base);
19399 	    test_ret++;
19400             printf(" %d", n_doc);
19401             printf(" %d", n_recursive);
19402             printf("\n");
19403         }
19404     }
19405     }
19406     function_tests++;
19407 #endif
19408 
19409     return(test_ret);
19410 }
19411 
19412 
19413 static int
test_xmlCopyDtd(void)19414 test_xmlCopyDtd(void) {
19415     int test_ret = 0;
19416 
19417 #if defined(LIBXML_TREE_ENABLED)
19418     int mem_base;
19419     xmlDtdPtr ret_val;
19420     xmlDtdPtr dtd; /* the dtd */
19421     int n_dtd;
19422 
19423     for (n_dtd = 0;n_dtd < gen_nb_xmlDtdPtr;n_dtd++) {
19424         mem_base = xmlMemBlocks();
19425         dtd = gen_xmlDtdPtr(n_dtd, 0);
19426 
19427         ret_val = xmlCopyDtd(dtd);
19428         desret_xmlDtdPtr(ret_val);
19429         call_tests++;
19430         des_xmlDtdPtr(n_dtd, dtd, 0);
19431         xmlResetLastError();
19432         if (mem_base != xmlMemBlocks()) {
19433             printf("Leak of %d blocks found in xmlCopyDtd",
19434 	           xmlMemBlocks() - mem_base);
19435 	    test_ret++;
19436             printf(" %d", n_dtd);
19437             printf("\n");
19438         }
19439     }
19440     function_tests++;
19441 #endif
19442 
19443     return(test_ret);
19444 }
19445 
19446 
19447 static int
test_xmlCopyNamespace(void)19448 test_xmlCopyNamespace(void) {
19449     int test_ret = 0;
19450 
19451     int mem_base;
19452     xmlNsPtr ret_val;
19453     xmlNsPtr cur; /* the namespace */
19454     int n_cur;
19455 
19456     for (n_cur = 0;n_cur < gen_nb_xmlNsPtr;n_cur++) {
19457         mem_base = xmlMemBlocks();
19458         cur = gen_xmlNsPtr(n_cur, 0);
19459 
19460         ret_val = xmlCopyNamespace(cur);
19461         if (ret_val != NULL) xmlFreeNs(ret_val);
19462         desret_xmlNsPtr(ret_val);
19463         call_tests++;
19464         des_xmlNsPtr(n_cur, cur, 0);
19465         xmlResetLastError();
19466         if (mem_base != xmlMemBlocks()) {
19467             printf("Leak of %d blocks found in xmlCopyNamespace",
19468 	           xmlMemBlocks() - mem_base);
19469 	    test_ret++;
19470             printf(" %d", n_cur);
19471             printf("\n");
19472         }
19473     }
19474     function_tests++;
19475 
19476     return(test_ret);
19477 }
19478 
19479 
19480 static int
test_xmlCopyNamespaceList(void)19481 test_xmlCopyNamespaceList(void) {
19482     int test_ret = 0;
19483 
19484     int mem_base;
19485     xmlNsPtr ret_val;
19486     xmlNsPtr cur; /* the first namespace */
19487     int n_cur;
19488 
19489     for (n_cur = 0;n_cur < gen_nb_xmlNsPtr;n_cur++) {
19490         mem_base = xmlMemBlocks();
19491         cur = gen_xmlNsPtr(n_cur, 0);
19492 
19493         ret_val = xmlCopyNamespaceList(cur);
19494         if (ret_val != NULL) xmlFreeNsList(ret_val);
19495         desret_xmlNsPtr(ret_val);
19496         call_tests++;
19497         des_xmlNsPtr(n_cur, cur, 0);
19498         xmlResetLastError();
19499         if (mem_base != xmlMemBlocks()) {
19500             printf("Leak of %d blocks found in xmlCopyNamespaceList",
19501 	           xmlMemBlocks() - mem_base);
19502 	    test_ret++;
19503             printf(" %d", n_cur);
19504             printf("\n");
19505         }
19506     }
19507     function_tests++;
19508 
19509     return(test_ret);
19510 }
19511 
19512 
19513 static int
test_xmlCopyNode(void)19514 test_xmlCopyNode(void) {
19515     int test_ret = 0;
19516 
19517     int mem_base;
19518     xmlNodePtr ret_val;
19519     xmlNodePtr node; /* the node */
19520     int n_node;
19521     int extended; /* if 1 do a recursive copy (properties, namespaces and children when applicable) if 2 copy properties and namespaces (when applicable) */
19522     int n_extended;
19523 
19524     for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
19525     for (n_extended = 0;n_extended < gen_nb_int;n_extended++) {
19526         mem_base = xmlMemBlocks();
19527         node = gen_xmlNodePtr(n_node, 0);
19528         extended = gen_int(n_extended, 1);
19529 
19530         ret_val = xmlCopyNode(node, extended);
19531         desret_xmlNodePtr(ret_val);
19532         call_tests++;
19533         des_xmlNodePtr(n_node, node, 0);
19534         des_int(n_extended, extended, 1);
19535         xmlResetLastError();
19536         if (mem_base != xmlMemBlocks()) {
19537             printf("Leak of %d blocks found in xmlCopyNode",
19538 	           xmlMemBlocks() - mem_base);
19539 	    test_ret++;
19540             printf(" %d", n_node);
19541             printf(" %d", n_extended);
19542             printf("\n");
19543         }
19544     }
19545     }
19546     function_tests++;
19547 
19548     return(test_ret);
19549 }
19550 
19551 
19552 static int
test_xmlCopyNodeList(void)19553 test_xmlCopyNodeList(void) {
19554     int test_ret = 0;
19555 
19556     int mem_base;
19557     xmlNodePtr ret_val;
19558     xmlNodePtr node; /* the first node in the list. */
19559     int n_node;
19560 
19561     for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
19562         mem_base = xmlMemBlocks();
19563         node = gen_xmlNodePtr(n_node, 0);
19564 
19565         ret_val = xmlCopyNodeList(node);
19566         desret_xmlNodePtr(ret_val);
19567         call_tests++;
19568         des_xmlNodePtr(n_node, node, 0);
19569         xmlResetLastError();
19570         if (mem_base != xmlMemBlocks()) {
19571             printf("Leak of %d blocks found in xmlCopyNodeList",
19572 	           xmlMemBlocks() - mem_base);
19573 	    test_ret++;
19574             printf(" %d", n_node);
19575             printf("\n");
19576         }
19577     }
19578     function_tests++;
19579 
19580     return(test_ret);
19581 }
19582 
19583 
19584 static int
test_xmlCopyProp(void)19585 test_xmlCopyProp(void) {
19586     int test_ret = 0;
19587 
19588     int mem_base;
19589     xmlAttrPtr ret_val;
19590     xmlNodePtr target; /* the element where the attribute will be grafted */
19591     int n_target;
19592     xmlAttrPtr cur; /* the attribute */
19593     int n_cur;
19594 
19595     for (n_target = 0;n_target < gen_nb_xmlNodePtr;n_target++) {
19596     for (n_cur = 0;n_cur < gen_nb_xmlAttrPtr;n_cur++) {
19597         mem_base = xmlMemBlocks();
19598         target = gen_xmlNodePtr(n_target, 0);
19599         cur = gen_xmlAttrPtr(n_cur, 1);
19600 
19601         ret_val = xmlCopyProp(target, cur);
19602         desret_xmlAttrPtr(ret_val);
19603         call_tests++;
19604         des_xmlNodePtr(n_target, target, 0);
19605         des_xmlAttrPtr(n_cur, cur, 1);
19606         xmlResetLastError();
19607         if (mem_base != xmlMemBlocks()) {
19608             printf("Leak of %d blocks found in xmlCopyProp",
19609 	           xmlMemBlocks() - mem_base);
19610 	    test_ret++;
19611             printf(" %d", n_target);
19612             printf(" %d", n_cur);
19613             printf("\n");
19614         }
19615     }
19616     }
19617     function_tests++;
19618 
19619     return(test_ret);
19620 }
19621 
19622 
19623 static int
test_xmlCopyPropList(void)19624 test_xmlCopyPropList(void) {
19625     int test_ret = 0;
19626 
19627     int mem_base;
19628     xmlAttrPtr ret_val;
19629     xmlNodePtr target; /* the element where the attributes will be grafted */
19630     int n_target;
19631     xmlAttrPtr cur; /* the first attribute */
19632     int n_cur;
19633 
19634     for (n_target = 0;n_target < gen_nb_xmlNodePtr;n_target++) {
19635     for (n_cur = 0;n_cur < gen_nb_xmlAttrPtr;n_cur++) {
19636         mem_base = xmlMemBlocks();
19637         target = gen_xmlNodePtr(n_target, 0);
19638         cur = gen_xmlAttrPtr(n_cur, 1);
19639 
19640         ret_val = xmlCopyPropList(target, cur);
19641         desret_xmlAttrPtr(ret_val);
19642         call_tests++;
19643         des_xmlNodePtr(n_target, target, 0);
19644         des_xmlAttrPtr(n_cur, cur, 1);
19645         xmlResetLastError();
19646         if (mem_base != xmlMemBlocks()) {
19647             printf("Leak of %d blocks found in xmlCopyPropList",
19648 	           xmlMemBlocks() - mem_base);
19649 	    test_ret++;
19650             printf(" %d", n_target);
19651             printf(" %d", n_cur);
19652             printf("\n");
19653         }
19654     }
19655     }
19656     function_tests++;
19657 
19658     return(test_ret);
19659 }
19660 
19661 
19662 static int
test_xmlCreateIntSubset(void)19663 test_xmlCreateIntSubset(void) {
19664     int test_ret = 0;
19665 
19666     int mem_base;
19667     xmlDtdPtr ret_val;
19668     xmlDocPtr doc; /* the document pointer */
19669     int n_doc;
19670     xmlChar * name; /* the DTD name */
19671     int n_name;
19672     xmlChar * ExternalID; /* the external (PUBLIC) ID */
19673     int n_ExternalID;
19674     xmlChar * SystemID; /* the system ID */
19675     int n_SystemID;
19676 
19677     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
19678     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
19679     for (n_ExternalID = 0;n_ExternalID < gen_nb_const_xmlChar_ptr;n_ExternalID++) {
19680     for (n_SystemID = 0;n_SystemID < gen_nb_const_xmlChar_ptr;n_SystemID++) {
19681         mem_base = xmlMemBlocks();
19682         doc = gen_xmlDocPtr(n_doc, 0);
19683         name = gen_const_xmlChar_ptr(n_name, 1);
19684         ExternalID = gen_const_xmlChar_ptr(n_ExternalID, 2);
19685         SystemID = gen_const_xmlChar_ptr(n_SystemID, 3);
19686 
19687         ret_val = xmlCreateIntSubset(doc, (const xmlChar *)name, (const xmlChar *)ExternalID, (const xmlChar *)SystemID);
19688         desret_xmlDtdPtr(ret_val);
19689         call_tests++;
19690         des_xmlDocPtr(n_doc, doc, 0);
19691         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
19692         des_const_xmlChar_ptr(n_ExternalID, (const xmlChar *)ExternalID, 2);
19693         des_const_xmlChar_ptr(n_SystemID, (const xmlChar *)SystemID, 3);
19694         xmlResetLastError();
19695         if (mem_base != xmlMemBlocks()) {
19696             printf("Leak of %d blocks found in xmlCreateIntSubset",
19697 	           xmlMemBlocks() - mem_base);
19698 	    test_ret++;
19699             printf(" %d", n_doc);
19700             printf(" %d", n_name);
19701             printf(" %d", n_ExternalID);
19702             printf(" %d", n_SystemID);
19703             printf("\n");
19704         }
19705     }
19706     }
19707     }
19708     }
19709     function_tests++;
19710 
19711     return(test_ret);
19712 }
19713 
19714 
19715 #define gen_nb_xmlDOMWrapCtxtPtr 1
gen_xmlDOMWrapCtxtPtr(int no ATTRIBUTE_UNUSED,int nr ATTRIBUTE_UNUSED)19716 static xmlDOMWrapCtxtPtr gen_xmlDOMWrapCtxtPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
19717     return(NULL);
19718 }
des_xmlDOMWrapCtxtPtr(int no ATTRIBUTE_UNUSED,xmlDOMWrapCtxtPtr val ATTRIBUTE_UNUSED,int nr ATTRIBUTE_UNUSED)19719 static void des_xmlDOMWrapCtxtPtr(int no ATTRIBUTE_UNUSED, xmlDOMWrapCtxtPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
19720 }
19721 
19722 static int
test_xmlDOMWrapAdoptNode(void)19723 test_xmlDOMWrapAdoptNode(void) {
19724     int test_ret = 0;
19725 
19726     int mem_base;
19727     int ret_val;
19728     xmlDOMWrapCtxtPtr ctxt; /* the optional context for custom processing */
19729     int n_ctxt;
19730     xmlDocPtr sourceDoc; /* the optional sourceDoc */
19731     int n_sourceDoc;
19732     xmlNodePtr node; /* the node to start with */
19733     int n_node;
19734     xmlDocPtr destDoc; /* the destination doc */
19735     int n_destDoc;
19736     xmlNodePtr destParent; /* the optional new parent of @node in @destDoc */
19737     int n_destParent;
19738     int options; /* option flags */
19739     int n_options;
19740 
19741     for (n_ctxt = 0;n_ctxt < gen_nb_xmlDOMWrapCtxtPtr;n_ctxt++) {
19742     for (n_sourceDoc = 0;n_sourceDoc < gen_nb_xmlDocPtr;n_sourceDoc++) {
19743     for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
19744     for (n_destDoc = 0;n_destDoc < gen_nb_xmlDocPtr;n_destDoc++) {
19745     for (n_destParent = 0;n_destParent < gen_nb_xmlNodePtr;n_destParent++) {
19746     for (n_options = 0;n_options < gen_nb_int;n_options++) {
19747         mem_base = xmlMemBlocks();
19748         ctxt = gen_xmlDOMWrapCtxtPtr(n_ctxt, 0);
19749         sourceDoc = gen_xmlDocPtr(n_sourceDoc, 1);
19750         node = gen_xmlNodePtr(n_node, 2);
19751         destDoc = gen_xmlDocPtr(n_destDoc, 3);
19752         destParent = gen_xmlNodePtr(n_destParent, 4);
19753         options = gen_int(n_options, 5);
19754 
19755         ret_val = xmlDOMWrapAdoptNode(ctxt, sourceDoc, node, destDoc, destParent, options);
19756         if ((node != NULL) && (node->parent == NULL)) {xmlUnlinkNode(node);xmlFreeNode(node);node = NULL;}
19757         desret_int(ret_val);
19758         call_tests++;
19759         des_xmlDOMWrapCtxtPtr(n_ctxt, ctxt, 0);
19760         des_xmlDocPtr(n_sourceDoc, sourceDoc, 1);
19761         des_xmlNodePtr(n_node, node, 2);
19762         des_xmlDocPtr(n_destDoc, destDoc, 3);
19763         des_xmlNodePtr(n_destParent, destParent, 4);
19764         des_int(n_options, options, 5);
19765         xmlResetLastError();
19766         if (mem_base != xmlMemBlocks()) {
19767             printf("Leak of %d blocks found in xmlDOMWrapAdoptNode",
19768 	           xmlMemBlocks() - mem_base);
19769 	    test_ret++;
19770             printf(" %d", n_ctxt);
19771             printf(" %d", n_sourceDoc);
19772             printf(" %d", n_node);
19773             printf(" %d", n_destDoc);
19774             printf(" %d", n_destParent);
19775             printf(" %d", n_options);
19776             printf("\n");
19777         }
19778     }
19779     }
19780     }
19781     }
19782     }
19783     }
19784     function_tests++;
19785 
19786     return(test_ret);
19787 }
19788 
19789 
19790 static int
test_xmlDOMWrapCloneNode(void)19791 test_xmlDOMWrapCloneNode(void) {
19792     int test_ret = 0;
19793 
19794     int mem_base;
19795     int ret_val;
19796     xmlDOMWrapCtxtPtr ctxt; /* the optional context for custom processing */
19797     int n_ctxt;
19798     xmlDocPtr sourceDoc; /* the optional sourceDoc */
19799     int n_sourceDoc;
19800     xmlNodePtr node; /* the node to start with */
19801     int n_node;
19802     xmlNodePtr * resNode; /* the clone of the given @node */
19803     int n_resNode;
19804     xmlDocPtr destDoc; /* the destination doc */
19805     int n_destDoc;
19806     xmlNodePtr destParent; /* the optional new parent of @node in @destDoc */
19807     int n_destParent;
19808     int deep; /* descend into child if set */
19809     int n_deep;
19810     int options; /* option flags */
19811     int n_options;
19812 
19813     for (n_ctxt = 0;n_ctxt < gen_nb_xmlDOMWrapCtxtPtr;n_ctxt++) {
19814     for (n_sourceDoc = 0;n_sourceDoc < gen_nb_xmlDocPtr;n_sourceDoc++) {
19815     for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
19816     for (n_resNode = 0;n_resNode < gen_nb_xmlNodePtr_ptr;n_resNode++) {
19817     for (n_destDoc = 0;n_destDoc < gen_nb_xmlDocPtr;n_destDoc++) {
19818     for (n_destParent = 0;n_destParent < gen_nb_xmlNodePtr;n_destParent++) {
19819     for (n_deep = 0;n_deep < gen_nb_int;n_deep++) {
19820     for (n_options = 0;n_options < gen_nb_int;n_options++) {
19821         mem_base = xmlMemBlocks();
19822         ctxt = gen_xmlDOMWrapCtxtPtr(n_ctxt, 0);
19823         sourceDoc = gen_xmlDocPtr(n_sourceDoc, 1);
19824         node = gen_xmlNodePtr(n_node, 2);
19825         resNode = gen_xmlNodePtr_ptr(n_resNode, 3);
19826         destDoc = gen_xmlDocPtr(n_destDoc, 4);
19827         destParent = gen_xmlNodePtr(n_destParent, 5);
19828         deep = gen_int(n_deep, 6);
19829         options = gen_int(n_options, 7);
19830 
19831         ret_val = xmlDOMWrapCloneNode(ctxt, sourceDoc, node, resNode, destDoc, destParent, deep, options);
19832         desret_int(ret_val);
19833         call_tests++;
19834         des_xmlDOMWrapCtxtPtr(n_ctxt, ctxt, 0);
19835         des_xmlDocPtr(n_sourceDoc, sourceDoc, 1);
19836         des_xmlNodePtr(n_node, node, 2);
19837         des_xmlNodePtr_ptr(n_resNode, resNode, 3);
19838         des_xmlDocPtr(n_destDoc, destDoc, 4);
19839         des_xmlNodePtr(n_destParent, destParent, 5);
19840         des_int(n_deep, deep, 6);
19841         des_int(n_options, options, 7);
19842         xmlResetLastError();
19843         if (mem_base != xmlMemBlocks()) {
19844             printf("Leak of %d blocks found in xmlDOMWrapCloneNode",
19845 	           xmlMemBlocks() - mem_base);
19846 	    test_ret++;
19847             printf(" %d", n_ctxt);
19848             printf(" %d", n_sourceDoc);
19849             printf(" %d", n_node);
19850             printf(" %d", n_resNode);
19851             printf(" %d", n_destDoc);
19852             printf(" %d", n_destParent);
19853             printf(" %d", n_deep);
19854             printf(" %d", n_options);
19855             printf("\n");
19856         }
19857     }
19858     }
19859     }
19860     }
19861     }
19862     }
19863     }
19864     }
19865     function_tests++;
19866 
19867     return(test_ret);
19868 }
19869 
19870 
19871 static int
test_xmlDOMWrapNewCtxt(void)19872 test_xmlDOMWrapNewCtxt(void) {
19873     int test_ret = 0;
19874 
19875 
19876     /* missing type support */
19877     return(test_ret);
19878 }
19879 
19880 
19881 static int
test_xmlDOMWrapReconcileNamespaces(void)19882 test_xmlDOMWrapReconcileNamespaces(void) {
19883     int test_ret = 0;
19884 
19885     int mem_base;
19886     int ret_val;
19887     xmlDOMWrapCtxtPtr ctxt; /* DOM wrapper context, unused at the moment */
19888     int n_ctxt;
19889     xmlNodePtr elem; /* the element-node */
19890     int n_elem;
19891     int options; /* option flags */
19892     int n_options;
19893 
19894     for (n_ctxt = 0;n_ctxt < gen_nb_xmlDOMWrapCtxtPtr;n_ctxt++) {
19895     for (n_elem = 0;n_elem < gen_nb_xmlNodePtr;n_elem++) {
19896     for (n_options = 0;n_options < gen_nb_int;n_options++) {
19897         mem_base = xmlMemBlocks();
19898         ctxt = gen_xmlDOMWrapCtxtPtr(n_ctxt, 0);
19899         elem = gen_xmlNodePtr(n_elem, 1);
19900         options = gen_int(n_options, 2);
19901 
19902         ret_val = xmlDOMWrapReconcileNamespaces(ctxt, elem, options);
19903         desret_int(ret_val);
19904         call_tests++;
19905         des_xmlDOMWrapCtxtPtr(n_ctxt, ctxt, 0);
19906         des_xmlNodePtr(n_elem, elem, 1);
19907         des_int(n_options, options, 2);
19908         xmlResetLastError();
19909         if (mem_base != xmlMemBlocks()) {
19910             printf("Leak of %d blocks found in xmlDOMWrapReconcileNamespaces",
19911 	           xmlMemBlocks() - mem_base);
19912 	    test_ret++;
19913             printf(" %d", n_ctxt);
19914             printf(" %d", n_elem);
19915             printf(" %d", n_options);
19916             printf("\n");
19917         }
19918     }
19919     }
19920     }
19921     function_tests++;
19922 
19923     return(test_ret);
19924 }
19925 
19926 
19927 static int
test_xmlDOMWrapRemoveNode(void)19928 test_xmlDOMWrapRemoveNode(void) {
19929     int test_ret = 0;
19930 
19931     int mem_base;
19932     int ret_val;
19933     xmlDOMWrapCtxtPtr ctxt; /* a DOM wrapper context */
19934     int n_ctxt;
19935     xmlDocPtr doc; /* the doc */
19936     int n_doc;
19937     xmlNodePtr node; /* the node to be removed. */
19938     int n_node;
19939     int options; /* set of options, unused at the moment */
19940     int n_options;
19941 
19942     for (n_ctxt = 0;n_ctxt < gen_nb_xmlDOMWrapCtxtPtr;n_ctxt++) {
19943     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
19944     for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
19945     for (n_options = 0;n_options < gen_nb_int;n_options++) {
19946         mem_base = xmlMemBlocks();
19947         ctxt = gen_xmlDOMWrapCtxtPtr(n_ctxt, 0);
19948         doc = gen_xmlDocPtr(n_doc, 1);
19949         node = gen_xmlNodePtr(n_node, 2);
19950         options = gen_int(n_options, 3);
19951 
19952         ret_val = xmlDOMWrapRemoveNode(ctxt, doc, node, options);
19953         desret_int(ret_val);
19954         call_tests++;
19955         des_xmlDOMWrapCtxtPtr(n_ctxt, ctxt, 0);
19956         des_xmlDocPtr(n_doc, doc, 1);
19957         des_xmlNodePtr(n_node, node, 2);
19958         des_int(n_options, options, 3);
19959         xmlResetLastError();
19960         if (mem_base != xmlMemBlocks()) {
19961             printf("Leak of %d blocks found in xmlDOMWrapRemoveNode",
19962 	           xmlMemBlocks() - mem_base);
19963 	    test_ret++;
19964             printf(" %d", n_ctxt);
19965             printf(" %d", n_doc);
19966             printf(" %d", n_node);
19967             printf(" %d", n_options);
19968             printf("\n");
19969         }
19970     }
19971     }
19972     }
19973     }
19974     function_tests++;
19975 
19976     return(test_ret);
19977 }
19978 
19979 
19980 static int
test_xmlDocCopyNode(void)19981 test_xmlDocCopyNode(void) {
19982     int test_ret = 0;
19983 
19984     int mem_base;
19985     xmlNodePtr ret_val;
19986     xmlNodePtr node; /* the node */
19987     int n_node;
19988     xmlDocPtr doc; /* the document */
19989     int n_doc;
19990     int extended; /* if 1 do a recursive copy (properties, namespaces and children when applicable) if 2 copy properties and namespaces (when applicable) */
19991     int n_extended;
19992 
19993     for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
19994     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
19995     for (n_extended = 0;n_extended < gen_nb_int;n_extended++) {
19996         mem_base = xmlMemBlocks();
19997         node = gen_xmlNodePtr(n_node, 0);
19998         doc = gen_xmlDocPtr(n_doc, 1);
19999         extended = gen_int(n_extended, 2);
20000 
20001         ret_val = xmlDocCopyNode(node, doc, extended);
20002         desret_xmlNodePtr(ret_val);
20003         call_tests++;
20004         des_xmlNodePtr(n_node, node, 0);
20005         des_xmlDocPtr(n_doc, doc, 1);
20006         des_int(n_extended, extended, 2);
20007         xmlResetLastError();
20008         if (mem_base != xmlMemBlocks()) {
20009             printf("Leak of %d blocks found in xmlDocCopyNode",
20010 	           xmlMemBlocks() - mem_base);
20011 	    test_ret++;
20012             printf(" %d", n_node);
20013             printf(" %d", n_doc);
20014             printf(" %d", n_extended);
20015             printf("\n");
20016         }
20017     }
20018     }
20019     }
20020     function_tests++;
20021 
20022     return(test_ret);
20023 }
20024 
20025 
20026 static int
test_xmlDocCopyNodeList(void)20027 test_xmlDocCopyNodeList(void) {
20028     int test_ret = 0;
20029 
20030     int mem_base;
20031     xmlNodePtr ret_val;
20032     xmlDocPtr doc; /* the target document */
20033     int n_doc;
20034     xmlNodePtr node; /* the first node in the list. */
20035     int n_node;
20036 
20037     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
20038     for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
20039         mem_base = xmlMemBlocks();
20040         doc = gen_xmlDocPtr(n_doc, 0);
20041         node = gen_xmlNodePtr(n_node, 1);
20042 
20043         ret_val = xmlDocCopyNodeList(doc, node);
20044         desret_xmlNodePtr(ret_val);
20045         call_tests++;
20046         des_xmlDocPtr(n_doc, doc, 0);
20047         des_xmlNodePtr(n_node, node, 1);
20048         xmlResetLastError();
20049         if (mem_base != xmlMemBlocks()) {
20050             printf("Leak of %d blocks found in xmlDocCopyNodeList",
20051 	           xmlMemBlocks() - mem_base);
20052 	    test_ret++;
20053             printf(" %d", n_doc);
20054             printf(" %d", n_node);
20055             printf("\n");
20056         }
20057     }
20058     }
20059     function_tests++;
20060 
20061     return(test_ret);
20062 }
20063 
20064 
20065 static int
test_xmlDocDump(void)20066 test_xmlDocDump(void) {
20067     int test_ret = 0;
20068 
20069 #if defined(LIBXML_OUTPUT_ENABLED)
20070     int mem_base;
20071     int ret_val;
20072     FILE * f; /* the FILE* */
20073     int n_f;
20074     xmlDocPtr cur; /* the document */
20075     int n_cur;
20076 
20077     for (n_f = 0;n_f < gen_nb_FILE_ptr;n_f++) {
20078     for (n_cur = 0;n_cur < gen_nb_xmlDocPtr;n_cur++) {
20079         mem_base = xmlMemBlocks();
20080         f = gen_FILE_ptr(n_f, 0);
20081         cur = gen_xmlDocPtr(n_cur, 1);
20082 
20083         ret_val = xmlDocDump(f, cur);
20084         desret_int(ret_val);
20085         call_tests++;
20086         des_FILE_ptr(n_f, f, 0);
20087         des_xmlDocPtr(n_cur, cur, 1);
20088         xmlResetLastError();
20089         if (mem_base != xmlMemBlocks()) {
20090             printf("Leak of %d blocks found in xmlDocDump",
20091 	           xmlMemBlocks() - mem_base);
20092 	    test_ret++;
20093             printf(" %d", n_f);
20094             printf(" %d", n_cur);
20095             printf("\n");
20096         }
20097     }
20098     }
20099     function_tests++;
20100 #endif
20101 
20102     return(test_ret);
20103 }
20104 
20105 
20106 static int
test_xmlDocDumpFormatMemory(void)20107 test_xmlDocDumpFormatMemory(void) {
20108     int test_ret = 0;
20109 
20110 #if defined(LIBXML_OUTPUT_ENABLED)
20111     int mem_base;
20112     xmlDocPtr cur; /* the document */
20113     int n_cur;
20114     xmlChar ** mem; /* OUT: the memory pointer */
20115     int n_mem;
20116     int * size; /* OUT: the memory length */
20117     int n_size;
20118     int format; /* should formatting spaces been added */
20119     int n_format;
20120 
20121     for (n_cur = 0;n_cur < gen_nb_xmlDocPtr;n_cur++) {
20122     for (n_mem = 0;n_mem < gen_nb_xmlChar_ptr_ptr;n_mem++) {
20123     for (n_size = 0;n_size < gen_nb_int_ptr;n_size++) {
20124     for (n_format = 0;n_format < gen_nb_int;n_format++) {
20125         mem_base = xmlMemBlocks();
20126         cur = gen_xmlDocPtr(n_cur, 0);
20127         mem = gen_xmlChar_ptr_ptr(n_mem, 1);
20128         size = gen_int_ptr(n_size, 2);
20129         format = gen_int(n_format, 3);
20130 
20131         xmlDocDumpFormatMemory(cur, mem, size, format);
20132         call_tests++;
20133         des_xmlDocPtr(n_cur, cur, 0);
20134         des_xmlChar_ptr_ptr(n_mem, mem, 1);
20135         des_int_ptr(n_size, size, 2);
20136         des_int(n_format, format, 3);
20137         xmlResetLastError();
20138         if (mem_base != xmlMemBlocks()) {
20139             printf("Leak of %d blocks found in xmlDocDumpFormatMemory",
20140 	           xmlMemBlocks() - mem_base);
20141 	    test_ret++;
20142             printf(" %d", n_cur);
20143             printf(" %d", n_mem);
20144             printf(" %d", n_size);
20145             printf(" %d", n_format);
20146             printf("\n");
20147         }
20148     }
20149     }
20150     }
20151     }
20152     function_tests++;
20153 #endif
20154 
20155     return(test_ret);
20156 }
20157 
20158 
20159 static int
test_xmlDocDumpFormatMemoryEnc(void)20160 test_xmlDocDumpFormatMemoryEnc(void) {
20161     int test_ret = 0;
20162 
20163 #if defined(LIBXML_OUTPUT_ENABLED)
20164     int mem_base;
20165     xmlDocPtr out_doc; /* Document to generate XML text from */
20166     int n_out_doc;
20167     xmlChar ** doc_txt_ptr; /* Memory pointer for allocated XML text */
20168     int n_doc_txt_ptr;
20169     int * doc_txt_len; /* Length of the generated XML text */
20170     int n_doc_txt_len;
20171     char * txt_encoding; /* Character encoding to use when generating XML text */
20172     int n_txt_encoding;
20173     int format; /* should formatting spaces been added */
20174     int n_format;
20175 
20176     for (n_out_doc = 0;n_out_doc < gen_nb_xmlDocPtr;n_out_doc++) {
20177     for (n_doc_txt_ptr = 0;n_doc_txt_ptr < gen_nb_xmlChar_ptr_ptr;n_doc_txt_ptr++) {
20178     for (n_doc_txt_len = 0;n_doc_txt_len < gen_nb_int_ptr;n_doc_txt_len++) {
20179     for (n_txt_encoding = 0;n_txt_encoding < gen_nb_const_char_ptr;n_txt_encoding++) {
20180     for (n_format = 0;n_format < gen_nb_int;n_format++) {
20181         mem_base = xmlMemBlocks();
20182         out_doc = gen_xmlDocPtr(n_out_doc, 0);
20183         doc_txt_ptr = gen_xmlChar_ptr_ptr(n_doc_txt_ptr, 1);
20184         doc_txt_len = gen_int_ptr(n_doc_txt_len, 2);
20185         txt_encoding = gen_const_char_ptr(n_txt_encoding, 3);
20186         format = gen_int(n_format, 4);
20187 
20188         xmlDocDumpFormatMemoryEnc(out_doc, doc_txt_ptr, doc_txt_len, (const char *)txt_encoding, format);
20189         call_tests++;
20190         des_xmlDocPtr(n_out_doc, out_doc, 0);
20191         des_xmlChar_ptr_ptr(n_doc_txt_ptr, doc_txt_ptr, 1);
20192         des_int_ptr(n_doc_txt_len, doc_txt_len, 2);
20193         des_const_char_ptr(n_txt_encoding, (const char *)txt_encoding, 3);
20194         des_int(n_format, format, 4);
20195         xmlResetLastError();
20196         if (mem_base != xmlMemBlocks()) {
20197             printf("Leak of %d blocks found in xmlDocDumpFormatMemoryEnc",
20198 	           xmlMemBlocks() - mem_base);
20199 	    test_ret++;
20200             printf(" %d", n_out_doc);
20201             printf(" %d", n_doc_txt_ptr);
20202             printf(" %d", n_doc_txt_len);
20203             printf(" %d", n_txt_encoding);
20204             printf(" %d", n_format);
20205             printf("\n");
20206         }
20207     }
20208     }
20209     }
20210     }
20211     }
20212     function_tests++;
20213 #endif
20214 
20215     return(test_ret);
20216 }
20217 
20218 
20219 static int
test_xmlDocDumpMemory(void)20220 test_xmlDocDumpMemory(void) {
20221     int test_ret = 0;
20222 
20223 #if defined(LIBXML_OUTPUT_ENABLED)
20224     int mem_base;
20225     xmlDocPtr cur; /* the document */
20226     int n_cur;
20227     xmlChar ** mem; /* OUT: the memory pointer */
20228     int n_mem;
20229     int * size; /* OUT: the memory length */
20230     int n_size;
20231 
20232     for (n_cur = 0;n_cur < gen_nb_xmlDocPtr;n_cur++) {
20233     for (n_mem = 0;n_mem < gen_nb_xmlChar_ptr_ptr;n_mem++) {
20234     for (n_size = 0;n_size < gen_nb_int_ptr;n_size++) {
20235         mem_base = xmlMemBlocks();
20236         cur = gen_xmlDocPtr(n_cur, 0);
20237         mem = gen_xmlChar_ptr_ptr(n_mem, 1);
20238         size = gen_int_ptr(n_size, 2);
20239 
20240         xmlDocDumpMemory(cur, mem, size);
20241         call_tests++;
20242         des_xmlDocPtr(n_cur, cur, 0);
20243         des_xmlChar_ptr_ptr(n_mem, mem, 1);
20244         des_int_ptr(n_size, size, 2);
20245         xmlResetLastError();
20246         if (mem_base != xmlMemBlocks()) {
20247             printf("Leak of %d blocks found in xmlDocDumpMemory",
20248 	           xmlMemBlocks() - mem_base);
20249 	    test_ret++;
20250             printf(" %d", n_cur);
20251             printf(" %d", n_mem);
20252             printf(" %d", n_size);
20253             printf("\n");
20254         }
20255     }
20256     }
20257     }
20258     function_tests++;
20259 #endif
20260 
20261     return(test_ret);
20262 }
20263 
20264 
20265 static int
test_xmlDocDumpMemoryEnc(void)20266 test_xmlDocDumpMemoryEnc(void) {
20267     int test_ret = 0;
20268 
20269 #if defined(LIBXML_OUTPUT_ENABLED)
20270     int mem_base;
20271     xmlDocPtr out_doc; /* Document to generate XML text from */
20272     int n_out_doc;
20273     xmlChar ** doc_txt_ptr; /* Memory pointer for allocated XML text */
20274     int n_doc_txt_ptr;
20275     int * doc_txt_len; /* Length of the generated XML text */
20276     int n_doc_txt_len;
20277     char * txt_encoding; /* Character encoding to use when generating XML text */
20278     int n_txt_encoding;
20279 
20280     for (n_out_doc = 0;n_out_doc < gen_nb_xmlDocPtr;n_out_doc++) {
20281     for (n_doc_txt_ptr = 0;n_doc_txt_ptr < gen_nb_xmlChar_ptr_ptr;n_doc_txt_ptr++) {
20282     for (n_doc_txt_len = 0;n_doc_txt_len < gen_nb_int_ptr;n_doc_txt_len++) {
20283     for (n_txt_encoding = 0;n_txt_encoding < gen_nb_const_char_ptr;n_txt_encoding++) {
20284         mem_base = xmlMemBlocks();
20285         out_doc = gen_xmlDocPtr(n_out_doc, 0);
20286         doc_txt_ptr = gen_xmlChar_ptr_ptr(n_doc_txt_ptr, 1);
20287         doc_txt_len = gen_int_ptr(n_doc_txt_len, 2);
20288         txt_encoding = gen_const_char_ptr(n_txt_encoding, 3);
20289 
20290         xmlDocDumpMemoryEnc(out_doc, doc_txt_ptr, doc_txt_len, (const char *)txt_encoding);
20291         call_tests++;
20292         des_xmlDocPtr(n_out_doc, out_doc, 0);
20293         des_xmlChar_ptr_ptr(n_doc_txt_ptr, doc_txt_ptr, 1);
20294         des_int_ptr(n_doc_txt_len, doc_txt_len, 2);
20295         des_const_char_ptr(n_txt_encoding, (const char *)txt_encoding, 3);
20296         xmlResetLastError();
20297         if (mem_base != xmlMemBlocks()) {
20298             printf("Leak of %d blocks found in xmlDocDumpMemoryEnc",
20299 	           xmlMemBlocks() - mem_base);
20300 	    test_ret++;
20301             printf(" %d", n_out_doc);
20302             printf(" %d", n_doc_txt_ptr);
20303             printf(" %d", n_doc_txt_len);
20304             printf(" %d", n_txt_encoding);
20305             printf("\n");
20306         }
20307     }
20308     }
20309     }
20310     }
20311     function_tests++;
20312 #endif
20313 
20314     return(test_ret);
20315 }
20316 
20317 
20318 static int
test_xmlDocFormatDump(void)20319 test_xmlDocFormatDump(void) {
20320     int test_ret = 0;
20321 
20322 #if defined(LIBXML_OUTPUT_ENABLED)
20323     int mem_base;
20324     int ret_val;
20325     FILE * f; /* the FILE* */
20326     int n_f;
20327     xmlDocPtr cur; /* the document */
20328     int n_cur;
20329     int format; /* should formatting spaces been added */
20330     int n_format;
20331 
20332     for (n_f = 0;n_f < gen_nb_FILE_ptr;n_f++) {
20333     for (n_cur = 0;n_cur < gen_nb_xmlDocPtr;n_cur++) {
20334     for (n_format = 0;n_format < gen_nb_int;n_format++) {
20335         mem_base = xmlMemBlocks();
20336         f = gen_FILE_ptr(n_f, 0);
20337         cur = gen_xmlDocPtr(n_cur, 1);
20338         format = gen_int(n_format, 2);
20339 
20340         ret_val = xmlDocFormatDump(f, cur, format);
20341         desret_int(ret_val);
20342         call_tests++;
20343         des_FILE_ptr(n_f, f, 0);
20344         des_xmlDocPtr(n_cur, cur, 1);
20345         des_int(n_format, format, 2);
20346         xmlResetLastError();
20347         if (mem_base != xmlMemBlocks()) {
20348             printf("Leak of %d blocks found in xmlDocFormatDump",
20349 	           xmlMemBlocks() - mem_base);
20350 	    test_ret++;
20351             printf(" %d", n_f);
20352             printf(" %d", n_cur);
20353             printf(" %d", n_format);
20354             printf("\n");
20355         }
20356     }
20357     }
20358     }
20359     function_tests++;
20360 #endif
20361 
20362     return(test_ret);
20363 }
20364 
20365 
20366 static int
test_xmlDocGetRootElement(void)20367 test_xmlDocGetRootElement(void) {
20368     int test_ret = 0;
20369 
20370     int mem_base;
20371     xmlNodePtr ret_val;
20372     xmlDoc * doc; /* the document */
20373     int n_doc;
20374 
20375     for (n_doc = 0;n_doc < gen_nb_const_xmlDoc_ptr;n_doc++) {
20376         mem_base = xmlMemBlocks();
20377         doc = gen_const_xmlDoc_ptr(n_doc, 0);
20378 
20379         ret_val = xmlDocGetRootElement((const xmlDoc *)doc);
20380         desret_xmlNodePtr(ret_val);
20381         call_tests++;
20382         des_const_xmlDoc_ptr(n_doc, (const xmlDoc *)doc, 0);
20383         xmlResetLastError();
20384         if (mem_base != xmlMemBlocks()) {
20385             printf("Leak of %d blocks found in xmlDocGetRootElement",
20386 	           xmlMemBlocks() - mem_base);
20387 	    test_ret++;
20388             printf(" %d", n_doc);
20389             printf("\n");
20390         }
20391     }
20392     function_tests++;
20393 
20394     return(test_ret);
20395 }
20396 
20397 
20398 static int
test_xmlDocSetRootElement(void)20399 test_xmlDocSetRootElement(void) {
20400     int test_ret = 0;
20401 
20402 #if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_WRITER_ENABLED)
20403     int mem_base;
20404     xmlNodePtr ret_val;
20405     xmlDocPtr doc; /* the document */
20406     int n_doc;
20407     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. */
20408     int n_root;
20409 
20410     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
20411     for (n_root = 0;n_root < gen_nb_xmlNodePtr_in;n_root++) {
20412         mem_base = xmlMemBlocks();
20413         doc = gen_xmlDocPtr(n_doc, 0);
20414         root = gen_xmlNodePtr_in(n_root, 1);
20415 
20416         ret_val = xmlDocSetRootElement(doc, root);
20417         if (doc == NULL) { xmlFreeNode(root) ; root = NULL ; }
20418         desret_xmlNodePtr(ret_val);
20419         call_tests++;
20420         des_xmlDocPtr(n_doc, doc, 0);
20421         des_xmlNodePtr_in(n_root, root, 1);
20422         xmlResetLastError();
20423         if (mem_base != xmlMemBlocks()) {
20424             printf("Leak of %d blocks found in xmlDocSetRootElement",
20425 	           xmlMemBlocks() - mem_base);
20426 	    test_ret++;
20427             printf(" %d", n_doc);
20428             printf(" %d", n_root);
20429             printf("\n");
20430         }
20431     }
20432     }
20433     function_tests++;
20434 #endif
20435 
20436     return(test_ret);
20437 }
20438 
20439 
20440 static int
test_xmlElemDump(void)20441 test_xmlElemDump(void) {
20442     int test_ret = 0;
20443 
20444 #if defined(LIBXML_OUTPUT_ENABLED)
20445     int mem_base;
20446     FILE * f; /* the FILE * for the output */
20447     int n_f;
20448     xmlDocPtr doc; /* the document */
20449     int n_doc;
20450     xmlNodePtr cur; /* the current node */
20451     int n_cur;
20452 
20453     for (n_f = 0;n_f < gen_nb_FILE_ptr;n_f++) {
20454     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
20455     for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
20456         mem_base = xmlMemBlocks();
20457         f = gen_FILE_ptr(n_f, 0);
20458         doc = gen_xmlDocPtr(n_doc, 1);
20459         cur = gen_xmlNodePtr(n_cur, 2);
20460 
20461         xmlElemDump(f, doc, cur);
20462         call_tests++;
20463         des_FILE_ptr(n_f, f, 0);
20464         des_xmlDocPtr(n_doc, doc, 1);
20465         des_xmlNodePtr(n_cur, cur, 2);
20466         xmlResetLastError();
20467         if (mem_base != xmlMemBlocks()) {
20468             printf("Leak of %d blocks found in xmlElemDump",
20469 	           xmlMemBlocks() - mem_base);
20470 	    test_ret++;
20471             printf(" %d", n_f);
20472             printf(" %d", n_doc);
20473             printf(" %d", n_cur);
20474             printf("\n");
20475         }
20476     }
20477     }
20478     }
20479     function_tests++;
20480 #endif
20481 
20482     return(test_ret);
20483 }
20484 
20485 
20486 static int
test_xmlFirstElementChild(void)20487 test_xmlFirstElementChild(void) {
20488     int test_ret = 0;
20489 
20490 #if defined(LIBXML_TREE_ENABLED)
20491     int mem_base;
20492     xmlNodePtr ret_val;
20493     xmlNodePtr parent; /* the parent node */
20494     int n_parent;
20495 
20496     for (n_parent = 0;n_parent < gen_nb_xmlNodePtr;n_parent++) {
20497         mem_base = xmlMemBlocks();
20498         parent = gen_xmlNodePtr(n_parent, 0);
20499 
20500         ret_val = xmlFirstElementChild(parent);
20501         desret_xmlNodePtr(ret_val);
20502         call_tests++;
20503         des_xmlNodePtr(n_parent, parent, 0);
20504         xmlResetLastError();
20505         if (mem_base != xmlMemBlocks()) {
20506             printf("Leak of %d blocks found in xmlFirstElementChild",
20507 	           xmlMemBlocks() - mem_base);
20508 	    test_ret++;
20509             printf(" %d", n_parent);
20510             printf("\n");
20511         }
20512     }
20513     function_tests++;
20514 #endif
20515 
20516     return(test_ret);
20517 }
20518 
20519 
20520 static int
test_xmlGetBufferAllocationScheme(void)20521 test_xmlGetBufferAllocationScheme(void) {
20522     int test_ret = 0;
20523 
20524     int mem_base;
20525     xmlBufferAllocationScheme ret_val;
20526 
20527         mem_base = xmlMemBlocks();
20528 
20529         ret_val = xmlGetBufferAllocationScheme();
20530         desret_xmlBufferAllocationScheme(ret_val);
20531         call_tests++;
20532         xmlResetLastError();
20533         if (mem_base != xmlMemBlocks()) {
20534             printf("Leak of %d blocks found in xmlGetBufferAllocationScheme",
20535 	           xmlMemBlocks() - mem_base);
20536 	    test_ret++;
20537             printf("\n");
20538         }
20539     function_tests++;
20540 
20541     return(test_ret);
20542 }
20543 
20544 
20545 static int
test_xmlGetCompressMode(void)20546 test_xmlGetCompressMode(void) {
20547     int test_ret = 0;
20548 
20549     int mem_base;
20550     int ret_val;
20551 
20552         mem_base = xmlMemBlocks();
20553 
20554         ret_val = xmlGetCompressMode();
20555         desret_int(ret_val);
20556         call_tests++;
20557         xmlResetLastError();
20558         if (mem_base != xmlMemBlocks()) {
20559             printf("Leak of %d blocks found in xmlGetCompressMode",
20560 	           xmlMemBlocks() - mem_base);
20561 	    test_ret++;
20562             printf("\n");
20563         }
20564     function_tests++;
20565 
20566     return(test_ret);
20567 }
20568 
20569 
20570 static int
test_xmlGetDocCompressMode(void)20571 test_xmlGetDocCompressMode(void) {
20572     int test_ret = 0;
20573 
20574     int mem_base;
20575     int ret_val;
20576     xmlDoc * doc; /* the document */
20577     int n_doc;
20578 
20579     for (n_doc = 0;n_doc < gen_nb_const_xmlDoc_ptr;n_doc++) {
20580         mem_base = xmlMemBlocks();
20581         doc = gen_const_xmlDoc_ptr(n_doc, 0);
20582 
20583         ret_val = xmlGetDocCompressMode((const xmlDoc *)doc);
20584         desret_int(ret_val);
20585         call_tests++;
20586         des_const_xmlDoc_ptr(n_doc, (const xmlDoc *)doc, 0);
20587         xmlResetLastError();
20588         if (mem_base != xmlMemBlocks()) {
20589             printf("Leak of %d blocks found in xmlGetDocCompressMode",
20590 	           xmlMemBlocks() - mem_base);
20591 	    test_ret++;
20592             printf(" %d", n_doc);
20593             printf("\n");
20594         }
20595     }
20596     function_tests++;
20597 
20598     return(test_ret);
20599 }
20600 
20601 
20602 static int
test_xmlGetIntSubset(void)20603 test_xmlGetIntSubset(void) {
20604     int test_ret = 0;
20605 
20606     int mem_base;
20607     xmlDtdPtr ret_val;
20608     xmlDoc * doc; /* the document pointer */
20609     int n_doc;
20610 
20611     for (n_doc = 0;n_doc < gen_nb_const_xmlDoc_ptr;n_doc++) {
20612         mem_base = xmlMemBlocks();
20613         doc = gen_const_xmlDoc_ptr(n_doc, 0);
20614 
20615         ret_val = xmlGetIntSubset((const xmlDoc *)doc);
20616         desret_xmlDtdPtr(ret_val);
20617         call_tests++;
20618         des_const_xmlDoc_ptr(n_doc, (const xmlDoc *)doc, 0);
20619         xmlResetLastError();
20620         if (mem_base != xmlMemBlocks()) {
20621             printf("Leak of %d blocks found in xmlGetIntSubset",
20622 	           xmlMemBlocks() - mem_base);
20623 	    test_ret++;
20624             printf(" %d", n_doc);
20625             printf("\n");
20626         }
20627     }
20628     function_tests++;
20629 
20630     return(test_ret);
20631 }
20632 
20633 
20634 static int
test_xmlGetLastChild(void)20635 test_xmlGetLastChild(void) {
20636     int test_ret = 0;
20637 
20638     int mem_base;
20639     xmlNodePtr ret_val;
20640     xmlNode * parent; /* the parent node */
20641     int n_parent;
20642 
20643     for (n_parent = 0;n_parent < gen_nb_const_xmlNode_ptr;n_parent++) {
20644         mem_base = xmlMemBlocks();
20645         parent = gen_const_xmlNode_ptr(n_parent, 0);
20646 
20647         ret_val = xmlGetLastChild((const xmlNode *)parent);
20648         desret_xmlNodePtr(ret_val);
20649         call_tests++;
20650         des_const_xmlNode_ptr(n_parent, (const xmlNode *)parent, 0);
20651         xmlResetLastError();
20652         if (mem_base != xmlMemBlocks()) {
20653             printf("Leak of %d blocks found in xmlGetLastChild",
20654 	           xmlMemBlocks() - mem_base);
20655 	    test_ret++;
20656             printf(" %d", n_parent);
20657             printf("\n");
20658         }
20659     }
20660     function_tests++;
20661 
20662     return(test_ret);
20663 }
20664 
20665 
20666 static int
test_xmlGetLineNo(void)20667 test_xmlGetLineNo(void) {
20668     int test_ret = 0;
20669 
20670     int mem_base;
20671     long ret_val;
20672     xmlNode * node; /* valid node */
20673     int n_node;
20674 
20675     for (n_node = 0;n_node < gen_nb_const_xmlNode_ptr;n_node++) {
20676         mem_base = xmlMemBlocks();
20677         node = gen_const_xmlNode_ptr(n_node, 0);
20678 
20679         ret_val = xmlGetLineNo((const xmlNode *)node);
20680         desret_long(ret_val);
20681         call_tests++;
20682         des_const_xmlNode_ptr(n_node, (const xmlNode *)node, 0);
20683         xmlResetLastError();
20684         if (mem_base != xmlMemBlocks()) {
20685             printf("Leak of %d blocks found in xmlGetLineNo",
20686 	           xmlMemBlocks() - mem_base);
20687 	    test_ret++;
20688             printf(" %d", n_node);
20689             printf("\n");
20690         }
20691     }
20692     function_tests++;
20693 
20694     return(test_ret);
20695 }
20696 
20697 
20698 static int
test_xmlGetNoNsProp(void)20699 test_xmlGetNoNsProp(void) {
20700     int test_ret = 0;
20701 
20702     int mem_base;
20703     xmlChar * ret_val;
20704     xmlNode * node; /* the node */
20705     int n_node;
20706     xmlChar * name; /* the attribute name */
20707     int n_name;
20708 
20709     for (n_node = 0;n_node < gen_nb_const_xmlNode_ptr;n_node++) {
20710     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
20711         mem_base = xmlMemBlocks();
20712         node = gen_const_xmlNode_ptr(n_node, 0);
20713         name = gen_const_xmlChar_ptr(n_name, 1);
20714 
20715         ret_val = xmlGetNoNsProp((const xmlNode *)node, (const xmlChar *)name);
20716         desret_xmlChar_ptr(ret_val);
20717         call_tests++;
20718         des_const_xmlNode_ptr(n_node, (const xmlNode *)node, 0);
20719         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
20720         xmlResetLastError();
20721         if (mem_base != xmlMemBlocks()) {
20722             printf("Leak of %d blocks found in xmlGetNoNsProp",
20723 	           xmlMemBlocks() - mem_base);
20724 	    test_ret++;
20725             printf(" %d", n_node);
20726             printf(" %d", n_name);
20727             printf("\n");
20728         }
20729     }
20730     }
20731     function_tests++;
20732 
20733     return(test_ret);
20734 }
20735 
20736 
20737 static int
test_xmlGetNodePath(void)20738 test_xmlGetNodePath(void) {
20739     int test_ret = 0;
20740 
20741 #if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_DEBUG_ENABLED)
20742     int mem_base;
20743     xmlChar * ret_val;
20744     xmlNode * node; /* a node */
20745     int n_node;
20746 
20747     for (n_node = 0;n_node < gen_nb_const_xmlNode_ptr;n_node++) {
20748         mem_base = xmlMemBlocks();
20749         node = gen_const_xmlNode_ptr(n_node, 0);
20750 
20751         ret_val = xmlGetNodePath((const xmlNode *)node);
20752         desret_xmlChar_ptr(ret_val);
20753         call_tests++;
20754         des_const_xmlNode_ptr(n_node, (const xmlNode *)node, 0);
20755         xmlResetLastError();
20756         if (mem_base != xmlMemBlocks()) {
20757             printf("Leak of %d blocks found in xmlGetNodePath",
20758 	           xmlMemBlocks() - mem_base);
20759 	    test_ret++;
20760             printf(" %d", n_node);
20761             printf("\n");
20762         }
20763     }
20764     function_tests++;
20765 #endif
20766 
20767     return(test_ret);
20768 }
20769 
20770 
20771 static int
test_xmlGetNsList(void)20772 test_xmlGetNsList(void) {
20773     int test_ret = 0;
20774 
20775 
20776     /* missing type support */
20777     return(test_ret);
20778 }
20779 
20780 
20781 static int
test_xmlGetNsProp(void)20782 test_xmlGetNsProp(void) {
20783     int test_ret = 0;
20784 
20785     int mem_base;
20786     xmlChar * ret_val;
20787     xmlNode * node; /* the node */
20788     int n_node;
20789     xmlChar * name; /* the attribute name */
20790     int n_name;
20791     xmlChar * nameSpace; /* the URI of the namespace */
20792     int n_nameSpace;
20793 
20794     for (n_node = 0;n_node < gen_nb_const_xmlNode_ptr;n_node++) {
20795     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
20796     for (n_nameSpace = 0;n_nameSpace < gen_nb_const_xmlChar_ptr;n_nameSpace++) {
20797         mem_base = xmlMemBlocks();
20798         node = gen_const_xmlNode_ptr(n_node, 0);
20799         name = gen_const_xmlChar_ptr(n_name, 1);
20800         nameSpace = gen_const_xmlChar_ptr(n_nameSpace, 2);
20801 
20802         ret_val = xmlGetNsProp((const xmlNode *)node, (const xmlChar *)name, (const xmlChar *)nameSpace);
20803         desret_xmlChar_ptr(ret_val);
20804         call_tests++;
20805         des_const_xmlNode_ptr(n_node, (const xmlNode *)node, 0);
20806         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
20807         des_const_xmlChar_ptr(n_nameSpace, (const xmlChar *)nameSpace, 2);
20808         xmlResetLastError();
20809         if (mem_base != xmlMemBlocks()) {
20810             printf("Leak of %d blocks found in xmlGetNsProp",
20811 	           xmlMemBlocks() - mem_base);
20812 	    test_ret++;
20813             printf(" %d", n_node);
20814             printf(" %d", n_name);
20815             printf(" %d", n_nameSpace);
20816             printf("\n");
20817         }
20818     }
20819     }
20820     }
20821     function_tests++;
20822 
20823     return(test_ret);
20824 }
20825 
20826 
20827 static int
test_xmlGetProp(void)20828 test_xmlGetProp(void) {
20829     int test_ret = 0;
20830 
20831     int mem_base;
20832     xmlChar * ret_val;
20833     xmlNode * node; /* the node */
20834     int n_node;
20835     xmlChar * name; /* the attribute name */
20836     int n_name;
20837 
20838     for (n_node = 0;n_node < gen_nb_const_xmlNode_ptr;n_node++) {
20839     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
20840         mem_base = xmlMemBlocks();
20841         node = gen_const_xmlNode_ptr(n_node, 0);
20842         name = gen_const_xmlChar_ptr(n_name, 1);
20843 
20844         ret_val = xmlGetProp((const xmlNode *)node, (const xmlChar *)name);
20845         desret_xmlChar_ptr(ret_val);
20846         call_tests++;
20847         des_const_xmlNode_ptr(n_node, (const xmlNode *)node, 0);
20848         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
20849         xmlResetLastError();
20850         if (mem_base != xmlMemBlocks()) {
20851             printf("Leak of %d blocks found in xmlGetProp",
20852 	           xmlMemBlocks() - mem_base);
20853 	    test_ret++;
20854             printf(" %d", n_node);
20855             printf(" %d", n_name);
20856             printf("\n");
20857         }
20858     }
20859     }
20860     function_tests++;
20861 
20862     return(test_ret);
20863 }
20864 
20865 
20866 static int
test_xmlHasNsProp(void)20867 test_xmlHasNsProp(void) {
20868     int test_ret = 0;
20869 
20870     int mem_base;
20871     xmlAttrPtr ret_val;
20872     xmlNode * node; /* the node */
20873     int n_node;
20874     xmlChar * name; /* the attribute name */
20875     int n_name;
20876     xmlChar * nameSpace; /* the URI of the namespace */
20877     int n_nameSpace;
20878 
20879     for (n_node = 0;n_node < gen_nb_const_xmlNode_ptr;n_node++) {
20880     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
20881     for (n_nameSpace = 0;n_nameSpace < gen_nb_const_xmlChar_ptr;n_nameSpace++) {
20882         mem_base = xmlMemBlocks();
20883         node = gen_const_xmlNode_ptr(n_node, 0);
20884         name = gen_const_xmlChar_ptr(n_name, 1);
20885         nameSpace = gen_const_xmlChar_ptr(n_nameSpace, 2);
20886 
20887         ret_val = xmlHasNsProp((const xmlNode *)node, (const xmlChar *)name, (const xmlChar *)nameSpace);
20888         desret_xmlAttrPtr(ret_val);
20889         call_tests++;
20890         des_const_xmlNode_ptr(n_node, (const xmlNode *)node, 0);
20891         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
20892         des_const_xmlChar_ptr(n_nameSpace, (const xmlChar *)nameSpace, 2);
20893         xmlResetLastError();
20894         if (mem_base != xmlMemBlocks()) {
20895             printf("Leak of %d blocks found in xmlHasNsProp",
20896 	           xmlMemBlocks() - mem_base);
20897 	    test_ret++;
20898             printf(" %d", n_node);
20899             printf(" %d", n_name);
20900             printf(" %d", n_nameSpace);
20901             printf("\n");
20902         }
20903     }
20904     }
20905     }
20906     function_tests++;
20907 
20908     return(test_ret);
20909 }
20910 
20911 
20912 static int
test_xmlHasProp(void)20913 test_xmlHasProp(void) {
20914     int test_ret = 0;
20915 
20916     int mem_base;
20917     xmlAttrPtr ret_val;
20918     xmlNode * node; /* the node */
20919     int n_node;
20920     xmlChar * name; /* the attribute name */
20921     int n_name;
20922 
20923     for (n_node = 0;n_node < gen_nb_const_xmlNode_ptr;n_node++) {
20924     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
20925         mem_base = xmlMemBlocks();
20926         node = gen_const_xmlNode_ptr(n_node, 0);
20927         name = gen_const_xmlChar_ptr(n_name, 1);
20928 
20929         ret_val = xmlHasProp((const xmlNode *)node, (const xmlChar *)name);
20930         desret_xmlAttrPtr(ret_val);
20931         call_tests++;
20932         des_const_xmlNode_ptr(n_node, (const xmlNode *)node, 0);
20933         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
20934         xmlResetLastError();
20935         if (mem_base != xmlMemBlocks()) {
20936             printf("Leak of %d blocks found in xmlHasProp",
20937 	           xmlMemBlocks() - mem_base);
20938 	    test_ret++;
20939             printf(" %d", n_node);
20940             printf(" %d", n_name);
20941             printf("\n");
20942         }
20943     }
20944     }
20945     function_tests++;
20946 
20947     return(test_ret);
20948 }
20949 
20950 
20951 static int
test_xmlIsBlankNode(void)20952 test_xmlIsBlankNode(void) {
20953     int test_ret = 0;
20954 
20955     int mem_base;
20956     int ret_val;
20957     xmlNode * node; /* the node */
20958     int n_node;
20959 
20960     for (n_node = 0;n_node < gen_nb_const_xmlNode_ptr;n_node++) {
20961         mem_base = xmlMemBlocks();
20962         node = gen_const_xmlNode_ptr(n_node, 0);
20963 
20964         ret_val = xmlIsBlankNode((const xmlNode *)node);
20965         desret_int(ret_val);
20966         call_tests++;
20967         des_const_xmlNode_ptr(n_node, (const xmlNode *)node, 0);
20968         xmlResetLastError();
20969         if (mem_base != xmlMemBlocks()) {
20970             printf("Leak of %d blocks found in xmlIsBlankNode",
20971 	           xmlMemBlocks() - mem_base);
20972 	    test_ret++;
20973             printf(" %d", n_node);
20974             printf("\n");
20975         }
20976     }
20977     function_tests++;
20978 
20979     return(test_ret);
20980 }
20981 
20982 
20983 static int
test_xmlIsXHTML(void)20984 test_xmlIsXHTML(void) {
20985     int test_ret = 0;
20986 
20987     int mem_base;
20988     int ret_val;
20989     xmlChar * systemID; /* the system identifier */
20990     int n_systemID;
20991     xmlChar * publicID; /* the public identifier */
20992     int n_publicID;
20993 
20994     for (n_systemID = 0;n_systemID < gen_nb_const_xmlChar_ptr;n_systemID++) {
20995     for (n_publicID = 0;n_publicID < gen_nb_const_xmlChar_ptr;n_publicID++) {
20996         mem_base = xmlMemBlocks();
20997         systemID = gen_const_xmlChar_ptr(n_systemID, 0);
20998         publicID = gen_const_xmlChar_ptr(n_publicID, 1);
20999 
21000         ret_val = xmlIsXHTML((const xmlChar *)systemID, (const xmlChar *)publicID);
21001         desret_int(ret_val);
21002         call_tests++;
21003         des_const_xmlChar_ptr(n_systemID, (const xmlChar *)systemID, 0);
21004         des_const_xmlChar_ptr(n_publicID, (const xmlChar *)publicID, 1);
21005         xmlResetLastError();
21006         if (mem_base != xmlMemBlocks()) {
21007             printf("Leak of %d blocks found in xmlIsXHTML",
21008 	           xmlMemBlocks() - mem_base);
21009 	    test_ret++;
21010             printf(" %d", n_systemID);
21011             printf(" %d", n_publicID);
21012             printf("\n");
21013         }
21014     }
21015     }
21016     function_tests++;
21017 
21018     return(test_ret);
21019 }
21020 
21021 
21022 static int
test_xmlLastElementChild(void)21023 test_xmlLastElementChild(void) {
21024     int test_ret = 0;
21025 
21026 #if defined(LIBXML_TREE_ENABLED)
21027     int mem_base;
21028     xmlNodePtr ret_val;
21029     xmlNodePtr parent; /* the parent node */
21030     int n_parent;
21031 
21032     for (n_parent = 0;n_parent < gen_nb_xmlNodePtr;n_parent++) {
21033         mem_base = xmlMemBlocks();
21034         parent = gen_xmlNodePtr(n_parent, 0);
21035 
21036         ret_val = xmlLastElementChild(parent);
21037         desret_xmlNodePtr(ret_val);
21038         call_tests++;
21039         des_xmlNodePtr(n_parent, parent, 0);
21040         xmlResetLastError();
21041         if (mem_base != xmlMemBlocks()) {
21042             printf("Leak of %d blocks found in xmlLastElementChild",
21043 	           xmlMemBlocks() - mem_base);
21044 	    test_ret++;
21045             printf(" %d", n_parent);
21046             printf("\n");
21047         }
21048     }
21049     function_tests++;
21050 #endif
21051 
21052     return(test_ret);
21053 }
21054 
21055 
21056 static int
test_xmlNewCDataBlock(void)21057 test_xmlNewCDataBlock(void) {
21058     int test_ret = 0;
21059 
21060     int mem_base;
21061     xmlNodePtr ret_val;
21062     xmlDocPtr doc; /* the document */
21063     int n_doc;
21064     xmlChar * content; /* the CDATA block content content */
21065     int n_content;
21066     int len; /* the length of the block */
21067     int n_len;
21068 
21069     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
21070     for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
21071     for (n_len = 0;n_len < gen_nb_int;n_len++) {
21072         mem_base = xmlMemBlocks();
21073         doc = gen_xmlDocPtr(n_doc, 0);
21074         content = gen_const_xmlChar_ptr(n_content, 1);
21075         len = gen_int(n_len, 2);
21076         if ((content != NULL) &&
21077             (len > (int) strlen((const char *) content) + 1))
21078             continue;
21079 
21080         ret_val = xmlNewCDataBlock(doc, (const xmlChar *)content, len);
21081         desret_xmlNodePtr(ret_val);
21082         call_tests++;
21083         des_xmlDocPtr(n_doc, doc, 0);
21084         des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 1);
21085         des_int(n_len, len, 2);
21086         xmlResetLastError();
21087         if (mem_base != xmlMemBlocks()) {
21088             printf("Leak of %d blocks found in xmlNewCDataBlock",
21089 	           xmlMemBlocks() - mem_base);
21090 	    test_ret++;
21091             printf(" %d", n_doc);
21092             printf(" %d", n_content);
21093             printf(" %d", n_len);
21094             printf("\n");
21095         }
21096     }
21097     }
21098     }
21099     function_tests++;
21100 
21101     return(test_ret);
21102 }
21103 
21104 
21105 static int
test_xmlNewCharRef(void)21106 test_xmlNewCharRef(void) {
21107     int test_ret = 0;
21108 
21109     int mem_base;
21110     xmlNodePtr ret_val;
21111     xmlDocPtr doc; /* the document */
21112     int n_doc;
21113     xmlChar * name; /* the char ref string, starting with # or "&# ... ;" */
21114     int n_name;
21115 
21116     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
21117     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
21118         mem_base = xmlMemBlocks();
21119         doc = gen_xmlDocPtr(n_doc, 0);
21120         name = gen_const_xmlChar_ptr(n_name, 1);
21121 
21122         ret_val = xmlNewCharRef(doc, (const xmlChar *)name);
21123         desret_xmlNodePtr(ret_val);
21124         call_tests++;
21125         des_xmlDocPtr(n_doc, doc, 0);
21126         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
21127         xmlResetLastError();
21128         if (mem_base != xmlMemBlocks()) {
21129             printf("Leak of %d blocks found in xmlNewCharRef",
21130 	           xmlMemBlocks() - mem_base);
21131 	    test_ret++;
21132             printf(" %d", n_doc);
21133             printf(" %d", n_name);
21134             printf("\n");
21135         }
21136     }
21137     }
21138     function_tests++;
21139 
21140     return(test_ret);
21141 }
21142 
21143 
21144 static int
test_xmlNewChild(void)21145 test_xmlNewChild(void) {
21146     int test_ret = 0;
21147 
21148 #if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED)
21149 #ifdef LIBXML_TREE_ENABLED
21150     int mem_base;
21151     xmlNodePtr ret_val;
21152     xmlNodePtr parent; /* the parent node */
21153     int n_parent;
21154     xmlNsPtr ns; /* a namespace if any */
21155     int n_ns;
21156     xmlChar * name; /* the name of the child */
21157     int n_name;
21158     xmlChar * content; /* the XML content of the child if any. */
21159     int n_content;
21160 
21161     for (n_parent = 0;n_parent < gen_nb_xmlNodePtr;n_parent++) {
21162     for (n_ns = 0;n_ns < gen_nb_xmlNsPtr;n_ns++) {
21163     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
21164     for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
21165         mem_base = xmlMemBlocks();
21166         parent = gen_xmlNodePtr(n_parent, 0);
21167         ns = gen_xmlNsPtr(n_ns, 1);
21168         name = gen_const_xmlChar_ptr(n_name, 2);
21169         content = gen_const_xmlChar_ptr(n_content, 3);
21170 
21171         ret_val = xmlNewChild(parent, ns, (const xmlChar *)name, (const xmlChar *)content);
21172         desret_xmlNodePtr(ret_val);
21173         call_tests++;
21174         des_xmlNodePtr(n_parent, parent, 0);
21175         des_xmlNsPtr(n_ns, ns, 1);
21176         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 2);
21177         des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 3);
21178         xmlResetLastError();
21179         if (mem_base != xmlMemBlocks()) {
21180             printf("Leak of %d blocks found in xmlNewChild",
21181 	           xmlMemBlocks() - mem_base);
21182 	    test_ret++;
21183             printf(" %d", n_parent);
21184             printf(" %d", n_ns);
21185             printf(" %d", n_name);
21186             printf(" %d", n_content);
21187             printf("\n");
21188         }
21189     }
21190     }
21191     }
21192     }
21193     function_tests++;
21194 #endif
21195 #endif
21196 
21197     return(test_ret);
21198 }
21199 
21200 
21201 static int
test_xmlNewComment(void)21202 test_xmlNewComment(void) {
21203     int test_ret = 0;
21204 
21205     int mem_base;
21206     xmlNodePtr ret_val;
21207     xmlChar * content; /* the comment content */
21208     int n_content;
21209 
21210     for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
21211         mem_base = xmlMemBlocks();
21212         content = gen_const_xmlChar_ptr(n_content, 0);
21213 
21214         ret_val = xmlNewComment((const xmlChar *)content);
21215         desret_xmlNodePtr(ret_val);
21216         call_tests++;
21217         des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 0);
21218         xmlResetLastError();
21219         if (mem_base != xmlMemBlocks()) {
21220             printf("Leak of %d blocks found in xmlNewComment",
21221 	           xmlMemBlocks() - mem_base);
21222 	    test_ret++;
21223             printf(" %d", n_content);
21224             printf("\n");
21225         }
21226     }
21227     function_tests++;
21228 
21229     return(test_ret);
21230 }
21231 
21232 
21233 static int
test_xmlNewDoc(void)21234 test_xmlNewDoc(void) {
21235     int test_ret = 0;
21236 
21237     int mem_base;
21238     xmlDocPtr ret_val;
21239     xmlChar * version; /* xmlChar string giving the version of XML "1.0" */
21240     int n_version;
21241 
21242     for (n_version = 0;n_version < gen_nb_const_xmlChar_ptr;n_version++) {
21243         mem_base = xmlMemBlocks();
21244         version = gen_const_xmlChar_ptr(n_version, 0);
21245 
21246         ret_val = xmlNewDoc((const xmlChar *)version);
21247         desret_xmlDocPtr(ret_val);
21248         call_tests++;
21249         des_const_xmlChar_ptr(n_version, (const xmlChar *)version, 0);
21250         xmlResetLastError();
21251         if (mem_base != xmlMemBlocks()) {
21252             printf("Leak of %d blocks found in xmlNewDoc",
21253 	           xmlMemBlocks() - mem_base);
21254 	    test_ret++;
21255             printf(" %d", n_version);
21256             printf("\n");
21257         }
21258     }
21259     function_tests++;
21260 
21261     return(test_ret);
21262 }
21263 
21264 
21265 static int
test_xmlNewDocComment(void)21266 test_xmlNewDocComment(void) {
21267     int test_ret = 0;
21268 
21269     int mem_base;
21270     xmlNodePtr ret_val;
21271     xmlDocPtr doc; /* the document */
21272     int n_doc;
21273     xmlChar * content; /* the comment content */
21274     int n_content;
21275 
21276     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
21277     for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
21278         mem_base = xmlMemBlocks();
21279         doc = gen_xmlDocPtr(n_doc, 0);
21280         content = gen_const_xmlChar_ptr(n_content, 1);
21281 
21282         ret_val = xmlNewDocComment(doc, (const xmlChar *)content);
21283         desret_xmlNodePtr(ret_val);
21284         call_tests++;
21285         des_xmlDocPtr(n_doc, doc, 0);
21286         des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 1);
21287         xmlResetLastError();
21288         if (mem_base != xmlMemBlocks()) {
21289             printf("Leak of %d blocks found in xmlNewDocComment",
21290 	           xmlMemBlocks() - mem_base);
21291 	    test_ret++;
21292             printf(" %d", n_doc);
21293             printf(" %d", n_content);
21294             printf("\n");
21295         }
21296     }
21297     }
21298     function_tests++;
21299 
21300     return(test_ret);
21301 }
21302 
21303 
21304 static int
test_xmlNewDocFragment(void)21305 test_xmlNewDocFragment(void) {
21306     int test_ret = 0;
21307 
21308 #if defined(LIBXML_TREE_ENABLED)
21309     int mem_base;
21310     xmlNodePtr ret_val;
21311     xmlDocPtr doc; /* the document owning the fragment */
21312     int n_doc;
21313 
21314     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
21315         mem_base = xmlMemBlocks();
21316         doc = gen_xmlDocPtr(n_doc, 0);
21317 
21318         ret_val = xmlNewDocFragment(doc);
21319         desret_xmlNodePtr(ret_val);
21320         call_tests++;
21321         des_xmlDocPtr(n_doc, doc, 0);
21322         xmlResetLastError();
21323         if (mem_base != xmlMemBlocks()) {
21324             printf("Leak of %d blocks found in xmlNewDocFragment",
21325 	           xmlMemBlocks() - mem_base);
21326 	    test_ret++;
21327             printf(" %d", n_doc);
21328             printf("\n");
21329         }
21330     }
21331     function_tests++;
21332 #endif
21333 
21334     return(test_ret);
21335 }
21336 
21337 
21338 static int
test_xmlNewDocNode(void)21339 test_xmlNewDocNode(void) {
21340     int test_ret = 0;
21341 
21342     int mem_base;
21343     xmlNodePtr ret_val;
21344     xmlDocPtr doc; /* the document */
21345     int n_doc;
21346     xmlNsPtr ns; /* namespace if any */
21347     int n_ns;
21348     xmlChar * name; /* the node name */
21349     int n_name;
21350     xmlChar * content; /* the XML text content if any */
21351     int n_content;
21352 
21353     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
21354     for (n_ns = 0;n_ns < gen_nb_xmlNsPtr;n_ns++) {
21355     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
21356     for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
21357         mem_base = xmlMemBlocks();
21358         doc = gen_xmlDocPtr(n_doc, 0);
21359         ns = gen_xmlNsPtr(n_ns, 1);
21360         name = gen_const_xmlChar_ptr(n_name, 2);
21361         content = gen_const_xmlChar_ptr(n_content, 3);
21362 
21363         ret_val = xmlNewDocNode(doc, ns, (const xmlChar *)name, (const xmlChar *)content);
21364         desret_xmlNodePtr(ret_val);
21365         call_tests++;
21366         des_xmlDocPtr(n_doc, doc, 0);
21367         des_xmlNsPtr(n_ns, ns, 1);
21368         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 2);
21369         des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 3);
21370         xmlResetLastError();
21371         if (mem_base != xmlMemBlocks()) {
21372             printf("Leak of %d blocks found in xmlNewDocNode",
21373 	           xmlMemBlocks() - mem_base);
21374 	    test_ret++;
21375             printf(" %d", n_doc);
21376             printf(" %d", n_ns);
21377             printf(" %d", n_name);
21378             printf(" %d", n_content);
21379             printf("\n");
21380         }
21381     }
21382     }
21383     }
21384     }
21385     function_tests++;
21386 
21387     return(test_ret);
21388 }
21389 
21390 
21391 static int
test_xmlNewDocNodeEatName(void)21392 test_xmlNewDocNodeEatName(void) {
21393     int test_ret = 0;
21394 
21395     int mem_base;
21396     xmlNodePtr ret_val;
21397     xmlDocPtr doc; /* the document */
21398     int n_doc;
21399     xmlNsPtr ns; /* namespace if any */
21400     int n_ns;
21401     xmlChar * name; /* the node name */
21402     int n_name;
21403     xmlChar * content; /* the XML text content if any */
21404     int n_content;
21405 
21406     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
21407     for (n_ns = 0;n_ns < gen_nb_xmlNsPtr;n_ns++) {
21408     for (n_name = 0;n_name < gen_nb_eaten_name;n_name++) {
21409     for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
21410         mem_base = xmlMemBlocks();
21411         doc = gen_xmlDocPtr(n_doc, 0);
21412         ns = gen_xmlNsPtr(n_ns, 1);
21413         name = gen_eaten_name(n_name, 2);
21414         content = gen_const_xmlChar_ptr(n_content, 3);
21415 
21416         ret_val = xmlNewDocNodeEatName(doc, ns, name, (const xmlChar *)content);
21417         desret_xmlNodePtr(ret_val);
21418         call_tests++;
21419         des_xmlDocPtr(n_doc, doc, 0);
21420         des_xmlNsPtr(n_ns, ns, 1);
21421         des_eaten_name(n_name, name, 2);
21422         des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 3);
21423         xmlResetLastError();
21424         if (mem_base != xmlMemBlocks()) {
21425             printf("Leak of %d blocks found in xmlNewDocNodeEatName",
21426 	           xmlMemBlocks() - mem_base);
21427 	    test_ret++;
21428             printf(" %d", n_doc);
21429             printf(" %d", n_ns);
21430             printf(" %d", n_name);
21431             printf(" %d", n_content);
21432             printf("\n");
21433         }
21434     }
21435     }
21436     }
21437     }
21438     function_tests++;
21439 
21440     return(test_ret);
21441 }
21442 
21443 
21444 static int
test_xmlNewDocPI(void)21445 test_xmlNewDocPI(void) {
21446     int test_ret = 0;
21447 
21448     int mem_base;
21449     xmlNodePtr ret_val;
21450     xmlDocPtr doc; /* the target document */
21451     int n_doc;
21452     xmlChar * name; /* the processing instruction name */
21453     int n_name;
21454     xmlChar * content; /* the PI content */
21455     int n_content;
21456 
21457     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
21458     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
21459     for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
21460         mem_base = xmlMemBlocks();
21461         doc = gen_xmlDocPtr(n_doc, 0);
21462         name = gen_const_xmlChar_ptr(n_name, 1);
21463         content = gen_const_xmlChar_ptr(n_content, 2);
21464 
21465         ret_val = xmlNewDocPI(doc, (const xmlChar *)name, (const xmlChar *)content);
21466         desret_xmlNodePtr(ret_val);
21467         call_tests++;
21468         des_xmlDocPtr(n_doc, doc, 0);
21469         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
21470         des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 2);
21471         xmlResetLastError();
21472         if (mem_base != xmlMemBlocks()) {
21473             printf("Leak of %d blocks found in xmlNewDocPI",
21474 	           xmlMemBlocks() - mem_base);
21475 	    test_ret++;
21476             printf(" %d", n_doc);
21477             printf(" %d", n_name);
21478             printf(" %d", n_content);
21479             printf("\n");
21480         }
21481     }
21482     }
21483     }
21484     function_tests++;
21485 
21486     return(test_ret);
21487 }
21488 
21489 
21490 static int
test_xmlNewDocProp(void)21491 test_xmlNewDocProp(void) {
21492     int test_ret = 0;
21493 
21494     int mem_base;
21495     xmlAttrPtr ret_val;
21496     xmlDocPtr doc; /* the document */
21497     int n_doc;
21498     xmlChar * name; /* the name of the attribute */
21499     int n_name;
21500     xmlChar * value; /* the value of the attribute */
21501     int n_value;
21502 
21503     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
21504     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
21505     for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
21506         mem_base = xmlMemBlocks();
21507         doc = gen_xmlDocPtr(n_doc, 0);
21508         name = gen_const_xmlChar_ptr(n_name, 1);
21509         value = gen_const_xmlChar_ptr(n_value, 2);
21510 
21511         ret_val = xmlNewDocProp(doc, (const xmlChar *)name, (const xmlChar *)value);
21512         desret_xmlAttrPtr(ret_val);
21513         call_tests++;
21514         des_xmlDocPtr(n_doc, doc, 0);
21515         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
21516         des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 2);
21517         xmlResetLastError();
21518         if (mem_base != xmlMemBlocks()) {
21519             printf("Leak of %d blocks found in xmlNewDocProp",
21520 	           xmlMemBlocks() - mem_base);
21521 	    test_ret++;
21522             printf(" %d", n_doc);
21523             printf(" %d", n_name);
21524             printf(" %d", n_value);
21525             printf("\n");
21526         }
21527     }
21528     }
21529     }
21530     function_tests++;
21531 
21532     return(test_ret);
21533 }
21534 
21535 
21536 static int
test_xmlNewDocRawNode(void)21537 test_xmlNewDocRawNode(void) {
21538     int test_ret = 0;
21539 
21540 #if defined(LIBXML_TREE_ENABLED)
21541 #ifdef LIBXML_TREE_ENABLED
21542     int mem_base;
21543     xmlNodePtr ret_val;
21544     xmlDocPtr doc; /* the document */
21545     int n_doc;
21546     xmlNsPtr ns; /* namespace if any */
21547     int n_ns;
21548     xmlChar * name; /* the node name */
21549     int n_name;
21550     xmlChar * content; /* the text content if any */
21551     int n_content;
21552 
21553     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
21554     for (n_ns = 0;n_ns < gen_nb_xmlNsPtr;n_ns++) {
21555     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
21556     for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
21557         mem_base = xmlMemBlocks();
21558         doc = gen_xmlDocPtr(n_doc, 0);
21559         ns = gen_xmlNsPtr(n_ns, 1);
21560         name = gen_const_xmlChar_ptr(n_name, 2);
21561         content = gen_const_xmlChar_ptr(n_content, 3);
21562 
21563         ret_val = xmlNewDocRawNode(doc, ns, (const xmlChar *)name, (const xmlChar *)content);
21564         desret_xmlNodePtr(ret_val);
21565         call_tests++;
21566         des_xmlDocPtr(n_doc, doc, 0);
21567         des_xmlNsPtr(n_ns, ns, 1);
21568         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 2);
21569         des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 3);
21570         xmlResetLastError();
21571         if (mem_base != xmlMemBlocks()) {
21572             printf("Leak of %d blocks found in xmlNewDocRawNode",
21573 	           xmlMemBlocks() - mem_base);
21574 	    test_ret++;
21575             printf(" %d", n_doc);
21576             printf(" %d", n_ns);
21577             printf(" %d", n_name);
21578             printf(" %d", n_content);
21579             printf("\n");
21580         }
21581     }
21582     }
21583     }
21584     }
21585     function_tests++;
21586 #endif
21587 #endif
21588 
21589     return(test_ret);
21590 }
21591 
21592 
21593 static int
test_xmlNewDocText(void)21594 test_xmlNewDocText(void) {
21595     int test_ret = 0;
21596 
21597     int mem_base;
21598     xmlNodePtr ret_val;
21599     xmlDoc * doc; /* the document */
21600     int n_doc;
21601     xmlChar * content; /* the text content */
21602     int n_content;
21603 
21604     for (n_doc = 0;n_doc < gen_nb_const_xmlDoc_ptr;n_doc++) {
21605     for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
21606         mem_base = xmlMemBlocks();
21607         doc = gen_const_xmlDoc_ptr(n_doc, 0);
21608         content = gen_const_xmlChar_ptr(n_content, 1);
21609 
21610         ret_val = xmlNewDocText((const xmlDoc *)doc, (const xmlChar *)content);
21611         desret_xmlNodePtr(ret_val);
21612         call_tests++;
21613         des_const_xmlDoc_ptr(n_doc, (const xmlDoc *)doc, 0);
21614         des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 1);
21615         xmlResetLastError();
21616         if (mem_base != xmlMemBlocks()) {
21617             printf("Leak of %d blocks found in xmlNewDocText",
21618 	           xmlMemBlocks() - mem_base);
21619 	    test_ret++;
21620             printf(" %d", n_doc);
21621             printf(" %d", n_content);
21622             printf("\n");
21623         }
21624     }
21625     }
21626     function_tests++;
21627 
21628     return(test_ret);
21629 }
21630 
21631 
21632 static int
test_xmlNewDocTextLen(void)21633 test_xmlNewDocTextLen(void) {
21634     int test_ret = 0;
21635 
21636     int mem_base;
21637     xmlNodePtr ret_val;
21638     xmlDocPtr doc; /* the document */
21639     int n_doc;
21640     xmlChar * content; /* the text content */
21641     int n_content;
21642     int len; /* the text len. */
21643     int n_len;
21644 
21645     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
21646     for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
21647     for (n_len = 0;n_len < gen_nb_int;n_len++) {
21648         mem_base = xmlMemBlocks();
21649         doc = gen_xmlDocPtr(n_doc, 0);
21650         content = gen_const_xmlChar_ptr(n_content, 1);
21651         len = gen_int(n_len, 2);
21652         if ((content != NULL) &&
21653             (len > (int) strlen((const char *) content) + 1))
21654             continue;
21655 
21656         ret_val = xmlNewDocTextLen(doc, (const xmlChar *)content, len);
21657         desret_xmlNodePtr(ret_val);
21658         call_tests++;
21659         des_xmlDocPtr(n_doc, doc, 0);
21660         des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 1);
21661         des_int(n_len, len, 2);
21662         xmlResetLastError();
21663         if (mem_base != xmlMemBlocks()) {
21664             printf("Leak of %d blocks found in xmlNewDocTextLen",
21665 	           xmlMemBlocks() - mem_base);
21666 	    test_ret++;
21667             printf(" %d", n_doc);
21668             printf(" %d", n_content);
21669             printf(" %d", n_len);
21670             printf("\n");
21671         }
21672     }
21673     }
21674     }
21675     function_tests++;
21676 
21677     return(test_ret);
21678 }
21679 
21680 
21681 static int
test_xmlNewDtd(void)21682 test_xmlNewDtd(void) {
21683     int test_ret = 0;
21684 
21685     int mem_base;
21686     xmlDtdPtr ret_val;
21687     xmlDocPtr doc; /* the document pointer */
21688     int n_doc;
21689     xmlChar * name; /* the DTD name */
21690     int n_name;
21691     xmlChar * ExternalID; /* the external ID */
21692     int n_ExternalID;
21693     xmlChar * SystemID; /* the system ID */
21694     int n_SystemID;
21695 
21696     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
21697     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
21698     for (n_ExternalID = 0;n_ExternalID < gen_nb_const_xmlChar_ptr;n_ExternalID++) {
21699     for (n_SystemID = 0;n_SystemID < gen_nb_const_xmlChar_ptr;n_SystemID++) {
21700         mem_base = xmlMemBlocks();
21701         doc = gen_xmlDocPtr(n_doc, 0);
21702         name = gen_const_xmlChar_ptr(n_name, 1);
21703         ExternalID = gen_const_xmlChar_ptr(n_ExternalID, 2);
21704         SystemID = gen_const_xmlChar_ptr(n_SystemID, 3);
21705 
21706         ret_val = xmlNewDtd(doc, (const xmlChar *)name, (const xmlChar *)ExternalID, (const xmlChar *)SystemID);
21707         desret_xmlDtdPtr(ret_val);
21708         call_tests++;
21709         des_xmlDocPtr(n_doc, doc, 0);
21710         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
21711         des_const_xmlChar_ptr(n_ExternalID, (const xmlChar *)ExternalID, 2);
21712         des_const_xmlChar_ptr(n_SystemID, (const xmlChar *)SystemID, 3);
21713         xmlResetLastError();
21714         if (mem_base != xmlMemBlocks()) {
21715             printf("Leak of %d blocks found in xmlNewDtd",
21716 	           xmlMemBlocks() - mem_base);
21717 	    test_ret++;
21718             printf(" %d", n_doc);
21719             printf(" %d", n_name);
21720             printf(" %d", n_ExternalID);
21721             printf(" %d", n_SystemID);
21722             printf("\n");
21723         }
21724     }
21725     }
21726     }
21727     }
21728     function_tests++;
21729 
21730     return(test_ret);
21731 }
21732 
21733 
21734 static int
test_xmlNewNode(void)21735 test_xmlNewNode(void) {
21736     int test_ret = 0;
21737 
21738     int mem_base;
21739     xmlNodePtr ret_val;
21740     xmlNsPtr ns; /* namespace if any */
21741     int n_ns;
21742     xmlChar * name; /* the node name */
21743     int n_name;
21744 
21745     for (n_ns = 0;n_ns < gen_nb_xmlNsPtr;n_ns++) {
21746     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
21747         mem_base = xmlMemBlocks();
21748         ns = gen_xmlNsPtr(n_ns, 0);
21749         name = gen_const_xmlChar_ptr(n_name, 1);
21750 
21751         ret_val = xmlNewNode(ns, (const xmlChar *)name);
21752         desret_xmlNodePtr(ret_val);
21753         call_tests++;
21754         des_xmlNsPtr(n_ns, ns, 0);
21755         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
21756         xmlResetLastError();
21757         if (mem_base != xmlMemBlocks()) {
21758             printf("Leak of %d blocks found in xmlNewNode",
21759 	           xmlMemBlocks() - mem_base);
21760 	    test_ret++;
21761             printf(" %d", n_ns);
21762             printf(" %d", n_name);
21763             printf("\n");
21764         }
21765     }
21766     }
21767     function_tests++;
21768 
21769     return(test_ret);
21770 }
21771 
21772 
21773 static int
test_xmlNewNodeEatName(void)21774 test_xmlNewNodeEatName(void) {
21775     int test_ret = 0;
21776 
21777     int mem_base;
21778     xmlNodePtr ret_val;
21779     xmlNsPtr ns; /* namespace if any */
21780     int n_ns;
21781     xmlChar * name; /* the node name */
21782     int n_name;
21783 
21784     for (n_ns = 0;n_ns < gen_nb_xmlNsPtr;n_ns++) {
21785     for (n_name = 0;n_name < gen_nb_eaten_name;n_name++) {
21786         mem_base = xmlMemBlocks();
21787         ns = gen_xmlNsPtr(n_ns, 0);
21788         name = gen_eaten_name(n_name, 1);
21789 
21790         ret_val = xmlNewNodeEatName(ns, name);
21791         desret_xmlNodePtr(ret_val);
21792         call_tests++;
21793         des_xmlNsPtr(n_ns, ns, 0);
21794         des_eaten_name(n_name, name, 1);
21795         xmlResetLastError();
21796         if (mem_base != xmlMemBlocks()) {
21797             printf("Leak of %d blocks found in xmlNewNodeEatName",
21798 	           xmlMemBlocks() - mem_base);
21799 	    test_ret++;
21800             printf(" %d", n_ns);
21801             printf(" %d", n_name);
21802             printf("\n");
21803         }
21804     }
21805     }
21806     function_tests++;
21807 
21808     return(test_ret);
21809 }
21810 
21811 
21812 static int
test_xmlNewNs(void)21813 test_xmlNewNs(void) {
21814     int test_ret = 0;
21815 
21816     int mem_base;
21817     xmlNsPtr ret_val;
21818     xmlNodePtr node; /* the element carrying the namespace */
21819     int n_node;
21820     xmlChar * href; /* the URI associated */
21821     int n_href;
21822     xmlChar * prefix; /* the prefix for the namespace */
21823     int n_prefix;
21824 
21825     for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
21826     for (n_href = 0;n_href < gen_nb_const_xmlChar_ptr;n_href++) {
21827     for (n_prefix = 0;n_prefix < gen_nb_const_xmlChar_ptr;n_prefix++) {
21828         mem_base = xmlMemBlocks();
21829         node = gen_xmlNodePtr(n_node, 0);
21830         href = gen_const_xmlChar_ptr(n_href, 1);
21831         prefix = gen_const_xmlChar_ptr(n_prefix, 2);
21832 
21833         ret_val = xmlNewNs(node, (const xmlChar *)href, (const xmlChar *)prefix);
21834         if ((node == NULL) && (ret_val != NULL)) xmlFreeNs(ret_val);
21835         desret_xmlNsPtr(ret_val);
21836         call_tests++;
21837         des_xmlNodePtr(n_node, node, 0);
21838         des_const_xmlChar_ptr(n_href, (const xmlChar *)href, 1);
21839         des_const_xmlChar_ptr(n_prefix, (const xmlChar *)prefix, 2);
21840         xmlResetLastError();
21841         if (mem_base != xmlMemBlocks()) {
21842             printf("Leak of %d blocks found in xmlNewNs",
21843 	           xmlMemBlocks() - mem_base);
21844 	    test_ret++;
21845             printf(" %d", n_node);
21846             printf(" %d", n_href);
21847             printf(" %d", n_prefix);
21848             printf("\n");
21849         }
21850     }
21851     }
21852     }
21853     function_tests++;
21854 
21855     return(test_ret);
21856 }
21857 
21858 
21859 static int
test_xmlNewNsProp(void)21860 test_xmlNewNsProp(void) {
21861     int test_ret = 0;
21862 
21863     int mem_base;
21864     xmlAttrPtr ret_val;
21865     xmlNodePtr node; /* the holding node */
21866     int n_node;
21867     xmlNsPtr ns; /* the namespace */
21868     int n_ns;
21869     xmlChar * name; /* the name of the attribute */
21870     int n_name;
21871     xmlChar * value; /* the value of the attribute */
21872     int n_value;
21873 
21874     for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
21875     for (n_ns = 0;n_ns < gen_nb_xmlNsPtr;n_ns++) {
21876     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
21877     for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
21878         mem_base = xmlMemBlocks();
21879         node = gen_xmlNodePtr(n_node, 0);
21880         ns = gen_xmlNsPtr(n_ns, 1);
21881         name = gen_const_xmlChar_ptr(n_name, 2);
21882         value = gen_const_xmlChar_ptr(n_value, 3);
21883 
21884         ret_val = xmlNewNsProp(node, ns, (const xmlChar *)name, (const xmlChar *)value);
21885         desret_xmlAttrPtr(ret_val);
21886         call_tests++;
21887         des_xmlNodePtr(n_node, node, 0);
21888         des_xmlNsPtr(n_ns, ns, 1);
21889         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 2);
21890         des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 3);
21891         xmlResetLastError();
21892         if (mem_base != xmlMemBlocks()) {
21893             printf("Leak of %d blocks found in xmlNewNsProp",
21894 	           xmlMemBlocks() - mem_base);
21895 	    test_ret++;
21896             printf(" %d", n_node);
21897             printf(" %d", n_ns);
21898             printf(" %d", n_name);
21899             printf(" %d", n_value);
21900             printf("\n");
21901         }
21902     }
21903     }
21904     }
21905     }
21906     function_tests++;
21907 
21908     return(test_ret);
21909 }
21910 
21911 
21912 static int
test_xmlNewNsPropEatName(void)21913 test_xmlNewNsPropEatName(void) {
21914     int test_ret = 0;
21915 
21916     int mem_base;
21917     xmlAttrPtr ret_val;
21918     xmlNodePtr node; /* the holding node */
21919     int n_node;
21920     xmlNsPtr ns; /* the namespace */
21921     int n_ns;
21922     xmlChar * name; /* the name of the attribute */
21923     int n_name;
21924     xmlChar * value; /* the value of the attribute */
21925     int n_value;
21926 
21927     for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
21928     for (n_ns = 0;n_ns < gen_nb_xmlNsPtr;n_ns++) {
21929     for (n_name = 0;n_name < gen_nb_eaten_name;n_name++) {
21930     for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
21931         mem_base = xmlMemBlocks();
21932         node = gen_xmlNodePtr(n_node, 0);
21933         ns = gen_xmlNsPtr(n_ns, 1);
21934         name = gen_eaten_name(n_name, 2);
21935         value = gen_const_xmlChar_ptr(n_value, 3);
21936 
21937         ret_val = xmlNewNsPropEatName(node, ns, name, (const xmlChar *)value);
21938         desret_xmlAttrPtr(ret_val);
21939         call_tests++;
21940         des_xmlNodePtr(n_node, node, 0);
21941         des_xmlNsPtr(n_ns, ns, 1);
21942         des_eaten_name(n_name, name, 2);
21943         des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 3);
21944         xmlResetLastError();
21945         if (mem_base != xmlMemBlocks()) {
21946             printf("Leak of %d blocks found in xmlNewNsPropEatName",
21947 	           xmlMemBlocks() - mem_base);
21948 	    test_ret++;
21949             printf(" %d", n_node);
21950             printf(" %d", n_ns);
21951             printf(" %d", n_name);
21952             printf(" %d", n_value);
21953             printf("\n");
21954         }
21955     }
21956     }
21957     }
21958     }
21959     function_tests++;
21960 
21961     return(test_ret);
21962 }
21963 
21964 
21965 static int
test_xmlNewPI(void)21966 test_xmlNewPI(void) {
21967     int test_ret = 0;
21968 
21969     int mem_base;
21970     xmlNodePtr ret_val;
21971     xmlChar * name; /* the processing instruction name */
21972     int n_name;
21973     xmlChar * content; /* the PI content */
21974     int n_content;
21975 
21976     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
21977     for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
21978         mem_base = xmlMemBlocks();
21979         name = gen_const_xmlChar_ptr(n_name, 0);
21980         content = gen_const_xmlChar_ptr(n_content, 1);
21981 
21982         ret_val = xmlNewPI((const xmlChar *)name, (const xmlChar *)content);
21983         desret_xmlNodePtr(ret_val);
21984         call_tests++;
21985         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 0);
21986         des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 1);
21987         xmlResetLastError();
21988         if (mem_base != xmlMemBlocks()) {
21989             printf("Leak of %d blocks found in xmlNewPI",
21990 	           xmlMemBlocks() - mem_base);
21991 	    test_ret++;
21992             printf(" %d", n_name);
21993             printf(" %d", n_content);
21994             printf("\n");
21995         }
21996     }
21997     }
21998     function_tests++;
21999 
22000     return(test_ret);
22001 }
22002 
22003 
22004 static int
test_xmlNewProp(void)22005 test_xmlNewProp(void) {
22006     int test_ret = 0;
22007 
22008 #if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_HTML_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED)
22009 #ifdef LIBXML_TREE_ENABLED
22010     int mem_base;
22011     xmlAttrPtr ret_val;
22012     xmlNodePtr node; /* the holding node */
22013     int n_node;
22014     xmlChar * name; /* the name of the attribute */
22015     int n_name;
22016     xmlChar * value; /* the value of the attribute */
22017     int n_value;
22018 
22019     for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
22020     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
22021     for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
22022         mem_base = xmlMemBlocks();
22023         node = gen_xmlNodePtr(n_node, 0);
22024         name = gen_const_xmlChar_ptr(n_name, 1);
22025         value = gen_const_xmlChar_ptr(n_value, 2);
22026 
22027         ret_val = xmlNewProp(node, (const xmlChar *)name, (const xmlChar *)value);
22028         desret_xmlAttrPtr(ret_val);
22029         call_tests++;
22030         des_xmlNodePtr(n_node, node, 0);
22031         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
22032         des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 2);
22033         xmlResetLastError();
22034         if (mem_base != xmlMemBlocks()) {
22035             printf("Leak of %d blocks found in xmlNewProp",
22036 	           xmlMemBlocks() - mem_base);
22037 	    test_ret++;
22038             printf(" %d", n_node);
22039             printf(" %d", n_name);
22040             printf(" %d", n_value);
22041             printf("\n");
22042         }
22043     }
22044     }
22045     }
22046     function_tests++;
22047 #endif
22048 #endif
22049 
22050     return(test_ret);
22051 }
22052 
22053 
22054 static int
test_xmlNewReference(void)22055 test_xmlNewReference(void) {
22056     int test_ret = 0;
22057 
22058     int mem_base;
22059     xmlNodePtr ret_val;
22060     xmlDoc * doc; /* the document */
22061     int n_doc;
22062     xmlChar * name; /* the reference name, or the reference string with & and ; */
22063     int n_name;
22064 
22065     for (n_doc = 0;n_doc < gen_nb_const_xmlDoc_ptr;n_doc++) {
22066     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
22067         mem_base = xmlMemBlocks();
22068         doc = gen_const_xmlDoc_ptr(n_doc, 0);
22069         name = gen_const_xmlChar_ptr(n_name, 1);
22070 
22071         ret_val = xmlNewReference((const xmlDoc *)doc, (const xmlChar *)name);
22072         desret_xmlNodePtr(ret_val);
22073         call_tests++;
22074         des_const_xmlDoc_ptr(n_doc, (const xmlDoc *)doc, 0);
22075         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
22076         xmlResetLastError();
22077         if (mem_base != xmlMemBlocks()) {
22078             printf("Leak of %d blocks found in xmlNewReference",
22079 	           xmlMemBlocks() - mem_base);
22080 	    test_ret++;
22081             printf(" %d", n_doc);
22082             printf(" %d", n_name);
22083             printf("\n");
22084         }
22085     }
22086     }
22087     function_tests++;
22088 
22089     return(test_ret);
22090 }
22091 
22092 
22093 static int
test_xmlNewText(void)22094 test_xmlNewText(void) {
22095     int test_ret = 0;
22096 
22097     int mem_base;
22098     xmlNodePtr ret_val;
22099     xmlChar * content; /* the text content */
22100     int n_content;
22101 
22102     for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
22103         mem_base = xmlMemBlocks();
22104         content = gen_const_xmlChar_ptr(n_content, 0);
22105 
22106         ret_val = xmlNewText((const xmlChar *)content);
22107         desret_xmlNodePtr(ret_val);
22108         call_tests++;
22109         des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 0);
22110         xmlResetLastError();
22111         if (mem_base != xmlMemBlocks()) {
22112             printf("Leak of %d blocks found in xmlNewText",
22113 	           xmlMemBlocks() - mem_base);
22114 	    test_ret++;
22115             printf(" %d", n_content);
22116             printf("\n");
22117         }
22118     }
22119     function_tests++;
22120 
22121     return(test_ret);
22122 }
22123 
22124 
22125 static int
test_xmlNewTextChild(void)22126 test_xmlNewTextChild(void) {
22127     int test_ret = 0;
22128 
22129 #if defined(LIBXML_TREE_ENABLED)
22130 #ifdef LIBXML_TREE_ENABLED
22131     int mem_base;
22132     xmlNodePtr ret_val;
22133     xmlNodePtr parent; /* the parent node */
22134     int n_parent;
22135     xmlNsPtr ns; /* a namespace if any */
22136     int n_ns;
22137     xmlChar * name; /* the name of the child */
22138     int n_name;
22139     xmlChar * content; /* the text content of the child if any. */
22140     int n_content;
22141 
22142     for (n_parent = 0;n_parent < gen_nb_xmlNodePtr;n_parent++) {
22143     for (n_ns = 0;n_ns < gen_nb_xmlNsPtr;n_ns++) {
22144     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
22145     for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
22146         mem_base = xmlMemBlocks();
22147         parent = gen_xmlNodePtr(n_parent, 0);
22148         ns = gen_xmlNsPtr(n_ns, 1);
22149         name = gen_const_xmlChar_ptr(n_name, 2);
22150         content = gen_const_xmlChar_ptr(n_content, 3);
22151 
22152         ret_val = xmlNewTextChild(parent, ns, (const xmlChar *)name, (const xmlChar *)content);
22153         desret_xmlNodePtr(ret_val);
22154         call_tests++;
22155         des_xmlNodePtr(n_parent, parent, 0);
22156         des_xmlNsPtr(n_ns, ns, 1);
22157         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 2);
22158         des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 3);
22159         xmlResetLastError();
22160         if (mem_base != xmlMemBlocks()) {
22161             printf("Leak of %d blocks found in xmlNewTextChild",
22162 	           xmlMemBlocks() - mem_base);
22163 	    test_ret++;
22164             printf(" %d", n_parent);
22165             printf(" %d", n_ns);
22166             printf(" %d", n_name);
22167             printf(" %d", n_content);
22168             printf("\n");
22169         }
22170     }
22171     }
22172     }
22173     }
22174     function_tests++;
22175 #endif
22176 #endif
22177 
22178     return(test_ret);
22179 }
22180 
22181 
22182 static int
test_xmlNewTextLen(void)22183 test_xmlNewTextLen(void) {
22184     int test_ret = 0;
22185 
22186     int mem_base;
22187     xmlNodePtr ret_val;
22188     xmlChar * content; /* the text content */
22189     int n_content;
22190     int len; /* the text len. */
22191     int n_len;
22192 
22193     for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
22194     for (n_len = 0;n_len < gen_nb_int;n_len++) {
22195         mem_base = xmlMemBlocks();
22196         content = gen_const_xmlChar_ptr(n_content, 0);
22197         len = gen_int(n_len, 1);
22198         if ((content != NULL) &&
22199             (len > (int) strlen((const char *) content) + 1))
22200             continue;
22201 
22202         ret_val = xmlNewTextLen((const xmlChar *)content, len);
22203         desret_xmlNodePtr(ret_val);
22204         call_tests++;
22205         des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 0);
22206         des_int(n_len, len, 1);
22207         xmlResetLastError();
22208         if (mem_base != xmlMemBlocks()) {
22209             printf("Leak of %d blocks found in xmlNewTextLen",
22210 	           xmlMemBlocks() - mem_base);
22211 	    test_ret++;
22212             printf(" %d", n_content);
22213             printf(" %d", n_len);
22214             printf("\n");
22215         }
22216     }
22217     }
22218     function_tests++;
22219 
22220     return(test_ret);
22221 }
22222 
22223 
22224 static int
test_xmlNextElementSibling(void)22225 test_xmlNextElementSibling(void) {
22226     int test_ret = 0;
22227 
22228 #if defined(LIBXML_TREE_ENABLED)
22229     int mem_base;
22230     xmlNodePtr ret_val;
22231     xmlNodePtr node; /* the current node */
22232     int n_node;
22233 
22234     for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
22235         mem_base = xmlMemBlocks();
22236         node = gen_xmlNodePtr(n_node, 0);
22237 
22238         ret_val = xmlNextElementSibling(node);
22239         desret_xmlNodePtr(ret_val);
22240         call_tests++;
22241         des_xmlNodePtr(n_node, node, 0);
22242         xmlResetLastError();
22243         if (mem_base != xmlMemBlocks()) {
22244             printf("Leak of %d blocks found in xmlNextElementSibling",
22245 	           xmlMemBlocks() - mem_base);
22246 	    test_ret++;
22247             printf(" %d", n_node);
22248             printf("\n");
22249         }
22250     }
22251     function_tests++;
22252 #endif
22253 
22254     return(test_ret);
22255 }
22256 
22257 
22258 static int
test_xmlNodeAddContent(void)22259 test_xmlNodeAddContent(void) {
22260     int test_ret = 0;
22261 
22262     int mem_base;
22263     xmlNodePtr cur; /* the node being modified */
22264     int n_cur;
22265     xmlChar * content; /* extra content */
22266     int n_content;
22267 
22268     for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
22269     for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
22270         mem_base = xmlMemBlocks();
22271         cur = gen_xmlNodePtr(n_cur, 0);
22272         content = gen_const_xmlChar_ptr(n_content, 1);
22273 
22274         xmlNodeAddContent(cur, (const xmlChar *)content);
22275         call_tests++;
22276         des_xmlNodePtr(n_cur, cur, 0);
22277         des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 1);
22278         xmlResetLastError();
22279         if (mem_base != xmlMemBlocks()) {
22280             printf("Leak of %d blocks found in xmlNodeAddContent",
22281 	           xmlMemBlocks() - mem_base);
22282 	    test_ret++;
22283             printf(" %d", n_cur);
22284             printf(" %d", n_content);
22285             printf("\n");
22286         }
22287     }
22288     }
22289     function_tests++;
22290 
22291     return(test_ret);
22292 }
22293 
22294 
22295 static int
test_xmlNodeAddContentLen(void)22296 test_xmlNodeAddContentLen(void) {
22297     int test_ret = 0;
22298 
22299     int mem_base;
22300     xmlNodePtr cur; /* the node being modified */
22301     int n_cur;
22302     xmlChar * content; /* extra content */
22303     int n_content;
22304     int len; /* the size of @content */
22305     int n_len;
22306 
22307     for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
22308     for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
22309     for (n_len = 0;n_len < gen_nb_int;n_len++) {
22310         mem_base = xmlMemBlocks();
22311         cur = gen_xmlNodePtr(n_cur, 0);
22312         content = gen_const_xmlChar_ptr(n_content, 1);
22313         len = gen_int(n_len, 2);
22314         if ((content != NULL) &&
22315             (len > (int) strlen((const char *) content) + 1))
22316             continue;
22317 
22318         xmlNodeAddContentLen(cur, (const xmlChar *)content, len);
22319         call_tests++;
22320         des_xmlNodePtr(n_cur, cur, 0);
22321         des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 1);
22322         des_int(n_len, len, 2);
22323         xmlResetLastError();
22324         if (mem_base != xmlMemBlocks()) {
22325             printf("Leak of %d blocks found in xmlNodeAddContentLen",
22326 	           xmlMemBlocks() - mem_base);
22327 	    test_ret++;
22328             printf(" %d", n_cur);
22329             printf(" %d", n_content);
22330             printf(" %d", n_len);
22331             printf("\n");
22332         }
22333     }
22334     }
22335     }
22336     function_tests++;
22337 
22338     return(test_ret);
22339 }
22340 
22341 
22342 static int
test_xmlNodeBufGetContent(void)22343 test_xmlNodeBufGetContent(void) {
22344     int test_ret = 0;
22345 
22346     int mem_base;
22347     int ret_val;
22348     xmlBufferPtr buffer; /* a buffer */
22349     int n_buffer;
22350     xmlNode * cur; /* the node being read */
22351     int n_cur;
22352 
22353     for (n_buffer = 0;n_buffer < gen_nb_xmlBufferPtr;n_buffer++) {
22354     for (n_cur = 0;n_cur < gen_nb_const_xmlNode_ptr;n_cur++) {
22355         mem_base = xmlMemBlocks();
22356         buffer = gen_xmlBufferPtr(n_buffer, 0);
22357         cur = gen_const_xmlNode_ptr(n_cur, 1);
22358 
22359         ret_val = xmlNodeBufGetContent(buffer, (const xmlNode *)cur);
22360         desret_int(ret_val);
22361         call_tests++;
22362         des_xmlBufferPtr(n_buffer, buffer, 0);
22363         des_const_xmlNode_ptr(n_cur, (const xmlNode *)cur, 1);
22364         xmlResetLastError();
22365         if (mem_base != xmlMemBlocks()) {
22366             printf("Leak of %d blocks found in xmlNodeBufGetContent",
22367 	           xmlMemBlocks() - mem_base);
22368 	    test_ret++;
22369             printf(" %d", n_buffer);
22370             printf(" %d", n_cur);
22371             printf("\n");
22372         }
22373     }
22374     }
22375     function_tests++;
22376 
22377     return(test_ret);
22378 }
22379 
22380 
22381 static int
test_xmlNodeDump(void)22382 test_xmlNodeDump(void) {
22383     int test_ret = 0;
22384 
22385 #if defined(LIBXML_OUTPUT_ENABLED)
22386     int mem_base;
22387     int ret_val;
22388     xmlBufferPtr buf; /* the XML buffer output */
22389     int n_buf;
22390     xmlDocPtr doc; /* the document */
22391     int n_doc;
22392     xmlNodePtr cur; /* the current node */
22393     int n_cur;
22394     int level; /* the imbrication level for indenting */
22395     int n_level;
22396     int format; /* is formatting allowed */
22397     int n_format;
22398 
22399     for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
22400     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
22401     for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
22402     for (n_level = 0;n_level < gen_nb_int;n_level++) {
22403     for (n_format = 0;n_format < gen_nb_int;n_format++) {
22404         mem_base = xmlMemBlocks();
22405         buf = gen_xmlBufferPtr(n_buf, 0);
22406         doc = gen_xmlDocPtr(n_doc, 1);
22407         cur = gen_xmlNodePtr(n_cur, 2);
22408         level = gen_int(n_level, 3);
22409         format = gen_int(n_format, 4);
22410 
22411         ret_val = xmlNodeDump(buf, doc, cur, level, format);
22412         desret_int(ret_val);
22413         call_tests++;
22414         des_xmlBufferPtr(n_buf, buf, 0);
22415         des_xmlDocPtr(n_doc, doc, 1);
22416         des_xmlNodePtr(n_cur, cur, 2);
22417         des_int(n_level, level, 3);
22418         des_int(n_format, format, 4);
22419         xmlResetLastError();
22420         if (mem_base != xmlMemBlocks()) {
22421             printf("Leak of %d blocks found in xmlNodeDump",
22422 	           xmlMemBlocks() - mem_base);
22423 	    test_ret++;
22424             printf(" %d", n_buf);
22425             printf(" %d", n_doc);
22426             printf(" %d", n_cur);
22427             printf(" %d", n_level);
22428             printf(" %d", n_format);
22429             printf("\n");
22430         }
22431     }
22432     }
22433     }
22434     }
22435     }
22436     function_tests++;
22437 #endif
22438 
22439     return(test_ret);
22440 }
22441 
22442 
22443 static int
test_xmlNodeDumpOutput(void)22444 test_xmlNodeDumpOutput(void) {
22445     int test_ret = 0;
22446 
22447 #if defined(LIBXML_OUTPUT_ENABLED)
22448     int mem_base;
22449     xmlOutputBufferPtr buf; /* the XML buffer output */
22450     int n_buf;
22451     xmlDocPtr doc; /* the document */
22452     int n_doc;
22453     xmlNodePtr cur; /* the current node */
22454     int n_cur;
22455     int level; /* the imbrication level for indenting */
22456     int n_level;
22457     int format; /* is formatting allowed */
22458     int n_format;
22459     char * encoding; /* an optional encoding string */
22460     int n_encoding;
22461 
22462     for (n_buf = 0;n_buf < gen_nb_xmlOutputBufferPtr;n_buf++) {
22463     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
22464     for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
22465     for (n_level = 0;n_level < gen_nb_int;n_level++) {
22466     for (n_format = 0;n_format < gen_nb_int;n_format++) {
22467     for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
22468         mem_base = xmlMemBlocks();
22469         buf = gen_xmlOutputBufferPtr(n_buf, 0);
22470         doc = gen_xmlDocPtr(n_doc, 1);
22471         cur = gen_xmlNodePtr(n_cur, 2);
22472         level = gen_int(n_level, 3);
22473         format = gen_int(n_format, 4);
22474         encoding = gen_const_char_ptr(n_encoding, 5);
22475 
22476         xmlNodeDumpOutput(buf, doc, cur, level, format, (const char *)encoding);
22477         call_tests++;
22478         des_xmlOutputBufferPtr(n_buf, buf, 0);
22479         des_xmlDocPtr(n_doc, doc, 1);
22480         des_xmlNodePtr(n_cur, cur, 2);
22481         des_int(n_level, level, 3);
22482         des_int(n_format, format, 4);
22483         des_const_char_ptr(n_encoding, (const char *)encoding, 5);
22484         xmlResetLastError();
22485         if (mem_base != xmlMemBlocks()) {
22486             printf("Leak of %d blocks found in xmlNodeDumpOutput",
22487 	           xmlMemBlocks() - mem_base);
22488 	    test_ret++;
22489             printf(" %d", n_buf);
22490             printf(" %d", n_doc);
22491             printf(" %d", n_cur);
22492             printf(" %d", n_level);
22493             printf(" %d", n_format);
22494             printf(" %d", n_encoding);
22495             printf("\n");
22496         }
22497     }
22498     }
22499     }
22500     }
22501     }
22502     }
22503     function_tests++;
22504 #endif
22505 
22506     return(test_ret);
22507 }
22508 
22509 
22510 static int
test_xmlNodeGetBase(void)22511 test_xmlNodeGetBase(void) {
22512     int test_ret = 0;
22513 
22514     int mem_base;
22515     xmlChar * ret_val;
22516     xmlDoc * doc; /* the document the node pertains to */
22517     int n_doc;
22518     xmlNode * cur; /* the node being checked */
22519     int n_cur;
22520 
22521     for (n_doc = 0;n_doc < gen_nb_const_xmlDoc_ptr;n_doc++) {
22522     for (n_cur = 0;n_cur < gen_nb_const_xmlNode_ptr;n_cur++) {
22523         mem_base = xmlMemBlocks();
22524         doc = gen_const_xmlDoc_ptr(n_doc, 0);
22525         cur = gen_const_xmlNode_ptr(n_cur, 1);
22526 
22527         ret_val = xmlNodeGetBase((const xmlDoc *)doc, (const xmlNode *)cur);
22528         desret_xmlChar_ptr(ret_val);
22529         call_tests++;
22530         des_const_xmlDoc_ptr(n_doc, (const xmlDoc *)doc, 0);
22531         des_const_xmlNode_ptr(n_cur, (const xmlNode *)cur, 1);
22532         xmlResetLastError();
22533         if (mem_base != xmlMemBlocks()) {
22534             printf("Leak of %d blocks found in xmlNodeGetBase",
22535 	           xmlMemBlocks() - mem_base);
22536 	    test_ret++;
22537             printf(" %d", n_doc);
22538             printf(" %d", n_cur);
22539             printf("\n");
22540         }
22541     }
22542     }
22543     function_tests++;
22544 
22545     return(test_ret);
22546 }
22547 
22548 
22549 static int
test_xmlNodeGetContent(void)22550 test_xmlNodeGetContent(void) {
22551     int test_ret = 0;
22552 
22553     int mem_base;
22554     xmlChar * ret_val;
22555     xmlNode * cur; /* the node being read */
22556     int n_cur;
22557 
22558     for (n_cur = 0;n_cur < gen_nb_const_xmlNode_ptr;n_cur++) {
22559         mem_base = xmlMemBlocks();
22560         cur = gen_const_xmlNode_ptr(n_cur, 0);
22561 
22562         ret_val = xmlNodeGetContent((const xmlNode *)cur);
22563         desret_xmlChar_ptr(ret_val);
22564         call_tests++;
22565         des_const_xmlNode_ptr(n_cur, (const xmlNode *)cur, 0);
22566         xmlResetLastError();
22567         if (mem_base != xmlMemBlocks()) {
22568             printf("Leak of %d blocks found in xmlNodeGetContent",
22569 	           xmlMemBlocks() - mem_base);
22570 	    test_ret++;
22571             printf(" %d", n_cur);
22572             printf("\n");
22573         }
22574     }
22575     function_tests++;
22576 
22577     return(test_ret);
22578 }
22579 
22580 
22581 static int
test_xmlNodeGetLang(void)22582 test_xmlNodeGetLang(void) {
22583     int test_ret = 0;
22584 
22585     int mem_base;
22586     xmlChar * ret_val;
22587     xmlNode * cur; /* the node being checked */
22588     int n_cur;
22589 
22590     for (n_cur = 0;n_cur < gen_nb_const_xmlNode_ptr;n_cur++) {
22591         mem_base = xmlMemBlocks();
22592         cur = gen_const_xmlNode_ptr(n_cur, 0);
22593 
22594         ret_val = xmlNodeGetLang((const xmlNode *)cur);
22595         desret_xmlChar_ptr(ret_val);
22596         call_tests++;
22597         des_const_xmlNode_ptr(n_cur, (const xmlNode *)cur, 0);
22598         xmlResetLastError();
22599         if (mem_base != xmlMemBlocks()) {
22600             printf("Leak of %d blocks found in xmlNodeGetLang",
22601 	           xmlMemBlocks() - mem_base);
22602 	    test_ret++;
22603             printf(" %d", n_cur);
22604             printf("\n");
22605         }
22606     }
22607     function_tests++;
22608 
22609     return(test_ret);
22610 }
22611 
22612 
22613 static int
test_xmlNodeGetSpacePreserve(void)22614 test_xmlNodeGetSpacePreserve(void) {
22615     int test_ret = 0;
22616 
22617     int mem_base;
22618     int ret_val;
22619     xmlNode * cur; /* the node being checked */
22620     int n_cur;
22621 
22622     for (n_cur = 0;n_cur < gen_nb_const_xmlNode_ptr;n_cur++) {
22623         mem_base = xmlMemBlocks();
22624         cur = gen_const_xmlNode_ptr(n_cur, 0);
22625 
22626         ret_val = xmlNodeGetSpacePreserve((const xmlNode *)cur);
22627         desret_int(ret_val);
22628         call_tests++;
22629         des_const_xmlNode_ptr(n_cur, (const xmlNode *)cur, 0);
22630         xmlResetLastError();
22631         if (mem_base != xmlMemBlocks()) {
22632             printf("Leak of %d blocks found in xmlNodeGetSpacePreserve",
22633 	           xmlMemBlocks() - mem_base);
22634 	    test_ret++;
22635             printf(" %d", n_cur);
22636             printf("\n");
22637         }
22638     }
22639     function_tests++;
22640 
22641     return(test_ret);
22642 }
22643 
22644 
22645 static int
test_xmlNodeIsText(void)22646 test_xmlNodeIsText(void) {
22647     int test_ret = 0;
22648 
22649     int mem_base;
22650     int ret_val;
22651     xmlNode * node; /* the node */
22652     int n_node;
22653 
22654     for (n_node = 0;n_node < gen_nb_const_xmlNode_ptr;n_node++) {
22655         mem_base = xmlMemBlocks();
22656         node = gen_const_xmlNode_ptr(n_node, 0);
22657 
22658         ret_val = xmlNodeIsText((const xmlNode *)node);
22659         desret_int(ret_val);
22660         call_tests++;
22661         des_const_xmlNode_ptr(n_node, (const xmlNode *)node, 0);
22662         xmlResetLastError();
22663         if (mem_base != xmlMemBlocks()) {
22664             printf("Leak of %d blocks found in xmlNodeIsText",
22665 	           xmlMemBlocks() - mem_base);
22666 	    test_ret++;
22667             printf(" %d", n_node);
22668             printf("\n");
22669         }
22670     }
22671     function_tests++;
22672 
22673     return(test_ret);
22674 }
22675 
22676 
22677 static int
test_xmlNodeListGetRawString(void)22678 test_xmlNodeListGetRawString(void) {
22679     int test_ret = 0;
22680 
22681 #if defined(LIBXML_TREE_ENABLED)
22682     int mem_base;
22683     xmlChar * ret_val;
22684     xmlDoc * doc; /* the document */
22685     int n_doc;
22686     xmlNode * list; /* a Node list */
22687     int n_list;
22688     int inLine; /* should we replace entity contents or show their external form */
22689     int n_inLine;
22690 
22691     for (n_doc = 0;n_doc < gen_nb_const_xmlDoc_ptr;n_doc++) {
22692     for (n_list = 0;n_list < gen_nb_const_xmlNode_ptr;n_list++) {
22693     for (n_inLine = 0;n_inLine < gen_nb_int;n_inLine++) {
22694         mem_base = xmlMemBlocks();
22695         doc = gen_const_xmlDoc_ptr(n_doc, 0);
22696         list = gen_const_xmlNode_ptr(n_list, 1);
22697         inLine = gen_int(n_inLine, 2);
22698 
22699         ret_val = xmlNodeListGetRawString((const xmlDoc *)doc, (const xmlNode *)list, inLine);
22700         desret_xmlChar_ptr(ret_val);
22701         call_tests++;
22702         des_const_xmlDoc_ptr(n_doc, (const xmlDoc *)doc, 0);
22703         des_const_xmlNode_ptr(n_list, (const xmlNode *)list, 1);
22704         des_int(n_inLine, inLine, 2);
22705         xmlResetLastError();
22706         if (mem_base != xmlMemBlocks()) {
22707             printf("Leak of %d blocks found in xmlNodeListGetRawString",
22708 	           xmlMemBlocks() - mem_base);
22709 	    test_ret++;
22710             printf(" %d", n_doc);
22711             printf(" %d", n_list);
22712             printf(" %d", n_inLine);
22713             printf("\n");
22714         }
22715     }
22716     }
22717     }
22718     function_tests++;
22719 #endif
22720 
22721     return(test_ret);
22722 }
22723 
22724 
22725 static int
test_xmlNodeListGetString(void)22726 test_xmlNodeListGetString(void) {
22727     int test_ret = 0;
22728 
22729     int mem_base;
22730     xmlChar * ret_val;
22731     xmlDocPtr doc; /* the document */
22732     int n_doc;
22733     xmlNode * list; /* a Node list */
22734     int n_list;
22735     int inLine; /* should we replace entity contents or show their external form */
22736     int n_inLine;
22737 
22738     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
22739     for (n_list = 0;n_list < gen_nb_const_xmlNode_ptr;n_list++) {
22740     for (n_inLine = 0;n_inLine < gen_nb_int;n_inLine++) {
22741         mem_base = xmlMemBlocks();
22742         doc = gen_xmlDocPtr(n_doc, 0);
22743         list = gen_const_xmlNode_ptr(n_list, 1);
22744         inLine = gen_int(n_inLine, 2);
22745 
22746         ret_val = xmlNodeListGetString(doc, (const xmlNode *)list, inLine);
22747         desret_xmlChar_ptr(ret_val);
22748         call_tests++;
22749         des_xmlDocPtr(n_doc, doc, 0);
22750         des_const_xmlNode_ptr(n_list, (const xmlNode *)list, 1);
22751         des_int(n_inLine, inLine, 2);
22752         xmlResetLastError();
22753         if (mem_base != xmlMemBlocks()) {
22754             printf("Leak of %d blocks found in xmlNodeListGetString",
22755 	           xmlMemBlocks() - mem_base);
22756 	    test_ret++;
22757             printf(" %d", n_doc);
22758             printf(" %d", n_list);
22759             printf(" %d", n_inLine);
22760             printf("\n");
22761         }
22762     }
22763     }
22764     }
22765     function_tests++;
22766 
22767     return(test_ret);
22768 }
22769 
22770 
22771 static int
test_xmlNodeSetBase(void)22772 test_xmlNodeSetBase(void) {
22773     int test_ret = 0;
22774 
22775 #if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_XINCLUDE_ENABLED)
22776     int mem_base;
22777     xmlNodePtr cur; /* the node being changed */
22778     int n_cur;
22779     xmlChar * uri; /* the new base URI */
22780     int n_uri;
22781 
22782     for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
22783     for (n_uri = 0;n_uri < gen_nb_const_xmlChar_ptr;n_uri++) {
22784         mem_base = xmlMemBlocks();
22785         cur = gen_xmlNodePtr(n_cur, 0);
22786         uri = gen_const_xmlChar_ptr(n_uri, 1);
22787 
22788         xmlNodeSetBase(cur, (const xmlChar *)uri);
22789         call_tests++;
22790         des_xmlNodePtr(n_cur, cur, 0);
22791         des_const_xmlChar_ptr(n_uri, (const xmlChar *)uri, 1);
22792         xmlResetLastError();
22793         if (mem_base != xmlMemBlocks()) {
22794             printf("Leak of %d blocks found in xmlNodeSetBase",
22795 	           xmlMemBlocks() - mem_base);
22796 	    test_ret++;
22797             printf(" %d", n_cur);
22798             printf(" %d", n_uri);
22799             printf("\n");
22800         }
22801     }
22802     }
22803     function_tests++;
22804 #endif
22805 
22806     return(test_ret);
22807 }
22808 
22809 
22810 static int
test_xmlNodeSetContent(void)22811 test_xmlNodeSetContent(void) {
22812     int test_ret = 0;
22813 
22814     int mem_base;
22815     xmlNodePtr cur; /* the node being modified */
22816     int n_cur;
22817     xmlChar * content; /* the new value of the content */
22818     int n_content;
22819 
22820     for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
22821     for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
22822         mem_base = xmlMemBlocks();
22823         cur = gen_xmlNodePtr(n_cur, 0);
22824         content = gen_const_xmlChar_ptr(n_content, 1);
22825 
22826         xmlNodeSetContent(cur, (const xmlChar *)content);
22827         call_tests++;
22828         des_xmlNodePtr(n_cur, cur, 0);
22829         des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 1);
22830         xmlResetLastError();
22831         if (mem_base != xmlMemBlocks()) {
22832             printf("Leak of %d blocks found in xmlNodeSetContent",
22833 	           xmlMemBlocks() - mem_base);
22834 	    test_ret++;
22835             printf(" %d", n_cur);
22836             printf(" %d", n_content);
22837             printf("\n");
22838         }
22839     }
22840     }
22841     function_tests++;
22842 
22843     return(test_ret);
22844 }
22845 
22846 
22847 static int
test_xmlNodeSetContentLen(void)22848 test_xmlNodeSetContentLen(void) {
22849     int test_ret = 0;
22850 
22851 #if defined(LIBXML_TREE_ENABLED)
22852     int mem_base;
22853     xmlNodePtr cur; /* the node being modified */
22854     int n_cur;
22855     xmlChar * content; /* the new value of the content */
22856     int n_content;
22857     int len; /* the size of @content */
22858     int n_len;
22859 
22860     for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
22861     for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
22862     for (n_len = 0;n_len < gen_nb_int;n_len++) {
22863         mem_base = xmlMemBlocks();
22864         cur = gen_xmlNodePtr(n_cur, 0);
22865         content = gen_const_xmlChar_ptr(n_content, 1);
22866         len = gen_int(n_len, 2);
22867         if ((content != NULL) &&
22868             (len > (int) strlen((const char *) content) + 1))
22869             continue;
22870 
22871         xmlNodeSetContentLen(cur, (const xmlChar *)content, len);
22872         call_tests++;
22873         des_xmlNodePtr(n_cur, cur, 0);
22874         des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 1);
22875         des_int(n_len, len, 2);
22876         xmlResetLastError();
22877         if (mem_base != xmlMemBlocks()) {
22878             printf("Leak of %d blocks found in xmlNodeSetContentLen",
22879 	           xmlMemBlocks() - mem_base);
22880 	    test_ret++;
22881             printf(" %d", n_cur);
22882             printf(" %d", n_content);
22883             printf(" %d", n_len);
22884             printf("\n");
22885         }
22886     }
22887     }
22888     }
22889     function_tests++;
22890 #endif
22891 
22892     return(test_ret);
22893 }
22894 
22895 
22896 static int
test_xmlNodeSetLang(void)22897 test_xmlNodeSetLang(void) {
22898     int test_ret = 0;
22899 
22900 #if defined(LIBXML_TREE_ENABLED)
22901     int mem_base;
22902     xmlNodePtr cur; /* the node being changed */
22903     int n_cur;
22904     xmlChar * lang; /* the language description */
22905     int n_lang;
22906 
22907     for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
22908     for (n_lang = 0;n_lang < gen_nb_const_xmlChar_ptr;n_lang++) {
22909         mem_base = xmlMemBlocks();
22910         cur = gen_xmlNodePtr(n_cur, 0);
22911         lang = gen_const_xmlChar_ptr(n_lang, 1);
22912 
22913         xmlNodeSetLang(cur, (const xmlChar *)lang);
22914         call_tests++;
22915         des_xmlNodePtr(n_cur, cur, 0);
22916         des_const_xmlChar_ptr(n_lang, (const xmlChar *)lang, 1);
22917         xmlResetLastError();
22918         if (mem_base != xmlMemBlocks()) {
22919             printf("Leak of %d blocks found in xmlNodeSetLang",
22920 	           xmlMemBlocks() - mem_base);
22921 	    test_ret++;
22922             printf(" %d", n_cur);
22923             printf(" %d", n_lang);
22924             printf("\n");
22925         }
22926     }
22927     }
22928     function_tests++;
22929 #endif
22930 
22931     return(test_ret);
22932 }
22933 
22934 
22935 static int
test_xmlNodeSetName(void)22936 test_xmlNodeSetName(void) {
22937     int test_ret = 0;
22938 
22939 #if defined(LIBXML_TREE_ENABLED)
22940     int mem_base;
22941     xmlNodePtr cur; /* the node being changed */
22942     int n_cur;
22943     xmlChar * name; /* the new tag name */
22944     int n_name;
22945 
22946     for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
22947     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
22948         mem_base = xmlMemBlocks();
22949         cur = gen_xmlNodePtr(n_cur, 0);
22950         name = gen_const_xmlChar_ptr(n_name, 1);
22951 
22952         xmlNodeSetName(cur, (const xmlChar *)name);
22953         call_tests++;
22954         des_xmlNodePtr(n_cur, cur, 0);
22955         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
22956         xmlResetLastError();
22957         if (mem_base != xmlMemBlocks()) {
22958             printf("Leak of %d blocks found in xmlNodeSetName",
22959 	           xmlMemBlocks() - mem_base);
22960 	    test_ret++;
22961             printf(" %d", n_cur);
22962             printf(" %d", n_name);
22963             printf("\n");
22964         }
22965     }
22966     }
22967     function_tests++;
22968 #endif
22969 
22970     return(test_ret);
22971 }
22972 
22973 
22974 static int
test_xmlNodeSetSpacePreserve(void)22975 test_xmlNodeSetSpacePreserve(void) {
22976     int test_ret = 0;
22977 
22978 #if defined(LIBXML_TREE_ENABLED)
22979     int mem_base;
22980     xmlNodePtr cur; /* the node being changed */
22981     int n_cur;
22982     int val; /* the xml:space value ("0": default, 1: "preserve") */
22983     int n_val;
22984 
22985     for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
22986     for (n_val = 0;n_val < gen_nb_int;n_val++) {
22987         mem_base = xmlMemBlocks();
22988         cur = gen_xmlNodePtr(n_cur, 0);
22989         val = gen_int(n_val, 1);
22990 
22991         xmlNodeSetSpacePreserve(cur, val);
22992         call_tests++;
22993         des_xmlNodePtr(n_cur, cur, 0);
22994         des_int(n_val, val, 1);
22995         xmlResetLastError();
22996         if (mem_base != xmlMemBlocks()) {
22997             printf("Leak of %d blocks found in xmlNodeSetSpacePreserve",
22998 	           xmlMemBlocks() - mem_base);
22999 	    test_ret++;
23000             printf(" %d", n_cur);
23001             printf(" %d", n_val);
23002             printf("\n");
23003         }
23004     }
23005     }
23006     function_tests++;
23007 #endif
23008 
23009     return(test_ret);
23010 }
23011 
23012 
23013 static int
test_xmlPreviousElementSibling(void)23014 test_xmlPreviousElementSibling(void) {
23015     int test_ret = 0;
23016 
23017 #if defined(LIBXML_TREE_ENABLED)
23018     int mem_base;
23019     xmlNodePtr ret_val;
23020     xmlNodePtr node; /* the current node */
23021     int n_node;
23022 
23023     for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
23024         mem_base = xmlMemBlocks();
23025         node = gen_xmlNodePtr(n_node, 0);
23026 
23027         ret_val = xmlPreviousElementSibling(node);
23028         desret_xmlNodePtr(ret_val);
23029         call_tests++;
23030         des_xmlNodePtr(n_node, node, 0);
23031         xmlResetLastError();
23032         if (mem_base != xmlMemBlocks()) {
23033             printf("Leak of %d blocks found in xmlPreviousElementSibling",
23034 	           xmlMemBlocks() - mem_base);
23035 	    test_ret++;
23036             printf(" %d", n_node);
23037             printf("\n");
23038         }
23039     }
23040     function_tests++;
23041 #endif
23042 
23043     return(test_ret);
23044 }
23045 
23046 
23047 static int
test_xmlReconciliateNs(void)23048 test_xmlReconciliateNs(void) {
23049     int test_ret = 0;
23050 
23051 #if defined(LIBXML_TREE_ENABLED)
23052 #ifdef LIBXML_TREE_ENABLED
23053     int mem_base;
23054     int ret_val;
23055     xmlDocPtr doc; /* the document */
23056     int n_doc;
23057     xmlNodePtr tree; /* a node defining the subtree to reconciliate */
23058     int n_tree;
23059 
23060     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
23061     for (n_tree = 0;n_tree < gen_nb_xmlNodePtr;n_tree++) {
23062         mem_base = xmlMemBlocks();
23063         doc = gen_xmlDocPtr(n_doc, 0);
23064         tree = gen_xmlNodePtr(n_tree, 1);
23065 
23066         ret_val = xmlReconciliateNs(doc, tree);
23067         desret_int(ret_val);
23068         call_tests++;
23069         des_xmlDocPtr(n_doc, doc, 0);
23070         des_xmlNodePtr(n_tree, tree, 1);
23071         xmlResetLastError();
23072         if (mem_base != xmlMemBlocks()) {
23073             printf("Leak of %d blocks found in xmlReconciliateNs",
23074 	           xmlMemBlocks() - mem_base);
23075 	    test_ret++;
23076             printf(" %d", n_doc);
23077             printf(" %d", n_tree);
23078             printf("\n");
23079         }
23080     }
23081     }
23082     function_tests++;
23083 #endif
23084 #endif
23085 
23086     return(test_ret);
23087 }
23088 
23089 
23090 static int
test_xmlRemoveProp(void)23091 test_xmlRemoveProp(void) {
23092     int test_ret = 0;
23093 
23094     int mem_base;
23095     int ret_val;
23096     xmlAttrPtr cur; /* an attribute */
23097     int n_cur;
23098 
23099     for (n_cur = 0;n_cur < gen_nb_xmlAttrPtr;n_cur++) {
23100         mem_base = xmlMemBlocks();
23101         cur = gen_xmlAttrPtr(n_cur, 0);
23102 
23103         ret_val = xmlRemoveProp(cur);
23104         cur = NULL;
23105         desret_int(ret_val);
23106         call_tests++;
23107         des_xmlAttrPtr(n_cur, cur, 0);
23108         xmlResetLastError();
23109         if (mem_base != xmlMemBlocks()) {
23110             printf("Leak of %d blocks found in xmlRemoveProp",
23111 	           xmlMemBlocks() - mem_base);
23112 	    test_ret++;
23113             printf(" %d", n_cur);
23114             printf("\n");
23115         }
23116     }
23117     function_tests++;
23118 
23119     return(test_ret);
23120 }
23121 
23122 
23123 static int
test_xmlReplaceNode(void)23124 test_xmlReplaceNode(void) {
23125     int test_ret = 0;
23126 
23127 #if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_WRITER_ENABLED)
23128     int mem_base;
23129     xmlNodePtr ret_val;
23130     xmlNodePtr old; /* the old node */
23131     int n_old;
23132     xmlNodePtr cur; /* the node */
23133     int n_cur;
23134 
23135     for (n_old = 0;n_old < gen_nb_xmlNodePtr;n_old++) {
23136     for (n_cur = 0;n_cur < gen_nb_xmlNodePtr_in;n_cur++) {
23137         mem_base = xmlMemBlocks();
23138         old = gen_xmlNodePtr(n_old, 0);
23139         cur = gen_xmlNodePtr_in(n_cur, 1);
23140 
23141         ret_val = xmlReplaceNode(old, cur);
23142         if (cur != NULL) {
23143               xmlUnlinkNode(cur);
23144               xmlFreeNode(cur) ; cur = NULL ; }
23145           if (old != NULL) {
23146               xmlUnlinkNode(old);
23147               xmlFreeNode(old) ; old = NULL ; }
23148 	  ret_val = NULL;
23149         desret_xmlNodePtr(ret_val);
23150         call_tests++;
23151         des_xmlNodePtr(n_old, old, 0);
23152         des_xmlNodePtr_in(n_cur, cur, 1);
23153         xmlResetLastError();
23154         if (mem_base != xmlMemBlocks()) {
23155             printf("Leak of %d blocks found in xmlReplaceNode",
23156 	           xmlMemBlocks() - mem_base);
23157 	    test_ret++;
23158             printf(" %d", n_old);
23159             printf(" %d", n_cur);
23160             printf("\n");
23161         }
23162     }
23163     }
23164     function_tests++;
23165 #endif
23166 
23167     return(test_ret);
23168 }
23169 
23170 
23171 static int
test_xmlSaveFile(void)23172 test_xmlSaveFile(void) {
23173     int test_ret = 0;
23174 
23175 #if defined(LIBXML_OUTPUT_ENABLED)
23176     int mem_base;
23177     int ret_val;
23178     const char * filename; /* the filename (or URL) */
23179     int n_filename;
23180     xmlDocPtr cur; /* the document */
23181     int n_cur;
23182 
23183     for (n_filename = 0;n_filename < gen_nb_fileoutput;n_filename++) {
23184     for (n_cur = 0;n_cur < gen_nb_xmlDocPtr;n_cur++) {
23185         mem_base = xmlMemBlocks();
23186         filename = gen_fileoutput(n_filename, 0);
23187         cur = gen_xmlDocPtr(n_cur, 1);
23188 
23189         ret_val = xmlSaveFile(filename, cur);
23190         desret_int(ret_val);
23191         call_tests++;
23192         des_fileoutput(n_filename, filename, 0);
23193         des_xmlDocPtr(n_cur, cur, 1);
23194         xmlResetLastError();
23195         if (mem_base != xmlMemBlocks()) {
23196             printf("Leak of %d blocks found in xmlSaveFile",
23197 	           xmlMemBlocks() - mem_base);
23198 	    test_ret++;
23199             printf(" %d", n_filename);
23200             printf(" %d", n_cur);
23201             printf("\n");
23202         }
23203     }
23204     }
23205     function_tests++;
23206 #endif
23207 
23208     return(test_ret);
23209 }
23210 
23211 
23212 static int
test_xmlSaveFileEnc(void)23213 test_xmlSaveFileEnc(void) {
23214     int test_ret = 0;
23215 
23216 #if defined(LIBXML_OUTPUT_ENABLED)
23217     int mem_base;
23218     int ret_val;
23219     const char * filename; /* the filename (or URL) */
23220     int n_filename;
23221     xmlDocPtr cur; /* the document */
23222     int n_cur;
23223     char * encoding; /* the name of an encoding (or NULL) */
23224     int n_encoding;
23225 
23226     for (n_filename = 0;n_filename < gen_nb_fileoutput;n_filename++) {
23227     for (n_cur = 0;n_cur < gen_nb_xmlDocPtr;n_cur++) {
23228     for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
23229         mem_base = xmlMemBlocks();
23230         filename = gen_fileoutput(n_filename, 0);
23231         cur = gen_xmlDocPtr(n_cur, 1);
23232         encoding = gen_const_char_ptr(n_encoding, 2);
23233 
23234         ret_val = xmlSaveFileEnc(filename, cur, (const char *)encoding);
23235         desret_int(ret_val);
23236         call_tests++;
23237         des_fileoutput(n_filename, filename, 0);
23238         des_xmlDocPtr(n_cur, cur, 1);
23239         des_const_char_ptr(n_encoding, (const char *)encoding, 2);
23240         xmlResetLastError();
23241         if (mem_base != xmlMemBlocks()) {
23242             printf("Leak of %d blocks found in xmlSaveFileEnc",
23243 	           xmlMemBlocks() - mem_base);
23244 	    test_ret++;
23245             printf(" %d", n_filename);
23246             printf(" %d", n_cur);
23247             printf(" %d", n_encoding);
23248             printf("\n");
23249         }
23250     }
23251     }
23252     }
23253     function_tests++;
23254 #endif
23255 
23256     return(test_ret);
23257 }
23258 
23259 
23260 static int
test_xmlSaveFileTo(void)23261 test_xmlSaveFileTo(void) {
23262     int test_ret = 0;
23263 
23264 #if defined(LIBXML_OUTPUT_ENABLED)
23265     int mem_base;
23266     int ret_val;
23267     xmlOutputBufferPtr buf; /* an output I/O buffer */
23268     int n_buf;
23269     xmlDocPtr cur; /* the document */
23270     int n_cur;
23271     char * encoding; /* the encoding if any assuming the I/O layer handles the trancoding */
23272     int n_encoding;
23273 
23274     for (n_buf = 0;n_buf < gen_nb_xmlOutputBufferPtr;n_buf++) {
23275     for (n_cur = 0;n_cur < gen_nb_xmlDocPtr;n_cur++) {
23276     for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
23277         mem_base = xmlMemBlocks();
23278         buf = gen_xmlOutputBufferPtr(n_buf, 0);
23279         cur = gen_xmlDocPtr(n_cur, 1);
23280         encoding = gen_const_char_ptr(n_encoding, 2);
23281 
23282         ret_val = xmlSaveFileTo(buf, cur, (const char *)encoding);
23283         buf = NULL;
23284         desret_int(ret_val);
23285         call_tests++;
23286         des_xmlOutputBufferPtr(n_buf, buf, 0);
23287         des_xmlDocPtr(n_cur, cur, 1);
23288         des_const_char_ptr(n_encoding, (const char *)encoding, 2);
23289         xmlResetLastError();
23290         if (mem_base != xmlMemBlocks()) {
23291             printf("Leak of %d blocks found in xmlSaveFileTo",
23292 	           xmlMemBlocks() - mem_base);
23293 	    test_ret++;
23294             printf(" %d", n_buf);
23295             printf(" %d", n_cur);
23296             printf(" %d", n_encoding);
23297             printf("\n");
23298         }
23299     }
23300     }
23301     }
23302     function_tests++;
23303 #endif
23304 
23305     return(test_ret);
23306 }
23307 
23308 
23309 static int
test_xmlSaveFormatFile(void)23310 test_xmlSaveFormatFile(void) {
23311     int test_ret = 0;
23312 
23313 #if defined(LIBXML_OUTPUT_ENABLED)
23314     int mem_base;
23315     int ret_val;
23316     const char * filename; /* the filename (or URL) */
23317     int n_filename;
23318     xmlDocPtr cur; /* the document */
23319     int n_cur;
23320     int format; /* should formatting spaces been added */
23321     int n_format;
23322 
23323     for (n_filename = 0;n_filename < gen_nb_fileoutput;n_filename++) {
23324     for (n_cur = 0;n_cur < gen_nb_xmlDocPtr;n_cur++) {
23325     for (n_format = 0;n_format < gen_nb_int;n_format++) {
23326         mem_base = xmlMemBlocks();
23327         filename = gen_fileoutput(n_filename, 0);
23328         cur = gen_xmlDocPtr(n_cur, 1);
23329         format = gen_int(n_format, 2);
23330 
23331         ret_val = xmlSaveFormatFile(filename, cur, format);
23332         desret_int(ret_val);
23333         call_tests++;
23334         des_fileoutput(n_filename, filename, 0);
23335         des_xmlDocPtr(n_cur, cur, 1);
23336         des_int(n_format, format, 2);
23337         xmlResetLastError();
23338         if (mem_base != xmlMemBlocks()) {
23339             printf("Leak of %d blocks found in xmlSaveFormatFile",
23340 	           xmlMemBlocks() - mem_base);
23341 	    test_ret++;
23342             printf(" %d", n_filename);
23343             printf(" %d", n_cur);
23344             printf(" %d", n_format);
23345             printf("\n");
23346         }
23347     }
23348     }
23349     }
23350     function_tests++;
23351 #endif
23352 
23353     return(test_ret);
23354 }
23355 
23356 
23357 static int
test_xmlSaveFormatFileEnc(void)23358 test_xmlSaveFormatFileEnc(void) {
23359     int test_ret = 0;
23360 
23361 #if defined(LIBXML_OUTPUT_ENABLED)
23362     int mem_base;
23363     int ret_val;
23364     const char * filename; /* the filename or URL to output */
23365     int n_filename;
23366     xmlDocPtr cur; /* the document being saved */
23367     int n_cur;
23368     char * encoding; /* the name of the encoding to use or NULL. */
23369     int n_encoding;
23370     int format; /* should formatting spaces be added. */
23371     int n_format;
23372 
23373     for (n_filename = 0;n_filename < gen_nb_fileoutput;n_filename++) {
23374     for (n_cur = 0;n_cur < gen_nb_xmlDocPtr;n_cur++) {
23375     for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
23376     for (n_format = 0;n_format < gen_nb_int;n_format++) {
23377         mem_base = xmlMemBlocks();
23378         filename = gen_fileoutput(n_filename, 0);
23379         cur = gen_xmlDocPtr(n_cur, 1);
23380         encoding = gen_const_char_ptr(n_encoding, 2);
23381         format = gen_int(n_format, 3);
23382 
23383         ret_val = xmlSaveFormatFileEnc(filename, cur, (const char *)encoding, format);
23384         desret_int(ret_val);
23385         call_tests++;
23386         des_fileoutput(n_filename, filename, 0);
23387         des_xmlDocPtr(n_cur, cur, 1);
23388         des_const_char_ptr(n_encoding, (const char *)encoding, 2);
23389         des_int(n_format, format, 3);
23390         xmlResetLastError();
23391         if (mem_base != xmlMemBlocks()) {
23392             printf("Leak of %d blocks found in xmlSaveFormatFileEnc",
23393 	           xmlMemBlocks() - mem_base);
23394 	    test_ret++;
23395             printf(" %d", n_filename);
23396             printf(" %d", n_cur);
23397             printf(" %d", n_encoding);
23398             printf(" %d", n_format);
23399             printf("\n");
23400         }
23401     }
23402     }
23403     }
23404     }
23405     function_tests++;
23406 #endif
23407 
23408     return(test_ret);
23409 }
23410 
23411 
23412 static int
test_xmlSaveFormatFileTo(void)23413 test_xmlSaveFormatFileTo(void) {
23414     int test_ret = 0;
23415 
23416 #if defined(LIBXML_OUTPUT_ENABLED)
23417     int mem_base;
23418     int ret_val;
23419     xmlOutputBufferPtr buf; /* an output I/O buffer */
23420     int n_buf;
23421     xmlDocPtr cur; /* the document */
23422     int n_cur;
23423     char * encoding; /* the encoding if any assuming the I/O layer handles the trancoding */
23424     int n_encoding;
23425     int format; /* should formatting spaces been added */
23426     int n_format;
23427 
23428     for (n_buf = 0;n_buf < gen_nb_xmlOutputBufferPtr;n_buf++) {
23429     for (n_cur = 0;n_cur < gen_nb_xmlDocPtr;n_cur++) {
23430     for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
23431     for (n_format = 0;n_format < gen_nb_int;n_format++) {
23432         mem_base = xmlMemBlocks();
23433         buf = gen_xmlOutputBufferPtr(n_buf, 0);
23434         cur = gen_xmlDocPtr(n_cur, 1);
23435         encoding = gen_const_char_ptr(n_encoding, 2);
23436         format = gen_int(n_format, 3);
23437 
23438         ret_val = xmlSaveFormatFileTo(buf, cur, (const char *)encoding, format);
23439         buf = NULL;
23440         desret_int(ret_val);
23441         call_tests++;
23442         des_xmlOutputBufferPtr(n_buf, buf, 0);
23443         des_xmlDocPtr(n_cur, cur, 1);
23444         des_const_char_ptr(n_encoding, (const char *)encoding, 2);
23445         des_int(n_format, format, 3);
23446         xmlResetLastError();
23447         if (mem_base != xmlMemBlocks()) {
23448             printf("Leak of %d blocks found in xmlSaveFormatFileTo",
23449 	           xmlMemBlocks() - mem_base);
23450 	    test_ret++;
23451             printf(" %d", n_buf);
23452             printf(" %d", n_cur);
23453             printf(" %d", n_encoding);
23454             printf(" %d", n_format);
23455             printf("\n");
23456         }
23457     }
23458     }
23459     }
23460     }
23461     function_tests++;
23462 #endif
23463 
23464     return(test_ret);
23465 }
23466 
23467 
23468 static int
test_xmlSearchNs(void)23469 test_xmlSearchNs(void) {
23470     int test_ret = 0;
23471 
23472     int mem_base;
23473     xmlNsPtr ret_val;
23474     xmlDocPtr doc; /* the document */
23475     int n_doc;
23476     xmlNodePtr node; /* the current node */
23477     int n_node;
23478     xmlChar * nameSpace; /* the namespace prefix */
23479     int n_nameSpace;
23480 
23481     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
23482     for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
23483     for (n_nameSpace = 0;n_nameSpace < gen_nb_const_xmlChar_ptr;n_nameSpace++) {
23484         mem_base = xmlMemBlocks();
23485         doc = gen_xmlDocPtr(n_doc, 0);
23486         node = gen_xmlNodePtr(n_node, 1);
23487         nameSpace = gen_const_xmlChar_ptr(n_nameSpace, 2);
23488 
23489         ret_val = xmlSearchNs(doc, node, (const xmlChar *)nameSpace);
23490         desret_xmlNsPtr(ret_val);
23491         call_tests++;
23492         des_xmlDocPtr(n_doc, doc, 0);
23493         des_xmlNodePtr(n_node, node, 1);
23494         des_const_xmlChar_ptr(n_nameSpace, (const xmlChar *)nameSpace, 2);
23495         xmlResetLastError();
23496         if (mem_base != xmlMemBlocks()) {
23497             printf("Leak of %d blocks found in xmlSearchNs",
23498 	           xmlMemBlocks() - mem_base);
23499 	    test_ret++;
23500             printf(" %d", n_doc);
23501             printf(" %d", n_node);
23502             printf(" %d", n_nameSpace);
23503             printf("\n");
23504         }
23505     }
23506     }
23507     }
23508     function_tests++;
23509 
23510     return(test_ret);
23511 }
23512 
23513 
23514 static int
test_xmlSearchNsByHref(void)23515 test_xmlSearchNsByHref(void) {
23516     int test_ret = 0;
23517 
23518     int mem_base;
23519     xmlNsPtr ret_val;
23520     xmlDocPtr doc; /* the document */
23521     int n_doc;
23522     xmlNodePtr node; /* the current node */
23523     int n_node;
23524     xmlChar * href; /* the namespace value */
23525     int n_href;
23526 
23527     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
23528     for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
23529     for (n_href = 0;n_href < gen_nb_const_xmlChar_ptr;n_href++) {
23530         mem_base = xmlMemBlocks();
23531         doc = gen_xmlDocPtr(n_doc, 0);
23532         node = gen_xmlNodePtr(n_node, 1);
23533         href = gen_const_xmlChar_ptr(n_href, 2);
23534 
23535         ret_val = xmlSearchNsByHref(doc, node, (const xmlChar *)href);
23536         desret_xmlNsPtr(ret_val);
23537         call_tests++;
23538         des_xmlDocPtr(n_doc, doc, 0);
23539         des_xmlNodePtr(n_node, node, 1);
23540         des_const_xmlChar_ptr(n_href, (const xmlChar *)href, 2);
23541         xmlResetLastError();
23542         if (mem_base != xmlMemBlocks()) {
23543             printf("Leak of %d blocks found in xmlSearchNsByHref",
23544 	           xmlMemBlocks() - mem_base);
23545 	    test_ret++;
23546             printf(" %d", n_doc);
23547             printf(" %d", n_node);
23548             printf(" %d", n_href);
23549             printf("\n");
23550         }
23551     }
23552     }
23553     }
23554     function_tests++;
23555 
23556     return(test_ret);
23557 }
23558 
23559 
23560 static int
test_xmlSetBufferAllocationScheme(void)23561 test_xmlSetBufferAllocationScheme(void) {
23562     int test_ret = 0;
23563 
23564     int mem_base;
23565     xmlBufferAllocationScheme scheme; /* allocation method to use */
23566     int n_scheme;
23567 
23568     for (n_scheme = 0;n_scheme < gen_nb_xmlBufferAllocationScheme;n_scheme++) {
23569         mem_base = xmlMemBlocks();
23570         scheme = gen_xmlBufferAllocationScheme(n_scheme, 0);
23571 
23572         xmlSetBufferAllocationScheme(scheme);
23573         call_tests++;
23574         des_xmlBufferAllocationScheme(n_scheme, scheme, 0);
23575         xmlResetLastError();
23576         if (mem_base != xmlMemBlocks()) {
23577             printf("Leak of %d blocks found in xmlSetBufferAllocationScheme",
23578 	           xmlMemBlocks() - mem_base);
23579 	    test_ret++;
23580             printf(" %d", n_scheme);
23581             printf("\n");
23582         }
23583     }
23584     function_tests++;
23585 
23586     return(test_ret);
23587 }
23588 
23589 
23590 static int
test_xmlSetCompressMode(void)23591 test_xmlSetCompressMode(void) {
23592     int test_ret = 0;
23593 
23594     int mem_base;
23595     int mode; /* the compression ratio */
23596     int n_mode;
23597 
23598     for (n_mode = 0;n_mode < gen_nb_int;n_mode++) {
23599         mem_base = xmlMemBlocks();
23600         mode = gen_int(n_mode, 0);
23601 
23602         xmlSetCompressMode(mode);
23603         call_tests++;
23604         des_int(n_mode, mode, 0);
23605         xmlResetLastError();
23606         if (mem_base != xmlMemBlocks()) {
23607             printf("Leak of %d blocks found in xmlSetCompressMode",
23608 	           xmlMemBlocks() - mem_base);
23609 	    test_ret++;
23610             printf(" %d", n_mode);
23611             printf("\n");
23612         }
23613     }
23614     function_tests++;
23615 
23616     return(test_ret);
23617 }
23618 
23619 
23620 static int
test_xmlSetDocCompressMode(void)23621 test_xmlSetDocCompressMode(void) {
23622     int test_ret = 0;
23623 
23624     int mem_base;
23625     xmlDocPtr doc; /* the document */
23626     int n_doc;
23627     int mode; /* the compression ratio */
23628     int n_mode;
23629 
23630     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
23631     for (n_mode = 0;n_mode < gen_nb_int;n_mode++) {
23632         mem_base = xmlMemBlocks();
23633         doc = gen_xmlDocPtr(n_doc, 0);
23634         mode = gen_int(n_mode, 1);
23635 
23636         xmlSetDocCompressMode(doc, mode);
23637         call_tests++;
23638         des_xmlDocPtr(n_doc, doc, 0);
23639         des_int(n_mode, mode, 1);
23640         xmlResetLastError();
23641         if (mem_base != xmlMemBlocks()) {
23642             printf("Leak of %d blocks found in xmlSetDocCompressMode",
23643 	           xmlMemBlocks() - mem_base);
23644 	    test_ret++;
23645             printf(" %d", n_doc);
23646             printf(" %d", n_mode);
23647             printf("\n");
23648         }
23649     }
23650     }
23651     function_tests++;
23652 
23653     return(test_ret);
23654 }
23655 
23656 
23657 static int
test_xmlSetNs(void)23658 test_xmlSetNs(void) {
23659     int test_ret = 0;
23660 
23661     int mem_base;
23662     xmlNodePtr node; /* a node in the document */
23663     int n_node;
23664     xmlNsPtr ns; /* a namespace pointer */
23665     int n_ns;
23666 
23667     for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
23668     for (n_ns = 0;n_ns < gen_nb_xmlNsPtr;n_ns++) {
23669         mem_base = xmlMemBlocks();
23670         node = gen_xmlNodePtr(n_node, 0);
23671         ns = gen_xmlNsPtr(n_ns, 1);
23672 
23673         xmlSetNs(node, ns);
23674         call_tests++;
23675         des_xmlNodePtr(n_node, node, 0);
23676         des_xmlNsPtr(n_ns, ns, 1);
23677         xmlResetLastError();
23678         if (mem_base != xmlMemBlocks()) {
23679             printf("Leak of %d blocks found in xmlSetNs",
23680 	           xmlMemBlocks() - mem_base);
23681 	    test_ret++;
23682             printf(" %d", n_node);
23683             printf(" %d", n_ns);
23684             printf("\n");
23685         }
23686     }
23687     }
23688     function_tests++;
23689 
23690     return(test_ret);
23691 }
23692 
23693 
23694 static int
test_xmlSetNsProp(void)23695 test_xmlSetNsProp(void) {
23696     int test_ret = 0;
23697 
23698 #if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_XINCLUDE_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED) || defined(LIBXML_HTML_ENABLED)
23699     int mem_base;
23700     xmlAttrPtr ret_val;
23701     xmlNodePtr node; /* the node */
23702     int n_node;
23703     xmlNsPtr ns; /* the namespace definition */
23704     int n_ns;
23705     xmlChar * name; /* the attribute name */
23706     int n_name;
23707     xmlChar * value; /* the attribute value */
23708     int n_value;
23709 
23710     for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
23711     for (n_ns = 0;n_ns < gen_nb_xmlNsPtr;n_ns++) {
23712     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
23713     for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
23714         mem_base = xmlMemBlocks();
23715         node = gen_xmlNodePtr(n_node, 0);
23716         ns = gen_xmlNsPtr(n_ns, 1);
23717         name = gen_const_xmlChar_ptr(n_name, 2);
23718         value = gen_const_xmlChar_ptr(n_value, 3);
23719 
23720         ret_val = xmlSetNsProp(node, ns, (const xmlChar *)name, (const xmlChar *)value);
23721         desret_xmlAttrPtr(ret_val);
23722         call_tests++;
23723         des_xmlNodePtr(n_node, node, 0);
23724         des_xmlNsPtr(n_ns, ns, 1);
23725         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 2);
23726         des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 3);
23727         xmlResetLastError();
23728         if (mem_base != xmlMemBlocks()) {
23729             printf("Leak of %d blocks found in xmlSetNsProp",
23730 	           xmlMemBlocks() - mem_base);
23731 	    test_ret++;
23732             printf(" %d", n_node);
23733             printf(" %d", n_ns);
23734             printf(" %d", n_name);
23735             printf(" %d", n_value);
23736             printf("\n");
23737         }
23738     }
23739     }
23740     }
23741     }
23742     function_tests++;
23743 #endif
23744 
23745     return(test_ret);
23746 }
23747 
23748 
23749 static int
test_xmlSetProp(void)23750 test_xmlSetProp(void) {
23751     int test_ret = 0;
23752 
23753 #if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_XINCLUDE_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED) || defined(LIBXML_HTML_ENABLED)
23754     int mem_base;
23755     xmlAttrPtr ret_val;
23756     xmlNodePtr node; /* the node */
23757     int n_node;
23758     xmlChar * name; /* the attribute name (a QName) */
23759     int n_name;
23760     xmlChar * value; /* the attribute value */
23761     int n_value;
23762 
23763     for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
23764     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
23765     for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
23766         mem_base = xmlMemBlocks();
23767         node = gen_xmlNodePtr(n_node, 0);
23768         name = gen_const_xmlChar_ptr(n_name, 1);
23769         value = gen_const_xmlChar_ptr(n_value, 2);
23770 
23771         ret_val = xmlSetProp(node, (const xmlChar *)name, (const xmlChar *)value);
23772         desret_xmlAttrPtr(ret_val);
23773         call_tests++;
23774         des_xmlNodePtr(n_node, node, 0);
23775         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
23776         des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 2);
23777         xmlResetLastError();
23778         if (mem_base != xmlMemBlocks()) {
23779             printf("Leak of %d blocks found in xmlSetProp",
23780 	           xmlMemBlocks() - mem_base);
23781 	    test_ret++;
23782             printf(" %d", n_node);
23783             printf(" %d", n_name);
23784             printf(" %d", n_value);
23785             printf("\n");
23786         }
23787     }
23788     }
23789     }
23790     function_tests++;
23791 #endif
23792 
23793     return(test_ret);
23794 }
23795 
23796 
23797 static int
test_xmlSplitQName2(void)23798 test_xmlSplitQName2(void) {
23799     int test_ret = 0;
23800 
23801     int mem_base;
23802     xmlChar * ret_val;
23803     xmlChar * name; /* the full QName */
23804     int n_name;
23805     xmlChar ** prefix; /* a xmlChar ** */
23806     int n_prefix;
23807 
23808     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
23809     for (n_prefix = 0;n_prefix < gen_nb_xmlChar_ptr_ptr;n_prefix++) {
23810         mem_base = xmlMemBlocks();
23811         name = gen_const_xmlChar_ptr(n_name, 0);
23812         prefix = gen_xmlChar_ptr_ptr(n_prefix, 1);
23813 
23814         ret_val = xmlSplitQName2((const xmlChar *)name, prefix);
23815         desret_xmlChar_ptr(ret_val);
23816         call_tests++;
23817         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 0);
23818         des_xmlChar_ptr_ptr(n_prefix, prefix, 1);
23819         xmlResetLastError();
23820         if (mem_base != xmlMemBlocks()) {
23821             printf("Leak of %d blocks found in xmlSplitQName2",
23822 	           xmlMemBlocks() - mem_base);
23823 	    test_ret++;
23824             printf(" %d", n_name);
23825             printf(" %d", n_prefix);
23826             printf("\n");
23827         }
23828     }
23829     }
23830     function_tests++;
23831 
23832     return(test_ret);
23833 }
23834 
23835 
23836 static int
test_xmlSplitQName3(void)23837 test_xmlSplitQName3(void) {
23838     int test_ret = 0;
23839 
23840     int mem_base;
23841     const xmlChar * ret_val;
23842     xmlChar * name; /* the full QName */
23843     int n_name;
23844     int * len; /* an int * */
23845     int n_len;
23846 
23847     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
23848     for (n_len = 0;n_len < gen_nb_int_ptr;n_len++) {
23849         mem_base = xmlMemBlocks();
23850         name = gen_const_xmlChar_ptr(n_name, 0);
23851         len = gen_int_ptr(n_len, 1);
23852 
23853         ret_val = xmlSplitQName3((const xmlChar *)name, len);
23854         desret_const_xmlChar_ptr(ret_val);
23855         call_tests++;
23856         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 0);
23857         des_int_ptr(n_len, len, 1);
23858         xmlResetLastError();
23859         if (mem_base != xmlMemBlocks()) {
23860             printf("Leak of %d blocks found in xmlSplitQName3",
23861 	           xmlMemBlocks() - mem_base);
23862 	    test_ret++;
23863             printf(" %d", n_name);
23864             printf(" %d", n_len);
23865             printf("\n");
23866         }
23867     }
23868     }
23869     function_tests++;
23870 
23871     return(test_ret);
23872 }
23873 
23874 
23875 static int
test_xmlStringGetNodeList(void)23876 test_xmlStringGetNodeList(void) {
23877     int test_ret = 0;
23878 
23879     int mem_base;
23880     xmlNodePtr ret_val;
23881     xmlDoc * doc; /* the document */
23882     int n_doc;
23883     xmlChar * value; /* the value of the attribute */
23884     int n_value;
23885 
23886     for (n_doc = 0;n_doc < gen_nb_const_xmlDoc_ptr;n_doc++) {
23887     for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
23888         mem_base = xmlMemBlocks();
23889         doc = gen_const_xmlDoc_ptr(n_doc, 0);
23890         value = gen_const_xmlChar_ptr(n_value, 1);
23891 
23892         ret_val = xmlStringGetNodeList((const xmlDoc *)doc, (const xmlChar *)value);
23893         desret_xmlNodePtr(ret_val);
23894         call_tests++;
23895         des_const_xmlDoc_ptr(n_doc, (const xmlDoc *)doc, 0);
23896         des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 1);
23897         xmlResetLastError();
23898         if (mem_base != xmlMemBlocks()) {
23899             printf("Leak of %d blocks found in xmlStringGetNodeList",
23900 	           xmlMemBlocks() - mem_base);
23901 	    test_ret++;
23902             printf(" %d", n_doc);
23903             printf(" %d", n_value);
23904             printf("\n");
23905         }
23906     }
23907     }
23908     function_tests++;
23909 
23910     return(test_ret);
23911 }
23912 
23913 
23914 static int
test_xmlStringLenGetNodeList(void)23915 test_xmlStringLenGetNodeList(void) {
23916     int test_ret = 0;
23917 
23918     int mem_base;
23919     xmlNodePtr ret_val;
23920     xmlDoc * doc; /* the document */
23921     int n_doc;
23922     xmlChar * value; /* the value of the text */
23923     int n_value;
23924     int len; /* the length of the string value */
23925     int n_len;
23926 
23927     for (n_doc = 0;n_doc < gen_nb_const_xmlDoc_ptr;n_doc++) {
23928     for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
23929     for (n_len = 0;n_len < gen_nb_int;n_len++) {
23930         mem_base = xmlMemBlocks();
23931         doc = gen_const_xmlDoc_ptr(n_doc, 0);
23932         value = gen_const_xmlChar_ptr(n_value, 1);
23933         len = gen_int(n_len, 2);
23934         if ((value != NULL) &&
23935             (len > (int) strlen((const char *) value) + 1))
23936             continue;
23937 
23938         ret_val = xmlStringLenGetNodeList((const xmlDoc *)doc, (const xmlChar *)value, len);
23939         desret_xmlNodePtr(ret_val);
23940         call_tests++;
23941         des_const_xmlDoc_ptr(n_doc, (const xmlDoc *)doc, 0);
23942         des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 1);
23943         des_int(n_len, len, 2);
23944         xmlResetLastError();
23945         if (mem_base != xmlMemBlocks()) {
23946             printf("Leak of %d blocks found in xmlStringLenGetNodeList",
23947 	           xmlMemBlocks() - mem_base);
23948 	    test_ret++;
23949             printf(" %d", n_doc);
23950             printf(" %d", n_value);
23951             printf(" %d", n_len);
23952             printf("\n");
23953         }
23954     }
23955     }
23956     }
23957     function_tests++;
23958 
23959     return(test_ret);
23960 }
23961 
23962 
23963 static int
test_xmlTextConcat(void)23964 test_xmlTextConcat(void) {
23965     int test_ret = 0;
23966 
23967     int mem_base;
23968     int ret_val;
23969     xmlNodePtr node; /* the node */
23970     int n_node;
23971     xmlChar * content; /* the content */
23972     int n_content;
23973     int len; /* @content length */
23974     int n_len;
23975 
23976     for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
23977     for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
23978     for (n_len = 0;n_len < gen_nb_int;n_len++) {
23979         mem_base = xmlMemBlocks();
23980         node = gen_xmlNodePtr(n_node, 0);
23981         content = gen_const_xmlChar_ptr(n_content, 1);
23982         len = gen_int(n_len, 2);
23983         if ((content != NULL) &&
23984             (len > (int) strlen((const char *) content) + 1))
23985             continue;
23986 
23987         ret_val = xmlTextConcat(node, (const xmlChar *)content, len);
23988         desret_int(ret_val);
23989         call_tests++;
23990         des_xmlNodePtr(n_node, node, 0);
23991         des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 1);
23992         des_int(n_len, len, 2);
23993         xmlResetLastError();
23994         if (mem_base != xmlMemBlocks()) {
23995             printf("Leak of %d blocks found in xmlTextConcat",
23996 	           xmlMemBlocks() - mem_base);
23997 	    test_ret++;
23998             printf(" %d", n_node);
23999             printf(" %d", n_content);
24000             printf(" %d", n_len);
24001             printf("\n");
24002         }
24003     }
24004     }
24005     }
24006     function_tests++;
24007 
24008     return(test_ret);
24009 }
24010 
24011 
24012 static int
test_xmlTextMerge(void)24013 test_xmlTextMerge(void) {
24014     int test_ret = 0;
24015 
24016     int mem_base;
24017     xmlNodePtr ret_val;
24018     xmlNodePtr first; /* the first text node */
24019     int n_first;
24020     xmlNodePtr second; /* the second text node being merged */
24021     int n_second;
24022 
24023     for (n_first = 0;n_first < gen_nb_xmlNodePtr_in;n_first++) {
24024     for (n_second = 0;n_second < gen_nb_xmlNodePtr_in;n_second++) {
24025         mem_base = xmlMemBlocks();
24026         first = gen_xmlNodePtr_in(n_first, 0);
24027         second = gen_xmlNodePtr_in(n_second, 1);
24028 
24029         ret_val = xmlTextMerge(first, second);
24030         if ((first != NULL) && (first->type != XML_TEXT_NODE)) {
24031               xmlUnlinkNode(second);
24032               xmlFreeNode(second) ; second = NULL ; }
24033         desret_xmlNodePtr(ret_val);
24034         call_tests++;
24035         des_xmlNodePtr_in(n_first, first, 0);
24036         des_xmlNodePtr_in(n_second, second, 1);
24037         xmlResetLastError();
24038         if (mem_base != xmlMemBlocks()) {
24039             printf("Leak of %d blocks found in xmlTextMerge",
24040 	           xmlMemBlocks() - mem_base);
24041 	    test_ret++;
24042             printf(" %d", n_first);
24043             printf(" %d", n_second);
24044             printf("\n");
24045         }
24046     }
24047     }
24048     function_tests++;
24049 
24050     return(test_ret);
24051 }
24052 
24053 
24054 static int
test_xmlUnsetNsProp(void)24055 test_xmlUnsetNsProp(void) {
24056     int test_ret = 0;
24057 
24058 #if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED)
24059     int mem_base;
24060     int ret_val;
24061     xmlNodePtr node; /* the node */
24062     int n_node;
24063     xmlNsPtr ns; /* the namespace definition */
24064     int n_ns;
24065     xmlChar * name; /* the attribute name */
24066     int n_name;
24067 
24068     for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
24069     for (n_ns = 0;n_ns < gen_nb_xmlNsPtr;n_ns++) {
24070     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
24071         mem_base = xmlMemBlocks();
24072         node = gen_xmlNodePtr(n_node, 0);
24073         ns = gen_xmlNsPtr(n_ns, 1);
24074         name = gen_const_xmlChar_ptr(n_name, 2);
24075 
24076         ret_val = xmlUnsetNsProp(node, ns, (const xmlChar *)name);
24077         desret_int(ret_val);
24078         call_tests++;
24079         des_xmlNodePtr(n_node, node, 0);
24080         des_xmlNsPtr(n_ns, ns, 1);
24081         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 2);
24082         xmlResetLastError();
24083         if (mem_base != xmlMemBlocks()) {
24084             printf("Leak of %d blocks found in xmlUnsetNsProp",
24085 	           xmlMemBlocks() - mem_base);
24086 	    test_ret++;
24087             printf(" %d", n_node);
24088             printf(" %d", n_ns);
24089             printf(" %d", n_name);
24090             printf("\n");
24091         }
24092     }
24093     }
24094     }
24095     function_tests++;
24096 #endif
24097 
24098     return(test_ret);
24099 }
24100 
24101 
24102 static int
test_xmlUnsetProp(void)24103 test_xmlUnsetProp(void) {
24104     int test_ret = 0;
24105 
24106 #if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED)
24107     int mem_base;
24108     int ret_val;
24109     xmlNodePtr node; /* the node */
24110     int n_node;
24111     xmlChar * name; /* the attribute name */
24112     int n_name;
24113 
24114     for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
24115     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
24116         mem_base = xmlMemBlocks();
24117         node = gen_xmlNodePtr(n_node, 0);
24118         name = gen_const_xmlChar_ptr(n_name, 1);
24119 
24120         ret_val = xmlUnsetProp(node, (const xmlChar *)name);
24121         desret_int(ret_val);
24122         call_tests++;
24123         des_xmlNodePtr(n_node, node, 0);
24124         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
24125         xmlResetLastError();
24126         if (mem_base != xmlMemBlocks()) {
24127             printf("Leak of %d blocks found in xmlUnsetProp",
24128 	           xmlMemBlocks() - mem_base);
24129 	    test_ret++;
24130             printf(" %d", n_node);
24131             printf(" %d", n_name);
24132             printf("\n");
24133         }
24134     }
24135     }
24136     function_tests++;
24137 #endif
24138 
24139     return(test_ret);
24140 }
24141 
24142 
24143 static int
test_xmlValidateNCName(void)24144 test_xmlValidateNCName(void) {
24145     int test_ret = 0;
24146 
24147 #if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_XPATH_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED) || defined(LIBXML_DEBUG_ENABLED) || defined (LIBXML_HTML_ENABLED) || defined(LIBXML_SAX1_ENABLED) || defined(LIBXML_HTML_ENABLED) || defined(LIBXML_WRITER_ENABLED) || defined(LIBXML_DOCB_ENABLED) || defined(LIBXML_LEGACY_ENABLED)
24148 #ifdef LIBXML_TREE_ENABLED
24149     int mem_base;
24150     int ret_val;
24151     xmlChar * value; /* the value to check */
24152     int n_value;
24153     int space; /* allow spaces in front and end of the string */
24154     int n_space;
24155 
24156     for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
24157     for (n_space = 0;n_space < gen_nb_int;n_space++) {
24158         mem_base = xmlMemBlocks();
24159         value = gen_const_xmlChar_ptr(n_value, 0);
24160         space = gen_int(n_space, 1);
24161 
24162         ret_val = xmlValidateNCName((const xmlChar *)value, space);
24163         desret_int(ret_val);
24164         call_tests++;
24165         des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 0);
24166         des_int(n_space, space, 1);
24167         xmlResetLastError();
24168         if (mem_base != xmlMemBlocks()) {
24169             printf("Leak of %d blocks found in xmlValidateNCName",
24170 	           xmlMemBlocks() - mem_base);
24171 	    test_ret++;
24172             printf(" %d", n_value);
24173             printf(" %d", n_space);
24174             printf("\n");
24175         }
24176     }
24177     }
24178     function_tests++;
24179 #endif
24180 #endif
24181 
24182     return(test_ret);
24183 }
24184 
24185 
24186 static int
test_xmlValidateNMToken(void)24187 test_xmlValidateNMToken(void) {
24188     int test_ret = 0;
24189 
24190 #if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED)
24191 #ifdef LIBXML_TREE_ENABLED
24192     int mem_base;
24193     int ret_val;
24194     xmlChar * value; /* the value to check */
24195     int n_value;
24196     int space; /* allow spaces in front and end of the string */
24197     int n_space;
24198 
24199     for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
24200     for (n_space = 0;n_space < gen_nb_int;n_space++) {
24201         mem_base = xmlMemBlocks();
24202         value = gen_const_xmlChar_ptr(n_value, 0);
24203         space = gen_int(n_space, 1);
24204 
24205         ret_val = xmlValidateNMToken((const xmlChar *)value, space);
24206         desret_int(ret_val);
24207         call_tests++;
24208         des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 0);
24209         des_int(n_space, space, 1);
24210         xmlResetLastError();
24211         if (mem_base != xmlMemBlocks()) {
24212             printf("Leak of %d blocks found in xmlValidateNMToken",
24213 	           xmlMemBlocks() - mem_base);
24214 	    test_ret++;
24215             printf(" %d", n_value);
24216             printf(" %d", n_space);
24217             printf("\n");
24218         }
24219     }
24220     }
24221     function_tests++;
24222 #endif
24223 #endif
24224 
24225     return(test_ret);
24226 }
24227 
24228 
24229 static int
test_xmlValidateName(void)24230 test_xmlValidateName(void) {
24231     int test_ret = 0;
24232 
24233 #if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED)
24234 #ifdef LIBXML_TREE_ENABLED
24235     int mem_base;
24236     int ret_val;
24237     xmlChar * value; /* the value to check */
24238     int n_value;
24239     int space; /* allow spaces in front and end of the string */
24240     int n_space;
24241 
24242     for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
24243     for (n_space = 0;n_space < gen_nb_int;n_space++) {
24244         mem_base = xmlMemBlocks();
24245         value = gen_const_xmlChar_ptr(n_value, 0);
24246         space = gen_int(n_space, 1);
24247 
24248         ret_val = xmlValidateName((const xmlChar *)value, space);
24249         desret_int(ret_val);
24250         call_tests++;
24251         des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 0);
24252         des_int(n_space, space, 1);
24253         xmlResetLastError();
24254         if (mem_base != xmlMemBlocks()) {
24255             printf("Leak of %d blocks found in xmlValidateName",
24256 	           xmlMemBlocks() - mem_base);
24257 	    test_ret++;
24258             printf(" %d", n_value);
24259             printf(" %d", n_space);
24260             printf("\n");
24261         }
24262     }
24263     }
24264     function_tests++;
24265 #endif
24266 #endif
24267 
24268     return(test_ret);
24269 }
24270 
24271 
24272 static int
test_xmlValidateQName(void)24273 test_xmlValidateQName(void) {
24274     int test_ret = 0;
24275 
24276 #if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED)
24277 #ifdef LIBXML_TREE_ENABLED
24278     int mem_base;
24279     int ret_val;
24280     xmlChar * value; /* the value to check */
24281     int n_value;
24282     int space; /* allow spaces in front and end of the string */
24283     int n_space;
24284 
24285     for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
24286     for (n_space = 0;n_space < gen_nb_int;n_space++) {
24287         mem_base = xmlMemBlocks();
24288         value = gen_const_xmlChar_ptr(n_value, 0);
24289         space = gen_int(n_space, 1);
24290 
24291         ret_val = xmlValidateQName((const xmlChar *)value, space);
24292         desret_int(ret_val);
24293         call_tests++;
24294         des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 0);
24295         des_int(n_space, space, 1);
24296         xmlResetLastError();
24297         if (mem_base != xmlMemBlocks()) {
24298             printf("Leak of %d blocks found in xmlValidateQName",
24299 	           xmlMemBlocks() - mem_base);
24300 	    test_ret++;
24301             printf(" %d", n_value);
24302             printf(" %d", n_space);
24303             printf("\n");
24304         }
24305     }
24306     }
24307     function_tests++;
24308 #endif
24309 #endif
24310 
24311     return(test_ret);
24312 }
24313 
24314 static int
test_tree(void)24315 test_tree(void) {
24316     int test_ret = 0;
24317 
24318     if (quiet == 0) printf("Testing tree : 142 of 164 functions ...\n");
24319     test_ret += test_xmlAddChild();
24320     test_ret += test_xmlAddChildList();
24321     test_ret += test_xmlAddNextSibling();
24322     test_ret += test_xmlAddPrevSibling();
24323     test_ret += test_xmlAddSibling();
24324     test_ret += test_xmlAttrSerializeTxtContent();
24325     test_ret += test_xmlBufContent();
24326     test_ret += test_xmlBufEnd();
24327     test_ret += test_xmlBufGetNodeContent();
24328     test_ret += test_xmlBufNodeDump();
24329     test_ret += test_xmlBufShrink();
24330     test_ret += test_xmlBufUse();
24331     test_ret += test_xmlBufferAdd();
24332     test_ret += test_xmlBufferAddHead();
24333     test_ret += test_xmlBufferCCat();
24334     test_ret += test_xmlBufferCat();
24335     test_ret += test_xmlBufferContent();
24336     test_ret += test_xmlBufferCreate();
24337     test_ret += test_xmlBufferCreateSize();
24338     test_ret += test_xmlBufferCreateStatic();
24339     test_ret += test_xmlBufferDetach();
24340     test_ret += test_xmlBufferEmpty();
24341     test_ret += test_xmlBufferGrow();
24342     test_ret += test_xmlBufferLength();
24343     test_ret += test_xmlBufferResize();
24344     test_ret += test_xmlBufferSetAllocationScheme();
24345     test_ret += test_xmlBufferShrink();
24346     test_ret += test_xmlBufferWriteCHAR();
24347     test_ret += test_xmlBufferWriteChar();
24348     test_ret += test_xmlBufferWriteQuotedString();
24349     test_ret += test_xmlBuildQName();
24350     test_ret += test_xmlChildElementCount();
24351     test_ret += test_xmlCopyDoc();
24352     test_ret += test_xmlCopyDtd();
24353     test_ret += test_xmlCopyNamespace();
24354     test_ret += test_xmlCopyNamespaceList();
24355     test_ret += test_xmlCopyNode();
24356     test_ret += test_xmlCopyNodeList();
24357     test_ret += test_xmlCopyProp();
24358     test_ret += test_xmlCopyPropList();
24359     test_ret += test_xmlCreateIntSubset();
24360     test_ret += test_xmlDOMWrapAdoptNode();
24361     test_ret += test_xmlDOMWrapCloneNode();
24362     test_ret += test_xmlDOMWrapNewCtxt();
24363     test_ret += test_xmlDOMWrapReconcileNamespaces();
24364     test_ret += test_xmlDOMWrapRemoveNode();
24365     test_ret += test_xmlDocCopyNode();
24366     test_ret += test_xmlDocCopyNodeList();
24367     test_ret += test_xmlDocDump();
24368     test_ret += test_xmlDocDumpFormatMemory();
24369     test_ret += test_xmlDocDumpFormatMemoryEnc();
24370     test_ret += test_xmlDocDumpMemory();
24371     test_ret += test_xmlDocDumpMemoryEnc();
24372     test_ret += test_xmlDocFormatDump();
24373     test_ret += test_xmlDocGetRootElement();
24374     test_ret += test_xmlDocSetRootElement();
24375     test_ret += test_xmlElemDump();
24376     test_ret += test_xmlFirstElementChild();
24377     test_ret += test_xmlGetBufferAllocationScheme();
24378     test_ret += test_xmlGetCompressMode();
24379     test_ret += test_xmlGetDocCompressMode();
24380     test_ret += test_xmlGetIntSubset();
24381     test_ret += test_xmlGetLastChild();
24382     test_ret += test_xmlGetLineNo();
24383     test_ret += test_xmlGetNoNsProp();
24384     test_ret += test_xmlGetNodePath();
24385     test_ret += test_xmlGetNsList();
24386     test_ret += test_xmlGetNsProp();
24387     test_ret += test_xmlGetProp();
24388     test_ret += test_xmlHasNsProp();
24389     test_ret += test_xmlHasProp();
24390     test_ret += test_xmlIsBlankNode();
24391     test_ret += test_xmlIsXHTML();
24392     test_ret += test_xmlLastElementChild();
24393     test_ret += test_xmlNewCDataBlock();
24394     test_ret += test_xmlNewCharRef();
24395     test_ret += test_xmlNewChild();
24396     test_ret += test_xmlNewComment();
24397     test_ret += test_xmlNewDoc();
24398     test_ret += test_xmlNewDocComment();
24399     test_ret += test_xmlNewDocFragment();
24400     test_ret += test_xmlNewDocNode();
24401     test_ret += test_xmlNewDocNodeEatName();
24402     test_ret += test_xmlNewDocPI();
24403     test_ret += test_xmlNewDocProp();
24404     test_ret += test_xmlNewDocRawNode();
24405     test_ret += test_xmlNewDocText();
24406     test_ret += test_xmlNewDocTextLen();
24407     test_ret += test_xmlNewDtd();
24408     test_ret += test_xmlNewNode();
24409     test_ret += test_xmlNewNodeEatName();
24410     test_ret += test_xmlNewNs();
24411     test_ret += test_xmlNewNsProp();
24412     test_ret += test_xmlNewNsPropEatName();
24413     test_ret += test_xmlNewPI();
24414     test_ret += test_xmlNewProp();
24415     test_ret += test_xmlNewReference();
24416     test_ret += test_xmlNewText();
24417     test_ret += test_xmlNewTextChild();
24418     test_ret += test_xmlNewTextLen();
24419     test_ret += test_xmlNextElementSibling();
24420     test_ret += test_xmlNodeAddContent();
24421     test_ret += test_xmlNodeAddContentLen();
24422     test_ret += test_xmlNodeBufGetContent();
24423     test_ret += test_xmlNodeDump();
24424     test_ret += test_xmlNodeDumpOutput();
24425     test_ret += test_xmlNodeGetBase();
24426     test_ret += test_xmlNodeGetContent();
24427     test_ret += test_xmlNodeGetLang();
24428     test_ret += test_xmlNodeGetSpacePreserve();
24429     test_ret += test_xmlNodeIsText();
24430     test_ret += test_xmlNodeListGetRawString();
24431     test_ret += test_xmlNodeListGetString();
24432     test_ret += test_xmlNodeSetBase();
24433     test_ret += test_xmlNodeSetContent();
24434     test_ret += test_xmlNodeSetContentLen();
24435     test_ret += test_xmlNodeSetLang();
24436     test_ret += test_xmlNodeSetName();
24437     test_ret += test_xmlNodeSetSpacePreserve();
24438     test_ret += test_xmlPreviousElementSibling();
24439     test_ret += test_xmlReconciliateNs();
24440     test_ret += test_xmlRemoveProp();
24441     test_ret += test_xmlReplaceNode();
24442     test_ret += test_xmlSaveFile();
24443     test_ret += test_xmlSaveFileEnc();
24444     test_ret += test_xmlSaveFileTo();
24445     test_ret += test_xmlSaveFormatFile();
24446     test_ret += test_xmlSaveFormatFileEnc();
24447     test_ret += test_xmlSaveFormatFileTo();
24448     test_ret += test_xmlSearchNs();
24449     test_ret += test_xmlSearchNsByHref();
24450     test_ret += test_xmlSetBufferAllocationScheme();
24451     test_ret += test_xmlSetCompressMode();
24452     test_ret += test_xmlSetDocCompressMode();
24453     test_ret += test_xmlSetNs();
24454     test_ret += test_xmlSetNsProp();
24455     test_ret += test_xmlSetProp();
24456     test_ret += test_xmlSplitQName2();
24457     test_ret += test_xmlSplitQName3();
24458     test_ret += test_xmlStringGetNodeList();
24459     test_ret += test_xmlStringLenGetNodeList();
24460     test_ret += test_xmlTextConcat();
24461     test_ret += test_xmlTextMerge();
24462     test_ret += test_xmlUnsetNsProp();
24463     test_ret += test_xmlUnsetProp();
24464     test_ret += test_xmlValidateNCName();
24465     test_ret += test_xmlValidateNMToken();
24466     test_ret += test_xmlValidateName();
24467     test_ret += test_xmlValidateQName();
24468 
24469     if (test_ret != 0)
24470 	printf("Module tree: %d errors\n", test_ret);
24471     return(test_ret);
24472 }
24473 
24474 static int
test_xmlBuildRelativeURI(void)24475 test_xmlBuildRelativeURI(void) {
24476     int test_ret = 0;
24477 
24478     int mem_base;
24479     xmlChar * ret_val;
24480     xmlChar * URI; /* the URI reference under consideration */
24481     int n_URI;
24482     xmlChar * base; /* the base value */
24483     int n_base;
24484 
24485     for (n_URI = 0;n_URI < gen_nb_const_xmlChar_ptr;n_URI++) {
24486     for (n_base = 0;n_base < gen_nb_const_xmlChar_ptr;n_base++) {
24487         mem_base = xmlMemBlocks();
24488         URI = gen_const_xmlChar_ptr(n_URI, 0);
24489         base = gen_const_xmlChar_ptr(n_base, 1);
24490 
24491         ret_val = xmlBuildRelativeURI((const xmlChar *)URI, (const xmlChar *)base);
24492         desret_xmlChar_ptr(ret_val);
24493         call_tests++;
24494         des_const_xmlChar_ptr(n_URI, (const xmlChar *)URI, 0);
24495         des_const_xmlChar_ptr(n_base, (const xmlChar *)base, 1);
24496         xmlResetLastError();
24497         if (mem_base != xmlMemBlocks()) {
24498             printf("Leak of %d blocks found in xmlBuildRelativeURI",
24499 	           xmlMemBlocks() - mem_base);
24500 	    test_ret++;
24501             printf(" %d", n_URI);
24502             printf(" %d", n_base);
24503             printf("\n");
24504         }
24505     }
24506     }
24507     function_tests++;
24508 
24509     return(test_ret);
24510 }
24511 
24512 
24513 static int
test_xmlBuildURI(void)24514 test_xmlBuildURI(void) {
24515     int test_ret = 0;
24516 
24517     int mem_base;
24518     xmlChar * ret_val;
24519     xmlChar * URI; /* the URI instance found in the document */
24520     int n_URI;
24521     xmlChar * base; /* the base value */
24522     int n_base;
24523 
24524     for (n_URI = 0;n_URI < gen_nb_const_xmlChar_ptr;n_URI++) {
24525     for (n_base = 0;n_base < gen_nb_const_xmlChar_ptr;n_base++) {
24526         mem_base = xmlMemBlocks();
24527         URI = gen_const_xmlChar_ptr(n_URI, 0);
24528         base = gen_const_xmlChar_ptr(n_base, 1);
24529 
24530         ret_val = xmlBuildURI((const xmlChar *)URI, (const xmlChar *)base);
24531         desret_xmlChar_ptr(ret_val);
24532         call_tests++;
24533         des_const_xmlChar_ptr(n_URI, (const xmlChar *)URI, 0);
24534         des_const_xmlChar_ptr(n_base, (const xmlChar *)base, 1);
24535         xmlResetLastError();
24536         if (mem_base != xmlMemBlocks()) {
24537             printf("Leak of %d blocks found in xmlBuildURI",
24538 	           xmlMemBlocks() - mem_base);
24539 	    test_ret++;
24540             printf(" %d", n_URI);
24541             printf(" %d", n_base);
24542             printf("\n");
24543         }
24544     }
24545     }
24546     function_tests++;
24547 
24548     return(test_ret);
24549 }
24550 
24551 
24552 static int
test_xmlCanonicPath(void)24553 test_xmlCanonicPath(void) {
24554     int test_ret = 0;
24555 
24556     int mem_base;
24557     xmlChar * ret_val;
24558     xmlChar * path; /* the resource locator in a filesystem notation */
24559     int n_path;
24560 
24561     for (n_path = 0;n_path < gen_nb_const_xmlChar_ptr;n_path++) {
24562         mem_base = xmlMemBlocks();
24563         path = gen_const_xmlChar_ptr(n_path, 0);
24564 
24565         ret_val = xmlCanonicPath((const xmlChar *)path);
24566         desret_xmlChar_ptr(ret_val);
24567         call_tests++;
24568         des_const_xmlChar_ptr(n_path, (const xmlChar *)path, 0);
24569         xmlResetLastError();
24570         if (mem_base != xmlMemBlocks()) {
24571             printf("Leak of %d blocks found in xmlCanonicPath",
24572 	           xmlMemBlocks() - mem_base);
24573 	    test_ret++;
24574             printf(" %d", n_path);
24575             printf("\n");
24576         }
24577     }
24578     function_tests++;
24579 
24580     return(test_ret);
24581 }
24582 
24583 
24584 static int
test_xmlCreateURI(void)24585 test_xmlCreateURI(void) {
24586     int test_ret = 0;
24587 
24588 
24589     /* missing type support */
24590     return(test_ret);
24591 }
24592 
24593 
24594 static int
test_xmlNormalizeURIPath(void)24595 test_xmlNormalizeURIPath(void) {
24596     int test_ret = 0;
24597 
24598     int mem_base;
24599     int ret_val;
24600     char * path; /* pointer to the path string */
24601     int n_path;
24602 
24603     for (n_path = 0;n_path < gen_nb_char_ptr;n_path++) {
24604         mem_base = xmlMemBlocks();
24605         path = gen_char_ptr(n_path, 0);
24606 
24607         ret_val = xmlNormalizeURIPath(path);
24608         desret_int(ret_val);
24609         call_tests++;
24610         des_char_ptr(n_path, path, 0);
24611         xmlResetLastError();
24612         if (mem_base != xmlMemBlocks()) {
24613             printf("Leak of %d blocks found in xmlNormalizeURIPath",
24614 	           xmlMemBlocks() - mem_base);
24615 	    test_ret++;
24616             printf(" %d", n_path);
24617             printf("\n");
24618         }
24619     }
24620     function_tests++;
24621 
24622     return(test_ret);
24623 }
24624 
24625 
24626 static int
test_xmlParseURI(void)24627 test_xmlParseURI(void) {
24628     int test_ret = 0;
24629 
24630 
24631     /* missing type support */
24632     return(test_ret);
24633 }
24634 
24635 
24636 static int
test_xmlParseURIRaw(void)24637 test_xmlParseURIRaw(void) {
24638     int test_ret = 0;
24639 
24640 
24641     /* missing type support */
24642     return(test_ret);
24643 }
24644 
24645 
24646 #define gen_nb_xmlURIPtr 1
gen_xmlURIPtr(int no ATTRIBUTE_UNUSED,int nr ATTRIBUTE_UNUSED)24647 static xmlURIPtr gen_xmlURIPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
24648     return(NULL);
24649 }
des_xmlURIPtr(int no ATTRIBUTE_UNUSED,xmlURIPtr val ATTRIBUTE_UNUSED,int nr ATTRIBUTE_UNUSED)24650 static void des_xmlURIPtr(int no ATTRIBUTE_UNUSED, xmlURIPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
24651 }
24652 
24653 static int
test_xmlParseURIReference(void)24654 test_xmlParseURIReference(void) {
24655     int test_ret = 0;
24656 
24657     int mem_base;
24658     int ret_val;
24659     xmlURIPtr uri; /* pointer to an URI structure */
24660     int n_uri;
24661     char * str; /* the string to analyze */
24662     int n_str;
24663 
24664     for (n_uri = 0;n_uri < gen_nb_xmlURIPtr;n_uri++) {
24665     for (n_str = 0;n_str < gen_nb_const_char_ptr;n_str++) {
24666         mem_base = xmlMemBlocks();
24667         uri = gen_xmlURIPtr(n_uri, 0);
24668         str = gen_const_char_ptr(n_str, 1);
24669 
24670         ret_val = xmlParseURIReference(uri, (const char *)str);
24671         desret_int(ret_val);
24672         call_tests++;
24673         des_xmlURIPtr(n_uri, uri, 0);
24674         des_const_char_ptr(n_str, (const char *)str, 1);
24675         xmlResetLastError();
24676         if (mem_base != xmlMemBlocks()) {
24677             printf("Leak of %d blocks found in xmlParseURIReference",
24678 	           xmlMemBlocks() - mem_base);
24679 	    test_ret++;
24680             printf(" %d", n_uri);
24681             printf(" %d", n_str);
24682             printf("\n");
24683         }
24684     }
24685     }
24686     function_tests++;
24687 
24688     return(test_ret);
24689 }
24690 
24691 
24692 static int
test_xmlPathToURI(void)24693 test_xmlPathToURI(void) {
24694     int test_ret = 0;
24695 
24696     int mem_base;
24697     xmlChar * ret_val;
24698     xmlChar * path; /* the resource locator in a filesystem notation */
24699     int n_path;
24700 
24701     for (n_path = 0;n_path < gen_nb_const_xmlChar_ptr;n_path++) {
24702         mem_base = xmlMemBlocks();
24703         path = gen_const_xmlChar_ptr(n_path, 0);
24704 
24705         ret_val = xmlPathToURI((const xmlChar *)path);
24706         desret_xmlChar_ptr(ret_val);
24707         call_tests++;
24708         des_const_xmlChar_ptr(n_path, (const xmlChar *)path, 0);
24709         xmlResetLastError();
24710         if (mem_base != xmlMemBlocks()) {
24711             printf("Leak of %d blocks found in xmlPathToURI",
24712 	           xmlMemBlocks() - mem_base);
24713 	    test_ret++;
24714             printf(" %d", n_path);
24715             printf("\n");
24716         }
24717     }
24718     function_tests++;
24719 
24720     return(test_ret);
24721 }
24722 
24723 
24724 static int
test_xmlPrintURI(void)24725 test_xmlPrintURI(void) {
24726     int test_ret = 0;
24727 
24728     int mem_base;
24729     FILE * stream; /* a FILE* for the output */
24730     int n_stream;
24731     xmlURIPtr uri; /* pointer to an xmlURI */
24732     int n_uri;
24733 
24734     for (n_stream = 0;n_stream < gen_nb_FILE_ptr;n_stream++) {
24735     for (n_uri = 0;n_uri < gen_nb_xmlURIPtr;n_uri++) {
24736         mem_base = xmlMemBlocks();
24737         stream = gen_FILE_ptr(n_stream, 0);
24738         uri = gen_xmlURIPtr(n_uri, 1);
24739 
24740         xmlPrintURI(stream, uri);
24741         call_tests++;
24742         des_FILE_ptr(n_stream, stream, 0);
24743         des_xmlURIPtr(n_uri, uri, 1);
24744         xmlResetLastError();
24745         if (mem_base != xmlMemBlocks()) {
24746             printf("Leak of %d blocks found in xmlPrintURI",
24747 	           xmlMemBlocks() - mem_base);
24748 	    test_ret++;
24749             printf(" %d", n_stream);
24750             printf(" %d", n_uri);
24751             printf("\n");
24752         }
24753     }
24754     }
24755     function_tests++;
24756 
24757     return(test_ret);
24758 }
24759 
24760 
24761 static int
test_xmlSaveUri(void)24762 test_xmlSaveUri(void) {
24763     int test_ret = 0;
24764 
24765     int mem_base;
24766     xmlChar * ret_val;
24767     xmlURIPtr uri; /* pointer to an xmlURI */
24768     int n_uri;
24769 
24770     for (n_uri = 0;n_uri < gen_nb_xmlURIPtr;n_uri++) {
24771         mem_base = xmlMemBlocks();
24772         uri = gen_xmlURIPtr(n_uri, 0);
24773 
24774         ret_val = xmlSaveUri(uri);
24775         desret_xmlChar_ptr(ret_val);
24776         call_tests++;
24777         des_xmlURIPtr(n_uri, uri, 0);
24778         xmlResetLastError();
24779         if (mem_base != xmlMemBlocks()) {
24780             printf("Leak of %d blocks found in xmlSaveUri",
24781 	           xmlMemBlocks() - mem_base);
24782 	    test_ret++;
24783             printf(" %d", n_uri);
24784             printf("\n");
24785         }
24786     }
24787     function_tests++;
24788 
24789     return(test_ret);
24790 }
24791 
24792 
24793 static int
test_xmlURIEscape(void)24794 test_xmlURIEscape(void) {
24795     int test_ret = 0;
24796 
24797     int mem_base;
24798     xmlChar * ret_val;
24799     xmlChar * str; /* the string of the URI to escape */
24800     int n_str;
24801 
24802     for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) {
24803         mem_base = xmlMemBlocks();
24804         str = gen_const_xmlChar_ptr(n_str, 0);
24805 
24806         ret_val = xmlURIEscape((const xmlChar *)str);
24807         desret_xmlChar_ptr(ret_val);
24808         call_tests++;
24809         des_const_xmlChar_ptr(n_str, (const xmlChar *)str, 0);
24810         xmlResetLastError();
24811         if (mem_base != xmlMemBlocks()) {
24812             printf("Leak of %d blocks found in xmlURIEscape",
24813 	           xmlMemBlocks() - mem_base);
24814 	    test_ret++;
24815             printf(" %d", n_str);
24816             printf("\n");
24817         }
24818     }
24819     function_tests++;
24820 
24821     return(test_ret);
24822 }
24823 
24824 
24825 static int
test_xmlURIEscapeStr(void)24826 test_xmlURIEscapeStr(void) {
24827     int test_ret = 0;
24828 
24829     int mem_base;
24830     xmlChar * ret_val;
24831     xmlChar * str; /* string to escape */
24832     int n_str;
24833     xmlChar * list; /* exception list string of chars not to escape */
24834     int n_list;
24835 
24836     for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) {
24837     for (n_list = 0;n_list < gen_nb_const_xmlChar_ptr;n_list++) {
24838         mem_base = xmlMemBlocks();
24839         str = gen_const_xmlChar_ptr(n_str, 0);
24840         list = gen_const_xmlChar_ptr(n_list, 1);
24841 
24842         ret_val = xmlURIEscapeStr((const xmlChar *)str, (const xmlChar *)list);
24843         desret_xmlChar_ptr(ret_val);
24844         call_tests++;
24845         des_const_xmlChar_ptr(n_str, (const xmlChar *)str, 0);
24846         des_const_xmlChar_ptr(n_list, (const xmlChar *)list, 1);
24847         xmlResetLastError();
24848         if (mem_base != xmlMemBlocks()) {
24849             printf("Leak of %d blocks found in xmlURIEscapeStr",
24850 	           xmlMemBlocks() - mem_base);
24851 	    test_ret++;
24852             printf(" %d", n_str);
24853             printf(" %d", n_list);
24854             printf("\n");
24855         }
24856     }
24857     }
24858     function_tests++;
24859 
24860     return(test_ret);
24861 }
24862 
24863 
24864 static int
test_xmlURIUnescapeString(void)24865 test_xmlURIUnescapeString(void) {
24866     int test_ret = 0;
24867 
24868 
24869     /* missing type support */
24870     return(test_ret);
24871 }
24872 
24873 static int
test_uri(void)24874 test_uri(void) {
24875     int test_ret = 0;
24876 
24877     if (quiet == 0) printf("Testing uri : 10 of 15 functions ...\n");
24878     test_ret += test_xmlBuildRelativeURI();
24879     test_ret += test_xmlBuildURI();
24880     test_ret += test_xmlCanonicPath();
24881     test_ret += test_xmlCreateURI();
24882     test_ret += test_xmlNormalizeURIPath();
24883     test_ret += test_xmlParseURI();
24884     test_ret += test_xmlParseURIRaw();
24885     test_ret += test_xmlParseURIReference();
24886     test_ret += test_xmlPathToURI();
24887     test_ret += test_xmlPrintURI();
24888     test_ret += test_xmlSaveUri();
24889     test_ret += test_xmlURIEscape();
24890     test_ret += test_xmlURIEscapeStr();
24891     test_ret += test_xmlURIUnescapeString();
24892 
24893     if (test_ret != 0)
24894 	printf("Module uri: %d errors\n", test_ret);
24895     return(test_ret);
24896 }
24897 
24898 static int
test_xmlAddAttributeDecl(void)24899 test_xmlAddAttributeDecl(void) {
24900     int test_ret = 0;
24901 
24902     int mem_base;
24903     xmlAttributePtr ret_val;
24904     xmlValidCtxtPtr ctxt; /* the validation context */
24905     int n_ctxt;
24906     xmlDtdPtr dtd; /* pointer to the DTD */
24907     int n_dtd;
24908     xmlChar * elem; /* the element name */
24909     int n_elem;
24910     xmlChar * name; /* the attribute name */
24911     int n_name;
24912     xmlChar * ns; /* the attribute namespace prefix */
24913     int n_ns;
24914     xmlAttributeType type; /* the attribute type */
24915     int n_type;
24916     xmlAttributeDefault def; /* the attribute default type */
24917     int n_def;
24918     xmlChar * defaultValue; /* the attribute default value */
24919     int n_defaultValue;
24920     xmlEnumerationPtr tree; /* if it's an enumeration, the associated list */
24921     int n_tree;
24922 
24923     for (n_ctxt = 0;n_ctxt < gen_nb_xmlValidCtxtPtr;n_ctxt++) {
24924     for (n_dtd = 0;n_dtd < gen_nb_xmlDtdPtr;n_dtd++) {
24925     for (n_elem = 0;n_elem < gen_nb_const_xmlChar_ptr;n_elem++) {
24926     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
24927     for (n_ns = 0;n_ns < gen_nb_const_xmlChar_ptr;n_ns++) {
24928     for (n_type = 0;n_type < gen_nb_xmlAttributeType;n_type++) {
24929     for (n_def = 0;n_def < gen_nb_xmlAttributeDefault;n_def++) {
24930     for (n_defaultValue = 0;n_defaultValue < gen_nb_const_xmlChar_ptr;n_defaultValue++) {
24931     for (n_tree = 0;n_tree < gen_nb_xmlEnumerationPtr;n_tree++) {
24932         mem_base = xmlMemBlocks();
24933         ctxt = gen_xmlValidCtxtPtr(n_ctxt, 0);
24934         dtd = gen_xmlDtdPtr(n_dtd, 1);
24935         elem = gen_const_xmlChar_ptr(n_elem, 2);
24936         name = gen_const_xmlChar_ptr(n_name, 3);
24937         ns = gen_const_xmlChar_ptr(n_ns, 4);
24938         type = gen_xmlAttributeType(n_type, 5);
24939         def = gen_xmlAttributeDefault(n_def, 6);
24940         defaultValue = gen_const_xmlChar_ptr(n_defaultValue, 7);
24941         tree = gen_xmlEnumerationPtr(n_tree, 8);
24942 
24943         ret_val = xmlAddAttributeDecl(ctxt, dtd, (const xmlChar *)elem, (const xmlChar *)name, (const xmlChar *)ns, type, def, (const xmlChar *)defaultValue, tree);
24944         desret_xmlAttributePtr(ret_val);
24945         call_tests++;
24946         des_xmlValidCtxtPtr(n_ctxt, ctxt, 0);
24947         des_xmlDtdPtr(n_dtd, dtd, 1);
24948         des_const_xmlChar_ptr(n_elem, (const xmlChar *)elem, 2);
24949         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 3);
24950         des_const_xmlChar_ptr(n_ns, (const xmlChar *)ns, 4);
24951         des_xmlAttributeType(n_type, type, 5);
24952         des_xmlAttributeDefault(n_def, def, 6);
24953         des_const_xmlChar_ptr(n_defaultValue, (const xmlChar *)defaultValue, 7);
24954         des_xmlEnumerationPtr(n_tree, tree, 8);
24955         xmlResetLastError();
24956         if (mem_base != xmlMemBlocks()) {
24957             printf("Leak of %d blocks found in xmlAddAttributeDecl",
24958 	           xmlMemBlocks() - mem_base);
24959 	    test_ret++;
24960             printf(" %d", n_ctxt);
24961             printf(" %d", n_dtd);
24962             printf(" %d", n_elem);
24963             printf(" %d", n_name);
24964             printf(" %d", n_ns);
24965             printf(" %d", n_type);
24966             printf(" %d", n_def);
24967             printf(" %d", n_defaultValue);
24968             printf(" %d", n_tree);
24969             printf("\n");
24970         }
24971     }
24972     }
24973     }
24974     }
24975     }
24976     }
24977     }
24978     }
24979     }
24980     function_tests++;
24981 
24982     return(test_ret);
24983 }
24984 
24985 
24986 static int
test_xmlAddElementDecl(void)24987 test_xmlAddElementDecl(void) {
24988     int test_ret = 0;
24989 
24990     int mem_base;
24991     xmlElementPtr ret_val;
24992     xmlValidCtxtPtr ctxt; /* the validation context */
24993     int n_ctxt;
24994     xmlDtdPtr dtd; /* pointer to the DTD */
24995     int n_dtd;
24996     xmlChar * name; /* the entity name */
24997     int n_name;
24998     xmlElementTypeVal type; /* the element type */
24999     int n_type;
25000     xmlElementContentPtr content; /* the element content tree or NULL */
25001     int n_content;
25002 
25003     for (n_ctxt = 0;n_ctxt < gen_nb_xmlValidCtxtPtr;n_ctxt++) {
25004     for (n_dtd = 0;n_dtd < gen_nb_xmlDtdPtr;n_dtd++) {
25005     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
25006     for (n_type = 0;n_type < gen_nb_xmlElementTypeVal;n_type++) {
25007     for (n_content = 0;n_content < gen_nb_xmlElementContentPtr;n_content++) {
25008         mem_base = xmlMemBlocks();
25009         ctxt = gen_xmlValidCtxtPtr(n_ctxt, 0);
25010         dtd = gen_xmlDtdPtr(n_dtd, 1);
25011         name = gen_const_xmlChar_ptr(n_name, 2);
25012         type = gen_xmlElementTypeVal(n_type, 3);
25013         content = gen_xmlElementContentPtr(n_content, 4);
25014 
25015         ret_val = xmlAddElementDecl(ctxt, dtd, (const xmlChar *)name, type, content);
25016         desret_xmlElementPtr(ret_val);
25017         call_tests++;
25018         des_xmlValidCtxtPtr(n_ctxt, ctxt, 0);
25019         des_xmlDtdPtr(n_dtd, dtd, 1);
25020         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 2);
25021         des_xmlElementTypeVal(n_type, type, 3);
25022         des_xmlElementContentPtr(n_content, content, 4);
25023         xmlResetLastError();
25024         if (mem_base != xmlMemBlocks()) {
25025             printf("Leak of %d blocks found in xmlAddElementDecl",
25026 	           xmlMemBlocks() - mem_base);
25027 	    test_ret++;
25028             printf(" %d", n_ctxt);
25029             printf(" %d", n_dtd);
25030             printf(" %d", n_name);
25031             printf(" %d", n_type);
25032             printf(" %d", n_content);
25033             printf("\n");
25034         }
25035     }
25036     }
25037     }
25038     }
25039     }
25040     function_tests++;
25041 
25042     return(test_ret);
25043 }
25044 
25045 
25046 static int
test_xmlAddID(void)25047 test_xmlAddID(void) {
25048     int test_ret = 0;
25049 
25050 
25051     /* missing type support */
25052     return(test_ret);
25053 }
25054 
25055 
25056 static int
test_xmlAddNotationDecl(void)25057 test_xmlAddNotationDecl(void) {
25058     int test_ret = 0;
25059 
25060 
25061     /* missing type support */
25062     return(test_ret);
25063 }
25064 
25065 
25066 static int
test_xmlAddRef(void)25067 test_xmlAddRef(void) {
25068     int test_ret = 0;
25069 
25070 
25071     /* missing type support */
25072     return(test_ret);
25073 }
25074 
25075 
25076 static int
test_xmlCopyAttributeTable(void)25077 test_xmlCopyAttributeTable(void) {
25078     int test_ret = 0;
25079 
25080 
25081     /* missing type support */
25082     return(test_ret);
25083 }
25084 
25085 
25086 static int
test_xmlCopyDocElementContent(void)25087 test_xmlCopyDocElementContent(void) {
25088     int test_ret = 0;
25089 
25090     int mem_base;
25091     xmlElementContentPtr ret_val;
25092     xmlDocPtr doc; /* the document owning the element declaration */
25093     int n_doc;
25094     xmlElementContentPtr cur; /* An element content pointer. */
25095     int n_cur;
25096 
25097     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
25098     for (n_cur = 0;n_cur < gen_nb_xmlElementContentPtr;n_cur++) {
25099         mem_base = xmlMemBlocks();
25100         doc = gen_xmlDocPtr(n_doc, 0);
25101         cur = gen_xmlElementContentPtr(n_cur, 1);
25102 
25103         ret_val = xmlCopyDocElementContent(doc, cur);
25104         desret_xmlElementContentPtr(ret_val);
25105         call_tests++;
25106         des_xmlDocPtr(n_doc, doc, 0);
25107         des_xmlElementContentPtr(n_cur, cur, 1);
25108         xmlResetLastError();
25109         if (mem_base != xmlMemBlocks()) {
25110             printf("Leak of %d blocks found in xmlCopyDocElementContent",
25111 	           xmlMemBlocks() - mem_base);
25112 	    test_ret++;
25113             printf(" %d", n_doc);
25114             printf(" %d", n_cur);
25115             printf("\n");
25116         }
25117     }
25118     }
25119     function_tests++;
25120 
25121     return(test_ret);
25122 }
25123 
25124 
25125 static int
test_xmlCopyElementContent(void)25126 test_xmlCopyElementContent(void) {
25127     int test_ret = 0;
25128 
25129     int mem_base;
25130     xmlElementContentPtr ret_val;
25131     xmlElementContentPtr cur; /* An element content pointer. */
25132     int n_cur;
25133 
25134     for (n_cur = 0;n_cur < gen_nb_xmlElementContentPtr;n_cur++) {
25135         mem_base = xmlMemBlocks();
25136         cur = gen_xmlElementContentPtr(n_cur, 0);
25137 
25138         ret_val = xmlCopyElementContent(cur);
25139         desret_xmlElementContentPtr(ret_val);
25140         call_tests++;
25141         des_xmlElementContentPtr(n_cur, cur, 0);
25142         xmlResetLastError();
25143         if (mem_base != xmlMemBlocks()) {
25144             printf("Leak of %d blocks found in xmlCopyElementContent",
25145 	           xmlMemBlocks() - mem_base);
25146 	    test_ret++;
25147             printf(" %d", n_cur);
25148             printf("\n");
25149         }
25150     }
25151     function_tests++;
25152 
25153     return(test_ret);
25154 }
25155 
25156 
25157 static int
test_xmlCopyElementTable(void)25158 test_xmlCopyElementTable(void) {
25159     int test_ret = 0;
25160 
25161 
25162     /* missing type support */
25163     return(test_ret);
25164 }
25165 
25166 
25167 static int
test_xmlCopyEnumeration(void)25168 test_xmlCopyEnumeration(void) {
25169     int test_ret = 0;
25170 
25171 
25172     /* missing type support */
25173     return(test_ret);
25174 }
25175 
25176 
25177 static int
test_xmlCopyNotationTable(void)25178 test_xmlCopyNotationTable(void) {
25179     int test_ret = 0;
25180 
25181 
25182     /* missing type support */
25183     return(test_ret);
25184 }
25185 
25186 
25187 static int
test_xmlCreateEnumeration(void)25188 test_xmlCreateEnumeration(void) {
25189     int test_ret = 0;
25190 
25191 
25192     /* missing type support */
25193     return(test_ret);
25194 }
25195 
25196 
25197 #define gen_nb_xmlAttributePtr 1
gen_xmlAttributePtr(int no ATTRIBUTE_UNUSED,int nr ATTRIBUTE_UNUSED)25198 static xmlAttributePtr gen_xmlAttributePtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
25199     return(NULL);
25200 }
des_xmlAttributePtr(int no ATTRIBUTE_UNUSED,xmlAttributePtr val ATTRIBUTE_UNUSED,int nr ATTRIBUTE_UNUSED)25201 static void des_xmlAttributePtr(int no ATTRIBUTE_UNUSED, xmlAttributePtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
25202 }
25203 
25204 static int
test_xmlDumpAttributeDecl(void)25205 test_xmlDumpAttributeDecl(void) {
25206     int test_ret = 0;
25207 
25208 #if defined(LIBXML_OUTPUT_ENABLED)
25209     int mem_base;
25210     xmlBufferPtr buf; /* the XML buffer output */
25211     int n_buf;
25212     xmlAttributePtr attr; /* An attribute declaration */
25213     int n_attr;
25214 
25215     for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
25216     for (n_attr = 0;n_attr < gen_nb_xmlAttributePtr;n_attr++) {
25217         mem_base = xmlMemBlocks();
25218         buf = gen_xmlBufferPtr(n_buf, 0);
25219         attr = gen_xmlAttributePtr(n_attr, 1);
25220 
25221         xmlDumpAttributeDecl(buf, attr);
25222         call_tests++;
25223         des_xmlBufferPtr(n_buf, buf, 0);
25224         des_xmlAttributePtr(n_attr, attr, 1);
25225         xmlResetLastError();
25226         if (mem_base != xmlMemBlocks()) {
25227             printf("Leak of %d blocks found in xmlDumpAttributeDecl",
25228 	           xmlMemBlocks() - mem_base);
25229 	    test_ret++;
25230             printf(" %d", n_buf);
25231             printf(" %d", n_attr);
25232             printf("\n");
25233         }
25234     }
25235     }
25236     function_tests++;
25237 #endif
25238 
25239     return(test_ret);
25240 }
25241 
25242 
25243 #define gen_nb_xmlAttributeTablePtr 1
gen_xmlAttributeTablePtr(int no ATTRIBUTE_UNUSED,int nr ATTRIBUTE_UNUSED)25244 static xmlAttributeTablePtr gen_xmlAttributeTablePtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
25245     return(NULL);
25246 }
des_xmlAttributeTablePtr(int no ATTRIBUTE_UNUSED,xmlAttributeTablePtr val ATTRIBUTE_UNUSED,int nr ATTRIBUTE_UNUSED)25247 static void des_xmlAttributeTablePtr(int no ATTRIBUTE_UNUSED, xmlAttributeTablePtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
25248 }
25249 
25250 static int
test_xmlDumpAttributeTable(void)25251 test_xmlDumpAttributeTable(void) {
25252     int test_ret = 0;
25253 
25254 #if defined(LIBXML_OUTPUT_ENABLED)
25255     int mem_base;
25256     xmlBufferPtr buf; /* the XML buffer output */
25257     int n_buf;
25258     xmlAttributeTablePtr table; /* An attribute table */
25259     int n_table;
25260 
25261     for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
25262     for (n_table = 0;n_table < gen_nb_xmlAttributeTablePtr;n_table++) {
25263         mem_base = xmlMemBlocks();
25264         buf = gen_xmlBufferPtr(n_buf, 0);
25265         table = gen_xmlAttributeTablePtr(n_table, 1);
25266 
25267         xmlDumpAttributeTable(buf, table);
25268         call_tests++;
25269         des_xmlBufferPtr(n_buf, buf, 0);
25270         des_xmlAttributeTablePtr(n_table, table, 1);
25271         xmlResetLastError();
25272         if (mem_base != xmlMemBlocks()) {
25273             printf("Leak of %d blocks found in xmlDumpAttributeTable",
25274 	           xmlMemBlocks() - mem_base);
25275 	    test_ret++;
25276             printf(" %d", n_buf);
25277             printf(" %d", n_table);
25278             printf("\n");
25279         }
25280     }
25281     }
25282     function_tests++;
25283 #endif
25284 
25285     return(test_ret);
25286 }
25287 
25288 
25289 #define gen_nb_xmlElementPtr 1
gen_xmlElementPtr(int no ATTRIBUTE_UNUSED,int nr ATTRIBUTE_UNUSED)25290 static xmlElementPtr gen_xmlElementPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
25291     return(NULL);
25292 }
des_xmlElementPtr(int no ATTRIBUTE_UNUSED,xmlElementPtr val ATTRIBUTE_UNUSED,int nr ATTRIBUTE_UNUSED)25293 static void des_xmlElementPtr(int no ATTRIBUTE_UNUSED, xmlElementPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
25294 }
25295 
25296 static int
test_xmlDumpElementDecl(void)25297 test_xmlDumpElementDecl(void) {
25298     int test_ret = 0;
25299 
25300 #if defined(LIBXML_OUTPUT_ENABLED)
25301     int mem_base;
25302     xmlBufferPtr buf; /* the XML buffer output */
25303     int n_buf;
25304     xmlElementPtr elem; /* An element table */
25305     int n_elem;
25306 
25307     for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
25308     for (n_elem = 0;n_elem < gen_nb_xmlElementPtr;n_elem++) {
25309         mem_base = xmlMemBlocks();
25310         buf = gen_xmlBufferPtr(n_buf, 0);
25311         elem = gen_xmlElementPtr(n_elem, 1);
25312 
25313         xmlDumpElementDecl(buf, elem);
25314         call_tests++;
25315         des_xmlBufferPtr(n_buf, buf, 0);
25316         des_xmlElementPtr(n_elem, elem, 1);
25317         xmlResetLastError();
25318         if (mem_base != xmlMemBlocks()) {
25319             printf("Leak of %d blocks found in xmlDumpElementDecl",
25320 	           xmlMemBlocks() - mem_base);
25321 	    test_ret++;
25322             printf(" %d", n_buf);
25323             printf(" %d", n_elem);
25324             printf("\n");
25325         }
25326     }
25327     }
25328     function_tests++;
25329 #endif
25330 
25331     return(test_ret);
25332 }
25333 
25334 
25335 #define gen_nb_xmlElementTablePtr 1
gen_xmlElementTablePtr(int no ATTRIBUTE_UNUSED,int nr ATTRIBUTE_UNUSED)25336 static xmlElementTablePtr gen_xmlElementTablePtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
25337     return(NULL);
25338 }
des_xmlElementTablePtr(int no ATTRIBUTE_UNUSED,xmlElementTablePtr val ATTRIBUTE_UNUSED,int nr ATTRIBUTE_UNUSED)25339 static void des_xmlElementTablePtr(int no ATTRIBUTE_UNUSED, xmlElementTablePtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
25340 }
25341 
25342 static int
test_xmlDumpElementTable(void)25343 test_xmlDumpElementTable(void) {
25344     int test_ret = 0;
25345 
25346 #if defined(LIBXML_OUTPUT_ENABLED)
25347     int mem_base;
25348     xmlBufferPtr buf; /* the XML buffer output */
25349     int n_buf;
25350     xmlElementTablePtr table; /* An element table */
25351     int n_table;
25352 
25353     for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
25354     for (n_table = 0;n_table < gen_nb_xmlElementTablePtr;n_table++) {
25355         mem_base = xmlMemBlocks();
25356         buf = gen_xmlBufferPtr(n_buf, 0);
25357         table = gen_xmlElementTablePtr(n_table, 1);
25358 
25359         xmlDumpElementTable(buf, table);
25360         call_tests++;
25361         des_xmlBufferPtr(n_buf, buf, 0);
25362         des_xmlElementTablePtr(n_table, table, 1);
25363         xmlResetLastError();
25364         if (mem_base != xmlMemBlocks()) {
25365             printf("Leak of %d blocks found in xmlDumpElementTable",
25366 	           xmlMemBlocks() - mem_base);
25367 	    test_ret++;
25368             printf(" %d", n_buf);
25369             printf(" %d", n_table);
25370             printf("\n");
25371         }
25372     }
25373     }
25374     function_tests++;
25375 #endif
25376 
25377     return(test_ret);
25378 }
25379 
25380 
25381 #define gen_nb_xmlNotationPtr 1
gen_xmlNotationPtr(int no ATTRIBUTE_UNUSED,int nr ATTRIBUTE_UNUSED)25382 static xmlNotationPtr gen_xmlNotationPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
25383     return(NULL);
25384 }
des_xmlNotationPtr(int no ATTRIBUTE_UNUSED,xmlNotationPtr val ATTRIBUTE_UNUSED,int nr ATTRIBUTE_UNUSED)25385 static void des_xmlNotationPtr(int no ATTRIBUTE_UNUSED, xmlNotationPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
25386 }
25387 
25388 static int
test_xmlDumpNotationDecl(void)25389 test_xmlDumpNotationDecl(void) {
25390     int test_ret = 0;
25391 
25392 #if defined(LIBXML_OUTPUT_ENABLED)
25393     int mem_base;
25394     xmlBufferPtr buf; /* the XML buffer output */
25395     int n_buf;
25396     xmlNotationPtr nota; /* A notation declaration */
25397     int n_nota;
25398 
25399     for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
25400     for (n_nota = 0;n_nota < gen_nb_xmlNotationPtr;n_nota++) {
25401         mem_base = xmlMemBlocks();
25402         buf = gen_xmlBufferPtr(n_buf, 0);
25403         nota = gen_xmlNotationPtr(n_nota, 1);
25404 
25405         xmlDumpNotationDecl(buf, nota);
25406         call_tests++;
25407         des_xmlBufferPtr(n_buf, buf, 0);
25408         des_xmlNotationPtr(n_nota, nota, 1);
25409         xmlResetLastError();
25410         if (mem_base != xmlMemBlocks()) {
25411             printf("Leak of %d blocks found in xmlDumpNotationDecl",
25412 	           xmlMemBlocks() - mem_base);
25413 	    test_ret++;
25414             printf(" %d", n_buf);
25415             printf(" %d", n_nota);
25416             printf("\n");
25417         }
25418     }
25419     }
25420     function_tests++;
25421 #endif
25422 
25423     return(test_ret);
25424 }
25425 
25426 
25427 #define gen_nb_xmlNotationTablePtr 1
gen_xmlNotationTablePtr(int no ATTRIBUTE_UNUSED,int nr ATTRIBUTE_UNUSED)25428 static xmlNotationTablePtr gen_xmlNotationTablePtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
25429     return(NULL);
25430 }
des_xmlNotationTablePtr(int no ATTRIBUTE_UNUSED,xmlNotationTablePtr val ATTRIBUTE_UNUSED,int nr ATTRIBUTE_UNUSED)25431 static void des_xmlNotationTablePtr(int no ATTRIBUTE_UNUSED, xmlNotationTablePtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
25432 }
25433 
25434 static int
test_xmlDumpNotationTable(void)25435 test_xmlDumpNotationTable(void) {
25436     int test_ret = 0;
25437 
25438 #if defined(LIBXML_OUTPUT_ENABLED)
25439     int mem_base;
25440     xmlBufferPtr buf; /* the XML buffer output */
25441     int n_buf;
25442     xmlNotationTablePtr table; /* A notation table */
25443     int n_table;
25444 
25445     for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
25446     for (n_table = 0;n_table < gen_nb_xmlNotationTablePtr;n_table++) {
25447         mem_base = xmlMemBlocks();
25448         buf = gen_xmlBufferPtr(n_buf, 0);
25449         table = gen_xmlNotationTablePtr(n_table, 1);
25450 
25451         xmlDumpNotationTable(buf, table);
25452         call_tests++;
25453         des_xmlBufferPtr(n_buf, buf, 0);
25454         des_xmlNotationTablePtr(n_table, table, 1);
25455         xmlResetLastError();
25456         if (mem_base != xmlMemBlocks()) {
25457             printf("Leak of %d blocks found in xmlDumpNotationTable",
25458 	           xmlMemBlocks() - mem_base);
25459 	    test_ret++;
25460             printf(" %d", n_buf);
25461             printf(" %d", n_table);
25462             printf("\n");
25463         }
25464     }
25465     }
25466     function_tests++;
25467 #endif
25468 
25469     return(test_ret);
25470 }
25471 
25472 
25473 static int
test_xmlGetDtdAttrDesc(void)25474 test_xmlGetDtdAttrDesc(void) {
25475     int test_ret = 0;
25476 
25477     int mem_base;
25478     xmlAttributePtr ret_val;
25479     xmlDtdPtr dtd; /* a pointer to the DtD to search */
25480     int n_dtd;
25481     xmlChar * elem; /* the element name */
25482     int n_elem;
25483     xmlChar * name; /* the attribute name */
25484     int n_name;
25485 
25486     for (n_dtd = 0;n_dtd < gen_nb_xmlDtdPtr;n_dtd++) {
25487     for (n_elem = 0;n_elem < gen_nb_const_xmlChar_ptr;n_elem++) {
25488     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
25489         mem_base = xmlMemBlocks();
25490         dtd = gen_xmlDtdPtr(n_dtd, 0);
25491         elem = gen_const_xmlChar_ptr(n_elem, 1);
25492         name = gen_const_xmlChar_ptr(n_name, 2);
25493 
25494         ret_val = xmlGetDtdAttrDesc(dtd, (const xmlChar *)elem, (const xmlChar *)name);
25495         desret_xmlAttributePtr(ret_val);
25496         call_tests++;
25497         des_xmlDtdPtr(n_dtd, dtd, 0);
25498         des_const_xmlChar_ptr(n_elem, (const xmlChar *)elem, 1);
25499         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 2);
25500         xmlResetLastError();
25501         if (mem_base != xmlMemBlocks()) {
25502             printf("Leak of %d blocks found in xmlGetDtdAttrDesc",
25503 	           xmlMemBlocks() - mem_base);
25504 	    test_ret++;
25505             printf(" %d", n_dtd);
25506             printf(" %d", n_elem);
25507             printf(" %d", n_name);
25508             printf("\n");
25509         }
25510     }
25511     }
25512     }
25513     function_tests++;
25514 
25515     return(test_ret);
25516 }
25517 
25518 
25519 static int
test_xmlGetDtdElementDesc(void)25520 test_xmlGetDtdElementDesc(void) {
25521     int test_ret = 0;
25522 
25523     int mem_base;
25524     xmlElementPtr ret_val;
25525     xmlDtdPtr dtd; /* a pointer to the DtD to search */
25526     int n_dtd;
25527     xmlChar * name; /* the element name */
25528     int n_name;
25529 
25530     for (n_dtd = 0;n_dtd < gen_nb_xmlDtdPtr;n_dtd++) {
25531     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
25532         mem_base = xmlMemBlocks();
25533         dtd = gen_xmlDtdPtr(n_dtd, 0);
25534         name = gen_const_xmlChar_ptr(n_name, 1);
25535 
25536         ret_val = xmlGetDtdElementDesc(dtd, (const xmlChar *)name);
25537         desret_xmlElementPtr(ret_val);
25538         call_tests++;
25539         des_xmlDtdPtr(n_dtd, dtd, 0);
25540         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
25541         xmlResetLastError();
25542         if (mem_base != xmlMemBlocks()) {
25543             printf("Leak of %d blocks found in xmlGetDtdElementDesc",
25544 	           xmlMemBlocks() - mem_base);
25545 	    test_ret++;
25546             printf(" %d", n_dtd);
25547             printf(" %d", n_name);
25548             printf("\n");
25549         }
25550     }
25551     }
25552     function_tests++;
25553 
25554     return(test_ret);
25555 }
25556 
25557 
25558 static int
test_xmlGetDtdNotationDesc(void)25559 test_xmlGetDtdNotationDesc(void) {
25560     int test_ret = 0;
25561 
25562 
25563     /* missing type support */
25564     return(test_ret);
25565 }
25566 
25567 
25568 static int
test_xmlGetDtdQAttrDesc(void)25569 test_xmlGetDtdQAttrDesc(void) {
25570     int test_ret = 0;
25571 
25572     int mem_base;
25573     xmlAttributePtr ret_val;
25574     xmlDtdPtr dtd; /* a pointer to the DtD to search */
25575     int n_dtd;
25576     xmlChar * elem; /* the element name */
25577     int n_elem;
25578     xmlChar * name; /* the attribute name */
25579     int n_name;
25580     xmlChar * prefix; /* the attribute namespace prefix */
25581     int n_prefix;
25582 
25583     for (n_dtd = 0;n_dtd < gen_nb_xmlDtdPtr;n_dtd++) {
25584     for (n_elem = 0;n_elem < gen_nb_const_xmlChar_ptr;n_elem++) {
25585     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
25586     for (n_prefix = 0;n_prefix < gen_nb_const_xmlChar_ptr;n_prefix++) {
25587         mem_base = xmlMemBlocks();
25588         dtd = gen_xmlDtdPtr(n_dtd, 0);
25589         elem = gen_const_xmlChar_ptr(n_elem, 1);
25590         name = gen_const_xmlChar_ptr(n_name, 2);
25591         prefix = gen_const_xmlChar_ptr(n_prefix, 3);
25592 
25593         ret_val = xmlGetDtdQAttrDesc(dtd, (const xmlChar *)elem, (const xmlChar *)name, (const xmlChar *)prefix);
25594         desret_xmlAttributePtr(ret_val);
25595         call_tests++;
25596         des_xmlDtdPtr(n_dtd, dtd, 0);
25597         des_const_xmlChar_ptr(n_elem, (const xmlChar *)elem, 1);
25598         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 2);
25599         des_const_xmlChar_ptr(n_prefix, (const xmlChar *)prefix, 3);
25600         xmlResetLastError();
25601         if (mem_base != xmlMemBlocks()) {
25602             printf("Leak of %d blocks found in xmlGetDtdQAttrDesc",
25603 	           xmlMemBlocks() - mem_base);
25604 	    test_ret++;
25605             printf(" %d", n_dtd);
25606             printf(" %d", n_elem);
25607             printf(" %d", n_name);
25608             printf(" %d", n_prefix);
25609             printf("\n");
25610         }
25611     }
25612     }
25613     }
25614     }
25615     function_tests++;
25616 
25617     return(test_ret);
25618 }
25619 
25620 
25621 static int
test_xmlGetDtdQElementDesc(void)25622 test_xmlGetDtdQElementDesc(void) {
25623     int test_ret = 0;
25624 
25625     int mem_base;
25626     xmlElementPtr ret_val;
25627     xmlDtdPtr dtd; /* a pointer to the DtD to search */
25628     int n_dtd;
25629     xmlChar * name; /* the element name */
25630     int n_name;
25631     xmlChar * prefix; /* the element namespace prefix */
25632     int n_prefix;
25633 
25634     for (n_dtd = 0;n_dtd < gen_nb_xmlDtdPtr;n_dtd++) {
25635     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
25636     for (n_prefix = 0;n_prefix < gen_nb_const_xmlChar_ptr;n_prefix++) {
25637         mem_base = xmlMemBlocks();
25638         dtd = gen_xmlDtdPtr(n_dtd, 0);
25639         name = gen_const_xmlChar_ptr(n_name, 1);
25640         prefix = gen_const_xmlChar_ptr(n_prefix, 2);
25641 
25642         ret_val = xmlGetDtdQElementDesc(dtd, (const xmlChar *)name, (const xmlChar *)prefix);
25643         desret_xmlElementPtr(ret_val);
25644         call_tests++;
25645         des_xmlDtdPtr(n_dtd, dtd, 0);
25646         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
25647         des_const_xmlChar_ptr(n_prefix, (const xmlChar *)prefix, 2);
25648         xmlResetLastError();
25649         if (mem_base != xmlMemBlocks()) {
25650             printf("Leak of %d blocks found in xmlGetDtdQElementDesc",
25651 	           xmlMemBlocks() - mem_base);
25652 	    test_ret++;
25653             printf(" %d", n_dtd);
25654             printf(" %d", n_name);
25655             printf(" %d", n_prefix);
25656             printf("\n");
25657         }
25658     }
25659     }
25660     }
25661     function_tests++;
25662 
25663     return(test_ret);
25664 }
25665 
25666 
25667 static int
test_xmlGetID(void)25668 test_xmlGetID(void) {
25669     int test_ret = 0;
25670 
25671     int mem_base;
25672     xmlAttrPtr ret_val;
25673     xmlDocPtr doc; /* pointer to the document */
25674     int n_doc;
25675     xmlChar * ID; /* the ID value */
25676     int n_ID;
25677 
25678     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
25679     for (n_ID = 0;n_ID < gen_nb_const_xmlChar_ptr;n_ID++) {
25680         mem_base = xmlMemBlocks();
25681         doc = gen_xmlDocPtr(n_doc, 0);
25682         ID = gen_const_xmlChar_ptr(n_ID, 1);
25683 
25684         ret_val = xmlGetID(doc, (const xmlChar *)ID);
25685         desret_xmlAttrPtr(ret_val);
25686         call_tests++;
25687         des_xmlDocPtr(n_doc, doc, 0);
25688         des_const_xmlChar_ptr(n_ID, (const xmlChar *)ID, 1);
25689         xmlResetLastError();
25690         if (mem_base != xmlMemBlocks()) {
25691             printf("Leak of %d blocks found in xmlGetID",
25692 	           xmlMemBlocks() - mem_base);
25693 	    test_ret++;
25694             printf(" %d", n_doc);
25695             printf(" %d", n_ID);
25696             printf("\n");
25697         }
25698     }
25699     }
25700     function_tests++;
25701 
25702     return(test_ret);
25703 }
25704 
25705 
25706 static int
test_xmlGetRefs(void)25707 test_xmlGetRefs(void) {
25708     int test_ret = 0;
25709 
25710 
25711     /* missing type support */
25712     return(test_ret);
25713 }
25714 
25715 
25716 static int
test_xmlIsID(void)25717 test_xmlIsID(void) {
25718     int test_ret = 0;
25719 
25720     int mem_base;
25721     int ret_val;
25722     xmlDocPtr doc; /* the document */
25723     int n_doc;
25724     xmlNodePtr elem; /* the element carrying the attribute */
25725     int n_elem;
25726     xmlAttrPtr attr; /* the attribute */
25727     int n_attr;
25728 
25729     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
25730     for (n_elem = 0;n_elem < gen_nb_xmlNodePtr;n_elem++) {
25731     for (n_attr = 0;n_attr < gen_nb_xmlAttrPtr;n_attr++) {
25732         mem_base = xmlMemBlocks();
25733         doc = gen_xmlDocPtr(n_doc, 0);
25734         elem = gen_xmlNodePtr(n_elem, 1);
25735         attr = gen_xmlAttrPtr(n_attr, 2);
25736 
25737         ret_val = xmlIsID(doc, elem, attr);
25738         desret_int(ret_val);
25739         call_tests++;
25740         des_xmlDocPtr(n_doc, doc, 0);
25741         des_xmlNodePtr(n_elem, elem, 1);
25742         des_xmlAttrPtr(n_attr, attr, 2);
25743         xmlResetLastError();
25744         if (mem_base != xmlMemBlocks()) {
25745             printf("Leak of %d blocks found in xmlIsID",
25746 	           xmlMemBlocks() - mem_base);
25747 	    test_ret++;
25748             printf(" %d", n_doc);
25749             printf(" %d", n_elem);
25750             printf(" %d", n_attr);
25751             printf("\n");
25752         }
25753     }
25754     }
25755     }
25756     function_tests++;
25757 
25758     return(test_ret);
25759 }
25760 
25761 
25762 static int
test_xmlIsMixedElement(void)25763 test_xmlIsMixedElement(void) {
25764     int test_ret = 0;
25765 
25766     int mem_base;
25767     int ret_val;
25768     xmlDocPtr doc; /* the document */
25769     int n_doc;
25770     xmlChar * name; /* the element name */
25771     int n_name;
25772 
25773     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
25774     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
25775         mem_base = xmlMemBlocks();
25776         doc = gen_xmlDocPtr(n_doc, 0);
25777         name = gen_const_xmlChar_ptr(n_name, 1);
25778 
25779         ret_val = xmlIsMixedElement(doc, (const xmlChar *)name);
25780         desret_int(ret_val);
25781         call_tests++;
25782         des_xmlDocPtr(n_doc, doc, 0);
25783         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
25784         xmlResetLastError();
25785         if (mem_base != xmlMemBlocks()) {
25786             printf("Leak of %d blocks found in xmlIsMixedElement",
25787 	           xmlMemBlocks() - mem_base);
25788 	    test_ret++;
25789             printf(" %d", n_doc);
25790             printf(" %d", n_name);
25791             printf("\n");
25792         }
25793     }
25794     }
25795     function_tests++;
25796 
25797     return(test_ret);
25798 }
25799 
25800 
25801 static int
test_xmlIsRef(void)25802 test_xmlIsRef(void) {
25803     int test_ret = 0;
25804 
25805     int mem_base;
25806     int ret_val;
25807     xmlDocPtr doc; /* the document */
25808     int n_doc;
25809     xmlNodePtr elem; /* the element carrying the attribute */
25810     int n_elem;
25811     xmlAttrPtr attr; /* the attribute */
25812     int n_attr;
25813 
25814     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
25815     for (n_elem = 0;n_elem < gen_nb_xmlNodePtr;n_elem++) {
25816     for (n_attr = 0;n_attr < gen_nb_xmlAttrPtr;n_attr++) {
25817         mem_base = xmlMemBlocks();
25818         doc = gen_xmlDocPtr(n_doc, 0);
25819         elem = gen_xmlNodePtr(n_elem, 1);
25820         attr = gen_xmlAttrPtr(n_attr, 2);
25821 
25822         ret_val = xmlIsRef(doc, elem, attr);
25823         desret_int(ret_val);
25824         call_tests++;
25825         des_xmlDocPtr(n_doc, doc, 0);
25826         des_xmlNodePtr(n_elem, elem, 1);
25827         des_xmlAttrPtr(n_attr, attr, 2);
25828         xmlResetLastError();
25829         if (mem_base != xmlMemBlocks()) {
25830             printf("Leak of %d blocks found in xmlIsRef",
25831 	           xmlMemBlocks() - mem_base);
25832 	    test_ret++;
25833             printf(" %d", n_doc);
25834             printf(" %d", n_elem);
25835             printf(" %d", n_attr);
25836             printf("\n");
25837         }
25838     }
25839     }
25840     }
25841     function_tests++;
25842 
25843     return(test_ret);
25844 }
25845 
25846 
25847 static int
test_xmlNewDocElementContent(void)25848 test_xmlNewDocElementContent(void) {
25849     int test_ret = 0;
25850 
25851     int mem_base;
25852     xmlElementContentPtr ret_val;
25853     xmlDocPtr doc; /* the document */
25854     int n_doc;
25855     xmlChar * name; /* the subelement name or NULL */
25856     int n_name;
25857     xmlElementContentType type; /* the type of element content decl */
25858     int n_type;
25859 
25860     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
25861     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
25862     for (n_type = 0;n_type < gen_nb_xmlElementContentType;n_type++) {
25863         mem_base = xmlMemBlocks();
25864         doc = gen_xmlDocPtr(n_doc, 0);
25865         name = gen_const_xmlChar_ptr(n_name, 1);
25866         type = gen_xmlElementContentType(n_type, 2);
25867 
25868         ret_val = xmlNewDocElementContent(doc, (const xmlChar *)name, type);
25869         xmlFreeDocElementContent(doc, ret_val); ret_val = NULL;
25870         desret_xmlElementContentPtr(ret_val);
25871         call_tests++;
25872         des_xmlDocPtr(n_doc, doc, 0);
25873         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
25874         des_xmlElementContentType(n_type, type, 2);
25875         xmlResetLastError();
25876         if (mem_base != xmlMemBlocks()) {
25877             printf("Leak of %d blocks found in xmlNewDocElementContent",
25878 	           xmlMemBlocks() - mem_base);
25879 	    test_ret++;
25880             printf(" %d", n_doc);
25881             printf(" %d", n_name);
25882             printf(" %d", n_type);
25883             printf("\n");
25884         }
25885     }
25886     }
25887     }
25888     function_tests++;
25889 
25890     return(test_ret);
25891 }
25892 
25893 
25894 static int
test_xmlNewElementContent(void)25895 test_xmlNewElementContent(void) {
25896     int test_ret = 0;
25897 
25898     int mem_base;
25899     xmlElementContentPtr ret_val;
25900     xmlChar * name; /* the subelement name or NULL */
25901     int n_name;
25902     xmlElementContentType type; /* the type of element content decl */
25903     int n_type;
25904 
25905     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
25906     for (n_type = 0;n_type < gen_nb_xmlElementContentType;n_type++) {
25907         mem_base = xmlMemBlocks();
25908         name = gen_const_xmlChar_ptr(n_name, 0);
25909         type = gen_xmlElementContentType(n_type, 1);
25910 
25911         ret_val = xmlNewElementContent((const xmlChar *)name, type);
25912         desret_xmlElementContentPtr(ret_val);
25913         call_tests++;
25914         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 0);
25915         des_xmlElementContentType(n_type, type, 1);
25916         xmlResetLastError();
25917         if (mem_base != xmlMemBlocks()) {
25918             printf("Leak of %d blocks found in xmlNewElementContent",
25919 	           xmlMemBlocks() - mem_base);
25920 	    test_ret++;
25921             printf(" %d", n_name);
25922             printf(" %d", n_type);
25923             printf("\n");
25924         }
25925     }
25926     }
25927     function_tests++;
25928 
25929     return(test_ret);
25930 }
25931 
25932 
25933 static int
test_xmlNewValidCtxt(void)25934 test_xmlNewValidCtxt(void) {
25935     int test_ret = 0;
25936 
25937 
25938     /* missing type support */
25939     return(test_ret);
25940 }
25941 
25942 
25943 static int
test_xmlRemoveID(void)25944 test_xmlRemoveID(void) {
25945     int test_ret = 0;
25946 
25947     int mem_base;
25948     int ret_val;
25949     xmlDocPtr doc; /* the document */
25950     int n_doc;
25951     xmlAttrPtr attr; /* the attribute */
25952     int n_attr;
25953 
25954     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
25955     for (n_attr = 0;n_attr < gen_nb_xmlAttrPtr;n_attr++) {
25956         mem_base = xmlMemBlocks();
25957         doc = gen_xmlDocPtr(n_doc, 0);
25958         attr = gen_xmlAttrPtr(n_attr, 1);
25959 
25960         ret_val = xmlRemoveID(doc, attr);
25961         desret_int(ret_val);
25962         call_tests++;
25963         des_xmlDocPtr(n_doc, doc, 0);
25964         des_xmlAttrPtr(n_attr, attr, 1);
25965         xmlResetLastError();
25966         if (mem_base != xmlMemBlocks()) {
25967             printf("Leak of %d blocks found in xmlRemoveID",
25968 	           xmlMemBlocks() - mem_base);
25969 	    test_ret++;
25970             printf(" %d", n_doc);
25971             printf(" %d", n_attr);
25972             printf("\n");
25973         }
25974     }
25975     }
25976     function_tests++;
25977 
25978     return(test_ret);
25979 }
25980 
25981 
25982 static int
test_xmlRemoveRef(void)25983 test_xmlRemoveRef(void) {
25984     int test_ret = 0;
25985 
25986     int mem_base;
25987     int ret_val;
25988     xmlDocPtr doc; /* the document */
25989     int n_doc;
25990     xmlAttrPtr attr; /* the attribute */
25991     int n_attr;
25992 
25993     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
25994     for (n_attr = 0;n_attr < gen_nb_xmlAttrPtr;n_attr++) {
25995         mem_base = xmlMemBlocks();
25996         doc = gen_xmlDocPtr(n_doc, 0);
25997         attr = gen_xmlAttrPtr(n_attr, 1);
25998 
25999         ret_val = xmlRemoveRef(doc, attr);
26000         desret_int(ret_val);
26001         call_tests++;
26002         des_xmlDocPtr(n_doc, doc, 0);
26003         des_xmlAttrPtr(n_attr, attr, 1);
26004         xmlResetLastError();
26005         if (mem_base != xmlMemBlocks()) {
26006             printf("Leak of %d blocks found in xmlRemoveRef",
26007 	           xmlMemBlocks() - mem_base);
26008 	    test_ret++;
26009             printf(" %d", n_doc);
26010             printf(" %d", n_attr);
26011             printf("\n");
26012         }
26013     }
26014     }
26015     function_tests++;
26016 
26017     return(test_ret);
26018 }
26019 
26020 
26021 static int
test_xmlSnprintfElementContent(void)26022 test_xmlSnprintfElementContent(void) {
26023     int test_ret = 0;
26024 
26025     int mem_base;
26026     char * buf; /* an output buffer */
26027     int n_buf;
26028     int size; /* the buffer size */
26029     int n_size;
26030     xmlElementContentPtr content; /* An element table */
26031     int n_content;
26032     int englob; /* 1 if one must print the englobing parenthesis, 0 otherwise */
26033     int n_englob;
26034 
26035     for (n_buf = 0;n_buf < gen_nb_char_ptr;n_buf++) {
26036     for (n_size = 0;n_size < gen_nb_int;n_size++) {
26037     for (n_content = 0;n_content < gen_nb_xmlElementContentPtr;n_content++) {
26038     for (n_englob = 0;n_englob < gen_nb_int;n_englob++) {
26039         mem_base = xmlMemBlocks();
26040         buf = gen_char_ptr(n_buf, 0);
26041         size = gen_int(n_size, 1);
26042         content = gen_xmlElementContentPtr(n_content, 2);
26043         englob = gen_int(n_englob, 3);
26044 
26045         xmlSnprintfElementContent(buf, size, content, englob);
26046         call_tests++;
26047         des_char_ptr(n_buf, buf, 0);
26048         des_int(n_size, size, 1);
26049         des_xmlElementContentPtr(n_content, content, 2);
26050         des_int(n_englob, englob, 3);
26051         xmlResetLastError();
26052         if (mem_base != xmlMemBlocks()) {
26053             printf("Leak of %d blocks found in xmlSnprintfElementContent",
26054 	           xmlMemBlocks() - mem_base);
26055 	    test_ret++;
26056             printf(" %d", n_buf);
26057             printf(" %d", n_size);
26058             printf(" %d", n_content);
26059             printf(" %d", n_englob);
26060             printf("\n");
26061         }
26062     }
26063     }
26064     }
26065     }
26066     function_tests++;
26067 
26068     return(test_ret);
26069 }
26070 
26071 
26072 static int
test_xmlSprintfElementContent(void)26073 test_xmlSprintfElementContent(void) {
26074     int test_ret = 0;
26075 
26076 #if defined(LIBXML_OUTPUT_ENABLED)
26077 #ifdef LIBXML_OUTPUT_ENABLED
26078     int mem_base;
26079     char * buf; /* an output buffer */
26080     int n_buf;
26081     xmlElementContentPtr content; /* An element table */
26082     int n_content;
26083     int englob; /* 1 if one must print the englobing parenthesis, 0 otherwise */
26084     int n_englob;
26085 
26086     for (n_buf = 0;n_buf < gen_nb_char_ptr;n_buf++) {
26087     for (n_content = 0;n_content < gen_nb_xmlElementContentPtr;n_content++) {
26088     for (n_englob = 0;n_englob < gen_nb_int;n_englob++) {
26089         mem_base = xmlMemBlocks();
26090         buf = gen_char_ptr(n_buf, 0);
26091         content = gen_xmlElementContentPtr(n_content, 1);
26092         englob = gen_int(n_englob, 2);
26093 
26094         xmlSprintfElementContent(buf, content, englob);
26095         call_tests++;
26096         des_char_ptr(n_buf, buf, 0);
26097         des_xmlElementContentPtr(n_content, content, 1);
26098         des_int(n_englob, englob, 2);
26099         xmlResetLastError();
26100         if (mem_base != xmlMemBlocks()) {
26101             printf("Leak of %d blocks found in xmlSprintfElementContent",
26102 	           xmlMemBlocks() - mem_base);
26103 	    test_ret++;
26104             printf(" %d", n_buf);
26105             printf(" %d", n_content);
26106             printf(" %d", n_englob);
26107             printf("\n");
26108         }
26109     }
26110     }
26111     }
26112     function_tests++;
26113 #endif
26114 #endif
26115 
26116     return(test_ret);
26117 }
26118 
26119 
26120 static int
test_xmlValidBuildContentModel(void)26121 test_xmlValidBuildContentModel(void) {
26122     int test_ret = 0;
26123 
26124 #if defined(LIBXML_VALID_ENABLED) && defined(LIBXML_REGEXP_ENABLED)
26125     int mem_base;
26126     int ret_val;
26127     xmlValidCtxtPtr ctxt; /* a validation context */
26128     int n_ctxt;
26129     xmlElementPtr elem; /* an element declaration node */
26130     int n_elem;
26131 
26132     for (n_ctxt = 0;n_ctxt < gen_nb_xmlValidCtxtPtr;n_ctxt++) {
26133     for (n_elem = 0;n_elem < gen_nb_xmlElementPtr;n_elem++) {
26134         mem_base = xmlMemBlocks();
26135         ctxt = gen_xmlValidCtxtPtr(n_ctxt, 0);
26136         elem = gen_xmlElementPtr(n_elem, 1);
26137 
26138         ret_val = xmlValidBuildContentModel(ctxt, elem);
26139         desret_int(ret_val);
26140         call_tests++;
26141         des_xmlValidCtxtPtr(n_ctxt, ctxt, 0);
26142         des_xmlElementPtr(n_elem, elem, 1);
26143         xmlResetLastError();
26144         if (mem_base != xmlMemBlocks()) {
26145             printf("Leak of %d blocks found in xmlValidBuildContentModel",
26146 	           xmlMemBlocks() - mem_base);
26147 	    test_ret++;
26148             printf(" %d", n_ctxt);
26149             printf(" %d", n_elem);
26150             printf("\n");
26151         }
26152     }
26153     }
26154     function_tests++;
26155 #endif
26156 
26157     return(test_ret);
26158 }
26159 
26160 
26161 static int
test_xmlValidCtxtNormalizeAttributeValue(void)26162 test_xmlValidCtxtNormalizeAttributeValue(void) {
26163     int test_ret = 0;
26164 
26165 #if defined(LIBXML_VALID_ENABLED)
26166     int mem_base;
26167     xmlChar * ret_val;
26168     xmlValidCtxtPtr ctxt; /* the validation context or NULL */
26169     int n_ctxt;
26170     xmlDocPtr doc; /* the document */
26171     int n_doc;
26172     xmlNodePtr elem; /* the parent */
26173     int n_elem;
26174     xmlChar * name; /* the attribute name */
26175     int n_name;
26176     xmlChar * value; /* the attribute value */
26177     int n_value;
26178 
26179     for (n_ctxt = 0;n_ctxt < gen_nb_xmlValidCtxtPtr;n_ctxt++) {
26180     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
26181     for (n_elem = 0;n_elem < gen_nb_xmlNodePtr;n_elem++) {
26182     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
26183     for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
26184         mem_base = xmlMemBlocks();
26185         ctxt = gen_xmlValidCtxtPtr(n_ctxt, 0);
26186         doc = gen_xmlDocPtr(n_doc, 1);
26187         elem = gen_xmlNodePtr(n_elem, 2);
26188         name = gen_const_xmlChar_ptr(n_name, 3);
26189         value = gen_const_xmlChar_ptr(n_value, 4);
26190 
26191         ret_val = xmlValidCtxtNormalizeAttributeValue(ctxt, doc, elem, (const xmlChar *)name, (const xmlChar *)value);
26192         desret_xmlChar_ptr(ret_val);
26193         call_tests++;
26194         des_xmlValidCtxtPtr(n_ctxt, ctxt, 0);
26195         des_xmlDocPtr(n_doc, doc, 1);
26196         des_xmlNodePtr(n_elem, elem, 2);
26197         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 3);
26198         des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 4);
26199         xmlResetLastError();
26200         if (mem_base != xmlMemBlocks()) {
26201             printf("Leak of %d blocks found in xmlValidCtxtNormalizeAttributeValue",
26202 	           xmlMemBlocks() - mem_base);
26203 	    test_ret++;
26204             printf(" %d", n_ctxt);
26205             printf(" %d", n_doc);
26206             printf(" %d", n_elem);
26207             printf(" %d", n_name);
26208             printf(" %d", n_value);
26209             printf("\n");
26210         }
26211     }
26212     }
26213     }
26214     }
26215     }
26216     function_tests++;
26217 #endif
26218 
26219     return(test_ret);
26220 }
26221 
26222 
26223 #define gen_nb_xmlElementContent_ptr 1
gen_xmlElementContent_ptr(int no ATTRIBUTE_UNUSED,int nr ATTRIBUTE_UNUSED)26224 static xmlElementContent * gen_xmlElementContent_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
26225     return(NULL);
26226 }
des_xmlElementContent_ptr(int no ATTRIBUTE_UNUSED,xmlElementContent * val ATTRIBUTE_UNUSED,int nr ATTRIBUTE_UNUSED)26227 static void des_xmlElementContent_ptr(int no ATTRIBUTE_UNUSED, xmlElementContent * val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
26228 }
26229 
26230 static int
test_xmlValidGetPotentialChildren(void)26231 test_xmlValidGetPotentialChildren(void) {
26232     int test_ret = 0;
26233 
26234 #if defined(LIBXML_VALID_ENABLED)
26235 #ifdef LIBXML_VALID_ENABLED
26236     int mem_base;
26237     int ret_val;
26238     xmlElementContent * ctree; /* an element content tree */
26239     int n_ctree;
26240     xmlChar ** names; /* an array to store the list of child names */
26241     int n_names;
26242     int * len; /* a pointer to the number of element in the list */
26243     int n_len;
26244     int max; /* the size of the array */
26245     int n_max;
26246 
26247     for (n_ctree = 0;n_ctree < gen_nb_xmlElementContent_ptr;n_ctree++) {
26248     for (n_names = 0;n_names < gen_nb_const_xmlChar_ptr_ptr;n_names++) {
26249     for (n_len = 0;n_len < gen_nb_int_ptr;n_len++) {
26250     for (n_max = 0;n_max < gen_nb_int;n_max++) {
26251         mem_base = xmlMemBlocks();
26252         ctree = gen_xmlElementContent_ptr(n_ctree, 0);
26253         names = gen_const_xmlChar_ptr_ptr(n_names, 1);
26254         len = gen_int_ptr(n_len, 2);
26255         max = gen_int(n_max, 3);
26256 
26257         ret_val = xmlValidGetPotentialChildren(ctree, (const xmlChar **)names, len, max);
26258         desret_int(ret_val);
26259         call_tests++;
26260         des_xmlElementContent_ptr(n_ctree, ctree, 0);
26261         des_const_xmlChar_ptr_ptr(n_names, (const xmlChar **)names, 1);
26262         des_int_ptr(n_len, len, 2);
26263         des_int(n_max, max, 3);
26264         xmlResetLastError();
26265         if (mem_base != xmlMemBlocks()) {
26266             printf("Leak of %d blocks found in xmlValidGetPotentialChildren",
26267 	           xmlMemBlocks() - mem_base);
26268 	    test_ret++;
26269             printf(" %d", n_ctree);
26270             printf(" %d", n_names);
26271             printf(" %d", n_len);
26272             printf(" %d", n_max);
26273             printf("\n");
26274         }
26275     }
26276     }
26277     }
26278     }
26279     function_tests++;
26280 #endif
26281 #endif
26282 
26283     return(test_ret);
26284 }
26285 
26286 
26287 static int
test_xmlValidGetValidElements(void)26288 test_xmlValidGetValidElements(void) {
26289     int test_ret = 0;
26290 
26291 #if defined(LIBXML_VALID_ENABLED)
26292 #ifdef LIBXML_VALID_ENABLED
26293     int mem_base;
26294     int ret_val;
26295     xmlNode * prev; /* an element to insert after */
26296     int n_prev;
26297     xmlNode * next; /* an element to insert next */
26298     int n_next;
26299     xmlChar ** names; /* an array to store the list of child names */
26300     int n_names;
26301     int max; /* the size of the array */
26302     int n_max;
26303 
26304     for (n_prev = 0;n_prev < gen_nb_xmlNodePtr;n_prev++) {
26305     for (n_next = 0;n_next < gen_nb_xmlNodePtr;n_next++) {
26306     for (n_names = 0;n_names < gen_nb_const_xmlChar_ptr_ptr;n_names++) {
26307     for (n_max = 0;n_max < gen_nb_int;n_max++) {
26308         mem_base = xmlMemBlocks();
26309         prev = gen_xmlNodePtr(n_prev, 0);
26310         next = gen_xmlNodePtr(n_next, 1);
26311         names = gen_const_xmlChar_ptr_ptr(n_names, 2);
26312         max = gen_int(n_max, 3);
26313 
26314         ret_val = xmlValidGetValidElements(prev, next, (const xmlChar **)names, max);
26315         desret_int(ret_val);
26316         call_tests++;
26317         des_xmlNodePtr(n_prev, prev, 0);
26318         des_xmlNodePtr(n_next, next, 1);
26319         des_const_xmlChar_ptr_ptr(n_names, (const xmlChar **)names, 2);
26320         des_int(n_max, max, 3);
26321         xmlResetLastError();
26322         if (mem_base != xmlMemBlocks()) {
26323             printf("Leak of %d blocks found in xmlValidGetValidElements",
26324 	           xmlMemBlocks() - mem_base);
26325 	    test_ret++;
26326             printf(" %d", n_prev);
26327             printf(" %d", n_next);
26328             printf(" %d", n_names);
26329             printf(" %d", n_max);
26330             printf("\n");
26331         }
26332     }
26333     }
26334     }
26335     }
26336     function_tests++;
26337 #endif
26338 #endif
26339 
26340     return(test_ret);
26341 }
26342 
26343 
26344 static int
test_xmlValidNormalizeAttributeValue(void)26345 test_xmlValidNormalizeAttributeValue(void) {
26346     int test_ret = 0;
26347 
26348 #if defined(LIBXML_VALID_ENABLED)
26349     int mem_base;
26350     xmlChar * ret_val;
26351     xmlDocPtr doc; /* the document */
26352     int n_doc;
26353     xmlNodePtr elem; /* the parent */
26354     int n_elem;
26355     xmlChar * name; /* the attribute name */
26356     int n_name;
26357     xmlChar * value; /* the attribute value */
26358     int n_value;
26359 
26360     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
26361     for (n_elem = 0;n_elem < gen_nb_xmlNodePtr;n_elem++) {
26362     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
26363     for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
26364         mem_base = xmlMemBlocks();
26365         doc = gen_xmlDocPtr(n_doc, 0);
26366         elem = gen_xmlNodePtr(n_elem, 1);
26367         name = gen_const_xmlChar_ptr(n_name, 2);
26368         value = gen_const_xmlChar_ptr(n_value, 3);
26369 
26370         ret_val = xmlValidNormalizeAttributeValue(doc, elem, (const xmlChar *)name, (const xmlChar *)value);
26371         desret_xmlChar_ptr(ret_val);
26372         call_tests++;
26373         des_xmlDocPtr(n_doc, doc, 0);
26374         des_xmlNodePtr(n_elem, elem, 1);
26375         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 2);
26376         des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 3);
26377         xmlResetLastError();
26378         if (mem_base != xmlMemBlocks()) {
26379             printf("Leak of %d blocks found in xmlValidNormalizeAttributeValue",
26380 	           xmlMemBlocks() - mem_base);
26381 	    test_ret++;
26382             printf(" %d", n_doc);
26383             printf(" %d", n_elem);
26384             printf(" %d", n_name);
26385             printf(" %d", n_value);
26386             printf("\n");
26387         }
26388     }
26389     }
26390     }
26391     }
26392     function_tests++;
26393 #endif
26394 
26395     return(test_ret);
26396 }
26397 
26398 
26399 static int
test_xmlValidateAttributeDecl(void)26400 test_xmlValidateAttributeDecl(void) {
26401     int test_ret = 0;
26402 
26403 #if defined(LIBXML_VALID_ENABLED)
26404     int mem_base;
26405     int ret_val;
26406     xmlValidCtxtPtr ctxt; /* the validation context */
26407     int n_ctxt;
26408     xmlDocPtr doc; /* a document instance */
26409     int n_doc;
26410     xmlAttributePtr attr; /* an attribute definition */
26411     int n_attr;
26412 
26413     for (n_ctxt = 0;n_ctxt < gen_nb_xmlValidCtxtPtr;n_ctxt++) {
26414     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
26415     for (n_attr = 0;n_attr < gen_nb_xmlAttributePtr;n_attr++) {
26416         mem_base = xmlMemBlocks();
26417         ctxt = gen_xmlValidCtxtPtr(n_ctxt, 0);
26418         doc = gen_xmlDocPtr(n_doc, 1);
26419         attr = gen_xmlAttributePtr(n_attr, 2);
26420 
26421         ret_val = xmlValidateAttributeDecl(ctxt, doc, attr);
26422         desret_int(ret_val);
26423         call_tests++;
26424         des_xmlValidCtxtPtr(n_ctxt, ctxt, 0);
26425         des_xmlDocPtr(n_doc, doc, 1);
26426         des_xmlAttributePtr(n_attr, attr, 2);
26427         xmlResetLastError();
26428         if (mem_base != xmlMemBlocks()) {
26429             printf("Leak of %d blocks found in xmlValidateAttributeDecl",
26430 	           xmlMemBlocks() - mem_base);
26431 	    test_ret++;
26432             printf(" %d", n_ctxt);
26433             printf(" %d", n_doc);
26434             printf(" %d", n_attr);
26435             printf("\n");
26436         }
26437     }
26438     }
26439     }
26440     function_tests++;
26441 #endif
26442 
26443     return(test_ret);
26444 }
26445 
26446 
26447 static int
test_xmlValidateAttributeValue(void)26448 test_xmlValidateAttributeValue(void) {
26449     int test_ret = 0;
26450 
26451 #if defined(LIBXML_VALID_ENABLED)
26452     int mem_base;
26453     int ret_val;
26454     xmlAttributeType type; /* an attribute type */
26455     int n_type;
26456     xmlChar * value; /* an attribute value */
26457     int n_value;
26458 
26459     for (n_type = 0;n_type < gen_nb_xmlAttributeType;n_type++) {
26460     for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
26461         mem_base = xmlMemBlocks();
26462         type = gen_xmlAttributeType(n_type, 0);
26463         value = gen_const_xmlChar_ptr(n_value, 1);
26464 
26465         ret_val = xmlValidateAttributeValue(type, (const xmlChar *)value);
26466         desret_int(ret_val);
26467         call_tests++;
26468         des_xmlAttributeType(n_type, type, 0);
26469         des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 1);
26470         xmlResetLastError();
26471         if (mem_base != xmlMemBlocks()) {
26472             printf("Leak of %d blocks found in xmlValidateAttributeValue",
26473 	           xmlMemBlocks() - mem_base);
26474 	    test_ret++;
26475             printf(" %d", n_type);
26476             printf(" %d", n_value);
26477             printf("\n");
26478         }
26479     }
26480     }
26481     function_tests++;
26482 #endif
26483 
26484     return(test_ret);
26485 }
26486 
26487 
26488 static int
test_xmlValidateDocument(void)26489 test_xmlValidateDocument(void) {
26490     int test_ret = 0;
26491 
26492 #if defined(LIBXML_VALID_ENABLED)
26493     int mem_base;
26494     int ret_val;
26495     xmlValidCtxtPtr ctxt; /* the validation context */
26496     int n_ctxt;
26497     xmlDocPtr doc; /* a document instance */
26498     int n_doc;
26499 
26500     for (n_ctxt = 0;n_ctxt < gen_nb_xmlValidCtxtPtr;n_ctxt++) {
26501     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
26502         mem_base = xmlMemBlocks();
26503         ctxt = gen_xmlValidCtxtPtr(n_ctxt, 0);
26504         doc = gen_xmlDocPtr(n_doc, 1);
26505 
26506         ret_val = xmlValidateDocument(ctxt, doc);
26507         desret_int(ret_val);
26508         call_tests++;
26509         des_xmlValidCtxtPtr(n_ctxt, ctxt, 0);
26510         des_xmlDocPtr(n_doc, doc, 1);
26511         xmlResetLastError();
26512         if (mem_base != xmlMemBlocks()) {
26513             printf("Leak of %d blocks found in xmlValidateDocument",
26514 	           xmlMemBlocks() - mem_base);
26515 	    test_ret++;
26516             printf(" %d", n_ctxt);
26517             printf(" %d", n_doc);
26518             printf("\n");
26519         }
26520     }
26521     }
26522     function_tests++;
26523 #endif
26524 
26525     return(test_ret);
26526 }
26527 
26528 
26529 static int
test_xmlValidateDocumentFinal(void)26530 test_xmlValidateDocumentFinal(void) {
26531     int test_ret = 0;
26532 
26533 #if defined(LIBXML_VALID_ENABLED)
26534     int mem_base;
26535     int ret_val;
26536     xmlValidCtxtPtr ctxt; /* the validation context */
26537     int n_ctxt;
26538     xmlDocPtr doc; /* a document instance */
26539     int n_doc;
26540 
26541     for (n_ctxt = 0;n_ctxt < gen_nb_xmlValidCtxtPtr;n_ctxt++) {
26542     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
26543         mem_base = xmlMemBlocks();
26544         ctxt = gen_xmlValidCtxtPtr(n_ctxt, 0);
26545         doc = gen_xmlDocPtr(n_doc, 1);
26546 
26547         ret_val = xmlValidateDocumentFinal(ctxt, doc);
26548         desret_int(ret_val);
26549         call_tests++;
26550         des_xmlValidCtxtPtr(n_ctxt, ctxt, 0);
26551         des_xmlDocPtr(n_doc, doc, 1);
26552         xmlResetLastError();
26553         if (mem_base != xmlMemBlocks()) {
26554             printf("Leak of %d blocks found in xmlValidateDocumentFinal",
26555 	           xmlMemBlocks() - mem_base);
26556 	    test_ret++;
26557             printf(" %d", n_ctxt);
26558             printf(" %d", n_doc);
26559             printf("\n");
26560         }
26561     }
26562     }
26563     function_tests++;
26564 #endif
26565 
26566     return(test_ret);
26567 }
26568 
26569 
26570 static int
test_xmlValidateDtd(void)26571 test_xmlValidateDtd(void) {
26572     int test_ret = 0;
26573 
26574 #if defined(LIBXML_VALID_ENABLED)
26575     int mem_base;
26576     int ret_val;
26577     xmlValidCtxtPtr ctxt; /* the validation context */
26578     int n_ctxt;
26579     xmlDocPtr doc; /* a document instance */
26580     int n_doc;
26581     xmlDtdPtr dtd; /* a dtd instance */
26582     int n_dtd;
26583 
26584     for (n_ctxt = 0;n_ctxt < gen_nb_xmlValidCtxtPtr;n_ctxt++) {
26585     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
26586     for (n_dtd = 0;n_dtd < gen_nb_xmlDtdPtr;n_dtd++) {
26587         mem_base = xmlMemBlocks();
26588         ctxt = gen_xmlValidCtxtPtr(n_ctxt, 0);
26589         doc = gen_xmlDocPtr(n_doc, 1);
26590         dtd = gen_xmlDtdPtr(n_dtd, 2);
26591 
26592         ret_val = xmlValidateDtd(ctxt, doc, dtd);
26593         desret_int(ret_val);
26594         call_tests++;
26595         des_xmlValidCtxtPtr(n_ctxt, ctxt, 0);
26596         des_xmlDocPtr(n_doc, doc, 1);
26597         des_xmlDtdPtr(n_dtd, dtd, 2);
26598         xmlResetLastError();
26599         if (mem_base != xmlMemBlocks()) {
26600             printf("Leak of %d blocks found in xmlValidateDtd",
26601 	           xmlMemBlocks() - mem_base);
26602 	    test_ret++;
26603             printf(" %d", n_ctxt);
26604             printf(" %d", n_doc);
26605             printf(" %d", n_dtd);
26606             printf("\n");
26607         }
26608     }
26609     }
26610     }
26611     function_tests++;
26612 #endif
26613 
26614     return(test_ret);
26615 }
26616 
26617 
26618 static int
test_xmlValidateDtdFinal(void)26619 test_xmlValidateDtdFinal(void) {
26620     int test_ret = 0;
26621 
26622 #if defined(LIBXML_VALID_ENABLED)
26623     int mem_base;
26624     int ret_val;
26625     xmlValidCtxtPtr ctxt; /* the validation context */
26626     int n_ctxt;
26627     xmlDocPtr doc; /* a document instance */
26628     int n_doc;
26629 
26630     for (n_ctxt = 0;n_ctxt < gen_nb_xmlValidCtxtPtr;n_ctxt++) {
26631     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
26632         mem_base = xmlMemBlocks();
26633         ctxt = gen_xmlValidCtxtPtr(n_ctxt, 0);
26634         doc = gen_xmlDocPtr(n_doc, 1);
26635 
26636         ret_val = xmlValidateDtdFinal(ctxt, doc);
26637         desret_int(ret_val);
26638         call_tests++;
26639         des_xmlValidCtxtPtr(n_ctxt, ctxt, 0);
26640         des_xmlDocPtr(n_doc, doc, 1);
26641         xmlResetLastError();
26642         if (mem_base != xmlMemBlocks()) {
26643             printf("Leak of %d blocks found in xmlValidateDtdFinal",
26644 	           xmlMemBlocks() - mem_base);
26645 	    test_ret++;
26646             printf(" %d", n_ctxt);
26647             printf(" %d", n_doc);
26648             printf("\n");
26649         }
26650     }
26651     }
26652     function_tests++;
26653 #endif
26654 
26655     return(test_ret);
26656 }
26657 
26658 
26659 static int
test_xmlValidateElement(void)26660 test_xmlValidateElement(void) {
26661     int test_ret = 0;
26662 
26663 #if defined(LIBXML_VALID_ENABLED)
26664     int mem_base;
26665     int ret_val;
26666     xmlValidCtxtPtr ctxt; /* the validation context */
26667     int n_ctxt;
26668     xmlDocPtr doc; /* a document instance */
26669     int n_doc;
26670     xmlNodePtr elem; /* an element instance */
26671     int n_elem;
26672 
26673     for (n_ctxt = 0;n_ctxt < gen_nb_xmlValidCtxtPtr;n_ctxt++) {
26674     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
26675     for (n_elem = 0;n_elem < gen_nb_xmlNodePtr;n_elem++) {
26676         mem_base = xmlMemBlocks();
26677         ctxt = gen_xmlValidCtxtPtr(n_ctxt, 0);
26678         doc = gen_xmlDocPtr(n_doc, 1);
26679         elem = gen_xmlNodePtr(n_elem, 2);
26680 
26681         ret_val = xmlValidateElement(ctxt, doc, elem);
26682         desret_int(ret_val);
26683         call_tests++;
26684         des_xmlValidCtxtPtr(n_ctxt, ctxt, 0);
26685         des_xmlDocPtr(n_doc, doc, 1);
26686         des_xmlNodePtr(n_elem, elem, 2);
26687         xmlResetLastError();
26688         if (mem_base != xmlMemBlocks()) {
26689             printf("Leak of %d blocks found in xmlValidateElement",
26690 	           xmlMemBlocks() - mem_base);
26691 	    test_ret++;
26692             printf(" %d", n_ctxt);
26693             printf(" %d", n_doc);
26694             printf(" %d", n_elem);
26695             printf("\n");
26696         }
26697     }
26698     }
26699     }
26700     function_tests++;
26701 #endif
26702 
26703     return(test_ret);
26704 }
26705 
26706 
26707 static int
test_xmlValidateElementDecl(void)26708 test_xmlValidateElementDecl(void) {
26709     int test_ret = 0;
26710 
26711 #if defined(LIBXML_VALID_ENABLED)
26712     int mem_base;
26713     int ret_val;
26714     xmlValidCtxtPtr ctxt; /* the validation context */
26715     int n_ctxt;
26716     xmlDocPtr doc; /* a document instance */
26717     int n_doc;
26718     xmlElementPtr elem; /* an element definition */
26719     int n_elem;
26720 
26721     for (n_ctxt = 0;n_ctxt < gen_nb_xmlValidCtxtPtr;n_ctxt++) {
26722     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
26723     for (n_elem = 0;n_elem < gen_nb_xmlElementPtr;n_elem++) {
26724         mem_base = xmlMemBlocks();
26725         ctxt = gen_xmlValidCtxtPtr(n_ctxt, 0);
26726         doc = gen_xmlDocPtr(n_doc, 1);
26727         elem = gen_xmlElementPtr(n_elem, 2);
26728 
26729         ret_val = xmlValidateElementDecl(ctxt, doc, elem);
26730         desret_int(ret_val);
26731         call_tests++;
26732         des_xmlValidCtxtPtr(n_ctxt, ctxt, 0);
26733         des_xmlDocPtr(n_doc, doc, 1);
26734         des_xmlElementPtr(n_elem, elem, 2);
26735         xmlResetLastError();
26736         if (mem_base != xmlMemBlocks()) {
26737             printf("Leak of %d blocks found in xmlValidateElementDecl",
26738 	           xmlMemBlocks() - mem_base);
26739 	    test_ret++;
26740             printf(" %d", n_ctxt);
26741             printf(" %d", n_doc);
26742             printf(" %d", n_elem);
26743             printf("\n");
26744         }
26745     }
26746     }
26747     }
26748     function_tests++;
26749 #endif
26750 
26751     return(test_ret);
26752 }
26753 
26754 
26755 static int
test_xmlValidateNameValue(void)26756 test_xmlValidateNameValue(void) {
26757     int test_ret = 0;
26758 
26759 #if defined(LIBXML_VALID_ENABLED)
26760     int mem_base;
26761     int ret_val;
26762     xmlChar * value; /* an Name value */
26763     int n_value;
26764 
26765     for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
26766         mem_base = xmlMemBlocks();
26767         value = gen_const_xmlChar_ptr(n_value, 0);
26768 
26769         ret_val = xmlValidateNameValue((const xmlChar *)value);
26770         desret_int(ret_val);
26771         call_tests++;
26772         des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 0);
26773         xmlResetLastError();
26774         if (mem_base != xmlMemBlocks()) {
26775             printf("Leak of %d blocks found in xmlValidateNameValue",
26776 	           xmlMemBlocks() - mem_base);
26777 	    test_ret++;
26778             printf(" %d", n_value);
26779             printf("\n");
26780         }
26781     }
26782     function_tests++;
26783 #endif
26784 
26785     return(test_ret);
26786 }
26787 
26788 
26789 static int
test_xmlValidateNamesValue(void)26790 test_xmlValidateNamesValue(void) {
26791     int test_ret = 0;
26792 
26793 #if defined(LIBXML_VALID_ENABLED)
26794     int mem_base;
26795     int ret_val;
26796     xmlChar * value; /* an Names value */
26797     int n_value;
26798 
26799     for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
26800         mem_base = xmlMemBlocks();
26801         value = gen_const_xmlChar_ptr(n_value, 0);
26802 
26803         ret_val = xmlValidateNamesValue((const xmlChar *)value);
26804         desret_int(ret_val);
26805         call_tests++;
26806         des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 0);
26807         xmlResetLastError();
26808         if (mem_base != xmlMemBlocks()) {
26809             printf("Leak of %d blocks found in xmlValidateNamesValue",
26810 	           xmlMemBlocks() - mem_base);
26811 	    test_ret++;
26812             printf(" %d", n_value);
26813             printf("\n");
26814         }
26815     }
26816     function_tests++;
26817 #endif
26818 
26819     return(test_ret);
26820 }
26821 
26822 
26823 static int
test_xmlValidateNmtokenValue(void)26824 test_xmlValidateNmtokenValue(void) {
26825     int test_ret = 0;
26826 
26827 #if defined(LIBXML_VALID_ENABLED)
26828     int mem_base;
26829     int ret_val;
26830     xmlChar * value; /* an Nmtoken value */
26831     int n_value;
26832 
26833     for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
26834         mem_base = xmlMemBlocks();
26835         value = gen_const_xmlChar_ptr(n_value, 0);
26836 
26837         ret_val = xmlValidateNmtokenValue((const xmlChar *)value);
26838         desret_int(ret_val);
26839         call_tests++;
26840         des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 0);
26841         xmlResetLastError();
26842         if (mem_base != xmlMemBlocks()) {
26843             printf("Leak of %d blocks found in xmlValidateNmtokenValue",
26844 	           xmlMemBlocks() - mem_base);
26845 	    test_ret++;
26846             printf(" %d", n_value);
26847             printf("\n");
26848         }
26849     }
26850     function_tests++;
26851 #endif
26852 
26853     return(test_ret);
26854 }
26855 
26856 
26857 static int
test_xmlValidateNmtokensValue(void)26858 test_xmlValidateNmtokensValue(void) {
26859     int test_ret = 0;
26860 
26861 #if defined(LIBXML_VALID_ENABLED)
26862     int mem_base;
26863     int ret_val;
26864     xmlChar * value; /* an Nmtokens value */
26865     int n_value;
26866 
26867     for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
26868         mem_base = xmlMemBlocks();
26869         value = gen_const_xmlChar_ptr(n_value, 0);
26870 
26871         ret_val = xmlValidateNmtokensValue((const xmlChar *)value);
26872         desret_int(ret_val);
26873         call_tests++;
26874         des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 0);
26875         xmlResetLastError();
26876         if (mem_base != xmlMemBlocks()) {
26877             printf("Leak of %d blocks found in xmlValidateNmtokensValue",
26878 	           xmlMemBlocks() - mem_base);
26879 	    test_ret++;
26880             printf(" %d", n_value);
26881             printf("\n");
26882         }
26883     }
26884     function_tests++;
26885 #endif
26886 
26887     return(test_ret);
26888 }
26889 
26890 
26891 static int
test_xmlValidateNotationDecl(void)26892 test_xmlValidateNotationDecl(void) {
26893     int test_ret = 0;
26894 
26895 #if defined(LIBXML_VALID_ENABLED)
26896     int mem_base;
26897     int ret_val;
26898     xmlValidCtxtPtr ctxt; /* the validation context */
26899     int n_ctxt;
26900     xmlDocPtr doc; /* a document instance */
26901     int n_doc;
26902     xmlNotationPtr nota; /* a notation definition */
26903     int n_nota;
26904 
26905     for (n_ctxt = 0;n_ctxt < gen_nb_xmlValidCtxtPtr;n_ctxt++) {
26906     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
26907     for (n_nota = 0;n_nota < gen_nb_xmlNotationPtr;n_nota++) {
26908         mem_base = xmlMemBlocks();
26909         ctxt = gen_xmlValidCtxtPtr(n_ctxt, 0);
26910         doc = gen_xmlDocPtr(n_doc, 1);
26911         nota = gen_xmlNotationPtr(n_nota, 2);
26912 
26913         ret_val = xmlValidateNotationDecl(ctxt, doc, nota);
26914         desret_int(ret_val);
26915         call_tests++;
26916         des_xmlValidCtxtPtr(n_ctxt, ctxt, 0);
26917         des_xmlDocPtr(n_doc, doc, 1);
26918         des_xmlNotationPtr(n_nota, nota, 2);
26919         xmlResetLastError();
26920         if (mem_base != xmlMemBlocks()) {
26921             printf("Leak of %d blocks found in xmlValidateNotationDecl",
26922 	           xmlMemBlocks() - mem_base);
26923 	    test_ret++;
26924             printf(" %d", n_ctxt);
26925             printf(" %d", n_doc);
26926             printf(" %d", n_nota);
26927             printf("\n");
26928         }
26929     }
26930     }
26931     }
26932     function_tests++;
26933 #endif
26934 
26935     return(test_ret);
26936 }
26937 
26938 
26939 static int
test_xmlValidateNotationUse(void)26940 test_xmlValidateNotationUse(void) {
26941     int test_ret = 0;
26942 
26943 #if defined(LIBXML_VALID_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED)
26944     int mem_base;
26945     int ret_val;
26946     xmlValidCtxtPtr ctxt; /* the validation context */
26947     int n_ctxt;
26948     xmlDocPtr doc; /* the document */
26949     int n_doc;
26950     xmlChar * notationName; /* the notation name to check */
26951     int n_notationName;
26952 
26953     for (n_ctxt = 0;n_ctxt < gen_nb_xmlValidCtxtPtr;n_ctxt++) {
26954     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
26955     for (n_notationName = 0;n_notationName < gen_nb_const_xmlChar_ptr;n_notationName++) {
26956         mem_base = xmlMemBlocks();
26957         ctxt = gen_xmlValidCtxtPtr(n_ctxt, 0);
26958         doc = gen_xmlDocPtr(n_doc, 1);
26959         notationName = gen_const_xmlChar_ptr(n_notationName, 2);
26960 
26961         ret_val = xmlValidateNotationUse(ctxt, doc, (const xmlChar *)notationName);
26962         desret_int(ret_val);
26963         call_tests++;
26964         des_xmlValidCtxtPtr(n_ctxt, ctxt, 0);
26965         des_xmlDocPtr(n_doc, doc, 1);
26966         des_const_xmlChar_ptr(n_notationName, (const xmlChar *)notationName, 2);
26967         xmlResetLastError();
26968         if (mem_base != xmlMemBlocks()) {
26969             printf("Leak of %d blocks found in xmlValidateNotationUse",
26970 	           xmlMemBlocks() - mem_base);
26971 	    test_ret++;
26972             printf(" %d", n_ctxt);
26973             printf(" %d", n_doc);
26974             printf(" %d", n_notationName);
26975             printf("\n");
26976         }
26977     }
26978     }
26979     }
26980     function_tests++;
26981 #endif
26982 
26983     return(test_ret);
26984 }
26985 
26986 
26987 static int
test_xmlValidateOneAttribute(void)26988 test_xmlValidateOneAttribute(void) {
26989     int test_ret = 0;
26990 
26991 #if defined(LIBXML_VALID_ENABLED)
26992     int mem_base;
26993     int ret_val;
26994     xmlValidCtxtPtr ctxt; /* the validation context */
26995     int n_ctxt;
26996     xmlDocPtr doc; /* a document instance */
26997     int n_doc;
26998     xmlNodePtr elem; /* an element instance */
26999     int n_elem;
27000     xmlAttrPtr attr; /* an attribute instance */
27001     int n_attr;
27002     xmlChar * value; /* the attribute value (without entities processing) */
27003     int n_value;
27004 
27005     for (n_ctxt = 0;n_ctxt < gen_nb_xmlValidCtxtPtr;n_ctxt++) {
27006     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
27007     for (n_elem = 0;n_elem < gen_nb_xmlNodePtr;n_elem++) {
27008     for (n_attr = 0;n_attr < gen_nb_xmlAttrPtr;n_attr++) {
27009     for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
27010         mem_base = xmlMemBlocks();
27011         ctxt = gen_xmlValidCtxtPtr(n_ctxt, 0);
27012         doc = gen_xmlDocPtr(n_doc, 1);
27013         elem = gen_xmlNodePtr(n_elem, 2);
27014         attr = gen_xmlAttrPtr(n_attr, 3);
27015         value = gen_const_xmlChar_ptr(n_value, 4);
27016 
27017         ret_val = xmlValidateOneAttribute(ctxt, doc, elem, attr, (const xmlChar *)value);
27018         desret_int(ret_val);
27019         call_tests++;
27020         des_xmlValidCtxtPtr(n_ctxt, ctxt, 0);
27021         des_xmlDocPtr(n_doc, doc, 1);
27022         des_xmlNodePtr(n_elem, elem, 2);
27023         des_xmlAttrPtr(n_attr, attr, 3);
27024         des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 4);
27025         xmlResetLastError();
27026         if (mem_base != xmlMemBlocks()) {
27027             printf("Leak of %d blocks found in xmlValidateOneAttribute",
27028 	           xmlMemBlocks() - mem_base);
27029 	    test_ret++;
27030             printf(" %d", n_ctxt);
27031             printf(" %d", n_doc);
27032             printf(" %d", n_elem);
27033             printf(" %d", n_attr);
27034             printf(" %d", n_value);
27035             printf("\n");
27036         }
27037     }
27038     }
27039     }
27040     }
27041     }
27042     function_tests++;
27043 #endif
27044 
27045     return(test_ret);
27046 }
27047 
27048 
27049 static int
test_xmlValidateOneElement(void)27050 test_xmlValidateOneElement(void) {
27051     int test_ret = 0;
27052 
27053 #if defined(LIBXML_VALID_ENABLED)
27054     int mem_base;
27055     int ret_val;
27056     xmlValidCtxtPtr ctxt; /* the validation context */
27057     int n_ctxt;
27058     xmlDocPtr doc; /* a document instance */
27059     int n_doc;
27060     xmlNodePtr elem; /* an element instance */
27061     int n_elem;
27062 
27063     for (n_ctxt = 0;n_ctxt < gen_nb_xmlValidCtxtPtr;n_ctxt++) {
27064     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
27065     for (n_elem = 0;n_elem < gen_nb_xmlNodePtr;n_elem++) {
27066         mem_base = xmlMemBlocks();
27067         ctxt = gen_xmlValidCtxtPtr(n_ctxt, 0);
27068         doc = gen_xmlDocPtr(n_doc, 1);
27069         elem = gen_xmlNodePtr(n_elem, 2);
27070 
27071         ret_val = xmlValidateOneElement(ctxt, doc, elem);
27072         desret_int(ret_val);
27073         call_tests++;
27074         des_xmlValidCtxtPtr(n_ctxt, ctxt, 0);
27075         des_xmlDocPtr(n_doc, doc, 1);
27076         des_xmlNodePtr(n_elem, elem, 2);
27077         xmlResetLastError();
27078         if (mem_base != xmlMemBlocks()) {
27079             printf("Leak of %d blocks found in xmlValidateOneElement",
27080 	           xmlMemBlocks() - mem_base);
27081 	    test_ret++;
27082             printf(" %d", n_ctxt);
27083             printf(" %d", n_doc);
27084             printf(" %d", n_elem);
27085             printf("\n");
27086         }
27087     }
27088     }
27089     }
27090     function_tests++;
27091 #endif
27092 
27093     return(test_ret);
27094 }
27095 
27096 
27097 static int
test_xmlValidateOneNamespace(void)27098 test_xmlValidateOneNamespace(void) {
27099     int test_ret = 0;
27100 
27101 #if defined(LIBXML_VALID_ENABLED)
27102     int mem_base;
27103     int ret_val;
27104     xmlValidCtxtPtr ctxt; /* the validation context */
27105     int n_ctxt;
27106     xmlDocPtr doc; /* a document instance */
27107     int n_doc;
27108     xmlNodePtr elem; /* an element instance */
27109     int n_elem;
27110     xmlChar * prefix; /* the namespace prefix */
27111     int n_prefix;
27112     xmlNsPtr ns; /* an namespace declaration instance */
27113     int n_ns;
27114     xmlChar * value; /* the attribute value (without entities processing) */
27115     int n_value;
27116 
27117     for (n_ctxt = 0;n_ctxt < gen_nb_xmlValidCtxtPtr;n_ctxt++) {
27118     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
27119     for (n_elem = 0;n_elem < gen_nb_xmlNodePtr;n_elem++) {
27120     for (n_prefix = 0;n_prefix < gen_nb_const_xmlChar_ptr;n_prefix++) {
27121     for (n_ns = 0;n_ns < gen_nb_xmlNsPtr;n_ns++) {
27122     for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
27123         mem_base = xmlMemBlocks();
27124         ctxt = gen_xmlValidCtxtPtr(n_ctxt, 0);
27125         doc = gen_xmlDocPtr(n_doc, 1);
27126         elem = gen_xmlNodePtr(n_elem, 2);
27127         prefix = gen_const_xmlChar_ptr(n_prefix, 3);
27128         ns = gen_xmlNsPtr(n_ns, 4);
27129         value = gen_const_xmlChar_ptr(n_value, 5);
27130 
27131         ret_val = xmlValidateOneNamespace(ctxt, doc, elem, (const xmlChar *)prefix, ns, (const xmlChar *)value);
27132         desret_int(ret_val);
27133         call_tests++;
27134         des_xmlValidCtxtPtr(n_ctxt, ctxt, 0);
27135         des_xmlDocPtr(n_doc, doc, 1);
27136         des_xmlNodePtr(n_elem, elem, 2);
27137         des_const_xmlChar_ptr(n_prefix, (const xmlChar *)prefix, 3);
27138         des_xmlNsPtr(n_ns, ns, 4);
27139         des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 5);
27140         xmlResetLastError();
27141         if (mem_base != xmlMemBlocks()) {
27142             printf("Leak of %d blocks found in xmlValidateOneNamespace",
27143 	           xmlMemBlocks() - mem_base);
27144 	    test_ret++;
27145             printf(" %d", n_ctxt);
27146             printf(" %d", n_doc);
27147             printf(" %d", n_elem);
27148             printf(" %d", n_prefix);
27149             printf(" %d", n_ns);
27150             printf(" %d", n_value);
27151             printf("\n");
27152         }
27153     }
27154     }
27155     }
27156     }
27157     }
27158     }
27159     function_tests++;
27160 #endif
27161 
27162     return(test_ret);
27163 }
27164 
27165 
27166 static int
test_xmlValidatePopElement(void)27167 test_xmlValidatePopElement(void) {
27168     int test_ret = 0;
27169 
27170 #if defined(LIBXML_VALID_ENABLED) && defined(LIBXML_REGEXP_ENABLED)
27171     int mem_base;
27172     int ret_val;
27173     xmlValidCtxtPtr ctxt; /* the validation context */
27174     int n_ctxt;
27175     xmlDocPtr doc; /* a document instance */
27176     int n_doc;
27177     xmlNodePtr elem; /* an element instance */
27178     int n_elem;
27179     xmlChar * qname; /* the qualified name as appearing in the serialization */
27180     int n_qname;
27181 
27182     for (n_ctxt = 0;n_ctxt < gen_nb_xmlValidCtxtPtr;n_ctxt++) {
27183     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
27184     for (n_elem = 0;n_elem < gen_nb_xmlNodePtr;n_elem++) {
27185     for (n_qname = 0;n_qname < gen_nb_const_xmlChar_ptr;n_qname++) {
27186         mem_base = xmlMemBlocks();
27187         ctxt = gen_xmlValidCtxtPtr(n_ctxt, 0);
27188         doc = gen_xmlDocPtr(n_doc, 1);
27189         elem = gen_xmlNodePtr(n_elem, 2);
27190         qname = gen_const_xmlChar_ptr(n_qname, 3);
27191 
27192         ret_val = xmlValidatePopElement(ctxt, doc, elem, (const xmlChar *)qname);
27193         desret_int(ret_val);
27194         call_tests++;
27195         des_xmlValidCtxtPtr(n_ctxt, ctxt, 0);
27196         des_xmlDocPtr(n_doc, doc, 1);
27197         des_xmlNodePtr(n_elem, elem, 2);
27198         des_const_xmlChar_ptr(n_qname, (const xmlChar *)qname, 3);
27199         xmlResetLastError();
27200         if (mem_base != xmlMemBlocks()) {
27201             printf("Leak of %d blocks found in xmlValidatePopElement",
27202 	           xmlMemBlocks() - mem_base);
27203 	    test_ret++;
27204             printf(" %d", n_ctxt);
27205             printf(" %d", n_doc);
27206             printf(" %d", n_elem);
27207             printf(" %d", n_qname);
27208             printf("\n");
27209         }
27210     }
27211     }
27212     }
27213     }
27214     function_tests++;
27215 #endif
27216 
27217     return(test_ret);
27218 }
27219 
27220 
27221 static int
test_xmlValidatePushCData(void)27222 test_xmlValidatePushCData(void) {
27223     int test_ret = 0;
27224 
27225 #if defined(LIBXML_VALID_ENABLED) && defined(LIBXML_REGEXP_ENABLED)
27226     int mem_base;
27227     int ret_val;
27228     xmlValidCtxtPtr ctxt; /* the validation context */
27229     int n_ctxt;
27230     xmlChar * data; /* some character data read */
27231     int n_data;
27232     int len; /* the length of the data */
27233     int n_len;
27234 
27235     for (n_ctxt = 0;n_ctxt < gen_nb_xmlValidCtxtPtr;n_ctxt++) {
27236     for (n_data = 0;n_data < gen_nb_const_xmlChar_ptr;n_data++) {
27237     for (n_len = 0;n_len < gen_nb_int;n_len++) {
27238         mem_base = xmlMemBlocks();
27239         ctxt = gen_xmlValidCtxtPtr(n_ctxt, 0);
27240         data = gen_const_xmlChar_ptr(n_data, 1);
27241         len = gen_int(n_len, 2);
27242         if ((data != NULL) &&
27243             (len > (int) strlen((const char *) data) + 1))
27244             continue;
27245 
27246         ret_val = xmlValidatePushCData(ctxt, (const xmlChar *)data, len);
27247         desret_int(ret_val);
27248         call_tests++;
27249         des_xmlValidCtxtPtr(n_ctxt, ctxt, 0);
27250         des_const_xmlChar_ptr(n_data, (const xmlChar *)data, 1);
27251         des_int(n_len, len, 2);
27252         xmlResetLastError();
27253         if (mem_base != xmlMemBlocks()) {
27254             printf("Leak of %d blocks found in xmlValidatePushCData",
27255 	           xmlMemBlocks() - mem_base);
27256 	    test_ret++;
27257             printf(" %d", n_ctxt);
27258             printf(" %d", n_data);
27259             printf(" %d", n_len);
27260             printf("\n");
27261         }
27262     }
27263     }
27264     }
27265     function_tests++;
27266 #endif
27267 
27268     return(test_ret);
27269 }
27270 
27271 
27272 static int
test_xmlValidatePushElement(void)27273 test_xmlValidatePushElement(void) {
27274     int test_ret = 0;
27275 
27276 #if defined(LIBXML_VALID_ENABLED) && defined(LIBXML_REGEXP_ENABLED)
27277     int mem_base;
27278     int ret_val;
27279     xmlValidCtxtPtr ctxt; /* the validation context */
27280     int n_ctxt;
27281     xmlDocPtr doc; /* a document instance */
27282     int n_doc;
27283     xmlNodePtr elem; /* an element instance */
27284     int n_elem;
27285     xmlChar * qname; /* the qualified name as appearing in the serialization */
27286     int n_qname;
27287 
27288     for (n_ctxt = 0;n_ctxt < gen_nb_xmlValidCtxtPtr;n_ctxt++) {
27289     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
27290     for (n_elem = 0;n_elem < gen_nb_xmlNodePtr;n_elem++) {
27291     for (n_qname = 0;n_qname < gen_nb_const_xmlChar_ptr;n_qname++) {
27292         mem_base = xmlMemBlocks();
27293         ctxt = gen_xmlValidCtxtPtr(n_ctxt, 0);
27294         doc = gen_xmlDocPtr(n_doc, 1);
27295         elem = gen_xmlNodePtr(n_elem, 2);
27296         qname = gen_const_xmlChar_ptr(n_qname, 3);
27297 
27298         ret_val = xmlValidatePushElement(ctxt, doc, elem, (const xmlChar *)qname);
27299         desret_int(ret_val);
27300         call_tests++;
27301         des_xmlValidCtxtPtr(n_ctxt, ctxt, 0);
27302         des_xmlDocPtr(n_doc, doc, 1);
27303         des_xmlNodePtr(n_elem, elem, 2);
27304         des_const_xmlChar_ptr(n_qname, (const xmlChar *)qname, 3);
27305         xmlResetLastError();
27306         if (mem_base != xmlMemBlocks()) {
27307             printf("Leak of %d blocks found in xmlValidatePushElement",
27308 	           xmlMemBlocks() - mem_base);
27309 	    test_ret++;
27310             printf(" %d", n_ctxt);
27311             printf(" %d", n_doc);
27312             printf(" %d", n_elem);
27313             printf(" %d", n_qname);
27314             printf("\n");
27315         }
27316     }
27317     }
27318     }
27319     }
27320     function_tests++;
27321 #endif
27322 
27323     return(test_ret);
27324 }
27325 
27326 
27327 static int
test_xmlValidateRoot(void)27328 test_xmlValidateRoot(void) {
27329     int test_ret = 0;
27330 
27331 #if defined(LIBXML_VALID_ENABLED)
27332     int mem_base;
27333     int ret_val;
27334     xmlValidCtxtPtr ctxt; /* the validation context */
27335     int n_ctxt;
27336     xmlDocPtr doc; /* a document instance */
27337     int n_doc;
27338 
27339     for (n_ctxt = 0;n_ctxt < gen_nb_xmlValidCtxtPtr;n_ctxt++) {
27340     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
27341         mem_base = xmlMemBlocks();
27342         ctxt = gen_xmlValidCtxtPtr(n_ctxt, 0);
27343         doc = gen_xmlDocPtr(n_doc, 1);
27344 
27345         ret_val = xmlValidateRoot(ctxt, doc);
27346         desret_int(ret_val);
27347         call_tests++;
27348         des_xmlValidCtxtPtr(n_ctxt, ctxt, 0);
27349         des_xmlDocPtr(n_doc, doc, 1);
27350         xmlResetLastError();
27351         if (mem_base != xmlMemBlocks()) {
27352             printf("Leak of %d blocks found in xmlValidateRoot",
27353 	           xmlMemBlocks() - mem_base);
27354 	    test_ret++;
27355             printf(" %d", n_ctxt);
27356             printf(" %d", n_doc);
27357             printf("\n");
27358         }
27359     }
27360     }
27361     function_tests++;
27362 #endif
27363 
27364     return(test_ret);
27365 }
27366 
27367 static int
test_valid(void)27368 test_valid(void) {
27369     int test_ret = 0;
27370 
27371     if (quiet == 0) printf("Testing valid : 50 of 70 functions ...\n");
27372     test_ret += test_xmlAddAttributeDecl();
27373     test_ret += test_xmlAddElementDecl();
27374     test_ret += test_xmlAddID();
27375     test_ret += test_xmlAddNotationDecl();
27376     test_ret += test_xmlAddRef();
27377     test_ret += test_xmlCopyAttributeTable();
27378     test_ret += test_xmlCopyDocElementContent();
27379     test_ret += test_xmlCopyElementContent();
27380     test_ret += test_xmlCopyElementTable();
27381     test_ret += test_xmlCopyEnumeration();
27382     test_ret += test_xmlCopyNotationTable();
27383     test_ret += test_xmlCreateEnumeration();
27384     test_ret += test_xmlDumpAttributeDecl();
27385     test_ret += test_xmlDumpAttributeTable();
27386     test_ret += test_xmlDumpElementDecl();
27387     test_ret += test_xmlDumpElementTable();
27388     test_ret += test_xmlDumpNotationDecl();
27389     test_ret += test_xmlDumpNotationTable();
27390     test_ret += test_xmlGetDtdAttrDesc();
27391     test_ret += test_xmlGetDtdElementDesc();
27392     test_ret += test_xmlGetDtdNotationDesc();
27393     test_ret += test_xmlGetDtdQAttrDesc();
27394     test_ret += test_xmlGetDtdQElementDesc();
27395     test_ret += test_xmlGetID();
27396     test_ret += test_xmlGetRefs();
27397     test_ret += test_xmlIsID();
27398     test_ret += test_xmlIsMixedElement();
27399     test_ret += test_xmlIsRef();
27400     test_ret += test_xmlNewDocElementContent();
27401     test_ret += test_xmlNewElementContent();
27402     test_ret += test_xmlNewValidCtxt();
27403     test_ret += test_xmlRemoveID();
27404     test_ret += test_xmlRemoveRef();
27405     test_ret += test_xmlSnprintfElementContent();
27406     test_ret += test_xmlSprintfElementContent();
27407     test_ret += test_xmlValidBuildContentModel();
27408     test_ret += test_xmlValidCtxtNormalizeAttributeValue();
27409     test_ret += test_xmlValidGetPotentialChildren();
27410     test_ret += test_xmlValidGetValidElements();
27411     test_ret += test_xmlValidNormalizeAttributeValue();
27412     test_ret += test_xmlValidateAttributeDecl();
27413     test_ret += test_xmlValidateAttributeValue();
27414     test_ret += test_xmlValidateDocument();
27415     test_ret += test_xmlValidateDocumentFinal();
27416     test_ret += test_xmlValidateDtd();
27417     test_ret += test_xmlValidateDtdFinal();
27418     test_ret += test_xmlValidateElement();
27419     test_ret += test_xmlValidateElementDecl();
27420     test_ret += test_xmlValidateNameValue();
27421     test_ret += test_xmlValidateNamesValue();
27422     test_ret += test_xmlValidateNmtokenValue();
27423     test_ret += test_xmlValidateNmtokensValue();
27424     test_ret += test_xmlValidateNotationDecl();
27425     test_ret += test_xmlValidateNotationUse();
27426     test_ret += test_xmlValidateOneAttribute();
27427     test_ret += test_xmlValidateOneElement();
27428     test_ret += test_xmlValidateOneNamespace();
27429     test_ret += test_xmlValidatePopElement();
27430     test_ret += test_xmlValidatePushCData();
27431     test_ret += test_xmlValidatePushElement();
27432     test_ret += test_xmlValidateRoot();
27433 
27434     if (test_ret != 0)
27435 	printf("Module valid: %d errors\n", test_ret);
27436     return(test_ret);
27437 }
27438 
27439 static int
test_xmlXIncludeNewContext(void)27440 test_xmlXIncludeNewContext(void) {
27441     int test_ret = 0;
27442 
27443 
27444     /* missing type support */
27445     return(test_ret);
27446 }
27447 
27448 
27449 static int
test_xmlXIncludeProcess(void)27450 test_xmlXIncludeProcess(void) {
27451     int test_ret = 0;
27452 
27453 #if defined(LIBXML_XINCLUDE_ENABLED)
27454     int mem_base;
27455     int ret_val;
27456     xmlDocPtr doc; /* an XML document */
27457     int n_doc;
27458 
27459     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
27460         mem_base = xmlMemBlocks();
27461         doc = gen_xmlDocPtr(n_doc, 0);
27462 
27463         ret_val = xmlXIncludeProcess(doc);
27464         desret_int(ret_val);
27465         call_tests++;
27466         des_xmlDocPtr(n_doc, doc, 0);
27467         xmlResetLastError();
27468         if (mem_base != xmlMemBlocks()) {
27469             printf("Leak of %d blocks found in xmlXIncludeProcess",
27470 	           xmlMemBlocks() - mem_base);
27471 	    test_ret++;
27472             printf(" %d", n_doc);
27473             printf("\n");
27474         }
27475     }
27476     function_tests++;
27477 #endif
27478 
27479     return(test_ret);
27480 }
27481 
27482 
27483 static int
test_xmlXIncludeProcessFlags(void)27484 test_xmlXIncludeProcessFlags(void) {
27485     int test_ret = 0;
27486 
27487 #if defined(LIBXML_XINCLUDE_ENABLED)
27488     int mem_base;
27489     int ret_val;
27490     xmlDocPtr doc; /* an XML document */
27491     int n_doc;
27492     int flags; /* a set of xmlParserOption used for parsing XML includes */
27493     int n_flags;
27494 
27495     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
27496     for (n_flags = 0;n_flags < gen_nb_int;n_flags++) {
27497         mem_base = xmlMemBlocks();
27498         doc = gen_xmlDocPtr(n_doc, 0);
27499         flags = gen_int(n_flags, 1);
27500 
27501         ret_val = xmlXIncludeProcessFlags(doc, flags);
27502         desret_int(ret_val);
27503         call_tests++;
27504         des_xmlDocPtr(n_doc, doc, 0);
27505         des_int(n_flags, flags, 1);
27506         xmlResetLastError();
27507         if (mem_base != xmlMemBlocks()) {
27508             printf("Leak of %d blocks found in xmlXIncludeProcessFlags",
27509 	           xmlMemBlocks() - mem_base);
27510 	    test_ret++;
27511             printf(" %d", n_doc);
27512             printf(" %d", n_flags);
27513             printf("\n");
27514         }
27515     }
27516     }
27517     function_tests++;
27518 #endif
27519 
27520     return(test_ret);
27521 }
27522 
27523 
27524 static int
test_xmlXIncludeProcessFlagsData(void)27525 test_xmlXIncludeProcessFlagsData(void) {
27526     int test_ret = 0;
27527 
27528 #if defined(LIBXML_XINCLUDE_ENABLED)
27529     int mem_base;
27530     int ret_val;
27531     xmlDocPtr doc; /* an XML document */
27532     int n_doc;
27533     int flags; /* a set of xmlParserOption used for parsing XML includes */
27534     int n_flags;
27535     void * data; /* application data that will be passed to the parser context in the _private field of the parser context(s) */
27536     int n_data;
27537 
27538     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
27539     for (n_flags = 0;n_flags < gen_nb_int;n_flags++) {
27540     for (n_data = 0;n_data < gen_nb_userdata;n_data++) {
27541         mem_base = xmlMemBlocks();
27542         doc = gen_xmlDocPtr(n_doc, 0);
27543         flags = gen_int(n_flags, 1);
27544         data = gen_userdata(n_data, 2);
27545 
27546         ret_val = xmlXIncludeProcessFlagsData(doc, flags, data);
27547         desret_int(ret_val);
27548         call_tests++;
27549         des_xmlDocPtr(n_doc, doc, 0);
27550         des_int(n_flags, flags, 1);
27551         des_userdata(n_data, data, 2);
27552         xmlResetLastError();
27553         if (mem_base != xmlMemBlocks()) {
27554             printf("Leak of %d blocks found in xmlXIncludeProcessFlagsData",
27555 	           xmlMemBlocks() - mem_base);
27556 	    test_ret++;
27557             printf(" %d", n_doc);
27558             printf(" %d", n_flags);
27559             printf(" %d", n_data);
27560             printf("\n");
27561         }
27562     }
27563     }
27564     }
27565     function_tests++;
27566 #endif
27567 
27568     return(test_ret);
27569 }
27570 
27571 #ifdef LIBXML_XINCLUDE_ENABLED
27572 
27573 #define gen_nb_xmlXIncludeCtxtPtr 1
gen_xmlXIncludeCtxtPtr(int no ATTRIBUTE_UNUSED,int nr ATTRIBUTE_UNUSED)27574 static xmlXIncludeCtxtPtr gen_xmlXIncludeCtxtPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
27575     return(NULL);
27576 }
des_xmlXIncludeCtxtPtr(int no ATTRIBUTE_UNUSED,xmlXIncludeCtxtPtr val ATTRIBUTE_UNUSED,int nr ATTRIBUTE_UNUSED)27577 static void des_xmlXIncludeCtxtPtr(int no ATTRIBUTE_UNUSED, xmlXIncludeCtxtPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
27578 }
27579 #endif
27580 
27581 
27582 static int
test_xmlXIncludeProcessNode(void)27583 test_xmlXIncludeProcessNode(void) {
27584     int test_ret = 0;
27585 
27586 #if defined(LIBXML_XINCLUDE_ENABLED)
27587     int mem_base;
27588     int ret_val;
27589     xmlXIncludeCtxtPtr ctxt; /* an existing XInclude context */
27590     int n_ctxt;
27591     xmlNodePtr node; /* a node in an XML document */
27592     int n_node;
27593 
27594     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXIncludeCtxtPtr;n_ctxt++) {
27595     for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
27596         mem_base = xmlMemBlocks();
27597         ctxt = gen_xmlXIncludeCtxtPtr(n_ctxt, 0);
27598         node = gen_xmlNodePtr(n_node, 1);
27599 
27600         ret_val = xmlXIncludeProcessNode(ctxt, node);
27601         desret_int(ret_val);
27602         call_tests++;
27603         des_xmlXIncludeCtxtPtr(n_ctxt, ctxt, 0);
27604         des_xmlNodePtr(n_node, node, 1);
27605         xmlResetLastError();
27606         if (mem_base != xmlMemBlocks()) {
27607             printf("Leak of %d blocks found in xmlXIncludeProcessNode",
27608 	           xmlMemBlocks() - mem_base);
27609 	    test_ret++;
27610             printf(" %d", n_ctxt);
27611             printf(" %d", n_node);
27612             printf("\n");
27613         }
27614     }
27615     }
27616     function_tests++;
27617 #endif
27618 
27619     return(test_ret);
27620 }
27621 
27622 
27623 static int
test_xmlXIncludeProcessTree(void)27624 test_xmlXIncludeProcessTree(void) {
27625     int test_ret = 0;
27626 
27627 #if defined(LIBXML_XINCLUDE_ENABLED)
27628     int mem_base;
27629     int ret_val;
27630     xmlNodePtr tree; /* a node in an XML document */
27631     int n_tree;
27632 
27633     for (n_tree = 0;n_tree < gen_nb_xmlNodePtr;n_tree++) {
27634         mem_base = xmlMemBlocks();
27635         tree = gen_xmlNodePtr(n_tree, 0);
27636 
27637         ret_val = xmlXIncludeProcessTree(tree);
27638         desret_int(ret_val);
27639         call_tests++;
27640         des_xmlNodePtr(n_tree, tree, 0);
27641         xmlResetLastError();
27642         if (mem_base != xmlMemBlocks()) {
27643             printf("Leak of %d blocks found in xmlXIncludeProcessTree",
27644 	           xmlMemBlocks() - mem_base);
27645 	    test_ret++;
27646             printf(" %d", n_tree);
27647             printf("\n");
27648         }
27649     }
27650     function_tests++;
27651 #endif
27652 
27653     return(test_ret);
27654 }
27655 
27656 
27657 static int
test_xmlXIncludeProcessTreeFlags(void)27658 test_xmlXIncludeProcessTreeFlags(void) {
27659     int test_ret = 0;
27660 
27661 #if defined(LIBXML_XINCLUDE_ENABLED)
27662     int mem_base;
27663     int ret_val;
27664     xmlNodePtr tree; /* a node in an XML document */
27665     int n_tree;
27666     int flags; /* a set of xmlParserOption used for parsing XML includes */
27667     int n_flags;
27668 
27669     for (n_tree = 0;n_tree < gen_nb_xmlNodePtr;n_tree++) {
27670     for (n_flags = 0;n_flags < gen_nb_int;n_flags++) {
27671         mem_base = xmlMemBlocks();
27672         tree = gen_xmlNodePtr(n_tree, 0);
27673         flags = gen_int(n_flags, 1);
27674 
27675         ret_val = xmlXIncludeProcessTreeFlags(tree, flags);
27676         desret_int(ret_val);
27677         call_tests++;
27678         des_xmlNodePtr(n_tree, tree, 0);
27679         des_int(n_flags, flags, 1);
27680         xmlResetLastError();
27681         if (mem_base != xmlMemBlocks()) {
27682             printf("Leak of %d blocks found in xmlXIncludeProcessTreeFlags",
27683 	           xmlMemBlocks() - mem_base);
27684 	    test_ret++;
27685             printf(" %d", n_tree);
27686             printf(" %d", n_flags);
27687             printf("\n");
27688         }
27689     }
27690     }
27691     function_tests++;
27692 #endif
27693 
27694     return(test_ret);
27695 }
27696 
27697 
27698 static int
test_xmlXIncludeProcessTreeFlagsData(void)27699 test_xmlXIncludeProcessTreeFlagsData(void) {
27700     int test_ret = 0;
27701 
27702 #if defined(LIBXML_XINCLUDE_ENABLED)
27703     int mem_base;
27704     int ret_val;
27705     xmlNodePtr tree; /* an XML node */
27706     int n_tree;
27707     int flags; /* a set of xmlParserOption used for parsing XML includes */
27708     int n_flags;
27709     void * data; /* application data that will be passed to the parser context in the _private field of the parser context(s) */
27710     int n_data;
27711 
27712     for (n_tree = 0;n_tree < gen_nb_xmlNodePtr;n_tree++) {
27713     for (n_flags = 0;n_flags < gen_nb_int;n_flags++) {
27714     for (n_data = 0;n_data < gen_nb_userdata;n_data++) {
27715         mem_base = xmlMemBlocks();
27716         tree = gen_xmlNodePtr(n_tree, 0);
27717         flags = gen_int(n_flags, 1);
27718         data = gen_userdata(n_data, 2);
27719 
27720         ret_val = xmlXIncludeProcessTreeFlagsData(tree, flags, data);
27721         desret_int(ret_val);
27722         call_tests++;
27723         des_xmlNodePtr(n_tree, tree, 0);
27724         des_int(n_flags, flags, 1);
27725         des_userdata(n_data, data, 2);
27726         xmlResetLastError();
27727         if (mem_base != xmlMemBlocks()) {
27728             printf("Leak of %d blocks found in xmlXIncludeProcessTreeFlagsData",
27729 	           xmlMemBlocks() - mem_base);
27730 	    test_ret++;
27731             printf(" %d", n_tree);
27732             printf(" %d", n_flags);
27733             printf(" %d", n_data);
27734             printf("\n");
27735         }
27736     }
27737     }
27738     }
27739     function_tests++;
27740 #endif
27741 
27742     return(test_ret);
27743 }
27744 
27745 
27746 static int
test_xmlXIncludeSetFlags(void)27747 test_xmlXIncludeSetFlags(void) {
27748     int test_ret = 0;
27749 
27750 #if defined(LIBXML_XINCLUDE_ENABLED)
27751     int mem_base;
27752     int ret_val;
27753     xmlXIncludeCtxtPtr ctxt; /* an XInclude processing context */
27754     int n_ctxt;
27755     int flags; /* a set of xmlParserOption used for parsing XML includes */
27756     int n_flags;
27757 
27758     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXIncludeCtxtPtr;n_ctxt++) {
27759     for (n_flags = 0;n_flags < gen_nb_int;n_flags++) {
27760         mem_base = xmlMemBlocks();
27761         ctxt = gen_xmlXIncludeCtxtPtr(n_ctxt, 0);
27762         flags = gen_int(n_flags, 1);
27763 
27764         ret_val = xmlXIncludeSetFlags(ctxt, flags);
27765         desret_int(ret_val);
27766         call_tests++;
27767         des_xmlXIncludeCtxtPtr(n_ctxt, ctxt, 0);
27768         des_int(n_flags, flags, 1);
27769         xmlResetLastError();
27770         if (mem_base != xmlMemBlocks()) {
27771             printf("Leak of %d blocks found in xmlXIncludeSetFlags",
27772 	           xmlMemBlocks() - mem_base);
27773 	    test_ret++;
27774             printf(" %d", n_ctxt);
27775             printf(" %d", n_flags);
27776             printf("\n");
27777         }
27778     }
27779     }
27780     function_tests++;
27781 #endif
27782 
27783     return(test_ret);
27784 }
27785 
27786 static int
test_xinclude(void)27787 test_xinclude(void) {
27788     int test_ret = 0;
27789 
27790     if (quiet == 0) printf("Testing xinclude : 8 of 10 functions ...\n");
27791     test_ret += test_xmlXIncludeNewContext();
27792     test_ret += test_xmlXIncludeProcess();
27793     test_ret += test_xmlXIncludeProcessFlags();
27794     test_ret += test_xmlXIncludeProcessFlagsData();
27795     test_ret += test_xmlXIncludeProcessNode();
27796     test_ret += test_xmlXIncludeProcessTree();
27797     test_ret += test_xmlXIncludeProcessTreeFlags();
27798     test_ret += test_xmlXIncludeProcessTreeFlagsData();
27799     test_ret += test_xmlXIncludeSetFlags();
27800 
27801     if (test_ret != 0)
27802 	printf("Module xinclude: %d errors\n", test_ret);
27803     return(test_ret);
27804 }
27805 
27806 static int
test_xmlAllocOutputBuffer(void)27807 test_xmlAllocOutputBuffer(void) {
27808     int test_ret = 0;
27809 
27810 #if defined(LIBXML_OUTPUT_ENABLED)
27811     int mem_base;
27812     xmlOutputBufferPtr ret_val;
27813     xmlCharEncodingHandlerPtr encoder; /* the encoding converter or NULL */
27814     int n_encoder;
27815 
27816     for (n_encoder = 0;n_encoder < gen_nb_xmlCharEncodingHandlerPtr;n_encoder++) {
27817         mem_base = xmlMemBlocks();
27818         encoder = gen_xmlCharEncodingHandlerPtr(n_encoder, 0);
27819 
27820         ret_val = xmlAllocOutputBuffer(encoder);
27821         desret_xmlOutputBufferPtr(ret_val);
27822         call_tests++;
27823         des_xmlCharEncodingHandlerPtr(n_encoder, encoder, 0);
27824         xmlResetLastError();
27825         if (mem_base != xmlMemBlocks()) {
27826             printf("Leak of %d blocks found in xmlAllocOutputBuffer",
27827 	           xmlMemBlocks() - mem_base);
27828 	    test_ret++;
27829             printf(" %d", n_encoder);
27830             printf("\n");
27831         }
27832     }
27833     function_tests++;
27834 #endif
27835 
27836     return(test_ret);
27837 }
27838 
27839 
27840 static int
test_xmlAllocParserInputBuffer(void)27841 test_xmlAllocParserInputBuffer(void) {
27842     int test_ret = 0;
27843 
27844     int mem_base;
27845     xmlParserInputBufferPtr ret_val;
27846     xmlCharEncoding enc; /* the charset encoding if known */
27847     int n_enc;
27848 
27849     for (n_enc = 0;n_enc < gen_nb_xmlCharEncoding;n_enc++) {
27850         mem_base = xmlMemBlocks();
27851         enc = gen_xmlCharEncoding(n_enc, 0);
27852 
27853         ret_val = xmlAllocParserInputBuffer(enc);
27854         desret_xmlParserInputBufferPtr(ret_val);
27855         call_tests++;
27856         des_xmlCharEncoding(n_enc, enc, 0);
27857         xmlResetLastError();
27858         if (mem_base != xmlMemBlocks()) {
27859             printf("Leak of %d blocks found in xmlAllocParserInputBuffer",
27860 	           xmlMemBlocks() - mem_base);
27861 	    test_ret++;
27862             printf(" %d", n_enc);
27863             printf("\n");
27864         }
27865     }
27866     function_tests++;
27867 
27868     return(test_ret);
27869 }
27870 
27871 
27872 static int
test_xmlCheckFilename(void)27873 test_xmlCheckFilename(void) {
27874     int test_ret = 0;
27875 
27876     int mem_base;
27877     int ret_val;
27878     char * path; /* the path to check */
27879     int n_path;
27880 
27881     for (n_path = 0;n_path < gen_nb_const_char_ptr;n_path++) {
27882         mem_base = xmlMemBlocks();
27883         path = gen_const_char_ptr(n_path, 0);
27884 
27885         ret_val = xmlCheckFilename((const char *)path);
27886         desret_int(ret_val);
27887         call_tests++;
27888         des_const_char_ptr(n_path, (const char *)path, 0);
27889         xmlResetLastError();
27890         if (mem_base != xmlMemBlocks()) {
27891             printf("Leak of %d blocks found in xmlCheckFilename",
27892 	           xmlMemBlocks() - mem_base);
27893 	    test_ret++;
27894             printf(" %d", n_path);
27895             printf("\n");
27896         }
27897     }
27898     function_tests++;
27899 
27900     return(test_ret);
27901 }
27902 
27903 
27904 static int
test_xmlCheckHTTPInput(void)27905 test_xmlCheckHTTPInput(void) {
27906     int test_ret = 0;
27907 
27908     int mem_base;
27909     xmlParserInputPtr ret_val;
27910     xmlParserCtxtPtr ctxt; /* an XML parser context */
27911     int n_ctxt;
27912     xmlParserInputPtr ret; /* an XML parser input */
27913     int n_ret;
27914 
27915     for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
27916     for (n_ret = 0;n_ret < gen_nb_xmlParserInputPtr;n_ret++) {
27917         mem_base = xmlMemBlocks();
27918         ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
27919         ret = gen_xmlParserInputPtr(n_ret, 1);
27920 
27921         ret_val = xmlCheckHTTPInput(ctxt, ret);
27922         desret_xmlParserInputPtr(ret_val);
27923         call_tests++;
27924         des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
27925         des_xmlParserInputPtr(n_ret, ret, 1);
27926         xmlResetLastError();
27927         if (mem_base != xmlMemBlocks()) {
27928             printf("Leak of %d blocks found in xmlCheckHTTPInput",
27929 	           xmlMemBlocks() - mem_base);
27930 	    test_ret++;
27931             printf(" %d", n_ctxt);
27932             printf(" %d", n_ret);
27933             printf("\n");
27934         }
27935     }
27936     }
27937     function_tests++;
27938 
27939     return(test_ret);
27940 }
27941 
27942 
27943 static int
test_xmlCleanupInputCallbacks(void)27944 test_xmlCleanupInputCallbacks(void) {
27945     int test_ret = 0;
27946 
27947     int mem_base;
27948 
27949         mem_base = xmlMemBlocks();
27950 
27951         xmlCleanupInputCallbacks();
27952         call_tests++;
27953         xmlResetLastError();
27954         if (mem_base != xmlMemBlocks()) {
27955             printf("Leak of %d blocks found in xmlCleanupInputCallbacks",
27956 	           xmlMemBlocks() - mem_base);
27957 	    test_ret++;
27958             printf("\n");
27959         }
27960     function_tests++;
27961 
27962     return(test_ret);
27963 }
27964 
27965 
27966 static int
test_xmlCleanupOutputCallbacks(void)27967 test_xmlCleanupOutputCallbacks(void) {
27968     int test_ret = 0;
27969 
27970 #if defined(LIBXML_OUTPUT_ENABLED)
27971     int mem_base;
27972 
27973         mem_base = xmlMemBlocks();
27974 
27975         xmlCleanupOutputCallbacks();
27976         call_tests++;
27977         xmlResetLastError();
27978         if (mem_base != xmlMemBlocks()) {
27979             printf("Leak of %d blocks found in xmlCleanupOutputCallbacks",
27980 	           xmlMemBlocks() - mem_base);
27981 	    test_ret++;
27982             printf("\n");
27983         }
27984     function_tests++;
27985 #endif
27986 
27987     return(test_ret);
27988 }
27989 
27990 
27991 static int
test_xmlFileClose(void)27992 test_xmlFileClose(void) {
27993     int test_ret = 0;
27994 
27995     int mem_base;
27996     int ret_val;
27997     void * context; /* the I/O context */
27998     int n_context;
27999 
28000     for (n_context = 0;n_context < gen_nb_void_ptr;n_context++) {
28001         mem_base = xmlMemBlocks();
28002         context = gen_void_ptr(n_context, 0);
28003 
28004         ret_val = xmlFileClose(context);
28005         desret_int(ret_val);
28006         call_tests++;
28007         des_void_ptr(n_context, context, 0);
28008         xmlResetLastError();
28009         if (mem_base != xmlMemBlocks()) {
28010             printf("Leak of %d blocks found in xmlFileClose",
28011 	           xmlMemBlocks() - mem_base);
28012 	    test_ret++;
28013             printf(" %d", n_context);
28014             printf("\n");
28015         }
28016     }
28017     function_tests++;
28018 
28019     return(test_ret);
28020 }
28021 
28022 
28023 static int
test_xmlFileMatch(void)28024 test_xmlFileMatch(void) {
28025     int test_ret = 0;
28026 
28027     int mem_base;
28028     int ret_val;
28029     const char * filename; /* the URI for matching */
28030     int n_filename;
28031 
28032     for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
28033         mem_base = xmlMemBlocks();
28034         filename = gen_filepath(n_filename, 0);
28035 
28036         ret_val = xmlFileMatch(filename);
28037         desret_int(ret_val);
28038         call_tests++;
28039         des_filepath(n_filename, filename, 0);
28040         xmlResetLastError();
28041         if (mem_base != xmlMemBlocks()) {
28042             printf("Leak of %d blocks found in xmlFileMatch",
28043 	           xmlMemBlocks() - mem_base);
28044 	    test_ret++;
28045             printf(" %d", n_filename);
28046             printf("\n");
28047         }
28048     }
28049     function_tests++;
28050 
28051     return(test_ret);
28052 }
28053 
28054 
28055 static int
test_xmlFileOpen(void)28056 test_xmlFileOpen(void) {
28057     int test_ret = 0;
28058 
28059     int mem_base;
28060     void * ret_val;
28061     const char * filename; /* the URI for matching */
28062     int n_filename;
28063 
28064     for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
28065         mem_base = xmlMemBlocks();
28066         filename = gen_filepath(n_filename, 0);
28067 
28068         ret_val = xmlFileOpen(filename);
28069         desret_void_ptr(ret_val);
28070         call_tests++;
28071         des_filepath(n_filename, filename, 0);
28072         xmlResetLastError();
28073         if (mem_base != xmlMemBlocks()) {
28074             printf("Leak of %d blocks found in xmlFileOpen",
28075 	           xmlMemBlocks() - mem_base);
28076 	    test_ret++;
28077             printf(" %d", n_filename);
28078             printf("\n");
28079         }
28080     }
28081     function_tests++;
28082 
28083     return(test_ret);
28084 }
28085 
28086 
28087 static int
test_xmlFileRead(void)28088 test_xmlFileRead(void) {
28089     int test_ret = 0;
28090 
28091     int mem_base;
28092     int ret_val;
28093     void * context; /* the I/O context */
28094     int n_context;
28095     char * buffer; /* where to drop data */
28096     int n_buffer;
28097     int len; /* number of bytes to write */
28098     int n_len;
28099 
28100     for (n_context = 0;n_context < gen_nb_void_ptr;n_context++) {
28101     for (n_buffer = 0;n_buffer < gen_nb_char_ptr;n_buffer++) {
28102     for (n_len = 0;n_len < gen_nb_int;n_len++) {
28103         mem_base = xmlMemBlocks();
28104         context = gen_void_ptr(n_context, 0);
28105         buffer = gen_char_ptr(n_buffer, 1);
28106         len = gen_int(n_len, 2);
28107 
28108         ret_val = xmlFileRead(context, buffer, len);
28109         desret_int(ret_val);
28110         call_tests++;
28111         des_void_ptr(n_context, context, 0);
28112         des_char_ptr(n_buffer, buffer, 1);
28113         des_int(n_len, len, 2);
28114         xmlResetLastError();
28115         if (mem_base != xmlMemBlocks()) {
28116             printf("Leak of %d blocks found in xmlFileRead",
28117 	           xmlMemBlocks() - mem_base);
28118 	    test_ret++;
28119             printf(" %d", n_context);
28120             printf(" %d", n_buffer);
28121             printf(" %d", n_len);
28122             printf("\n");
28123         }
28124     }
28125     }
28126     }
28127     function_tests++;
28128 
28129     return(test_ret);
28130 }
28131 
28132 
28133 static int
test_xmlIOFTPClose(void)28134 test_xmlIOFTPClose(void) {
28135     int test_ret = 0;
28136 
28137 #if defined(LIBXML_FTP_ENABLED)
28138     int mem_base;
28139     int ret_val;
28140     void * context; /* the I/O context */
28141     int n_context;
28142 
28143     for (n_context = 0;n_context < gen_nb_void_ptr;n_context++) {
28144         mem_base = xmlMemBlocks();
28145         context = gen_void_ptr(n_context, 0);
28146 
28147         ret_val = xmlIOFTPClose(context);
28148         desret_int(ret_val);
28149         call_tests++;
28150         des_void_ptr(n_context, context, 0);
28151         xmlResetLastError();
28152         if (mem_base != xmlMemBlocks()) {
28153             printf("Leak of %d blocks found in xmlIOFTPClose",
28154 	           xmlMemBlocks() - mem_base);
28155 	    test_ret++;
28156             printf(" %d", n_context);
28157             printf("\n");
28158         }
28159     }
28160     function_tests++;
28161 #endif
28162 
28163     return(test_ret);
28164 }
28165 
28166 
28167 static int
test_xmlIOFTPMatch(void)28168 test_xmlIOFTPMatch(void) {
28169     int test_ret = 0;
28170 
28171 #if defined(LIBXML_FTP_ENABLED)
28172     int mem_base;
28173     int ret_val;
28174     const char * filename; /* the URI for matching */
28175     int n_filename;
28176 
28177     for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
28178         mem_base = xmlMemBlocks();
28179         filename = gen_filepath(n_filename, 0);
28180 
28181         ret_val = xmlIOFTPMatch(filename);
28182         desret_int(ret_val);
28183         call_tests++;
28184         des_filepath(n_filename, filename, 0);
28185         xmlResetLastError();
28186         if (mem_base != xmlMemBlocks()) {
28187             printf("Leak of %d blocks found in xmlIOFTPMatch",
28188 	           xmlMemBlocks() - mem_base);
28189 	    test_ret++;
28190             printf(" %d", n_filename);
28191             printf("\n");
28192         }
28193     }
28194     function_tests++;
28195 #endif
28196 
28197     return(test_ret);
28198 }
28199 
28200 
28201 static int
test_xmlIOFTPOpen(void)28202 test_xmlIOFTPOpen(void) {
28203     int test_ret = 0;
28204 
28205 #if defined(LIBXML_FTP_ENABLED)
28206     int mem_base;
28207     void * ret_val;
28208     const char * filename; /* the URI for matching */
28209     int n_filename;
28210 
28211     for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
28212         mem_base = xmlMemBlocks();
28213         filename = gen_filepath(n_filename, 0);
28214 
28215         ret_val = xmlIOFTPOpen(filename);
28216         desret_void_ptr(ret_val);
28217         call_tests++;
28218         des_filepath(n_filename, filename, 0);
28219         xmlResetLastError();
28220         if (mem_base != xmlMemBlocks()) {
28221             printf("Leak of %d blocks found in xmlIOFTPOpen",
28222 	           xmlMemBlocks() - mem_base);
28223 	    test_ret++;
28224             printf(" %d", n_filename);
28225             printf("\n");
28226         }
28227     }
28228     function_tests++;
28229 #endif
28230 
28231     return(test_ret);
28232 }
28233 
28234 
28235 static int
test_xmlIOFTPRead(void)28236 test_xmlIOFTPRead(void) {
28237     int test_ret = 0;
28238 
28239 #if defined(LIBXML_FTP_ENABLED)
28240     int mem_base;
28241     int ret_val;
28242     void * context; /* the I/O context */
28243     int n_context;
28244     char * buffer; /* where to drop data */
28245     int n_buffer;
28246     int len; /* number of bytes to write */
28247     int n_len;
28248 
28249     for (n_context = 0;n_context < gen_nb_void_ptr;n_context++) {
28250     for (n_buffer = 0;n_buffer < gen_nb_char_ptr;n_buffer++) {
28251     for (n_len = 0;n_len < gen_nb_int;n_len++) {
28252         mem_base = xmlMemBlocks();
28253         context = gen_void_ptr(n_context, 0);
28254         buffer = gen_char_ptr(n_buffer, 1);
28255         len = gen_int(n_len, 2);
28256 
28257         ret_val = xmlIOFTPRead(context, buffer, len);
28258         desret_int(ret_val);
28259         call_tests++;
28260         des_void_ptr(n_context, context, 0);
28261         des_char_ptr(n_buffer, buffer, 1);
28262         des_int(n_len, len, 2);
28263         xmlResetLastError();
28264         if (mem_base != xmlMemBlocks()) {
28265             printf("Leak of %d blocks found in xmlIOFTPRead",
28266 	           xmlMemBlocks() - mem_base);
28267 	    test_ret++;
28268             printf(" %d", n_context);
28269             printf(" %d", n_buffer);
28270             printf(" %d", n_len);
28271             printf("\n");
28272         }
28273     }
28274     }
28275     }
28276     function_tests++;
28277 #endif
28278 
28279     return(test_ret);
28280 }
28281 
28282 
28283 static int
test_xmlIOHTTPClose(void)28284 test_xmlIOHTTPClose(void) {
28285     int test_ret = 0;
28286 
28287 #if defined(LIBXML_HTTP_ENABLED)
28288     int mem_base;
28289     int ret_val;
28290     void * context; /* the I/O context */
28291     int n_context;
28292 
28293     for (n_context = 0;n_context < gen_nb_void_ptr;n_context++) {
28294         mem_base = xmlMemBlocks();
28295         context = gen_void_ptr(n_context, 0);
28296 
28297         ret_val = xmlIOHTTPClose(context);
28298         desret_int(ret_val);
28299         call_tests++;
28300         des_void_ptr(n_context, context, 0);
28301         xmlResetLastError();
28302         if (mem_base != xmlMemBlocks()) {
28303             printf("Leak of %d blocks found in xmlIOHTTPClose",
28304 	           xmlMemBlocks() - mem_base);
28305 	    test_ret++;
28306             printf(" %d", n_context);
28307             printf("\n");
28308         }
28309     }
28310     function_tests++;
28311 #endif
28312 
28313     return(test_ret);
28314 }
28315 
28316 
28317 static int
test_xmlIOHTTPMatch(void)28318 test_xmlIOHTTPMatch(void) {
28319     int test_ret = 0;
28320 
28321 #if defined(LIBXML_HTTP_ENABLED)
28322     int mem_base;
28323     int ret_val;
28324     const char * filename; /* the URI for matching */
28325     int n_filename;
28326 
28327     for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
28328         mem_base = xmlMemBlocks();
28329         filename = gen_filepath(n_filename, 0);
28330 
28331         ret_val = xmlIOHTTPMatch(filename);
28332         desret_int(ret_val);
28333         call_tests++;
28334         des_filepath(n_filename, filename, 0);
28335         xmlResetLastError();
28336         if (mem_base != xmlMemBlocks()) {
28337             printf("Leak of %d blocks found in xmlIOHTTPMatch",
28338 	           xmlMemBlocks() - mem_base);
28339 	    test_ret++;
28340             printf(" %d", n_filename);
28341             printf("\n");
28342         }
28343     }
28344     function_tests++;
28345 #endif
28346 
28347     return(test_ret);
28348 }
28349 
28350 
28351 static int
test_xmlIOHTTPOpen(void)28352 test_xmlIOHTTPOpen(void) {
28353     int test_ret = 0;
28354 
28355 #if defined(LIBXML_HTTP_ENABLED)
28356     int mem_base;
28357     void * ret_val;
28358     const char * filename; /* the URI for matching */
28359     int n_filename;
28360 
28361     for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
28362         mem_base = xmlMemBlocks();
28363         filename = gen_filepath(n_filename, 0);
28364 
28365         ret_val = xmlIOHTTPOpen(filename);
28366         desret_xmlNanoHTTPCtxtPtr(ret_val);
28367         call_tests++;
28368         des_filepath(n_filename, filename, 0);
28369         xmlResetLastError();
28370         if (mem_base != xmlMemBlocks()) {
28371             printf("Leak of %d blocks found in xmlIOHTTPOpen",
28372 	           xmlMemBlocks() - mem_base);
28373 	    test_ret++;
28374             printf(" %d", n_filename);
28375             printf("\n");
28376         }
28377     }
28378     function_tests++;
28379 #endif
28380 
28381     return(test_ret);
28382 }
28383 
28384 
28385 static int
test_xmlIOHTTPRead(void)28386 test_xmlIOHTTPRead(void) {
28387     int test_ret = 0;
28388 
28389 #if defined(LIBXML_HTTP_ENABLED)
28390     int mem_base;
28391     int ret_val;
28392     void * context; /* the I/O context */
28393     int n_context;
28394     char * buffer; /* where to drop data */
28395     int n_buffer;
28396     int len; /* number of bytes to write */
28397     int n_len;
28398 
28399     for (n_context = 0;n_context < gen_nb_void_ptr;n_context++) {
28400     for (n_buffer = 0;n_buffer < gen_nb_char_ptr;n_buffer++) {
28401     for (n_len = 0;n_len < gen_nb_int;n_len++) {
28402         mem_base = xmlMemBlocks();
28403         context = gen_void_ptr(n_context, 0);
28404         buffer = gen_char_ptr(n_buffer, 1);
28405         len = gen_int(n_len, 2);
28406 
28407         ret_val = xmlIOHTTPRead(context, buffer, len);
28408         desret_int(ret_val);
28409         call_tests++;
28410         des_void_ptr(n_context, context, 0);
28411         des_char_ptr(n_buffer, buffer, 1);
28412         des_int(n_len, len, 2);
28413         xmlResetLastError();
28414         if (mem_base != xmlMemBlocks()) {
28415             printf("Leak of %d blocks found in xmlIOHTTPRead",
28416 	           xmlMemBlocks() - mem_base);
28417 	    test_ret++;
28418             printf(" %d", n_context);
28419             printf(" %d", n_buffer);
28420             printf(" %d", n_len);
28421             printf("\n");
28422         }
28423     }
28424     }
28425     }
28426     function_tests++;
28427 #endif
28428 
28429     return(test_ret);
28430 }
28431 
28432 
28433 static int
test_xmlNoNetExternalEntityLoader(void)28434 test_xmlNoNetExternalEntityLoader(void) {
28435     int test_ret = 0;
28436 
28437     int mem_base;
28438     xmlParserInputPtr ret_val;
28439     const char * URL; /* the URL for the entity to load */
28440     int n_URL;
28441     char * ID; /* the System ID for the entity to load */
28442     int n_ID;
28443     xmlParserCtxtPtr ctxt; /* the context in which the entity is called or NULL */
28444     int n_ctxt;
28445 
28446     for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) {
28447     for (n_ID = 0;n_ID < gen_nb_const_char_ptr;n_ID++) {
28448     for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
28449         mem_base = xmlMemBlocks();
28450         URL = gen_filepath(n_URL, 0);
28451         ID = gen_const_char_ptr(n_ID, 1);
28452         ctxt = gen_xmlParserCtxtPtr(n_ctxt, 2);
28453 
28454         ret_val = xmlNoNetExternalEntityLoader(URL, (const char *)ID, ctxt);
28455         desret_xmlParserInputPtr(ret_val);
28456         call_tests++;
28457         des_filepath(n_URL, URL, 0);
28458         des_const_char_ptr(n_ID, (const char *)ID, 1);
28459         des_xmlParserCtxtPtr(n_ctxt, ctxt, 2);
28460         xmlResetLastError();
28461         if (mem_base != xmlMemBlocks()) {
28462             printf("Leak of %d blocks found in xmlNoNetExternalEntityLoader",
28463 	           xmlMemBlocks() - mem_base);
28464 	    test_ret++;
28465             printf(" %d", n_URL);
28466             printf(" %d", n_ID);
28467             printf(" %d", n_ctxt);
28468             printf("\n");
28469         }
28470     }
28471     }
28472     }
28473     function_tests++;
28474 
28475     return(test_ret);
28476 }
28477 
28478 
28479 static int
test_xmlNormalizeWindowsPath(void)28480 test_xmlNormalizeWindowsPath(void) {
28481     int test_ret = 0;
28482 
28483     int mem_base;
28484     xmlChar * ret_val;
28485     xmlChar * path; /* the input file path */
28486     int n_path;
28487 
28488     for (n_path = 0;n_path < gen_nb_const_xmlChar_ptr;n_path++) {
28489         mem_base = xmlMemBlocks();
28490         path = gen_const_xmlChar_ptr(n_path, 0);
28491 
28492         ret_val = xmlNormalizeWindowsPath((const xmlChar *)path);
28493         desret_xmlChar_ptr(ret_val);
28494         call_tests++;
28495         des_const_xmlChar_ptr(n_path, (const xmlChar *)path, 0);
28496         xmlResetLastError();
28497         if (mem_base != xmlMemBlocks()) {
28498             printf("Leak of %d blocks found in xmlNormalizeWindowsPath",
28499 	           xmlMemBlocks() - mem_base);
28500 	    test_ret++;
28501             printf(" %d", n_path);
28502             printf("\n");
28503         }
28504     }
28505     function_tests++;
28506 
28507     return(test_ret);
28508 }
28509 
28510 
28511 static int
test_xmlOutputBufferCreateBuffer(void)28512 test_xmlOutputBufferCreateBuffer(void) {
28513     int test_ret = 0;
28514 
28515 #if defined(LIBXML_OUTPUT_ENABLED)
28516     int mem_base;
28517     xmlOutputBufferPtr ret_val;
28518     xmlBufferPtr buffer; /* a xmlBufferPtr */
28519     int n_buffer;
28520     xmlCharEncodingHandlerPtr encoder; /* the encoding converter or NULL */
28521     int n_encoder;
28522 
28523     for (n_buffer = 0;n_buffer < gen_nb_xmlBufferPtr;n_buffer++) {
28524     for (n_encoder = 0;n_encoder < gen_nb_xmlCharEncodingHandlerPtr;n_encoder++) {
28525         mem_base = xmlMemBlocks();
28526         buffer = gen_xmlBufferPtr(n_buffer, 0);
28527         encoder = gen_xmlCharEncodingHandlerPtr(n_encoder, 1);
28528 
28529         ret_val = xmlOutputBufferCreateBuffer(buffer, encoder);
28530         desret_xmlOutputBufferPtr(ret_val);
28531         call_tests++;
28532         des_xmlBufferPtr(n_buffer, buffer, 0);
28533         des_xmlCharEncodingHandlerPtr(n_encoder, encoder, 1);
28534         xmlResetLastError();
28535         if (mem_base != xmlMemBlocks()) {
28536             printf("Leak of %d blocks found in xmlOutputBufferCreateBuffer",
28537 	           xmlMemBlocks() - mem_base);
28538 	    test_ret++;
28539             printf(" %d", n_buffer);
28540             printf(" %d", n_encoder);
28541             printf("\n");
28542         }
28543     }
28544     }
28545     function_tests++;
28546 #endif
28547 
28548     return(test_ret);
28549 }
28550 
28551 
28552 static int
test_xmlOutputBufferCreateFd(void)28553 test_xmlOutputBufferCreateFd(void) {
28554     int test_ret = 0;
28555 
28556 #if defined(LIBXML_OUTPUT_ENABLED)
28557     int mem_base;
28558     xmlOutputBufferPtr ret_val;
28559     int fd; /* a file descriptor number */
28560     int n_fd;
28561     xmlCharEncodingHandlerPtr encoder; /* the encoding converter or NULL */
28562     int n_encoder;
28563 
28564     for (n_fd = 0;n_fd < gen_nb_int;n_fd++) {
28565     for (n_encoder = 0;n_encoder < gen_nb_xmlCharEncodingHandlerPtr;n_encoder++) {
28566         mem_base = xmlMemBlocks();
28567         fd = gen_int(n_fd, 0);
28568         encoder = gen_xmlCharEncodingHandlerPtr(n_encoder, 1);
28569 
28570         ret_val = xmlOutputBufferCreateFd(fd, encoder);
28571         desret_xmlOutputBufferPtr(ret_val);
28572         call_tests++;
28573         des_int(n_fd, fd, 0);
28574         des_xmlCharEncodingHandlerPtr(n_encoder, encoder, 1);
28575         xmlResetLastError();
28576         if (mem_base != xmlMemBlocks()) {
28577             printf("Leak of %d blocks found in xmlOutputBufferCreateFd",
28578 	           xmlMemBlocks() - mem_base);
28579 	    test_ret++;
28580             printf(" %d", n_fd);
28581             printf(" %d", n_encoder);
28582             printf("\n");
28583         }
28584     }
28585     }
28586     function_tests++;
28587 #endif
28588 
28589     return(test_ret);
28590 }
28591 
28592 
28593 static int
test_xmlOutputBufferCreateFile(void)28594 test_xmlOutputBufferCreateFile(void) {
28595     int test_ret = 0;
28596 
28597 #if defined(LIBXML_OUTPUT_ENABLED)
28598     int mem_base;
28599     xmlOutputBufferPtr ret_val;
28600     FILE * file; /* a FILE* */
28601     int n_file;
28602     xmlCharEncodingHandlerPtr encoder; /* the encoding converter or NULL */
28603     int n_encoder;
28604 
28605     for (n_file = 0;n_file < gen_nb_FILE_ptr;n_file++) {
28606     for (n_encoder = 0;n_encoder < gen_nb_xmlCharEncodingHandlerPtr;n_encoder++) {
28607         mem_base = xmlMemBlocks();
28608         file = gen_FILE_ptr(n_file, 0);
28609         encoder = gen_xmlCharEncodingHandlerPtr(n_encoder, 1);
28610 
28611         ret_val = xmlOutputBufferCreateFile(file, encoder);
28612         desret_xmlOutputBufferPtr(ret_val);
28613         call_tests++;
28614         des_FILE_ptr(n_file, file, 0);
28615         des_xmlCharEncodingHandlerPtr(n_encoder, encoder, 1);
28616         xmlResetLastError();
28617         if (mem_base != xmlMemBlocks()) {
28618             printf("Leak of %d blocks found in xmlOutputBufferCreateFile",
28619 	           xmlMemBlocks() - mem_base);
28620 	    test_ret++;
28621             printf(" %d", n_file);
28622             printf(" %d", n_encoder);
28623             printf("\n");
28624         }
28625     }
28626     }
28627     function_tests++;
28628 #endif
28629 
28630     return(test_ret);
28631 }
28632 
28633 
28634 static int
test_xmlOutputBufferCreateFilename(void)28635 test_xmlOutputBufferCreateFilename(void) {
28636     int test_ret = 0;
28637 
28638 #if defined(LIBXML_OUTPUT_ENABLED)
28639     int mem_base;
28640     xmlOutputBufferPtr ret_val;
28641     const char * URI; /* a C string containing the URI or filename */
28642     int n_URI;
28643     xmlCharEncodingHandlerPtr encoder; /* the encoding converter or NULL */
28644     int n_encoder;
28645     int compression; /* the compression ration (0 none, 9 max). */
28646     int n_compression;
28647 
28648     for (n_URI = 0;n_URI < gen_nb_fileoutput;n_URI++) {
28649     for (n_encoder = 0;n_encoder < gen_nb_xmlCharEncodingHandlerPtr;n_encoder++) {
28650     for (n_compression = 0;n_compression < gen_nb_int;n_compression++) {
28651         mem_base = xmlMemBlocks();
28652         URI = gen_fileoutput(n_URI, 0);
28653         encoder = gen_xmlCharEncodingHandlerPtr(n_encoder, 1);
28654         compression = gen_int(n_compression, 2);
28655 
28656         ret_val = xmlOutputBufferCreateFilename(URI, encoder, compression);
28657         desret_xmlOutputBufferPtr(ret_val);
28658         call_tests++;
28659         des_fileoutput(n_URI, URI, 0);
28660         des_xmlCharEncodingHandlerPtr(n_encoder, encoder, 1);
28661         des_int(n_compression, compression, 2);
28662         xmlResetLastError();
28663         if (mem_base != xmlMemBlocks()) {
28664             printf("Leak of %d blocks found in xmlOutputBufferCreateFilename",
28665 	           xmlMemBlocks() - mem_base);
28666 	    test_ret++;
28667             printf(" %d", n_URI);
28668             printf(" %d", n_encoder);
28669             printf(" %d", n_compression);
28670             printf("\n");
28671         }
28672     }
28673     }
28674     }
28675     function_tests++;
28676 #endif
28677 
28678     return(test_ret);
28679 }
28680 
28681 
28682 static int
test_xmlOutputBufferFlush(void)28683 test_xmlOutputBufferFlush(void) {
28684     int test_ret = 0;
28685 
28686 #if defined(LIBXML_OUTPUT_ENABLED)
28687     int mem_base;
28688     int ret_val;
28689     xmlOutputBufferPtr out; /* a buffered output */
28690     int n_out;
28691 
28692     for (n_out = 0;n_out < gen_nb_xmlOutputBufferPtr;n_out++) {
28693         mem_base = xmlMemBlocks();
28694         out = gen_xmlOutputBufferPtr(n_out, 0);
28695 
28696         ret_val = xmlOutputBufferFlush(out);
28697         desret_int(ret_val);
28698         call_tests++;
28699         des_xmlOutputBufferPtr(n_out, out, 0);
28700         xmlResetLastError();
28701         if (mem_base != xmlMemBlocks()) {
28702             printf("Leak of %d blocks found in xmlOutputBufferFlush",
28703 	           xmlMemBlocks() - mem_base);
28704 	    test_ret++;
28705             printf(" %d", n_out);
28706             printf("\n");
28707         }
28708     }
28709     function_tests++;
28710 #endif
28711 
28712     return(test_ret);
28713 }
28714 
28715 
28716 static int
test_xmlOutputBufferGetContent(void)28717 test_xmlOutputBufferGetContent(void) {
28718     int test_ret = 0;
28719 
28720 #if defined(LIBXML_OUTPUT_ENABLED)
28721     int mem_base;
28722     const xmlChar * ret_val;
28723     xmlOutputBufferPtr out; /* an xmlOutputBufferPtr */
28724     int n_out;
28725 
28726     for (n_out = 0;n_out < gen_nb_xmlOutputBufferPtr;n_out++) {
28727         mem_base = xmlMemBlocks();
28728         out = gen_xmlOutputBufferPtr(n_out, 0);
28729 
28730         ret_val = xmlOutputBufferGetContent(out);
28731         desret_const_xmlChar_ptr(ret_val);
28732         call_tests++;
28733         des_xmlOutputBufferPtr(n_out, out, 0);
28734         xmlResetLastError();
28735         if (mem_base != xmlMemBlocks()) {
28736             printf("Leak of %d blocks found in xmlOutputBufferGetContent",
28737 	           xmlMemBlocks() - mem_base);
28738 	    test_ret++;
28739             printf(" %d", n_out);
28740             printf("\n");
28741         }
28742     }
28743     function_tests++;
28744 #endif
28745 
28746     return(test_ret);
28747 }
28748 
28749 
28750 static int
test_xmlOutputBufferGetSize(void)28751 test_xmlOutputBufferGetSize(void) {
28752     int test_ret = 0;
28753 
28754 
28755     /* missing type support */
28756     return(test_ret);
28757 }
28758 
28759 
28760 static int
test_xmlOutputBufferWrite(void)28761 test_xmlOutputBufferWrite(void) {
28762     int test_ret = 0;
28763 
28764 #if defined(LIBXML_OUTPUT_ENABLED)
28765     int mem_base;
28766     int ret_val;
28767     xmlOutputBufferPtr out; /* a buffered parser output */
28768     int n_out;
28769     int len; /* the size in bytes of the array. */
28770     int n_len;
28771     char * buf; /* an char array */
28772     int n_buf;
28773 
28774     for (n_out = 0;n_out < gen_nb_xmlOutputBufferPtr;n_out++) {
28775     for (n_len = 0;n_len < gen_nb_int;n_len++) {
28776     for (n_buf = 0;n_buf < gen_nb_const_char_ptr;n_buf++) {
28777         mem_base = xmlMemBlocks();
28778         out = gen_xmlOutputBufferPtr(n_out, 0);
28779         len = gen_int(n_len, 1);
28780         buf = gen_const_char_ptr(n_buf, 2);
28781         if ((buf != NULL) &&
28782             (len > (int) strlen((const char *) buf) + 1))
28783             continue;
28784 
28785         ret_val = xmlOutputBufferWrite(out, len, (const char *)buf);
28786         desret_int(ret_val);
28787         call_tests++;
28788         des_xmlOutputBufferPtr(n_out, out, 0);
28789         des_int(n_len, len, 1);
28790         des_const_char_ptr(n_buf, (const char *)buf, 2);
28791         xmlResetLastError();
28792         if (mem_base != xmlMemBlocks()) {
28793             printf("Leak of %d blocks found in xmlOutputBufferWrite",
28794 	           xmlMemBlocks() - mem_base);
28795 	    test_ret++;
28796             printf(" %d", n_out);
28797             printf(" %d", n_len);
28798             printf(" %d", n_buf);
28799             printf("\n");
28800         }
28801     }
28802     }
28803     }
28804     function_tests++;
28805 #endif
28806 
28807     return(test_ret);
28808 }
28809 
28810 
28811 static int
test_xmlOutputBufferWriteEscape(void)28812 test_xmlOutputBufferWriteEscape(void) {
28813     int test_ret = 0;
28814 
28815 
28816     /* missing type support */
28817     return(test_ret);
28818 }
28819 
28820 
28821 static int
test_xmlOutputBufferWriteString(void)28822 test_xmlOutputBufferWriteString(void) {
28823     int test_ret = 0;
28824 
28825 #if defined(LIBXML_OUTPUT_ENABLED)
28826     int mem_base;
28827     int ret_val;
28828     xmlOutputBufferPtr out; /* a buffered parser output */
28829     int n_out;
28830     char * str; /* a zero terminated C string */
28831     int n_str;
28832 
28833     for (n_out = 0;n_out < gen_nb_xmlOutputBufferPtr;n_out++) {
28834     for (n_str = 0;n_str < gen_nb_const_char_ptr;n_str++) {
28835         mem_base = xmlMemBlocks();
28836         out = gen_xmlOutputBufferPtr(n_out, 0);
28837         str = gen_const_char_ptr(n_str, 1);
28838 
28839         ret_val = xmlOutputBufferWriteString(out, (const char *)str);
28840         desret_int(ret_val);
28841         call_tests++;
28842         des_xmlOutputBufferPtr(n_out, out, 0);
28843         des_const_char_ptr(n_str, (const char *)str, 1);
28844         xmlResetLastError();
28845         if (mem_base != xmlMemBlocks()) {
28846             printf("Leak of %d blocks found in xmlOutputBufferWriteString",
28847 	           xmlMemBlocks() - mem_base);
28848 	    test_ret++;
28849             printf(" %d", n_out);
28850             printf(" %d", n_str);
28851             printf("\n");
28852         }
28853     }
28854     }
28855     function_tests++;
28856 #endif
28857 
28858     return(test_ret);
28859 }
28860 
28861 
28862 static int
test_xmlParserGetDirectory(void)28863 test_xmlParserGetDirectory(void) {
28864     int test_ret = 0;
28865 
28866 
28867     /* missing type support */
28868     return(test_ret);
28869 }
28870 
28871 
28872 static int
test_xmlParserInputBufferCreateFd(void)28873 test_xmlParserInputBufferCreateFd(void) {
28874     int test_ret = 0;
28875 
28876     int mem_base;
28877     xmlParserInputBufferPtr ret_val;
28878     int fd; /* a file descriptor number */
28879     int n_fd;
28880     xmlCharEncoding enc; /* the charset encoding if known */
28881     int n_enc;
28882 
28883     for (n_fd = 0;n_fd < gen_nb_int;n_fd++) {
28884     for (n_enc = 0;n_enc < gen_nb_xmlCharEncoding;n_enc++) {
28885         mem_base = xmlMemBlocks();
28886         fd = gen_int(n_fd, 0);
28887         enc = gen_xmlCharEncoding(n_enc, 1);
28888         if (fd >= 0) fd = -1;
28889 
28890         ret_val = xmlParserInputBufferCreateFd(fd, enc);
28891         desret_xmlParserInputBufferPtr(ret_val);
28892         call_tests++;
28893         des_int(n_fd, fd, 0);
28894         des_xmlCharEncoding(n_enc, enc, 1);
28895         xmlResetLastError();
28896         if (mem_base != xmlMemBlocks()) {
28897             printf("Leak of %d blocks found in xmlParserInputBufferCreateFd",
28898 	           xmlMemBlocks() - mem_base);
28899 	    test_ret++;
28900             printf(" %d", n_fd);
28901             printf(" %d", n_enc);
28902             printf("\n");
28903         }
28904     }
28905     }
28906     function_tests++;
28907 
28908     return(test_ret);
28909 }
28910 
28911 
28912 static int
test_xmlParserInputBufferCreateFile(void)28913 test_xmlParserInputBufferCreateFile(void) {
28914     int test_ret = 0;
28915 
28916     int mem_base;
28917     xmlParserInputBufferPtr ret_val;
28918     FILE * file; /* a FILE* */
28919     int n_file;
28920     xmlCharEncoding enc; /* the charset encoding if known */
28921     int n_enc;
28922 
28923     for (n_file = 0;n_file < gen_nb_FILE_ptr;n_file++) {
28924     for (n_enc = 0;n_enc < gen_nb_xmlCharEncoding;n_enc++) {
28925         mem_base = xmlMemBlocks();
28926         file = gen_FILE_ptr(n_file, 0);
28927         enc = gen_xmlCharEncoding(n_enc, 1);
28928 
28929         ret_val = xmlParserInputBufferCreateFile(file, enc);
28930         desret_xmlParserInputBufferPtr(ret_val);
28931         call_tests++;
28932         des_FILE_ptr(n_file, file, 0);
28933         des_xmlCharEncoding(n_enc, enc, 1);
28934         xmlResetLastError();
28935         if (mem_base != xmlMemBlocks()) {
28936             printf("Leak of %d blocks found in xmlParserInputBufferCreateFile",
28937 	           xmlMemBlocks() - mem_base);
28938 	    test_ret++;
28939             printf(" %d", n_file);
28940             printf(" %d", n_enc);
28941             printf("\n");
28942         }
28943     }
28944     }
28945     function_tests++;
28946 
28947     return(test_ret);
28948 }
28949 
28950 
28951 static int
test_xmlParserInputBufferCreateFilename(void)28952 test_xmlParserInputBufferCreateFilename(void) {
28953     int test_ret = 0;
28954 
28955     int mem_base;
28956     xmlParserInputBufferPtr ret_val;
28957     const char * URI; /* a C string containing the URI or filename */
28958     int n_URI;
28959     xmlCharEncoding enc; /* the charset encoding if known */
28960     int n_enc;
28961 
28962     for (n_URI = 0;n_URI < gen_nb_fileoutput;n_URI++) {
28963     for (n_enc = 0;n_enc < gen_nb_xmlCharEncoding;n_enc++) {
28964         mem_base = xmlMemBlocks();
28965         URI = gen_fileoutput(n_URI, 0);
28966         enc = gen_xmlCharEncoding(n_enc, 1);
28967 
28968         ret_val = xmlParserInputBufferCreateFilename(URI, enc);
28969         desret_xmlParserInputBufferPtr(ret_val);
28970         call_tests++;
28971         des_fileoutput(n_URI, URI, 0);
28972         des_xmlCharEncoding(n_enc, enc, 1);
28973         xmlResetLastError();
28974         if (mem_base != xmlMemBlocks()) {
28975             printf("Leak of %d blocks found in xmlParserInputBufferCreateFilename",
28976 	           xmlMemBlocks() - mem_base);
28977 	    test_ret++;
28978             printf(" %d", n_URI);
28979             printf(" %d", n_enc);
28980             printf("\n");
28981         }
28982     }
28983     }
28984     function_tests++;
28985 
28986     return(test_ret);
28987 }
28988 
28989 
28990 static int
test_xmlParserInputBufferCreateMem(void)28991 test_xmlParserInputBufferCreateMem(void) {
28992     int test_ret = 0;
28993 
28994     int mem_base;
28995     xmlParserInputBufferPtr ret_val;
28996     char * mem; /* the memory input */
28997     int n_mem;
28998     int size; /* the length of the memory block */
28999     int n_size;
29000     xmlCharEncoding enc; /* the charset encoding if known */
29001     int n_enc;
29002 
29003     for (n_mem = 0;n_mem < gen_nb_const_char_ptr;n_mem++) {
29004     for (n_size = 0;n_size < gen_nb_int;n_size++) {
29005     for (n_enc = 0;n_enc < gen_nb_xmlCharEncoding;n_enc++) {
29006         mem_base = xmlMemBlocks();
29007         mem = gen_const_char_ptr(n_mem, 0);
29008         size = gen_int(n_size, 1);
29009         enc = gen_xmlCharEncoding(n_enc, 2);
29010         if ((mem != NULL) &&
29011             (size > (int) strlen((const char *) mem) + 1))
29012             continue;
29013 
29014         ret_val = xmlParserInputBufferCreateMem((const char *)mem, size, enc);
29015         desret_xmlParserInputBufferPtr(ret_val);
29016         call_tests++;
29017         des_const_char_ptr(n_mem, (const char *)mem, 0);
29018         des_int(n_size, size, 1);
29019         des_xmlCharEncoding(n_enc, enc, 2);
29020         xmlResetLastError();
29021         if (mem_base != xmlMemBlocks()) {
29022             printf("Leak of %d blocks found in xmlParserInputBufferCreateMem",
29023 	           xmlMemBlocks() - mem_base);
29024 	    test_ret++;
29025             printf(" %d", n_mem);
29026             printf(" %d", n_size);
29027             printf(" %d", n_enc);
29028             printf("\n");
29029         }
29030     }
29031     }
29032     }
29033     function_tests++;
29034 
29035     return(test_ret);
29036 }
29037 
29038 
29039 static int
test_xmlParserInputBufferCreateStatic(void)29040 test_xmlParserInputBufferCreateStatic(void) {
29041     int test_ret = 0;
29042 
29043     int mem_base;
29044     xmlParserInputBufferPtr ret_val;
29045     char * mem; /* the memory input */
29046     int n_mem;
29047     int size; /* the length of the memory block */
29048     int n_size;
29049     xmlCharEncoding enc; /* the charset encoding if known */
29050     int n_enc;
29051 
29052     for (n_mem = 0;n_mem < gen_nb_const_char_ptr;n_mem++) {
29053     for (n_size = 0;n_size < gen_nb_int;n_size++) {
29054     for (n_enc = 0;n_enc < gen_nb_xmlCharEncoding;n_enc++) {
29055         mem_base = xmlMemBlocks();
29056         mem = gen_const_char_ptr(n_mem, 0);
29057         size = gen_int(n_size, 1);
29058         enc = gen_xmlCharEncoding(n_enc, 2);
29059         if ((mem != NULL) &&
29060             (size > (int) strlen((const char *) mem) + 1))
29061             continue;
29062 
29063         ret_val = xmlParserInputBufferCreateStatic((const char *)mem, size, enc);
29064         desret_xmlParserInputBufferPtr(ret_val);
29065         call_tests++;
29066         des_const_char_ptr(n_mem, (const char *)mem, 0);
29067         des_int(n_size, size, 1);
29068         des_xmlCharEncoding(n_enc, enc, 2);
29069         xmlResetLastError();
29070         if (mem_base != xmlMemBlocks()) {
29071             printf("Leak of %d blocks found in xmlParserInputBufferCreateStatic",
29072 	           xmlMemBlocks() - mem_base);
29073 	    test_ret++;
29074             printf(" %d", n_mem);
29075             printf(" %d", n_size);
29076             printf(" %d", n_enc);
29077             printf("\n");
29078         }
29079     }
29080     }
29081     }
29082     function_tests++;
29083 
29084     return(test_ret);
29085 }
29086 
29087 
29088 static int
test_xmlParserInputBufferGrow(void)29089 test_xmlParserInputBufferGrow(void) {
29090     int test_ret = 0;
29091 
29092     int mem_base;
29093     int ret_val;
29094     xmlParserInputBufferPtr in; /* a buffered parser input */
29095     int n_in;
29096     int len; /* indicative value of the amount of chars to read */
29097     int n_len;
29098 
29099     for (n_in = 0;n_in < gen_nb_xmlParserInputBufferPtr;n_in++) {
29100     for (n_len = 0;n_len < gen_nb_int;n_len++) {
29101         mem_base = xmlMemBlocks();
29102         in = gen_xmlParserInputBufferPtr(n_in, 0);
29103         len = gen_int(n_len, 1);
29104 
29105         ret_val = xmlParserInputBufferGrow(in, len);
29106         desret_int(ret_val);
29107         call_tests++;
29108         des_xmlParserInputBufferPtr(n_in, in, 0);
29109         des_int(n_len, len, 1);
29110         xmlResetLastError();
29111         if (mem_base != xmlMemBlocks()) {
29112             printf("Leak of %d blocks found in xmlParserInputBufferGrow",
29113 	           xmlMemBlocks() - mem_base);
29114 	    test_ret++;
29115             printf(" %d", n_in);
29116             printf(" %d", n_len);
29117             printf("\n");
29118         }
29119     }
29120     }
29121     function_tests++;
29122 
29123     return(test_ret);
29124 }
29125 
29126 
29127 static int
test_xmlParserInputBufferPush(void)29128 test_xmlParserInputBufferPush(void) {
29129     int test_ret = 0;
29130 
29131     int mem_base;
29132     int ret_val;
29133     xmlParserInputBufferPtr in; /* a buffered parser input */
29134     int n_in;
29135     int len; /* the size in bytes of the array. */
29136     int n_len;
29137     char * buf; /* an char array */
29138     int n_buf;
29139 
29140     for (n_in = 0;n_in < gen_nb_xmlParserInputBufferPtr;n_in++) {
29141     for (n_len = 0;n_len < gen_nb_int;n_len++) {
29142     for (n_buf = 0;n_buf < gen_nb_const_char_ptr;n_buf++) {
29143         mem_base = xmlMemBlocks();
29144         in = gen_xmlParserInputBufferPtr(n_in, 0);
29145         len = gen_int(n_len, 1);
29146         buf = gen_const_char_ptr(n_buf, 2);
29147         if ((buf != NULL) &&
29148             (len > (int) strlen((const char *) buf) + 1))
29149             continue;
29150 
29151         ret_val = xmlParserInputBufferPush(in, len, (const char *)buf);
29152         desret_int(ret_val);
29153         call_tests++;
29154         des_xmlParserInputBufferPtr(n_in, in, 0);
29155         des_int(n_len, len, 1);
29156         des_const_char_ptr(n_buf, (const char *)buf, 2);
29157         xmlResetLastError();
29158         if (mem_base != xmlMemBlocks()) {
29159             printf("Leak of %d blocks found in xmlParserInputBufferPush",
29160 	           xmlMemBlocks() - mem_base);
29161 	    test_ret++;
29162             printf(" %d", n_in);
29163             printf(" %d", n_len);
29164             printf(" %d", n_buf);
29165             printf("\n");
29166         }
29167     }
29168     }
29169     }
29170     function_tests++;
29171 
29172     return(test_ret);
29173 }
29174 
29175 
29176 static int
test_xmlParserInputBufferRead(void)29177 test_xmlParserInputBufferRead(void) {
29178     int test_ret = 0;
29179 
29180     int mem_base;
29181     int ret_val;
29182     xmlParserInputBufferPtr in; /* a buffered parser input */
29183     int n_in;
29184     int len; /* indicative value of the amount of chars to read */
29185     int n_len;
29186 
29187     for (n_in = 0;n_in < gen_nb_xmlParserInputBufferPtr;n_in++) {
29188     for (n_len = 0;n_len < gen_nb_int;n_len++) {
29189         mem_base = xmlMemBlocks();
29190         in = gen_xmlParserInputBufferPtr(n_in, 0);
29191         len = gen_int(n_len, 1);
29192 
29193         ret_val = xmlParserInputBufferRead(in, len);
29194         desret_int(ret_val);
29195         call_tests++;
29196         des_xmlParserInputBufferPtr(n_in, in, 0);
29197         des_int(n_len, len, 1);
29198         xmlResetLastError();
29199         if (mem_base != xmlMemBlocks()) {
29200             printf("Leak of %d blocks found in xmlParserInputBufferRead",
29201 	           xmlMemBlocks() - mem_base);
29202 	    test_ret++;
29203             printf(" %d", n_in);
29204             printf(" %d", n_len);
29205             printf("\n");
29206         }
29207     }
29208     }
29209     function_tests++;
29210 
29211     return(test_ret);
29212 }
29213 
29214 
29215 static int
test_xmlPopInputCallbacks(void)29216 test_xmlPopInputCallbacks(void) {
29217     int test_ret = 0;
29218 
29219     int mem_base;
29220     int ret_val;
29221 
29222         mem_base = xmlMemBlocks();
29223 
29224         ret_val = xmlPopInputCallbacks();
29225         desret_int(ret_val);
29226         call_tests++;
29227         xmlResetLastError();
29228         if (mem_base != xmlMemBlocks()) {
29229             printf("Leak of %d blocks found in xmlPopInputCallbacks",
29230 	           xmlMemBlocks() - mem_base);
29231 	    test_ret++;
29232             printf("\n");
29233         }
29234     function_tests++;
29235 
29236     return(test_ret);
29237 }
29238 
29239 
29240 static int
test_xmlRegisterDefaultInputCallbacks(void)29241 test_xmlRegisterDefaultInputCallbacks(void) {
29242     int test_ret = 0;
29243 
29244     int mem_base;
29245 
29246         mem_base = xmlMemBlocks();
29247 
29248         xmlRegisterDefaultInputCallbacks();
29249         call_tests++;
29250         xmlResetLastError();
29251         if (mem_base != xmlMemBlocks()) {
29252             printf("Leak of %d blocks found in xmlRegisterDefaultInputCallbacks",
29253 	           xmlMemBlocks() - mem_base);
29254 	    test_ret++;
29255             printf("\n");
29256         }
29257     function_tests++;
29258 
29259     return(test_ret);
29260 }
29261 
29262 
29263 static int
test_xmlRegisterDefaultOutputCallbacks(void)29264 test_xmlRegisterDefaultOutputCallbacks(void) {
29265     int test_ret = 0;
29266 
29267 #if defined(LIBXML_OUTPUT_ENABLED)
29268     int mem_base;
29269 
29270         mem_base = xmlMemBlocks();
29271 
29272         xmlRegisterDefaultOutputCallbacks();
29273         call_tests++;
29274         xmlResetLastError();
29275         if (mem_base != xmlMemBlocks()) {
29276             printf("Leak of %d blocks found in xmlRegisterDefaultOutputCallbacks",
29277 	           xmlMemBlocks() - mem_base);
29278 	    test_ret++;
29279             printf("\n");
29280         }
29281     function_tests++;
29282 #endif
29283 
29284     return(test_ret);
29285 }
29286 
29287 
29288 static int
test_xmlRegisterHTTPPostCallbacks(void)29289 test_xmlRegisterHTTPPostCallbacks(void) {
29290     int test_ret = 0;
29291 
29292 #if defined(LIBXML_OUTPUT_ENABLED) && defined(LIBXML_HTTP_ENABLED)
29293     int mem_base;
29294 
29295         mem_base = xmlMemBlocks();
29296 
29297         xmlRegisterHTTPPostCallbacks();
29298         call_tests++;
29299         xmlResetLastError();
29300         if (mem_base != xmlMemBlocks()) {
29301             printf("Leak of %d blocks found in xmlRegisterHTTPPostCallbacks",
29302 	           xmlMemBlocks() - mem_base);
29303 	    test_ret++;
29304             printf("\n");
29305         }
29306     function_tests++;
29307 #endif
29308 
29309     return(test_ret);
29310 }
29311 
29312 static int
test_xmlIO(void)29313 test_xmlIO(void) {
29314     int test_ret = 0;
29315 
29316     if (quiet == 0) printf("Testing xmlIO : 40 of 50 functions ...\n");
29317     test_ret += test_xmlAllocOutputBuffer();
29318     test_ret += test_xmlAllocParserInputBuffer();
29319     test_ret += test_xmlCheckFilename();
29320     test_ret += test_xmlCheckHTTPInput();
29321     test_ret += test_xmlCleanupInputCallbacks();
29322     test_ret += test_xmlCleanupOutputCallbacks();
29323     test_ret += test_xmlFileClose();
29324     test_ret += test_xmlFileMatch();
29325     test_ret += test_xmlFileOpen();
29326     test_ret += test_xmlFileRead();
29327     test_ret += test_xmlIOFTPClose();
29328     test_ret += test_xmlIOFTPMatch();
29329     test_ret += test_xmlIOFTPOpen();
29330     test_ret += test_xmlIOFTPRead();
29331     test_ret += test_xmlIOHTTPClose();
29332     test_ret += test_xmlIOHTTPMatch();
29333     test_ret += test_xmlIOHTTPOpen();
29334     test_ret += test_xmlIOHTTPRead();
29335     test_ret += test_xmlNoNetExternalEntityLoader();
29336     test_ret += test_xmlNormalizeWindowsPath();
29337     test_ret += test_xmlOutputBufferCreateBuffer();
29338     test_ret += test_xmlOutputBufferCreateFd();
29339     test_ret += test_xmlOutputBufferCreateFile();
29340     test_ret += test_xmlOutputBufferCreateFilename();
29341     test_ret += test_xmlOutputBufferFlush();
29342     test_ret += test_xmlOutputBufferGetContent();
29343     test_ret += test_xmlOutputBufferGetSize();
29344     test_ret += test_xmlOutputBufferWrite();
29345     test_ret += test_xmlOutputBufferWriteEscape();
29346     test_ret += test_xmlOutputBufferWriteString();
29347     test_ret += test_xmlParserGetDirectory();
29348     test_ret += test_xmlParserInputBufferCreateFd();
29349     test_ret += test_xmlParserInputBufferCreateFile();
29350     test_ret += test_xmlParserInputBufferCreateFilename();
29351     test_ret += test_xmlParserInputBufferCreateMem();
29352     test_ret += test_xmlParserInputBufferCreateStatic();
29353     test_ret += test_xmlParserInputBufferGrow();
29354     test_ret += test_xmlParserInputBufferPush();
29355     test_ret += test_xmlParserInputBufferRead();
29356     test_ret += test_xmlPopInputCallbacks();
29357     test_ret += test_xmlRegisterDefaultInputCallbacks();
29358     test_ret += test_xmlRegisterDefaultOutputCallbacks();
29359     test_ret += test_xmlRegisterHTTPPostCallbacks();
29360 
29361     if (test_ret != 0)
29362 	printf("Module xmlIO: %d errors\n", test_ret);
29363     return(test_ret);
29364 }
29365 
29366 static int
test_xmlAutomataCompile(void)29367 test_xmlAutomataCompile(void) {
29368     int test_ret = 0;
29369 
29370 
29371     /* missing type support */
29372     return(test_ret);
29373 }
29374 
29375 
29376 static int
test_xmlAutomataGetInitState(void)29377 test_xmlAutomataGetInitState(void) {
29378     int test_ret = 0;
29379 
29380 
29381     /* missing type support */
29382     return(test_ret);
29383 }
29384 
29385 #ifdef LIBXML_AUTOMATA_ENABLED
29386 
29387 #define gen_nb_xmlAutomataPtr 1
gen_xmlAutomataPtr(int no ATTRIBUTE_UNUSED,int nr ATTRIBUTE_UNUSED)29388 static xmlAutomataPtr gen_xmlAutomataPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
29389     return(NULL);
29390 }
des_xmlAutomataPtr(int no ATTRIBUTE_UNUSED,xmlAutomataPtr val ATTRIBUTE_UNUSED,int nr ATTRIBUTE_UNUSED)29391 static void des_xmlAutomataPtr(int no ATTRIBUTE_UNUSED, xmlAutomataPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
29392 }
29393 #endif
29394 
29395 
29396 static int
test_xmlAutomataIsDeterminist(void)29397 test_xmlAutomataIsDeterminist(void) {
29398     int test_ret = 0;
29399 
29400 #if defined(LIBXML_REGEXP_ENABLED) && defined(LIBXML_AUTOMATA_ENABLED)
29401     int mem_base;
29402     int ret_val;
29403     xmlAutomataPtr am; /* an automata */
29404     int n_am;
29405 
29406     for (n_am = 0;n_am < gen_nb_xmlAutomataPtr;n_am++) {
29407         mem_base = xmlMemBlocks();
29408         am = gen_xmlAutomataPtr(n_am, 0);
29409 
29410         ret_val = xmlAutomataIsDeterminist(am);
29411         desret_int(ret_val);
29412         call_tests++;
29413         des_xmlAutomataPtr(n_am, am, 0);
29414         xmlResetLastError();
29415         if (mem_base != xmlMemBlocks()) {
29416             printf("Leak of %d blocks found in xmlAutomataIsDeterminist",
29417 	           xmlMemBlocks() - mem_base);
29418 	    test_ret++;
29419             printf(" %d", n_am);
29420             printf("\n");
29421         }
29422     }
29423     function_tests++;
29424 #endif
29425 
29426     return(test_ret);
29427 }
29428 
29429 
29430 static int
test_xmlAutomataNewAllTrans(void)29431 test_xmlAutomataNewAllTrans(void) {
29432     int test_ret = 0;
29433 
29434 
29435     /* missing type support */
29436     return(test_ret);
29437 }
29438 
29439 
29440 static int
test_xmlAutomataNewCountTrans(void)29441 test_xmlAutomataNewCountTrans(void) {
29442     int test_ret = 0;
29443 
29444 
29445     /* missing type support */
29446     return(test_ret);
29447 }
29448 
29449 
29450 static int
test_xmlAutomataNewCountTrans2(void)29451 test_xmlAutomataNewCountTrans2(void) {
29452     int test_ret = 0;
29453 
29454 
29455     /* missing type support */
29456     return(test_ret);
29457 }
29458 
29459 
29460 static int
test_xmlAutomataNewCountedTrans(void)29461 test_xmlAutomataNewCountedTrans(void) {
29462     int test_ret = 0;
29463 
29464 
29465     /* missing type support */
29466     return(test_ret);
29467 }
29468 
29469 
29470 static int
test_xmlAutomataNewCounter(void)29471 test_xmlAutomataNewCounter(void) {
29472     int test_ret = 0;
29473 
29474 #if defined(LIBXML_REGEXP_ENABLED) && defined(LIBXML_AUTOMATA_ENABLED)
29475     int mem_base;
29476     int ret_val;
29477     xmlAutomataPtr am; /* an automata */
29478     int n_am;
29479     int min; /* the minimal value on the counter */
29480     int n_min;
29481     int max; /* the maximal value on the counter */
29482     int n_max;
29483 
29484     for (n_am = 0;n_am < gen_nb_xmlAutomataPtr;n_am++) {
29485     for (n_min = 0;n_min < gen_nb_int;n_min++) {
29486     for (n_max = 0;n_max < gen_nb_int;n_max++) {
29487         mem_base = xmlMemBlocks();
29488         am = gen_xmlAutomataPtr(n_am, 0);
29489         min = gen_int(n_min, 1);
29490         max = gen_int(n_max, 2);
29491 
29492         ret_val = xmlAutomataNewCounter(am, min, max);
29493         desret_int(ret_val);
29494         call_tests++;
29495         des_xmlAutomataPtr(n_am, am, 0);
29496         des_int(n_min, min, 1);
29497         des_int(n_max, max, 2);
29498         xmlResetLastError();
29499         if (mem_base != xmlMemBlocks()) {
29500             printf("Leak of %d blocks found in xmlAutomataNewCounter",
29501 	           xmlMemBlocks() - mem_base);
29502 	    test_ret++;
29503             printf(" %d", n_am);
29504             printf(" %d", n_min);
29505             printf(" %d", n_max);
29506             printf("\n");
29507         }
29508     }
29509     }
29510     }
29511     function_tests++;
29512 #endif
29513 
29514     return(test_ret);
29515 }
29516 
29517 
29518 static int
test_xmlAutomataNewCounterTrans(void)29519 test_xmlAutomataNewCounterTrans(void) {
29520     int test_ret = 0;
29521 
29522 
29523     /* missing type support */
29524     return(test_ret);
29525 }
29526 
29527 
29528 static int
test_xmlAutomataNewEpsilon(void)29529 test_xmlAutomataNewEpsilon(void) {
29530     int test_ret = 0;
29531 
29532 
29533     /* missing type support */
29534     return(test_ret);
29535 }
29536 
29537 
29538 static int
test_xmlAutomataNewNegTrans(void)29539 test_xmlAutomataNewNegTrans(void) {
29540     int test_ret = 0;
29541 
29542 
29543     /* missing type support */
29544     return(test_ret);
29545 }
29546 
29547 
29548 static int
test_xmlAutomataNewOnceTrans(void)29549 test_xmlAutomataNewOnceTrans(void) {
29550     int test_ret = 0;
29551 
29552 
29553     /* missing type support */
29554     return(test_ret);
29555 }
29556 
29557 
29558 static int
test_xmlAutomataNewOnceTrans2(void)29559 test_xmlAutomataNewOnceTrans2(void) {
29560     int test_ret = 0;
29561 
29562 
29563     /* missing type support */
29564     return(test_ret);
29565 }
29566 
29567 
29568 static int
test_xmlAutomataNewState(void)29569 test_xmlAutomataNewState(void) {
29570     int test_ret = 0;
29571 
29572 
29573     /* missing type support */
29574     return(test_ret);
29575 }
29576 
29577 
29578 static int
test_xmlAutomataNewTransition(void)29579 test_xmlAutomataNewTransition(void) {
29580     int test_ret = 0;
29581 
29582 
29583     /* missing type support */
29584     return(test_ret);
29585 }
29586 
29587 
29588 static int
test_xmlAutomataNewTransition2(void)29589 test_xmlAutomataNewTransition2(void) {
29590     int test_ret = 0;
29591 
29592 
29593     /* missing type support */
29594     return(test_ret);
29595 }
29596 
29597 #ifdef LIBXML_AUTOMATA_ENABLED
29598 
29599 #define gen_nb_xmlAutomataStatePtr 1
gen_xmlAutomataStatePtr(int no ATTRIBUTE_UNUSED,int nr ATTRIBUTE_UNUSED)29600 static xmlAutomataStatePtr gen_xmlAutomataStatePtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
29601     return(NULL);
29602 }
des_xmlAutomataStatePtr(int no ATTRIBUTE_UNUSED,xmlAutomataStatePtr val ATTRIBUTE_UNUSED,int nr ATTRIBUTE_UNUSED)29603 static void des_xmlAutomataStatePtr(int no ATTRIBUTE_UNUSED, xmlAutomataStatePtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
29604 }
29605 #endif
29606 
29607 
29608 static int
test_xmlAutomataSetFinalState(void)29609 test_xmlAutomataSetFinalState(void) {
29610     int test_ret = 0;
29611 
29612 #if defined(LIBXML_REGEXP_ENABLED) && defined(LIBXML_AUTOMATA_ENABLED)
29613     int mem_base;
29614     int ret_val;
29615     xmlAutomataPtr am; /* an automata */
29616     int n_am;
29617     xmlAutomataStatePtr state; /* a state in this automata */
29618     int n_state;
29619 
29620     for (n_am = 0;n_am < gen_nb_xmlAutomataPtr;n_am++) {
29621     for (n_state = 0;n_state < gen_nb_xmlAutomataStatePtr;n_state++) {
29622         mem_base = xmlMemBlocks();
29623         am = gen_xmlAutomataPtr(n_am, 0);
29624         state = gen_xmlAutomataStatePtr(n_state, 1);
29625 
29626         ret_val = xmlAutomataSetFinalState(am, state);
29627         desret_int(ret_val);
29628         call_tests++;
29629         des_xmlAutomataPtr(n_am, am, 0);
29630         des_xmlAutomataStatePtr(n_state, state, 1);
29631         xmlResetLastError();
29632         if (mem_base != xmlMemBlocks()) {
29633             printf("Leak of %d blocks found in xmlAutomataSetFinalState",
29634 	           xmlMemBlocks() - mem_base);
29635 	    test_ret++;
29636             printf(" %d", n_am);
29637             printf(" %d", n_state);
29638             printf("\n");
29639         }
29640     }
29641     }
29642     function_tests++;
29643 #endif
29644 
29645     return(test_ret);
29646 }
29647 
29648 
29649 static int
test_xmlNewAutomata(void)29650 test_xmlNewAutomata(void) {
29651     int test_ret = 0;
29652 
29653 
29654     /* missing type support */
29655     return(test_ret);
29656 }
29657 
29658 static int
test_xmlautomata(void)29659 test_xmlautomata(void) {
29660     int test_ret = 0;
29661 
29662     if (quiet == 0) printf("Testing xmlautomata : 3 of 19 functions ...\n");
29663     test_ret += test_xmlAutomataCompile();
29664     test_ret += test_xmlAutomataGetInitState();
29665     test_ret += test_xmlAutomataIsDeterminist();
29666     test_ret += test_xmlAutomataNewAllTrans();
29667     test_ret += test_xmlAutomataNewCountTrans();
29668     test_ret += test_xmlAutomataNewCountTrans2();
29669     test_ret += test_xmlAutomataNewCountedTrans();
29670     test_ret += test_xmlAutomataNewCounter();
29671     test_ret += test_xmlAutomataNewCounterTrans();
29672     test_ret += test_xmlAutomataNewEpsilon();
29673     test_ret += test_xmlAutomataNewNegTrans();
29674     test_ret += test_xmlAutomataNewOnceTrans();
29675     test_ret += test_xmlAutomataNewOnceTrans2();
29676     test_ret += test_xmlAutomataNewState();
29677     test_ret += test_xmlAutomataNewTransition();
29678     test_ret += test_xmlAutomataNewTransition2();
29679     test_ret += test_xmlAutomataSetFinalState();
29680     test_ret += test_xmlNewAutomata();
29681 
29682     if (test_ret != 0)
29683 	printf("Module xmlautomata: %d errors\n", test_ret);
29684     return(test_ret);
29685 }
29686 
29687 #define gen_nb_xmlGenericErrorFunc_ptr 1
gen_xmlGenericErrorFunc_ptr(int no ATTRIBUTE_UNUSED,int nr ATTRIBUTE_UNUSED)29688 static xmlGenericErrorFunc * gen_xmlGenericErrorFunc_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
29689     return(NULL);
29690 }
des_xmlGenericErrorFunc_ptr(int no ATTRIBUTE_UNUSED,xmlGenericErrorFunc * val ATTRIBUTE_UNUSED,int nr ATTRIBUTE_UNUSED)29691 static void des_xmlGenericErrorFunc_ptr(int no ATTRIBUTE_UNUSED, xmlGenericErrorFunc * val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
29692 }
29693 
29694 static int
test_initGenericErrorDefaultFunc(void)29695 test_initGenericErrorDefaultFunc(void) {
29696     int test_ret = 0;
29697 
29698     int mem_base;
29699     xmlGenericErrorFunc * handler; /* the handler */
29700     int n_handler;
29701 
29702     for (n_handler = 0;n_handler < gen_nb_xmlGenericErrorFunc_ptr;n_handler++) {
29703         mem_base = xmlMemBlocks();
29704         handler = gen_xmlGenericErrorFunc_ptr(n_handler, 0);
29705 
29706         initGenericErrorDefaultFunc(handler);
29707         call_tests++;
29708         des_xmlGenericErrorFunc_ptr(n_handler, handler, 0);
29709         xmlResetLastError();
29710         if (mem_base != xmlMemBlocks()) {
29711             printf("Leak of %d blocks found in initGenericErrorDefaultFunc",
29712 	           xmlMemBlocks() - mem_base);
29713 	    test_ret++;
29714             printf(" %d", n_handler);
29715             printf("\n");
29716         }
29717     }
29718     function_tests++;
29719 
29720     return(test_ret);
29721 }
29722 
29723 
29724 #define gen_nb_xmlErrorPtr 1
gen_xmlErrorPtr(int no ATTRIBUTE_UNUSED,int nr ATTRIBUTE_UNUSED)29725 static xmlErrorPtr gen_xmlErrorPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
29726     return(NULL);
29727 }
des_xmlErrorPtr(int no ATTRIBUTE_UNUSED,xmlErrorPtr val ATTRIBUTE_UNUSED,int nr ATTRIBUTE_UNUSED)29728 static void des_xmlErrorPtr(int no ATTRIBUTE_UNUSED, xmlErrorPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
29729 }
29730 
29731 static int
test_xmlCopyError(void)29732 test_xmlCopyError(void) {
29733     int test_ret = 0;
29734 
29735     int mem_base;
29736     int ret_val;
29737     xmlErrorPtr from; /* a source error */
29738     int n_from;
29739     xmlErrorPtr to; /* a target error */
29740     int n_to;
29741 
29742     for (n_from = 0;n_from < gen_nb_xmlErrorPtr;n_from++) {
29743     for (n_to = 0;n_to < gen_nb_xmlErrorPtr;n_to++) {
29744         mem_base = xmlMemBlocks();
29745         from = gen_xmlErrorPtr(n_from, 0);
29746         to = gen_xmlErrorPtr(n_to, 1);
29747 
29748         ret_val = xmlCopyError(from, to);
29749         desret_int(ret_val);
29750         call_tests++;
29751         des_xmlErrorPtr(n_from, from, 0);
29752         des_xmlErrorPtr(n_to, to, 1);
29753         xmlResetLastError();
29754         if (mem_base != xmlMemBlocks()) {
29755             printf("Leak of %d blocks found in xmlCopyError",
29756 	           xmlMemBlocks() - mem_base);
29757 	    test_ret++;
29758             printf(" %d", n_from);
29759             printf(" %d", n_to);
29760             printf("\n");
29761         }
29762     }
29763     }
29764     function_tests++;
29765 
29766     return(test_ret);
29767 }
29768 
29769 
29770 static int
test_xmlCtxtGetLastError(void)29771 test_xmlCtxtGetLastError(void) {
29772     int test_ret = 0;
29773 
29774 
29775     /* missing type support */
29776     return(test_ret);
29777 }
29778 
29779 
29780 static int
test_xmlCtxtResetLastError(void)29781 test_xmlCtxtResetLastError(void) {
29782     int test_ret = 0;
29783 
29784     int mem_base;
29785     void * ctx; /* an XML parser context */
29786     int n_ctx;
29787 
29788     for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
29789         mem_base = xmlMemBlocks();
29790         ctx = gen_void_ptr(n_ctx, 0);
29791 
29792         xmlCtxtResetLastError(ctx);
29793         call_tests++;
29794         des_void_ptr(n_ctx, ctx, 0);
29795         xmlResetLastError();
29796         if (mem_base != xmlMemBlocks()) {
29797             printf("Leak of %d blocks found in xmlCtxtResetLastError",
29798 	           xmlMemBlocks() - mem_base);
29799 	    test_ret++;
29800             printf(" %d", n_ctx);
29801             printf("\n");
29802         }
29803     }
29804     function_tests++;
29805 
29806     return(test_ret);
29807 }
29808 
29809 
29810 static int
test_xmlGetLastError(void)29811 test_xmlGetLastError(void) {
29812     int test_ret = 0;
29813 
29814 
29815     /* missing type support */
29816     return(test_ret);
29817 }
29818 
29819 
29820 static int
test_xmlParserError(void)29821 test_xmlParserError(void) {
29822     int test_ret = 0;
29823 
29824 
29825     /* missing type support */
29826     return(test_ret);
29827 }
29828 
29829 
29830 static int
test_xmlParserPrintFileContext(void)29831 test_xmlParserPrintFileContext(void) {
29832     int test_ret = 0;
29833 
29834     int mem_base;
29835     xmlParserInputPtr input; /* an xmlParserInputPtr input */
29836     int n_input;
29837 
29838     for (n_input = 0;n_input < gen_nb_xmlParserInputPtr;n_input++) {
29839         mem_base = xmlMemBlocks();
29840         input = gen_xmlParserInputPtr(n_input, 0);
29841 
29842         xmlParserPrintFileContext(input);
29843         call_tests++;
29844         des_xmlParserInputPtr(n_input, input, 0);
29845         xmlResetLastError();
29846         if (mem_base != xmlMemBlocks()) {
29847             printf("Leak of %d blocks found in xmlParserPrintFileContext",
29848 	           xmlMemBlocks() - mem_base);
29849 	    test_ret++;
29850             printf(" %d", n_input);
29851             printf("\n");
29852         }
29853     }
29854     function_tests++;
29855 
29856     return(test_ret);
29857 }
29858 
29859 
29860 static int
test_xmlParserPrintFileInfo(void)29861 test_xmlParserPrintFileInfo(void) {
29862     int test_ret = 0;
29863 
29864     int mem_base;
29865     xmlParserInputPtr input; /* an xmlParserInputPtr input */
29866     int n_input;
29867 
29868     for (n_input = 0;n_input < gen_nb_xmlParserInputPtr;n_input++) {
29869         mem_base = xmlMemBlocks();
29870         input = gen_xmlParserInputPtr(n_input, 0);
29871 
29872         xmlParserPrintFileInfo(input);
29873         call_tests++;
29874         des_xmlParserInputPtr(n_input, input, 0);
29875         xmlResetLastError();
29876         if (mem_base != xmlMemBlocks()) {
29877             printf("Leak of %d blocks found in xmlParserPrintFileInfo",
29878 	           xmlMemBlocks() - mem_base);
29879 	    test_ret++;
29880             printf(" %d", n_input);
29881             printf("\n");
29882         }
29883     }
29884     function_tests++;
29885 
29886     return(test_ret);
29887 }
29888 
29889 
29890 static int
test_xmlParserValidityError(void)29891 test_xmlParserValidityError(void) {
29892     int test_ret = 0;
29893 
29894 
29895     /* missing type support */
29896     return(test_ret);
29897 }
29898 
29899 
29900 static int
test_xmlParserValidityWarning(void)29901 test_xmlParserValidityWarning(void) {
29902     int test_ret = 0;
29903 
29904 
29905     /* missing type support */
29906     return(test_ret);
29907 }
29908 
29909 
29910 static int
test_xmlParserWarning(void)29911 test_xmlParserWarning(void) {
29912     int test_ret = 0;
29913 
29914 
29915     /* missing type support */
29916     return(test_ret);
29917 }
29918 
29919 
29920 static int
test_xmlResetError(void)29921 test_xmlResetError(void) {
29922     int test_ret = 0;
29923 
29924     int mem_base;
29925     xmlErrorPtr err; /* pointer to the error. */
29926     int n_err;
29927 
29928     for (n_err = 0;n_err < gen_nb_xmlErrorPtr;n_err++) {
29929         mem_base = xmlMemBlocks();
29930         err = gen_xmlErrorPtr(n_err, 0);
29931 
29932         xmlResetError(err);
29933         call_tests++;
29934         des_xmlErrorPtr(n_err, err, 0);
29935         xmlResetLastError();
29936         if (mem_base != xmlMemBlocks()) {
29937             printf("Leak of %d blocks found in xmlResetError",
29938 	           xmlMemBlocks() - mem_base);
29939 	    test_ret++;
29940             printf(" %d", n_err);
29941             printf("\n");
29942         }
29943     }
29944     function_tests++;
29945 
29946     return(test_ret);
29947 }
29948 
29949 
29950 static int
test_xmlResetLastError(void)29951 test_xmlResetLastError(void) {
29952     int test_ret = 0;
29953 
29954 
29955 
29956         xmlResetLastError();
29957         call_tests++;
29958         xmlResetLastError();
29959     function_tests++;
29960 
29961     return(test_ret);
29962 }
29963 
29964 
29965 static int
test_xmlSetGenericErrorFunc(void)29966 test_xmlSetGenericErrorFunc(void) {
29967     int test_ret = 0;
29968 
29969 
29970     /* missing type support */
29971     return(test_ret);
29972 }
29973 
29974 
29975 static int
test_xmlSetStructuredErrorFunc(void)29976 test_xmlSetStructuredErrorFunc(void) {
29977     int test_ret = 0;
29978 
29979 
29980     /* missing type support */
29981     return(test_ret);
29982 }
29983 
29984 static int
test_xmlerror(void)29985 test_xmlerror(void) {
29986     int test_ret = 0;
29987 
29988     if (quiet == 0) printf("Testing xmlerror : 7 of 15 functions ...\n");
29989     test_ret += test_initGenericErrorDefaultFunc();
29990     test_ret += test_xmlCopyError();
29991     test_ret += test_xmlCtxtGetLastError();
29992     test_ret += test_xmlCtxtResetLastError();
29993     test_ret += test_xmlGetLastError();
29994     test_ret += test_xmlParserError();
29995     test_ret += test_xmlParserPrintFileContext();
29996     test_ret += test_xmlParserPrintFileInfo();
29997     test_ret += test_xmlParserValidityError();
29998     test_ret += test_xmlParserValidityWarning();
29999     test_ret += test_xmlParserWarning();
30000     test_ret += test_xmlResetError();
30001     test_ret += test_xmlResetLastError();
30002     test_ret += test_xmlSetGenericErrorFunc();
30003     test_ret += test_xmlSetStructuredErrorFunc();
30004 
30005     if (test_ret != 0)
30006 	printf("Module xmlerror: %d errors\n", test_ret);
30007     return(test_ret);
30008 }
30009 #ifdef LIBXML_MODULES_ENABLED
30010 
30011 #define gen_nb_xmlModulePtr 1
gen_xmlModulePtr(int no ATTRIBUTE_UNUSED,int nr ATTRIBUTE_UNUSED)30012 static xmlModulePtr gen_xmlModulePtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
30013     return(NULL);
30014 }
des_xmlModulePtr(int no ATTRIBUTE_UNUSED,xmlModulePtr val ATTRIBUTE_UNUSED,int nr ATTRIBUTE_UNUSED)30015 static void des_xmlModulePtr(int no ATTRIBUTE_UNUSED, xmlModulePtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
30016 }
30017 #endif
30018 
30019 
30020 static int
test_xmlModuleClose(void)30021 test_xmlModuleClose(void) {
30022     int test_ret = 0;
30023 
30024 #if defined(LIBXML_MODULES_ENABLED)
30025     int mem_base;
30026     int ret_val;
30027     xmlModulePtr module; /* the module handle */
30028     int n_module;
30029 
30030     for (n_module = 0;n_module < gen_nb_xmlModulePtr;n_module++) {
30031         mem_base = xmlMemBlocks();
30032         module = gen_xmlModulePtr(n_module, 0);
30033 
30034         ret_val = xmlModuleClose(module);
30035         desret_int(ret_val);
30036         call_tests++;
30037         des_xmlModulePtr(n_module, module, 0);
30038         xmlResetLastError();
30039         if (mem_base != xmlMemBlocks()) {
30040             printf("Leak of %d blocks found in xmlModuleClose",
30041 	           xmlMemBlocks() - mem_base);
30042 	    test_ret++;
30043             printf(" %d", n_module);
30044             printf("\n");
30045         }
30046     }
30047     function_tests++;
30048 #endif
30049 
30050     return(test_ret);
30051 }
30052 
30053 
30054 static int
test_xmlModuleOpen(void)30055 test_xmlModuleOpen(void) {
30056     int test_ret = 0;
30057 
30058 
30059     /* missing type support */
30060     return(test_ret);
30061 }
30062 
30063 
30064 static int
test_xmlModuleSymbol(void)30065 test_xmlModuleSymbol(void) {
30066     int test_ret = 0;
30067 
30068 #if defined(LIBXML_MODULES_ENABLED)
30069     int mem_base;
30070     int ret_val;
30071     xmlModulePtr module; /* the module */
30072     int n_module;
30073     char * name; /* the name of the symbol */
30074     int n_name;
30075     void ** symbol; /* the resulting symbol address */
30076     int n_symbol;
30077 
30078     for (n_module = 0;n_module < gen_nb_xmlModulePtr;n_module++) {
30079     for (n_name = 0;n_name < gen_nb_const_char_ptr;n_name++) {
30080     for (n_symbol = 0;n_symbol < gen_nb_void_ptr_ptr;n_symbol++) {
30081         mem_base = xmlMemBlocks();
30082         module = gen_xmlModulePtr(n_module, 0);
30083         name = gen_const_char_ptr(n_name, 1);
30084         symbol = gen_void_ptr_ptr(n_symbol, 2);
30085 
30086         ret_val = xmlModuleSymbol(module, (const char *)name, symbol);
30087         desret_int(ret_val);
30088         call_tests++;
30089         des_xmlModulePtr(n_module, module, 0);
30090         des_const_char_ptr(n_name, (const char *)name, 1);
30091         des_void_ptr_ptr(n_symbol, symbol, 2);
30092         xmlResetLastError();
30093         if (mem_base != xmlMemBlocks()) {
30094             printf("Leak of %d blocks found in xmlModuleSymbol",
30095 	           xmlMemBlocks() - mem_base);
30096 	    test_ret++;
30097             printf(" %d", n_module);
30098             printf(" %d", n_name);
30099             printf(" %d", n_symbol);
30100             printf("\n");
30101         }
30102     }
30103     }
30104     }
30105     function_tests++;
30106 #endif
30107 
30108     return(test_ret);
30109 }
30110 
30111 static int
test_xmlmodule(void)30112 test_xmlmodule(void) {
30113     int test_ret = 0;
30114 
30115     if (quiet == 0) printf("Testing xmlmodule : 2 of 4 functions ...\n");
30116     test_ret += test_xmlModuleClose();
30117     test_ret += test_xmlModuleOpen();
30118     test_ret += test_xmlModuleSymbol();
30119 
30120     if (test_ret != 0)
30121 	printf("Module xmlmodule: %d errors\n", test_ret);
30122     return(test_ret);
30123 }
30124 
30125 static int
test_xmlNewTextReader(void)30126 test_xmlNewTextReader(void) {
30127     int test_ret = 0;
30128 
30129 #if defined(LIBXML_READER_ENABLED)
30130     int mem_base;
30131     xmlTextReaderPtr ret_val;
30132     xmlParserInputBufferPtr input; /* the xmlParserInputBufferPtr used to read data */
30133     int n_input;
30134     const char * URI; /* the URI information for the source if available */
30135     int n_URI;
30136 
30137     for (n_input = 0;n_input < gen_nb_xmlParserInputBufferPtr;n_input++) {
30138     for (n_URI = 0;n_URI < gen_nb_filepath;n_URI++) {
30139         mem_base = xmlMemBlocks();
30140         input = gen_xmlParserInputBufferPtr(n_input, 0);
30141         URI = gen_filepath(n_URI, 1);
30142 
30143         ret_val = xmlNewTextReader(input, URI);
30144         desret_xmlTextReaderPtr(ret_val);
30145         call_tests++;
30146         des_xmlParserInputBufferPtr(n_input, input, 0);
30147         des_filepath(n_URI, URI, 1);
30148         xmlResetLastError();
30149         if (mem_base != xmlMemBlocks()) {
30150             printf("Leak of %d blocks found in xmlNewTextReader",
30151 	           xmlMemBlocks() - mem_base);
30152 	    test_ret++;
30153             printf(" %d", n_input);
30154             printf(" %d", n_URI);
30155             printf("\n");
30156         }
30157     }
30158     }
30159     function_tests++;
30160 #endif
30161 
30162     return(test_ret);
30163 }
30164 
30165 
30166 static int
test_xmlNewTextReaderFilename(void)30167 test_xmlNewTextReaderFilename(void) {
30168     int test_ret = 0;
30169 
30170 #if defined(LIBXML_READER_ENABLED)
30171     int mem_base;
30172     xmlTextReaderPtr ret_val;
30173     const char * URI; /* the URI of the resource to process */
30174     int n_URI;
30175 
30176     for (n_URI = 0;n_URI < gen_nb_filepath;n_URI++) {
30177         mem_base = xmlMemBlocks();
30178         URI = gen_filepath(n_URI, 0);
30179 
30180         ret_val = xmlNewTextReaderFilename(URI);
30181         desret_xmlTextReaderPtr(ret_val);
30182         call_tests++;
30183         des_filepath(n_URI, URI, 0);
30184         xmlResetLastError();
30185         if (mem_base != xmlMemBlocks()) {
30186             printf("Leak of %d blocks found in xmlNewTextReaderFilename",
30187 	           xmlMemBlocks() - mem_base);
30188 	    test_ret++;
30189             printf(" %d", n_URI);
30190             printf("\n");
30191         }
30192     }
30193     function_tests++;
30194 #endif
30195 
30196     return(test_ret);
30197 }
30198 
30199 
30200 static int
test_xmlReaderForDoc(void)30201 test_xmlReaderForDoc(void) {
30202     int test_ret = 0;
30203 
30204 #if defined(LIBXML_READER_ENABLED)
30205     int mem_base;
30206     xmlTextReaderPtr ret_val;
30207     xmlChar * cur; /* a pointer to a zero terminated string */
30208     int n_cur;
30209     const char * URL; /* the base URL to use for the document */
30210     int n_URL;
30211     char * encoding; /* the document encoding, or NULL */
30212     int n_encoding;
30213     int options; /* a combination of xmlParserOption */
30214     int n_options;
30215 
30216     for (n_cur = 0;n_cur < gen_nb_const_xmlChar_ptr;n_cur++) {
30217     for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) {
30218     for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
30219     for (n_options = 0;n_options < gen_nb_parseroptions;n_options++) {
30220         mem_base = xmlMemBlocks();
30221         cur = gen_const_xmlChar_ptr(n_cur, 0);
30222         URL = gen_filepath(n_URL, 1);
30223         encoding = gen_const_char_ptr(n_encoding, 2);
30224         options = gen_parseroptions(n_options, 3);
30225 
30226         ret_val = xmlReaderForDoc((const xmlChar *)cur, URL, (const char *)encoding, options);
30227         desret_xmlTextReaderPtr(ret_val);
30228         call_tests++;
30229         des_const_xmlChar_ptr(n_cur, (const xmlChar *)cur, 0);
30230         des_filepath(n_URL, URL, 1);
30231         des_const_char_ptr(n_encoding, (const char *)encoding, 2);
30232         des_parseroptions(n_options, options, 3);
30233         xmlResetLastError();
30234         if (mem_base != xmlMemBlocks()) {
30235             printf("Leak of %d blocks found in xmlReaderForDoc",
30236 	           xmlMemBlocks() - mem_base);
30237 	    test_ret++;
30238             printf(" %d", n_cur);
30239             printf(" %d", n_URL);
30240             printf(" %d", n_encoding);
30241             printf(" %d", n_options);
30242             printf("\n");
30243         }
30244     }
30245     }
30246     }
30247     }
30248     function_tests++;
30249 #endif
30250 
30251     return(test_ret);
30252 }
30253 
30254 
30255 static int
test_xmlReaderForFile(void)30256 test_xmlReaderForFile(void) {
30257     int test_ret = 0;
30258 
30259 #if defined(LIBXML_READER_ENABLED)
30260     int mem_base;
30261     xmlTextReaderPtr ret_val;
30262     const char * filename; /* a file or URL */
30263     int n_filename;
30264     char * encoding; /* the document encoding, or NULL */
30265     int n_encoding;
30266     int options; /* a combination of xmlParserOption */
30267     int n_options;
30268 
30269     for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
30270     for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
30271     for (n_options = 0;n_options < gen_nb_parseroptions;n_options++) {
30272         mem_base = xmlMemBlocks();
30273         filename = gen_filepath(n_filename, 0);
30274         encoding = gen_const_char_ptr(n_encoding, 1);
30275         options = gen_parseroptions(n_options, 2);
30276 
30277         ret_val = xmlReaderForFile(filename, (const char *)encoding, options);
30278         desret_xmlTextReaderPtr(ret_val);
30279         call_tests++;
30280         des_filepath(n_filename, filename, 0);
30281         des_const_char_ptr(n_encoding, (const char *)encoding, 1);
30282         des_parseroptions(n_options, options, 2);
30283         xmlResetLastError();
30284         if (mem_base != xmlMemBlocks()) {
30285             printf("Leak of %d blocks found in xmlReaderForFile",
30286 	           xmlMemBlocks() - mem_base);
30287 	    test_ret++;
30288             printf(" %d", n_filename);
30289             printf(" %d", n_encoding);
30290             printf(" %d", n_options);
30291             printf("\n");
30292         }
30293     }
30294     }
30295     }
30296     function_tests++;
30297 #endif
30298 
30299     return(test_ret);
30300 }
30301 
30302 
30303 static int
test_xmlReaderForMemory(void)30304 test_xmlReaderForMemory(void) {
30305     int test_ret = 0;
30306 
30307 #if defined(LIBXML_READER_ENABLED)
30308     int mem_base;
30309     xmlTextReaderPtr ret_val;
30310     char * buffer; /* a pointer to a char array */
30311     int n_buffer;
30312     int size; /* the size of the array */
30313     int n_size;
30314     const char * URL; /* the base URL to use for the document */
30315     int n_URL;
30316     char * encoding; /* the document encoding, or NULL */
30317     int n_encoding;
30318     int options; /* a combination of xmlParserOption */
30319     int n_options;
30320 
30321     for (n_buffer = 0;n_buffer < gen_nb_const_char_ptr;n_buffer++) {
30322     for (n_size = 0;n_size < gen_nb_int;n_size++) {
30323     for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) {
30324     for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
30325     for (n_options = 0;n_options < gen_nb_parseroptions;n_options++) {
30326         mem_base = xmlMemBlocks();
30327         buffer = gen_const_char_ptr(n_buffer, 0);
30328         size = gen_int(n_size, 1);
30329         URL = gen_filepath(n_URL, 2);
30330         encoding = gen_const_char_ptr(n_encoding, 3);
30331         options = gen_parseroptions(n_options, 4);
30332         if ((buffer != NULL) &&
30333             (size > (int) strlen((const char *) buffer) + 1))
30334             continue;
30335 
30336         ret_val = xmlReaderForMemory((const char *)buffer, size, URL, (const char *)encoding, options);
30337         desret_xmlTextReaderPtr(ret_val);
30338         call_tests++;
30339         des_const_char_ptr(n_buffer, (const char *)buffer, 0);
30340         des_int(n_size, size, 1);
30341         des_filepath(n_URL, URL, 2);
30342         des_const_char_ptr(n_encoding, (const char *)encoding, 3);
30343         des_parseroptions(n_options, options, 4);
30344         xmlResetLastError();
30345         if (mem_base != xmlMemBlocks()) {
30346             printf("Leak of %d blocks found in xmlReaderForMemory",
30347 	           xmlMemBlocks() - mem_base);
30348 	    test_ret++;
30349             printf(" %d", n_buffer);
30350             printf(" %d", n_size);
30351             printf(" %d", n_URL);
30352             printf(" %d", n_encoding);
30353             printf(" %d", n_options);
30354             printf("\n");
30355         }
30356     }
30357     }
30358     }
30359     }
30360     }
30361     function_tests++;
30362 #endif
30363 
30364     return(test_ret);
30365 }
30366 
30367 
30368 static int
test_xmlReaderNewDoc(void)30369 test_xmlReaderNewDoc(void) {
30370     int test_ret = 0;
30371 
30372 #if defined(LIBXML_READER_ENABLED)
30373     int mem_base;
30374     int ret_val;
30375     xmlTextReaderPtr reader; /* an XML reader */
30376     int n_reader;
30377     xmlChar * cur; /* a pointer to a zero terminated string */
30378     int n_cur;
30379     const char * URL; /* the base URL to use for the document */
30380     int n_URL;
30381     char * encoding; /* the document encoding, or NULL */
30382     int n_encoding;
30383     int options; /* a combination of xmlParserOption */
30384     int n_options;
30385 
30386     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
30387     for (n_cur = 0;n_cur < gen_nb_const_xmlChar_ptr;n_cur++) {
30388     for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) {
30389     for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
30390     for (n_options = 0;n_options < gen_nb_parseroptions;n_options++) {
30391         mem_base = xmlMemBlocks();
30392         reader = gen_xmlTextReaderPtr(n_reader, 0);
30393         cur = gen_const_xmlChar_ptr(n_cur, 1);
30394         URL = gen_filepath(n_URL, 2);
30395         encoding = gen_const_char_ptr(n_encoding, 3);
30396         options = gen_parseroptions(n_options, 4);
30397 
30398         ret_val = xmlReaderNewDoc(reader, (const xmlChar *)cur, URL, (const char *)encoding, options);
30399         desret_int(ret_val);
30400         call_tests++;
30401         des_xmlTextReaderPtr(n_reader, reader, 0);
30402         des_const_xmlChar_ptr(n_cur, (const xmlChar *)cur, 1);
30403         des_filepath(n_URL, URL, 2);
30404         des_const_char_ptr(n_encoding, (const char *)encoding, 3);
30405         des_parseroptions(n_options, options, 4);
30406         xmlResetLastError();
30407         if (mem_base != xmlMemBlocks()) {
30408             printf("Leak of %d blocks found in xmlReaderNewDoc",
30409 	           xmlMemBlocks() - mem_base);
30410 	    test_ret++;
30411             printf(" %d", n_reader);
30412             printf(" %d", n_cur);
30413             printf(" %d", n_URL);
30414             printf(" %d", n_encoding);
30415             printf(" %d", n_options);
30416             printf("\n");
30417         }
30418     }
30419     }
30420     }
30421     }
30422     }
30423     function_tests++;
30424 #endif
30425 
30426     return(test_ret);
30427 }
30428 
30429 
30430 static int
test_xmlReaderNewFile(void)30431 test_xmlReaderNewFile(void) {
30432     int test_ret = 0;
30433 
30434 #if defined(LIBXML_READER_ENABLED)
30435     int mem_base;
30436     int ret_val;
30437     xmlTextReaderPtr reader; /* an XML reader */
30438     int n_reader;
30439     const char * filename; /* a file or URL */
30440     int n_filename;
30441     char * encoding; /* the document encoding, or NULL */
30442     int n_encoding;
30443     int options; /* a combination of xmlParserOption */
30444     int n_options;
30445 
30446     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
30447     for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
30448     for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
30449     for (n_options = 0;n_options < gen_nb_parseroptions;n_options++) {
30450         mem_base = xmlMemBlocks();
30451         reader = gen_xmlTextReaderPtr(n_reader, 0);
30452         filename = gen_filepath(n_filename, 1);
30453         encoding = gen_const_char_ptr(n_encoding, 2);
30454         options = gen_parseroptions(n_options, 3);
30455 
30456         ret_val = xmlReaderNewFile(reader, filename, (const char *)encoding, options);
30457         desret_int(ret_val);
30458         call_tests++;
30459         des_xmlTextReaderPtr(n_reader, reader, 0);
30460         des_filepath(n_filename, filename, 1);
30461         des_const_char_ptr(n_encoding, (const char *)encoding, 2);
30462         des_parseroptions(n_options, options, 3);
30463         xmlResetLastError();
30464         if (mem_base != xmlMemBlocks()) {
30465             printf("Leak of %d blocks found in xmlReaderNewFile",
30466 	           xmlMemBlocks() - mem_base);
30467 	    test_ret++;
30468             printf(" %d", n_reader);
30469             printf(" %d", n_filename);
30470             printf(" %d", n_encoding);
30471             printf(" %d", n_options);
30472             printf("\n");
30473         }
30474     }
30475     }
30476     }
30477     }
30478     function_tests++;
30479 #endif
30480 
30481     return(test_ret);
30482 }
30483 
30484 
30485 static int
test_xmlReaderNewMemory(void)30486 test_xmlReaderNewMemory(void) {
30487     int test_ret = 0;
30488 
30489 #if defined(LIBXML_READER_ENABLED)
30490     int mem_base;
30491     int ret_val;
30492     xmlTextReaderPtr reader; /* an XML reader */
30493     int n_reader;
30494     char * buffer; /* a pointer to a char array */
30495     int n_buffer;
30496     int size; /* the size of the array */
30497     int n_size;
30498     const char * URL; /* the base URL to use for the document */
30499     int n_URL;
30500     char * encoding; /* the document encoding, or NULL */
30501     int n_encoding;
30502     int options; /* a combination of xmlParserOption */
30503     int n_options;
30504 
30505     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
30506     for (n_buffer = 0;n_buffer < gen_nb_const_char_ptr;n_buffer++) {
30507     for (n_size = 0;n_size < gen_nb_int;n_size++) {
30508     for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) {
30509     for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
30510     for (n_options = 0;n_options < gen_nb_parseroptions;n_options++) {
30511         mem_base = xmlMemBlocks();
30512         reader = gen_xmlTextReaderPtr(n_reader, 0);
30513         buffer = gen_const_char_ptr(n_buffer, 1);
30514         size = gen_int(n_size, 2);
30515         URL = gen_filepath(n_URL, 3);
30516         encoding = gen_const_char_ptr(n_encoding, 4);
30517         options = gen_parseroptions(n_options, 5);
30518         if ((buffer != NULL) &&
30519             (size > (int) strlen((const char *) buffer) + 1))
30520             continue;
30521 
30522         ret_val = xmlReaderNewMemory(reader, (const char *)buffer, size, URL, (const char *)encoding, options);
30523         desret_int(ret_val);
30524         call_tests++;
30525         des_xmlTextReaderPtr(n_reader, reader, 0);
30526         des_const_char_ptr(n_buffer, (const char *)buffer, 1);
30527         des_int(n_size, size, 2);
30528         des_filepath(n_URL, URL, 3);
30529         des_const_char_ptr(n_encoding, (const char *)encoding, 4);
30530         des_parseroptions(n_options, options, 5);
30531         xmlResetLastError();
30532         if (mem_base != xmlMemBlocks()) {
30533             printf("Leak of %d blocks found in xmlReaderNewMemory",
30534 	           xmlMemBlocks() - mem_base);
30535 	    test_ret++;
30536             printf(" %d", n_reader);
30537             printf(" %d", n_buffer);
30538             printf(" %d", n_size);
30539             printf(" %d", n_URL);
30540             printf(" %d", n_encoding);
30541             printf(" %d", n_options);
30542             printf("\n");
30543         }
30544     }
30545     }
30546     }
30547     }
30548     }
30549     }
30550     function_tests++;
30551 #endif
30552 
30553     return(test_ret);
30554 }
30555 
30556 
30557 static int
test_xmlReaderNewWalker(void)30558 test_xmlReaderNewWalker(void) {
30559     int test_ret = 0;
30560 
30561 #if defined(LIBXML_READER_ENABLED)
30562     int mem_base;
30563     int ret_val;
30564     xmlTextReaderPtr reader; /* an XML reader */
30565     int n_reader;
30566     xmlDocPtr doc; /* a preparsed document */
30567     int n_doc;
30568 
30569     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
30570     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
30571         mem_base = xmlMemBlocks();
30572         reader = gen_xmlTextReaderPtr(n_reader, 0);
30573         doc = gen_xmlDocPtr(n_doc, 1);
30574 
30575         ret_val = xmlReaderNewWalker(reader, doc);
30576         desret_int(ret_val);
30577         call_tests++;
30578         des_xmlTextReaderPtr(n_reader, reader, 0);
30579         des_xmlDocPtr(n_doc, doc, 1);
30580         xmlResetLastError();
30581         if (mem_base != xmlMemBlocks()) {
30582             printf("Leak of %d blocks found in xmlReaderNewWalker",
30583 	           xmlMemBlocks() - mem_base);
30584 	    test_ret++;
30585             printf(" %d", n_reader);
30586             printf(" %d", n_doc);
30587             printf("\n");
30588         }
30589     }
30590     }
30591     function_tests++;
30592 #endif
30593 
30594     return(test_ret);
30595 }
30596 
30597 
30598 static int
test_xmlReaderWalker(void)30599 test_xmlReaderWalker(void) {
30600     int test_ret = 0;
30601 
30602 #if defined(LIBXML_READER_ENABLED)
30603     int mem_base;
30604     xmlTextReaderPtr ret_val;
30605     xmlDocPtr doc; /* a preparsed document */
30606     int n_doc;
30607 
30608     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
30609         mem_base = xmlMemBlocks();
30610         doc = gen_xmlDocPtr(n_doc, 0);
30611 
30612         ret_val = xmlReaderWalker(doc);
30613         desret_xmlTextReaderPtr(ret_val);
30614         call_tests++;
30615         des_xmlDocPtr(n_doc, doc, 0);
30616         xmlResetLastError();
30617         if (mem_base != xmlMemBlocks()) {
30618             printf("Leak of %d blocks found in xmlReaderWalker",
30619 	           xmlMemBlocks() - mem_base);
30620 	    test_ret++;
30621             printf(" %d", n_doc);
30622             printf("\n");
30623         }
30624     }
30625     function_tests++;
30626 #endif
30627 
30628     return(test_ret);
30629 }
30630 
30631 
30632 static int
test_xmlTextReaderAttributeCount(void)30633 test_xmlTextReaderAttributeCount(void) {
30634     int test_ret = 0;
30635 
30636 #if defined(LIBXML_READER_ENABLED)
30637     int mem_base;
30638     int ret_val;
30639     xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
30640     int n_reader;
30641 
30642     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
30643         mem_base = xmlMemBlocks();
30644         reader = gen_xmlTextReaderPtr(n_reader, 0);
30645 
30646         ret_val = xmlTextReaderAttributeCount(reader);
30647         desret_int(ret_val);
30648         call_tests++;
30649         des_xmlTextReaderPtr(n_reader, reader, 0);
30650         xmlResetLastError();
30651         if (mem_base != xmlMemBlocks()) {
30652             printf("Leak of %d blocks found in xmlTextReaderAttributeCount",
30653 	           xmlMemBlocks() - mem_base);
30654 	    test_ret++;
30655             printf(" %d", n_reader);
30656             printf("\n");
30657         }
30658     }
30659     function_tests++;
30660 #endif
30661 
30662     return(test_ret);
30663 }
30664 
30665 
30666 static int
test_xmlTextReaderBaseUri(void)30667 test_xmlTextReaderBaseUri(void) {
30668     int test_ret = 0;
30669 
30670 #if defined(LIBXML_READER_ENABLED)
30671     int mem_base;
30672     xmlChar * ret_val;
30673     xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
30674     int n_reader;
30675 
30676     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
30677         mem_base = xmlMemBlocks();
30678         reader = gen_xmlTextReaderPtr(n_reader, 0);
30679 
30680         ret_val = xmlTextReaderBaseUri(reader);
30681         desret_xmlChar_ptr(ret_val);
30682         call_tests++;
30683         des_xmlTextReaderPtr(n_reader, reader, 0);
30684         xmlResetLastError();
30685         if (mem_base != xmlMemBlocks()) {
30686             printf("Leak of %d blocks found in xmlTextReaderBaseUri",
30687 	           xmlMemBlocks() - mem_base);
30688 	    test_ret++;
30689             printf(" %d", n_reader);
30690             printf("\n");
30691         }
30692     }
30693     function_tests++;
30694 #endif
30695 
30696     return(test_ret);
30697 }
30698 
30699 
30700 static int
test_xmlTextReaderByteConsumed(void)30701 test_xmlTextReaderByteConsumed(void) {
30702     int test_ret = 0;
30703 
30704 #if defined(LIBXML_READER_ENABLED)
30705     int mem_base;
30706     long ret_val;
30707     xmlTextReaderPtr reader; /* an XML reader */
30708     int n_reader;
30709 
30710     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
30711         mem_base = xmlMemBlocks();
30712         reader = gen_xmlTextReaderPtr(n_reader, 0);
30713 
30714         ret_val = xmlTextReaderByteConsumed(reader);
30715         desret_long(ret_val);
30716         call_tests++;
30717         des_xmlTextReaderPtr(n_reader, reader, 0);
30718         xmlResetLastError();
30719         if (mem_base != xmlMemBlocks()) {
30720             printf("Leak of %d blocks found in xmlTextReaderByteConsumed",
30721 	           xmlMemBlocks() - mem_base);
30722 	    test_ret++;
30723             printf(" %d", n_reader);
30724             printf("\n");
30725         }
30726     }
30727     function_tests++;
30728 #endif
30729 
30730     return(test_ret);
30731 }
30732 
30733 
30734 static int
test_xmlTextReaderClose(void)30735 test_xmlTextReaderClose(void) {
30736     int test_ret = 0;
30737 
30738 #if defined(LIBXML_READER_ENABLED)
30739     int mem_base;
30740     int ret_val;
30741     xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
30742     int n_reader;
30743 
30744     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
30745         mem_base = xmlMemBlocks();
30746         reader = gen_xmlTextReaderPtr(n_reader, 0);
30747 
30748         ret_val = xmlTextReaderClose(reader);
30749         desret_int(ret_val);
30750         call_tests++;
30751         des_xmlTextReaderPtr(n_reader, reader, 0);
30752         xmlResetLastError();
30753         if (mem_base != xmlMemBlocks()) {
30754             printf("Leak of %d blocks found in xmlTextReaderClose",
30755 	           xmlMemBlocks() - mem_base);
30756 	    test_ret++;
30757             printf(" %d", n_reader);
30758             printf("\n");
30759         }
30760     }
30761     function_tests++;
30762 #endif
30763 
30764     return(test_ret);
30765 }
30766 
30767 
30768 static int
test_xmlTextReaderConstBaseUri(void)30769 test_xmlTextReaderConstBaseUri(void) {
30770     int test_ret = 0;
30771 
30772 #if defined(LIBXML_READER_ENABLED)
30773     int mem_base;
30774     const xmlChar * ret_val;
30775     xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
30776     int n_reader;
30777 
30778     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
30779         mem_base = xmlMemBlocks();
30780         reader = gen_xmlTextReaderPtr(n_reader, 0);
30781 
30782         ret_val = xmlTextReaderConstBaseUri(reader);
30783         desret_const_xmlChar_ptr(ret_val);
30784         call_tests++;
30785         des_xmlTextReaderPtr(n_reader, reader, 0);
30786         xmlResetLastError();
30787         if (mem_base != xmlMemBlocks()) {
30788             printf("Leak of %d blocks found in xmlTextReaderConstBaseUri",
30789 	           xmlMemBlocks() - mem_base);
30790 	    test_ret++;
30791             printf(" %d", n_reader);
30792             printf("\n");
30793         }
30794     }
30795     function_tests++;
30796 #endif
30797 
30798     return(test_ret);
30799 }
30800 
30801 
30802 static int
test_xmlTextReaderConstEncoding(void)30803 test_xmlTextReaderConstEncoding(void) {
30804     int test_ret = 0;
30805 
30806 #if defined(LIBXML_READER_ENABLED)
30807     int mem_base;
30808     const xmlChar * ret_val;
30809     xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
30810     int n_reader;
30811 
30812     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
30813         mem_base = xmlMemBlocks();
30814         reader = gen_xmlTextReaderPtr(n_reader, 0);
30815 
30816         ret_val = xmlTextReaderConstEncoding(reader);
30817         desret_const_xmlChar_ptr(ret_val);
30818         call_tests++;
30819         des_xmlTextReaderPtr(n_reader, reader, 0);
30820         xmlResetLastError();
30821         if (mem_base != xmlMemBlocks()) {
30822             printf("Leak of %d blocks found in xmlTextReaderConstEncoding",
30823 	           xmlMemBlocks() - mem_base);
30824 	    test_ret++;
30825             printf(" %d", n_reader);
30826             printf("\n");
30827         }
30828     }
30829     function_tests++;
30830 #endif
30831 
30832     return(test_ret);
30833 }
30834 
30835 
30836 static int
test_xmlTextReaderConstLocalName(void)30837 test_xmlTextReaderConstLocalName(void) {
30838     int test_ret = 0;
30839 
30840 #if defined(LIBXML_READER_ENABLED)
30841     int mem_base;
30842     const xmlChar * ret_val;
30843     xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
30844     int n_reader;
30845 
30846     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
30847         mem_base = xmlMemBlocks();
30848         reader = gen_xmlTextReaderPtr(n_reader, 0);
30849 
30850         ret_val = xmlTextReaderConstLocalName(reader);
30851         desret_const_xmlChar_ptr(ret_val);
30852         call_tests++;
30853         des_xmlTextReaderPtr(n_reader, reader, 0);
30854         xmlResetLastError();
30855         if (mem_base != xmlMemBlocks()) {
30856             printf("Leak of %d blocks found in xmlTextReaderConstLocalName",
30857 	           xmlMemBlocks() - mem_base);
30858 	    test_ret++;
30859             printf(" %d", n_reader);
30860             printf("\n");
30861         }
30862     }
30863     function_tests++;
30864 #endif
30865 
30866     return(test_ret);
30867 }
30868 
30869 
30870 static int
test_xmlTextReaderConstName(void)30871 test_xmlTextReaderConstName(void) {
30872     int test_ret = 0;
30873 
30874 #if defined(LIBXML_READER_ENABLED)
30875     int mem_base;
30876     const xmlChar * ret_val;
30877     xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
30878     int n_reader;
30879 
30880     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
30881         mem_base = xmlMemBlocks();
30882         reader = gen_xmlTextReaderPtr(n_reader, 0);
30883 
30884         ret_val = xmlTextReaderConstName(reader);
30885         desret_const_xmlChar_ptr(ret_val);
30886         call_tests++;
30887         des_xmlTextReaderPtr(n_reader, reader, 0);
30888         xmlResetLastError();
30889         if (mem_base != xmlMemBlocks()) {
30890             printf("Leak of %d blocks found in xmlTextReaderConstName",
30891 	           xmlMemBlocks() - mem_base);
30892 	    test_ret++;
30893             printf(" %d", n_reader);
30894             printf("\n");
30895         }
30896     }
30897     function_tests++;
30898 #endif
30899 
30900     return(test_ret);
30901 }
30902 
30903 
30904 static int
test_xmlTextReaderConstNamespaceUri(void)30905 test_xmlTextReaderConstNamespaceUri(void) {
30906     int test_ret = 0;
30907 
30908 #if defined(LIBXML_READER_ENABLED)
30909     int mem_base;
30910     const xmlChar * ret_val;
30911     xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
30912     int n_reader;
30913 
30914     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
30915         mem_base = xmlMemBlocks();
30916         reader = gen_xmlTextReaderPtr(n_reader, 0);
30917 
30918         ret_val = xmlTextReaderConstNamespaceUri(reader);
30919         desret_const_xmlChar_ptr(ret_val);
30920         call_tests++;
30921         des_xmlTextReaderPtr(n_reader, reader, 0);
30922         xmlResetLastError();
30923         if (mem_base != xmlMemBlocks()) {
30924             printf("Leak of %d blocks found in xmlTextReaderConstNamespaceUri",
30925 	           xmlMemBlocks() - mem_base);
30926 	    test_ret++;
30927             printf(" %d", n_reader);
30928             printf("\n");
30929         }
30930     }
30931     function_tests++;
30932 #endif
30933 
30934     return(test_ret);
30935 }
30936 
30937 
30938 static int
test_xmlTextReaderConstPrefix(void)30939 test_xmlTextReaderConstPrefix(void) {
30940     int test_ret = 0;
30941 
30942 #if defined(LIBXML_READER_ENABLED)
30943     int mem_base;
30944     const xmlChar * ret_val;
30945     xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
30946     int n_reader;
30947 
30948     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
30949         mem_base = xmlMemBlocks();
30950         reader = gen_xmlTextReaderPtr(n_reader, 0);
30951 
30952         ret_val = xmlTextReaderConstPrefix(reader);
30953         desret_const_xmlChar_ptr(ret_val);
30954         call_tests++;
30955         des_xmlTextReaderPtr(n_reader, reader, 0);
30956         xmlResetLastError();
30957         if (mem_base != xmlMemBlocks()) {
30958             printf("Leak of %d blocks found in xmlTextReaderConstPrefix",
30959 	           xmlMemBlocks() - mem_base);
30960 	    test_ret++;
30961             printf(" %d", n_reader);
30962             printf("\n");
30963         }
30964     }
30965     function_tests++;
30966 #endif
30967 
30968     return(test_ret);
30969 }
30970 
30971 
30972 static int
test_xmlTextReaderConstString(void)30973 test_xmlTextReaderConstString(void) {
30974     int test_ret = 0;
30975 
30976 #if defined(LIBXML_READER_ENABLED)
30977     int mem_base;
30978     const xmlChar * ret_val;
30979     xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
30980     int n_reader;
30981     xmlChar * str; /* the string to intern. */
30982     int n_str;
30983 
30984     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
30985     for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) {
30986         mem_base = xmlMemBlocks();
30987         reader = gen_xmlTextReaderPtr(n_reader, 0);
30988         str = gen_const_xmlChar_ptr(n_str, 1);
30989 
30990         ret_val = xmlTextReaderConstString(reader, (const xmlChar *)str);
30991         desret_const_xmlChar_ptr(ret_val);
30992         call_tests++;
30993         des_xmlTextReaderPtr(n_reader, reader, 0);
30994         des_const_xmlChar_ptr(n_str, (const xmlChar *)str, 1);
30995         xmlResetLastError();
30996         if (mem_base != xmlMemBlocks()) {
30997             printf("Leak of %d blocks found in xmlTextReaderConstString",
30998 	           xmlMemBlocks() - mem_base);
30999 	    test_ret++;
31000             printf(" %d", n_reader);
31001             printf(" %d", n_str);
31002             printf("\n");
31003         }
31004     }
31005     }
31006     function_tests++;
31007 #endif
31008 
31009     return(test_ret);
31010 }
31011 
31012 
31013 static int
test_xmlTextReaderConstValue(void)31014 test_xmlTextReaderConstValue(void) {
31015     int test_ret = 0;
31016 
31017 #if defined(LIBXML_READER_ENABLED)
31018     int mem_base;
31019     const xmlChar * ret_val;
31020     xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
31021     int n_reader;
31022 
31023     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
31024         mem_base = xmlMemBlocks();
31025         reader = gen_xmlTextReaderPtr(n_reader, 0);
31026 
31027         ret_val = xmlTextReaderConstValue(reader);
31028         desret_const_xmlChar_ptr(ret_val);
31029         call_tests++;
31030         des_xmlTextReaderPtr(n_reader, reader, 0);
31031         xmlResetLastError();
31032         if (mem_base != xmlMemBlocks()) {
31033             printf("Leak of %d blocks found in xmlTextReaderConstValue",
31034 	           xmlMemBlocks() - mem_base);
31035 	    test_ret++;
31036             printf(" %d", n_reader);
31037             printf("\n");
31038         }
31039     }
31040     function_tests++;
31041 #endif
31042 
31043     return(test_ret);
31044 }
31045 
31046 
31047 static int
test_xmlTextReaderConstXmlLang(void)31048 test_xmlTextReaderConstXmlLang(void) {
31049     int test_ret = 0;
31050 
31051 #if defined(LIBXML_READER_ENABLED)
31052     int mem_base;
31053     const xmlChar * ret_val;
31054     xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
31055     int n_reader;
31056 
31057     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
31058         mem_base = xmlMemBlocks();
31059         reader = gen_xmlTextReaderPtr(n_reader, 0);
31060 
31061         ret_val = xmlTextReaderConstXmlLang(reader);
31062         desret_const_xmlChar_ptr(ret_val);
31063         call_tests++;
31064         des_xmlTextReaderPtr(n_reader, reader, 0);
31065         xmlResetLastError();
31066         if (mem_base != xmlMemBlocks()) {
31067             printf("Leak of %d blocks found in xmlTextReaderConstXmlLang",
31068 	           xmlMemBlocks() - mem_base);
31069 	    test_ret++;
31070             printf(" %d", n_reader);
31071             printf("\n");
31072         }
31073     }
31074     function_tests++;
31075 #endif
31076 
31077     return(test_ret);
31078 }
31079 
31080 
31081 static int
test_xmlTextReaderConstXmlVersion(void)31082 test_xmlTextReaderConstXmlVersion(void) {
31083     int test_ret = 0;
31084 
31085 #if defined(LIBXML_READER_ENABLED)
31086     int mem_base;
31087     const xmlChar * ret_val;
31088     xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
31089     int n_reader;
31090 
31091     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
31092         mem_base = xmlMemBlocks();
31093         reader = gen_xmlTextReaderPtr(n_reader, 0);
31094 
31095         ret_val = xmlTextReaderConstXmlVersion(reader);
31096         desret_const_xmlChar_ptr(ret_val);
31097         call_tests++;
31098         des_xmlTextReaderPtr(n_reader, reader, 0);
31099         xmlResetLastError();
31100         if (mem_base != xmlMemBlocks()) {
31101             printf("Leak of %d blocks found in xmlTextReaderConstXmlVersion",
31102 	           xmlMemBlocks() - mem_base);
31103 	    test_ret++;
31104             printf(" %d", n_reader);
31105             printf("\n");
31106         }
31107     }
31108     function_tests++;
31109 #endif
31110 
31111     return(test_ret);
31112 }
31113 
31114 
31115 static int
test_xmlTextReaderCurrentDoc(void)31116 test_xmlTextReaderCurrentDoc(void) {
31117     int test_ret = 0;
31118 
31119 #if defined(LIBXML_READER_ENABLED)
31120     int mem_base;
31121     xmlDocPtr ret_val;
31122     xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
31123     int n_reader;
31124 
31125     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
31126         mem_base = xmlMemBlocks();
31127         reader = gen_xmlTextReaderPtr(n_reader, 0);
31128 
31129         ret_val = xmlTextReaderCurrentDoc(reader);
31130         desret_xmlDocPtr(ret_val);
31131         call_tests++;
31132         des_xmlTextReaderPtr(n_reader, reader, 0);
31133         xmlResetLastError();
31134         if (mem_base != xmlMemBlocks()) {
31135             printf("Leak of %d blocks found in xmlTextReaderCurrentDoc",
31136 	           xmlMemBlocks() - mem_base);
31137 	    test_ret++;
31138             printf(" %d", n_reader);
31139             printf("\n");
31140         }
31141     }
31142     function_tests++;
31143 #endif
31144 
31145     return(test_ret);
31146 }
31147 
31148 
31149 static int
test_xmlTextReaderCurrentNode(void)31150 test_xmlTextReaderCurrentNode(void) {
31151     int test_ret = 0;
31152 
31153 #if defined(LIBXML_READER_ENABLED)
31154     int mem_base;
31155     xmlNodePtr ret_val;
31156     xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
31157     int n_reader;
31158 
31159     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
31160         mem_base = xmlMemBlocks();
31161         reader = gen_xmlTextReaderPtr(n_reader, 0);
31162 
31163         ret_val = xmlTextReaderCurrentNode(reader);
31164         desret_xmlNodePtr(ret_val);
31165         call_tests++;
31166         des_xmlTextReaderPtr(n_reader, reader, 0);
31167         xmlResetLastError();
31168         if (mem_base != xmlMemBlocks()) {
31169             printf("Leak of %d blocks found in xmlTextReaderCurrentNode",
31170 	           xmlMemBlocks() - mem_base);
31171 	    test_ret++;
31172             printf(" %d", n_reader);
31173             printf("\n");
31174         }
31175     }
31176     function_tests++;
31177 #endif
31178 
31179     return(test_ret);
31180 }
31181 
31182 
31183 static int
test_xmlTextReaderDepth(void)31184 test_xmlTextReaderDepth(void) {
31185     int test_ret = 0;
31186 
31187 #if defined(LIBXML_READER_ENABLED)
31188     int mem_base;
31189     int ret_val;
31190     xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
31191     int n_reader;
31192 
31193     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
31194         mem_base = xmlMemBlocks();
31195         reader = gen_xmlTextReaderPtr(n_reader, 0);
31196 
31197         ret_val = xmlTextReaderDepth(reader);
31198         desret_int(ret_val);
31199         call_tests++;
31200         des_xmlTextReaderPtr(n_reader, reader, 0);
31201         xmlResetLastError();
31202         if (mem_base != xmlMemBlocks()) {
31203             printf("Leak of %d blocks found in xmlTextReaderDepth",
31204 	           xmlMemBlocks() - mem_base);
31205 	    test_ret++;
31206             printf(" %d", n_reader);
31207             printf("\n");
31208         }
31209     }
31210     function_tests++;
31211 #endif
31212 
31213     return(test_ret);
31214 }
31215 
31216 
31217 static int
test_xmlTextReaderExpand(void)31218 test_xmlTextReaderExpand(void) {
31219     int test_ret = 0;
31220 
31221 #if defined(LIBXML_READER_ENABLED)
31222     int mem_base;
31223     xmlNodePtr ret_val;
31224     xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
31225     int n_reader;
31226 
31227     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
31228         mem_base = xmlMemBlocks();
31229         reader = gen_xmlTextReaderPtr(n_reader, 0);
31230 
31231         ret_val = xmlTextReaderExpand(reader);
31232         desret_xmlNodePtr(ret_val);
31233         call_tests++;
31234         des_xmlTextReaderPtr(n_reader, reader, 0);
31235         xmlResetLastError();
31236         if (mem_base != xmlMemBlocks()) {
31237             printf("Leak of %d blocks found in xmlTextReaderExpand",
31238 	           xmlMemBlocks() - mem_base);
31239 	    test_ret++;
31240             printf(" %d", n_reader);
31241             printf("\n");
31242         }
31243     }
31244     function_tests++;
31245 #endif
31246 
31247     return(test_ret);
31248 }
31249 
31250 
31251 static int
test_xmlTextReaderGetAttribute(void)31252 test_xmlTextReaderGetAttribute(void) {
31253     int test_ret = 0;
31254 
31255 #if defined(LIBXML_READER_ENABLED)
31256     int mem_base;
31257     xmlChar * ret_val;
31258     xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
31259     int n_reader;
31260     xmlChar * name; /* the qualified name of the attribute. */
31261     int n_name;
31262 
31263     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
31264     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
31265         mem_base = xmlMemBlocks();
31266         reader = gen_xmlTextReaderPtr(n_reader, 0);
31267         name = gen_const_xmlChar_ptr(n_name, 1);
31268 
31269         ret_val = xmlTextReaderGetAttribute(reader, (const xmlChar *)name);
31270         desret_xmlChar_ptr(ret_val);
31271         call_tests++;
31272         des_xmlTextReaderPtr(n_reader, reader, 0);
31273         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
31274         xmlResetLastError();
31275         if (mem_base != xmlMemBlocks()) {
31276             printf("Leak of %d blocks found in xmlTextReaderGetAttribute",
31277 	           xmlMemBlocks() - mem_base);
31278 	    test_ret++;
31279             printf(" %d", n_reader);
31280             printf(" %d", n_name);
31281             printf("\n");
31282         }
31283     }
31284     }
31285     function_tests++;
31286 #endif
31287 
31288     return(test_ret);
31289 }
31290 
31291 
31292 static int
test_xmlTextReaderGetAttributeNo(void)31293 test_xmlTextReaderGetAttributeNo(void) {
31294     int test_ret = 0;
31295 
31296 #if defined(LIBXML_READER_ENABLED)
31297     int mem_base;
31298     xmlChar * ret_val;
31299     xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
31300     int n_reader;
31301     int no; /* the zero-based index of the attribute relative to the containing element */
31302     int n_no;
31303 
31304     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
31305     for (n_no = 0;n_no < gen_nb_int;n_no++) {
31306         mem_base = xmlMemBlocks();
31307         reader = gen_xmlTextReaderPtr(n_reader, 0);
31308         no = gen_int(n_no, 1);
31309 
31310         ret_val = xmlTextReaderGetAttributeNo(reader, no);
31311         desret_xmlChar_ptr(ret_val);
31312         call_tests++;
31313         des_xmlTextReaderPtr(n_reader, reader, 0);
31314         des_int(n_no, no, 1);
31315         xmlResetLastError();
31316         if (mem_base != xmlMemBlocks()) {
31317             printf("Leak of %d blocks found in xmlTextReaderGetAttributeNo",
31318 	           xmlMemBlocks() - mem_base);
31319 	    test_ret++;
31320             printf(" %d", n_reader);
31321             printf(" %d", n_no);
31322             printf("\n");
31323         }
31324     }
31325     }
31326     function_tests++;
31327 #endif
31328 
31329     return(test_ret);
31330 }
31331 
31332 
31333 static int
test_xmlTextReaderGetAttributeNs(void)31334 test_xmlTextReaderGetAttributeNs(void) {
31335     int test_ret = 0;
31336 
31337 #if defined(LIBXML_READER_ENABLED)
31338     int mem_base;
31339     xmlChar * ret_val;
31340     xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
31341     int n_reader;
31342     xmlChar * localName; /* the local name of the attribute. */
31343     int n_localName;
31344     xmlChar * namespaceURI; /* the namespace URI of the attribute. */
31345     int n_namespaceURI;
31346 
31347     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
31348     for (n_localName = 0;n_localName < gen_nb_const_xmlChar_ptr;n_localName++) {
31349     for (n_namespaceURI = 0;n_namespaceURI < gen_nb_const_xmlChar_ptr;n_namespaceURI++) {
31350         mem_base = xmlMemBlocks();
31351         reader = gen_xmlTextReaderPtr(n_reader, 0);
31352         localName = gen_const_xmlChar_ptr(n_localName, 1);
31353         namespaceURI = gen_const_xmlChar_ptr(n_namespaceURI, 2);
31354 
31355         ret_val = xmlTextReaderGetAttributeNs(reader, (const xmlChar *)localName, (const xmlChar *)namespaceURI);
31356         desret_xmlChar_ptr(ret_val);
31357         call_tests++;
31358         des_xmlTextReaderPtr(n_reader, reader, 0);
31359         des_const_xmlChar_ptr(n_localName, (const xmlChar *)localName, 1);
31360         des_const_xmlChar_ptr(n_namespaceURI, (const xmlChar *)namespaceURI, 2);
31361         xmlResetLastError();
31362         if (mem_base != xmlMemBlocks()) {
31363             printf("Leak of %d blocks found in xmlTextReaderGetAttributeNs",
31364 	           xmlMemBlocks() - mem_base);
31365 	    test_ret++;
31366             printf(" %d", n_reader);
31367             printf(" %d", n_localName);
31368             printf(" %d", n_namespaceURI);
31369             printf("\n");
31370         }
31371     }
31372     }
31373     }
31374     function_tests++;
31375 #endif
31376 
31377     return(test_ret);
31378 }
31379 
31380 #ifdef LIBXML_READER_ENABLED
31381 
31382 #define gen_nb_xmlTextReaderErrorFunc_ptr 1
gen_xmlTextReaderErrorFunc_ptr(int no ATTRIBUTE_UNUSED,int nr ATTRIBUTE_UNUSED)31383 static xmlTextReaderErrorFunc * gen_xmlTextReaderErrorFunc_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
31384     return(NULL);
31385 }
des_xmlTextReaderErrorFunc_ptr(int no ATTRIBUTE_UNUSED,xmlTextReaderErrorFunc * val ATTRIBUTE_UNUSED,int nr ATTRIBUTE_UNUSED)31386 static void des_xmlTextReaderErrorFunc_ptr(int no ATTRIBUTE_UNUSED, xmlTextReaderErrorFunc * val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
31387 }
31388 #endif
31389 
31390 
31391 static int
test_xmlTextReaderGetErrorHandler(void)31392 test_xmlTextReaderGetErrorHandler(void) {
31393     int test_ret = 0;
31394 
31395 #if defined(LIBXML_READER_ENABLED)
31396     int mem_base;
31397     xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
31398     int n_reader;
31399     xmlTextReaderErrorFunc * f; /* the callback function or NULL is no callback has been registered */
31400     int n_f;
31401     void ** arg; /* a user argument */
31402     int n_arg;
31403 
31404     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
31405     for (n_f = 0;n_f < gen_nb_xmlTextReaderErrorFunc_ptr;n_f++) {
31406     for (n_arg = 0;n_arg < gen_nb_void_ptr_ptr;n_arg++) {
31407         mem_base = xmlMemBlocks();
31408         reader = gen_xmlTextReaderPtr(n_reader, 0);
31409         f = gen_xmlTextReaderErrorFunc_ptr(n_f, 1);
31410         arg = gen_void_ptr_ptr(n_arg, 2);
31411 
31412         xmlTextReaderGetErrorHandler(reader, f, arg);
31413         call_tests++;
31414         des_xmlTextReaderPtr(n_reader, reader, 0);
31415         des_xmlTextReaderErrorFunc_ptr(n_f, f, 1);
31416         des_void_ptr_ptr(n_arg, arg, 2);
31417         xmlResetLastError();
31418         if (mem_base != xmlMemBlocks()) {
31419             printf("Leak of %d blocks found in xmlTextReaderGetErrorHandler",
31420 	           xmlMemBlocks() - mem_base);
31421 	    test_ret++;
31422             printf(" %d", n_reader);
31423             printf(" %d", n_f);
31424             printf(" %d", n_arg);
31425             printf("\n");
31426         }
31427     }
31428     }
31429     }
31430     function_tests++;
31431 #endif
31432 
31433     return(test_ret);
31434 }
31435 
31436 
31437 static int
test_xmlTextReaderGetParserColumnNumber(void)31438 test_xmlTextReaderGetParserColumnNumber(void) {
31439     int test_ret = 0;
31440 
31441 #if defined(LIBXML_READER_ENABLED)
31442     int mem_base;
31443     int ret_val;
31444     xmlTextReaderPtr reader; /* the user data (XML reader context) */
31445     int n_reader;
31446 
31447     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
31448         mem_base = xmlMemBlocks();
31449         reader = gen_xmlTextReaderPtr(n_reader, 0);
31450 
31451         ret_val = xmlTextReaderGetParserColumnNumber(reader);
31452         desret_int(ret_val);
31453         call_tests++;
31454         des_xmlTextReaderPtr(n_reader, reader, 0);
31455         xmlResetLastError();
31456         if (mem_base != xmlMemBlocks()) {
31457             printf("Leak of %d blocks found in xmlTextReaderGetParserColumnNumber",
31458 	           xmlMemBlocks() - mem_base);
31459 	    test_ret++;
31460             printf(" %d", n_reader);
31461             printf("\n");
31462         }
31463     }
31464     function_tests++;
31465 #endif
31466 
31467     return(test_ret);
31468 }
31469 
31470 
31471 static int
test_xmlTextReaderGetParserLineNumber(void)31472 test_xmlTextReaderGetParserLineNumber(void) {
31473     int test_ret = 0;
31474 
31475 #if defined(LIBXML_READER_ENABLED)
31476     int mem_base;
31477     int ret_val;
31478     xmlTextReaderPtr reader; /* the user data (XML reader context) */
31479     int n_reader;
31480 
31481     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
31482         mem_base = xmlMemBlocks();
31483         reader = gen_xmlTextReaderPtr(n_reader, 0);
31484 
31485         ret_val = xmlTextReaderGetParserLineNumber(reader);
31486         desret_int(ret_val);
31487         call_tests++;
31488         des_xmlTextReaderPtr(n_reader, reader, 0);
31489         xmlResetLastError();
31490         if (mem_base != xmlMemBlocks()) {
31491             printf("Leak of %d blocks found in xmlTextReaderGetParserLineNumber",
31492 	           xmlMemBlocks() - mem_base);
31493 	    test_ret++;
31494             printf(" %d", n_reader);
31495             printf("\n");
31496         }
31497     }
31498     function_tests++;
31499 #endif
31500 
31501     return(test_ret);
31502 }
31503 
31504 
31505 static int
test_xmlTextReaderGetParserProp(void)31506 test_xmlTextReaderGetParserProp(void) {
31507     int test_ret = 0;
31508 
31509 #if defined(LIBXML_READER_ENABLED)
31510     int mem_base;
31511     int ret_val;
31512     xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
31513     int n_reader;
31514     int prop; /* the xmlParserProperties to get */
31515     int n_prop;
31516 
31517     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
31518     for (n_prop = 0;n_prop < gen_nb_int;n_prop++) {
31519         mem_base = xmlMemBlocks();
31520         reader = gen_xmlTextReaderPtr(n_reader, 0);
31521         prop = gen_int(n_prop, 1);
31522 
31523         ret_val = xmlTextReaderGetParserProp(reader, prop);
31524         desret_int(ret_val);
31525         call_tests++;
31526         des_xmlTextReaderPtr(n_reader, reader, 0);
31527         des_int(n_prop, prop, 1);
31528         xmlResetLastError();
31529         if (mem_base != xmlMemBlocks()) {
31530             printf("Leak of %d blocks found in xmlTextReaderGetParserProp",
31531 	           xmlMemBlocks() - mem_base);
31532 	    test_ret++;
31533             printf(" %d", n_reader);
31534             printf(" %d", n_prop);
31535             printf("\n");
31536         }
31537     }
31538     }
31539     function_tests++;
31540 #endif
31541 
31542     return(test_ret);
31543 }
31544 
31545 
31546 static int
test_xmlTextReaderGetRemainder(void)31547 test_xmlTextReaderGetRemainder(void) {
31548     int test_ret = 0;
31549 
31550 #if defined(LIBXML_READER_ENABLED)
31551     int mem_base;
31552     xmlParserInputBufferPtr ret_val;
31553     xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
31554     int n_reader;
31555 
31556     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
31557         mem_base = xmlMemBlocks();
31558         reader = gen_xmlTextReaderPtr(n_reader, 0);
31559 
31560         ret_val = xmlTextReaderGetRemainder(reader);
31561         desret_xmlParserInputBufferPtr(ret_val);
31562         call_tests++;
31563         des_xmlTextReaderPtr(n_reader, reader, 0);
31564         xmlResetLastError();
31565         if (mem_base != xmlMemBlocks()) {
31566             printf("Leak of %d blocks found in xmlTextReaderGetRemainder",
31567 	           xmlMemBlocks() - mem_base);
31568 	    test_ret++;
31569             printf(" %d", n_reader);
31570             printf("\n");
31571         }
31572     }
31573     function_tests++;
31574 #endif
31575 
31576     return(test_ret);
31577 }
31578 
31579 
31580 static int
test_xmlTextReaderHasAttributes(void)31581 test_xmlTextReaderHasAttributes(void) {
31582     int test_ret = 0;
31583 
31584 #if defined(LIBXML_READER_ENABLED)
31585     int mem_base;
31586     int ret_val;
31587     xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
31588     int n_reader;
31589 
31590     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
31591         mem_base = xmlMemBlocks();
31592         reader = gen_xmlTextReaderPtr(n_reader, 0);
31593 
31594         ret_val = xmlTextReaderHasAttributes(reader);
31595         desret_int(ret_val);
31596         call_tests++;
31597         des_xmlTextReaderPtr(n_reader, reader, 0);
31598         xmlResetLastError();
31599         if (mem_base != xmlMemBlocks()) {
31600             printf("Leak of %d blocks found in xmlTextReaderHasAttributes",
31601 	           xmlMemBlocks() - mem_base);
31602 	    test_ret++;
31603             printf(" %d", n_reader);
31604             printf("\n");
31605         }
31606     }
31607     function_tests++;
31608 #endif
31609 
31610     return(test_ret);
31611 }
31612 
31613 
31614 static int
test_xmlTextReaderHasValue(void)31615 test_xmlTextReaderHasValue(void) {
31616     int test_ret = 0;
31617 
31618 #if defined(LIBXML_READER_ENABLED)
31619     int mem_base;
31620     int ret_val;
31621     xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
31622     int n_reader;
31623 
31624     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
31625         mem_base = xmlMemBlocks();
31626         reader = gen_xmlTextReaderPtr(n_reader, 0);
31627 
31628         ret_val = xmlTextReaderHasValue(reader);
31629         desret_int(ret_val);
31630         call_tests++;
31631         des_xmlTextReaderPtr(n_reader, reader, 0);
31632         xmlResetLastError();
31633         if (mem_base != xmlMemBlocks()) {
31634             printf("Leak of %d blocks found in xmlTextReaderHasValue",
31635 	           xmlMemBlocks() - mem_base);
31636 	    test_ret++;
31637             printf(" %d", n_reader);
31638             printf("\n");
31639         }
31640     }
31641     function_tests++;
31642 #endif
31643 
31644     return(test_ret);
31645 }
31646 
31647 
31648 static int
test_xmlTextReaderIsDefault(void)31649 test_xmlTextReaderIsDefault(void) {
31650     int test_ret = 0;
31651 
31652 #if defined(LIBXML_READER_ENABLED)
31653     int mem_base;
31654     int ret_val;
31655     xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
31656     int n_reader;
31657 
31658     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
31659         mem_base = xmlMemBlocks();
31660         reader = gen_xmlTextReaderPtr(n_reader, 0);
31661 
31662         ret_val = xmlTextReaderIsDefault(reader);
31663         desret_int(ret_val);
31664         call_tests++;
31665         des_xmlTextReaderPtr(n_reader, reader, 0);
31666         xmlResetLastError();
31667         if (mem_base != xmlMemBlocks()) {
31668             printf("Leak of %d blocks found in xmlTextReaderIsDefault",
31669 	           xmlMemBlocks() - mem_base);
31670 	    test_ret++;
31671             printf(" %d", n_reader);
31672             printf("\n");
31673         }
31674     }
31675     function_tests++;
31676 #endif
31677 
31678     return(test_ret);
31679 }
31680 
31681 
31682 static int
test_xmlTextReaderIsEmptyElement(void)31683 test_xmlTextReaderIsEmptyElement(void) {
31684     int test_ret = 0;
31685 
31686 #if defined(LIBXML_READER_ENABLED)
31687     int mem_base;
31688     int ret_val;
31689     xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
31690     int n_reader;
31691 
31692     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
31693         mem_base = xmlMemBlocks();
31694         reader = gen_xmlTextReaderPtr(n_reader, 0);
31695 
31696         ret_val = xmlTextReaderIsEmptyElement(reader);
31697         desret_int(ret_val);
31698         call_tests++;
31699         des_xmlTextReaderPtr(n_reader, reader, 0);
31700         xmlResetLastError();
31701         if (mem_base != xmlMemBlocks()) {
31702             printf("Leak of %d blocks found in xmlTextReaderIsEmptyElement",
31703 	           xmlMemBlocks() - mem_base);
31704 	    test_ret++;
31705             printf(" %d", n_reader);
31706             printf("\n");
31707         }
31708     }
31709     function_tests++;
31710 #endif
31711 
31712     return(test_ret);
31713 }
31714 
31715 
31716 static int
test_xmlTextReaderIsNamespaceDecl(void)31717 test_xmlTextReaderIsNamespaceDecl(void) {
31718     int test_ret = 0;
31719 
31720 #if defined(LIBXML_READER_ENABLED)
31721     int mem_base;
31722     int ret_val;
31723     xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
31724     int n_reader;
31725 
31726     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
31727         mem_base = xmlMemBlocks();
31728         reader = gen_xmlTextReaderPtr(n_reader, 0);
31729 
31730         ret_val = xmlTextReaderIsNamespaceDecl(reader);
31731         desret_int(ret_val);
31732         call_tests++;
31733         des_xmlTextReaderPtr(n_reader, reader, 0);
31734         xmlResetLastError();
31735         if (mem_base != xmlMemBlocks()) {
31736             printf("Leak of %d blocks found in xmlTextReaderIsNamespaceDecl",
31737 	           xmlMemBlocks() - mem_base);
31738 	    test_ret++;
31739             printf(" %d", n_reader);
31740             printf("\n");
31741         }
31742     }
31743     function_tests++;
31744 #endif
31745 
31746     return(test_ret);
31747 }
31748 
31749 
31750 static int
test_xmlTextReaderIsValid(void)31751 test_xmlTextReaderIsValid(void) {
31752     int test_ret = 0;
31753 
31754 #if defined(LIBXML_READER_ENABLED)
31755     int mem_base;
31756     int ret_val;
31757     xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
31758     int n_reader;
31759 
31760     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
31761         mem_base = xmlMemBlocks();
31762         reader = gen_xmlTextReaderPtr(n_reader, 0);
31763 
31764         ret_val = xmlTextReaderIsValid(reader);
31765         desret_int(ret_val);
31766         call_tests++;
31767         des_xmlTextReaderPtr(n_reader, reader, 0);
31768         xmlResetLastError();
31769         if (mem_base != xmlMemBlocks()) {
31770             printf("Leak of %d blocks found in xmlTextReaderIsValid",
31771 	           xmlMemBlocks() - mem_base);
31772 	    test_ret++;
31773             printf(" %d", n_reader);
31774             printf("\n");
31775         }
31776     }
31777     function_tests++;
31778 #endif
31779 
31780     return(test_ret);
31781 }
31782 
31783 
31784 static int
test_xmlTextReaderLocalName(void)31785 test_xmlTextReaderLocalName(void) {
31786     int test_ret = 0;
31787 
31788 #if defined(LIBXML_READER_ENABLED)
31789     int mem_base;
31790     xmlChar * ret_val;
31791     xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
31792     int n_reader;
31793 
31794     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
31795         mem_base = xmlMemBlocks();
31796         reader = gen_xmlTextReaderPtr(n_reader, 0);
31797 
31798         ret_val = xmlTextReaderLocalName(reader);
31799         desret_xmlChar_ptr(ret_val);
31800         call_tests++;
31801         des_xmlTextReaderPtr(n_reader, reader, 0);
31802         xmlResetLastError();
31803         if (mem_base != xmlMemBlocks()) {
31804             printf("Leak of %d blocks found in xmlTextReaderLocalName",
31805 	           xmlMemBlocks() - mem_base);
31806 	    test_ret++;
31807             printf(" %d", n_reader);
31808             printf("\n");
31809         }
31810     }
31811     function_tests++;
31812 #endif
31813 
31814     return(test_ret);
31815 }
31816 
31817 #ifdef LIBXML_READER_ENABLED
31818 
31819 #define gen_nb_xmlTextReaderLocatorPtr 1
gen_xmlTextReaderLocatorPtr(int no ATTRIBUTE_UNUSED,int nr ATTRIBUTE_UNUSED)31820 static xmlTextReaderLocatorPtr gen_xmlTextReaderLocatorPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
31821     return(NULL);
31822 }
des_xmlTextReaderLocatorPtr(int no ATTRIBUTE_UNUSED,xmlTextReaderLocatorPtr val ATTRIBUTE_UNUSED,int nr ATTRIBUTE_UNUSED)31823 static void des_xmlTextReaderLocatorPtr(int no ATTRIBUTE_UNUSED, xmlTextReaderLocatorPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
31824 }
31825 #endif
31826 
31827 
31828 static int
test_xmlTextReaderLocatorBaseURI(void)31829 test_xmlTextReaderLocatorBaseURI(void) {
31830     int test_ret = 0;
31831 
31832 #if defined(LIBXML_READER_ENABLED)
31833     int mem_base;
31834     xmlChar * ret_val;
31835     xmlTextReaderLocatorPtr locator; /* the xmlTextReaderLocatorPtr used */
31836     int n_locator;
31837 
31838     for (n_locator = 0;n_locator < gen_nb_xmlTextReaderLocatorPtr;n_locator++) {
31839         mem_base = xmlMemBlocks();
31840         locator = gen_xmlTextReaderLocatorPtr(n_locator, 0);
31841 
31842         ret_val = xmlTextReaderLocatorBaseURI(locator);
31843         desret_xmlChar_ptr(ret_val);
31844         call_tests++;
31845         des_xmlTextReaderLocatorPtr(n_locator, locator, 0);
31846         xmlResetLastError();
31847         if (mem_base != xmlMemBlocks()) {
31848             printf("Leak of %d blocks found in xmlTextReaderLocatorBaseURI",
31849 	           xmlMemBlocks() - mem_base);
31850 	    test_ret++;
31851             printf(" %d", n_locator);
31852             printf("\n");
31853         }
31854     }
31855     function_tests++;
31856 #endif
31857 
31858     return(test_ret);
31859 }
31860 
31861 
31862 static int
test_xmlTextReaderLocatorLineNumber(void)31863 test_xmlTextReaderLocatorLineNumber(void) {
31864     int test_ret = 0;
31865 
31866 #if defined(LIBXML_READER_ENABLED)
31867     int mem_base;
31868     int ret_val;
31869     xmlTextReaderLocatorPtr locator; /* the xmlTextReaderLocatorPtr used */
31870     int n_locator;
31871 
31872     for (n_locator = 0;n_locator < gen_nb_xmlTextReaderLocatorPtr;n_locator++) {
31873         mem_base = xmlMemBlocks();
31874         locator = gen_xmlTextReaderLocatorPtr(n_locator, 0);
31875 
31876         ret_val = xmlTextReaderLocatorLineNumber(locator);
31877         desret_int(ret_val);
31878         call_tests++;
31879         des_xmlTextReaderLocatorPtr(n_locator, locator, 0);
31880         xmlResetLastError();
31881         if (mem_base != xmlMemBlocks()) {
31882             printf("Leak of %d blocks found in xmlTextReaderLocatorLineNumber",
31883 	           xmlMemBlocks() - mem_base);
31884 	    test_ret++;
31885             printf(" %d", n_locator);
31886             printf("\n");
31887         }
31888     }
31889     function_tests++;
31890 #endif
31891 
31892     return(test_ret);
31893 }
31894 
31895 
31896 static int
test_xmlTextReaderLookupNamespace(void)31897 test_xmlTextReaderLookupNamespace(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     xmlChar * prefix; /* the prefix whose namespace URI is to be resolved. To return the default namespace, specify NULL */
31906     int n_prefix;
31907 
31908     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
31909     for (n_prefix = 0;n_prefix < gen_nb_const_xmlChar_ptr;n_prefix++) {
31910         mem_base = xmlMemBlocks();
31911         reader = gen_xmlTextReaderPtr(n_reader, 0);
31912         prefix = gen_const_xmlChar_ptr(n_prefix, 1);
31913 
31914         ret_val = xmlTextReaderLookupNamespace(reader, (const xmlChar *)prefix);
31915         desret_xmlChar_ptr(ret_val);
31916         call_tests++;
31917         des_xmlTextReaderPtr(n_reader, reader, 0);
31918         des_const_xmlChar_ptr(n_prefix, (const xmlChar *)prefix, 1);
31919         xmlResetLastError();
31920         if (mem_base != xmlMemBlocks()) {
31921             printf("Leak of %d blocks found in xmlTextReaderLookupNamespace",
31922 	           xmlMemBlocks() - mem_base);
31923 	    test_ret++;
31924             printf(" %d", n_reader);
31925             printf(" %d", n_prefix);
31926             printf("\n");
31927         }
31928     }
31929     }
31930     function_tests++;
31931 #endif
31932 
31933     return(test_ret);
31934 }
31935 
31936 
31937 static int
test_xmlTextReaderMoveToAttribute(void)31938 test_xmlTextReaderMoveToAttribute(void) {
31939     int test_ret = 0;
31940 
31941 #if defined(LIBXML_READER_ENABLED)
31942     int mem_base;
31943     int ret_val;
31944     xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
31945     int n_reader;
31946     xmlChar * name; /* the qualified name of the attribute. */
31947     int n_name;
31948 
31949     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
31950     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
31951         mem_base = xmlMemBlocks();
31952         reader = gen_xmlTextReaderPtr(n_reader, 0);
31953         name = gen_const_xmlChar_ptr(n_name, 1);
31954 
31955         ret_val = xmlTextReaderMoveToAttribute(reader, (const xmlChar *)name);
31956         desret_int(ret_val);
31957         call_tests++;
31958         des_xmlTextReaderPtr(n_reader, reader, 0);
31959         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
31960         xmlResetLastError();
31961         if (mem_base != xmlMemBlocks()) {
31962             printf("Leak of %d blocks found in xmlTextReaderMoveToAttribute",
31963 	           xmlMemBlocks() - mem_base);
31964 	    test_ret++;
31965             printf(" %d", n_reader);
31966             printf(" %d", n_name);
31967             printf("\n");
31968         }
31969     }
31970     }
31971     function_tests++;
31972 #endif
31973 
31974     return(test_ret);
31975 }
31976 
31977 
31978 static int
test_xmlTextReaderMoveToAttributeNo(void)31979 test_xmlTextReaderMoveToAttributeNo(void) {
31980     int test_ret = 0;
31981 
31982 #if defined(LIBXML_READER_ENABLED)
31983     int mem_base;
31984     int ret_val;
31985     xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
31986     int n_reader;
31987     int no; /* the zero-based index of the attribute relative to the containing element. */
31988     int n_no;
31989 
31990     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
31991     for (n_no = 0;n_no < gen_nb_int;n_no++) {
31992         mem_base = xmlMemBlocks();
31993         reader = gen_xmlTextReaderPtr(n_reader, 0);
31994         no = gen_int(n_no, 1);
31995 
31996         ret_val = xmlTextReaderMoveToAttributeNo(reader, no);
31997         desret_int(ret_val);
31998         call_tests++;
31999         des_xmlTextReaderPtr(n_reader, reader, 0);
32000         des_int(n_no, no, 1);
32001         xmlResetLastError();
32002         if (mem_base != xmlMemBlocks()) {
32003             printf("Leak of %d blocks found in xmlTextReaderMoveToAttributeNo",
32004 	           xmlMemBlocks() - mem_base);
32005 	    test_ret++;
32006             printf(" %d", n_reader);
32007             printf(" %d", n_no);
32008             printf("\n");
32009         }
32010     }
32011     }
32012     function_tests++;
32013 #endif
32014 
32015     return(test_ret);
32016 }
32017 
32018 
32019 static int
test_xmlTextReaderMoveToAttributeNs(void)32020 test_xmlTextReaderMoveToAttributeNs(void) {
32021     int test_ret = 0;
32022 
32023 #if defined(LIBXML_READER_ENABLED)
32024     int mem_base;
32025     int ret_val;
32026     xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
32027     int n_reader;
32028     xmlChar * localName; /* the local name of the attribute. */
32029     int n_localName;
32030     xmlChar * namespaceURI; /* the namespace URI of the attribute. */
32031     int n_namespaceURI;
32032 
32033     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
32034     for (n_localName = 0;n_localName < gen_nb_const_xmlChar_ptr;n_localName++) {
32035     for (n_namespaceURI = 0;n_namespaceURI < gen_nb_const_xmlChar_ptr;n_namespaceURI++) {
32036         mem_base = xmlMemBlocks();
32037         reader = gen_xmlTextReaderPtr(n_reader, 0);
32038         localName = gen_const_xmlChar_ptr(n_localName, 1);
32039         namespaceURI = gen_const_xmlChar_ptr(n_namespaceURI, 2);
32040 
32041         ret_val = xmlTextReaderMoveToAttributeNs(reader, (const xmlChar *)localName, (const xmlChar *)namespaceURI);
32042         desret_int(ret_val);
32043         call_tests++;
32044         des_xmlTextReaderPtr(n_reader, reader, 0);
32045         des_const_xmlChar_ptr(n_localName, (const xmlChar *)localName, 1);
32046         des_const_xmlChar_ptr(n_namespaceURI, (const xmlChar *)namespaceURI, 2);
32047         xmlResetLastError();
32048         if (mem_base != xmlMemBlocks()) {
32049             printf("Leak of %d blocks found in xmlTextReaderMoveToAttributeNs",
32050 	           xmlMemBlocks() - mem_base);
32051 	    test_ret++;
32052             printf(" %d", n_reader);
32053             printf(" %d", n_localName);
32054             printf(" %d", n_namespaceURI);
32055             printf("\n");
32056         }
32057     }
32058     }
32059     }
32060     function_tests++;
32061 #endif
32062 
32063     return(test_ret);
32064 }
32065 
32066 
32067 static int
test_xmlTextReaderMoveToElement(void)32068 test_xmlTextReaderMoveToElement(void) {
32069     int test_ret = 0;
32070 
32071 #if defined(LIBXML_READER_ENABLED)
32072     int mem_base;
32073     int ret_val;
32074     xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
32075     int n_reader;
32076 
32077     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
32078         mem_base = xmlMemBlocks();
32079         reader = gen_xmlTextReaderPtr(n_reader, 0);
32080 
32081         ret_val = xmlTextReaderMoveToElement(reader);
32082         desret_int(ret_val);
32083         call_tests++;
32084         des_xmlTextReaderPtr(n_reader, reader, 0);
32085         xmlResetLastError();
32086         if (mem_base != xmlMemBlocks()) {
32087             printf("Leak of %d blocks found in xmlTextReaderMoveToElement",
32088 	           xmlMemBlocks() - mem_base);
32089 	    test_ret++;
32090             printf(" %d", n_reader);
32091             printf("\n");
32092         }
32093     }
32094     function_tests++;
32095 #endif
32096 
32097     return(test_ret);
32098 }
32099 
32100 
32101 static int
test_xmlTextReaderMoveToFirstAttribute(void)32102 test_xmlTextReaderMoveToFirstAttribute(void) {
32103     int test_ret = 0;
32104 
32105 #if defined(LIBXML_READER_ENABLED)
32106     int mem_base;
32107     int ret_val;
32108     xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
32109     int n_reader;
32110 
32111     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
32112         mem_base = xmlMemBlocks();
32113         reader = gen_xmlTextReaderPtr(n_reader, 0);
32114 
32115         ret_val = xmlTextReaderMoveToFirstAttribute(reader);
32116         desret_int(ret_val);
32117         call_tests++;
32118         des_xmlTextReaderPtr(n_reader, reader, 0);
32119         xmlResetLastError();
32120         if (mem_base != xmlMemBlocks()) {
32121             printf("Leak of %d blocks found in xmlTextReaderMoveToFirstAttribute",
32122 	           xmlMemBlocks() - mem_base);
32123 	    test_ret++;
32124             printf(" %d", n_reader);
32125             printf("\n");
32126         }
32127     }
32128     function_tests++;
32129 #endif
32130 
32131     return(test_ret);
32132 }
32133 
32134 
32135 static int
test_xmlTextReaderMoveToNextAttribute(void)32136 test_xmlTextReaderMoveToNextAttribute(void) {
32137     int test_ret = 0;
32138 
32139 #if defined(LIBXML_READER_ENABLED)
32140     int mem_base;
32141     int ret_val;
32142     xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
32143     int n_reader;
32144 
32145     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
32146         mem_base = xmlMemBlocks();
32147         reader = gen_xmlTextReaderPtr(n_reader, 0);
32148 
32149         ret_val = xmlTextReaderMoveToNextAttribute(reader);
32150         desret_int(ret_val);
32151         call_tests++;
32152         des_xmlTextReaderPtr(n_reader, reader, 0);
32153         xmlResetLastError();
32154         if (mem_base != xmlMemBlocks()) {
32155             printf("Leak of %d blocks found in xmlTextReaderMoveToNextAttribute",
32156 	           xmlMemBlocks() - mem_base);
32157 	    test_ret++;
32158             printf(" %d", n_reader);
32159             printf("\n");
32160         }
32161     }
32162     function_tests++;
32163 #endif
32164 
32165     return(test_ret);
32166 }
32167 
32168 
32169 static int
test_xmlTextReaderName(void)32170 test_xmlTextReaderName(void) {
32171     int test_ret = 0;
32172 
32173 #if defined(LIBXML_READER_ENABLED)
32174     int mem_base;
32175     xmlChar * ret_val;
32176     xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
32177     int n_reader;
32178 
32179     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
32180         mem_base = xmlMemBlocks();
32181         reader = gen_xmlTextReaderPtr(n_reader, 0);
32182 
32183         ret_val = xmlTextReaderName(reader);
32184         desret_xmlChar_ptr(ret_val);
32185         call_tests++;
32186         des_xmlTextReaderPtr(n_reader, reader, 0);
32187         xmlResetLastError();
32188         if (mem_base != xmlMemBlocks()) {
32189             printf("Leak of %d blocks found in xmlTextReaderName",
32190 	           xmlMemBlocks() - mem_base);
32191 	    test_ret++;
32192             printf(" %d", n_reader);
32193             printf("\n");
32194         }
32195     }
32196     function_tests++;
32197 #endif
32198 
32199     return(test_ret);
32200 }
32201 
32202 
32203 static int
test_xmlTextReaderNamespaceUri(void)32204 test_xmlTextReaderNamespaceUri(void) {
32205     int test_ret = 0;
32206 
32207 #if defined(LIBXML_READER_ENABLED)
32208     int mem_base;
32209     xmlChar * ret_val;
32210     xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
32211     int n_reader;
32212 
32213     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
32214         mem_base = xmlMemBlocks();
32215         reader = gen_xmlTextReaderPtr(n_reader, 0);
32216 
32217         ret_val = xmlTextReaderNamespaceUri(reader);
32218         desret_xmlChar_ptr(ret_val);
32219         call_tests++;
32220         des_xmlTextReaderPtr(n_reader, reader, 0);
32221         xmlResetLastError();
32222         if (mem_base != xmlMemBlocks()) {
32223             printf("Leak of %d blocks found in xmlTextReaderNamespaceUri",
32224 	           xmlMemBlocks() - mem_base);
32225 	    test_ret++;
32226             printf(" %d", n_reader);
32227             printf("\n");
32228         }
32229     }
32230     function_tests++;
32231 #endif
32232 
32233     return(test_ret);
32234 }
32235 
32236 
32237 static int
test_xmlTextReaderNext(void)32238 test_xmlTextReaderNext(void) {
32239     int test_ret = 0;
32240 
32241 #if defined(LIBXML_READER_ENABLED)
32242     int mem_base;
32243     int ret_val;
32244     xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
32245     int n_reader;
32246 
32247     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
32248         mem_base = xmlMemBlocks();
32249         reader = gen_xmlTextReaderPtr(n_reader, 0);
32250 
32251         ret_val = xmlTextReaderNext(reader);
32252         desret_int(ret_val);
32253         call_tests++;
32254         des_xmlTextReaderPtr(n_reader, reader, 0);
32255         xmlResetLastError();
32256         if (mem_base != xmlMemBlocks()) {
32257             printf("Leak of %d blocks found in xmlTextReaderNext",
32258 	           xmlMemBlocks() - mem_base);
32259 	    test_ret++;
32260             printf(" %d", n_reader);
32261             printf("\n");
32262         }
32263     }
32264     function_tests++;
32265 #endif
32266 
32267     return(test_ret);
32268 }
32269 
32270 
32271 static int
test_xmlTextReaderNextSibling(void)32272 test_xmlTextReaderNextSibling(void) {
32273     int test_ret = 0;
32274 
32275 #if defined(LIBXML_READER_ENABLED)
32276     int mem_base;
32277     int ret_val;
32278     xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
32279     int n_reader;
32280 
32281     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
32282         mem_base = xmlMemBlocks();
32283         reader = gen_xmlTextReaderPtr(n_reader, 0);
32284 
32285         ret_val = xmlTextReaderNextSibling(reader);
32286         desret_int(ret_val);
32287         call_tests++;
32288         des_xmlTextReaderPtr(n_reader, reader, 0);
32289         xmlResetLastError();
32290         if (mem_base != xmlMemBlocks()) {
32291             printf("Leak of %d blocks found in xmlTextReaderNextSibling",
32292 	           xmlMemBlocks() - mem_base);
32293 	    test_ret++;
32294             printf(" %d", n_reader);
32295             printf("\n");
32296         }
32297     }
32298     function_tests++;
32299 #endif
32300 
32301     return(test_ret);
32302 }
32303 
32304 
32305 static int
test_xmlTextReaderNodeType(void)32306 test_xmlTextReaderNodeType(void) {
32307     int test_ret = 0;
32308 
32309 #if defined(LIBXML_READER_ENABLED)
32310     int mem_base;
32311     int ret_val;
32312     xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
32313     int n_reader;
32314 
32315     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
32316         mem_base = xmlMemBlocks();
32317         reader = gen_xmlTextReaderPtr(n_reader, 0);
32318 
32319         ret_val = xmlTextReaderNodeType(reader);
32320         desret_int(ret_val);
32321         call_tests++;
32322         des_xmlTextReaderPtr(n_reader, reader, 0);
32323         xmlResetLastError();
32324         if (mem_base != xmlMemBlocks()) {
32325             printf("Leak of %d blocks found in xmlTextReaderNodeType",
32326 	           xmlMemBlocks() - mem_base);
32327 	    test_ret++;
32328             printf(" %d", n_reader);
32329             printf("\n");
32330         }
32331     }
32332     function_tests++;
32333 #endif
32334 
32335     return(test_ret);
32336 }
32337 
32338 
32339 static int
test_xmlTextReaderNormalization(void)32340 test_xmlTextReaderNormalization(void) {
32341     int test_ret = 0;
32342 
32343 #if defined(LIBXML_READER_ENABLED)
32344     int mem_base;
32345     int ret_val;
32346     xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
32347     int n_reader;
32348 
32349     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
32350         mem_base = xmlMemBlocks();
32351         reader = gen_xmlTextReaderPtr(n_reader, 0);
32352 
32353         ret_val = xmlTextReaderNormalization(reader);
32354         desret_int(ret_val);
32355         call_tests++;
32356         des_xmlTextReaderPtr(n_reader, reader, 0);
32357         xmlResetLastError();
32358         if (mem_base != xmlMemBlocks()) {
32359             printf("Leak of %d blocks found in xmlTextReaderNormalization",
32360 	           xmlMemBlocks() - mem_base);
32361 	    test_ret++;
32362             printf(" %d", n_reader);
32363             printf("\n");
32364         }
32365     }
32366     function_tests++;
32367 #endif
32368 
32369     return(test_ret);
32370 }
32371 
32372 
32373 static int
test_xmlTextReaderPrefix(void)32374 test_xmlTextReaderPrefix(void) {
32375     int test_ret = 0;
32376 
32377 #if defined(LIBXML_READER_ENABLED)
32378     int mem_base;
32379     xmlChar * ret_val;
32380     xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
32381     int n_reader;
32382 
32383     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
32384         mem_base = xmlMemBlocks();
32385         reader = gen_xmlTextReaderPtr(n_reader, 0);
32386 
32387         ret_val = xmlTextReaderPrefix(reader);
32388         desret_xmlChar_ptr(ret_val);
32389         call_tests++;
32390         des_xmlTextReaderPtr(n_reader, reader, 0);
32391         xmlResetLastError();
32392         if (mem_base != xmlMemBlocks()) {
32393             printf("Leak of %d blocks found in xmlTextReaderPrefix",
32394 	           xmlMemBlocks() - mem_base);
32395 	    test_ret++;
32396             printf(" %d", n_reader);
32397             printf("\n");
32398         }
32399     }
32400     function_tests++;
32401 #endif
32402 
32403     return(test_ret);
32404 }
32405 
32406 
32407 static int
test_xmlTextReaderPreserve(void)32408 test_xmlTextReaderPreserve(void) {
32409     int test_ret = 0;
32410 
32411 #if defined(LIBXML_READER_ENABLED)
32412     int mem_base;
32413     xmlNodePtr ret_val;
32414     xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
32415     int n_reader;
32416 
32417     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
32418         mem_base = xmlMemBlocks();
32419         reader = gen_xmlTextReaderPtr(n_reader, 0);
32420 
32421         ret_val = xmlTextReaderPreserve(reader);
32422         desret_xmlNodePtr(ret_val);
32423         call_tests++;
32424         des_xmlTextReaderPtr(n_reader, reader, 0);
32425         xmlResetLastError();
32426         if (mem_base != xmlMemBlocks()) {
32427             printf("Leak of %d blocks found in xmlTextReaderPreserve",
32428 	           xmlMemBlocks() - mem_base);
32429 	    test_ret++;
32430             printf(" %d", n_reader);
32431             printf("\n");
32432         }
32433     }
32434     function_tests++;
32435 #endif
32436 
32437     return(test_ret);
32438 }
32439 
32440 
32441 static int
test_xmlTextReaderPreservePattern(void)32442 test_xmlTextReaderPreservePattern(void) {
32443     int test_ret = 0;
32444 
32445 #if defined(LIBXML_READER_ENABLED) && defined(LIBXML_PATTERN_ENABLED)
32446 #ifdef LIBXML_PATTERN_ENABLED
32447     int mem_base;
32448     int ret_val;
32449     xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
32450     int n_reader;
32451     xmlChar * pattern; /* an XPath subset pattern */
32452     int n_pattern;
32453     xmlChar ** namespaces; /* the prefix definitions, array of [URI, prefix] or NULL */
32454     int n_namespaces;
32455 
32456     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
32457     for (n_pattern = 0;n_pattern < gen_nb_const_xmlChar_ptr;n_pattern++) {
32458     for (n_namespaces = 0;n_namespaces < gen_nb_const_xmlChar_ptr_ptr;n_namespaces++) {
32459         mem_base = xmlMemBlocks();
32460         reader = gen_xmlTextReaderPtr(n_reader, 0);
32461         pattern = gen_const_xmlChar_ptr(n_pattern, 1);
32462         namespaces = gen_const_xmlChar_ptr_ptr(n_namespaces, 2);
32463 
32464         ret_val = xmlTextReaderPreservePattern(reader, (const xmlChar *)pattern, (const xmlChar **)namespaces);
32465         desret_int(ret_val);
32466         call_tests++;
32467         des_xmlTextReaderPtr(n_reader, reader, 0);
32468         des_const_xmlChar_ptr(n_pattern, (const xmlChar *)pattern, 1);
32469         des_const_xmlChar_ptr_ptr(n_namespaces, (const xmlChar **)namespaces, 2);
32470         xmlResetLastError();
32471         if (mem_base != xmlMemBlocks()) {
32472             printf("Leak of %d blocks found in xmlTextReaderPreservePattern",
32473 	           xmlMemBlocks() - mem_base);
32474 	    test_ret++;
32475             printf(" %d", n_reader);
32476             printf(" %d", n_pattern);
32477             printf(" %d", n_namespaces);
32478             printf("\n");
32479         }
32480     }
32481     }
32482     }
32483     function_tests++;
32484 #endif
32485 #endif
32486 
32487     return(test_ret);
32488 }
32489 
32490 
32491 static int
test_xmlTextReaderQuoteChar(void)32492 test_xmlTextReaderQuoteChar(void) {
32493     int test_ret = 0;
32494 
32495 #if defined(LIBXML_READER_ENABLED)
32496     int mem_base;
32497     int ret_val;
32498     xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
32499     int n_reader;
32500 
32501     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
32502         mem_base = xmlMemBlocks();
32503         reader = gen_xmlTextReaderPtr(n_reader, 0);
32504 
32505         ret_val = xmlTextReaderQuoteChar(reader);
32506         desret_int(ret_val);
32507         call_tests++;
32508         des_xmlTextReaderPtr(n_reader, reader, 0);
32509         xmlResetLastError();
32510         if (mem_base != xmlMemBlocks()) {
32511             printf("Leak of %d blocks found in xmlTextReaderQuoteChar",
32512 	           xmlMemBlocks() - mem_base);
32513 	    test_ret++;
32514             printf(" %d", n_reader);
32515             printf("\n");
32516         }
32517     }
32518     function_tests++;
32519 #endif
32520 
32521     return(test_ret);
32522 }
32523 
32524 
32525 static int
test_xmlTextReaderRead(void)32526 test_xmlTextReaderRead(void) {
32527     int test_ret = 0;
32528 
32529 #if defined(LIBXML_READER_ENABLED)
32530     int mem_base;
32531     int ret_val;
32532     xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
32533     int n_reader;
32534 
32535     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
32536         mem_base = xmlMemBlocks();
32537         reader = gen_xmlTextReaderPtr(n_reader, 0);
32538 
32539         ret_val = xmlTextReaderRead(reader);
32540         desret_int(ret_val);
32541         call_tests++;
32542         des_xmlTextReaderPtr(n_reader, reader, 0);
32543         xmlResetLastError();
32544         if (mem_base != xmlMemBlocks()) {
32545             printf("Leak of %d blocks found in xmlTextReaderRead",
32546 	           xmlMemBlocks() - mem_base);
32547 	    test_ret++;
32548             printf(" %d", n_reader);
32549             printf("\n");
32550         }
32551     }
32552     function_tests++;
32553 #endif
32554 
32555     return(test_ret);
32556 }
32557 
32558 
32559 static int
test_xmlTextReaderReadAttributeValue(void)32560 test_xmlTextReaderReadAttributeValue(void) {
32561     int test_ret = 0;
32562 
32563 #if defined(LIBXML_READER_ENABLED)
32564     int mem_base;
32565     int ret_val;
32566     xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
32567     int n_reader;
32568 
32569     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
32570         mem_base = xmlMemBlocks();
32571         reader = gen_xmlTextReaderPtr(n_reader, 0);
32572 
32573         ret_val = xmlTextReaderReadAttributeValue(reader);
32574         desret_int(ret_val);
32575         call_tests++;
32576         des_xmlTextReaderPtr(n_reader, reader, 0);
32577         xmlResetLastError();
32578         if (mem_base != xmlMemBlocks()) {
32579             printf("Leak of %d blocks found in xmlTextReaderReadAttributeValue",
32580 	           xmlMemBlocks() - mem_base);
32581 	    test_ret++;
32582             printf(" %d", n_reader);
32583             printf("\n");
32584         }
32585     }
32586     function_tests++;
32587 #endif
32588 
32589     return(test_ret);
32590 }
32591 
32592 
32593 static int
test_xmlTextReaderReadState(void)32594 test_xmlTextReaderReadState(void) {
32595     int test_ret = 0;
32596 
32597 #if defined(LIBXML_READER_ENABLED)
32598     int mem_base;
32599     int ret_val;
32600     xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
32601     int n_reader;
32602 
32603     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
32604         mem_base = xmlMemBlocks();
32605         reader = gen_xmlTextReaderPtr(n_reader, 0);
32606 
32607         ret_val = xmlTextReaderReadState(reader);
32608         desret_int(ret_val);
32609         call_tests++;
32610         des_xmlTextReaderPtr(n_reader, reader, 0);
32611         xmlResetLastError();
32612         if (mem_base != xmlMemBlocks()) {
32613             printf("Leak of %d blocks found in xmlTextReaderReadState",
32614 	           xmlMemBlocks() - mem_base);
32615 	    test_ret++;
32616             printf(" %d", n_reader);
32617             printf("\n");
32618         }
32619     }
32620     function_tests++;
32621 #endif
32622 
32623     return(test_ret);
32624 }
32625 
32626 
32627 static int
test_xmlTextReaderRelaxNGSetSchema(void)32628 test_xmlTextReaderRelaxNGSetSchema(void) {
32629     int test_ret = 0;
32630 
32631 #if defined(LIBXML_READER_ENABLED) && defined(LIBXML_SCHEMAS_ENABLED)
32632     int mem_base;
32633     int ret_val;
32634     xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
32635     int n_reader;
32636     xmlRelaxNGPtr schema; /* a precompiled RelaxNG schema */
32637     int n_schema;
32638 
32639     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
32640     for (n_schema = 0;n_schema < gen_nb_xmlRelaxNGPtr;n_schema++) {
32641         mem_base = xmlMemBlocks();
32642         reader = gen_xmlTextReaderPtr(n_reader, 0);
32643         schema = gen_xmlRelaxNGPtr(n_schema, 1);
32644 
32645         ret_val = xmlTextReaderRelaxNGSetSchema(reader, schema);
32646         desret_int(ret_val);
32647         call_tests++;
32648         des_xmlTextReaderPtr(n_reader, reader, 0);
32649         des_xmlRelaxNGPtr(n_schema, schema, 1);
32650         xmlResetLastError();
32651         if (mem_base != xmlMemBlocks()) {
32652             printf("Leak of %d blocks found in xmlTextReaderRelaxNGSetSchema",
32653 	           xmlMemBlocks() - mem_base);
32654 	    test_ret++;
32655             printf(" %d", n_reader);
32656             printf(" %d", n_schema);
32657             printf("\n");
32658         }
32659     }
32660     }
32661     function_tests++;
32662 #endif
32663 
32664     return(test_ret);
32665 }
32666 
32667 
32668 static int
test_xmlTextReaderRelaxNGValidate(void)32669 test_xmlTextReaderRelaxNGValidate(void) {
32670     int test_ret = 0;
32671 
32672 #if defined(LIBXML_READER_ENABLED) && defined(LIBXML_SCHEMAS_ENABLED)
32673     int mem_base;
32674     int ret_val;
32675     xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
32676     int n_reader;
32677     char * rng; /* the path to a RelaxNG schema or NULL */
32678     int n_rng;
32679 
32680     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
32681     for (n_rng = 0;n_rng < gen_nb_const_char_ptr;n_rng++) {
32682         mem_base = xmlMemBlocks();
32683         reader = gen_xmlTextReaderPtr(n_reader, 0);
32684         rng = gen_const_char_ptr(n_rng, 1);
32685 
32686         ret_val = xmlTextReaderRelaxNGValidate(reader, (const char *)rng);
32687         desret_int(ret_val);
32688         call_tests++;
32689         des_xmlTextReaderPtr(n_reader, reader, 0);
32690         des_const_char_ptr(n_rng, (const char *)rng, 1);
32691         xmlResetLastError();
32692         if (mem_base != xmlMemBlocks()) {
32693             printf("Leak of %d blocks found in xmlTextReaderRelaxNGValidate",
32694 	           xmlMemBlocks() - mem_base);
32695 	    test_ret++;
32696             printf(" %d", n_reader);
32697             printf(" %d", n_rng);
32698             printf("\n");
32699         }
32700     }
32701     }
32702     function_tests++;
32703 #endif
32704 
32705     return(test_ret);
32706 }
32707 
32708 
32709 static int
test_xmlTextReaderRelaxNGValidateCtxt(void)32710 test_xmlTextReaderRelaxNGValidateCtxt(void) {
32711     int test_ret = 0;
32712 
32713 #if defined(LIBXML_READER_ENABLED) && defined(LIBXML_SCHEMAS_ENABLED)
32714     int mem_base;
32715     int ret_val;
32716     xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
32717     int n_reader;
32718     xmlRelaxNGValidCtxtPtr ctxt; /* the RelaxNG schema validation context or NULL */
32719     int n_ctxt;
32720     int options; /* options (not used yet) */
32721     int n_options;
32722 
32723     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
32724     for (n_ctxt = 0;n_ctxt < gen_nb_xmlRelaxNGValidCtxtPtr;n_ctxt++) {
32725     for (n_options = 0;n_options < gen_nb_parseroptions;n_options++) {
32726         mem_base = xmlMemBlocks();
32727         reader = gen_xmlTextReaderPtr(n_reader, 0);
32728         ctxt = gen_xmlRelaxNGValidCtxtPtr(n_ctxt, 1);
32729         options = gen_parseroptions(n_options, 2);
32730 
32731         ret_val = xmlTextReaderRelaxNGValidateCtxt(reader, ctxt, options);
32732         desret_int(ret_val);
32733         call_tests++;
32734         des_xmlTextReaderPtr(n_reader, reader, 0);
32735         des_xmlRelaxNGValidCtxtPtr(n_ctxt, ctxt, 1);
32736         des_parseroptions(n_options, options, 2);
32737         xmlResetLastError();
32738         if (mem_base != xmlMemBlocks()) {
32739             printf("Leak of %d blocks found in xmlTextReaderRelaxNGValidateCtxt",
32740 	           xmlMemBlocks() - mem_base);
32741 	    test_ret++;
32742             printf(" %d", n_reader);
32743             printf(" %d", n_ctxt);
32744             printf(" %d", n_options);
32745             printf("\n");
32746         }
32747     }
32748     }
32749     }
32750     function_tests++;
32751 #endif
32752 
32753     return(test_ret);
32754 }
32755 
32756 
32757 static int
test_xmlTextReaderSchemaValidate(void)32758 test_xmlTextReaderSchemaValidate(void) {
32759     int test_ret = 0;
32760 
32761 #if defined(LIBXML_READER_ENABLED) && defined(LIBXML_SCHEMAS_ENABLED)
32762     int ret_val;
32763     xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
32764     int n_reader;
32765     char * xsd; /* the path to a W3C XSD schema or NULL */
32766     int n_xsd;
32767 
32768     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
32769     for (n_xsd = 0;n_xsd < gen_nb_const_char_ptr;n_xsd++) {
32770         reader = gen_xmlTextReaderPtr(n_reader, 0);
32771         xsd = gen_const_char_ptr(n_xsd, 1);
32772 
32773         ret_val = xmlTextReaderSchemaValidate(reader, (const char *)xsd);
32774         desret_int(ret_val);
32775         call_tests++;
32776         des_xmlTextReaderPtr(n_reader, reader, 0);
32777         des_const_char_ptr(n_xsd, (const char *)xsd, 1);
32778         xmlResetLastError();
32779     }
32780     }
32781     function_tests++;
32782 #endif
32783 
32784     return(test_ret);
32785 }
32786 
32787 
32788 static int
test_xmlTextReaderSchemaValidateCtxt(void)32789 test_xmlTextReaderSchemaValidateCtxt(void) {
32790     int test_ret = 0;
32791 
32792 #if defined(LIBXML_READER_ENABLED) && defined(LIBXML_SCHEMAS_ENABLED)
32793     int mem_base;
32794     int ret_val;
32795     xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
32796     int n_reader;
32797     xmlSchemaValidCtxtPtr ctxt; /* the XML Schema validation context or NULL */
32798     int n_ctxt;
32799     int options; /* options (not used yet) */
32800     int n_options;
32801 
32802     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
32803     for (n_ctxt = 0;n_ctxt < gen_nb_xmlSchemaValidCtxtPtr;n_ctxt++) {
32804     for (n_options = 0;n_options < gen_nb_parseroptions;n_options++) {
32805         mem_base = xmlMemBlocks();
32806         reader = gen_xmlTextReaderPtr(n_reader, 0);
32807         ctxt = gen_xmlSchemaValidCtxtPtr(n_ctxt, 1);
32808         options = gen_parseroptions(n_options, 2);
32809 
32810         ret_val = xmlTextReaderSchemaValidateCtxt(reader, ctxt, options);
32811         desret_int(ret_val);
32812         call_tests++;
32813         des_xmlTextReaderPtr(n_reader, reader, 0);
32814         des_xmlSchemaValidCtxtPtr(n_ctxt, ctxt, 1);
32815         des_parseroptions(n_options, options, 2);
32816         xmlResetLastError();
32817         if (mem_base != xmlMemBlocks()) {
32818             printf("Leak of %d blocks found in xmlTextReaderSchemaValidateCtxt",
32819 	           xmlMemBlocks() - mem_base);
32820 	    test_ret++;
32821             printf(" %d", n_reader);
32822             printf(" %d", n_ctxt);
32823             printf(" %d", n_options);
32824             printf("\n");
32825         }
32826     }
32827     }
32828     }
32829     function_tests++;
32830 #endif
32831 
32832     return(test_ret);
32833 }
32834 
32835 
32836 static int
test_xmlTextReaderSetErrorHandler(void)32837 test_xmlTextReaderSetErrorHandler(void) {
32838     int test_ret = 0;
32839 
32840 
32841     /* missing type support */
32842     return(test_ret);
32843 }
32844 
32845 
32846 static int
test_xmlTextReaderSetParserProp(void)32847 test_xmlTextReaderSetParserProp(void) {
32848     int test_ret = 0;
32849 
32850 #if defined(LIBXML_READER_ENABLED)
32851     int mem_base;
32852     int ret_val;
32853     xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
32854     int n_reader;
32855     int prop; /* the xmlParserProperties to set */
32856     int n_prop;
32857     int value; /* usually 0 or 1 to (de)activate it */
32858     int n_value;
32859 
32860     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
32861     for (n_prop = 0;n_prop < gen_nb_int;n_prop++) {
32862     for (n_value = 0;n_value < gen_nb_int;n_value++) {
32863         mem_base = xmlMemBlocks();
32864         reader = gen_xmlTextReaderPtr(n_reader, 0);
32865         prop = gen_int(n_prop, 1);
32866         value = gen_int(n_value, 2);
32867 
32868         ret_val = xmlTextReaderSetParserProp(reader, prop, value);
32869         desret_int(ret_val);
32870         call_tests++;
32871         des_xmlTextReaderPtr(n_reader, reader, 0);
32872         des_int(n_prop, prop, 1);
32873         des_int(n_value, value, 2);
32874         xmlResetLastError();
32875         if (mem_base != xmlMemBlocks()) {
32876             printf("Leak of %d blocks found in xmlTextReaderSetParserProp",
32877 	           xmlMemBlocks() - mem_base);
32878 	    test_ret++;
32879             printf(" %d", n_reader);
32880             printf(" %d", n_prop);
32881             printf(" %d", n_value);
32882             printf("\n");
32883         }
32884     }
32885     }
32886     }
32887     function_tests++;
32888 #endif
32889 
32890     return(test_ret);
32891 }
32892 
32893 
32894 static int
test_xmlTextReaderSetSchema(void)32895 test_xmlTextReaderSetSchema(void) {
32896     int test_ret = 0;
32897 
32898 #if defined(LIBXML_READER_ENABLED) && defined(LIBXML_SCHEMAS_ENABLED)
32899     int mem_base;
32900     int ret_val;
32901     xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
32902     int n_reader;
32903     xmlSchemaPtr schema; /* a precompiled Schema schema */
32904     int n_schema;
32905 
32906     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
32907     for (n_schema = 0;n_schema < gen_nb_xmlSchemaPtr;n_schema++) {
32908         mem_base = xmlMemBlocks();
32909         reader = gen_xmlTextReaderPtr(n_reader, 0);
32910         schema = gen_xmlSchemaPtr(n_schema, 1);
32911 
32912         ret_val = xmlTextReaderSetSchema(reader, schema);
32913         desret_int(ret_val);
32914         call_tests++;
32915         des_xmlTextReaderPtr(n_reader, reader, 0);
32916         des_xmlSchemaPtr(n_schema, schema, 1);
32917         xmlResetLastError();
32918         if (mem_base != xmlMemBlocks()) {
32919             printf("Leak of %d blocks found in xmlTextReaderSetSchema",
32920 	           xmlMemBlocks() - mem_base);
32921 	    test_ret++;
32922             printf(" %d", n_reader);
32923             printf(" %d", n_schema);
32924             printf("\n");
32925         }
32926     }
32927     }
32928     function_tests++;
32929 #endif
32930 
32931     return(test_ret);
32932 }
32933 
32934 
32935 static int
test_xmlTextReaderSetStructuredErrorHandler(void)32936 test_xmlTextReaderSetStructuredErrorHandler(void) {
32937     int test_ret = 0;
32938 
32939 
32940     /* missing type support */
32941     return(test_ret);
32942 }
32943 
32944 
32945 static int
test_xmlTextReaderSetup(void)32946 test_xmlTextReaderSetup(void) {
32947     int test_ret = 0;
32948 
32949 #if defined(LIBXML_READER_ENABLED)
32950     int mem_base;
32951     int ret_val;
32952     xmlTextReaderPtr reader; /* an XML reader */
32953     int n_reader;
32954     xmlParserInputBufferPtr input; /* xmlParserInputBufferPtr used to feed the reader, will be destroyed with it. */
32955     int n_input;
32956     const char * URL; /* the base URL to use for the document */
32957     int n_URL;
32958     char * encoding; /* the document encoding, or NULL */
32959     int n_encoding;
32960     int options; /* a combination of xmlParserOption */
32961     int n_options;
32962 
32963     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
32964     for (n_input = 0;n_input < gen_nb_xmlParserInputBufferPtr;n_input++) {
32965     for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) {
32966     for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
32967     for (n_options = 0;n_options < gen_nb_parseroptions;n_options++) {
32968         mem_base = xmlMemBlocks();
32969         reader = gen_xmlTextReaderPtr(n_reader, 0);
32970         input = gen_xmlParserInputBufferPtr(n_input, 1);
32971         URL = gen_filepath(n_URL, 2);
32972         encoding = gen_const_char_ptr(n_encoding, 3);
32973         options = gen_parseroptions(n_options, 4);
32974 
32975         ret_val = xmlTextReaderSetup(reader, input, URL, (const char *)encoding, options);
32976         desret_int(ret_val);
32977         call_tests++;
32978         des_xmlTextReaderPtr(n_reader, reader, 0);
32979         des_filepath(n_URL, URL, 2);
32980         des_const_char_ptr(n_encoding, (const char *)encoding, 3);
32981         des_parseroptions(n_options, options, 4);
32982         xmlResetLastError();
32983         if (mem_base != xmlMemBlocks()) {
32984             printf("Leak of %d blocks found in xmlTextReaderSetup",
32985 	           xmlMemBlocks() - mem_base);
32986 	    test_ret++;
32987             printf(" %d", n_reader);
32988             printf(" %d", n_input);
32989             printf(" %d", n_URL);
32990             printf(" %d", n_encoding);
32991             printf(" %d", n_options);
32992             printf("\n");
32993         }
32994     }
32995     }
32996     }
32997     }
32998     }
32999     function_tests++;
33000 #endif
33001 
33002     return(test_ret);
33003 }
33004 
33005 
33006 static int
test_xmlTextReaderStandalone(void)33007 test_xmlTextReaderStandalone(void) {
33008     int test_ret = 0;
33009 
33010 #if defined(LIBXML_READER_ENABLED)
33011     int mem_base;
33012     int ret_val;
33013     xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
33014     int n_reader;
33015 
33016     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
33017         mem_base = xmlMemBlocks();
33018         reader = gen_xmlTextReaderPtr(n_reader, 0);
33019 
33020         ret_val = xmlTextReaderStandalone(reader);
33021         desret_int(ret_val);
33022         call_tests++;
33023         des_xmlTextReaderPtr(n_reader, reader, 0);
33024         xmlResetLastError();
33025         if (mem_base != xmlMemBlocks()) {
33026             printf("Leak of %d blocks found in xmlTextReaderStandalone",
33027 	           xmlMemBlocks() - mem_base);
33028 	    test_ret++;
33029             printf(" %d", n_reader);
33030             printf("\n");
33031         }
33032     }
33033     function_tests++;
33034 #endif
33035 
33036     return(test_ret);
33037 }
33038 
33039 
33040 static int
test_xmlTextReaderValue(void)33041 test_xmlTextReaderValue(void) {
33042     int test_ret = 0;
33043 
33044 #if defined(LIBXML_READER_ENABLED)
33045     int mem_base;
33046     xmlChar * ret_val;
33047     xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
33048     int n_reader;
33049 
33050     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
33051         mem_base = xmlMemBlocks();
33052         reader = gen_xmlTextReaderPtr(n_reader, 0);
33053 
33054         ret_val = xmlTextReaderValue(reader);
33055         desret_xmlChar_ptr(ret_val);
33056         call_tests++;
33057         des_xmlTextReaderPtr(n_reader, reader, 0);
33058         xmlResetLastError();
33059         if (mem_base != xmlMemBlocks()) {
33060             printf("Leak of %d blocks found in xmlTextReaderValue",
33061 	           xmlMemBlocks() - mem_base);
33062 	    test_ret++;
33063             printf(" %d", n_reader);
33064             printf("\n");
33065         }
33066     }
33067     function_tests++;
33068 #endif
33069 
33070     return(test_ret);
33071 }
33072 
33073 
33074 static int
test_xmlTextReaderXmlLang(void)33075 test_xmlTextReaderXmlLang(void) {
33076     int test_ret = 0;
33077 
33078 #if defined(LIBXML_READER_ENABLED)
33079     int mem_base;
33080     xmlChar * ret_val;
33081     xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
33082     int n_reader;
33083 
33084     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
33085         mem_base = xmlMemBlocks();
33086         reader = gen_xmlTextReaderPtr(n_reader, 0);
33087 
33088         ret_val = xmlTextReaderXmlLang(reader);
33089         desret_xmlChar_ptr(ret_val);
33090         call_tests++;
33091         des_xmlTextReaderPtr(n_reader, reader, 0);
33092         xmlResetLastError();
33093         if (mem_base != xmlMemBlocks()) {
33094             printf("Leak of %d blocks found in xmlTextReaderXmlLang",
33095 	           xmlMemBlocks() - mem_base);
33096 	    test_ret++;
33097             printf(" %d", n_reader);
33098             printf("\n");
33099         }
33100     }
33101     function_tests++;
33102 #endif
33103 
33104     return(test_ret);
33105 }
33106 
33107 static int
test_xmlreader(void)33108 test_xmlreader(void) {
33109     int test_ret = 0;
33110 
33111     if (quiet == 0) printf("Testing xmlreader : 76 of 86 functions ...\n");
33112     test_ret += test_xmlNewTextReader();
33113     test_ret += test_xmlNewTextReaderFilename();
33114     test_ret += test_xmlReaderForDoc();
33115     test_ret += test_xmlReaderForFile();
33116     test_ret += test_xmlReaderForMemory();
33117     test_ret += test_xmlReaderNewDoc();
33118     test_ret += test_xmlReaderNewFile();
33119     test_ret += test_xmlReaderNewMemory();
33120     test_ret += test_xmlReaderNewWalker();
33121     test_ret += test_xmlReaderWalker();
33122     test_ret += test_xmlTextReaderAttributeCount();
33123     test_ret += test_xmlTextReaderBaseUri();
33124     test_ret += test_xmlTextReaderByteConsumed();
33125     test_ret += test_xmlTextReaderClose();
33126     test_ret += test_xmlTextReaderConstBaseUri();
33127     test_ret += test_xmlTextReaderConstEncoding();
33128     test_ret += test_xmlTextReaderConstLocalName();
33129     test_ret += test_xmlTextReaderConstName();
33130     test_ret += test_xmlTextReaderConstNamespaceUri();
33131     test_ret += test_xmlTextReaderConstPrefix();
33132     test_ret += test_xmlTextReaderConstString();
33133     test_ret += test_xmlTextReaderConstValue();
33134     test_ret += test_xmlTextReaderConstXmlLang();
33135     test_ret += test_xmlTextReaderConstXmlVersion();
33136     test_ret += test_xmlTextReaderCurrentDoc();
33137     test_ret += test_xmlTextReaderCurrentNode();
33138     test_ret += test_xmlTextReaderDepth();
33139     test_ret += test_xmlTextReaderExpand();
33140     test_ret += test_xmlTextReaderGetAttribute();
33141     test_ret += test_xmlTextReaderGetAttributeNo();
33142     test_ret += test_xmlTextReaderGetAttributeNs();
33143     test_ret += test_xmlTextReaderGetErrorHandler();
33144     test_ret += test_xmlTextReaderGetParserColumnNumber();
33145     test_ret += test_xmlTextReaderGetParserLineNumber();
33146     test_ret += test_xmlTextReaderGetParserProp();
33147     test_ret += test_xmlTextReaderGetRemainder();
33148     test_ret += test_xmlTextReaderHasAttributes();
33149     test_ret += test_xmlTextReaderHasValue();
33150     test_ret += test_xmlTextReaderIsDefault();
33151     test_ret += test_xmlTextReaderIsEmptyElement();
33152     test_ret += test_xmlTextReaderIsNamespaceDecl();
33153     test_ret += test_xmlTextReaderIsValid();
33154     test_ret += test_xmlTextReaderLocalName();
33155     test_ret += test_xmlTextReaderLocatorBaseURI();
33156     test_ret += test_xmlTextReaderLocatorLineNumber();
33157     test_ret += test_xmlTextReaderLookupNamespace();
33158     test_ret += test_xmlTextReaderMoveToAttribute();
33159     test_ret += test_xmlTextReaderMoveToAttributeNo();
33160     test_ret += test_xmlTextReaderMoveToAttributeNs();
33161     test_ret += test_xmlTextReaderMoveToElement();
33162     test_ret += test_xmlTextReaderMoveToFirstAttribute();
33163     test_ret += test_xmlTextReaderMoveToNextAttribute();
33164     test_ret += test_xmlTextReaderName();
33165     test_ret += test_xmlTextReaderNamespaceUri();
33166     test_ret += test_xmlTextReaderNext();
33167     test_ret += test_xmlTextReaderNextSibling();
33168     test_ret += test_xmlTextReaderNodeType();
33169     test_ret += test_xmlTextReaderNormalization();
33170     test_ret += test_xmlTextReaderPrefix();
33171     test_ret += test_xmlTextReaderPreserve();
33172     test_ret += test_xmlTextReaderPreservePattern();
33173     test_ret += test_xmlTextReaderQuoteChar();
33174     test_ret += test_xmlTextReaderRead();
33175     test_ret += test_xmlTextReaderReadAttributeValue();
33176     test_ret += test_xmlTextReaderReadState();
33177     test_ret += test_xmlTextReaderRelaxNGSetSchema();
33178     test_ret += test_xmlTextReaderRelaxNGValidate();
33179     test_ret += test_xmlTextReaderRelaxNGValidateCtxt();
33180     test_ret += test_xmlTextReaderSchemaValidate();
33181     test_ret += test_xmlTextReaderSchemaValidateCtxt();
33182     test_ret += test_xmlTextReaderSetErrorHandler();
33183     test_ret += test_xmlTextReaderSetParserProp();
33184     test_ret += test_xmlTextReaderSetSchema();
33185     test_ret += test_xmlTextReaderSetStructuredErrorHandler();
33186     test_ret += test_xmlTextReaderSetup();
33187     test_ret += test_xmlTextReaderStandalone();
33188     test_ret += test_xmlTextReaderValue();
33189     test_ret += test_xmlTextReaderXmlLang();
33190 
33191     if (test_ret != 0)
33192 	printf("Module xmlreader: %d errors\n", test_ret);
33193     return(test_ret);
33194 }
33195 
33196 static int
test_xmlExpCtxtNbCons(void)33197 test_xmlExpCtxtNbCons(void) {
33198     int test_ret = 0;
33199 
33200 #if defined(LIBXML_REGEXP_ENABLED) && defined(LIBXML_EXPR_ENABLED)
33201     int mem_base;
33202     int ret_val;
33203     xmlExpCtxtPtr ctxt; /* an expression context */
33204     int n_ctxt;
33205 
33206     for (n_ctxt = 0;n_ctxt < gen_nb_xmlExpCtxtPtr;n_ctxt++) {
33207         mem_base = xmlMemBlocks();
33208         ctxt = gen_xmlExpCtxtPtr(n_ctxt, 0);
33209 
33210         ret_val = xmlExpCtxtNbCons(ctxt);
33211         desret_int(ret_val);
33212         call_tests++;
33213         des_xmlExpCtxtPtr(n_ctxt, ctxt, 0);
33214         xmlResetLastError();
33215         if (mem_base != xmlMemBlocks()) {
33216             printf("Leak of %d blocks found in xmlExpCtxtNbCons",
33217 	           xmlMemBlocks() - mem_base);
33218 	    test_ret++;
33219             printf(" %d", n_ctxt);
33220             printf("\n");
33221         }
33222     }
33223     function_tests++;
33224 #endif
33225 
33226     return(test_ret);
33227 }
33228 
33229 
33230 static int
test_xmlExpCtxtNbNodes(void)33231 test_xmlExpCtxtNbNodes(void) {
33232     int test_ret = 0;
33233 
33234 #if defined(LIBXML_REGEXP_ENABLED) && defined(LIBXML_EXPR_ENABLED)
33235     int mem_base;
33236     int ret_val;
33237     xmlExpCtxtPtr ctxt; /* an expression context */
33238     int n_ctxt;
33239 
33240     for (n_ctxt = 0;n_ctxt < gen_nb_xmlExpCtxtPtr;n_ctxt++) {
33241         mem_base = xmlMemBlocks();
33242         ctxt = gen_xmlExpCtxtPtr(n_ctxt, 0);
33243 
33244         ret_val = xmlExpCtxtNbNodes(ctxt);
33245         desret_int(ret_val);
33246         call_tests++;
33247         des_xmlExpCtxtPtr(n_ctxt, ctxt, 0);
33248         xmlResetLastError();
33249         if (mem_base != xmlMemBlocks()) {
33250             printf("Leak of %d blocks found in xmlExpCtxtNbNodes",
33251 	           xmlMemBlocks() - mem_base);
33252 	    test_ret++;
33253             printf(" %d", n_ctxt);
33254             printf("\n");
33255         }
33256     }
33257     function_tests++;
33258 #endif
33259 
33260     return(test_ret);
33261 }
33262 
33263 
33264 static int
test_xmlExpDump(void)33265 test_xmlExpDump(void) {
33266     int test_ret = 0;
33267 
33268 #if defined(LIBXML_REGEXP_ENABLED) && defined(LIBXML_EXPR_ENABLED)
33269     int mem_base;
33270     xmlBufferPtr buf; /* a buffer to receive the output */
33271     int n_buf;
33272     xmlExpNodePtr expr; /* the compiled expression */
33273     int n_expr;
33274 
33275     for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
33276     for (n_expr = 0;n_expr < gen_nb_xmlExpNodePtr;n_expr++) {
33277         mem_base = xmlMemBlocks();
33278         buf = gen_xmlBufferPtr(n_buf, 0);
33279         expr = gen_xmlExpNodePtr(n_expr, 1);
33280 
33281         xmlExpDump(buf, expr);
33282         call_tests++;
33283         des_xmlBufferPtr(n_buf, buf, 0);
33284         des_xmlExpNodePtr(n_expr, expr, 1);
33285         xmlResetLastError();
33286         if (mem_base != xmlMemBlocks()) {
33287             printf("Leak of %d blocks found in xmlExpDump",
33288 	           xmlMemBlocks() - mem_base);
33289 	    test_ret++;
33290             printf(" %d", n_buf);
33291             printf(" %d", n_expr);
33292             printf("\n");
33293         }
33294     }
33295     }
33296     function_tests++;
33297 #endif
33298 
33299     return(test_ret);
33300 }
33301 
33302 
33303 static int
test_xmlExpExpDerive(void)33304 test_xmlExpExpDerive(void) {
33305     int test_ret = 0;
33306 
33307 
33308     /* missing type support */
33309     return(test_ret);
33310 }
33311 
33312 
33313 static int
test_xmlExpGetLanguage(void)33314 test_xmlExpGetLanguage(void) {
33315     int test_ret = 0;
33316 
33317 #if defined(LIBXML_REGEXP_ENABLED) && defined(LIBXML_EXPR_ENABLED)
33318     int mem_base;
33319     int ret_val;
33320     xmlExpCtxtPtr ctxt; /* the expression context */
33321     int n_ctxt;
33322     xmlExpNodePtr exp; /* the expression */
33323     int n_exp;
33324     xmlChar ** langList; /* where to store the tokens */
33325     int n_langList;
33326     int len; /* the allocated length of @list */
33327     int n_len;
33328 
33329     for (n_ctxt = 0;n_ctxt < gen_nb_xmlExpCtxtPtr;n_ctxt++) {
33330     for (n_exp = 0;n_exp < gen_nb_xmlExpNodePtr;n_exp++) {
33331     for (n_langList = 0;n_langList < gen_nb_const_xmlChar_ptr_ptr;n_langList++) {
33332     for (n_len = 0;n_len < gen_nb_int;n_len++) {
33333         mem_base = xmlMemBlocks();
33334         ctxt = gen_xmlExpCtxtPtr(n_ctxt, 0);
33335         exp = gen_xmlExpNodePtr(n_exp, 1);
33336         langList = gen_const_xmlChar_ptr_ptr(n_langList, 2);
33337         len = gen_int(n_len, 3);
33338 
33339         ret_val = xmlExpGetLanguage(ctxt, exp, (const xmlChar **)langList, len);
33340         desret_int(ret_val);
33341         call_tests++;
33342         des_xmlExpCtxtPtr(n_ctxt, ctxt, 0);
33343         des_xmlExpNodePtr(n_exp, exp, 1);
33344         des_const_xmlChar_ptr_ptr(n_langList, (const xmlChar **)langList, 2);
33345         des_int(n_len, len, 3);
33346         xmlResetLastError();
33347         if (mem_base != xmlMemBlocks()) {
33348             printf("Leak of %d blocks found in xmlExpGetLanguage",
33349 	           xmlMemBlocks() - mem_base);
33350 	    test_ret++;
33351             printf(" %d", n_ctxt);
33352             printf(" %d", n_exp);
33353             printf(" %d", n_langList);
33354             printf(" %d", n_len);
33355             printf("\n");
33356         }
33357     }
33358     }
33359     }
33360     }
33361     function_tests++;
33362 #endif
33363 
33364     return(test_ret);
33365 }
33366 
33367 
33368 static int
test_xmlExpGetStart(void)33369 test_xmlExpGetStart(void) {
33370     int test_ret = 0;
33371 
33372 #if defined(LIBXML_REGEXP_ENABLED) && defined(LIBXML_EXPR_ENABLED)
33373     int mem_base;
33374     int ret_val;
33375     xmlExpCtxtPtr ctxt; /* the expression context */
33376     int n_ctxt;
33377     xmlExpNodePtr exp; /* the expression */
33378     int n_exp;
33379     xmlChar ** tokList; /* where to store the tokens */
33380     int n_tokList;
33381     int len; /* the allocated length of @list */
33382     int n_len;
33383 
33384     for (n_ctxt = 0;n_ctxt < gen_nb_xmlExpCtxtPtr;n_ctxt++) {
33385     for (n_exp = 0;n_exp < gen_nb_xmlExpNodePtr;n_exp++) {
33386     for (n_tokList = 0;n_tokList < gen_nb_const_xmlChar_ptr_ptr;n_tokList++) {
33387     for (n_len = 0;n_len < gen_nb_int;n_len++) {
33388         mem_base = xmlMemBlocks();
33389         ctxt = gen_xmlExpCtxtPtr(n_ctxt, 0);
33390         exp = gen_xmlExpNodePtr(n_exp, 1);
33391         tokList = gen_const_xmlChar_ptr_ptr(n_tokList, 2);
33392         len = gen_int(n_len, 3);
33393 
33394         ret_val = xmlExpGetStart(ctxt, exp, (const xmlChar **)tokList, len);
33395         desret_int(ret_val);
33396         call_tests++;
33397         des_xmlExpCtxtPtr(n_ctxt, ctxt, 0);
33398         des_xmlExpNodePtr(n_exp, exp, 1);
33399         des_const_xmlChar_ptr_ptr(n_tokList, (const xmlChar **)tokList, 2);
33400         des_int(n_len, len, 3);
33401         xmlResetLastError();
33402         if (mem_base != xmlMemBlocks()) {
33403             printf("Leak of %d blocks found in xmlExpGetStart",
33404 	           xmlMemBlocks() - mem_base);
33405 	    test_ret++;
33406             printf(" %d", n_ctxt);
33407             printf(" %d", n_exp);
33408             printf(" %d", n_tokList);
33409             printf(" %d", n_len);
33410             printf("\n");
33411         }
33412     }
33413     }
33414     }
33415     }
33416     function_tests++;
33417 #endif
33418 
33419     return(test_ret);
33420 }
33421 
33422 
33423 static int
test_xmlExpIsNillable(void)33424 test_xmlExpIsNillable(void) {
33425     int test_ret = 0;
33426 
33427 #if defined(LIBXML_REGEXP_ENABLED) && defined(LIBXML_EXPR_ENABLED)
33428     int mem_base;
33429     int ret_val;
33430     xmlExpNodePtr exp; /* the expression */
33431     int n_exp;
33432 
33433     for (n_exp = 0;n_exp < gen_nb_xmlExpNodePtr;n_exp++) {
33434         mem_base = xmlMemBlocks();
33435         exp = gen_xmlExpNodePtr(n_exp, 0);
33436 
33437         ret_val = xmlExpIsNillable(exp);
33438         desret_int(ret_val);
33439         call_tests++;
33440         des_xmlExpNodePtr(n_exp, exp, 0);
33441         xmlResetLastError();
33442         if (mem_base != xmlMemBlocks()) {
33443             printf("Leak of %d blocks found in xmlExpIsNillable",
33444 	           xmlMemBlocks() - mem_base);
33445 	    test_ret++;
33446             printf(" %d", n_exp);
33447             printf("\n");
33448         }
33449     }
33450     function_tests++;
33451 #endif
33452 
33453     return(test_ret);
33454 }
33455 
33456 
33457 static int
test_xmlExpMaxToken(void)33458 test_xmlExpMaxToken(void) {
33459     int test_ret = 0;
33460 
33461 #if defined(LIBXML_REGEXP_ENABLED) && defined(LIBXML_EXPR_ENABLED)
33462     int mem_base;
33463     int ret_val;
33464     xmlExpNodePtr expr; /* a compiled expression */
33465     int n_expr;
33466 
33467     for (n_expr = 0;n_expr < gen_nb_xmlExpNodePtr;n_expr++) {
33468         mem_base = xmlMemBlocks();
33469         expr = gen_xmlExpNodePtr(n_expr, 0);
33470 
33471         ret_val = xmlExpMaxToken(expr);
33472         desret_int(ret_val);
33473         call_tests++;
33474         des_xmlExpNodePtr(n_expr, expr, 0);
33475         xmlResetLastError();
33476         if (mem_base != xmlMemBlocks()) {
33477             printf("Leak of %d blocks found in xmlExpMaxToken",
33478 	           xmlMemBlocks() - mem_base);
33479 	    test_ret++;
33480             printf(" %d", n_expr);
33481             printf("\n");
33482         }
33483     }
33484     function_tests++;
33485 #endif
33486 
33487     return(test_ret);
33488 }
33489 
33490 
33491 static int
test_xmlExpNewAtom(void)33492 test_xmlExpNewAtom(void) {
33493     int test_ret = 0;
33494 
33495 
33496     /* missing type support */
33497     return(test_ret);
33498 }
33499 
33500 
33501 static int
test_xmlExpNewCtxt(void)33502 test_xmlExpNewCtxt(void) {
33503     int test_ret = 0;
33504 
33505 
33506     /* missing type support */
33507     return(test_ret);
33508 }
33509 
33510 
33511 static int
test_xmlExpNewOr(void)33512 test_xmlExpNewOr(void) {
33513     int test_ret = 0;
33514 
33515 
33516     /* missing type support */
33517     return(test_ret);
33518 }
33519 
33520 
33521 static int
test_xmlExpNewRange(void)33522 test_xmlExpNewRange(void) {
33523     int test_ret = 0;
33524 
33525 
33526     /* missing type support */
33527     return(test_ret);
33528 }
33529 
33530 
33531 static int
test_xmlExpNewSeq(void)33532 test_xmlExpNewSeq(void) {
33533     int test_ret = 0;
33534 
33535 
33536     /* missing type support */
33537     return(test_ret);
33538 }
33539 
33540 
33541 static int
test_xmlExpParse(void)33542 test_xmlExpParse(void) {
33543     int test_ret = 0;
33544 
33545 
33546     /* missing type support */
33547     return(test_ret);
33548 }
33549 
33550 
33551 static int
test_xmlExpRef(void)33552 test_xmlExpRef(void) {
33553     int test_ret = 0;
33554 
33555 #if defined(LIBXML_REGEXP_ENABLED) && defined(LIBXML_EXPR_ENABLED)
33556     int mem_base;
33557     xmlExpNodePtr exp; /* the expression */
33558     int n_exp;
33559 
33560     for (n_exp = 0;n_exp < gen_nb_xmlExpNodePtr;n_exp++) {
33561         mem_base = xmlMemBlocks();
33562         exp = gen_xmlExpNodePtr(n_exp, 0);
33563 
33564         xmlExpRef(exp);
33565         call_tests++;
33566         des_xmlExpNodePtr(n_exp, exp, 0);
33567         xmlResetLastError();
33568         if (mem_base != xmlMemBlocks()) {
33569             printf("Leak of %d blocks found in xmlExpRef",
33570 	           xmlMemBlocks() - mem_base);
33571 	    test_ret++;
33572             printf(" %d", n_exp);
33573             printf("\n");
33574         }
33575     }
33576     function_tests++;
33577 #endif
33578 
33579     return(test_ret);
33580 }
33581 
33582 
33583 static int
test_xmlExpStringDerive(void)33584 test_xmlExpStringDerive(void) {
33585     int test_ret = 0;
33586 
33587 
33588     /* missing type support */
33589     return(test_ret);
33590 }
33591 
33592 
33593 static int
test_xmlExpSubsume(void)33594 test_xmlExpSubsume(void) {
33595     int test_ret = 0;
33596 
33597 #if defined(LIBXML_REGEXP_ENABLED) && defined(LIBXML_EXPR_ENABLED)
33598     int mem_base;
33599     int ret_val;
33600     xmlExpCtxtPtr ctxt; /* the expressions context */
33601     int n_ctxt;
33602     xmlExpNodePtr exp; /* the englobing expression */
33603     int n_exp;
33604     xmlExpNodePtr sub; /* the subexpression */
33605     int n_sub;
33606 
33607     for (n_ctxt = 0;n_ctxt < gen_nb_xmlExpCtxtPtr;n_ctxt++) {
33608     for (n_exp = 0;n_exp < gen_nb_xmlExpNodePtr;n_exp++) {
33609     for (n_sub = 0;n_sub < gen_nb_xmlExpNodePtr;n_sub++) {
33610         mem_base = xmlMemBlocks();
33611         ctxt = gen_xmlExpCtxtPtr(n_ctxt, 0);
33612         exp = gen_xmlExpNodePtr(n_exp, 1);
33613         sub = gen_xmlExpNodePtr(n_sub, 2);
33614 
33615         ret_val = xmlExpSubsume(ctxt, exp, sub);
33616         desret_int(ret_val);
33617         call_tests++;
33618         des_xmlExpCtxtPtr(n_ctxt, ctxt, 0);
33619         des_xmlExpNodePtr(n_exp, exp, 1);
33620         des_xmlExpNodePtr(n_sub, sub, 2);
33621         xmlResetLastError();
33622         if (mem_base != xmlMemBlocks()) {
33623             printf("Leak of %d blocks found in xmlExpSubsume",
33624 	           xmlMemBlocks() - mem_base);
33625 	    test_ret++;
33626             printf(" %d", n_ctxt);
33627             printf(" %d", n_exp);
33628             printf(" %d", n_sub);
33629             printf("\n");
33630         }
33631     }
33632     }
33633     }
33634     function_tests++;
33635 #endif
33636 
33637     return(test_ret);
33638 }
33639 
33640 #ifdef LIBXML_REGEXP_ENABLED
33641 
33642 #define gen_nb_xmlRegExecCtxtPtr 1
gen_xmlRegExecCtxtPtr(int no ATTRIBUTE_UNUSED,int nr ATTRIBUTE_UNUSED)33643 static xmlRegExecCtxtPtr gen_xmlRegExecCtxtPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
33644     return(NULL);
33645 }
des_xmlRegExecCtxtPtr(int no ATTRIBUTE_UNUSED,xmlRegExecCtxtPtr val ATTRIBUTE_UNUSED,int nr ATTRIBUTE_UNUSED)33646 static void des_xmlRegExecCtxtPtr(int no ATTRIBUTE_UNUSED, xmlRegExecCtxtPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
33647 }
33648 #endif
33649 
33650 
33651 static int
test_xmlRegExecErrInfo(void)33652 test_xmlRegExecErrInfo(void) {
33653     int test_ret = 0;
33654 
33655 #if defined(LIBXML_REGEXP_ENABLED)
33656     int mem_base;
33657     int ret_val;
33658     xmlRegExecCtxtPtr exec; /* a regexp execution context generating an error */
33659     int n_exec;
33660     xmlChar ** string; /* return value for the error string */
33661     int n_string;
33662     int * nbval; /* pointer to the number of accepted values IN/OUT */
33663     int n_nbval;
33664     int * nbneg; /* return number of negative transitions */
33665     int n_nbneg;
33666     xmlChar ** values; /* pointer to the array of acceptable values */
33667     int n_values;
33668     int * terminal; /* return value if this was a terminal state */
33669     int n_terminal;
33670 
33671     for (n_exec = 0;n_exec < gen_nb_xmlRegExecCtxtPtr;n_exec++) {
33672     for (n_string = 0;n_string < gen_nb_const_xmlChar_ptr_ptr;n_string++) {
33673     for (n_nbval = 0;n_nbval < gen_nb_int_ptr;n_nbval++) {
33674     for (n_nbneg = 0;n_nbneg < gen_nb_int_ptr;n_nbneg++) {
33675     for (n_values = 0;n_values < gen_nb_xmlChar_ptr_ptr;n_values++) {
33676     for (n_terminal = 0;n_terminal < gen_nb_int_ptr;n_terminal++) {
33677         mem_base = xmlMemBlocks();
33678         exec = gen_xmlRegExecCtxtPtr(n_exec, 0);
33679         string = gen_const_xmlChar_ptr_ptr(n_string, 1);
33680         nbval = gen_int_ptr(n_nbval, 2);
33681         nbneg = gen_int_ptr(n_nbneg, 3);
33682         values = gen_xmlChar_ptr_ptr(n_values, 4);
33683         terminal = gen_int_ptr(n_terminal, 5);
33684 
33685         ret_val = xmlRegExecErrInfo(exec, (const xmlChar **)string, nbval, nbneg, values, terminal);
33686         desret_int(ret_val);
33687         call_tests++;
33688         des_xmlRegExecCtxtPtr(n_exec, exec, 0);
33689         des_const_xmlChar_ptr_ptr(n_string, (const xmlChar **)string, 1);
33690         des_int_ptr(n_nbval, nbval, 2);
33691         des_int_ptr(n_nbneg, nbneg, 3);
33692         des_xmlChar_ptr_ptr(n_values, values, 4);
33693         des_int_ptr(n_terminal, terminal, 5);
33694         xmlResetLastError();
33695         if (mem_base != xmlMemBlocks()) {
33696             printf("Leak of %d blocks found in xmlRegExecErrInfo",
33697 	           xmlMemBlocks() - mem_base);
33698 	    test_ret++;
33699             printf(" %d", n_exec);
33700             printf(" %d", n_string);
33701             printf(" %d", n_nbval);
33702             printf(" %d", n_nbneg);
33703             printf(" %d", n_values);
33704             printf(" %d", n_terminal);
33705             printf("\n");
33706         }
33707     }
33708     }
33709     }
33710     }
33711     }
33712     }
33713     function_tests++;
33714 #endif
33715 
33716     return(test_ret);
33717 }
33718 
33719 
33720 static int
test_xmlRegExecNextValues(void)33721 test_xmlRegExecNextValues(void) {
33722     int test_ret = 0;
33723 
33724 #if defined(LIBXML_REGEXP_ENABLED)
33725     int mem_base;
33726     int ret_val;
33727     xmlRegExecCtxtPtr exec; /* a regexp execution context */
33728     int n_exec;
33729     int * nbval; /* pointer to the number of accepted values IN/OUT */
33730     int n_nbval;
33731     int * nbneg; /* return number of negative transitions */
33732     int n_nbneg;
33733     xmlChar ** values; /* pointer to the array of acceptable values */
33734     int n_values;
33735     int * terminal; /* return value if this was a terminal state */
33736     int n_terminal;
33737 
33738     for (n_exec = 0;n_exec < gen_nb_xmlRegExecCtxtPtr;n_exec++) {
33739     for (n_nbval = 0;n_nbval < gen_nb_int_ptr;n_nbval++) {
33740     for (n_nbneg = 0;n_nbneg < gen_nb_int_ptr;n_nbneg++) {
33741     for (n_values = 0;n_values < gen_nb_xmlChar_ptr_ptr;n_values++) {
33742     for (n_terminal = 0;n_terminal < gen_nb_int_ptr;n_terminal++) {
33743         mem_base = xmlMemBlocks();
33744         exec = gen_xmlRegExecCtxtPtr(n_exec, 0);
33745         nbval = gen_int_ptr(n_nbval, 1);
33746         nbneg = gen_int_ptr(n_nbneg, 2);
33747         values = gen_xmlChar_ptr_ptr(n_values, 3);
33748         terminal = gen_int_ptr(n_terminal, 4);
33749 
33750         ret_val = xmlRegExecNextValues(exec, nbval, nbneg, values, terminal);
33751         desret_int(ret_val);
33752         call_tests++;
33753         des_xmlRegExecCtxtPtr(n_exec, exec, 0);
33754         des_int_ptr(n_nbval, nbval, 1);
33755         des_int_ptr(n_nbneg, nbneg, 2);
33756         des_xmlChar_ptr_ptr(n_values, values, 3);
33757         des_int_ptr(n_terminal, terminal, 4);
33758         xmlResetLastError();
33759         if (mem_base != xmlMemBlocks()) {
33760             printf("Leak of %d blocks found in xmlRegExecNextValues",
33761 	           xmlMemBlocks() - mem_base);
33762 	    test_ret++;
33763             printf(" %d", n_exec);
33764             printf(" %d", n_nbval);
33765             printf(" %d", n_nbneg);
33766             printf(" %d", n_values);
33767             printf(" %d", n_terminal);
33768             printf("\n");
33769         }
33770     }
33771     }
33772     }
33773     }
33774     }
33775     function_tests++;
33776 #endif
33777 
33778     return(test_ret);
33779 }
33780 
33781 
33782 static int
test_xmlRegExecPushString(void)33783 test_xmlRegExecPushString(void) {
33784     int test_ret = 0;
33785 
33786 #if defined(LIBXML_REGEXP_ENABLED)
33787     int mem_base;
33788     int ret_val;
33789     xmlRegExecCtxtPtr exec; /* a regexp execution context or NULL to indicate the end */
33790     int n_exec;
33791     xmlChar * value; /* a string token input */
33792     int n_value;
33793     void * data; /* data associated to the token to reuse in callbacks */
33794     int n_data;
33795 
33796     for (n_exec = 0;n_exec < gen_nb_xmlRegExecCtxtPtr;n_exec++) {
33797     for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
33798     for (n_data = 0;n_data < gen_nb_userdata;n_data++) {
33799         mem_base = xmlMemBlocks();
33800         exec = gen_xmlRegExecCtxtPtr(n_exec, 0);
33801         value = gen_const_xmlChar_ptr(n_value, 1);
33802         data = gen_userdata(n_data, 2);
33803 
33804         ret_val = xmlRegExecPushString(exec, (const xmlChar *)value, data);
33805         desret_int(ret_val);
33806         call_tests++;
33807         des_xmlRegExecCtxtPtr(n_exec, exec, 0);
33808         des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 1);
33809         des_userdata(n_data, data, 2);
33810         xmlResetLastError();
33811         if (mem_base != xmlMemBlocks()) {
33812             printf("Leak of %d blocks found in xmlRegExecPushString",
33813 	           xmlMemBlocks() - mem_base);
33814 	    test_ret++;
33815             printf(" %d", n_exec);
33816             printf(" %d", n_value);
33817             printf(" %d", n_data);
33818             printf("\n");
33819         }
33820     }
33821     }
33822     }
33823     function_tests++;
33824 #endif
33825 
33826     return(test_ret);
33827 }
33828 
33829 
33830 static int
test_xmlRegExecPushString2(void)33831 test_xmlRegExecPushString2(void) {
33832     int test_ret = 0;
33833 
33834 #if defined(LIBXML_REGEXP_ENABLED)
33835     int mem_base;
33836     int ret_val;
33837     xmlRegExecCtxtPtr exec; /* a regexp execution context or NULL to indicate the end */
33838     int n_exec;
33839     xmlChar * value; /* the first string token input */
33840     int n_value;
33841     xmlChar * value2; /* the second string token input */
33842     int n_value2;
33843     void * data; /* data associated to the token to reuse in callbacks */
33844     int n_data;
33845 
33846     for (n_exec = 0;n_exec < gen_nb_xmlRegExecCtxtPtr;n_exec++) {
33847     for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
33848     for (n_value2 = 0;n_value2 < gen_nb_const_xmlChar_ptr;n_value2++) {
33849     for (n_data = 0;n_data < gen_nb_userdata;n_data++) {
33850         mem_base = xmlMemBlocks();
33851         exec = gen_xmlRegExecCtxtPtr(n_exec, 0);
33852         value = gen_const_xmlChar_ptr(n_value, 1);
33853         value2 = gen_const_xmlChar_ptr(n_value2, 2);
33854         data = gen_userdata(n_data, 3);
33855 
33856         ret_val = xmlRegExecPushString2(exec, (const xmlChar *)value, (const xmlChar *)value2, data);
33857         desret_int(ret_val);
33858         call_tests++;
33859         des_xmlRegExecCtxtPtr(n_exec, exec, 0);
33860         des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 1);
33861         des_const_xmlChar_ptr(n_value2, (const xmlChar *)value2, 2);
33862         des_userdata(n_data, data, 3);
33863         xmlResetLastError();
33864         if (mem_base != xmlMemBlocks()) {
33865             printf("Leak of %d blocks found in xmlRegExecPushString2",
33866 	           xmlMemBlocks() - mem_base);
33867 	    test_ret++;
33868             printf(" %d", n_exec);
33869             printf(" %d", n_value);
33870             printf(" %d", n_value2);
33871             printf(" %d", n_data);
33872             printf("\n");
33873         }
33874     }
33875     }
33876     }
33877     }
33878     function_tests++;
33879 #endif
33880 
33881     return(test_ret);
33882 }
33883 
33884 
33885 static int
test_xmlRegNewExecCtxt(void)33886 test_xmlRegNewExecCtxt(void) {
33887     int test_ret = 0;
33888 
33889 
33890     /* missing type support */
33891     return(test_ret);
33892 }
33893 
33894 
33895 static int
test_xmlRegexpCompile(void)33896 test_xmlRegexpCompile(void) {
33897     int test_ret = 0;
33898 
33899 
33900     /* missing type support */
33901     return(test_ret);
33902 }
33903 
33904 #ifdef LIBXML_REGEXP_ENABLED
33905 
33906 #define gen_nb_xmlRegexpPtr 1
gen_xmlRegexpPtr(int no ATTRIBUTE_UNUSED,int nr ATTRIBUTE_UNUSED)33907 static xmlRegexpPtr gen_xmlRegexpPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
33908     return(NULL);
33909 }
des_xmlRegexpPtr(int no ATTRIBUTE_UNUSED,xmlRegexpPtr val ATTRIBUTE_UNUSED,int nr ATTRIBUTE_UNUSED)33910 static void des_xmlRegexpPtr(int no ATTRIBUTE_UNUSED, xmlRegexpPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
33911 }
33912 #endif
33913 
33914 
33915 static int
test_xmlRegexpExec(void)33916 test_xmlRegexpExec(void) {
33917     int test_ret = 0;
33918 
33919 #if defined(LIBXML_REGEXP_ENABLED)
33920     int mem_base;
33921     int ret_val;
33922     xmlRegexpPtr comp; /* the compiled regular expression */
33923     int n_comp;
33924     xmlChar * content; /* the value to check against the regular expression */
33925     int n_content;
33926 
33927     for (n_comp = 0;n_comp < gen_nb_xmlRegexpPtr;n_comp++) {
33928     for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
33929         mem_base = xmlMemBlocks();
33930         comp = gen_xmlRegexpPtr(n_comp, 0);
33931         content = gen_const_xmlChar_ptr(n_content, 1);
33932 
33933         ret_val = xmlRegexpExec(comp, (const xmlChar *)content);
33934         desret_int(ret_val);
33935         call_tests++;
33936         des_xmlRegexpPtr(n_comp, comp, 0);
33937         des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 1);
33938         xmlResetLastError();
33939         if (mem_base != xmlMemBlocks()) {
33940             printf("Leak of %d blocks found in xmlRegexpExec",
33941 	           xmlMemBlocks() - mem_base);
33942 	    test_ret++;
33943             printf(" %d", n_comp);
33944             printf(" %d", n_content);
33945             printf("\n");
33946         }
33947     }
33948     }
33949     function_tests++;
33950 #endif
33951 
33952     return(test_ret);
33953 }
33954 
33955 
33956 static int
test_xmlRegexpIsDeterminist(void)33957 test_xmlRegexpIsDeterminist(void) {
33958     int test_ret = 0;
33959 
33960 #if defined(LIBXML_REGEXP_ENABLED)
33961     int mem_base;
33962     int ret_val;
33963     xmlRegexpPtr comp; /* the compiled regular expression */
33964     int n_comp;
33965 
33966     for (n_comp = 0;n_comp < gen_nb_xmlRegexpPtr;n_comp++) {
33967         mem_base = xmlMemBlocks();
33968         comp = gen_xmlRegexpPtr(n_comp, 0);
33969 
33970         ret_val = xmlRegexpIsDeterminist(comp);
33971         desret_int(ret_val);
33972         call_tests++;
33973         des_xmlRegexpPtr(n_comp, comp, 0);
33974         xmlResetLastError();
33975         if (mem_base != xmlMemBlocks()) {
33976             printf("Leak of %d blocks found in xmlRegexpIsDeterminist",
33977 	           xmlMemBlocks() - mem_base);
33978 	    test_ret++;
33979             printf(" %d", n_comp);
33980             printf("\n");
33981         }
33982     }
33983     function_tests++;
33984 #endif
33985 
33986     return(test_ret);
33987 }
33988 
33989 
33990 static int
test_xmlRegexpPrint(void)33991 test_xmlRegexpPrint(void) {
33992     int test_ret = 0;
33993 
33994 #if defined(LIBXML_REGEXP_ENABLED)
33995     int mem_base;
33996     FILE * output; /* the file for the output debug */
33997     int n_output;
33998     xmlRegexpPtr regexp; /* the compiled regexp */
33999     int n_regexp;
34000 
34001     for (n_output = 0;n_output < gen_nb_FILE_ptr;n_output++) {
34002     for (n_regexp = 0;n_regexp < gen_nb_xmlRegexpPtr;n_regexp++) {
34003         mem_base = xmlMemBlocks();
34004         output = gen_FILE_ptr(n_output, 0);
34005         regexp = gen_xmlRegexpPtr(n_regexp, 1);
34006 
34007         xmlRegexpPrint(output, regexp);
34008         call_tests++;
34009         des_FILE_ptr(n_output, output, 0);
34010         des_xmlRegexpPtr(n_regexp, regexp, 1);
34011         xmlResetLastError();
34012         if (mem_base != xmlMemBlocks()) {
34013             printf("Leak of %d blocks found in xmlRegexpPrint",
34014 	           xmlMemBlocks() - mem_base);
34015 	    test_ret++;
34016             printf(" %d", n_output);
34017             printf(" %d", n_regexp);
34018             printf("\n");
34019         }
34020     }
34021     }
34022     function_tests++;
34023 #endif
34024 
34025     return(test_ret);
34026 }
34027 
34028 static int
test_xmlregexp(void)34029 test_xmlregexp(void) {
34030     int test_ret = 0;
34031 
34032     if (quiet == 0) printf("Testing xmlregexp : 16 of 30 functions ...\n");
34033     test_ret += test_xmlExpCtxtNbCons();
34034     test_ret += test_xmlExpCtxtNbNodes();
34035     test_ret += test_xmlExpDump();
34036     test_ret += test_xmlExpExpDerive();
34037     test_ret += test_xmlExpGetLanguage();
34038     test_ret += test_xmlExpGetStart();
34039     test_ret += test_xmlExpIsNillable();
34040     test_ret += test_xmlExpMaxToken();
34041     test_ret += test_xmlExpNewAtom();
34042     test_ret += test_xmlExpNewCtxt();
34043     test_ret += test_xmlExpNewOr();
34044     test_ret += test_xmlExpNewRange();
34045     test_ret += test_xmlExpNewSeq();
34046     test_ret += test_xmlExpParse();
34047     test_ret += test_xmlExpRef();
34048     test_ret += test_xmlExpStringDerive();
34049     test_ret += test_xmlExpSubsume();
34050     test_ret += test_xmlRegExecErrInfo();
34051     test_ret += test_xmlRegExecNextValues();
34052     test_ret += test_xmlRegExecPushString();
34053     test_ret += test_xmlRegExecPushString2();
34054     test_ret += test_xmlRegNewExecCtxt();
34055     test_ret += test_xmlRegexpCompile();
34056     test_ret += test_xmlRegexpExec();
34057     test_ret += test_xmlRegexpIsDeterminist();
34058     test_ret += test_xmlRegexpPrint();
34059 
34060     if (test_ret != 0)
34061 	printf("Module xmlregexp: %d errors\n", test_ret);
34062     return(test_ret);
34063 }
34064 #ifdef LIBXML_OUTPUT_ENABLED
34065 
34066 #define gen_nb_xmlSaveCtxtPtr 1
gen_xmlSaveCtxtPtr(int no ATTRIBUTE_UNUSED,int nr ATTRIBUTE_UNUSED)34067 static xmlSaveCtxtPtr gen_xmlSaveCtxtPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
34068     return(NULL);
34069 }
des_xmlSaveCtxtPtr(int no ATTRIBUTE_UNUSED,xmlSaveCtxtPtr val ATTRIBUTE_UNUSED,int nr ATTRIBUTE_UNUSED)34070 static void des_xmlSaveCtxtPtr(int no ATTRIBUTE_UNUSED, xmlSaveCtxtPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
34071 }
34072 #endif
34073 
34074 
34075 static int
test_xmlSaveClose(void)34076 test_xmlSaveClose(void) {
34077     int test_ret = 0;
34078 
34079 #if defined(LIBXML_OUTPUT_ENABLED)
34080     int mem_base;
34081     int ret_val;
34082     xmlSaveCtxtPtr ctxt; /* a document saving context */
34083     int n_ctxt;
34084 
34085     for (n_ctxt = 0;n_ctxt < gen_nb_xmlSaveCtxtPtr;n_ctxt++) {
34086         mem_base = xmlMemBlocks();
34087         ctxt = gen_xmlSaveCtxtPtr(n_ctxt, 0);
34088 
34089         ret_val = xmlSaveClose(ctxt);
34090         desret_int(ret_val);
34091         call_tests++;
34092         des_xmlSaveCtxtPtr(n_ctxt, ctxt, 0);
34093         xmlResetLastError();
34094         if (mem_base != xmlMemBlocks()) {
34095             printf("Leak of %d blocks found in xmlSaveClose",
34096 	           xmlMemBlocks() - mem_base);
34097 	    test_ret++;
34098             printf(" %d", n_ctxt);
34099             printf("\n");
34100         }
34101     }
34102     function_tests++;
34103 #endif
34104 
34105     return(test_ret);
34106 }
34107 
34108 
34109 static int
test_xmlSaveDoc(void)34110 test_xmlSaveDoc(void) {
34111     int test_ret = 0;
34112 
34113 #if defined(LIBXML_OUTPUT_ENABLED)
34114     int mem_base;
34115     long ret_val;
34116     xmlSaveCtxtPtr ctxt; /* a document saving context */
34117     int n_ctxt;
34118     xmlDocPtr doc; /* a document */
34119     int n_doc;
34120 
34121     for (n_ctxt = 0;n_ctxt < gen_nb_xmlSaveCtxtPtr;n_ctxt++) {
34122     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
34123         mem_base = xmlMemBlocks();
34124         ctxt = gen_xmlSaveCtxtPtr(n_ctxt, 0);
34125         doc = gen_xmlDocPtr(n_doc, 1);
34126 
34127         ret_val = xmlSaveDoc(ctxt, doc);
34128         desret_long(ret_val);
34129         call_tests++;
34130         des_xmlSaveCtxtPtr(n_ctxt, ctxt, 0);
34131         des_xmlDocPtr(n_doc, doc, 1);
34132         xmlResetLastError();
34133         if (mem_base != xmlMemBlocks()) {
34134             printf("Leak of %d blocks found in xmlSaveDoc",
34135 	           xmlMemBlocks() - mem_base);
34136 	    test_ret++;
34137             printf(" %d", n_ctxt);
34138             printf(" %d", n_doc);
34139             printf("\n");
34140         }
34141     }
34142     }
34143     function_tests++;
34144 #endif
34145 
34146     return(test_ret);
34147 }
34148 
34149 
34150 static int
test_xmlSaveFlush(void)34151 test_xmlSaveFlush(void) {
34152     int test_ret = 0;
34153 
34154 #if defined(LIBXML_OUTPUT_ENABLED)
34155     int mem_base;
34156     int ret_val;
34157     xmlSaveCtxtPtr ctxt; /* a document saving context */
34158     int n_ctxt;
34159 
34160     for (n_ctxt = 0;n_ctxt < gen_nb_xmlSaveCtxtPtr;n_ctxt++) {
34161         mem_base = xmlMemBlocks();
34162         ctxt = gen_xmlSaveCtxtPtr(n_ctxt, 0);
34163 
34164         ret_val = xmlSaveFlush(ctxt);
34165         desret_int(ret_val);
34166         call_tests++;
34167         des_xmlSaveCtxtPtr(n_ctxt, ctxt, 0);
34168         xmlResetLastError();
34169         if (mem_base != xmlMemBlocks()) {
34170             printf("Leak of %d blocks found in xmlSaveFlush",
34171 	           xmlMemBlocks() - mem_base);
34172 	    test_ret++;
34173             printf(" %d", n_ctxt);
34174             printf("\n");
34175         }
34176     }
34177     function_tests++;
34178 #endif
34179 
34180     return(test_ret);
34181 }
34182 
34183 
34184 static int
test_xmlSaveSetAttrEscape(void)34185 test_xmlSaveSetAttrEscape(void) {
34186     int test_ret = 0;
34187 
34188 
34189     /* missing type support */
34190     return(test_ret);
34191 }
34192 
34193 
34194 static int
test_xmlSaveSetEscape(void)34195 test_xmlSaveSetEscape(void) {
34196     int test_ret = 0;
34197 
34198 
34199     /* missing type support */
34200     return(test_ret);
34201 }
34202 
34203 
34204 static int
test_xmlSaveToBuffer(void)34205 test_xmlSaveToBuffer(void) {
34206     int test_ret = 0;
34207 
34208 
34209     /* missing type support */
34210     return(test_ret);
34211 }
34212 
34213 
34214 static int
test_xmlSaveToFd(void)34215 test_xmlSaveToFd(void) {
34216     int test_ret = 0;
34217 
34218 
34219     /* missing type support */
34220     return(test_ret);
34221 }
34222 
34223 
34224 static int
test_xmlSaveToFilename(void)34225 test_xmlSaveToFilename(void) {
34226     int test_ret = 0;
34227 
34228 
34229     /* missing type support */
34230     return(test_ret);
34231 }
34232 
34233 
34234 static int
test_xmlSaveTree(void)34235 test_xmlSaveTree(void) {
34236     int test_ret = 0;
34237 
34238 #if defined(LIBXML_OUTPUT_ENABLED)
34239     int mem_base;
34240     long ret_val;
34241     xmlSaveCtxtPtr ctxt; /* a document saving context */
34242     int n_ctxt;
34243     xmlNodePtr node; /* the top node of the subtree to save */
34244     int n_node;
34245 
34246     for (n_ctxt = 0;n_ctxt < gen_nb_xmlSaveCtxtPtr;n_ctxt++) {
34247     for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
34248         mem_base = xmlMemBlocks();
34249         ctxt = gen_xmlSaveCtxtPtr(n_ctxt, 0);
34250         node = gen_xmlNodePtr(n_node, 1);
34251 
34252         ret_val = xmlSaveTree(ctxt, node);
34253         desret_long(ret_val);
34254         call_tests++;
34255         des_xmlSaveCtxtPtr(n_ctxt, ctxt, 0);
34256         des_xmlNodePtr(n_node, node, 1);
34257         xmlResetLastError();
34258         if (mem_base != xmlMemBlocks()) {
34259             printf("Leak of %d blocks found in xmlSaveTree",
34260 	           xmlMemBlocks() - mem_base);
34261 	    test_ret++;
34262             printf(" %d", n_ctxt);
34263             printf(" %d", n_node);
34264             printf("\n");
34265         }
34266     }
34267     }
34268     function_tests++;
34269 #endif
34270 
34271     return(test_ret);
34272 }
34273 
34274 static int
test_xmlsave(void)34275 test_xmlsave(void) {
34276     int test_ret = 0;
34277 
34278     if (quiet == 0) printf("Testing xmlsave : 4 of 10 functions ...\n");
34279     test_ret += test_xmlSaveClose();
34280     test_ret += test_xmlSaveDoc();
34281     test_ret += test_xmlSaveFlush();
34282     test_ret += test_xmlSaveSetAttrEscape();
34283     test_ret += test_xmlSaveSetEscape();
34284     test_ret += test_xmlSaveToBuffer();
34285     test_ret += test_xmlSaveToFd();
34286     test_ret += test_xmlSaveToFilename();
34287     test_ret += test_xmlSaveTree();
34288 
34289     if (test_ret != 0)
34290 	printf("Module xmlsave: %d errors\n", test_ret);
34291     return(test_ret);
34292 }
34293 
34294 static int
test_xmlSchemaDump(void)34295 test_xmlSchemaDump(void) {
34296     int test_ret = 0;
34297 
34298 #if defined(LIBXML_SCHEMAS_ENABLED) && defined(LIBXML_OUTPUT_ENABLED)
34299     int mem_base;
34300     FILE * output; /* the file output */
34301     int n_output;
34302     xmlSchemaPtr schema; /* a schema structure */
34303     int n_schema;
34304 
34305     for (n_output = 0;n_output < gen_nb_FILE_ptr;n_output++) {
34306     for (n_schema = 0;n_schema < gen_nb_xmlSchemaPtr;n_schema++) {
34307         mem_base = xmlMemBlocks();
34308         output = gen_FILE_ptr(n_output, 0);
34309         schema = gen_xmlSchemaPtr(n_schema, 1);
34310 
34311         xmlSchemaDump(output, schema);
34312         call_tests++;
34313         des_FILE_ptr(n_output, output, 0);
34314         des_xmlSchemaPtr(n_schema, schema, 1);
34315         xmlResetLastError();
34316         if (mem_base != xmlMemBlocks()) {
34317             printf("Leak of %d blocks found in xmlSchemaDump",
34318 	           xmlMemBlocks() - mem_base);
34319 	    test_ret++;
34320             printf(" %d", n_output);
34321             printf(" %d", n_schema);
34322             printf("\n");
34323         }
34324     }
34325     }
34326     function_tests++;
34327 #endif
34328 
34329     return(test_ret);
34330 }
34331 
34332 #ifdef LIBXML_SCHEMAS_ENABLED
34333 
34334 #define gen_nb_xmlSchemaParserCtxtPtr 1
gen_xmlSchemaParserCtxtPtr(int no ATTRIBUTE_UNUSED,int nr ATTRIBUTE_UNUSED)34335 static xmlSchemaParserCtxtPtr gen_xmlSchemaParserCtxtPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
34336     return(NULL);
34337 }
des_xmlSchemaParserCtxtPtr(int no ATTRIBUTE_UNUSED,xmlSchemaParserCtxtPtr val ATTRIBUTE_UNUSED,int nr ATTRIBUTE_UNUSED)34338 static void des_xmlSchemaParserCtxtPtr(int no ATTRIBUTE_UNUSED, xmlSchemaParserCtxtPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
34339 }
34340 #endif
34341 
34342 #ifdef LIBXML_SCHEMAS_ENABLED
34343 
34344 #define gen_nb_xmlSchemaValidityErrorFunc_ptr 1
gen_xmlSchemaValidityErrorFunc_ptr(int no ATTRIBUTE_UNUSED,int nr ATTRIBUTE_UNUSED)34345 static xmlSchemaValidityErrorFunc * gen_xmlSchemaValidityErrorFunc_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
34346     return(NULL);
34347 }
des_xmlSchemaValidityErrorFunc_ptr(int no ATTRIBUTE_UNUSED,xmlSchemaValidityErrorFunc * val ATTRIBUTE_UNUSED,int nr ATTRIBUTE_UNUSED)34348 static void des_xmlSchemaValidityErrorFunc_ptr(int no ATTRIBUTE_UNUSED, xmlSchemaValidityErrorFunc * val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
34349 }
34350 #endif
34351 
34352 #ifdef LIBXML_SCHEMAS_ENABLED
34353 
34354 #define gen_nb_xmlSchemaValidityWarningFunc_ptr 1
gen_xmlSchemaValidityWarningFunc_ptr(int no ATTRIBUTE_UNUSED,int nr ATTRIBUTE_UNUSED)34355 static xmlSchemaValidityWarningFunc * gen_xmlSchemaValidityWarningFunc_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
34356     return(NULL);
34357 }
des_xmlSchemaValidityWarningFunc_ptr(int no ATTRIBUTE_UNUSED,xmlSchemaValidityWarningFunc * val ATTRIBUTE_UNUSED,int nr ATTRIBUTE_UNUSED)34358 static void des_xmlSchemaValidityWarningFunc_ptr(int no ATTRIBUTE_UNUSED, xmlSchemaValidityWarningFunc * val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
34359 }
34360 #endif
34361 
34362 
34363 static int
test_xmlSchemaGetParserErrors(void)34364 test_xmlSchemaGetParserErrors(void) {
34365     int test_ret = 0;
34366 
34367 #if defined(LIBXML_SCHEMAS_ENABLED)
34368     int mem_base;
34369     int ret_val;
34370     xmlSchemaParserCtxtPtr ctxt; /* a XMl-Schema parser context */
34371     int n_ctxt;
34372     xmlSchemaValidityErrorFunc * err; /* the error callback result */
34373     int n_err;
34374     xmlSchemaValidityWarningFunc * warn; /* the warning callback result */
34375     int n_warn;
34376     void ** ctx; /* contextual data for the callbacks result */
34377     int n_ctx;
34378 
34379     for (n_ctxt = 0;n_ctxt < gen_nb_xmlSchemaParserCtxtPtr;n_ctxt++) {
34380     for (n_err = 0;n_err < gen_nb_xmlSchemaValidityErrorFunc_ptr;n_err++) {
34381     for (n_warn = 0;n_warn < gen_nb_xmlSchemaValidityWarningFunc_ptr;n_warn++) {
34382     for (n_ctx = 0;n_ctx < gen_nb_void_ptr_ptr;n_ctx++) {
34383         mem_base = xmlMemBlocks();
34384         ctxt = gen_xmlSchemaParserCtxtPtr(n_ctxt, 0);
34385         err = gen_xmlSchemaValidityErrorFunc_ptr(n_err, 1);
34386         warn = gen_xmlSchemaValidityWarningFunc_ptr(n_warn, 2);
34387         ctx = gen_void_ptr_ptr(n_ctx, 3);
34388 
34389         ret_val = xmlSchemaGetParserErrors(ctxt, err, warn, ctx);
34390         desret_int(ret_val);
34391         call_tests++;
34392         des_xmlSchemaParserCtxtPtr(n_ctxt, ctxt, 0);
34393         des_xmlSchemaValidityErrorFunc_ptr(n_err, err, 1);
34394         des_xmlSchemaValidityWarningFunc_ptr(n_warn, warn, 2);
34395         des_void_ptr_ptr(n_ctx, ctx, 3);
34396         xmlResetLastError();
34397         if (mem_base != xmlMemBlocks()) {
34398             printf("Leak of %d blocks found in xmlSchemaGetParserErrors",
34399 	           xmlMemBlocks() - mem_base);
34400 	    test_ret++;
34401             printf(" %d", n_ctxt);
34402             printf(" %d", n_err);
34403             printf(" %d", n_warn);
34404             printf(" %d", n_ctx);
34405             printf("\n");
34406         }
34407     }
34408     }
34409     }
34410     }
34411     function_tests++;
34412 #endif
34413 
34414     return(test_ret);
34415 }
34416 
34417 
34418 static int
test_xmlSchemaGetValidErrors(void)34419 test_xmlSchemaGetValidErrors(void) {
34420     int test_ret = 0;
34421 
34422 #if defined(LIBXML_SCHEMAS_ENABLED)
34423     int mem_base;
34424     int ret_val;
34425     xmlSchemaValidCtxtPtr ctxt; /* a XML-Schema validation context */
34426     int n_ctxt;
34427     xmlSchemaValidityErrorFunc * err; /* the error function result */
34428     int n_err;
34429     xmlSchemaValidityWarningFunc * warn; /* the warning function result */
34430     int n_warn;
34431     void ** ctx; /* the functions context result */
34432     int n_ctx;
34433 
34434     for (n_ctxt = 0;n_ctxt < gen_nb_xmlSchemaValidCtxtPtr;n_ctxt++) {
34435     for (n_err = 0;n_err < gen_nb_xmlSchemaValidityErrorFunc_ptr;n_err++) {
34436     for (n_warn = 0;n_warn < gen_nb_xmlSchemaValidityWarningFunc_ptr;n_warn++) {
34437     for (n_ctx = 0;n_ctx < gen_nb_void_ptr_ptr;n_ctx++) {
34438         mem_base = xmlMemBlocks();
34439         ctxt = gen_xmlSchemaValidCtxtPtr(n_ctxt, 0);
34440         err = gen_xmlSchemaValidityErrorFunc_ptr(n_err, 1);
34441         warn = gen_xmlSchemaValidityWarningFunc_ptr(n_warn, 2);
34442         ctx = gen_void_ptr_ptr(n_ctx, 3);
34443 
34444         ret_val = xmlSchemaGetValidErrors(ctxt, err, warn, ctx);
34445         desret_int(ret_val);
34446         call_tests++;
34447         des_xmlSchemaValidCtxtPtr(n_ctxt, ctxt, 0);
34448         des_xmlSchemaValidityErrorFunc_ptr(n_err, err, 1);
34449         des_xmlSchemaValidityWarningFunc_ptr(n_warn, warn, 2);
34450         des_void_ptr_ptr(n_ctx, ctx, 3);
34451         xmlResetLastError();
34452         if (mem_base != xmlMemBlocks()) {
34453             printf("Leak of %d blocks found in xmlSchemaGetValidErrors",
34454 	           xmlMemBlocks() - mem_base);
34455 	    test_ret++;
34456             printf(" %d", n_ctxt);
34457             printf(" %d", n_err);
34458             printf(" %d", n_warn);
34459             printf(" %d", n_ctx);
34460             printf("\n");
34461         }
34462     }
34463     }
34464     }
34465     }
34466     function_tests++;
34467 #endif
34468 
34469     return(test_ret);
34470 }
34471 
34472 
34473 static int
test_xmlSchemaIsValid(void)34474 test_xmlSchemaIsValid(void) {
34475     int test_ret = 0;
34476 
34477 #if defined(LIBXML_SCHEMAS_ENABLED)
34478     int mem_base;
34479     int ret_val;
34480     xmlSchemaValidCtxtPtr ctxt; /* the schema validation context */
34481     int n_ctxt;
34482 
34483     for (n_ctxt = 0;n_ctxt < gen_nb_xmlSchemaValidCtxtPtr;n_ctxt++) {
34484         mem_base = xmlMemBlocks();
34485         ctxt = gen_xmlSchemaValidCtxtPtr(n_ctxt, 0);
34486 
34487         ret_val = xmlSchemaIsValid(ctxt);
34488         desret_int(ret_val);
34489         call_tests++;
34490         des_xmlSchemaValidCtxtPtr(n_ctxt, ctxt, 0);
34491         xmlResetLastError();
34492         if (mem_base != xmlMemBlocks()) {
34493             printf("Leak of %d blocks found in xmlSchemaIsValid",
34494 	           xmlMemBlocks() - mem_base);
34495 	    test_ret++;
34496             printf(" %d", n_ctxt);
34497             printf("\n");
34498         }
34499     }
34500     function_tests++;
34501 #endif
34502 
34503     return(test_ret);
34504 }
34505 
34506 
34507 static int
test_xmlSchemaNewDocParserCtxt(void)34508 test_xmlSchemaNewDocParserCtxt(void) {
34509     int test_ret = 0;
34510 
34511 #if defined(LIBXML_SCHEMAS_ENABLED)
34512     int mem_base;
34513     xmlSchemaParserCtxtPtr ret_val;
34514     xmlDocPtr doc; /* a preparsed document tree */
34515     int n_doc;
34516 
34517     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
34518         mem_base = xmlMemBlocks();
34519         doc = gen_xmlDocPtr(n_doc, 0);
34520 
34521         ret_val = xmlSchemaNewDocParserCtxt(doc);
34522         desret_xmlSchemaParserCtxtPtr(ret_val);
34523         call_tests++;
34524         des_xmlDocPtr(n_doc, doc, 0);
34525         xmlResetLastError();
34526         if (mem_base != xmlMemBlocks()) {
34527             printf("Leak of %d blocks found in xmlSchemaNewDocParserCtxt",
34528 	           xmlMemBlocks() - mem_base);
34529 	    test_ret++;
34530             printf(" %d", n_doc);
34531             printf("\n");
34532         }
34533     }
34534     function_tests++;
34535 #endif
34536 
34537     return(test_ret);
34538 }
34539 
34540 
34541 static int
test_xmlSchemaNewMemParserCtxt(void)34542 test_xmlSchemaNewMemParserCtxt(void) {
34543     int test_ret = 0;
34544 
34545 #if defined(LIBXML_SCHEMAS_ENABLED)
34546     int mem_base;
34547     xmlSchemaParserCtxtPtr ret_val;
34548     char * buffer; /* a pointer to a char array containing the schemas */
34549     int n_buffer;
34550     int size; /* the size of the array */
34551     int n_size;
34552 
34553     for (n_buffer = 0;n_buffer < gen_nb_const_char_ptr;n_buffer++) {
34554     for (n_size = 0;n_size < gen_nb_int;n_size++) {
34555         mem_base = xmlMemBlocks();
34556         buffer = gen_const_char_ptr(n_buffer, 0);
34557         size = gen_int(n_size, 1);
34558         if ((buffer != NULL) &&
34559             (size > (int) strlen((const char *) buffer) + 1))
34560             continue;
34561 
34562         ret_val = xmlSchemaNewMemParserCtxt((const char *)buffer, size);
34563         desret_xmlSchemaParserCtxtPtr(ret_val);
34564         call_tests++;
34565         des_const_char_ptr(n_buffer, (const char *)buffer, 0);
34566         des_int(n_size, size, 1);
34567         xmlResetLastError();
34568         if (mem_base != xmlMemBlocks()) {
34569             printf("Leak of %d blocks found in xmlSchemaNewMemParserCtxt",
34570 	           xmlMemBlocks() - mem_base);
34571 	    test_ret++;
34572             printf(" %d", n_buffer);
34573             printf(" %d", n_size);
34574             printf("\n");
34575         }
34576     }
34577     }
34578     function_tests++;
34579 #endif
34580 
34581     return(test_ret);
34582 }
34583 
34584 
34585 static int
test_xmlSchemaNewParserCtxt(void)34586 test_xmlSchemaNewParserCtxt(void) {
34587     int test_ret = 0;
34588 
34589 #if defined(LIBXML_SCHEMAS_ENABLED)
34590     int mem_base;
34591     xmlSchemaParserCtxtPtr ret_val;
34592     char * URL; /* the location of the schema */
34593     int n_URL;
34594 
34595     for (n_URL = 0;n_URL < gen_nb_const_char_ptr;n_URL++) {
34596         mem_base = xmlMemBlocks();
34597         URL = gen_const_char_ptr(n_URL, 0);
34598 
34599         ret_val = xmlSchemaNewParserCtxt((const char *)URL);
34600         desret_xmlSchemaParserCtxtPtr(ret_val);
34601         call_tests++;
34602         des_const_char_ptr(n_URL, (const char *)URL, 0);
34603         xmlResetLastError();
34604         if (mem_base != xmlMemBlocks()) {
34605             printf("Leak of %d blocks found in xmlSchemaNewParserCtxt",
34606 	           xmlMemBlocks() - mem_base);
34607 	    test_ret++;
34608             printf(" %d", n_URL);
34609             printf("\n");
34610         }
34611     }
34612     function_tests++;
34613 #endif
34614 
34615     return(test_ret);
34616 }
34617 
34618 
34619 static int
test_xmlSchemaNewValidCtxt(void)34620 test_xmlSchemaNewValidCtxt(void) {
34621     int test_ret = 0;
34622 
34623 
34624     /* missing type support */
34625     return(test_ret);
34626 }
34627 
34628 
34629 static int
test_xmlSchemaParse(void)34630 test_xmlSchemaParse(void) {
34631     int test_ret = 0;
34632 
34633 
34634     /* missing type support */
34635     return(test_ret);
34636 }
34637 
34638 
34639 static int
test_xmlSchemaSAXPlug(void)34640 test_xmlSchemaSAXPlug(void) {
34641     int test_ret = 0;
34642 
34643 
34644     /* missing type support */
34645     return(test_ret);
34646 }
34647 
34648 #ifdef LIBXML_SCHEMAS_ENABLED
34649 
34650 #define gen_nb_xmlSchemaSAXPlugPtr 1
gen_xmlSchemaSAXPlugPtr(int no ATTRIBUTE_UNUSED,int nr ATTRIBUTE_UNUSED)34651 static xmlSchemaSAXPlugPtr gen_xmlSchemaSAXPlugPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
34652     return(NULL);
34653 }
des_xmlSchemaSAXPlugPtr(int no ATTRIBUTE_UNUSED,xmlSchemaSAXPlugPtr val ATTRIBUTE_UNUSED,int nr ATTRIBUTE_UNUSED)34654 static void des_xmlSchemaSAXPlugPtr(int no ATTRIBUTE_UNUSED, xmlSchemaSAXPlugPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
34655 }
34656 #endif
34657 
34658 
34659 static int
test_xmlSchemaSAXUnplug(void)34660 test_xmlSchemaSAXUnplug(void) {
34661     int test_ret = 0;
34662 
34663 #if defined(LIBXML_SCHEMAS_ENABLED)
34664     int mem_base;
34665     int ret_val;
34666     xmlSchemaSAXPlugPtr plug; /* a data structure returned by xmlSchemaSAXPlug */
34667     int n_plug;
34668 
34669     for (n_plug = 0;n_plug < gen_nb_xmlSchemaSAXPlugPtr;n_plug++) {
34670         mem_base = xmlMemBlocks();
34671         plug = gen_xmlSchemaSAXPlugPtr(n_plug, 0);
34672 
34673         ret_val = xmlSchemaSAXUnplug(plug);
34674         desret_int(ret_val);
34675         call_tests++;
34676         des_xmlSchemaSAXPlugPtr(n_plug, plug, 0);
34677         xmlResetLastError();
34678         if (mem_base != xmlMemBlocks()) {
34679             printf("Leak of %d blocks found in xmlSchemaSAXUnplug",
34680 	           xmlMemBlocks() - mem_base);
34681 	    test_ret++;
34682             printf(" %d", n_plug);
34683             printf("\n");
34684         }
34685     }
34686     function_tests++;
34687 #endif
34688 
34689     return(test_ret);
34690 }
34691 
34692 
34693 static int
test_xmlSchemaSetParserErrors(void)34694 test_xmlSchemaSetParserErrors(void) {
34695     int test_ret = 0;
34696 
34697 
34698     /* missing type support */
34699     return(test_ret);
34700 }
34701 
34702 
34703 static int
test_xmlSchemaSetParserStructuredErrors(void)34704 test_xmlSchemaSetParserStructuredErrors(void) {
34705     int test_ret = 0;
34706 
34707 
34708     /* missing type support */
34709     return(test_ret);
34710 }
34711 
34712 
34713 static int
test_xmlSchemaSetValidErrors(void)34714 test_xmlSchemaSetValidErrors(void) {
34715     int test_ret = 0;
34716 
34717 
34718     /* missing type support */
34719     return(test_ret);
34720 }
34721 
34722 
34723 static int
test_xmlSchemaSetValidOptions(void)34724 test_xmlSchemaSetValidOptions(void) {
34725     int test_ret = 0;
34726 
34727 #if defined(LIBXML_SCHEMAS_ENABLED)
34728     int mem_base;
34729     int ret_val;
34730     xmlSchemaValidCtxtPtr ctxt; /* a schema validation context */
34731     int n_ctxt;
34732     int options; /* a combination of xmlSchemaValidOption */
34733     int n_options;
34734 
34735     for (n_ctxt = 0;n_ctxt < gen_nb_xmlSchemaValidCtxtPtr;n_ctxt++) {
34736     for (n_options = 0;n_options < gen_nb_int;n_options++) {
34737         mem_base = xmlMemBlocks();
34738         ctxt = gen_xmlSchemaValidCtxtPtr(n_ctxt, 0);
34739         options = gen_int(n_options, 1);
34740 
34741         ret_val = xmlSchemaSetValidOptions(ctxt, options);
34742         desret_int(ret_val);
34743         call_tests++;
34744         des_xmlSchemaValidCtxtPtr(n_ctxt, ctxt, 0);
34745         des_int(n_options, options, 1);
34746         xmlResetLastError();
34747         if (mem_base != xmlMemBlocks()) {
34748             printf("Leak of %d blocks found in xmlSchemaSetValidOptions",
34749 	           xmlMemBlocks() - mem_base);
34750 	    test_ret++;
34751             printf(" %d", n_ctxt);
34752             printf(" %d", n_options);
34753             printf("\n");
34754         }
34755     }
34756     }
34757     function_tests++;
34758 #endif
34759 
34760     return(test_ret);
34761 }
34762 
34763 
34764 static int
test_xmlSchemaSetValidStructuredErrors(void)34765 test_xmlSchemaSetValidStructuredErrors(void) {
34766     int test_ret = 0;
34767 
34768 
34769     /* missing type support */
34770     return(test_ret);
34771 }
34772 
34773 
34774 static int
test_xmlSchemaValidCtxtGetOptions(void)34775 test_xmlSchemaValidCtxtGetOptions(void) {
34776     int test_ret = 0;
34777 
34778 #if defined(LIBXML_SCHEMAS_ENABLED)
34779     int mem_base;
34780     int ret_val;
34781     xmlSchemaValidCtxtPtr ctxt; /* a schema validation context */
34782     int n_ctxt;
34783 
34784     for (n_ctxt = 0;n_ctxt < gen_nb_xmlSchemaValidCtxtPtr;n_ctxt++) {
34785         mem_base = xmlMemBlocks();
34786         ctxt = gen_xmlSchemaValidCtxtPtr(n_ctxt, 0);
34787 
34788         ret_val = xmlSchemaValidCtxtGetOptions(ctxt);
34789         desret_int(ret_val);
34790         call_tests++;
34791         des_xmlSchemaValidCtxtPtr(n_ctxt, ctxt, 0);
34792         xmlResetLastError();
34793         if (mem_base != xmlMemBlocks()) {
34794             printf("Leak of %d blocks found in xmlSchemaValidCtxtGetOptions",
34795 	           xmlMemBlocks() - mem_base);
34796 	    test_ret++;
34797             printf(" %d", n_ctxt);
34798             printf("\n");
34799         }
34800     }
34801     function_tests++;
34802 #endif
34803 
34804     return(test_ret);
34805 }
34806 
34807 
34808 static int
test_xmlSchemaValidCtxtGetParserCtxt(void)34809 test_xmlSchemaValidCtxtGetParserCtxt(void) {
34810     int test_ret = 0;
34811 
34812 #if defined(LIBXML_SCHEMAS_ENABLED)
34813     int mem_base;
34814     xmlParserCtxtPtr ret_val;
34815     xmlSchemaValidCtxtPtr ctxt; /* a schema validation context */
34816     int n_ctxt;
34817 
34818     for (n_ctxt = 0;n_ctxt < gen_nb_xmlSchemaValidCtxtPtr;n_ctxt++) {
34819         mem_base = xmlMemBlocks();
34820         ctxt = gen_xmlSchemaValidCtxtPtr(n_ctxt, 0);
34821 
34822         ret_val = xmlSchemaValidCtxtGetParserCtxt(ctxt);
34823         desret_xmlParserCtxtPtr(ret_val);
34824         call_tests++;
34825         des_xmlSchemaValidCtxtPtr(n_ctxt, ctxt, 0);
34826         xmlResetLastError();
34827         if (mem_base != xmlMemBlocks()) {
34828             printf("Leak of %d blocks found in xmlSchemaValidCtxtGetParserCtxt",
34829 	           xmlMemBlocks() - mem_base);
34830 	    test_ret++;
34831             printf(" %d", n_ctxt);
34832             printf("\n");
34833         }
34834     }
34835     function_tests++;
34836 #endif
34837 
34838     return(test_ret);
34839 }
34840 
34841 
34842 static int
test_xmlSchemaValidateDoc(void)34843 test_xmlSchemaValidateDoc(void) {
34844     int test_ret = 0;
34845 
34846 #if defined(LIBXML_SCHEMAS_ENABLED)
34847     int mem_base;
34848     int ret_val;
34849     xmlSchemaValidCtxtPtr ctxt; /* a schema validation context */
34850     int n_ctxt;
34851     xmlDocPtr doc; /* a parsed document tree */
34852     int n_doc;
34853 
34854     for (n_ctxt = 0;n_ctxt < gen_nb_xmlSchemaValidCtxtPtr;n_ctxt++) {
34855     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
34856         mem_base = xmlMemBlocks();
34857         ctxt = gen_xmlSchemaValidCtxtPtr(n_ctxt, 0);
34858         doc = gen_xmlDocPtr(n_doc, 1);
34859 
34860         ret_val = xmlSchemaValidateDoc(ctxt, doc);
34861         desret_int(ret_val);
34862         call_tests++;
34863         des_xmlSchemaValidCtxtPtr(n_ctxt, ctxt, 0);
34864         des_xmlDocPtr(n_doc, doc, 1);
34865         xmlResetLastError();
34866         if (mem_base != xmlMemBlocks()) {
34867             printf("Leak of %d blocks found in xmlSchemaValidateDoc",
34868 	           xmlMemBlocks() - mem_base);
34869 	    test_ret++;
34870             printf(" %d", n_ctxt);
34871             printf(" %d", n_doc);
34872             printf("\n");
34873         }
34874     }
34875     }
34876     function_tests++;
34877 #endif
34878 
34879     return(test_ret);
34880 }
34881 
34882 
34883 static int
test_xmlSchemaValidateFile(void)34884 test_xmlSchemaValidateFile(void) {
34885     int test_ret = 0;
34886 
34887 #if defined(LIBXML_SCHEMAS_ENABLED)
34888     int mem_base;
34889     int ret_val;
34890     xmlSchemaValidCtxtPtr ctxt; /* a schema validation context */
34891     int n_ctxt;
34892     const char * filename; /* the URI of the instance */
34893     int n_filename;
34894     int options; /* a future set of options, currently unused */
34895     int n_options;
34896 
34897     for (n_ctxt = 0;n_ctxt < gen_nb_xmlSchemaValidCtxtPtr;n_ctxt++) {
34898     for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
34899     for (n_options = 0;n_options < gen_nb_int;n_options++) {
34900         mem_base = xmlMemBlocks();
34901         ctxt = gen_xmlSchemaValidCtxtPtr(n_ctxt, 0);
34902         filename = gen_filepath(n_filename, 1);
34903         options = gen_int(n_options, 2);
34904 
34905         ret_val = xmlSchemaValidateFile(ctxt, filename, options);
34906         desret_int(ret_val);
34907         call_tests++;
34908         des_xmlSchemaValidCtxtPtr(n_ctxt, ctxt, 0);
34909         des_filepath(n_filename, filename, 1);
34910         des_int(n_options, options, 2);
34911         xmlResetLastError();
34912         if (mem_base != xmlMemBlocks()) {
34913             printf("Leak of %d blocks found in xmlSchemaValidateFile",
34914 	           xmlMemBlocks() - mem_base);
34915 	    test_ret++;
34916             printf(" %d", n_ctxt);
34917             printf(" %d", n_filename);
34918             printf(" %d", n_options);
34919             printf("\n");
34920         }
34921     }
34922     }
34923     }
34924     function_tests++;
34925 #endif
34926 
34927     return(test_ret);
34928 }
34929 
34930 
34931 static int
test_xmlSchemaValidateOneElement(void)34932 test_xmlSchemaValidateOneElement(void) {
34933     int test_ret = 0;
34934 
34935 #if defined(LIBXML_SCHEMAS_ENABLED)
34936     int mem_base;
34937     int ret_val;
34938     xmlSchemaValidCtxtPtr ctxt; /* a schema validation context */
34939     int n_ctxt;
34940     xmlNodePtr elem; /* an element node */
34941     int n_elem;
34942 
34943     for (n_ctxt = 0;n_ctxt < gen_nb_xmlSchemaValidCtxtPtr;n_ctxt++) {
34944     for (n_elem = 0;n_elem < gen_nb_xmlNodePtr;n_elem++) {
34945         mem_base = xmlMemBlocks();
34946         ctxt = gen_xmlSchemaValidCtxtPtr(n_ctxt, 0);
34947         elem = gen_xmlNodePtr(n_elem, 1);
34948 
34949         ret_val = xmlSchemaValidateOneElement(ctxt, elem);
34950         desret_int(ret_val);
34951         call_tests++;
34952         des_xmlSchemaValidCtxtPtr(n_ctxt, ctxt, 0);
34953         des_xmlNodePtr(n_elem, elem, 1);
34954         xmlResetLastError();
34955         if (mem_base != xmlMemBlocks()) {
34956             printf("Leak of %d blocks found in xmlSchemaValidateOneElement",
34957 	           xmlMemBlocks() - mem_base);
34958 	    test_ret++;
34959             printf(" %d", n_ctxt);
34960             printf(" %d", n_elem);
34961             printf("\n");
34962         }
34963     }
34964     }
34965     function_tests++;
34966 #endif
34967 
34968     return(test_ret);
34969 }
34970 
34971 
34972 static int
test_xmlSchemaValidateSetFilename(void)34973 test_xmlSchemaValidateSetFilename(void) {
34974     int test_ret = 0;
34975 
34976 #if defined(LIBXML_SCHEMAS_ENABLED)
34977     int mem_base;
34978     xmlSchemaValidCtxtPtr vctxt; /* the schema validation context */
34979     int n_vctxt;
34980     const char * filename; /* the file name */
34981     int n_filename;
34982 
34983     for (n_vctxt = 0;n_vctxt < gen_nb_xmlSchemaValidCtxtPtr;n_vctxt++) {
34984     for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
34985         mem_base = xmlMemBlocks();
34986         vctxt = gen_xmlSchemaValidCtxtPtr(n_vctxt, 0);
34987         filename = gen_filepath(n_filename, 1);
34988 
34989         xmlSchemaValidateSetFilename(vctxt, filename);
34990         call_tests++;
34991         des_xmlSchemaValidCtxtPtr(n_vctxt, vctxt, 0);
34992         des_filepath(n_filename, filename, 1);
34993         xmlResetLastError();
34994         if (mem_base != xmlMemBlocks()) {
34995             printf("Leak of %d blocks found in xmlSchemaValidateSetFilename",
34996 	           xmlMemBlocks() - mem_base);
34997 	    test_ret++;
34998             printf(" %d", n_vctxt);
34999             printf(" %d", n_filename);
35000             printf("\n");
35001         }
35002     }
35003     }
35004     function_tests++;
35005 #endif
35006 
35007     return(test_ret);
35008 }
35009 
35010 
35011 static int
test_xmlSchemaValidateSetLocator(void)35012 test_xmlSchemaValidateSetLocator(void) {
35013     int test_ret = 0;
35014 
35015 
35016     /* missing type support */
35017     return(test_ret);
35018 }
35019 
35020 
35021 static int
test_xmlSchemaValidateStream(void)35022 test_xmlSchemaValidateStream(void) {
35023     int test_ret = 0;
35024 
35025 #if defined(LIBXML_SCHEMAS_ENABLED)
35026     int mem_base;
35027     int ret_val;
35028     xmlSchemaValidCtxtPtr ctxt; /* a schema validation context */
35029     int n_ctxt;
35030     xmlParserInputBufferPtr input; /* the input to use for reading the data */
35031     int n_input;
35032     xmlCharEncoding enc; /* an optional encoding information */
35033     int n_enc;
35034     xmlSAXHandlerPtr sax; /* a SAX handler for the resulting events */
35035     int n_sax;
35036     void * user_data; /* the context to provide to the SAX handler. */
35037     int n_user_data;
35038 
35039     for (n_ctxt = 0;n_ctxt < gen_nb_xmlSchemaValidCtxtPtr;n_ctxt++) {
35040     for (n_input = 0;n_input < gen_nb_xmlParserInputBufferPtr;n_input++) {
35041     for (n_enc = 0;n_enc < gen_nb_xmlCharEncoding;n_enc++) {
35042     for (n_sax = 0;n_sax < gen_nb_xmlSAXHandlerPtr;n_sax++) {
35043     for (n_user_data = 0;n_user_data < gen_nb_userdata;n_user_data++) {
35044         mem_base = xmlMemBlocks();
35045         ctxt = gen_xmlSchemaValidCtxtPtr(n_ctxt, 0);
35046         input = gen_xmlParserInputBufferPtr(n_input, 1);
35047         enc = gen_xmlCharEncoding(n_enc, 2);
35048         sax = gen_xmlSAXHandlerPtr(n_sax, 3);
35049         user_data = gen_userdata(n_user_data, 4);
35050 
35051         ret_val = xmlSchemaValidateStream(ctxt, input, enc, sax, user_data);
35052         desret_int(ret_val);
35053         call_tests++;
35054         des_xmlSchemaValidCtxtPtr(n_ctxt, ctxt, 0);
35055         des_xmlParserInputBufferPtr(n_input, input, 1);
35056         des_xmlCharEncoding(n_enc, enc, 2);
35057         des_xmlSAXHandlerPtr(n_sax, sax, 3);
35058         des_userdata(n_user_data, user_data, 4);
35059         xmlResetLastError();
35060         if (mem_base != xmlMemBlocks()) {
35061             printf("Leak of %d blocks found in xmlSchemaValidateStream",
35062 	           xmlMemBlocks() - mem_base);
35063 	    test_ret++;
35064             printf(" %d", n_ctxt);
35065             printf(" %d", n_input);
35066             printf(" %d", n_enc);
35067             printf(" %d", n_sax);
35068             printf(" %d", n_user_data);
35069             printf("\n");
35070         }
35071     }
35072     }
35073     }
35074     }
35075     }
35076     function_tests++;
35077 #endif
35078 
35079     return(test_ret);
35080 }
35081 
35082 static int
test_xmlschemas(void)35083 test_xmlschemas(void) {
35084     int test_ret = 0;
35085 
35086     if (quiet == 0) printf("Testing xmlschemas : 16 of 27 functions ...\n");
35087     test_ret += test_xmlSchemaDump();
35088     test_ret += test_xmlSchemaGetParserErrors();
35089     test_ret += test_xmlSchemaGetValidErrors();
35090     test_ret += test_xmlSchemaIsValid();
35091     test_ret += test_xmlSchemaNewDocParserCtxt();
35092     test_ret += test_xmlSchemaNewMemParserCtxt();
35093     test_ret += test_xmlSchemaNewParserCtxt();
35094     test_ret += test_xmlSchemaNewValidCtxt();
35095     test_ret += test_xmlSchemaParse();
35096     test_ret += test_xmlSchemaSAXPlug();
35097     test_ret += test_xmlSchemaSAXUnplug();
35098     test_ret += test_xmlSchemaSetParserErrors();
35099     test_ret += test_xmlSchemaSetParserStructuredErrors();
35100     test_ret += test_xmlSchemaSetValidErrors();
35101     test_ret += test_xmlSchemaSetValidOptions();
35102     test_ret += test_xmlSchemaSetValidStructuredErrors();
35103     test_ret += test_xmlSchemaValidCtxtGetOptions();
35104     test_ret += test_xmlSchemaValidCtxtGetParserCtxt();
35105     test_ret += test_xmlSchemaValidateDoc();
35106     test_ret += test_xmlSchemaValidateFile();
35107     test_ret += test_xmlSchemaValidateOneElement();
35108     test_ret += test_xmlSchemaValidateSetFilename();
35109     test_ret += test_xmlSchemaValidateSetLocator();
35110     test_ret += test_xmlSchemaValidateStream();
35111 
35112     if (test_ret != 0)
35113 	printf("Module xmlschemas: %d errors\n", test_ret);
35114     return(test_ret);
35115 }
35116 #ifdef LIBXML_SCHEMAS_ENABLED
35117 
35118 #define gen_nb_xmlSchemaFacetPtr 1
gen_xmlSchemaFacetPtr(int no ATTRIBUTE_UNUSED,int nr ATTRIBUTE_UNUSED)35119 static xmlSchemaFacetPtr gen_xmlSchemaFacetPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
35120     return(NULL);
35121 }
des_xmlSchemaFacetPtr(int no ATTRIBUTE_UNUSED,xmlSchemaFacetPtr val ATTRIBUTE_UNUSED,int nr ATTRIBUTE_UNUSED)35122 static void des_xmlSchemaFacetPtr(int no ATTRIBUTE_UNUSED, xmlSchemaFacetPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
35123 }
35124 #endif
35125 
35126 #ifdef LIBXML_SCHEMAS_ENABLED
35127 
35128 #define gen_nb_xmlSchemaTypePtr 1
gen_xmlSchemaTypePtr(int no ATTRIBUTE_UNUSED,int nr ATTRIBUTE_UNUSED)35129 static xmlSchemaTypePtr gen_xmlSchemaTypePtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
35130     return(NULL);
35131 }
des_xmlSchemaTypePtr(int no ATTRIBUTE_UNUSED,xmlSchemaTypePtr val ATTRIBUTE_UNUSED,int nr ATTRIBUTE_UNUSED)35132 static void des_xmlSchemaTypePtr(int no ATTRIBUTE_UNUSED, xmlSchemaTypePtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
35133 }
35134 #endif
35135 
35136 
35137 static int
test_xmlSchemaCheckFacet(void)35138 test_xmlSchemaCheckFacet(void) {
35139     int test_ret = 0;
35140 
35141 #if defined(LIBXML_SCHEMAS_ENABLED)
35142     int mem_base;
35143     int ret_val;
35144     xmlSchemaFacetPtr facet; /* the facet */
35145     int n_facet;
35146     xmlSchemaTypePtr typeDecl; /* the schema type definition */
35147     int n_typeDecl;
35148     xmlSchemaParserCtxtPtr pctxt; /* the schema parser context or NULL */
35149     int n_pctxt;
35150     xmlChar * name; /* the optional name of the type */
35151     int n_name;
35152 
35153     for (n_facet = 0;n_facet < gen_nb_xmlSchemaFacetPtr;n_facet++) {
35154     for (n_typeDecl = 0;n_typeDecl < gen_nb_xmlSchemaTypePtr;n_typeDecl++) {
35155     for (n_pctxt = 0;n_pctxt < gen_nb_xmlSchemaParserCtxtPtr;n_pctxt++) {
35156     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
35157         mem_base = xmlMemBlocks();
35158         facet = gen_xmlSchemaFacetPtr(n_facet, 0);
35159         typeDecl = gen_xmlSchemaTypePtr(n_typeDecl, 1);
35160         pctxt = gen_xmlSchemaParserCtxtPtr(n_pctxt, 2);
35161         name = gen_const_xmlChar_ptr(n_name, 3);
35162 
35163         ret_val = xmlSchemaCheckFacet(facet, typeDecl, pctxt, (const xmlChar *)name);
35164         desret_int(ret_val);
35165         call_tests++;
35166         des_xmlSchemaFacetPtr(n_facet, facet, 0);
35167         des_xmlSchemaTypePtr(n_typeDecl, typeDecl, 1);
35168         des_xmlSchemaParserCtxtPtr(n_pctxt, pctxt, 2);
35169         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 3);
35170         xmlResetLastError();
35171         if (mem_base != xmlMemBlocks()) {
35172             printf("Leak of %d blocks found in xmlSchemaCheckFacet",
35173 	           xmlMemBlocks() - mem_base);
35174 	    test_ret++;
35175             printf(" %d", n_facet);
35176             printf(" %d", n_typeDecl);
35177             printf(" %d", n_pctxt);
35178             printf(" %d", n_name);
35179             printf("\n");
35180         }
35181     }
35182     }
35183     }
35184     }
35185     function_tests++;
35186 #endif
35187 
35188     return(test_ret);
35189 }
35190 
35191 
35192 static int
test_xmlSchemaCleanupTypes(void)35193 test_xmlSchemaCleanupTypes(void) {
35194     int test_ret = 0;
35195 
35196 #if defined(LIBXML_SCHEMAS_ENABLED)
35197 
35198 
35199         xmlSchemaCleanupTypes();
35200         call_tests++;
35201         xmlResetLastError();
35202     function_tests++;
35203 #endif
35204 
35205     return(test_ret);
35206 }
35207 
35208 
35209 static int
test_xmlSchemaCollapseString(void)35210 test_xmlSchemaCollapseString(void) {
35211     int test_ret = 0;
35212 
35213 #if defined(LIBXML_SCHEMAS_ENABLED)
35214     int mem_base;
35215     xmlChar * ret_val;
35216     xmlChar * value; /* a value */
35217     int n_value;
35218 
35219     for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
35220         mem_base = xmlMemBlocks();
35221         value = gen_const_xmlChar_ptr(n_value, 0);
35222 
35223         ret_val = xmlSchemaCollapseString((const xmlChar *)value);
35224         desret_xmlChar_ptr(ret_val);
35225         call_tests++;
35226         des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 0);
35227         xmlResetLastError();
35228         if (mem_base != xmlMemBlocks()) {
35229             printf("Leak of %d blocks found in xmlSchemaCollapseString",
35230 	           xmlMemBlocks() - mem_base);
35231 	    test_ret++;
35232             printf(" %d", n_value);
35233             printf("\n");
35234         }
35235     }
35236     function_tests++;
35237 #endif
35238 
35239     return(test_ret);
35240 }
35241 
35242 #ifdef LIBXML_SCHEMAS_ENABLED
35243 
35244 #define gen_nb_xmlSchemaValPtr 1
gen_xmlSchemaValPtr(int no ATTRIBUTE_UNUSED,int nr ATTRIBUTE_UNUSED)35245 static xmlSchemaValPtr gen_xmlSchemaValPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
35246     return(NULL);
35247 }
des_xmlSchemaValPtr(int no ATTRIBUTE_UNUSED,xmlSchemaValPtr val ATTRIBUTE_UNUSED,int nr ATTRIBUTE_UNUSED)35248 static void des_xmlSchemaValPtr(int no ATTRIBUTE_UNUSED, xmlSchemaValPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
35249 }
35250 #endif
35251 
35252 
35253 static int
test_xmlSchemaCompareValues(void)35254 test_xmlSchemaCompareValues(void) {
35255     int test_ret = 0;
35256 
35257 #if defined(LIBXML_SCHEMAS_ENABLED)
35258     int mem_base;
35259     int ret_val;
35260     xmlSchemaValPtr x; /* a first value */
35261     int n_x;
35262     xmlSchemaValPtr y; /* a second value */
35263     int n_y;
35264 
35265     for (n_x = 0;n_x < gen_nb_xmlSchemaValPtr;n_x++) {
35266     for (n_y = 0;n_y < gen_nb_xmlSchemaValPtr;n_y++) {
35267         mem_base = xmlMemBlocks();
35268         x = gen_xmlSchemaValPtr(n_x, 0);
35269         y = gen_xmlSchemaValPtr(n_y, 1);
35270 
35271         ret_val = xmlSchemaCompareValues(x, y);
35272         desret_int(ret_val);
35273         call_tests++;
35274         des_xmlSchemaValPtr(n_x, x, 0);
35275         des_xmlSchemaValPtr(n_y, y, 1);
35276         xmlResetLastError();
35277         if (mem_base != xmlMemBlocks()) {
35278             printf("Leak of %d blocks found in xmlSchemaCompareValues",
35279 	           xmlMemBlocks() - mem_base);
35280 	    test_ret++;
35281             printf(" %d", n_x);
35282             printf(" %d", n_y);
35283             printf("\n");
35284         }
35285     }
35286     }
35287     function_tests++;
35288 #endif
35289 
35290     return(test_ret);
35291 }
35292 
35293 
35294 static int
test_xmlSchemaCompareValuesWhtsp(void)35295 test_xmlSchemaCompareValuesWhtsp(void) {
35296     int test_ret = 0;
35297 
35298 #if defined(LIBXML_SCHEMAS_ENABLED)
35299     int mem_base;
35300     int ret_val;
35301     xmlSchemaValPtr x; /* a first value */
35302     int n_x;
35303     xmlSchemaWhitespaceValueType xws; /* the whitespace value of x */
35304     int n_xws;
35305     xmlSchemaValPtr y; /* a second value */
35306     int n_y;
35307     xmlSchemaWhitespaceValueType yws; /* the whitespace value of y */
35308     int n_yws;
35309 
35310     for (n_x = 0;n_x < gen_nb_xmlSchemaValPtr;n_x++) {
35311     for (n_xws = 0;n_xws < gen_nb_xmlSchemaWhitespaceValueType;n_xws++) {
35312     for (n_y = 0;n_y < gen_nb_xmlSchemaValPtr;n_y++) {
35313     for (n_yws = 0;n_yws < gen_nb_xmlSchemaWhitespaceValueType;n_yws++) {
35314         mem_base = xmlMemBlocks();
35315         x = gen_xmlSchemaValPtr(n_x, 0);
35316         xws = gen_xmlSchemaWhitespaceValueType(n_xws, 1);
35317         y = gen_xmlSchemaValPtr(n_y, 2);
35318         yws = gen_xmlSchemaWhitespaceValueType(n_yws, 3);
35319 
35320         ret_val = xmlSchemaCompareValuesWhtsp(x, xws, y, yws);
35321         desret_int(ret_val);
35322         call_tests++;
35323         des_xmlSchemaValPtr(n_x, x, 0);
35324         des_xmlSchemaWhitespaceValueType(n_xws, xws, 1);
35325         des_xmlSchemaValPtr(n_y, y, 2);
35326         des_xmlSchemaWhitespaceValueType(n_yws, yws, 3);
35327         xmlResetLastError();
35328         if (mem_base != xmlMemBlocks()) {
35329             printf("Leak of %d blocks found in xmlSchemaCompareValuesWhtsp",
35330 	           xmlMemBlocks() - mem_base);
35331 	    test_ret++;
35332             printf(" %d", n_x);
35333             printf(" %d", n_xws);
35334             printf(" %d", n_y);
35335             printf(" %d", n_yws);
35336             printf("\n");
35337         }
35338     }
35339     }
35340     }
35341     }
35342     function_tests++;
35343 #endif
35344 
35345     return(test_ret);
35346 }
35347 
35348 
35349 static int
test_xmlSchemaCopyValue(void)35350 test_xmlSchemaCopyValue(void) {
35351     int test_ret = 0;
35352 
35353 
35354     /* missing type support */
35355     return(test_ret);
35356 }
35357 
35358 
35359 static int
test_xmlSchemaGetBuiltInListSimpleTypeItemType(void)35360 test_xmlSchemaGetBuiltInListSimpleTypeItemType(void) {
35361     int test_ret = 0;
35362 
35363 #if defined(LIBXML_SCHEMAS_ENABLED)
35364     int mem_base;
35365     xmlSchemaTypePtr ret_val;
35366     xmlSchemaTypePtr type; /* the built-in simple type. */
35367     int n_type;
35368 
35369     for (n_type = 0;n_type < gen_nb_xmlSchemaTypePtr;n_type++) {
35370         mem_base = xmlMemBlocks();
35371         type = gen_xmlSchemaTypePtr(n_type, 0);
35372 
35373         ret_val = xmlSchemaGetBuiltInListSimpleTypeItemType(type);
35374         desret_xmlSchemaTypePtr(ret_val);
35375         call_tests++;
35376         des_xmlSchemaTypePtr(n_type, type, 0);
35377         xmlResetLastError();
35378         if (mem_base != xmlMemBlocks()) {
35379             printf("Leak of %d blocks found in xmlSchemaGetBuiltInListSimpleTypeItemType",
35380 	           xmlMemBlocks() - mem_base);
35381 	    test_ret++;
35382             printf(" %d", n_type);
35383             printf("\n");
35384         }
35385     }
35386     function_tests++;
35387 #endif
35388 
35389     return(test_ret);
35390 }
35391 
35392 
35393 static int
test_xmlSchemaGetBuiltInType(void)35394 test_xmlSchemaGetBuiltInType(void) {
35395     int test_ret = 0;
35396 
35397 #if defined(LIBXML_SCHEMAS_ENABLED)
35398     xmlSchemaTypePtr ret_val;
35399     xmlSchemaValType type; /* the type of the built in type */
35400     int n_type;
35401 
35402     for (n_type = 0;n_type < gen_nb_xmlSchemaValType;n_type++) {
35403         type = gen_xmlSchemaValType(n_type, 0);
35404 
35405         ret_val = xmlSchemaGetBuiltInType(type);
35406         desret_xmlSchemaTypePtr(ret_val);
35407         call_tests++;
35408         des_xmlSchemaValType(n_type, type, 0);
35409         xmlResetLastError();
35410     }
35411     function_tests++;
35412 #endif
35413 
35414     return(test_ret);
35415 }
35416 
35417 
35418 static int
test_xmlSchemaGetCanonValue(void)35419 test_xmlSchemaGetCanonValue(void) {
35420     int test_ret = 0;
35421 
35422 #if defined(LIBXML_SCHEMAS_ENABLED)
35423     int mem_base;
35424     int ret_val;
35425     xmlSchemaValPtr val; /* the precomputed value */
35426     int n_val;
35427     xmlChar ** retValue; /* the returned value */
35428     int n_retValue;
35429 
35430     for (n_val = 0;n_val < gen_nb_xmlSchemaValPtr;n_val++) {
35431     for (n_retValue = 0;n_retValue < gen_nb_const_xmlChar_ptr_ptr;n_retValue++) {
35432         mem_base = xmlMemBlocks();
35433         val = gen_xmlSchemaValPtr(n_val, 0);
35434         retValue = gen_const_xmlChar_ptr_ptr(n_retValue, 1);
35435 
35436         ret_val = xmlSchemaGetCanonValue(val, (const xmlChar **)retValue);
35437         desret_int(ret_val);
35438         call_tests++;
35439         des_xmlSchemaValPtr(n_val, val, 0);
35440         des_const_xmlChar_ptr_ptr(n_retValue, (const xmlChar **)retValue, 1);
35441         xmlResetLastError();
35442         if (mem_base != xmlMemBlocks()) {
35443             printf("Leak of %d blocks found in xmlSchemaGetCanonValue",
35444 	           xmlMemBlocks() - mem_base);
35445 	    test_ret++;
35446             printf(" %d", n_val);
35447             printf(" %d", n_retValue);
35448             printf("\n");
35449         }
35450     }
35451     }
35452     function_tests++;
35453 #endif
35454 
35455     return(test_ret);
35456 }
35457 
35458 
35459 static int
test_xmlSchemaGetCanonValueWhtsp(void)35460 test_xmlSchemaGetCanonValueWhtsp(void) {
35461     int test_ret = 0;
35462 
35463 #if defined(LIBXML_SCHEMAS_ENABLED)
35464     int mem_base;
35465     int ret_val;
35466     xmlSchemaValPtr val; /* the precomputed value */
35467     int n_val;
35468     xmlChar ** retValue; /* the returned value */
35469     int n_retValue;
35470     xmlSchemaWhitespaceValueType ws; /* the whitespace type of the value */
35471     int n_ws;
35472 
35473     for (n_val = 0;n_val < gen_nb_xmlSchemaValPtr;n_val++) {
35474     for (n_retValue = 0;n_retValue < gen_nb_const_xmlChar_ptr_ptr;n_retValue++) {
35475     for (n_ws = 0;n_ws < gen_nb_xmlSchemaWhitespaceValueType;n_ws++) {
35476         mem_base = xmlMemBlocks();
35477         val = gen_xmlSchemaValPtr(n_val, 0);
35478         retValue = gen_const_xmlChar_ptr_ptr(n_retValue, 1);
35479         ws = gen_xmlSchemaWhitespaceValueType(n_ws, 2);
35480 
35481         ret_val = xmlSchemaGetCanonValueWhtsp(val, (const xmlChar **)retValue, ws);
35482         desret_int(ret_val);
35483         call_tests++;
35484         des_xmlSchemaValPtr(n_val, val, 0);
35485         des_const_xmlChar_ptr_ptr(n_retValue, (const xmlChar **)retValue, 1);
35486         des_xmlSchemaWhitespaceValueType(n_ws, ws, 2);
35487         xmlResetLastError();
35488         if (mem_base != xmlMemBlocks()) {
35489             printf("Leak of %d blocks found in xmlSchemaGetCanonValueWhtsp",
35490 	           xmlMemBlocks() - mem_base);
35491 	    test_ret++;
35492             printf(" %d", n_val);
35493             printf(" %d", n_retValue);
35494             printf(" %d", n_ws);
35495             printf("\n");
35496         }
35497     }
35498     }
35499     }
35500     function_tests++;
35501 #endif
35502 
35503     return(test_ret);
35504 }
35505 
35506 
35507 static int
test_xmlSchemaGetFacetValueAsULong(void)35508 test_xmlSchemaGetFacetValueAsULong(void) {
35509     int test_ret = 0;
35510 
35511 #if defined(LIBXML_SCHEMAS_ENABLED)
35512     int mem_base;
35513     unsigned long ret_val;
35514     xmlSchemaFacetPtr facet; /* an schemas type facet */
35515     int n_facet;
35516 
35517     for (n_facet = 0;n_facet < gen_nb_xmlSchemaFacetPtr;n_facet++) {
35518         mem_base = xmlMemBlocks();
35519         facet = gen_xmlSchemaFacetPtr(n_facet, 0);
35520 
35521         ret_val = xmlSchemaGetFacetValueAsULong(facet);
35522         desret_unsigned_long(ret_val);
35523         call_tests++;
35524         des_xmlSchemaFacetPtr(n_facet, facet, 0);
35525         xmlResetLastError();
35526         if (mem_base != xmlMemBlocks()) {
35527             printf("Leak of %d blocks found in xmlSchemaGetFacetValueAsULong",
35528 	           xmlMemBlocks() - mem_base);
35529 	    test_ret++;
35530             printf(" %d", n_facet);
35531             printf("\n");
35532         }
35533     }
35534     function_tests++;
35535 #endif
35536 
35537     return(test_ret);
35538 }
35539 
35540 
35541 static int
test_xmlSchemaGetPredefinedType(void)35542 test_xmlSchemaGetPredefinedType(void) {
35543     int test_ret = 0;
35544 
35545 #if defined(LIBXML_SCHEMAS_ENABLED)
35546     int mem_base;
35547     xmlSchemaTypePtr ret_val;
35548     xmlChar * name; /* the type name */
35549     int n_name;
35550     xmlChar * ns; /* the URI of the namespace usually "http://www.w3.org/2001/XMLSchema" */
35551     int n_ns;
35552 
35553     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
35554     for (n_ns = 0;n_ns < gen_nb_const_xmlChar_ptr;n_ns++) {
35555         mem_base = xmlMemBlocks();
35556         name = gen_const_xmlChar_ptr(n_name, 0);
35557         ns = gen_const_xmlChar_ptr(n_ns, 1);
35558 
35559         ret_val = xmlSchemaGetPredefinedType((const xmlChar *)name, (const xmlChar *)ns);
35560         desret_xmlSchemaTypePtr(ret_val);
35561         call_tests++;
35562         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 0);
35563         des_const_xmlChar_ptr(n_ns, (const xmlChar *)ns, 1);
35564         xmlResetLastError();
35565         if (mem_base != xmlMemBlocks()) {
35566             printf("Leak of %d blocks found in xmlSchemaGetPredefinedType",
35567 	           xmlMemBlocks() - mem_base);
35568 	    test_ret++;
35569             printf(" %d", n_name);
35570             printf(" %d", n_ns);
35571             printf("\n");
35572         }
35573     }
35574     }
35575     function_tests++;
35576 #endif
35577 
35578     return(test_ret);
35579 }
35580 
35581 
35582 static int
test_xmlSchemaGetValType(void)35583 test_xmlSchemaGetValType(void) {
35584     int test_ret = 0;
35585 
35586 #if defined(LIBXML_SCHEMAS_ENABLED)
35587     int mem_base;
35588     xmlSchemaValType ret_val;
35589     xmlSchemaValPtr val; /* a schemas value */
35590     int n_val;
35591 
35592     for (n_val = 0;n_val < gen_nb_xmlSchemaValPtr;n_val++) {
35593         mem_base = xmlMemBlocks();
35594         val = gen_xmlSchemaValPtr(n_val, 0);
35595 
35596         ret_val = xmlSchemaGetValType(val);
35597         desret_xmlSchemaValType(ret_val);
35598         call_tests++;
35599         des_xmlSchemaValPtr(n_val, val, 0);
35600         xmlResetLastError();
35601         if (mem_base != xmlMemBlocks()) {
35602             printf("Leak of %d blocks found in xmlSchemaGetValType",
35603 	           xmlMemBlocks() - mem_base);
35604 	    test_ret++;
35605             printf(" %d", n_val);
35606             printf("\n");
35607         }
35608     }
35609     function_tests++;
35610 #endif
35611 
35612     return(test_ret);
35613 }
35614 
35615 
35616 static int
test_xmlSchemaInitTypes(void)35617 test_xmlSchemaInitTypes(void) {
35618     int test_ret = 0;
35619 
35620 #if defined(LIBXML_SCHEMAS_ENABLED)
35621 
35622 
35623         xmlSchemaInitTypes();
35624         call_tests++;
35625         xmlResetLastError();
35626     function_tests++;
35627 #endif
35628 
35629     return(test_ret);
35630 }
35631 
35632 
35633 static int
test_xmlSchemaIsBuiltInTypeFacet(void)35634 test_xmlSchemaIsBuiltInTypeFacet(void) {
35635     int test_ret = 0;
35636 
35637 #if defined(LIBXML_SCHEMAS_ENABLED)
35638     int mem_base;
35639     int ret_val;
35640     xmlSchemaTypePtr type; /* the built-in type */
35641     int n_type;
35642     int facetType; /* the facet type */
35643     int n_facetType;
35644 
35645     for (n_type = 0;n_type < gen_nb_xmlSchemaTypePtr;n_type++) {
35646     for (n_facetType = 0;n_facetType < gen_nb_int;n_facetType++) {
35647         mem_base = xmlMemBlocks();
35648         type = gen_xmlSchemaTypePtr(n_type, 0);
35649         facetType = gen_int(n_facetType, 1);
35650 
35651         ret_val = xmlSchemaIsBuiltInTypeFacet(type, facetType);
35652         desret_int(ret_val);
35653         call_tests++;
35654         des_xmlSchemaTypePtr(n_type, type, 0);
35655         des_int(n_facetType, facetType, 1);
35656         xmlResetLastError();
35657         if (mem_base != xmlMemBlocks()) {
35658             printf("Leak of %d blocks found in xmlSchemaIsBuiltInTypeFacet",
35659 	           xmlMemBlocks() - mem_base);
35660 	    test_ret++;
35661             printf(" %d", n_type);
35662             printf(" %d", n_facetType);
35663             printf("\n");
35664         }
35665     }
35666     }
35667     function_tests++;
35668 #endif
35669 
35670     return(test_ret);
35671 }
35672 
35673 
35674 static int
test_xmlSchemaNewFacet(void)35675 test_xmlSchemaNewFacet(void) {
35676     int test_ret = 0;
35677 
35678 
35679     /* missing type support */
35680     return(test_ret);
35681 }
35682 
35683 
35684 static int
test_xmlSchemaNewNOTATIONValue(void)35685 test_xmlSchemaNewNOTATIONValue(void) {
35686     int test_ret = 0;
35687 
35688 
35689     /* missing type support */
35690     return(test_ret);
35691 }
35692 
35693 
35694 static int
test_xmlSchemaNewQNameValue(void)35695 test_xmlSchemaNewQNameValue(void) {
35696     int test_ret = 0;
35697 
35698 
35699     /* missing type support */
35700     return(test_ret);
35701 }
35702 
35703 
35704 static int
test_xmlSchemaNewStringValue(void)35705 test_xmlSchemaNewStringValue(void) {
35706     int test_ret = 0;
35707 
35708 
35709     /* missing type support */
35710     return(test_ret);
35711 }
35712 
35713 #ifdef LIBXML_SCHEMAS_ENABLED
35714 
35715 #define gen_nb_xmlSchemaValPtr_ptr 1
gen_xmlSchemaValPtr_ptr(int no ATTRIBUTE_UNUSED,int nr ATTRIBUTE_UNUSED)35716 static xmlSchemaValPtr * gen_xmlSchemaValPtr_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
35717     return(NULL);
35718 }
des_xmlSchemaValPtr_ptr(int no ATTRIBUTE_UNUSED,xmlSchemaValPtr * val ATTRIBUTE_UNUSED,int nr ATTRIBUTE_UNUSED)35719 static void des_xmlSchemaValPtr_ptr(int no ATTRIBUTE_UNUSED, xmlSchemaValPtr * val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
35720 }
35721 #endif
35722 
35723 
35724 static int
test_xmlSchemaValPredefTypeNode(void)35725 test_xmlSchemaValPredefTypeNode(void) {
35726     int test_ret = 0;
35727 
35728 #if defined(LIBXML_SCHEMAS_ENABLED)
35729     int mem_base;
35730     int ret_val;
35731     xmlSchemaTypePtr type; /* the predefined type */
35732     int n_type;
35733     xmlChar * value; /* the value to check */
35734     int n_value;
35735     xmlSchemaValPtr * val; /* the return computed value */
35736     int n_val;
35737     xmlNodePtr node; /* the node containing the value */
35738     int n_node;
35739 
35740     for (n_type = 0;n_type < gen_nb_xmlSchemaTypePtr;n_type++) {
35741     for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
35742     for (n_val = 0;n_val < gen_nb_xmlSchemaValPtr_ptr;n_val++) {
35743     for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
35744         mem_base = xmlMemBlocks();
35745         type = gen_xmlSchemaTypePtr(n_type, 0);
35746         value = gen_const_xmlChar_ptr(n_value, 1);
35747         val = gen_xmlSchemaValPtr_ptr(n_val, 2);
35748         node = gen_xmlNodePtr(n_node, 3);
35749 
35750         ret_val = xmlSchemaValPredefTypeNode(type, (const xmlChar *)value, val, node);
35751         desret_int(ret_val);
35752         call_tests++;
35753         des_xmlSchemaTypePtr(n_type, type, 0);
35754         des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 1);
35755         des_xmlSchemaValPtr_ptr(n_val, val, 2);
35756         des_xmlNodePtr(n_node, node, 3);
35757         xmlResetLastError();
35758         if (mem_base != xmlMemBlocks()) {
35759             printf("Leak of %d blocks found in xmlSchemaValPredefTypeNode",
35760 	           xmlMemBlocks() - mem_base);
35761 	    test_ret++;
35762             printf(" %d", n_type);
35763             printf(" %d", n_value);
35764             printf(" %d", n_val);
35765             printf(" %d", n_node);
35766             printf("\n");
35767         }
35768     }
35769     }
35770     }
35771     }
35772     function_tests++;
35773 #endif
35774 
35775     return(test_ret);
35776 }
35777 
35778 
35779 static int
test_xmlSchemaValPredefTypeNodeNoNorm(void)35780 test_xmlSchemaValPredefTypeNodeNoNorm(void) {
35781     int test_ret = 0;
35782 
35783 #if defined(LIBXML_SCHEMAS_ENABLED)
35784     int mem_base;
35785     int ret_val;
35786     xmlSchemaTypePtr type; /* the predefined type */
35787     int n_type;
35788     xmlChar * value; /* the value to check */
35789     int n_value;
35790     xmlSchemaValPtr * val; /* the return computed value */
35791     int n_val;
35792     xmlNodePtr node; /* the node containing the value */
35793     int n_node;
35794 
35795     for (n_type = 0;n_type < gen_nb_xmlSchemaTypePtr;n_type++) {
35796     for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
35797     for (n_val = 0;n_val < gen_nb_xmlSchemaValPtr_ptr;n_val++) {
35798     for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
35799         mem_base = xmlMemBlocks();
35800         type = gen_xmlSchemaTypePtr(n_type, 0);
35801         value = gen_const_xmlChar_ptr(n_value, 1);
35802         val = gen_xmlSchemaValPtr_ptr(n_val, 2);
35803         node = gen_xmlNodePtr(n_node, 3);
35804 
35805         ret_val = xmlSchemaValPredefTypeNodeNoNorm(type, (const xmlChar *)value, val, node);
35806         desret_int(ret_val);
35807         call_tests++;
35808         des_xmlSchemaTypePtr(n_type, type, 0);
35809         des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 1);
35810         des_xmlSchemaValPtr_ptr(n_val, val, 2);
35811         des_xmlNodePtr(n_node, node, 3);
35812         xmlResetLastError();
35813         if (mem_base != xmlMemBlocks()) {
35814             printf("Leak of %d blocks found in xmlSchemaValPredefTypeNodeNoNorm",
35815 	           xmlMemBlocks() - mem_base);
35816 	    test_ret++;
35817             printf(" %d", n_type);
35818             printf(" %d", n_value);
35819             printf(" %d", n_val);
35820             printf(" %d", n_node);
35821             printf("\n");
35822         }
35823     }
35824     }
35825     }
35826     }
35827     function_tests++;
35828 #endif
35829 
35830     return(test_ret);
35831 }
35832 
35833 
35834 static int
test_xmlSchemaValidateFacet(void)35835 test_xmlSchemaValidateFacet(void) {
35836     int test_ret = 0;
35837 
35838 #if defined(LIBXML_SCHEMAS_ENABLED)
35839     int mem_base;
35840     int ret_val;
35841     xmlSchemaTypePtr base; /* the base type */
35842     int n_base;
35843     xmlSchemaFacetPtr facet; /* the facet to check */
35844     int n_facet;
35845     xmlChar * value; /* the lexical repr of the value to validate */
35846     int n_value;
35847     xmlSchemaValPtr val; /* the precomputed value */
35848     int n_val;
35849 
35850     for (n_base = 0;n_base < gen_nb_xmlSchemaTypePtr;n_base++) {
35851     for (n_facet = 0;n_facet < gen_nb_xmlSchemaFacetPtr;n_facet++) {
35852     for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
35853     for (n_val = 0;n_val < gen_nb_xmlSchemaValPtr;n_val++) {
35854         mem_base = xmlMemBlocks();
35855         base = gen_xmlSchemaTypePtr(n_base, 0);
35856         facet = gen_xmlSchemaFacetPtr(n_facet, 1);
35857         value = gen_const_xmlChar_ptr(n_value, 2);
35858         val = gen_xmlSchemaValPtr(n_val, 3);
35859 
35860         ret_val = xmlSchemaValidateFacet(base, facet, (const xmlChar *)value, val);
35861         desret_int(ret_val);
35862         call_tests++;
35863         des_xmlSchemaTypePtr(n_base, base, 0);
35864         des_xmlSchemaFacetPtr(n_facet, facet, 1);
35865         des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 2);
35866         des_xmlSchemaValPtr(n_val, val, 3);
35867         xmlResetLastError();
35868         if (mem_base != xmlMemBlocks()) {
35869             printf("Leak of %d blocks found in xmlSchemaValidateFacet",
35870 	           xmlMemBlocks() - mem_base);
35871 	    test_ret++;
35872             printf(" %d", n_base);
35873             printf(" %d", n_facet);
35874             printf(" %d", n_value);
35875             printf(" %d", n_val);
35876             printf("\n");
35877         }
35878     }
35879     }
35880     }
35881     }
35882     function_tests++;
35883 #endif
35884 
35885     return(test_ret);
35886 }
35887 
35888 
35889 static int
test_xmlSchemaValidateFacetWhtsp(void)35890 test_xmlSchemaValidateFacetWhtsp(void) {
35891     int test_ret = 0;
35892 
35893 #if defined(LIBXML_SCHEMAS_ENABLED)
35894     int mem_base;
35895     int ret_val;
35896     xmlSchemaFacetPtr facet; /* the facet to check */
35897     int n_facet;
35898     xmlSchemaWhitespaceValueType fws; /* the whitespace type of the facet's value */
35899     int n_fws;
35900     xmlSchemaValType valType; /* the built-in type of the value */
35901     int n_valType;
35902     xmlChar * value; /* the lexical (or normalized for pattern) repr of the value to validate */
35903     int n_value;
35904     xmlSchemaValPtr val; /* the precomputed value */
35905     int n_val;
35906     xmlSchemaWhitespaceValueType ws; /* the whitespace type of the value */
35907     int n_ws;
35908 
35909     for (n_facet = 0;n_facet < gen_nb_xmlSchemaFacetPtr;n_facet++) {
35910     for (n_fws = 0;n_fws < gen_nb_xmlSchemaWhitespaceValueType;n_fws++) {
35911     for (n_valType = 0;n_valType < gen_nb_xmlSchemaValType;n_valType++) {
35912     for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
35913     for (n_val = 0;n_val < gen_nb_xmlSchemaValPtr;n_val++) {
35914     for (n_ws = 0;n_ws < gen_nb_xmlSchemaWhitespaceValueType;n_ws++) {
35915         mem_base = xmlMemBlocks();
35916         facet = gen_xmlSchemaFacetPtr(n_facet, 0);
35917         fws = gen_xmlSchemaWhitespaceValueType(n_fws, 1);
35918         valType = gen_xmlSchemaValType(n_valType, 2);
35919         value = gen_const_xmlChar_ptr(n_value, 3);
35920         val = gen_xmlSchemaValPtr(n_val, 4);
35921         ws = gen_xmlSchemaWhitespaceValueType(n_ws, 5);
35922 
35923         ret_val = xmlSchemaValidateFacetWhtsp(facet, fws, valType, (const xmlChar *)value, val, ws);
35924         desret_int(ret_val);
35925         call_tests++;
35926         des_xmlSchemaFacetPtr(n_facet, facet, 0);
35927         des_xmlSchemaWhitespaceValueType(n_fws, fws, 1);
35928         des_xmlSchemaValType(n_valType, valType, 2);
35929         des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 3);
35930         des_xmlSchemaValPtr(n_val, val, 4);
35931         des_xmlSchemaWhitespaceValueType(n_ws, ws, 5);
35932         xmlResetLastError();
35933         if (mem_base != xmlMemBlocks()) {
35934             printf("Leak of %d blocks found in xmlSchemaValidateFacetWhtsp",
35935 	           xmlMemBlocks() - mem_base);
35936 	    test_ret++;
35937             printf(" %d", n_facet);
35938             printf(" %d", n_fws);
35939             printf(" %d", n_valType);
35940             printf(" %d", n_value);
35941             printf(" %d", n_val);
35942             printf(" %d", n_ws);
35943             printf("\n");
35944         }
35945     }
35946     }
35947     }
35948     }
35949     }
35950     }
35951     function_tests++;
35952 #endif
35953 
35954     return(test_ret);
35955 }
35956 
35957 
35958 static int
test_xmlSchemaValidateLengthFacet(void)35959 test_xmlSchemaValidateLengthFacet(void) {
35960     int test_ret = 0;
35961 
35962 #if defined(LIBXML_SCHEMAS_ENABLED)
35963     int mem_base;
35964     int ret_val;
35965     xmlSchemaTypePtr type; /* the built-in type */
35966     int n_type;
35967     xmlSchemaFacetPtr facet; /* the facet to check */
35968     int n_facet;
35969     xmlChar * value; /* the lexical repr. of the value to be validated */
35970     int n_value;
35971     xmlSchemaValPtr val; /* the precomputed value */
35972     int n_val;
35973     unsigned long * length; /* the actual length of the value */
35974     int n_length;
35975 
35976     for (n_type = 0;n_type < gen_nb_xmlSchemaTypePtr;n_type++) {
35977     for (n_facet = 0;n_facet < gen_nb_xmlSchemaFacetPtr;n_facet++) {
35978     for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
35979     for (n_val = 0;n_val < gen_nb_xmlSchemaValPtr;n_val++) {
35980     for (n_length = 0;n_length < gen_nb_unsigned_long_ptr;n_length++) {
35981         mem_base = xmlMemBlocks();
35982         type = gen_xmlSchemaTypePtr(n_type, 0);
35983         facet = gen_xmlSchemaFacetPtr(n_facet, 1);
35984         value = gen_const_xmlChar_ptr(n_value, 2);
35985         val = gen_xmlSchemaValPtr(n_val, 3);
35986         length = gen_unsigned_long_ptr(n_length, 4);
35987 
35988         ret_val = xmlSchemaValidateLengthFacet(type, facet, (const xmlChar *)value, val, length);
35989         desret_int(ret_val);
35990         call_tests++;
35991         des_xmlSchemaTypePtr(n_type, type, 0);
35992         des_xmlSchemaFacetPtr(n_facet, facet, 1);
35993         des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 2);
35994         des_xmlSchemaValPtr(n_val, val, 3);
35995         des_unsigned_long_ptr(n_length, length, 4);
35996         xmlResetLastError();
35997         if (mem_base != xmlMemBlocks()) {
35998             printf("Leak of %d blocks found in xmlSchemaValidateLengthFacet",
35999 	           xmlMemBlocks() - mem_base);
36000 	    test_ret++;
36001             printf(" %d", n_type);
36002             printf(" %d", n_facet);
36003             printf(" %d", n_value);
36004             printf(" %d", n_val);
36005             printf(" %d", n_length);
36006             printf("\n");
36007         }
36008     }
36009     }
36010     }
36011     }
36012     }
36013     function_tests++;
36014 #endif
36015 
36016     return(test_ret);
36017 }
36018 
36019 
36020 static int
test_xmlSchemaValidateLengthFacetWhtsp(void)36021 test_xmlSchemaValidateLengthFacetWhtsp(void) {
36022     int test_ret = 0;
36023 
36024 #if defined(LIBXML_SCHEMAS_ENABLED)
36025     int mem_base;
36026     int ret_val;
36027     xmlSchemaFacetPtr facet; /* the facet to check */
36028     int n_facet;
36029     xmlSchemaValType valType; /* the built-in type */
36030     int n_valType;
36031     xmlChar * value; /* the lexical repr. of the value to be validated */
36032     int n_value;
36033     xmlSchemaValPtr val; /* the precomputed value */
36034     int n_val;
36035     unsigned long * length; /* the actual length of the value */
36036     int n_length;
36037     xmlSchemaWhitespaceValueType ws; /* the whitespace type of the value */
36038     int n_ws;
36039 
36040     for (n_facet = 0;n_facet < gen_nb_xmlSchemaFacetPtr;n_facet++) {
36041     for (n_valType = 0;n_valType < gen_nb_xmlSchemaValType;n_valType++) {
36042     for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
36043     for (n_val = 0;n_val < gen_nb_xmlSchemaValPtr;n_val++) {
36044     for (n_length = 0;n_length < gen_nb_unsigned_long_ptr;n_length++) {
36045     for (n_ws = 0;n_ws < gen_nb_xmlSchemaWhitespaceValueType;n_ws++) {
36046         mem_base = xmlMemBlocks();
36047         facet = gen_xmlSchemaFacetPtr(n_facet, 0);
36048         valType = gen_xmlSchemaValType(n_valType, 1);
36049         value = gen_const_xmlChar_ptr(n_value, 2);
36050         val = gen_xmlSchemaValPtr(n_val, 3);
36051         length = gen_unsigned_long_ptr(n_length, 4);
36052         ws = gen_xmlSchemaWhitespaceValueType(n_ws, 5);
36053 
36054         ret_val = xmlSchemaValidateLengthFacetWhtsp(facet, valType, (const xmlChar *)value, val, length, ws);
36055         desret_int(ret_val);
36056         call_tests++;
36057         des_xmlSchemaFacetPtr(n_facet, facet, 0);
36058         des_xmlSchemaValType(n_valType, valType, 1);
36059         des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 2);
36060         des_xmlSchemaValPtr(n_val, val, 3);
36061         des_unsigned_long_ptr(n_length, length, 4);
36062         des_xmlSchemaWhitespaceValueType(n_ws, ws, 5);
36063         xmlResetLastError();
36064         if (mem_base != xmlMemBlocks()) {
36065             printf("Leak of %d blocks found in xmlSchemaValidateLengthFacetWhtsp",
36066 	           xmlMemBlocks() - mem_base);
36067 	    test_ret++;
36068             printf(" %d", n_facet);
36069             printf(" %d", n_valType);
36070             printf(" %d", n_value);
36071             printf(" %d", n_val);
36072             printf(" %d", n_length);
36073             printf(" %d", n_ws);
36074             printf("\n");
36075         }
36076     }
36077     }
36078     }
36079     }
36080     }
36081     }
36082     function_tests++;
36083 #endif
36084 
36085     return(test_ret);
36086 }
36087 
36088 
36089 static int
test_xmlSchemaValidateListSimpleTypeFacet(void)36090 test_xmlSchemaValidateListSimpleTypeFacet(void) {
36091     int test_ret = 0;
36092 
36093 #if defined(LIBXML_SCHEMAS_ENABLED)
36094     int mem_base;
36095     int ret_val;
36096     xmlSchemaFacetPtr facet; /* the facet to check */
36097     int n_facet;
36098     xmlChar * value; /* the lexical repr of the value to validate */
36099     int n_value;
36100     unsigned long actualLen; /* the number of list items */
36101     int n_actualLen;
36102     unsigned long * expectedLen; /* the resulting expected number of list items */
36103     int n_expectedLen;
36104 
36105     for (n_facet = 0;n_facet < gen_nb_xmlSchemaFacetPtr;n_facet++) {
36106     for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
36107     for (n_actualLen = 0;n_actualLen < gen_nb_unsigned_long;n_actualLen++) {
36108     for (n_expectedLen = 0;n_expectedLen < gen_nb_unsigned_long_ptr;n_expectedLen++) {
36109         mem_base = xmlMemBlocks();
36110         facet = gen_xmlSchemaFacetPtr(n_facet, 0);
36111         value = gen_const_xmlChar_ptr(n_value, 1);
36112         actualLen = gen_unsigned_long(n_actualLen, 2);
36113         expectedLen = gen_unsigned_long_ptr(n_expectedLen, 3);
36114 
36115         ret_val = xmlSchemaValidateListSimpleTypeFacet(facet, (const xmlChar *)value, actualLen, expectedLen);
36116         desret_int(ret_val);
36117         call_tests++;
36118         des_xmlSchemaFacetPtr(n_facet, facet, 0);
36119         des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 1);
36120         des_unsigned_long(n_actualLen, actualLen, 2);
36121         des_unsigned_long_ptr(n_expectedLen, expectedLen, 3);
36122         xmlResetLastError();
36123         if (mem_base != xmlMemBlocks()) {
36124             printf("Leak of %d blocks found in xmlSchemaValidateListSimpleTypeFacet",
36125 	           xmlMemBlocks() - mem_base);
36126 	    test_ret++;
36127             printf(" %d", n_facet);
36128             printf(" %d", n_value);
36129             printf(" %d", n_actualLen);
36130             printf(" %d", n_expectedLen);
36131             printf("\n");
36132         }
36133     }
36134     }
36135     }
36136     }
36137     function_tests++;
36138 #endif
36139 
36140     return(test_ret);
36141 }
36142 
36143 
36144 static int
test_xmlSchemaValidatePredefinedType(void)36145 test_xmlSchemaValidatePredefinedType(void) {
36146     int test_ret = 0;
36147 
36148 #if defined(LIBXML_SCHEMAS_ENABLED)
36149     int mem_base;
36150     int ret_val;
36151     xmlSchemaTypePtr type; /* the predefined type */
36152     int n_type;
36153     xmlChar * value; /* the value to check */
36154     int n_value;
36155     xmlSchemaValPtr * val; /* the return computed value */
36156     int n_val;
36157 
36158     for (n_type = 0;n_type < gen_nb_xmlSchemaTypePtr;n_type++) {
36159     for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
36160     for (n_val = 0;n_val < gen_nb_xmlSchemaValPtr_ptr;n_val++) {
36161         mem_base = xmlMemBlocks();
36162         type = gen_xmlSchemaTypePtr(n_type, 0);
36163         value = gen_const_xmlChar_ptr(n_value, 1);
36164         val = gen_xmlSchemaValPtr_ptr(n_val, 2);
36165 
36166         ret_val = xmlSchemaValidatePredefinedType(type, (const xmlChar *)value, val);
36167         desret_int(ret_val);
36168         call_tests++;
36169         des_xmlSchemaTypePtr(n_type, type, 0);
36170         des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 1);
36171         des_xmlSchemaValPtr_ptr(n_val, val, 2);
36172         xmlResetLastError();
36173         if (mem_base != xmlMemBlocks()) {
36174             printf("Leak of %d blocks found in xmlSchemaValidatePredefinedType",
36175 	           xmlMemBlocks() - mem_base);
36176 	    test_ret++;
36177             printf(" %d", n_type);
36178             printf(" %d", n_value);
36179             printf(" %d", n_val);
36180             printf("\n");
36181         }
36182     }
36183     }
36184     }
36185     function_tests++;
36186 #endif
36187 
36188     return(test_ret);
36189 }
36190 
36191 
36192 static int
test_xmlSchemaValueAppend(void)36193 test_xmlSchemaValueAppend(void) {
36194     int test_ret = 0;
36195 
36196 #if defined(LIBXML_SCHEMAS_ENABLED)
36197     int mem_base;
36198     int ret_val;
36199     xmlSchemaValPtr prev; /* the value */
36200     int n_prev;
36201     xmlSchemaValPtr cur; /* the value to be appended */
36202     int n_cur;
36203 
36204     for (n_prev = 0;n_prev < gen_nb_xmlSchemaValPtr;n_prev++) {
36205     for (n_cur = 0;n_cur < gen_nb_xmlSchemaValPtr;n_cur++) {
36206         mem_base = xmlMemBlocks();
36207         prev = gen_xmlSchemaValPtr(n_prev, 0);
36208         cur = gen_xmlSchemaValPtr(n_cur, 1);
36209 
36210         ret_val = xmlSchemaValueAppend(prev, cur);
36211         desret_int(ret_val);
36212         call_tests++;
36213         des_xmlSchemaValPtr(n_prev, prev, 0);
36214         des_xmlSchemaValPtr(n_cur, cur, 1);
36215         xmlResetLastError();
36216         if (mem_base != xmlMemBlocks()) {
36217             printf("Leak of %d blocks found in xmlSchemaValueAppend",
36218 	           xmlMemBlocks() - mem_base);
36219 	    test_ret++;
36220             printf(" %d", n_prev);
36221             printf(" %d", n_cur);
36222             printf("\n");
36223         }
36224     }
36225     }
36226     function_tests++;
36227 #endif
36228 
36229     return(test_ret);
36230 }
36231 
36232 
36233 static int
test_xmlSchemaValueGetAsBoolean(void)36234 test_xmlSchemaValueGetAsBoolean(void) {
36235     int test_ret = 0;
36236 
36237 #if defined(LIBXML_SCHEMAS_ENABLED)
36238     int mem_base;
36239     int ret_val;
36240     xmlSchemaValPtr val; /* the value */
36241     int n_val;
36242 
36243     for (n_val = 0;n_val < gen_nb_xmlSchemaValPtr;n_val++) {
36244         mem_base = xmlMemBlocks();
36245         val = gen_xmlSchemaValPtr(n_val, 0);
36246 
36247         ret_val = xmlSchemaValueGetAsBoolean(val);
36248         desret_int(ret_val);
36249         call_tests++;
36250         des_xmlSchemaValPtr(n_val, val, 0);
36251         xmlResetLastError();
36252         if (mem_base != xmlMemBlocks()) {
36253             printf("Leak of %d blocks found in xmlSchemaValueGetAsBoolean",
36254 	           xmlMemBlocks() - mem_base);
36255 	    test_ret++;
36256             printf(" %d", n_val);
36257             printf("\n");
36258         }
36259     }
36260     function_tests++;
36261 #endif
36262 
36263     return(test_ret);
36264 }
36265 
36266 
36267 static int
test_xmlSchemaValueGetAsString(void)36268 test_xmlSchemaValueGetAsString(void) {
36269     int test_ret = 0;
36270 
36271 #if defined(LIBXML_SCHEMAS_ENABLED)
36272     int mem_base;
36273     const xmlChar * ret_val;
36274     xmlSchemaValPtr val; /* the value */
36275     int n_val;
36276 
36277     for (n_val = 0;n_val < gen_nb_xmlSchemaValPtr;n_val++) {
36278         mem_base = xmlMemBlocks();
36279         val = gen_xmlSchemaValPtr(n_val, 0);
36280 
36281         ret_val = xmlSchemaValueGetAsString(val);
36282         desret_const_xmlChar_ptr(ret_val);
36283         call_tests++;
36284         des_xmlSchemaValPtr(n_val, val, 0);
36285         xmlResetLastError();
36286         if (mem_base != xmlMemBlocks()) {
36287             printf("Leak of %d blocks found in xmlSchemaValueGetAsString",
36288 	           xmlMemBlocks() - mem_base);
36289 	    test_ret++;
36290             printf(" %d", n_val);
36291             printf("\n");
36292         }
36293     }
36294     function_tests++;
36295 #endif
36296 
36297     return(test_ret);
36298 }
36299 
36300 
36301 static int
test_xmlSchemaValueGetNext(void)36302 test_xmlSchemaValueGetNext(void) {
36303     int test_ret = 0;
36304 
36305 
36306     /* missing type support */
36307     return(test_ret);
36308 }
36309 
36310 
36311 static int
test_xmlSchemaWhiteSpaceReplace(void)36312 test_xmlSchemaWhiteSpaceReplace(void) {
36313     int test_ret = 0;
36314 
36315 #if defined(LIBXML_SCHEMAS_ENABLED)
36316     int mem_base;
36317     xmlChar * ret_val;
36318     xmlChar * value; /* a value */
36319     int n_value;
36320 
36321     for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
36322         mem_base = xmlMemBlocks();
36323         value = gen_const_xmlChar_ptr(n_value, 0);
36324 
36325         ret_val = xmlSchemaWhiteSpaceReplace((const xmlChar *)value);
36326         desret_xmlChar_ptr(ret_val);
36327         call_tests++;
36328         des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 0);
36329         xmlResetLastError();
36330         if (mem_base != xmlMemBlocks()) {
36331             printf("Leak of %d blocks found in xmlSchemaWhiteSpaceReplace",
36332 	           xmlMemBlocks() - mem_base);
36333 	    test_ret++;
36334             printf(" %d", n_value);
36335             printf("\n");
36336         }
36337     }
36338     function_tests++;
36339 #endif
36340 
36341     return(test_ret);
36342 }
36343 
36344 static int
test_xmlschemastypes(void)36345 test_xmlschemastypes(void) {
36346     int test_ret = 0;
36347 
36348     if (quiet == 0) printf("Testing xmlschemastypes : 26 of 34 functions ...\n");
36349     test_ret += test_xmlSchemaCheckFacet();
36350     test_ret += test_xmlSchemaCleanupTypes();
36351     test_ret += test_xmlSchemaCollapseString();
36352     test_ret += test_xmlSchemaCompareValues();
36353     test_ret += test_xmlSchemaCompareValuesWhtsp();
36354     test_ret += test_xmlSchemaCopyValue();
36355     test_ret += test_xmlSchemaGetBuiltInListSimpleTypeItemType();
36356     test_ret += test_xmlSchemaGetBuiltInType();
36357     test_ret += test_xmlSchemaGetCanonValue();
36358     test_ret += test_xmlSchemaGetCanonValueWhtsp();
36359     test_ret += test_xmlSchemaGetFacetValueAsULong();
36360     test_ret += test_xmlSchemaGetPredefinedType();
36361     test_ret += test_xmlSchemaGetValType();
36362     test_ret += test_xmlSchemaInitTypes();
36363     test_ret += test_xmlSchemaIsBuiltInTypeFacet();
36364     test_ret += test_xmlSchemaNewFacet();
36365     test_ret += test_xmlSchemaNewNOTATIONValue();
36366     test_ret += test_xmlSchemaNewQNameValue();
36367     test_ret += test_xmlSchemaNewStringValue();
36368     test_ret += test_xmlSchemaValPredefTypeNode();
36369     test_ret += test_xmlSchemaValPredefTypeNodeNoNorm();
36370     test_ret += test_xmlSchemaValidateFacet();
36371     test_ret += test_xmlSchemaValidateFacetWhtsp();
36372     test_ret += test_xmlSchemaValidateLengthFacet();
36373     test_ret += test_xmlSchemaValidateLengthFacetWhtsp();
36374     test_ret += test_xmlSchemaValidateListSimpleTypeFacet();
36375     test_ret += test_xmlSchemaValidatePredefinedType();
36376     test_ret += test_xmlSchemaValueAppend();
36377     test_ret += test_xmlSchemaValueGetAsBoolean();
36378     test_ret += test_xmlSchemaValueGetAsString();
36379     test_ret += test_xmlSchemaValueGetNext();
36380     test_ret += test_xmlSchemaWhiteSpaceReplace();
36381 
36382     if (test_ret != 0)
36383 	printf("Module xmlschemastypes: %d errors\n", test_ret);
36384     return(test_ret);
36385 }
36386 
36387 static int
test_xmlCharStrdup(void)36388 test_xmlCharStrdup(void) {
36389     int test_ret = 0;
36390 
36391     int mem_base;
36392     xmlChar * ret_val;
36393     char * cur; /* the input char * */
36394     int n_cur;
36395 
36396     for (n_cur = 0;n_cur < gen_nb_const_char_ptr;n_cur++) {
36397         mem_base = xmlMemBlocks();
36398         cur = gen_const_char_ptr(n_cur, 0);
36399 
36400         ret_val = xmlCharStrdup((const char *)cur);
36401         desret_xmlChar_ptr(ret_val);
36402         call_tests++;
36403         des_const_char_ptr(n_cur, (const char *)cur, 0);
36404         xmlResetLastError();
36405         if (mem_base != xmlMemBlocks()) {
36406             printf("Leak of %d blocks found in xmlCharStrdup",
36407 	           xmlMemBlocks() - mem_base);
36408 	    test_ret++;
36409             printf(" %d", n_cur);
36410             printf("\n");
36411         }
36412     }
36413     function_tests++;
36414 
36415     return(test_ret);
36416 }
36417 
36418 
36419 static int
test_xmlCharStrndup(void)36420 test_xmlCharStrndup(void) {
36421     int test_ret = 0;
36422 
36423     int mem_base;
36424     xmlChar * ret_val;
36425     char * cur; /* the input char * */
36426     int n_cur;
36427     int len; /* the len of @cur */
36428     int n_len;
36429 
36430     for (n_cur = 0;n_cur < gen_nb_const_char_ptr;n_cur++) {
36431     for (n_len = 0;n_len < gen_nb_int;n_len++) {
36432         mem_base = xmlMemBlocks();
36433         cur = gen_const_char_ptr(n_cur, 0);
36434         len = gen_int(n_len, 1);
36435         if ((cur != NULL) &&
36436             (len > (int) strlen((const char *) cur) + 1))
36437             continue;
36438 
36439         ret_val = xmlCharStrndup((const char *)cur, len);
36440         desret_xmlChar_ptr(ret_val);
36441         call_tests++;
36442         des_const_char_ptr(n_cur, (const char *)cur, 0);
36443         des_int(n_len, len, 1);
36444         xmlResetLastError();
36445         if (mem_base != xmlMemBlocks()) {
36446             printf("Leak of %d blocks found in xmlCharStrndup",
36447 	           xmlMemBlocks() - mem_base);
36448 	    test_ret++;
36449             printf(" %d", n_cur);
36450             printf(" %d", n_len);
36451             printf("\n");
36452         }
36453     }
36454     }
36455     function_tests++;
36456 
36457     return(test_ret);
36458 }
36459 
36460 
36461 static int
test_xmlCheckUTF8(void)36462 test_xmlCheckUTF8(void) {
36463     int test_ret = 0;
36464 
36465     int mem_base;
36466     int ret_val;
36467     unsigned char * utf; /* Pointer to putative UTF-8 encoded string. */
36468     int n_utf;
36469 
36470     for (n_utf = 0;n_utf < gen_nb_const_unsigned_char_ptr;n_utf++) {
36471         mem_base = xmlMemBlocks();
36472         utf = gen_const_unsigned_char_ptr(n_utf, 0);
36473 
36474         ret_val = xmlCheckUTF8((const unsigned char *)utf);
36475         desret_int(ret_val);
36476         call_tests++;
36477         des_const_unsigned_char_ptr(n_utf, (const unsigned char *)utf, 0);
36478         xmlResetLastError();
36479         if (mem_base != xmlMemBlocks()) {
36480             printf("Leak of %d blocks found in xmlCheckUTF8",
36481 	           xmlMemBlocks() - mem_base);
36482 	    test_ret++;
36483             printf(" %d", n_utf);
36484             printf("\n");
36485         }
36486     }
36487     function_tests++;
36488 
36489     return(test_ret);
36490 }
36491 
36492 
36493 static int
test_xmlGetUTF8Char(void)36494 test_xmlGetUTF8Char(void) {
36495     int test_ret = 0;
36496 
36497     int mem_base;
36498     int ret_val;
36499     unsigned char * utf; /* a sequence of UTF-8 encoded bytes */
36500     int n_utf;
36501     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. */
36502     int n_len;
36503 
36504     for (n_utf = 0;n_utf < gen_nb_const_unsigned_char_ptr;n_utf++) {
36505     for (n_len = 0;n_len < gen_nb_int_ptr;n_len++) {
36506         mem_base = xmlMemBlocks();
36507         utf = gen_const_unsigned_char_ptr(n_utf, 0);
36508         len = gen_int_ptr(n_len, 1);
36509 
36510         ret_val = xmlGetUTF8Char((const unsigned char *)utf, len);
36511         desret_int(ret_val);
36512         call_tests++;
36513         des_const_unsigned_char_ptr(n_utf, (const unsigned char *)utf, 0);
36514         des_int_ptr(n_len, len, 1);
36515         xmlResetLastError();
36516         if (mem_base != xmlMemBlocks()) {
36517             printf("Leak of %d blocks found in xmlGetUTF8Char",
36518 	           xmlMemBlocks() - mem_base);
36519 	    test_ret++;
36520             printf(" %d", n_utf);
36521             printf(" %d", n_len);
36522             printf("\n");
36523         }
36524     }
36525     }
36526     function_tests++;
36527 
36528     return(test_ret);
36529 }
36530 
36531 
36532 static int
test_xmlStrEqual(void)36533 test_xmlStrEqual(void) {
36534     int test_ret = 0;
36535 
36536     int mem_base;
36537     int ret_val;
36538     xmlChar * str1; /* the first xmlChar * */
36539     int n_str1;
36540     xmlChar * str2; /* the second xmlChar * */
36541     int n_str2;
36542 
36543     for (n_str1 = 0;n_str1 < gen_nb_const_xmlChar_ptr;n_str1++) {
36544     for (n_str2 = 0;n_str2 < gen_nb_const_xmlChar_ptr;n_str2++) {
36545         mem_base = xmlMemBlocks();
36546         str1 = gen_const_xmlChar_ptr(n_str1, 0);
36547         str2 = gen_const_xmlChar_ptr(n_str2, 1);
36548 
36549         ret_val = xmlStrEqual((const xmlChar *)str1, (const xmlChar *)str2);
36550         desret_int(ret_val);
36551         call_tests++;
36552         des_const_xmlChar_ptr(n_str1, (const xmlChar *)str1, 0);
36553         des_const_xmlChar_ptr(n_str2, (const xmlChar *)str2, 1);
36554         xmlResetLastError();
36555         if (mem_base != xmlMemBlocks()) {
36556             printf("Leak of %d blocks found in xmlStrEqual",
36557 	           xmlMemBlocks() - mem_base);
36558 	    test_ret++;
36559             printf(" %d", n_str1);
36560             printf(" %d", n_str2);
36561             printf("\n");
36562         }
36563     }
36564     }
36565     function_tests++;
36566 
36567     return(test_ret);
36568 }
36569 
36570 
36571 static int
test_xmlStrPrintf(void)36572 test_xmlStrPrintf(void) {
36573     int test_ret = 0;
36574 
36575 
36576     /* missing type support */
36577     return(test_ret);
36578 }
36579 
36580 
36581 static int
test_xmlStrQEqual(void)36582 test_xmlStrQEqual(void) {
36583     int test_ret = 0;
36584 
36585     int mem_base;
36586     int ret_val;
36587     xmlChar * pref; /* the prefix of the QName */
36588     int n_pref;
36589     xmlChar * name; /* the localname of the QName */
36590     int n_name;
36591     xmlChar * str; /* the second xmlChar * */
36592     int n_str;
36593 
36594     for (n_pref = 0;n_pref < gen_nb_const_xmlChar_ptr;n_pref++) {
36595     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
36596     for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) {
36597         mem_base = xmlMemBlocks();
36598         pref = gen_const_xmlChar_ptr(n_pref, 0);
36599         name = gen_const_xmlChar_ptr(n_name, 1);
36600         str = gen_const_xmlChar_ptr(n_str, 2);
36601 
36602         ret_val = xmlStrQEqual((const xmlChar *)pref, (const xmlChar *)name, (const xmlChar *)str);
36603         desret_int(ret_val);
36604         call_tests++;
36605         des_const_xmlChar_ptr(n_pref, (const xmlChar *)pref, 0);
36606         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
36607         des_const_xmlChar_ptr(n_str, (const xmlChar *)str, 2);
36608         xmlResetLastError();
36609         if (mem_base != xmlMemBlocks()) {
36610             printf("Leak of %d blocks found in xmlStrQEqual",
36611 	           xmlMemBlocks() - mem_base);
36612 	    test_ret++;
36613             printf(" %d", n_pref);
36614             printf(" %d", n_name);
36615             printf(" %d", n_str);
36616             printf("\n");
36617         }
36618     }
36619     }
36620     }
36621     function_tests++;
36622 
36623     return(test_ret);
36624 }
36625 
36626 
36627 static int
test_xmlStrVPrintf(void)36628 test_xmlStrVPrintf(void) {
36629     int test_ret = 0;
36630 
36631 
36632     /* missing type support */
36633     return(test_ret);
36634 }
36635 
36636 
36637 static int
test_xmlStrcasecmp(void)36638 test_xmlStrcasecmp(void) {
36639     int test_ret = 0;
36640 
36641     int mem_base;
36642     int ret_val;
36643     xmlChar * str1; /* the first xmlChar * */
36644     int n_str1;
36645     xmlChar * str2; /* the second xmlChar * */
36646     int n_str2;
36647 
36648     for (n_str1 = 0;n_str1 < gen_nb_const_xmlChar_ptr;n_str1++) {
36649     for (n_str2 = 0;n_str2 < gen_nb_const_xmlChar_ptr;n_str2++) {
36650         mem_base = xmlMemBlocks();
36651         str1 = gen_const_xmlChar_ptr(n_str1, 0);
36652         str2 = gen_const_xmlChar_ptr(n_str2, 1);
36653 
36654         ret_val = xmlStrcasecmp((const xmlChar *)str1, (const xmlChar *)str2);
36655         desret_int(ret_val);
36656         call_tests++;
36657         des_const_xmlChar_ptr(n_str1, (const xmlChar *)str1, 0);
36658         des_const_xmlChar_ptr(n_str2, (const xmlChar *)str2, 1);
36659         xmlResetLastError();
36660         if (mem_base != xmlMemBlocks()) {
36661             printf("Leak of %d blocks found in xmlStrcasecmp",
36662 	           xmlMemBlocks() - mem_base);
36663 	    test_ret++;
36664             printf(" %d", n_str1);
36665             printf(" %d", n_str2);
36666             printf("\n");
36667         }
36668     }
36669     }
36670     function_tests++;
36671 
36672     return(test_ret);
36673 }
36674 
36675 
36676 static int
test_xmlStrcasestr(void)36677 test_xmlStrcasestr(void) {
36678     int test_ret = 0;
36679 
36680     int mem_base;
36681     const xmlChar * ret_val;
36682     xmlChar * str; /* the xmlChar * array (haystack) */
36683     int n_str;
36684     xmlChar * val; /* the xmlChar to search (needle) */
36685     int n_val;
36686 
36687     for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) {
36688     for (n_val = 0;n_val < gen_nb_const_xmlChar_ptr;n_val++) {
36689         mem_base = xmlMemBlocks();
36690         str = gen_const_xmlChar_ptr(n_str, 0);
36691         val = gen_const_xmlChar_ptr(n_val, 1);
36692 
36693         ret_val = xmlStrcasestr((const xmlChar *)str, (const xmlChar *)val);
36694         desret_const_xmlChar_ptr(ret_val);
36695         call_tests++;
36696         des_const_xmlChar_ptr(n_str, (const xmlChar *)str, 0);
36697         des_const_xmlChar_ptr(n_val, (const xmlChar *)val, 1);
36698         xmlResetLastError();
36699         if (mem_base != xmlMemBlocks()) {
36700             printf("Leak of %d blocks found in xmlStrcasestr",
36701 	           xmlMemBlocks() - mem_base);
36702 	    test_ret++;
36703             printf(" %d", n_str);
36704             printf(" %d", n_val);
36705             printf("\n");
36706         }
36707     }
36708     }
36709     function_tests++;
36710 
36711     return(test_ret);
36712 }
36713 
36714 
36715 static int
test_xmlStrchr(void)36716 test_xmlStrchr(void) {
36717     int test_ret = 0;
36718 
36719     int mem_base;
36720     const xmlChar * ret_val;
36721     xmlChar * str; /* the xmlChar * array */
36722     int n_str;
36723     xmlChar val; /* the xmlChar to search */
36724     int n_val;
36725 
36726     for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) {
36727     for (n_val = 0;n_val < gen_nb_xmlChar;n_val++) {
36728         mem_base = xmlMemBlocks();
36729         str = gen_const_xmlChar_ptr(n_str, 0);
36730         val = gen_xmlChar(n_val, 1);
36731 
36732         ret_val = xmlStrchr((const xmlChar *)str, val);
36733         desret_const_xmlChar_ptr(ret_val);
36734         call_tests++;
36735         des_const_xmlChar_ptr(n_str, (const xmlChar *)str, 0);
36736         des_xmlChar(n_val, val, 1);
36737         xmlResetLastError();
36738         if (mem_base != xmlMemBlocks()) {
36739             printf("Leak of %d blocks found in xmlStrchr",
36740 	           xmlMemBlocks() - mem_base);
36741 	    test_ret++;
36742             printf(" %d", n_str);
36743             printf(" %d", n_val);
36744             printf("\n");
36745         }
36746     }
36747     }
36748     function_tests++;
36749 
36750     return(test_ret);
36751 }
36752 
36753 
36754 static int
test_xmlStrcmp(void)36755 test_xmlStrcmp(void) {
36756     int test_ret = 0;
36757 
36758     int mem_base;
36759     int ret_val;
36760     xmlChar * str1; /* the first xmlChar * */
36761     int n_str1;
36762     xmlChar * str2; /* the second xmlChar * */
36763     int n_str2;
36764 
36765     for (n_str1 = 0;n_str1 < gen_nb_const_xmlChar_ptr;n_str1++) {
36766     for (n_str2 = 0;n_str2 < gen_nb_const_xmlChar_ptr;n_str2++) {
36767         mem_base = xmlMemBlocks();
36768         str1 = gen_const_xmlChar_ptr(n_str1, 0);
36769         str2 = gen_const_xmlChar_ptr(n_str2, 1);
36770 
36771         ret_val = xmlStrcmp((const xmlChar *)str1, (const xmlChar *)str2);
36772         desret_int(ret_val);
36773         call_tests++;
36774         des_const_xmlChar_ptr(n_str1, (const xmlChar *)str1, 0);
36775         des_const_xmlChar_ptr(n_str2, (const xmlChar *)str2, 1);
36776         xmlResetLastError();
36777         if (mem_base != xmlMemBlocks()) {
36778             printf("Leak of %d blocks found in xmlStrcmp",
36779 	           xmlMemBlocks() - mem_base);
36780 	    test_ret++;
36781             printf(" %d", n_str1);
36782             printf(" %d", n_str2);
36783             printf("\n");
36784         }
36785     }
36786     }
36787     function_tests++;
36788 
36789     return(test_ret);
36790 }
36791 
36792 
36793 static int
test_xmlStrdup(void)36794 test_xmlStrdup(void) {
36795     int test_ret = 0;
36796 
36797     int mem_base;
36798     xmlChar * ret_val;
36799     xmlChar * cur; /* the input xmlChar * */
36800     int n_cur;
36801 
36802     for (n_cur = 0;n_cur < gen_nb_const_xmlChar_ptr;n_cur++) {
36803         mem_base = xmlMemBlocks();
36804         cur = gen_const_xmlChar_ptr(n_cur, 0);
36805 
36806         ret_val = xmlStrdup((const xmlChar *)cur);
36807         desret_xmlChar_ptr(ret_val);
36808         call_tests++;
36809         des_const_xmlChar_ptr(n_cur, (const xmlChar *)cur, 0);
36810         xmlResetLastError();
36811         if (mem_base != xmlMemBlocks()) {
36812             printf("Leak of %d blocks found in xmlStrdup",
36813 	           xmlMemBlocks() - mem_base);
36814 	    test_ret++;
36815             printf(" %d", n_cur);
36816             printf("\n");
36817         }
36818     }
36819     function_tests++;
36820 
36821     return(test_ret);
36822 }
36823 
36824 
36825 static int
test_xmlStrlen(void)36826 test_xmlStrlen(void) {
36827     int test_ret = 0;
36828 
36829     int mem_base;
36830     int ret_val;
36831     xmlChar * str; /* the xmlChar * array */
36832     int n_str;
36833 
36834     for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) {
36835         mem_base = xmlMemBlocks();
36836         str = gen_const_xmlChar_ptr(n_str, 0);
36837 
36838         ret_val = xmlStrlen((const xmlChar *)str);
36839         desret_int(ret_val);
36840         call_tests++;
36841         des_const_xmlChar_ptr(n_str, (const xmlChar *)str, 0);
36842         xmlResetLastError();
36843         if (mem_base != xmlMemBlocks()) {
36844             printf("Leak of %d blocks found in xmlStrlen",
36845 	           xmlMemBlocks() - mem_base);
36846 	    test_ret++;
36847             printf(" %d", n_str);
36848             printf("\n");
36849         }
36850     }
36851     function_tests++;
36852 
36853     return(test_ret);
36854 }
36855 
36856 
36857 static int
test_xmlStrncasecmp(void)36858 test_xmlStrncasecmp(void) {
36859     int test_ret = 0;
36860 
36861     int mem_base;
36862     int ret_val;
36863     xmlChar * str1; /* the first xmlChar * */
36864     int n_str1;
36865     xmlChar * str2; /* the second xmlChar * */
36866     int n_str2;
36867     int len; /* the max comparison length */
36868     int n_len;
36869 
36870     for (n_str1 = 0;n_str1 < gen_nb_const_xmlChar_ptr;n_str1++) {
36871     for (n_str2 = 0;n_str2 < gen_nb_const_xmlChar_ptr;n_str2++) {
36872     for (n_len = 0;n_len < gen_nb_int;n_len++) {
36873         mem_base = xmlMemBlocks();
36874         str1 = gen_const_xmlChar_ptr(n_str1, 0);
36875         str2 = gen_const_xmlChar_ptr(n_str2, 1);
36876         len = gen_int(n_len, 2);
36877         if ((str2 != NULL) &&
36878             (len > (int) strlen((const char *) str2) + 1))
36879             continue;
36880 
36881         ret_val = xmlStrncasecmp((const xmlChar *)str1, (const xmlChar *)str2, len);
36882         desret_int(ret_val);
36883         call_tests++;
36884         des_const_xmlChar_ptr(n_str1, (const xmlChar *)str1, 0);
36885         des_const_xmlChar_ptr(n_str2, (const xmlChar *)str2, 1);
36886         des_int(n_len, len, 2);
36887         xmlResetLastError();
36888         if (mem_base != xmlMemBlocks()) {
36889             printf("Leak of %d blocks found in xmlStrncasecmp",
36890 	           xmlMemBlocks() - mem_base);
36891 	    test_ret++;
36892             printf(" %d", n_str1);
36893             printf(" %d", n_str2);
36894             printf(" %d", n_len);
36895             printf("\n");
36896         }
36897     }
36898     }
36899     }
36900     function_tests++;
36901 
36902     return(test_ret);
36903 }
36904 
36905 
36906 static int
test_xmlStrncatNew(void)36907 test_xmlStrncatNew(void) {
36908     int test_ret = 0;
36909 
36910     int mem_base;
36911     xmlChar * ret_val;
36912     xmlChar * str1; /* first xmlChar string */
36913     int n_str1;
36914     xmlChar * str2; /* second xmlChar string */
36915     int n_str2;
36916     int len; /* the len of @str2 or < 0 */
36917     int n_len;
36918 
36919     for (n_str1 = 0;n_str1 < gen_nb_const_xmlChar_ptr;n_str1++) {
36920     for (n_str2 = 0;n_str2 < gen_nb_const_xmlChar_ptr;n_str2++) {
36921     for (n_len = 0;n_len < gen_nb_int;n_len++) {
36922         mem_base = xmlMemBlocks();
36923         str1 = gen_const_xmlChar_ptr(n_str1, 0);
36924         str2 = gen_const_xmlChar_ptr(n_str2, 1);
36925         len = gen_int(n_len, 2);
36926         if ((str2 != NULL) &&
36927             (len > (int) strlen((const char *) str2) + 1))
36928             continue;
36929 
36930         ret_val = xmlStrncatNew((const xmlChar *)str1, (const xmlChar *)str2, len);
36931         desret_xmlChar_ptr(ret_val);
36932         call_tests++;
36933         des_const_xmlChar_ptr(n_str1, (const xmlChar *)str1, 0);
36934         des_const_xmlChar_ptr(n_str2, (const xmlChar *)str2, 1);
36935         des_int(n_len, len, 2);
36936         xmlResetLastError();
36937         if (mem_base != xmlMemBlocks()) {
36938             printf("Leak of %d blocks found in xmlStrncatNew",
36939 	           xmlMemBlocks() - mem_base);
36940 	    test_ret++;
36941             printf(" %d", n_str1);
36942             printf(" %d", n_str2);
36943             printf(" %d", n_len);
36944             printf("\n");
36945         }
36946     }
36947     }
36948     }
36949     function_tests++;
36950 
36951     return(test_ret);
36952 }
36953 
36954 
36955 static int
test_xmlStrncmp(void)36956 test_xmlStrncmp(void) {
36957     int test_ret = 0;
36958 
36959     int mem_base;
36960     int ret_val;
36961     xmlChar * str1; /* the first xmlChar * */
36962     int n_str1;
36963     xmlChar * str2; /* the second xmlChar * */
36964     int n_str2;
36965     int len; /* the max comparison length */
36966     int n_len;
36967 
36968     for (n_str1 = 0;n_str1 < gen_nb_const_xmlChar_ptr;n_str1++) {
36969     for (n_str2 = 0;n_str2 < gen_nb_const_xmlChar_ptr;n_str2++) {
36970     for (n_len = 0;n_len < gen_nb_int;n_len++) {
36971         mem_base = xmlMemBlocks();
36972         str1 = gen_const_xmlChar_ptr(n_str1, 0);
36973         str2 = gen_const_xmlChar_ptr(n_str2, 1);
36974         len = gen_int(n_len, 2);
36975         if ((str2 != NULL) &&
36976             (len > (int) strlen((const char *) str2) + 1))
36977             continue;
36978 
36979         ret_val = xmlStrncmp((const xmlChar *)str1, (const xmlChar *)str2, len);
36980         desret_int(ret_val);
36981         call_tests++;
36982         des_const_xmlChar_ptr(n_str1, (const xmlChar *)str1, 0);
36983         des_const_xmlChar_ptr(n_str2, (const xmlChar *)str2, 1);
36984         des_int(n_len, len, 2);
36985         xmlResetLastError();
36986         if (mem_base != xmlMemBlocks()) {
36987             printf("Leak of %d blocks found in xmlStrncmp",
36988 	           xmlMemBlocks() - mem_base);
36989 	    test_ret++;
36990             printf(" %d", n_str1);
36991             printf(" %d", n_str2);
36992             printf(" %d", n_len);
36993             printf("\n");
36994         }
36995     }
36996     }
36997     }
36998     function_tests++;
36999 
37000     return(test_ret);
37001 }
37002 
37003 
37004 static int
test_xmlStrndup(void)37005 test_xmlStrndup(void) {
37006     int test_ret = 0;
37007 
37008     int mem_base;
37009     xmlChar * ret_val;
37010     xmlChar * cur; /* the input xmlChar * */
37011     int n_cur;
37012     int len; /* the len of @cur */
37013     int n_len;
37014 
37015     for (n_cur = 0;n_cur < gen_nb_const_xmlChar_ptr;n_cur++) {
37016     for (n_len = 0;n_len < gen_nb_int;n_len++) {
37017         mem_base = xmlMemBlocks();
37018         cur = gen_const_xmlChar_ptr(n_cur, 0);
37019         len = gen_int(n_len, 1);
37020         if ((cur != NULL) &&
37021             (len > (int) strlen((const char *) cur) + 1))
37022             continue;
37023 
37024         ret_val = xmlStrndup((const xmlChar *)cur, len);
37025         desret_xmlChar_ptr(ret_val);
37026         call_tests++;
37027         des_const_xmlChar_ptr(n_cur, (const xmlChar *)cur, 0);
37028         des_int(n_len, len, 1);
37029         xmlResetLastError();
37030         if (mem_base != xmlMemBlocks()) {
37031             printf("Leak of %d blocks found in xmlStrndup",
37032 	           xmlMemBlocks() - mem_base);
37033 	    test_ret++;
37034             printf(" %d", n_cur);
37035             printf(" %d", n_len);
37036             printf("\n");
37037         }
37038     }
37039     }
37040     function_tests++;
37041 
37042     return(test_ret);
37043 }
37044 
37045 
37046 static int
test_xmlStrstr(void)37047 test_xmlStrstr(void) {
37048     int test_ret = 0;
37049 
37050     int mem_base;
37051     const xmlChar * ret_val;
37052     xmlChar * str; /* the xmlChar * array (haystack) */
37053     int n_str;
37054     xmlChar * val; /* the xmlChar to search (needle) */
37055     int n_val;
37056 
37057     for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) {
37058     for (n_val = 0;n_val < gen_nb_const_xmlChar_ptr;n_val++) {
37059         mem_base = xmlMemBlocks();
37060         str = gen_const_xmlChar_ptr(n_str, 0);
37061         val = gen_const_xmlChar_ptr(n_val, 1);
37062 
37063         ret_val = xmlStrstr((const xmlChar *)str, (const xmlChar *)val);
37064         desret_const_xmlChar_ptr(ret_val);
37065         call_tests++;
37066         des_const_xmlChar_ptr(n_str, (const xmlChar *)str, 0);
37067         des_const_xmlChar_ptr(n_val, (const xmlChar *)val, 1);
37068         xmlResetLastError();
37069         if (mem_base != xmlMemBlocks()) {
37070             printf("Leak of %d blocks found in xmlStrstr",
37071 	           xmlMemBlocks() - mem_base);
37072 	    test_ret++;
37073             printf(" %d", n_str);
37074             printf(" %d", n_val);
37075             printf("\n");
37076         }
37077     }
37078     }
37079     function_tests++;
37080 
37081     return(test_ret);
37082 }
37083 
37084 
37085 static int
test_xmlStrsub(void)37086 test_xmlStrsub(void) {
37087     int test_ret = 0;
37088 
37089     int mem_base;
37090     xmlChar * ret_val;
37091     xmlChar * str; /* the xmlChar * array (haystack) */
37092     int n_str;
37093     int start; /* the index of the first char (zero based) */
37094     int n_start;
37095     int len; /* the length of the substring */
37096     int n_len;
37097 
37098     for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) {
37099     for (n_start = 0;n_start < gen_nb_int;n_start++) {
37100     for (n_len = 0;n_len < gen_nb_int;n_len++) {
37101         mem_base = xmlMemBlocks();
37102         str = gen_const_xmlChar_ptr(n_str, 0);
37103         start = gen_int(n_start, 1);
37104         len = gen_int(n_len, 2);
37105         if ((str != NULL) &&
37106             (start > (int) strlen((const char *) str) + 1))
37107             continue;
37108         if ((str != NULL) &&
37109             (len > (int) strlen((const char *) str) + 1))
37110             continue;
37111 
37112         ret_val = xmlStrsub((const xmlChar *)str, start, len);
37113         desret_xmlChar_ptr(ret_val);
37114         call_tests++;
37115         des_const_xmlChar_ptr(n_str, (const xmlChar *)str, 0);
37116         des_int(n_start, start, 1);
37117         des_int(n_len, len, 2);
37118         xmlResetLastError();
37119         if (mem_base != xmlMemBlocks()) {
37120             printf("Leak of %d blocks found in xmlStrsub",
37121 	           xmlMemBlocks() - mem_base);
37122 	    test_ret++;
37123             printf(" %d", n_str);
37124             printf(" %d", n_start);
37125             printf(" %d", n_len);
37126             printf("\n");
37127         }
37128     }
37129     }
37130     }
37131     function_tests++;
37132 
37133     return(test_ret);
37134 }
37135 
37136 
37137 static int
test_xmlUTF8Charcmp(void)37138 test_xmlUTF8Charcmp(void) {
37139     int test_ret = 0;
37140 
37141     int mem_base;
37142     int ret_val;
37143     xmlChar * utf1; /* pointer to first UTF8 char */
37144     int n_utf1;
37145     xmlChar * utf2; /* pointer to second UTF8 char */
37146     int n_utf2;
37147 
37148     for (n_utf1 = 0;n_utf1 < gen_nb_const_xmlChar_ptr;n_utf1++) {
37149     for (n_utf2 = 0;n_utf2 < gen_nb_const_xmlChar_ptr;n_utf2++) {
37150         mem_base = xmlMemBlocks();
37151         utf1 = gen_const_xmlChar_ptr(n_utf1, 0);
37152         utf2 = gen_const_xmlChar_ptr(n_utf2, 1);
37153 
37154         ret_val = xmlUTF8Charcmp((const xmlChar *)utf1, (const xmlChar *)utf2);
37155         desret_int(ret_val);
37156         call_tests++;
37157         des_const_xmlChar_ptr(n_utf1, (const xmlChar *)utf1, 0);
37158         des_const_xmlChar_ptr(n_utf2, (const xmlChar *)utf2, 1);
37159         xmlResetLastError();
37160         if (mem_base != xmlMemBlocks()) {
37161             printf("Leak of %d blocks found in xmlUTF8Charcmp",
37162 	           xmlMemBlocks() - mem_base);
37163 	    test_ret++;
37164             printf(" %d", n_utf1);
37165             printf(" %d", n_utf2);
37166             printf("\n");
37167         }
37168     }
37169     }
37170     function_tests++;
37171 
37172     return(test_ret);
37173 }
37174 
37175 
37176 static int
test_xmlUTF8Size(void)37177 test_xmlUTF8Size(void) {
37178     int test_ret = 0;
37179 
37180     int mem_base;
37181     int ret_val;
37182     xmlChar * utf; /* pointer to the UTF8 character */
37183     int n_utf;
37184 
37185     for (n_utf = 0;n_utf < gen_nb_const_xmlChar_ptr;n_utf++) {
37186         mem_base = xmlMemBlocks();
37187         utf = gen_const_xmlChar_ptr(n_utf, 0);
37188 
37189         ret_val = xmlUTF8Size((const xmlChar *)utf);
37190         desret_int(ret_val);
37191         call_tests++;
37192         des_const_xmlChar_ptr(n_utf, (const xmlChar *)utf, 0);
37193         xmlResetLastError();
37194         if (mem_base != xmlMemBlocks()) {
37195             printf("Leak of %d blocks found in xmlUTF8Size",
37196 	           xmlMemBlocks() - mem_base);
37197 	    test_ret++;
37198             printf(" %d", n_utf);
37199             printf("\n");
37200         }
37201     }
37202     function_tests++;
37203 
37204     return(test_ret);
37205 }
37206 
37207 
37208 static int
test_xmlUTF8Strlen(void)37209 test_xmlUTF8Strlen(void) {
37210     int test_ret = 0;
37211 
37212     int mem_base;
37213     int ret_val;
37214     xmlChar * utf; /* a sequence of UTF-8 encoded bytes */
37215     int n_utf;
37216 
37217     for (n_utf = 0;n_utf < gen_nb_const_xmlChar_ptr;n_utf++) {
37218         mem_base = xmlMemBlocks();
37219         utf = gen_const_xmlChar_ptr(n_utf, 0);
37220 
37221         ret_val = xmlUTF8Strlen((const xmlChar *)utf);
37222         desret_int(ret_val);
37223         call_tests++;
37224         des_const_xmlChar_ptr(n_utf, (const xmlChar *)utf, 0);
37225         xmlResetLastError();
37226         if (mem_base != xmlMemBlocks()) {
37227             printf("Leak of %d blocks found in xmlUTF8Strlen",
37228 	           xmlMemBlocks() - mem_base);
37229 	    test_ret++;
37230             printf(" %d", n_utf);
37231             printf("\n");
37232         }
37233     }
37234     function_tests++;
37235 
37236     return(test_ret);
37237 }
37238 
37239 
37240 static int
test_xmlUTF8Strloc(void)37241 test_xmlUTF8Strloc(void) {
37242     int test_ret = 0;
37243 
37244     int mem_base;
37245     int ret_val;
37246     xmlChar * utf; /* the input UTF8 * */
37247     int n_utf;
37248     xmlChar * utfchar; /* the UTF8 character to be found */
37249     int n_utfchar;
37250 
37251     for (n_utf = 0;n_utf < gen_nb_const_xmlChar_ptr;n_utf++) {
37252     for (n_utfchar = 0;n_utfchar < gen_nb_const_xmlChar_ptr;n_utfchar++) {
37253         mem_base = xmlMemBlocks();
37254         utf = gen_const_xmlChar_ptr(n_utf, 0);
37255         utfchar = gen_const_xmlChar_ptr(n_utfchar, 1);
37256 
37257         ret_val = xmlUTF8Strloc((const xmlChar *)utf, (const xmlChar *)utfchar);
37258         desret_int(ret_val);
37259         call_tests++;
37260         des_const_xmlChar_ptr(n_utf, (const xmlChar *)utf, 0);
37261         des_const_xmlChar_ptr(n_utfchar, (const xmlChar *)utfchar, 1);
37262         xmlResetLastError();
37263         if (mem_base != xmlMemBlocks()) {
37264             printf("Leak of %d blocks found in xmlUTF8Strloc",
37265 	           xmlMemBlocks() - mem_base);
37266 	    test_ret++;
37267             printf(" %d", n_utf);
37268             printf(" %d", n_utfchar);
37269             printf("\n");
37270         }
37271     }
37272     }
37273     function_tests++;
37274 
37275     return(test_ret);
37276 }
37277 
37278 
37279 static int
test_xmlUTF8Strndup(void)37280 test_xmlUTF8Strndup(void) {
37281     int test_ret = 0;
37282 
37283     int mem_base;
37284     xmlChar * ret_val;
37285     xmlChar * utf; /* the input UTF8 * */
37286     int n_utf;
37287     int len; /* the len of @utf (in chars) */
37288     int n_len;
37289 
37290     for (n_utf = 0;n_utf < gen_nb_const_xmlChar_ptr;n_utf++) {
37291     for (n_len = 0;n_len < gen_nb_int;n_len++) {
37292         mem_base = xmlMemBlocks();
37293         utf = gen_const_xmlChar_ptr(n_utf, 0);
37294         len = gen_int(n_len, 1);
37295         if ((utf != NULL) &&
37296             (len > (int) strlen((const char *) utf) + 1))
37297             continue;
37298 
37299         ret_val = xmlUTF8Strndup((const xmlChar *)utf, len);
37300         desret_xmlChar_ptr(ret_val);
37301         call_tests++;
37302         des_const_xmlChar_ptr(n_utf, (const xmlChar *)utf, 0);
37303         des_int(n_len, len, 1);
37304         xmlResetLastError();
37305         if (mem_base != xmlMemBlocks()) {
37306             printf("Leak of %d blocks found in xmlUTF8Strndup",
37307 	           xmlMemBlocks() - mem_base);
37308 	    test_ret++;
37309             printf(" %d", n_utf);
37310             printf(" %d", n_len);
37311             printf("\n");
37312         }
37313     }
37314     }
37315     function_tests++;
37316 
37317     return(test_ret);
37318 }
37319 
37320 
37321 static int
test_xmlUTF8Strpos(void)37322 test_xmlUTF8Strpos(void) {
37323     int test_ret = 0;
37324 
37325     int mem_base;
37326     const xmlChar * ret_val;
37327     xmlChar * utf; /* the input UTF8 * */
37328     int n_utf;
37329     int pos; /* the position of the desired UTF8 char (in chars) */
37330     int n_pos;
37331 
37332     for (n_utf = 0;n_utf < gen_nb_const_xmlChar_ptr;n_utf++) {
37333     for (n_pos = 0;n_pos < gen_nb_int;n_pos++) {
37334         mem_base = xmlMemBlocks();
37335         utf = gen_const_xmlChar_ptr(n_utf, 0);
37336         pos = gen_int(n_pos, 1);
37337 
37338         ret_val = xmlUTF8Strpos((const xmlChar *)utf, pos);
37339         desret_const_xmlChar_ptr(ret_val);
37340         call_tests++;
37341         des_const_xmlChar_ptr(n_utf, (const xmlChar *)utf, 0);
37342         des_int(n_pos, pos, 1);
37343         xmlResetLastError();
37344         if (mem_base != xmlMemBlocks()) {
37345             printf("Leak of %d blocks found in xmlUTF8Strpos",
37346 	           xmlMemBlocks() - mem_base);
37347 	    test_ret++;
37348             printf(" %d", n_utf);
37349             printf(" %d", n_pos);
37350             printf("\n");
37351         }
37352     }
37353     }
37354     function_tests++;
37355 
37356     return(test_ret);
37357 }
37358 
37359 
37360 static int
test_xmlUTF8Strsize(void)37361 test_xmlUTF8Strsize(void) {
37362     int test_ret = 0;
37363 
37364     int mem_base;
37365     int ret_val;
37366     xmlChar * utf; /* a sequence of UTF-8 encoded bytes */
37367     int n_utf;
37368     int len; /* the number of characters in the array */
37369     int n_len;
37370 
37371     for (n_utf = 0;n_utf < gen_nb_const_xmlChar_ptr;n_utf++) {
37372     for (n_len = 0;n_len < gen_nb_int;n_len++) {
37373         mem_base = xmlMemBlocks();
37374         utf = gen_const_xmlChar_ptr(n_utf, 0);
37375         len = gen_int(n_len, 1);
37376         if ((utf != NULL) &&
37377             (len > (int) strlen((const char *) utf) + 1))
37378             continue;
37379 
37380         ret_val = xmlUTF8Strsize((const xmlChar *)utf, len);
37381         desret_int(ret_val);
37382         call_tests++;
37383         des_const_xmlChar_ptr(n_utf, (const xmlChar *)utf, 0);
37384         des_int(n_len, len, 1);
37385         xmlResetLastError();
37386         if (mem_base != xmlMemBlocks()) {
37387             printf("Leak of %d blocks found in xmlUTF8Strsize",
37388 	           xmlMemBlocks() - mem_base);
37389 	    test_ret++;
37390             printf(" %d", n_utf);
37391             printf(" %d", n_len);
37392             printf("\n");
37393         }
37394     }
37395     }
37396     function_tests++;
37397 
37398     return(test_ret);
37399 }
37400 
37401 
37402 static int
test_xmlUTF8Strsub(void)37403 test_xmlUTF8Strsub(void) {
37404     int test_ret = 0;
37405 
37406     int mem_base;
37407     xmlChar * ret_val;
37408     xmlChar * utf; /* a sequence of UTF-8 encoded bytes */
37409     int n_utf;
37410     int start; /* relative pos of first char */
37411     int n_start;
37412     int len; /* total number to copy */
37413     int n_len;
37414 
37415     for (n_utf = 0;n_utf < gen_nb_const_xmlChar_ptr;n_utf++) {
37416     for (n_start = 0;n_start < gen_nb_int;n_start++) {
37417     for (n_len = 0;n_len < gen_nb_int;n_len++) {
37418         mem_base = xmlMemBlocks();
37419         utf = gen_const_xmlChar_ptr(n_utf, 0);
37420         start = gen_int(n_start, 1);
37421         len = gen_int(n_len, 2);
37422         if ((utf != NULL) &&
37423             (start > (int) strlen((const char *) utf) + 1))
37424             continue;
37425         if ((utf != NULL) &&
37426             (len > (int) strlen((const char *) utf) + 1))
37427             continue;
37428 
37429         ret_val = xmlUTF8Strsub((const xmlChar *)utf, start, len);
37430         desret_xmlChar_ptr(ret_val);
37431         call_tests++;
37432         des_const_xmlChar_ptr(n_utf, (const xmlChar *)utf, 0);
37433         des_int(n_start, start, 1);
37434         des_int(n_len, len, 2);
37435         xmlResetLastError();
37436         if (mem_base != xmlMemBlocks()) {
37437             printf("Leak of %d blocks found in xmlUTF8Strsub",
37438 	           xmlMemBlocks() - mem_base);
37439 	    test_ret++;
37440             printf(" %d", n_utf);
37441             printf(" %d", n_start);
37442             printf(" %d", n_len);
37443             printf("\n");
37444         }
37445     }
37446     }
37447     }
37448     function_tests++;
37449 
37450     return(test_ret);
37451 }
37452 
37453 static int
test_xmlstring(void)37454 test_xmlstring(void) {
37455     int test_ret = 0;
37456 
37457     if (quiet == 0) printf("Testing xmlstring : 26 of 30 functions ...\n");
37458     test_ret += test_xmlCharStrdup();
37459     test_ret += test_xmlCharStrndup();
37460     test_ret += test_xmlCheckUTF8();
37461     test_ret += test_xmlGetUTF8Char();
37462     test_ret += test_xmlStrEqual();
37463     test_ret += test_xmlStrPrintf();
37464     test_ret += test_xmlStrQEqual();
37465     test_ret += test_xmlStrVPrintf();
37466     test_ret += test_xmlStrcasecmp();
37467     test_ret += test_xmlStrcasestr();
37468     test_ret += test_xmlStrchr();
37469     test_ret += test_xmlStrcmp();
37470     test_ret += test_xmlStrdup();
37471     test_ret += test_xmlStrlen();
37472     test_ret += test_xmlStrncasecmp();
37473     test_ret += test_xmlStrncatNew();
37474     test_ret += test_xmlStrncmp();
37475     test_ret += test_xmlStrndup();
37476     test_ret += test_xmlStrstr();
37477     test_ret += test_xmlStrsub();
37478     test_ret += test_xmlUTF8Charcmp();
37479     test_ret += test_xmlUTF8Size();
37480     test_ret += test_xmlUTF8Strlen();
37481     test_ret += test_xmlUTF8Strloc();
37482     test_ret += test_xmlUTF8Strndup();
37483     test_ret += test_xmlUTF8Strpos();
37484     test_ret += test_xmlUTF8Strsize();
37485     test_ret += test_xmlUTF8Strsub();
37486 
37487     if (test_ret != 0)
37488 	printf("Module xmlstring: %d errors\n", test_ret);
37489     return(test_ret);
37490 }
37491 
37492 static int
test_xmlUCSIsAegeanNumbers(void)37493 test_xmlUCSIsAegeanNumbers(void) {
37494     int test_ret = 0;
37495 
37496 #if defined(LIBXML_UNICODE_ENABLED)
37497     int mem_base;
37498     int ret_val;
37499     int code; /* UCS code point */
37500     int n_code;
37501 
37502     for (n_code = 0;n_code < gen_nb_int;n_code++) {
37503         mem_base = xmlMemBlocks();
37504         code = gen_int(n_code, 0);
37505 
37506         ret_val = xmlUCSIsAegeanNumbers(code);
37507         desret_int(ret_val);
37508         call_tests++;
37509         des_int(n_code, code, 0);
37510         xmlResetLastError();
37511         if (mem_base != xmlMemBlocks()) {
37512             printf("Leak of %d blocks found in xmlUCSIsAegeanNumbers",
37513 	           xmlMemBlocks() - mem_base);
37514 	    test_ret++;
37515             printf(" %d", n_code);
37516             printf("\n");
37517         }
37518     }
37519     function_tests++;
37520 #endif
37521 
37522     return(test_ret);
37523 }
37524 
37525 
37526 static int
test_xmlUCSIsAlphabeticPresentationForms(void)37527 test_xmlUCSIsAlphabeticPresentationForms(void) {
37528     int test_ret = 0;
37529 
37530 #if defined(LIBXML_UNICODE_ENABLED)
37531     int mem_base;
37532     int ret_val;
37533     int code; /* UCS code point */
37534     int n_code;
37535 
37536     for (n_code = 0;n_code < gen_nb_int;n_code++) {
37537         mem_base = xmlMemBlocks();
37538         code = gen_int(n_code, 0);
37539 
37540         ret_val = xmlUCSIsAlphabeticPresentationForms(code);
37541         desret_int(ret_val);
37542         call_tests++;
37543         des_int(n_code, code, 0);
37544         xmlResetLastError();
37545         if (mem_base != xmlMemBlocks()) {
37546             printf("Leak of %d blocks found in xmlUCSIsAlphabeticPresentationForms",
37547 	           xmlMemBlocks() - mem_base);
37548 	    test_ret++;
37549             printf(" %d", n_code);
37550             printf("\n");
37551         }
37552     }
37553     function_tests++;
37554 #endif
37555 
37556     return(test_ret);
37557 }
37558 
37559 
37560 static int
test_xmlUCSIsArabic(void)37561 test_xmlUCSIsArabic(void) {
37562     int test_ret = 0;
37563 
37564 #if defined(LIBXML_UNICODE_ENABLED)
37565     int mem_base;
37566     int ret_val;
37567     int code; /* UCS code point */
37568     int n_code;
37569 
37570     for (n_code = 0;n_code < gen_nb_int;n_code++) {
37571         mem_base = xmlMemBlocks();
37572         code = gen_int(n_code, 0);
37573 
37574         ret_val = xmlUCSIsArabic(code);
37575         desret_int(ret_val);
37576         call_tests++;
37577         des_int(n_code, code, 0);
37578         xmlResetLastError();
37579         if (mem_base != xmlMemBlocks()) {
37580             printf("Leak of %d blocks found in xmlUCSIsArabic",
37581 	           xmlMemBlocks() - mem_base);
37582 	    test_ret++;
37583             printf(" %d", n_code);
37584             printf("\n");
37585         }
37586     }
37587     function_tests++;
37588 #endif
37589 
37590     return(test_ret);
37591 }
37592 
37593 
37594 static int
test_xmlUCSIsArabicPresentationFormsA(void)37595 test_xmlUCSIsArabicPresentationFormsA(void) {
37596     int test_ret = 0;
37597 
37598 #if defined(LIBXML_UNICODE_ENABLED)
37599     int mem_base;
37600     int ret_val;
37601     int code; /* UCS code point */
37602     int n_code;
37603 
37604     for (n_code = 0;n_code < gen_nb_int;n_code++) {
37605         mem_base = xmlMemBlocks();
37606         code = gen_int(n_code, 0);
37607 
37608         ret_val = xmlUCSIsArabicPresentationFormsA(code);
37609         desret_int(ret_val);
37610         call_tests++;
37611         des_int(n_code, code, 0);
37612         xmlResetLastError();
37613         if (mem_base != xmlMemBlocks()) {
37614             printf("Leak of %d blocks found in xmlUCSIsArabicPresentationFormsA",
37615 	           xmlMemBlocks() - mem_base);
37616 	    test_ret++;
37617             printf(" %d", n_code);
37618             printf("\n");
37619         }
37620     }
37621     function_tests++;
37622 #endif
37623 
37624     return(test_ret);
37625 }
37626 
37627 
37628 static int
test_xmlUCSIsArabicPresentationFormsB(void)37629 test_xmlUCSIsArabicPresentationFormsB(void) {
37630     int test_ret = 0;
37631 
37632 #if defined(LIBXML_UNICODE_ENABLED)
37633     int mem_base;
37634     int ret_val;
37635     int code; /* UCS code point */
37636     int n_code;
37637 
37638     for (n_code = 0;n_code < gen_nb_int;n_code++) {
37639         mem_base = xmlMemBlocks();
37640         code = gen_int(n_code, 0);
37641 
37642         ret_val = xmlUCSIsArabicPresentationFormsB(code);
37643         desret_int(ret_val);
37644         call_tests++;
37645         des_int(n_code, code, 0);
37646         xmlResetLastError();
37647         if (mem_base != xmlMemBlocks()) {
37648             printf("Leak of %d blocks found in xmlUCSIsArabicPresentationFormsB",
37649 	           xmlMemBlocks() - mem_base);
37650 	    test_ret++;
37651             printf(" %d", n_code);
37652             printf("\n");
37653         }
37654     }
37655     function_tests++;
37656 #endif
37657 
37658     return(test_ret);
37659 }
37660 
37661 
37662 static int
test_xmlUCSIsArmenian(void)37663 test_xmlUCSIsArmenian(void) {
37664     int test_ret = 0;
37665 
37666 #if defined(LIBXML_UNICODE_ENABLED)
37667     int mem_base;
37668     int ret_val;
37669     int code; /* UCS code point */
37670     int n_code;
37671 
37672     for (n_code = 0;n_code < gen_nb_int;n_code++) {
37673         mem_base = xmlMemBlocks();
37674         code = gen_int(n_code, 0);
37675 
37676         ret_val = xmlUCSIsArmenian(code);
37677         desret_int(ret_val);
37678         call_tests++;
37679         des_int(n_code, code, 0);
37680         xmlResetLastError();
37681         if (mem_base != xmlMemBlocks()) {
37682             printf("Leak of %d blocks found in xmlUCSIsArmenian",
37683 	           xmlMemBlocks() - mem_base);
37684 	    test_ret++;
37685             printf(" %d", n_code);
37686             printf("\n");
37687         }
37688     }
37689     function_tests++;
37690 #endif
37691 
37692     return(test_ret);
37693 }
37694 
37695 
37696 static int
test_xmlUCSIsArrows(void)37697 test_xmlUCSIsArrows(void) {
37698     int test_ret = 0;
37699 
37700 #if defined(LIBXML_UNICODE_ENABLED)
37701     int mem_base;
37702     int ret_val;
37703     int code; /* UCS code point */
37704     int n_code;
37705 
37706     for (n_code = 0;n_code < gen_nb_int;n_code++) {
37707         mem_base = xmlMemBlocks();
37708         code = gen_int(n_code, 0);
37709 
37710         ret_val = xmlUCSIsArrows(code);
37711         desret_int(ret_val);
37712         call_tests++;
37713         des_int(n_code, code, 0);
37714         xmlResetLastError();
37715         if (mem_base != xmlMemBlocks()) {
37716             printf("Leak of %d blocks found in xmlUCSIsArrows",
37717 	           xmlMemBlocks() - mem_base);
37718 	    test_ret++;
37719             printf(" %d", n_code);
37720             printf("\n");
37721         }
37722     }
37723     function_tests++;
37724 #endif
37725 
37726     return(test_ret);
37727 }
37728 
37729 
37730 static int
test_xmlUCSIsBasicLatin(void)37731 test_xmlUCSIsBasicLatin(void) {
37732     int test_ret = 0;
37733 
37734 #if defined(LIBXML_UNICODE_ENABLED)
37735     int mem_base;
37736     int ret_val;
37737     int code; /* UCS code point */
37738     int n_code;
37739 
37740     for (n_code = 0;n_code < gen_nb_int;n_code++) {
37741         mem_base = xmlMemBlocks();
37742         code = gen_int(n_code, 0);
37743 
37744         ret_val = xmlUCSIsBasicLatin(code);
37745         desret_int(ret_val);
37746         call_tests++;
37747         des_int(n_code, code, 0);
37748         xmlResetLastError();
37749         if (mem_base != xmlMemBlocks()) {
37750             printf("Leak of %d blocks found in xmlUCSIsBasicLatin",
37751 	           xmlMemBlocks() - mem_base);
37752 	    test_ret++;
37753             printf(" %d", n_code);
37754             printf("\n");
37755         }
37756     }
37757     function_tests++;
37758 #endif
37759 
37760     return(test_ret);
37761 }
37762 
37763 
37764 static int
test_xmlUCSIsBengali(void)37765 test_xmlUCSIsBengali(void) {
37766     int test_ret = 0;
37767 
37768 #if defined(LIBXML_UNICODE_ENABLED)
37769     int mem_base;
37770     int ret_val;
37771     int code; /* UCS code point */
37772     int n_code;
37773 
37774     for (n_code = 0;n_code < gen_nb_int;n_code++) {
37775         mem_base = xmlMemBlocks();
37776         code = gen_int(n_code, 0);
37777 
37778         ret_val = xmlUCSIsBengali(code);
37779         desret_int(ret_val);
37780         call_tests++;
37781         des_int(n_code, code, 0);
37782         xmlResetLastError();
37783         if (mem_base != xmlMemBlocks()) {
37784             printf("Leak of %d blocks found in xmlUCSIsBengali",
37785 	           xmlMemBlocks() - mem_base);
37786 	    test_ret++;
37787             printf(" %d", n_code);
37788             printf("\n");
37789         }
37790     }
37791     function_tests++;
37792 #endif
37793 
37794     return(test_ret);
37795 }
37796 
37797 
37798 static int
test_xmlUCSIsBlock(void)37799 test_xmlUCSIsBlock(void) {
37800     int test_ret = 0;
37801 
37802 #if defined(LIBXML_UNICODE_ENABLED)
37803     int mem_base;
37804     int ret_val;
37805     int code; /* UCS code point */
37806     int n_code;
37807     char * block; /* UCS block name */
37808     int n_block;
37809 
37810     for (n_code = 0;n_code < gen_nb_int;n_code++) {
37811     for (n_block = 0;n_block < gen_nb_const_char_ptr;n_block++) {
37812         mem_base = xmlMemBlocks();
37813         code = gen_int(n_code, 0);
37814         block = gen_const_char_ptr(n_block, 1);
37815 
37816         ret_val = xmlUCSIsBlock(code, (const char *)block);
37817         desret_int(ret_val);
37818         call_tests++;
37819         des_int(n_code, code, 0);
37820         des_const_char_ptr(n_block, (const char *)block, 1);
37821         xmlResetLastError();
37822         if (mem_base != xmlMemBlocks()) {
37823             printf("Leak of %d blocks found in xmlUCSIsBlock",
37824 	           xmlMemBlocks() - mem_base);
37825 	    test_ret++;
37826             printf(" %d", n_code);
37827             printf(" %d", n_block);
37828             printf("\n");
37829         }
37830     }
37831     }
37832     function_tests++;
37833 #endif
37834 
37835     return(test_ret);
37836 }
37837 
37838 
37839 static int
test_xmlUCSIsBlockElements(void)37840 test_xmlUCSIsBlockElements(void) {
37841     int test_ret = 0;
37842 
37843 #if defined(LIBXML_UNICODE_ENABLED)
37844     int mem_base;
37845     int ret_val;
37846     int code; /* UCS code point */
37847     int n_code;
37848 
37849     for (n_code = 0;n_code < gen_nb_int;n_code++) {
37850         mem_base = xmlMemBlocks();
37851         code = gen_int(n_code, 0);
37852 
37853         ret_val = xmlUCSIsBlockElements(code);
37854         desret_int(ret_val);
37855         call_tests++;
37856         des_int(n_code, code, 0);
37857         xmlResetLastError();
37858         if (mem_base != xmlMemBlocks()) {
37859             printf("Leak of %d blocks found in xmlUCSIsBlockElements",
37860 	           xmlMemBlocks() - mem_base);
37861 	    test_ret++;
37862             printf(" %d", n_code);
37863             printf("\n");
37864         }
37865     }
37866     function_tests++;
37867 #endif
37868 
37869     return(test_ret);
37870 }
37871 
37872 
37873 static int
test_xmlUCSIsBopomofo(void)37874 test_xmlUCSIsBopomofo(void) {
37875     int test_ret = 0;
37876 
37877 #if defined(LIBXML_UNICODE_ENABLED)
37878     int mem_base;
37879     int ret_val;
37880     int code; /* UCS code point */
37881     int n_code;
37882 
37883     for (n_code = 0;n_code < gen_nb_int;n_code++) {
37884         mem_base = xmlMemBlocks();
37885         code = gen_int(n_code, 0);
37886 
37887         ret_val = xmlUCSIsBopomofo(code);
37888         desret_int(ret_val);
37889         call_tests++;
37890         des_int(n_code, code, 0);
37891         xmlResetLastError();
37892         if (mem_base != xmlMemBlocks()) {
37893             printf("Leak of %d blocks found in xmlUCSIsBopomofo",
37894 	           xmlMemBlocks() - mem_base);
37895 	    test_ret++;
37896             printf(" %d", n_code);
37897             printf("\n");
37898         }
37899     }
37900     function_tests++;
37901 #endif
37902 
37903     return(test_ret);
37904 }
37905 
37906 
37907 static int
test_xmlUCSIsBopomofoExtended(void)37908 test_xmlUCSIsBopomofoExtended(void) {
37909     int test_ret = 0;
37910 
37911 #if defined(LIBXML_UNICODE_ENABLED)
37912     int mem_base;
37913     int ret_val;
37914     int code; /* UCS code point */
37915     int n_code;
37916 
37917     for (n_code = 0;n_code < gen_nb_int;n_code++) {
37918         mem_base = xmlMemBlocks();
37919         code = gen_int(n_code, 0);
37920 
37921         ret_val = xmlUCSIsBopomofoExtended(code);
37922         desret_int(ret_val);
37923         call_tests++;
37924         des_int(n_code, code, 0);
37925         xmlResetLastError();
37926         if (mem_base != xmlMemBlocks()) {
37927             printf("Leak of %d blocks found in xmlUCSIsBopomofoExtended",
37928 	           xmlMemBlocks() - mem_base);
37929 	    test_ret++;
37930             printf(" %d", n_code);
37931             printf("\n");
37932         }
37933     }
37934     function_tests++;
37935 #endif
37936 
37937     return(test_ret);
37938 }
37939 
37940 
37941 static int
test_xmlUCSIsBoxDrawing(void)37942 test_xmlUCSIsBoxDrawing(void) {
37943     int test_ret = 0;
37944 
37945 #if defined(LIBXML_UNICODE_ENABLED)
37946     int mem_base;
37947     int ret_val;
37948     int code; /* UCS code point */
37949     int n_code;
37950 
37951     for (n_code = 0;n_code < gen_nb_int;n_code++) {
37952         mem_base = xmlMemBlocks();
37953         code = gen_int(n_code, 0);
37954 
37955         ret_val = xmlUCSIsBoxDrawing(code);
37956         desret_int(ret_val);
37957         call_tests++;
37958         des_int(n_code, code, 0);
37959         xmlResetLastError();
37960         if (mem_base != xmlMemBlocks()) {
37961             printf("Leak of %d blocks found in xmlUCSIsBoxDrawing",
37962 	           xmlMemBlocks() - mem_base);
37963 	    test_ret++;
37964             printf(" %d", n_code);
37965             printf("\n");
37966         }
37967     }
37968     function_tests++;
37969 #endif
37970 
37971     return(test_ret);
37972 }
37973 
37974 
37975 static int
test_xmlUCSIsBraillePatterns(void)37976 test_xmlUCSIsBraillePatterns(void) {
37977     int test_ret = 0;
37978 
37979 #if defined(LIBXML_UNICODE_ENABLED)
37980     int mem_base;
37981     int ret_val;
37982     int code; /* UCS code point */
37983     int n_code;
37984 
37985     for (n_code = 0;n_code < gen_nb_int;n_code++) {
37986         mem_base = xmlMemBlocks();
37987         code = gen_int(n_code, 0);
37988 
37989         ret_val = xmlUCSIsBraillePatterns(code);
37990         desret_int(ret_val);
37991         call_tests++;
37992         des_int(n_code, code, 0);
37993         xmlResetLastError();
37994         if (mem_base != xmlMemBlocks()) {
37995             printf("Leak of %d blocks found in xmlUCSIsBraillePatterns",
37996 	           xmlMemBlocks() - mem_base);
37997 	    test_ret++;
37998             printf(" %d", n_code);
37999             printf("\n");
38000         }
38001     }
38002     function_tests++;
38003 #endif
38004 
38005     return(test_ret);
38006 }
38007 
38008 
38009 static int
test_xmlUCSIsBuhid(void)38010 test_xmlUCSIsBuhid(void) {
38011     int test_ret = 0;
38012 
38013 #if defined(LIBXML_UNICODE_ENABLED)
38014     int mem_base;
38015     int ret_val;
38016     int code; /* UCS code point */
38017     int n_code;
38018 
38019     for (n_code = 0;n_code < gen_nb_int;n_code++) {
38020         mem_base = xmlMemBlocks();
38021         code = gen_int(n_code, 0);
38022 
38023         ret_val = xmlUCSIsBuhid(code);
38024         desret_int(ret_val);
38025         call_tests++;
38026         des_int(n_code, code, 0);
38027         xmlResetLastError();
38028         if (mem_base != xmlMemBlocks()) {
38029             printf("Leak of %d blocks found in xmlUCSIsBuhid",
38030 	           xmlMemBlocks() - mem_base);
38031 	    test_ret++;
38032             printf(" %d", n_code);
38033             printf("\n");
38034         }
38035     }
38036     function_tests++;
38037 #endif
38038 
38039     return(test_ret);
38040 }
38041 
38042 
38043 static int
test_xmlUCSIsByzantineMusicalSymbols(void)38044 test_xmlUCSIsByzantineMusicalSymbols(void) {
38045     int test_ret = 0;
38046 
38047 #if defined(LIBXML_UNICODE_ENABLED)
38048     int mem_base;
38049     int ret_val;
38050     int code; /* UCS code point */
38051     int n_code;
38052 
38053     for (n_code = 0;n_code < gen_nb_int;n_code++) {
38054         mem_base = xmlMemBlocks();
38055         code = gen_int(n_code, 0);
38056 
38057         ret_val = xmlUCSIsByzantineMusicalSymbols(code);
38058         desret_int(ret_val);
38059         call_tests++;
38060         des_int(n_code, code, 0);
38061         xmlResetLastError();
38062         if (mem_base != xmlMemBlocks()) {
38063             printf("Leak of %d blocks found in xmlUCSIsByzantineMusicalSymbols",
38064 	           xmlMemBlocks() - mem_base);
38065 	    test_ret++;
38066             printf(" %d", n_code);
38067             printf("\n");
38068         }
38069     }
38070     function_tests++;
38071 #endif
38072 
38073     return(test_ret);
38074 }
38075 
38076 
38077 static int
test_xmlUCSIsCJKCompatibility(void)38078 test_xmlUCSIsCJKCompatibility(void) {
38079     int test_ret = 0;
38080 
38081 #if defined(LIBXML_UNICODE_ENABLED)
38082     int mem_base;
38083     int ret_val;
38084     int code; /* UCS code point */
38085     int n_code;
38086 
38087     for (n_code = 0;n_code < gen_nb_int;n_code++) {
38088         mem_base = xmlMemBlocks();
38089         code = gen_int(n_code, 0);
38090 
38091         ret_val = xmlUCSIsCJKCompatibility(code);
38092         desret_int(ret_val);
38093         call_tests++;
38094         des_int(n_code, code, 0);
38095         xmlResetLastError();
38096         if (mem_base != xmlMemBlocks()) {
38097             printf("Leak of %d blocks found in xmlUCSIsCJKCompatibility",
38098 	           xmlMemBlocks() - mem_base);
38099 	    test_ret++;
38100             printf(" %d", n_code);
38101             printf("\n");
38102         }
38103     }
38104     function_tests++;
38105 #endif
38106 
38107     return(test_ret);
38108 }
38109 
38110 
38111 static int
test_xmlUCSIsCJKCompatibilityForms(void)38112 test_xmlUCSIsCJKCompatibilityForms(void) {
38113     int test_ret = 0;
38114 
38115 #if defined(LIBXML_UNICODE_ENABLED)
38116     int mem_base;
38117     int ret_val;
38118     int code; /* UCS code point */
38119     int n_code;
38120 
38121     for (n_code = 0;n_code < gen_nb_int;n_code++) {
38122         mem_base = xmlMemBlocks();
38123         code = gen_int(n_code, 0);
38124 
38125         ret_val = xmlUCSIsCJKCompatibilityForms(code);
38126         desret_int(ret_val);
38127         call_tests++;
38128         des_int(n_code, code, 0);
38129         xmlResetLastError();
38130         if (mem_base != xmlMemBlocks()) {
38131             printf("Leak of %d blocks found in xmlUCSIsCJKCompatibilityForms",
38132 	           xmlMemBlocks() - mem_base);
38133 	    test_ret++;
38134             printf(" %d", n_code);
38135             printf("\n");
38136         }
38137     }
38138     function_tests++;
38139 #endif
38140 
38141     return(test_ret);
38142 }
38143 
38144 
38145 static int
test_xmlUCSIsCJKCompatibilityIdeographs(void)38146 test_xmlUCSIsCJKCompatibilityIdeographs(void) {
38147     int test_ret = 0;
38148 
38149 #if defined(LIBXML_UNICODE_ENABLED)
38150     int mem_base;
38151     int ret_val;
38152     int code; /* UCS code point */
38153     int n_code;
38154 
38155     for (n_code = 0;n_code < gen_nb_int;n_code++) {
38156         mem_base = xmlMemBlocks();
38157         code = gen_int(n_code, 0);
38158 
38159         ret_val = xmlUCSIsCJKCompatibilityIdeographs(code);
38160         desret_int(ret_val);
38161         call_tests++;
38162         des_int(n_code, code, 0);
38163         xmlResetLastError();
38164         if (mem_base != xmlMemBlocks()) {
38165             printf("Leak of %d blocks found in xmlUCSIsCJKCompatibilityIdeographs",
38166 	           xmlMemBlocks() - mem_base);
38167 	    test_ret++;
38168             printf(" %d", n_code);
38169             printf("\n");
38170         }
38171     }
38172     function_tests++;
38173 #endif
38174 
38175     return(test_ret);
38176 }
38177 
38178 
38179 static int
test_xmlUCSIsCJKCompatibilityIdeographsSupplement(void)38180 test_xmlUCSIsCJKCompatibilityIdeographsSupplement(void) {
38181     int test_ret = 0;
38182 
38183 #if defined(LIBXML_UNICODE_ENABLED)
38184     int mem_base;
38185     int ret_val;
38186     int code; /* UCS code point */
38187     int n_code;
38188 
38189     for (n_code = 0;n_code < gen_nb_int;n_code++) {
38190         mem_base = xmlMemBlocks();
38191         code = gen_int(n_code, 0);
38192 
38193         ret_val = xmlUCSIsCJKCompatibilityIdeographsSupplement(code);
38194         desret_int(ret_val);
38195         call_tests++;
38196         des_int(n_code, code, 0);
38197         xmlResetLastError();
38198         if (mem_base != xmlMemBlocks()) {
38199             printf("Leak of %d blocks found in xmlUCSIsCJKCompatibilityIdeographsSupplement",
38200 	           xmlMemBlocks() - mem_base);
38201 	    test_ret++;
38202             printf(" %d", n_code);
38203             printf("\n");
38204         }
38205     }
38206     function_tests++;
38207 #endif
38208 
38209     return(test_ret);
38210 }
38211 
38212 
38213 static int
test_xmlUCSIsCJKRadicalsSupplement(void)38214 test_xmlUCSIsCJKRadicalsSupplement(void) {
38215     int test_ret = 0;
38216 
38217 #if defined(LIBXML_UNICODE_ENABLED)
38218     int mem_base;
38219     int ret_val;
38220     int code; /* UCS code point */
38221     int n_code;
38222 
38223     for (n_code = 0;n_code < gen_nb_int;n_code++) {
38224         mem_base = xmlMemBlocks();
38225         code = gen_int(n_code, 0);
38226 
38227         ret_val = xmlUCSIsCJKRadicalsSupplement(code);
38228         desret_int(ret_val);
38229         call_tests++;
38230         des_int(n_code, code, 0);
38231         xmlResetLastError();
38232         if (mem_base != xmlMemBlocks()) {
38233             printf("Leak of %d blocks found in xmlUCSIsCJKRadicalsSupplement",
38234 	           xmlMemBlocks() - mem_base);
38235 	    test_ret++;
38236             printf(" %d", n_code);
38237             printf("\n");
38238         }
38239     }
38240     function_tests++;
38241 #endif
38242 
38243     return(test_ret);
38244 }
38245 
38246 
38247 static int
test_xmlUCSIsCJKSymbolsandPunctuation(void)38248 test_xmlUCSIsCJKSymbolsandPunctuation(void) {
38249     int test_ret = 0;
38250 
38251 #if defined(LIBXML_UNICODE_ENABLED)
38252     int mem_base;
38253     int ret_val;
38254     int code; /* UCS code point */
38255     int n_code;
38256 
38257     for (n_code = 0;n_code < gen_nb_int;n_code++) {
38258         mem_base = xmlMemBlocks();
38259         code = gen_int(n_code, 0);
38260 
38261         ret_val = xmlUCSIsCJKSymbolsandPunctuation(code);
38262         desret_int(ret_val);
38263         call_tests++;
38264         des_int(n_code, code, 0);
38265         xmlResetLastError();
38266         if (mem_base != xmlMemBlocks()) {
38267             printf("Leak of %d blocks found in xmlUCSIsCJKSymbolsandPunctuation",
38268 	           xmlMemBlocks() - mem_base);
38269 	    test_ret++;
38270             printf(" %d", n_code);
38271             printf("\n");
38272         }
38273     }
38274     function_tests++;
38275 #endif
38276 
38277     return(test_ret);
38278 }
38279 
38280 
38281 static int
test_xmlUCSIsCJKUnifiedIdeographs(void)38282 test_xmlUCSIsCJKUnifiedIdeographs(void) {
38283     int test_ret = 0;
38284 
38285 #if defined(LIBXML_UNICODE_ENABLED)
38286     int mem_base;
38287     int ret_val;
38288     int code; /* UCS code point */
38289     int n_code;
38290 
38291     for (n_code = 0;n_code < gen_nb_int;n_code++) {
38292         mem_base = xmlMemBlocks();
38293         code = gen_int(n_code, 0);
38294 
38295         ret_val = xmlUCSIsCJKUnifiedIdeographs(code);
38296         desret_int(ret_val);
38297         call_tests++;
38298         des_int(n_code, code, 0);
38299         xmlResetLastError();
38300         if (mem_base != xmlMemBlocks()) {
38301             printf("Leak of %d blocks found in xmlUCSIsCJKUnifiedIdeographs",
38302 	           xmlMemBlocks() - mem_base);
38303 	    test_ret++;
38304             printf(" %d", n_code);
38305             printf("\n");
38306         }
38307     }
38308     function_tests++;
38309 #endif
38310 
38311     return(test_ret);
38312 }
38313 
38314 
38315 static int
test_xmlUCSIsCJKUnifiedIdeographsExtensionA(void)38316 test_xmlUCSIsCJKUnifiedIdeographsExtensionA(void) {
38317     int test_ret = 0;
38318 
38319 #if defined(LIBXML_UNICODE_ENABLED)
38320     int mem_base;
38321     int ret_val;
38322     int code; /* UCS code point */
38323     int n_code;
38324 
38325     for (n_code = 0;n_code < gen_nb_int;n_code++) {
38326         mem_base = xmlMemBlocks();
38327         code = gen_int(n_code, 0);
38328 
38329         ret_val = xmlUCSIsCJKUnifiedIdeographsExtensionA(code);
38330         desret_int(ret_val);
38331         call_tests++;
38332         des_int(n_code, code, 0);
38333         xmlResetLastError();
38334         if (mem_base != xmlMemBlocks()) {
38335             printf("Leak of %d blocks found in xmlUCSIsCJKUnifiedIdeographsExtensionA",
38336 	           xmlMemBlocks() - mem_base);
38337 	    test_ret++;
38338             printf(" %d", n_code);
38339             printf("\n");
38340         }
38341     }
38342     function_tests++;
38343 #endif
38344 
38345     return(test_ret);
38346 }
38347 
38348 
38349 static int
test_xmlUCSIsCJKUnifiedIdeographsExtensionB(void)38350 test_xmlUCSIsCJKUnifiedIdeographsExtensionB(void) {
38351     int test_ret = 0;
38352 
38353 #if defined(LIBXML_UNICODE_ENABLED)
38354     int mem_base;
38355     int ret_val;
38356     int code; /* UCS code point */
38357     int n_code;
38358 
38359     for (n_code = 0;n_code < gen_nb_int;n_code++) {
38360         mem_base = xmlMemBlocks();
38361         code = gen_int(n_code, 0);
38362 
38363         ret_val = xmlUCSIsCJKUnifiedIdeographsExtensionB(code);
38364         desret_int(ret_val);
38365         call_tests++;
38366         des_int(n_code, code, 0);
38367         xmlResetLastError();
38368         if (mem_base != xmlMemBlocks()) {
38369             printf("Leak of %d blocks found in xmlUCSIsCJKUnifiedIdeographsExtensionB",
38370 	           xmlMemBlocks() - mem_base);
38371 	    test_ret++;
38372             printf(" %d", n_code);
38373             printf("\n");
38374         }
38375     }
38376     function_tests++;
38377 #endif
38378 
38379     return(test_ret);
38380 }
38381 
38382 
38383 static int
test_xmlUCSIsCat(void)38384 test_xmlUCSIsCat(void) {
38385     int test_ret = 0;
38386 
38387 #if defined(LIBXML_UNICODE_ENABLED)
38388     int mem_base;
38389     int ret_val;
38390     int code; /* UCS code point */
38391     int n_code;
38392     char * cat; /* UCS Category name */
38393     int n_cat;
38394 
38395     for (n_code = 0;n_code < gen_nb_int;n_code++) {
38396     for (n_cat = 0;n_cat < gen_nb_const_char_ptr;n_cat++) {
38397         mem_base = xmlMemBlocks();
38398         code = gen_int(n_code, 0);
38399         cat = gen_const_char_ptr(n_cat, 1);
38400 
38401         ret_val = xmlUCSIsCat(code, (const char *)cat);
38402         desret_int(ret_val);
38403         call_tests++;
38404         des_int(n_code, code, 0);
38405         des_const_char_ptr(n_cat, (const char *)cat, 1);
38406         xmlResetLastError();
38407         if (mem_base != xmlMemBlocks()) {
38408             printf("Leak of %d blocks found in xmlUCSIsCat",
38409 	           xmlMemBlocks() - mem_base);
38410 	    test_ret++;
38411             printf(" %d", n_code);
38412             printf(" %d", n_cat);
38413             printf("\n");
38414         }
38415     }
38416     }
38417     function_tests++;
38418 #endif
38419 
38420     return(test_ret);
38421 }
38422 
38423 
38424 static int
test_xmlUCSIsCatC(void)38425 test_xmlUCSIsCatC(void) {
38426     int test_ret = 0;
38427 
38428 #if defined(LIBXML_UNICODE_ENABLED)
38429     int mem_base;
38430     int ret_val;
38431     int code; /* UCS code point */
38432     int n_code;
38433 
38434     for (n_code = 0;n_code < gen_nb_int;n_code++) {
38435         mem_base = xmlMemBlocks();
38436         code = gen_int(n_code, 0);
38437 
38438         ret_val = xmlUCSIsCatC(code);
38439         desret_int(ret_val);
38440         call_tests++;
38441         des_int(n_code, code, 0);
38442         xmlResetLastError();
38443         if (mem_base != xmlMemBlocks()) {
38444             printf("Leak of %d blocks found in xmlUCSIsCatC",
38445 	           xmlMemBlocks() - mem_base);
38446 	    test_ret++;
38447             printf(" %d", n_code);
38448             printf("\n");
38449         }
38450     }
38451     function_tests++;
38452 #endif
38453 
38454     return(test_ret);
38455 }
38456 
38457 
38458 static int
test_xmlUCSIsCatCc(void)38459 test_xmlUCSIsCatCc(void) {
38460     int test_ret = 0;
38461 
38462 #if defined(LIBXML_UNICODE_ENABLED)
38463     int mem_base;
38464     int ret_val;
38465     int code; /* UCS code point */
38466     int n_code;
38467 
38468     for (n_code = 0;n_code < gen_nb_int;n_code++) {
38469         mem_base = xmlMemBlocks();
38470         code = gen_int(n_code, 0);
38471 
38472         ret_val = xmlUCSIsCatCc(code);
38473         desret_int(ret_val);
38474         call_tests++;
38475         des_int(n_code, code, 0);
38476         xmlResetLastError();
38477         if (mem_base != xmlMemBlocks()) {
38478             printf("Leak of %d blocks found in xmlUCSIsCatCc",
38479 	           xmlMemBlocks() - mem_base);
38480 	    test_ret++;
38481             printf(" %d", n_code);
38482             printf("\n");
38483         }
38484     }
38485     function_tests++;
38486 #endif
38487 
38488     return(test_ret);
38489 }
38490 
38491 
38492 static int
test_xmlUCSIsCatCf(void)38493 test_xmlUCSIsCatCf(void) {
38494     int test_ret = 0;
38495 
38496 #if defined(LIBXML_UNICODE_ENABLED)
38497     int mem_base;
38498     int ret_val;
38499     int code; /* UCS code point */
38500     int n_code;
38501 
38502     for (n_code = 0;n_code < gen_nb_int;n_code++) {
38503         mem_base = xmlMemBlocks();
38504         code = gen_int(n_code, 0);
38505 
38506         ret_val = xmlUCSIsCatCf(code);
38507         desret_int(ret_val);
38508         call_tests++;
38509         des_int(n_code, code, 0);
38510         xmlResetLastError();
38511         if (mem_base != xmlMemBlocks()) {
38512             printf("Leak of %d blocks found in xmlUCSIsCatCf",
38513 	           xmlMemBlocks() - mem_base);
38514 	    test_ret++;
38515             printf(" %d", n_code);
38516             printf("\n");
38517         }
38518     }
38519     function_tests++;
38520 #endif
38521 
38522     return(test_ret);
38523 }
38524 
38525 
38526 static int
test_xmlUCSIsCatCo(void)38527 test_xmlUCSIsCatCo(void) {
38528     int test_ret = 0;
38529 
38530 #if defined(LIBXML_UNICODE_ENABLED)
38531     int mem_base;
38532     int ret_val;
38533     int code; /* UCS code point */
38534     int n_code;
38535 
38536     for (n_code = 0;n_code < gen_nb_int;n_code++) {
38537         mem_base = xmlMemBlocks();
38538         code = gen_int(n_code, 0);
38539 
38540         ret_val = xmlUCSIsCatCo(code);
38541         desret_int(ret_val);
38542         call_tests++;
38543         des_int(n_code, code, 0);
38544         xmlResetLastError();
38545         if (mem_base != xmlMemBlocks()) {
38546             printf("Leak of %d blocks found in xmlUCSIsCatCo",
38547 	           xmlMemBlocks() - mem_base);
38548 	    test_ret++;
38549             printf(" %d", n_code);
38550             printf("\n");
38551         }
38552     }
38553     function_tests++;
38554 #endif
38555 
38556     return(test_ret);
38557 }
38558 
38559 
38560 static int
test_xmlUCSIsCatCs(void)38561 test_xmlUCSIsCatCs(void) {
38562     int test_ret = 0;
38563 
38564 #if defined(LIBXML_UNICODE_ENABLED)
38565     int mem_base;
38566     int ret_val;
38567     int code; /* UCS code point */
38568     int n_code;
38569 
38570     for (n_code = 0;n_code < gen_nb_int;n_code++) {
38571         mem_base = xmlMemBlocks();
38572         code = gen_int(n_code, 0);
38573 
38574         ret_val = xmlUCSIsCatCs(code);
38575         desret_int(ret_val);
38576         call_tests++;
38577         des_int(n_code, code, 0);
38578         xmlResetLastError();
38579         if (mem_base != xmlMemBlocks()) {
38580             printf("Leak of %d blocks found in xmlUCSIsCatCs",
38581 	           xmlMemBlocks() - mem_base);
38582 	    test_ret++;
38583             printf(" %d", n_code);
38584             printf("\n");
38585         }
38586     }
38587     function_tests++;
38588 #endif
38589 
38590     return(test_ret);
38591 }
38592 
38593 
38594 static int
test_xmlUCSIsCatL(void)38595 test_xmlUCSIsCatL(void) {
38596     int test_ret = 0;
38597 
38598 #if defined(LIBXML_UNICODE_ENABLED)
38599     int mem_base;
38600     int ret_val;
38601     int code; /* UCS code point */
38602     int n_code;
38603 
38604     for (n_code = 0;n_code < gen_nb_int;n_code++) {
38605         mem_base = xmlMemBlocks();
38606         code = gen_int(n_code, 0);
38607 
38608         ret_val = xmlUCSIsCatL(code);
38609         desret_int(ret_val);
38610         call_tests++;
38611         des_int(n_code, code, 0);
38612         xmlResetLastError();
38613         if (mem_base != xmlMemBlocks()) {
38614             printf("Leak of %d blocks found in xmlUCSIsCatL",
38615 	           xmlMemBlocks() - mem_base);
38616 	    test_ret++;
38617             printf(" %d", n_code);
38618             printf("\n");
38619         }
38620     }
38621     function_tests++;
38622 #endif
38623 
38624     return(test_ret);
38625 }
38626 
38627 
38628 static int
test_xmlUCSIsCatLl(void)38629 test_xmlUCSIsCatLl(void) {
38630     int test_ret = 0;
38631 
38632 #if defined(LIBXML_UNICODE_ENABLED)
38633     int mem_base;
38634     int ret_val;
38635     int code; /* UCS code point */
38636     int n_code;
38637 
38638     for (n_code = 0;n_code < gen_nb_int;n_code++) {
38639         mem_base = xmlMemBlocks();
38640         code = gen_int(n_code, 0);
38641 
38642         ret_val = xmlUCSIsCatLl(code);
38643         desret_int(ret_val);
38644         call_tests++;
38645         des_int(n_code, code, 0);
38646         xmlResetLastError();
38647         if (mem_base != xmlMemBlocks()) {
38648             printf("Leak of %d blocks found in xmlUCSIsCatLl",
38649 	           xmlMemBlocks() - mem_base);
38650 	    test_ret++;
38651             printf(" %d", n_code);
38652             printf("\n");
38653         }
38654     }
38655     function_tests++;
38656 #endif
38657 
38658     return(test_ret);
38659 }
38660 
38661 
38662 static int
test_xmlUCSIsCatLm(void)38663 test_xmlUCSIsCatLm(void) {
38664     int test_ret = 0;
38665 
38666 #if defined(LIBXML_UNICODE_ENABLED)
38667     int mem_base;
38668     int ret_val;
38669     int code; /* UCS code point */
38670     int n_code;
38671 
38672     for (n_code = 0;n_code < gen_nb_int;n_code++) {
38673         mem_base = xmlMemBlocks();
38674         code = gen_int(n_code, 0);
38675 
38676         ret_val = xmlUCSIsCatLm(code);
38677         desret_int(ret_val);
38678         call_tests++;
38679         des_int(n_code, code, 0);
38680         xmlResetLastError();
38681         if (mem_base != xmlMemBlocks()) {
38682             printf("Leak of %d blocks found in xmlUCSIsCatLm",
38683 	           xmlMemBlocks() - mem_base);
38684 	    test_ret++;
38685             printf(" %d", n_code);
38686             printf("\n");
38687         }
38688     }
38689     function_tests++;
38690 #endif
38691 
38692     return(test_ret);
38693 }
38694 
38695 
38696 static int
test_xmlUCSIsCatLo(void)38697 test_xmlUCSIsCatLo(void) {
38698     int test_ret = 0;
38699 
38700 #if defined(LIBXML_UNICODE_ENABLED)
38701     int mem_base;
38702     int ret_val;
38703     int code; /* UCS code point */
38704     int n_code;
38705 
38706     for (n_code = 0;n_code < gen_nb_int;n_code++) {
38707         mem_base = xmlMemBlocks();
38708         code = gen_int(n_code, 0);
38709 
38710         ret_val = xmlUCSIsCatLo(code);
38711         desret_int(ret_val);
38712         call_tests++;
38713         des_int(n_code, code, 0);
38714         xmlResetLastError();
38715         if (mem_base != xmlMemBlocks()) {
38716             printf("Leak of %d blocks found in xmlUCSIsCatLo",
38717 	           xmlMemBlocks() - mem_base);
38718 	    test_ret++;
38719             printf(" %d", n_code);
38720             printf("\n");
38721         }
38722     }
38723     function_tests++;
38724 #endif
38725 
38726     return(test_ret);
38727 }
38728 
38729 
38730 static int
test_xmlUCSIsCatLt(void)38731 test_xmlUCSIsCatLt(void) {
38732     int test_ret = 0;
38733 
38734 #if defined(LIBXML_UNICODE_ENABLED)
38735     int mem_base;
38736     int ret_val;
38737     int code; /* UCS code point */
38738     int n_code;
38739 
38740     for (n_code = 0;n_code < gen_nb_int;n_code++) {
38741         mem_base = xmlMemBlocks();
38742         code = gen_int(n_code, 0);
38743 
38744         ret_val = xmlUCSIsCatLt(code);
38745         desret_int(ret_val);
38746         call_tests++;
38747         des_int(n_code, code, 0);
38748         xmlResetLastError();
38749         if (mem_base != xmlMemBlocks()) {
38750             printf("Leak of %d blocks found in xmlUCSIsCatLt",
38751 	           xmlMemBlocks() - mem_base);
38752 	    test_ret++;
38753             printf(" %d", n_code);
38754             printf("\n");
38755         }
38756     }
38757     function_tests++;
38758 #endif
38759 
38760     return(test_ret);
38761 }
38762 
38763 
38764 static int
test_xmlUCSIsCatLu(void)38765 test_xmlUCSIsCatLu(void) {
38766     int test_ret = 0;
38767 
38768 #if defined(LIBXML_UNICODE_ENABLED)
38769     int mem_base;
38770     int ret_val;
38771     int code; /* UCS code point */
38772     int n_code;
38773 
38774     for (n_code = 0;n_code < gen_nb_int;n_code++) {
38775         mem_base = xmlMemBlocks();
38776         code = gen_int(n_code, 0);
38777 
38778         ret_val = xmlUCSIsCatLu(code);
38779         desret_int(ret_val);
38780         call_tests++;
38781         des_int(n_code, code, 0);
38782         xmlResetLastError();
38783         if (mem_base != xmlMemBlocks()) {
38784             printf("Leak of %d blocks found in xmlUCSIsCatLu",
38785 	           xmlMemBlocks() - mem_base);
38786 	    test_ret++;
38787             printf(" %d", n_code);
38788             printf("\n");
38789         }
38790     }
38791     function_tests++;
38792 #endif
38793 
38794     return(test_ret);
38795 }
38796 
38797 
38798 static int
test_xmlUCSIsCatM(void)38799 test_xmlUCSIsCatM(void) {
38800     int test_ret = 0;
38801 
38802 #if defined(LIBXML_UNICODE_ENABLED)
38803     int mem_base;
38804     int ret_val;
38805     int code; /* UCS code point */
38806     int n_code;
38807 
38808     for (n_code = 0;n_code < gen_nb_int;n_code++) {
38809         mem_base = xmlMemBlocks();
38810         code = gen_int(n_code, 0);
38811 
38812         ret_val = xmlUCSIsCatM(code);
38813         desret_int(ret_val);
38814         call_tests++;
38815         des_int(n_code, code, 0);
38816         xmlResetLastError();
38817         if (mem_base != xmlMemBlocks()) {
38818             printf("Leak of %d blocks found in xmlUCSIsCatM",
38819 	           xmlMemBlocks() - mem_base);
38820 	    test_ret++;
38821             printf(" %d", n_code);
38822             printf("\n");
38823         }
38824     }
38825     function_tests++;
38826 #endif
38827 
38828     return(test_ret);
38829 }
38830 
38831 
38832 static int
test_xmlUCSIsCatMc(void)38833 test_xmlUCSIsCatMc(void) {
38834     int test_ret = 0;
38835 
38836 #if defined(LIBXML_UNICODE_ENABLED)
38837     int mem_base;
38838     int ret_val;
38839     int code; /* UCS code point */
38840     int n_code;
38841 
38842     for (n_code = 0;n_code < gen_nb_int;n_code++) {
38843         mem_base = xmlMemBlocks();
38844         code = gen_int(n_code, 0);
38845 
38846         ret_val = xmlUCSIsCatMc(code);
38847         desret_int(ret_val);
38848         call_tests++;
38849         des_int(n_code, code, 0);
38850         xmlResetLastError();
38851         if (mem_base != xmlMemBlocks()) {
38852             printf("Leak of %d blocks found in xmlUCSIsCatMc",
38853 	           xmlMemBlocks() - mem_base);
38854 	    test_ret++;
38855             printf(" %d", n_code);
38856             printf("\n");
38857         }
38858     }
38859     function_tests++;
38860 #endif
38861 
38862     return(test_ret);
38863 }
38864 
38865 
38866 static int
test_xmlUCSIsCatMe(void)38867 test_xmlUCSIsCatMe(void) {
38868     int test_ret = 0;
38869 
38870 #if defined(LIBXML_UNICODE_ENABLED)
38871     int mem_base;
38872     int ret_val;
38873     int code; /* UCS code point */
38874     int n_code;
38875 
38876     for (n_code = 0;n_code < gen_nb_int;n_code++) {
38877         mem_base = xmlMemBlocks();
38878         code = gen_int(n_code, 0);
38879 
38880         ret_val = xmlUCSIsCatMe(code);
38881         desret_int(ret_val);
38882         call_tests++;
38883         des_int(n_code, code, 0);
38884         xmlResetLastError();
38885         if (mem_base != xmlMemBlocks()) {
38886             printf("Leak of %d blocks found in xmlUCSIsCatMe",
38887 	           xmlMemBlocks() - mem_base);
38888 	    test_ret++;
38889             printf(" %d", n_code);
38890             printf("\n");
38891         }
38892     }
38893     function_tests++;
38894 #endif
38895 
38896     return(test_ret);
38897 }
38898 
38899 
38900 static int
test_xmlUCSIsCatMn(void)38901 test_xmlUCSIsCatMn(void) {
38902     int test_ret = 0;
38903 
38904 #if defined(LIBXML_UNICODE_ENABLED)
38905     int mem_base;
38906     int ret_val;
38907     int code; /* UCS code point */
38908     int n_code;
38909 
38910     for (n_code = 0;n_code < gen_nb_int;n_code++) {
38911         mem_base = xmlMemBlocks();
38912         code = gen_int(n_code, 0);
38913 
38914         ret_val = xmlUCSIsCatMn(code);
38915         desret_int(ret_val);
38916         call_tests++;
38917         des_int(n_code, code, 0);
38918         xmlResetLastError();
38919         if (mem_base != xmlMemBlocks()) {
38920             printf("Leak of %d blocks found in xmlUCSIsCatMn",
38921 	           xmlMemBlocks() - mem_base);
38922 	    test_ret++;
38923             printf(" %d", n_code);
38924             printf("\n");
38925         }
38926     }
38927     function_tests++;
38928 #endif
38929 
38930     return(test_ret);
38931 }
38932 
38933 
38934 static int
test_xmlUCSIsCatN(void)38935 test_xmlUCSIsCatN(void) {
38936     int test_ret = 0;
38937 
38938 #if defined(LIBXML_UNICODE_ENABLED)
38939     int mem_base;
38940     int ret_val;
38941     int code; /* UCS code point */
38942     int n_code;
38943 
38944     for (n_code = 0;n_code < gen_nb_int;n_code++) {
38945         mem_base = xmlMemBlocks();
38946         code = gen_int(n_code, 0);
38947 
38948         ret_val = xmlUCSIsCatN(code);
38949         desret_int(ret_val);
38950         call_tests++;
38951         des_int(n_code, code, 0);
38952         xmlResetLastError();
38953         if (mem_base != xmlMemBlocks()) {
38954             printf("Leak of %d blocks found in xmlUCSIsCatN",
38955 	           xmlMemBlocks() - mem_base);
38956 	    test_ret++;
38957             printf(" %d", n_code);
38958             printf("\n");
38959         }
38960     }
38961     function_tests++;
38962 #endif
38963 
38964     return(test_ret);
38965 }
38966 
38967 
38968 static int
test_xmlUCSIsCatNd(void)38969 test_xmlUCSIsCatNd(void) {
38970     int test_ret = 0;
38971 
38972 #if defined(LIBXML_UNICODE_ENABLED)
38973     int mem_base;
38974     int ret_val;
38975     int code; /* UCS code point */
38976     int n_code;
38977 
38978     for (n_code = 0;n_code < gen_nb_int;n_code++) {
38979         mem_base = xmlMemBlocks();
38980         code = gen_int(n_code, 0);
38981 
38982         ret_val = xmlUCSIsCatNd(code);
38983         desret_int(ret_val);
38984         call_tests++;
38985         des_int(n_code, code, 0);
38986         xmlResetLastError();
38987         if (mem_base != xmlMemBlocks()) {
38988             printf("Leak of %d blocks found in xmlUCSIsCatNd",
38989 	           xmlMemBlocks() - mem_base);
38990 	    test_ret++;
38991             printf(" %d", n_code);
38992             printf("\n");
38993         }
38994     }
38995     function_tests++;
38996 #endif
38997 
38998     return(test_ret);
38999 }
39000 
39001 
39002 static int
test_xmlUCSIsCatNl(void)39003 test_xmlUCSIsCatNl(void) {
39004     int test_ret = 0;
39005 
39006 #if defined(LIBXML_UNICODE_ENABLED)
39007     int mem_base;
39008     int ret_val;
39009     int code; /* UCS code point */
39010     int n_code;
39011 
39012     for (n_code = 0;n_code < gen_nb_int;n_code++) {
39013         mem_base = xmlMemBlocks();
39014         code = gen_int(n_code, 0);
39015 
39016         ret_val = xmlUCSIsCatNl(code);
39017         desret_int(ret_val);
39018         call_tests++;
39019         des_int(n_code, code, 0);
39020         xmlResetLastError();
39021         if (mem_base != xmlMemBlocks()) {
39022             printf("Leak of %d blocks found in xmlUCSIsCatNl",
39023 	           xmlMemBlocks() - mem_base);
39024 	    test_ret++;
39025             printf(" %d", n_code);
39026             printf("\n");
39027         }
39028     }
39029     function_tests++;
39030 #endif
39031 
39032     return(test_ret);
39033 }
39034 
39035 
39036 static int
test_xmlUCSIsCatNo(void)39037 test_xmlUCSIsCatNo(void) {
39038     int test_ret = 0;
39039 
39040 #if defined(LIBXML_UNICODE_ENABLED)
39041     int mem_base;
39042     int ret_val;
39043     int code; /* UCS code point */
39044     int n_code;
39045 
39046     for (n_code = 0;n_code < gen_nb_int;n_code++) {
39047         mem_base = xmlMemBlocks();
39048         code = gen_int(n_code, 0);
39049 
39050         ret_val = xmlUCSIsCatNo(code);
39051         desret_int(ret_val);
39052         call_tests++;
39053         des_int(n_code, code, 0);
39054         xmlResetLastError();
39055         if (mem_base != xmlMemBlocks()) {
39056             printf("Leak of %d blocks found in xmlUCSIsCatNo",
39057 	           xmlMemBlocks() - mem_base);
39058 	    test_ret++;
39059             printf(" %d", n_code);
39060             printf("\n");
39061         }
39062     }
39063     function_tests++;
39064 #endif
39065 
39066     return(test_ret);
39067 }
39068 
39069 
39070 static int
test_xmlUCSIsCatP(void)39071 test_xmlUCSIsCatP(void) {
39072     int test_ret = 0;
39073 
39074 #if defined(LIBXML_UNICODE_ENABLED)
39075     int mem_base;
39076     int ret_val;
39077     int code; /* UCS code point */
39078     int n_code;
39079 
39080     for (n_code = 0;n_code < gen_nb_int;n_code++) {
39081         mem_base = xmlMemBlocks();
39082         code = gen_int(n_code, 0);
39083 
39084         ret_val = xmlUCSIsCatP(code);
39085         desret_int(ret_val);
39086         call_tests++;
39087         des_int(n_code, code, 0);
39088         xmlResetLastError();
39089         if (mem_base != xmlMemBlocks()) {
39090             printf("Leak of %d blocks found in xmlUCSIsCatP",
39091 	           xmlMemBlocks() - mem_base);
39092 	    test_ret++;
39093             printf(" %d", n_code);
39094             printf("\n");
39095         }
39096     }
39097     function_tests++;
39098 #endif
39099 
39100     return(test_ret);
39101 }
39102 
39103 
39104 static int
test_xmlUCSIsCatPc(void)39105 test_xmlUCSIsCatPc(void) {
39106     int test_ret = 0;
39107 
39108 #if defined(LIBXML_UNICODE_ENABLED)
39109     int mem_base;
39110     int ret_val;
39111     int code; /* UCS code point */
39112     int n_code;
39113 
39114     for (n_code = 0;n_code < gen_nb_int;n_code++) {
39115         mem_base = xmlMemBlocks();
39116         code = gen_int(n_code, 0);
39117 
39118         ret_val = xmlUCSIsCatPc(code);
39119         desret_int(ret_val);
39120         call_tests++;
39121         des_int(n_code, code, 0);
39122         xmlResetLastError();
39123         if (mem_base != xmlMemBlocks()) {
39124             printf("Leak of %d blocks found in xmlUCSIsCatPc",
39125 	           xmlMemBlocks() - mem_base);
39126 	    test_ret++;
39127             printf(" %d", n_code);
39128             printf("\n");
39129         }
39130     }
39131     function_tests++;
39132 #endif
39133 
39134     return(test_ret);
39135 }
39136 
39137 
39138 static int
test_xmlUCSIsCatPd(void)39139 test_xmlUCSIsCatPd(void) {
39140     int test_ret = 0;
39141 
39142 #if defined(LIBXML_UNICODE_ENABLED)
39143     int mem_base;
39144     int ret_val;
39145     int code; /* UCS code point */
39146     int n_code;
39147 
39148     for (n_code = 0;n_code < gen_nb_int;n_code++) {
39149         mem_base = xmlMemBlocks();
39150         code = gen_int(n_code, 0);
39151 
39152         ret_val = xmlUCSIsCatPd(code);
39153         desret_int(ret_val);
39154         call_tests++;
39155         des_int(n_code, code, 0);
39156         xmlResetLastError();
39157         if (mem_base != xmlMemBlocks()) {
39158             printf("Leak of %d blocks found in xmlUCSIsCatPd",
39159 	           xmlMemBlocks() - mem_base);
39160 	    test_ret++;
39161             printf(" %d", n_code);
39162             printf("\n");
39163         }
39164     }
39165     function_tests++;
39166 #endif
39167 
39168     return(test_ret);
39169 }
39170 
39171 
39172 static int
test_xmlUCSIsCatPe(void)39173 test_xmlUCSIsCatPe(void) {
39174     int test_ret = 0;
39175 
39176 #if defined(LIBXML_UNICODE_ENABLED)
39177     int mem_base;
39178     int ret_val;
39179     int code; /* UCS code point */
39180     int n_code;
39181 
39182     for (n_code = 0;n_code < gen_nb_int;n_code++) {
39183         mem_base = xmlMemBlocks();
39184         code = gen_int(n_code, 0);
39185 
39186         ret_val = xmlUCSIsCatPe(code);
39187         desret_int(ret_val);
39188         call_tests++;
39189         des_int(n_code, code, 0);
39190         xmlResetLastError();
39191         if (mem_base != xmlMemBlocks()) {
39192             printf("Leak of %d blocks found in xmlUCSIsCatPe",
39193 	           xmlMemBlocks() - mem_base);
39194 	    test_ret++;
39195             printf(" %d", n_code);
39196             printf("\n");
39197         }
39198     }
39199     function_tests++;
39200 #endif
39201 
39202     return(test_ret);
39203 }
39204 
39205 
39206 static int
test_xmlUCSIsCatPf(void)39207 test_xmlUCSIsCatPf(void) {
39208     int test_ret = 0;
39209 
39210 #if defined(LIBXML_UNICODE_ENABLED)
39211     int mem_base;
39212     int ret_val;
39213     int code; /* UCS code point */
39214     int n_code;
39215 
39216     for (n_code = 0;n_code < gen_nb_int;n_code++) {
39217         mem_base = xmlMemBlocks();
39218         code = gen_int(n_code, 0);
39219 
39220         ret_val = xmlUCSIsCatPf(code);
39221         desret_int(ret_val);
39222         call_tests++;
39223         des_int(n_code, code, 0);
39224         xmlResetLastError();
39225         if (mem_base != xmlMemBlocks()) {
39226             printf("Leak of %d blocks found in xmlUCSIsCatPf",
39227 	           xmlMemBlocks() - mem_base);
39228 	    test_ret++;
39229             printf(" %d", n_code);
39230             printf("\n");
39231         }
39232     }
39233     function_tests++;
39234 #endif
39235 
39236     return(test_ret);
39237 }
39238 
39239 
39240 static int
test_xmlUCSIsCatPi(void)39241 test_xmlUCSIsCatPi(void) {
39242     int test_ret = 0;
39243 
39244 #if defined(LIBXML_UNICODE_ENABLED)
39245     int mem_base;
39246     int ret_val;
39247     int code; /* UCS code point */
39248     int n_code;
39249 
39250     for (n_code = 0;n_code < gen_nb_int;n_code++) {
39251         mem_base = xmlMemBlocks();
39252         code = gen_int(n_code, 0);
39253 
39254         ret_val = xmlUCSIsCatPi(code);
39255         desret_int(ret_val);
39256         call_tests++;
39257         des_int(n_code, code, 0);
39258         xmlResetLastError();
39259         if (mem_base != xmlMemBlocks()) {
39260             printf("Leak of %d blocks found in xmlUCSIsCatPi",
39261 	           xmlMemBlocks() - mem_base);
39262 	    test_ret++;
39263             printf(" %d", n_code);
39264             printf("\n");
39265         }
39266     }
39267     function_tests++;
39268 #endif
39269 
39270     return(test_ret);
39271 }
39272 
39273 
39274 static int
test_xmlUCSIsCatPo(void)39275 test_xmlUCSIsCatPo(void) {
39276     int test_ret = 0;
39277 
39278 #if defined(LIBXML_UNICODE_ENABLED)
39279     int mem_base;
39280     int ret_val;
39281     int code; /* UCS code point */
39282     int n_code;
39283 
39284     for (n_code = 0;n_code < gen_nb_int;n_code++) {
39285         mem_base = xmlMemBlocks();
39286         code = gen_int(n_code, 0);
39287 
39288         ret_val = xmlUCSIsCatPo(code);
39289         desret_int(ret_val);
39290         call_tests++;
39291         des_int(n_code, code, 0);
39292         xmlResetLastError();
39293         if (mem_base != xmlMemBlocks()) {
39294             printf("Leak of %d blocks found in xmlUCSIsCatPo",
39295 	           xmlMemBlocks() - mem_base);
39296 	    test_ret++;
39297             printf(" %d", n_code);
39298             printf("\n");
39299         }
39300     }
39301     function_tests++;
39302 #endif
39303 
39304     return(test_ret);
39305 }
39306 
39307 
39308 static int
test_xmlUCSIsCatPs(void)39309 test_xmlUCSIsCatPs(void) {
39310     int test_ret = 0;
39311 
39312 #if defined(LIBXML_UNICODE_ENABLED)
39313     int mem_base;
39314     int ret_val;
39315     int code; /* UCS code point */
39316     int n_code;
39317 
39318     for (n_code = 0;n_code < gen_nb_int;n_code++) {
39319         mem_base = xmlMemBlocks();
39320         code = gen_int(n_code, 0);
39321 
39322         ret_val = xmlUCSIsCatPs(code);
39323         desret_int(ret_val);
39324         call_tests++;
39325         des_int(n_code, code, 0);
39326         xmlResetLastError();
39327         if (mem_base != xmlMemBlocks()) {
39328             printf("Leak of %d blocks found in xmlUCSIsCatPs",
39329 	           xmlMemBlocks() - mem_base);
39330 	    test_ret++;
39331             printf(" %d", n_code);
39332             printf("\n");
39333         }
39334     }
39335     function_tests++;
39336 #endif
39337 
39338     return(test_ret);
39339 }
39340 
39341 
39342 static int
test_xmlUCSIsCatS(void)39343 test_xmlUCSIsCatS(void) {
39344     int test_ret = 0;
39345 
39346 #if defined(LIBXML_UNICODE_ENABLED)
39347     int mem_base;
39348     int ret_val;
39349     int code; /* UCS code point */
39350     int n_code;
39351 
39352     for (n_code = 0;n_code < gen_nb_int;n_code++) {
39353         mem_base = xmlMemBlocks();
39354         code = gen_int(n_code, 0);
39355 
39356         ret_val = xmlUCSIsCatS(code);
39357         desret_int(ret_val);
39358         call_tests++;
39359         des_int(n_code, code, 0);
39360         xmlResetLastError();
39361         if (mem_base != xmlMemBlocks()) {
39362             printf("Leak of %d blocks found in xmlUCSIsCatS",
39363 	           xmlMemBlocks() - mem_base);
39364 	    test_ret++;
39365             printf(" %d", n_code);
39366             printf("\n");
39367         }
39368     }
39369     function_tests++;
39370 #endif
39371 
39372     return(test_ret);
39373 }
39374 
39375 
39376 static int
test_xmlUCSIsCatSc(void)39377 test_xmlUCSIsCatSc(void) {
39378     int test_ret = 0;
39379 
39380 #if defined(LIBXML_UNICODE_ENABLED)
39381     int mem_base;
39382     int ret_val;
39383     int code; /* UCS code point */
39384     int n_code;
39385 
39386     for (n_code = 0;n_code < gen_nb_int;n_code++) {
39387         mem_base = xmlMemBlocks();
39388         code = gen_int(n_code, 0);
39389 
39390         ret_val = xmlUCSIsCatSc(code);
39391         desret_int(ret_val);
39392         call_tests++;
39393         des_int(n_code, code, 0);
39394         xmlResetLastError();
39395         if (mem_base != xmlMemBlocks()) {
39396             printf("Leak of %d blocks found in xmlUCSIsCatSc",
39397 	           xmlMemBlocks() - mem_base);
39398 	    test_ret++;
39399             printf(" %d", n_code);
39400             printf("\n");
39401         }
39402     }
39403     function_tests++;
39404 #endif
39405 
39406     return(test_ret);
39407 }
39408 
39409 
39410 static int
test_xmlUCSIsCatSk(void)39411 test_xmlUCSIsCatSk(void) {
39412     int test_ret = 0;
39413 
39414 #if defined(LIBXML_UNICODE_ENABLED)
39415     int mem_base;
39416     int ret_val;
39417     int code; /* UCS code point */
39418     int n_code;
39419 
39420     for (n_code = 0;n_code < gen_nb_int;n_code++) {
39421         mem_base = xmlMemBlocks();
39422         code = gen_int(n_code, 0);
39423 
39424         ret_val = xmlUCSIsCatSk(code);
39425         desret_int(ret_val);
39426         call_tests++;
39427         des_int(n_code, code, 0);
39428         xmlResetLastError();
39429         if (mem_base != xmlMemBlocks()) {
39430             printf("Leak of %d blocks found in xmlUCSIsCatSk",
39431 	           xmlMemBlocks() - mem_base);
39432 	    test_ret++;
39433             printf(" %d", n_code);
39434             printf("\n");
39435         }
39436     }
39437     function_tests++;
39438 #endif
39439 
39440     return(test_ret);
39441 }
39442 
39443 
39444 static int
test_xmlUCSIsCatSm(void)39445 test_xmlUCSIsCatSm(void) {
39446     int test_ret = 0;
39447 
39448 #if defined(LIBXML_UNICODE_ENABLED)
39449     int mem_base;
39450     int ret_val;
39451     int code; /* UCS code point */
39452     int n_code;
39453 
39454     for (n_code = 0;n_code < gen_nb_int;n_code++) {
39455         mem_base = xmlMemBlocks();
39456         code = gen_int(n_code, 0);
39457 
39458         ret_val = xmlUCSIsCatSm(code);
39459         desret_int(ret_val);
39460         call_tests++;
39461         des_int(n_code, code, 0);
39462         xmlResetLastError();
39463         if (mem_base != xmlMemBlocks()) {
39464             printf("Leak of %d blocks found in xmlUCSIsCatSm",
39465 	           xmlMemBlocks() - mem_base);
39466 	    test_ret++;
39467             printf(" %d", n_code);
39468             printf("\n");
39469         }
39470     }
39471     function_tests++;
39472 #endif
39473 
39474     return(test_ret);
39475 }
39476 
39477 
39478 static int
test_xmlUCSIsCatSo(void)39479 test_xmlUCSIsCatSo(void) {
39480     int test_ret = 0;
39481 
39482 #if defined(LIBXML_UNICODE_ENABLED)
39483     int mem_base;
39484     int ret_val;
39485     int code; /* UCS code point */
39486     int n_code;
39487 
39488     for (n_code = 0;n_code < gen_nb_int;n_code++) {
39489         mem_base = xmlMemBlocks();
39490         code = gen_int(n_code, 0);
39491 
39492         ret_val = xmlUCSIsCatSo(code);
39493         desret_int(ret_val);
39494         call_tests++;
39495         des_int(n_code, code, 0);
39496         xmlResetLastError();
39497         if (mem_base != xmlMemBlocks()) {
39498             printf("Leak of %d blocks found in xmlUCSIsCatSo",
39499 	           xmlMemBlocks() - mem_base);
39500 	    test_ret++;
39501             printf(" %d", n_code);
39502             printf("\n");
39503         }
39504     }
39505     function_tests++;
39506 #endif
39507 
39508     return(test_ret);
39509 }
39510 
39511 
39512 static int
test_xmlUCSIsCatZ(void)39513 test_xmlUCSIsCatZ(void) {
39514     int test_ret = 0;
39515 
39516 #if defined(LIBXML_UNICODE_ENABLED)
39517     int mem_base;
39518     int ret_val;
39519     int code; /* UCS code point */
39520     int n_code;
39521 
39522     for (n_code = 0;n_code < gen_nb_int;n_code++) {
39523         mem_base = xmlMemBlocks();
39524         code = gen_int(n_code, 0);
39525 
39526         ret_val = xmlUCSIsCatZ(code);
39527         desret_int(ret_val);
39528         call_tests++;
39529         des_int(n_code, code, 0);
39530         xmlResetLastError();
39531         if (mem_base != xmlMemBlocks()) {
39532             printf("Leak of %d blocks found in xmlUCSIsCatZ",
39533 	           xmlMemBlocks() - mem_base);
39534 	    test_ret++;
39535             printf(" %d", n_code);
39536             printf("\n");
39537         }
39538     }
39539     function_tests++;
39540 #endif
39541 
39542     return(test_ret);
39543 }
39544 
39545 
39546 static int
test_xmlUCSIsCatZl(void)39547 test_xmlUCSIsCatZl(void) {
39548     int test_ret = 0;
39549 
39550 #if defined(LIBXML_UNICODE_ENABLED)
39551     int mem_base;
39552     int ret_val;
39553     int code; /* UCS code point */
39554     int n_code;
39555 
39556     for (n_code = 0;n_code < gen_nb_int;n_code++) {
39557         mem_base = xmlMemBlocks();
39558         code = gen_int(n_code, 0);
39559 
39560         ret_val = xmlUCSIsCatZl(code);
39561         desret_int(ret_val);
39562         call_tests++;
39563         des_int(n_code, code, 0);
39564         xmlResetLastError();
39565         if (mem_base != xmlMemBlocks()) {
39566             printf("Leak of %d blocks found in xmlUCSIsCatZl",
39567 	           xmlMemBlocks() - mem_base);
39568 	    test_ret++;
39569             printf(" %d", n_code);
39570             printf("\n");
39571         }
39572     }
39573     function_tests++;
39574 #endif
39575 
39576     return(test_ret);
39577 }
39578 
39579 
39580 static int
test_xmlUCSIsCatZp(void)39581 test_xmlUCSIsCatZp(void) {
39582     int test_ret = 0;
39583 
39584 #if defined(LIBXML_UNICODE_ENABLED)
39585     int mem_base;
39586     int ret_val;
39587     int code; /* UCS code point */
39588     int n_code;
39589 
39590     for (n_code = 0;n_code < gen_nb_int;n_code++) {
39591         mem_base = xmlMemBlocks();
39592         code = gen_int(n_code, 0);
39593 
39594         ret_val = xmlUCSIsCatZp(code);
39595         desret_int(ret_val);
39596         call_tests++;
39597         des_int(n_code, code, 0);
39598         xmlResetLastError();
39599         if (mem_base != xmlMemBlocks()) {
39600             printf("Leak of %d blocks found in xmlUCSIsCatZp",
39601 	           xmlMemBlocks() - mem_base);
39602 	    test_ret++;
39603             printf(" %d", n_code);
39604             printf("\n");
39605         }
39606     }
39607     function_tests++;
39608 #endif
39609 
39610     return(test_ret);
39611 }
39612 
39613 
39614 static int
test_xmlUCSIsCatZs(void)39615 test_xmlUCSIsCatZs(void) {
39616     int test_ret = 0;
39617 
39618 #if defined(LIBXML_UNICODE_ENABLED)
39619     int mem_base;
39620     int ret_val;
39621     int code; /* UCS code point */
39622     int n_code;
39623 
39624     for (n_code = 0;n_code < gen_nb_int;n_code++) {
39625         mem_base = xmlMemBlocks();
39626         code = gen_int(n_code, 0);
39627 
39628         ret_val = xmlUCSIsCatZs(code);
39629         desret_int(ret_val);
39630         call_tests++;
39631         des_int(n_code, code, 0);
39632         xmlResetLastError();
39633         if (mem_base != xmlMemBlocks()) {
39634             printf("Leak of %d blocks found in xmlUCSIsCatZs",
39635 	           xmlMemBlocks() - mem_base);
39636 	    test_ret++;
39637             printf(" %d", n_code);
39638             printf("\n");
39639         }
39640     }
39641     function_tests++;
39642 #endif
39643 
39644     return(test_ret);
39645 }
39646 
39647 
39648 static int
test_xmlUCSIsCherokee(void)39649 test_xmlUCSIsCherokee(void) {
39650     int test_ret = 0;
39651 
39652 #if defined(LIBXML_UNICODE_ENABLED)
39653     int mem_base;
39654     int ret_val;
39655     int code; /* UCS code point */
39656     int n_code;
39657 
39658     for (n_code = 0;n_code < gen_nb_int;n_code++) {
39659         mem_base = xmlMemBlocks();
39660         code = gen_int(n_code, 0);
39661 
39662         ret_val = xmlUCSIsCherokee(code);
39663         desret_int(ret_val);
39664         call_tests++;
39665         des_int(n_code, code, 0);
39666         xmlResetLastError();
39667         if (mem_base != xmlMemBlocks()) {
39668             printf("Leak of %d blocks found in xmlUCSIsCherokee",
39669 	           xmlMemBlocks() - mem_base);
39670 	    test_ret++;
39671             printf(" %d", n_code);
39672             printf("\n");
39673         }
39674     }
39675     function_tests++;
39676 #endif
39677 
39678     return(test_ret);
39679 }
39680 
39681 
39682 static int
test_xmlUCSIsCombiningDiacriticalMarks(void)39683 test_xmlUCSIsCombiningDiacriticalMarks(void) {
39684     int test_ret = 0;
39685 
39686 #if defined(LIBXML_UNICODE_ENABLED)
39687     int mem_base;
39688     int ret_val;
39689     int code; /* UCS code point */
39690     int n_code;
39691 
39692     for (n_code = 0;n_code < gen_nb_int;n_code++) {
39693         mem_base = xmlMemBlocks();
39694         code = gen_int(n_code, 0);
39695 
39696         ret_val = xmlUCSIsCombiningDiacriticalMarks(code);
39697         desret_int(ret_val);
39698         call_tests++;
39699         des_int(n_code, code, 0);
39700         xmlResetLastError();
39701         if (mem_base != xmlMemBlocks()) {
39702             printf("Leak of %d blocks found in xmlUCSIsCombiningDiacriticalMarks",
39703 	           xmlMemBlocks() - mem_base);
39704 	    test_ret++;
39705             printf(" %d", n_code);
39706             printf("\n");
39707         }
39708     }
39709     function_tests++;
39710 #endif
39711 
39712     return(test_ret);
39713 }
39714 
39715 
39716 static int
test_xmlUCSIsCombiningDiacriticalMarksforSymbols(void)39717 test_xmlUCSIsCombiningDiacriticalMarksforSymbols(void) {
39718     int test_ret = 0;
39719 
39720 #if defined(LIBXML_UNICODE_ENABLED)
39721     int mem_base;
39722     int ret_val;
39723     int code; /* UCS code point */
39724     int n_code;
39725 
39726     for (n_code = 0;n_code < gen_nb_int;n_code++) {
39727         mem_base = xmlMemBlocks();
39728         code = gen_int(n_code, 0);
39729 
39730         ret_val = xmlUCSIsCombiningDiacriticalMarksforSymbols(code);
39731         desret_int(ret_val);
39732         call_tests++;
39733         des_int(n_code, code, 0);
39734         xmlResetLastError();
39735         if (mem_base != xmlMemBlocks()) {
39736             printf("Leak of %d blocks found in xmlUCSIsCombiningDiacriticalMarksforSymbols",
39737 	           xmlMemBlocks() - mem_base);
39738 	    test_ret++;
39739             printf(" %d", n_code);
39740             printf("\n");
39741         }
39742     }
39743     function_tests++;
39744 #endif
39745 
39746     return(test_ret);
39747 }
39748 
39749 
39750 static int
test_xmlUCSIsCombiningHalfMarks(void)39751 test_xmlUCSIsCombiningHalfMarks(void) {
39752     int test_ret = 0;
39753 
39754 #if defined(LIBXML_UNICODE_ENABLED)
39755     int mem_base;
39756     int ret_val;
39757     int code; /* UCS code point */
39758     int n_code;
39759 
39760     for (n_code = 0;n_code < gen_nb_int;n_code++) {
39761         mem_base = xmlMemBlocks();
39762         code = gen_int(n_code, 0);
39763 
39764         ret_val = xmlUCSIsCombiningHalfMarks(code);
39765         desret_int(ret_val);
39766         call_tests++;
39767         des_int(n_code, code, 0);
39768         xmlResetLastError();
39769         if (mem_base != xmlMemBlocks()) {
39770             printf("Leak of %d blocks found in xmlUCSIsCombiningHalfMarks",
39771 	           xmlMemBlocks() - mem_base);
39772 	    test_ret++;
39773             printf(" %d", n_code);
39774             printf("\n");
39775         }
39776     }
39777     function_tests++;
39778 #endif
39779 
39780     return(test_ret);
39781 }
39782 
39783 
39784 static int
test_xmlUCSIsCombiningMarksforSymbols(void)39785 test_xmlUCSIsCombiningMarksforSymbols(void) {
39786     int test_ret = 0;
39787 
39788 #if defined(LIBXML_UNICODE_ENABLED)
39789     int mem_base;
39790     int ret_val;
39791     int code; /* UCS code point */
39792     int n_code;
39793 
39794     for (n_code = 0;n_code < gen_nb_int;n_code++) {
39795         mem_base = xmlMemBlocks();
39796         code = gen_int(n_code, 0);
39797 
39798         ret_val = xmlUCSIsCombiningMarksforSymbols(code);
39799         desret_int(ret_val);
39800         call_tests++;
39801         des_int(n_code, code, 0);
39802         xmlResetLastError();
39803         if (mem_base != xmlMemBlocks()) {
39804             printf("Leak of %d blocks found in xmlUCSIsCombiningMarksforSymbols",
39805 	           xmlMemBlocks() - mem_base);
39806 	    test_ret++;
39807             printf(" %d", n_code);
39808             printf("\n");
39809         }
39810     }
39811     function_tests++;
39812 #endif
39813 
39814     return(test_ret);
39815 }
39816 
39817 
39818 static int
test_xmlUCSIsControlPictures(void)39819 test_xmlUCSIsControlPictures(void) {
39820     int test_ret = 0;
39821 
39822 #if defined(LIBXML_UNICODE_ENABLED)
39823     int mem_base;
39824     int ret_val;
39825     int code; /* UCS code point */
39826     int n_code;
39827 
39828     for (n_code = 0;n_code < gen_nb_int;n_code++) {
39829         mem_base = xmlMemBlocks();
39830         code = gen_int(n_code, 0);
39831 
39832         ret_val = xmlUCSIsControlPictures(code);
39833         desret_int(ret_val);
39834         call_tests++;
39835         des_int(n_code, code, 0);
39836         xmlResetLastError();
39837         if (mem_base != xmlMemBlocks()) {
39838             printf("Leak of %d blocks found in xmlUCSIsControlPictures",
39839 	           xmlMemBlocks() - mem_base);
39840 	    test_ret++;
39841             printf(" %d", n_code);
39842             printf("\n");
39843         }
39844     }
39845     function_tests++;
39846 #endif
39847 
39848     return(test_ret);
39849 }
39850 
39851 
39852 static int
test_xmlUCSIsCurrencySymbols(void)39853 test_xmlUCSIsCurrencySymbols(void) {
39854     int test_ret = 0;
39855 
39856 #if defined(LIBXML_UNICODE_ENABLED)
39857     int mem_base;
39858     int ret_val;
39859     int code; /* UCS code point */
39860     int n_code;
39861 
39862     for (n_code = 0;n_code < gen_nb_int;n_code++) {
39863         mem_base = xmlMemBlocks();
39864         code = gen_int(n_code, 0);
39865 
39866         ret_val = xmlUCSIsCurrencySymbols(code);
39867         desret_int(ret_val);
39868         call_tests++;
39869         des_int(n_code, code, 0);
39870         xmlResetLastError();
39871         if (mem_base != xmlMemBlocks()) {
39872             printf("Leak of %d blocks found in xmlUCSIsCurrencySymbols",
39873 	           xmlMemBlocks() - mem_base);
39874 	    test_ret++;
39875             printf(" %d", n_code);
39876             printf("\n");
39877         }
39878     }
39879     function_tests++;
39880 #endif
39881 
39882     return(test_ret);
39883 }
39884 
39885 
39886 static int
test_xmlUCSIsCypriotSyllabary(void)39887 test_xmlUCSIsCypriotSyllabary(void) {
39888     int test_ret = 0;
39889 
39890 #if defined(LIBXML_UNICODE_ENABLED)
39891     int mem_base;
39892     int ret_val;
39893     int code; /* UCS code point */
39894     int n_code;
39895 
39896     for (n_code = 0;n_code < gen_nb_int;n_code++) {
39897         mem_base = xmlMemBlocks();
39898         code = gen_int(n_code, 0);
39899 
39900         ret_val = xmlUCSIsCypriotSyllabary(code);
39901         desret_int(ret_val);
39902         call_tests++;
39903         des_int(n_code, code, 0);
39904         xmlResetLastError();
39905         if (mem_base != xmlMemBlocks()) {
39906             printf("Leak of %d blocks found in xmlUCSIsCypriotSyllabary",
39907 	           xmlMemBlocks() - mem_base);
39908 	    test_ret++;
39909             printf(" %d", n_code);
39910             printf("\n");
39911         }
39912     }
39913     function_tests++;
39914 #endif
39915 
39916     return(test_ret);
39917 }
39918 
39919 
39920 static int
test_xmlUCSIsCyrillic(void)39921 test_xmlUCSIsCyrillic(void) {
39922     int test_ret = 0;
39923 
39924 #if defined(LIBXML_UNICODE_ENABLED)
39925     int mem_base;
39926     int ret_val;
39927     int code; /* UCS code point */
39928     int n_code;
39929 
39930     for (n_code = 0;n_code < gen_nb_int;n_code++) {
39931         mem_base = xmlMemBlocks();
39932         code = gen_int(n_code, 0);
39933 
39934         ret_val = xmlUCSIsCyrillic(code);
39935         desret_int(ret_val);
39936         call_tests++;
39937         des_int(n_code, code, 0);
39938         xmlResetLastError();
39939         if (mem_base != xmlMemBlocks()) {
39940             printf("Leak of %d blocks found in xmlUCSIsCyrillic",
39941 	           xmlMemBlocks() - mem_base);
39942 	    test_ret++;
39943             printf(" %d", n_code);
39944             printf("\n");
39945         }
39946     }
39947     function_tests++;
39948 #endif
39949 
39950     return(test_ret);
39951 }
39952 
39953 
39954 static int
test_xmlUCSIsCyrillicSupplement(void)39955 test_xmlUCSIsCyrillicSupplement(void) {
39956     int test_ret = 0;
39957 
39958 #if defined(LIBXML_UNICODE_ENABLED)
39959     int mem_base;
39960     int ret_val;
39961     int code; /* UCS code point */
39962     int n_code;
39963 
39964     for (n_code = 0;n_code < gen_nb_int;n_code++) {
39965         mem_base = xmlMemBlocks();
39966         code = gen_int(n_code, 0);
39967 
39968         ret_val = xmlUCSIsCyrillicSupplement(code);
39969         desret_int(ret_val);
39970         call_tests++;
39971         des_int(n_code, code, 0);
39972         xmlResetLastError();
39973         if (mem_base != xmlMemBlocks()) {
39974             printf("Leak of %d blocks found in xmlUCSIsCyrillicSupplement",
39975 	           xmlMemBlocks() - mem_base);
39976 	    test_ret++;
39977             printf(" %d", n_code);
39978             printf("\n");
39979         }
39980     }
39981     function_tests++;
39982 #endif
39983 
39984     return(test_ret);
39985 }
39986 
39987 
39988 static int
test_xmlUCSIsDeseret(void)39989 test_xmlUCSIsDeseret(void) {
39990     int test_ret = 0;
39991 
39992 #if defined(LIBXML_UNICODE_ENABLED)
39993     int mem_base;
39994     int ret_val;
39995     int code; /* UCS code point */
39996     int n_code;
39997 
39998     for (n_code = 0;n_code < gen_nb_int;n_code++) {
39999         mem_base = xmlMemBlocks();
40000         code = gen_int(n_code, 0);
40001 
40002         ret_val = xmlUCSIsDeseret(code);
40003         desret_int(ret_val);
40004         call_tests++;
40005         des_int(n_code, code, 0);
40006         xmlResetLastError();
40007         if (mem_base != xmlMemBlocks()) {
40008             printf("Leak of %d blocks found in xmlUCSIsDeseret",
40009 	           xmlMemBlocks() - mem_base);
40010 	    test_ret++;
40011             printf(" %d", n_code);
40012             printf("\n");
40013         }
40014     }
40015     function_tests++;
40016 #endif
40017 
40018     return(test_ret);
40019 }
40020 
40021 
40022 static int
test_xmlUCSIsDevanagari(void)40023 test_xmlUCSIsDevanagari(void) {
40024     int test_ret = 0;
40025 
40026 #if defined(LIBXML_UNICODE_ENABLED)
40027     int mem_base;
40028     int ret_val;
40029     int code; /* UCS code point */
40030     int n_code;
40031 
40032     for (n_code = 0;n_code < gen_nb_int;n_code++) {
40033         mem_base = xmlMemBlocks();
40034         code = gen_int(n_code, 0);
40035 
40036         ret_val = xmlUCSIsDevanagari(code);
40037         desret_int(ret_val);
40038         call_tests++;
40039         des_int(n_code, code, 0);
40040         xmlResetLastError();
40041         if (mem_base != xmlMemBlocks()) {
40042             printf("Leak of %d blocks found in xmlUCSIsDevanagari",
40043 	           xmlMemBlocks() - mem_base);
40044 	    test_ret++;
40045             printf(" %d", n_code);
40046             printf("\n");
40047         }
40048     }
40049     function_tests++;
40050 #endif
40051 
40052     return(test_ret);
40053 }
40054 
40055 
40056 static int
test_xmlUCSIsDingbats(void)40057 test_xmlUCSIsDingbats(void) {
40058     int test_ret = 0;
40059 
40060 #if defined(LIBXML_UNICODE_ENABLED)
40061     int mem_base;
40062     int ret_val;
40063     int code; /* UCS code point */
40064     int n_code;
40065 
40066     for (n_code = 0;n_code < gen_nb_int;n_code++) {
40067         mem_base = xmlMemBlocks();
40068         code = gen_int(n_code, 0);
40069 
40070         ret_val = xmlUCSIsDingbats(code);
40071         desret_int(ret_val);
40072         call_tests++;
40073         des_int(n_code, code, 0);
40074         xmlResetLastError();
40075         if (mem_base != xmlMemBlocks()) {
40076             printf("Leak of %d blocks found in xmlUCSIsDingbats",
40077 	           xmlMemBlocks() - mem_base);
40078 	    test_ret++;
40079             printf(" %d", n_code);
40080             printf("\n");
40081         }
40082     }
40083     function_tests++;
40084 #endif
40085 
40086     return(test_ret);
40087 }
40088 
40089 
40090 static int
test_xmlUCSIsEnclosedAlphanumerics(void)40091 test_xmlUCSIsEnclosedAlphanumerics(void) {
40092     int test_ret = 0;
40093 
40094 #if defined(LIBXML_UNICODE_ENABLED)
40095     int mem_base;
40096     int ret_val;
40097     int code; /* UCS code point */
40098     int n_code;
40099 
40100     for (n_code = 0;n_code < gen_nb_int;n_code++) {
40101         mem_base = xmlMemBlocks();
40102         code = gen_int(n_code, 0);
40103 
40104         ret_val = xmlUCSIsEnclosedAlphanumerics(code);
40105         desret_int(ret_val);
40106         call_tests++;
40107         des_int(n_code, code, 0);
40108         xmlResetLastError();
40109         if (mem_base != xmlMemBlocks()) {
40110             printf("Leak of %d blocks found in xmlUCSIsEnclosedAlphanumerics",
40111 	           xmlMemBlocks() - mem_base);
40112 	    test_ret++;
40113             printf(" %d", n_code);
40114             printf("\n");
40115         }
40116     }
40117     function_tests++;
40118 #endif
40119 
40120     return(test_ret);
40121 }
40122 
40123 
40124 static int
test_xmlUCSIsEnclosedCJKLettersandMonths(void)40125 test_xmlUCSIsEnclosedCJKLettersandMonths(void) {
40126     int test_ret = 0;
40127 
40128 #if defined(LIBXML_UNICODE_ENABLED)
40129     int mem_base;
40130     int ret_val;
40131     int code; /* UCS code point */
40132     int n_code;
40133 
40134     for (n_code = 0;n_code < gen_nb_int;n_code++) {
40135         mem_base = xmlMemBlocks();
40136         code = gen_int(n_code, 0);
40137 
40138         ret_val = xmlUCSIsEnclosedCJKLettersandMonths(code);
40139         desret_int(ret_val);
40140         call_tests++;
40141         des_int(n_code, code, 0);
40142         xmlResetLastError();
40143         if (mem_base != xmlMemBlocks()) {
40144             printf("Leak of %d blocks found in xmlUCSIsEnclosedCJKLettersandMonths",
40145 	           xmlMemBlocks() - mem_base);
40146 	    test_ret++;
40147             printf(" %d", n_code);
40148             printf("\n");
40149         }
40150     }
40151     function_tests++;
40152 #endif
40153 
40154     return(test_ret);
40155 }
40156 
40157 
40158 static int
test_xmlUCSIsEthiopic(void)40159 test_xmlUCSIsEthiopic(void) {
40160     int test_ret = 0;
40161 
40162 #if defined(LIBXML_UNICODE_ENABLED)
40163     int mem_base;
40164     int ret_val;
40165     int code; /* UCS code point */
40166     int n_code;
40167 
40168     for (n_code = 0;n_code < gen_nb_int;n_code++) {
40169         mem_base = xmlMemBlocks();
40170         code = gen_int(n_code, 0);
40171 
40172         ret_val = xmlUCSIsEthiopic(code);
40173         desret_int(ret_val);
40174         call_tests++;
40175         des_int(n_code, code, 0);
40176         xmlResetLastError();
40177         if (mem_base != xmlMemBlocks()) {
40178             printf("Leak of %d blocks found in xmlUCSIsEthiopic",
40179 	           xmlMemBlocks() - mem_base);
40180 	    test_ret++;
40181             printf(" %d", n_code);
40182             printf("\n");
40183         }
40184     }
40185     function_tests++;
40186 #endif
40187 
40188     return(test_ret);
40189 }
40190 
40191 
40192 static int
test_xmlUCSIsGeneralPunctuation(void)40193 test_xmlUCSIsGeneralPunctuation(void) {
40194     int test_ret = 0;
40195 
40196 #if defined(LIBXML_UNICODE_ENABLED)
40197     int mem_base;
40198     int ret_val;
40199     int code; /* UCS code point */
40200     int n_code;
40201 
40202     for (n_code = 0;n_code < gen_nb_int;n_code++) {
40203         mem_base = xmlMemBlocks();
40204         code = gen_int(n_code, 0);
40205 
40206         ret_val = xmlUCSIsGeneralPunctuation(code);
40207         desret_int(ret_val);
40208         call_tests++;
40209         des_int(n_code, code, 0);
40210         xmlResetLastError();
40211         if (mem_base != xmlMemBlocks()) {
40212             printf("Leak of %d blocks found in xmlUCSIsGeneralPunctuation",
40213 	           xmlMemBlocks() - mem_base);
40214 	    test_ret++;
40215             printf(" %d", n_code);
40216             printf("\n");
40217         }
40218     }
40219     function_tests++;
40220 #endif
40221 
40222     return(test_ret);
40223 }
40224 
40225 
40226 static int
test_xmlUCSIsGeometricShapes(void)40227 test_xmlUCSIsGeometricShapes(void) {
40228     int test_ret = 0;
40229 
40230 #if defined(LIBXML_UNICODE_ENABLED)
40231     int mem_base;
40232     int ret_val;
40233     int code; /* UCS code point */
40234     int n_code;
40235 
40236     for (n_code = 0;n_code < gen_nb_int;n_code++) {
40237         mem_base = xmlMemBlocks();
40238         code = gen_int(n_code, 0);
40239 
40240         ret_val = xmlUCSIsGeometricShapes(code);
40241         desret_int(ret_val);
40242         call_tests++;
40243         des_int(n_code, code, 0);
40244         xmlResetLastError();
40245         if (mem_base != xmlMemBlocks()) {
40246             printf("Leak of %d blocks found in xmlUCSIsGeometricShapes",
40247 	           xmlMemBlocks() - mem_base);
40248 	    test_ret++;
40249             printf(" %d", n_code);
40250             printf("\n");
40251         }
40252     }
40253     function_tests++;
40254 #endif
40255 
40256     return(test_ret);
40257 }
40258 
40259 
40260 static int
test_xmlUCSIsGeorgian(void)40261 test_xmlUCSIsGeorgian(void) {
40262     int test_ret = 0;
40263 
40264 #if defined(LIBXML_UNICODE_ENABLED)
40265     int mem_base;
40266     int ret_val;
40267     int code; /* UCS code point */
40268     int n_code;
40269 
40270     for (n_code = 0;n_code < gen_nb_int;n_code++) {
40271         mem_base = xmlMemBlocks();
40272         code = gen_int(n_code, 0);
40273 
40274         ret_val = xmlUCSIsGeorgian(code);
40275         desret_int(ret_val);
40276         call_tests++;
40277         des_int(n_code, code, 0);
40278         xmlResetLastError();
40279         if (mem_base != xmlMemBlocks()) {
40280             printf("Leak of %d blocks found in xmlUCSIsGeorgian",
40281 	           xmlMemBlocks() - mem_base);
40282 	    test_ret++;
40283             printf(" %d", n_code);
40284             printf("\n");
40285         }
40286     }
40287     function_tests++;
40288 #endif
40289 
40290     return(test_ret);
40291 }
40292 
40293 
40294 static int
test_xmlUCSIsGothic(void)40295 test_xmlUCSIsGothic(void) {
40296     int test_ret = 0;
40297 
40298 #if defined(LIBXML_UNICODE_ENABLED)
40299     int mem_base;
40300     int ret_val;
40301     int code; /* UCS code point */
40302     int n_code;
40303 
40304     for (n_code = 0;n_code < gen_nb_int;n_code++) {
40305         mem_base = xmlMemBlocks();
40306         code = gen_int(n_code, 0);
40307 
40308         ret_val = xmlUCSIsGothic(code);
40309         desret_int(ret_val);
40310         call_tests++;
40311         des_int(n_code, code, 0);
40312         xmlResetLastError();
40313         if (mem_base != xmlMemBlocks()) {
40314             printf("Leak of %d blocks found in xmlUCSIsGothic",
40315 	           xmlMemBlocks() - mem_base);
40316 	    test_ret++;
40317             printf(" %d", n_code);
40318             printf("\n");
40319         }
40320     }
40321     function_tests++;
40322 #endif
40323 
40324     return(test_ret);
40325 }
40326 
40327 
40328 static int
test_xmlUCSIsGreek(void)40329 test_xmlUCSIsGreek(void) {
40330     int test_ret = 0;
40331 
40332 #if defined(LIBXML_UNICODE_ENABLED)
40333     int mem_base;
40334     int ret_val;
40335     int code; /* UCS code point */
40336     int n_code;
40337 
40338     for (n_code = 0;n_code < gen_nb_int;n_code++) {
40339         mem_base = xmlMemBlocks();
40340         code = gen_int(n_code, 0);
40341 
40342         ret_val = xmlUCSIsGreek(code);
40343         desret_int(ret_val);
40344         call_tests++;
40345         des_int(n_code, code, 0);
40346         xmlResetLastError();
40347         if (mem_base != xmlMemBlocks()) {
40348             printf("Leak of %d blocks found in xmlUCSIsGreek",
40349 	           xmlMemBlocks() - mem_base);
40350 	    test_ret++;
40351             printf(" %d", n_code);
40352             printf("\n");
40353         }
40354     }
40355     function_tests++;
40356 #endif
40357 
40358     return(test_ret);
40359 }
40360 
40361 
40362 static int
test_xmlUCSIsGreekExtended(void)40363 test_xmlUCSIsGreekExtended(void) {
40364     int test_ret = 0;
40365 
40366 #if defined(LIBXML_UNICODE_ENABLED)
40367     int mem_base;
40368     int ret_val;
40369     int code; /* UCS code point */
40370     int n_code;
40371 
40372     for (n_code = 0;n_code < gen_nb_int;n_code++) {
40373         mem_base = xmlMemBlocks();
40374         code = gen_int(n_code, 0);
40375 
40376         ret_val = xmlUCSIsGreekExtended(code);
40377         desret_int(ret_val);
40378         call_tests++;
40379         des_int(n_code, code, 0);
40380         xmlResetLastError();
40381         if (mem_base != xmlMemBlocks()) {
40382             printf("Leak of %d blocks found in xmlUCSIsGreekExtended",
40383 	           xmlMemBlocks() - mem_base);
40384 	    test_ret++;
40385             printf(" %d", n_code);
40386             printf("\n");
40387         }
40388     }
40389     function_tests++;
40390 #endif
40391 
40392     return(test_ret);
40393 }
40394 
40395 
40396 static int
test_xmlUCSIsGreekandCoptic(void)40397 test_xmlUCSIsGreekandCoptic(void) {
40398     int test_ret = 0;
40399 
40400 #if defined(LIBXML_UNICODE_ENABLED)
40401     int mem_base;
40402     int ret_val;
40403     int code; /* UCS code point */
40404     int n_code;
40405 
40406     for (n_code = 0;n_code < gen_nb_int;n_code++) {
40407         mem_base = xmlMemBlocks();
40408         code = gen_int(n_code, 0);
40409 
40410         ret_val = xmlUCSIsGreekandCoptic(code);
40411         desret_int(ret_val);
40412         call_tests++;
40413         des_int(n_code, code, 0);
40414         xmlResetLastError();
40415         if (mem_base != xmlMemBlocks()) {
40416             printf("Leak of %d blocks found in xmlUCSIsGreekandCoptic",
40417 	           xmlMemBlocks() - mem_base);
40418 	    test_ret++;
40419             printf(" %d", n_code);
40420             printf("\n");
40421         }
40422     }
40423     function_tests++;
40424 #endif
40425 
40426     return(test_ret);
40427 }
40428 
40429 
40430 static int
test_xmlUCSIsGujarati(void)40431 test_xmlUCSIsGujarati(void) {
40432     int test_ret = 0;
40433 
40434 #if defined(LIBXML_UNICODE_ENABLED)
40435     int mem_base;
40436     int ret_val;
40437     int code; /* UCS code point */
40438     int n_code;
40439 
40440     for (n_code = 0;n_code < gen_nb_int;n_code++) {
40441         mem_base = xmlMemBlocks();
40442         code = gen_int(n_code, 0);
40443 
40444         ret_val = xmlUCSIsGujarati(code);
40445         desret_int(ret_val);
40446         call_tests++;
40447         des_int(n_code, code, 0);
40448         xmlResetLastError();
40449         if (mem_base != xmlMemBlocks()) {
40450             printf("Leak of %d blocks found in xmlUCSIsGujarati",
40451 	           xmlMemBlocks() - mem_base);
40452 	    test_ret++;
40453             printf(" %d", n_code);
40454             printf("\n");
40455         }
40456     }
40457     function_tests++;
40458 #endif
40459 
40460     return(test_ret);
40461 }
40462 
40463 
40464 static int
test_xmlUCSIsGurmukhi(void)40465 test_xmlUCSIsGurmukhi(void) {
40466     int test_ret = 0;
40467 
40468 #if defined(LIBXML_UNICODE_ENABLED)
40469     int mem_base;
40470     int ret_val;
40471     int code; /* UCS code point */
40472     int n_code;
40473 
40474     for (n_code = 0;n_code < gen_nb_int;n_code++) {
40475         mem_base = xmlMemBlocks();
40476         code = gen_int(n_code, 0);
40477 
40478         ret_val = xmlUCSIsGurmukhi(code);
40479         desret_int(ret_val);
40480         call_tests++;
40481         des_int(n_code, code, 0);
40482         xmlResetLastError();
40483         if (mem_base != xmlMemBlocks()) {
40484             printf("Leak of %d blocks found in xmlUCSIsGurmukhi",
40485 	           xmlMemBlocks() - mem_base);
40486 	    test_ret++;
40487             printf(" %d", n_code);
40488             printf("\n");
40489         }
40490     }
40491     function_tests++;
40492 #endif
40493 
40494     return(test_ret);
40495 }
40496 
40497 
40498 static int
test_xmlUCSIsHalfwidthandFullwidthForms(void)40499 test_xmlUCSIsHalfwidthandFullwidthForms(void) {
40500     int test_ret = 0;
40501 
40502 #if defined(LIBXML_UNICODE_ENABLED)
40503     int mem_base;
40504     int ret_val;
40505     int code; /* UCS code point */
40506     int n_code;
40507 
40508     for (n_code = 0;n_code < gen_nb_int;n_code++) {
40509         mem_base = xmlMemBlocks();
40510         code = gen_int(n_code, 0);
40511 
40512         ret_val = xmlUCSIsHalfwidthandFullwidthForms(code);
40513         desret_int(ret_val);
40514         call_tests++;
40515         des_int(n_code, code, 0);
40516         xmlResetLastError();
40517         if (mem_base != xmlMemBlocks()) {
40518             printf("Leak of %d blocks found in xmlUCSIsHalfwidthandFullwidthForms",
40519 	           xmlMemBlocks() - mem_base);
40520 	    test_ret++;
40521             printf(" %d", n_code);
40522             printf("\n");
40523         }
40524     }
40525     function_tests++;
40526 #endif
40527 
40528     return(test_ret);
40529 }
40530 
40531 
40532 static int
test_xmlUCSIsHangulCompatibilityJamo(void)40533 test_xmlUCSIsHangulCompatibilityJamo(void) {
40534     int test_ret = 0;
40535 
40536 #if defined(LIBXML_UNICODE_ENABLED)
40537     int mem_base;
40538     int ret_val;
40539     int code; /* UCS code point */
40540     int n_code;
40541 
40542     for (n_code = 0;n_code < gen_nb_int;n_code++) {
40543         mem_base = xmlMemBlocks();
40544         code = gen_int(n_code, 0);
40545 
40546         ret_val = xmlUCSIsHangulCompatibilityJamo(code);
40547         desret_int(ret_val);
40548         call_tests++;
40549         des_int(n_code, code, 0);
40550         xmlResetLastError();
40551         if (mem_base != xmlMemBlocks()) {
40552             printf("Leak of %d blocks found in xmlUCSIsHangulCompatibilityJamo",
40553 	           xmlMemBlocks() - mem_base);
40554 	    test_ret++;
40555             printf(" %d", n_code);
40556             printf("\n");
40557         }
40558     }
40559     function_tests++;
40560 #endif
40561 
40562     return(test_ret);
40563 }
40564 
40565 
40566 static int
test_xmlUCSIsHangulJamo(void)40567 test_xmlUCSIsHangulJamo(void) {
40568     int test_ret = 0;
40569 
40570 #if defined(LIBXML_UNICODE_ENABLED)
40571     int mem_base;
40572     int ret_val;
40573     int code; /* UCS code point */
40574     int n_code;
40575 
40576     for (n_code = 0;n_code < gen_nb_int;n_code++) {
40577         mem_base = xmlMemBlocks();
40578         code = gen_int(n_code, 0);
40579 
40580         ret_val = xmlUCSIsHangulJamo(code);
40581         desret_int(ret_val);
40582         call_tests++;
40583         des_int(n_code, code, 0);
40584         xmlResetLastError();
40585         if (mem_base != xmlMemBlocks()) {
40586             printf("Leak of %d blocks found in xmlUCSIsHangulJamo",
40587 	           xmlMemBlocks() - mem_base);
40588 	    test_ret++;
40589             printf(" %d", n_code);
40590             printf("\n");
40591         }
40592     }
40593     function_tests++;
40594 #endif
40595 
40596     return(test_ret);
40597 }
40598 
40599 
40600 static int
test_xmlUCSIsHangulSyllables(void)40601 test_xmlUCSIsHangulSyllables(void) {
40602     int test_ret = 0;
40603 
40604 #if defined(LIBXML_UNICODE_ENABLED)
40605     int mem_base;
40606     int ret_val;
40607     int code; /* UCS code point */
40608     int n_code;
40609 
40610     for (n_code = 0;n_code < gen_nb_int;n_code++) {
40611         mem_base = xmlMemBlocks();
40612         code = gen_int(n_code, 0);
40613 
40614         ret_val = xmlUCSIsHangulSyllables(code);
40615         desret_int(ret_val);
40616         call_tests++;
40617         des_int(n_code, code, 0);
40618         xmlResetLastError();
40619         if (mem_base != xmlMemBlocks()) {
40620             printf("Leak of %d blocks found in xmlUCSIsHangulSyllables",
40621 	           xmlMemBlocks() - mem_base);
40622 	    test_ret++;
40623             printf(" %d", n_code);
40624             printf("\n");
40625         }
40626     }
40627     function_tests++;
40628 #endif
40629 
40630     return(test_ret);
40631 }
40632 
40633 
40634 static int
test_xmlUCSIsHanunoo(void)40635 test_xmlUCSIsHanunoo(void) {
40636     int test_ret = 0;
40637 
40638 #if defined(LIBXML_UNICODE_ENABLED)
40639     int mem_base;
40640     int ret_val;
40641     int code; /* UCS code point */
40642     int n_code;
40643 
40644     for (n_code = 0;n_code < gen_nb_int;n_code++) {
40645         mem_base = xmlMemBlocks();
40646         code = gen_int(n_code, 0);
40647 
40648         ret_val = xmlUCSIsHanunoo(code);
40649         desret_int(ret_val);
40650         call_tests++;
40651         des_int(n_code, code, 0);
40652         xmlResetLastError();
40653         if (mem_base != xmlMemBlocks()) {
40654             printf("Leak of %d blocks found in xmlUCSIsHanunoo",
40655 	           xmlMemBlocks() - mem_base);
40656 	    test_ret++;
40657             printf(" %d", n_code);
40658             printf("\n");
40659         }
40660     }
40661     function_tests++;
40662 #endif
40663 
40664     return(test_ret);
40665 }
40666 
40667 
40668 static int
test_xmlUCSIsHebrew(void)40669 test_xmlUCSIsHebrew(void) {
40670     int test_ret = 0;
40671 
40672 #if defined(LIBXML_UNICODE_ENABLED)
40673     int mem_base;
40674     int ret_val;
40675     int code; /* UCS code point */
40676     int n_code;
40677 
40678     for (n_code = 0;n_code < gen_nb_int;n_code++) {
40679         mem_base = xmlMemBlocks();
40680         code = gen_int(n_code, 0);
40681 
40682         ret_val = xmlUCSIsHebrew(code);
40683         desret_int(ret_val);
40684         call_tests++;
40685         des_int(n_code, code, 0);
40686         xmlResetLastError();
40687         if (mem_base != xmlMemBlocks()) {
40688             printf("Leak of %d blocks found in xmlUCSIsHebrew",
40689 	           xmlMemBlocks() - mem_base);
40690 	    test_ret++;
40691             printf(" %d", n_code);
40692             printf("\n");
40693         }
40694     }
40695     function_tests++;
40696 #endif
40697 
40698     return(test_ret);
40699 }
40700 
40701 
40702 static int
test_xmlUCSIsHighPrivateUseSurrogates(void)40703 test_xmlUCSIsHighPrivateUseSurrogates(void) {
40704     int test_ret = 0;
40705 
40706 #if defined(LIBXML_UNICODE_ENABLED)
40707     int mem_base;
40708     int ret_val;
40709     int code; /* UCS code point */
40710     int n_code;
40711 
40712     for (n_code = 0;n_code < gen_nb_int;n_code++) {
40713         mem_base = xmlMemBlocks();
40714         code = gen_int(n_code, 0);
40715 
40716         ret_val = xmlUCSIsHighPrivateUseSurrogates(code);
40717         desret_int(ret_val);
40718         call_tests++;
40719         des_int(n_code, code, 0);
40720         xmlResetLastError();
40721         if (mem_base != xmlMemBlocks()) {
40722             printf("Leak of %d blocks found in xmlUCSIsHighPrivateUseSurrogates",
40723 	           xmlMemBlocks() - mem_base);
40724 	    test_ret++;
40725             printf(" %d", n_code);
40726             printf("\n");
40727         }
40728     }
40729     function_tests++;
40730 #endif
40731 
40732     return(test_ret);
40733 }
40734 
40735 
40736 static int
test_xmlUCSIsHighSurrogates(void)40737 test_xmlUCSIsHighSurrogates(void) {
40738     int test_ret = 0;
40739 
40740 #if defined(LIBXML_UNICODE_ENABLED)
40741     int mem_base;
40742     int ret_val;
40743     int code; /* UCS code point */
40744     int n_code;
40745 
40746     for (n_code = 0;n_code < gen_nb_int;n_code++) {
40747         mem_base = xmlMemBlocks();
40748         code = gen_int(n_code, 0);
40749 
40750         ret_val = xmlUCSIsHighSurrogates(code);
40751         desret_int(ret_val);
40752         call_tests++;
40753         des_int(n_code, code, 0);
40754         xmlResetLastError();
40755         if (mem_base != xmlMemBlocks()) {
40756             printf("Leak of %d blocks found in xmlUCSIsHighSurrogates",
40757 	           xmlMemBlocks() - mem_base);
40758 	    test_ret++;
40759             printf(" %d", n_code);
40760             printf("\n");
40761         }
40762     }
40763     function_tests++;
40764 #endif
40765 
40766     return(test_ret);
40767 }
40768 
40769 
40770 static int
test_xmlUCSIsHiragana(void)40771 test_xmlUCSIsHiragana(void) {
40772     int test_ret = 0;
40773 
40774 #if defined(LIBXML_UNICODE_ENABLED)
40775     int mem_base;
40776     int ret_val;
40777     int code; /* UCS code point */
40778     int n_code;
40779 
40780     for (n_code = 0;n_code < gen_nb_int;n_code++) {
40781         mem_base = xmlMemBlocks();
40782         code = gen_int(n_code, 0);
40783 
40784         ret_val = xmlUCSIsHiragana(code);
40785         desret_int(ret_val);
40786         call_tests++;
40787         des_int(n_code, code, 0);
40788         xmlResetLastError();
40789         if (mem_base != xmlMemBlocks()) {
40790             printf("Leak of %d blocks found in xmlUCSIsHiragana",
40791 	           xmlMemBlocks() - mem_base);
40792 	    test_ret++;
40793             printf(" %d", n_code);
40794             printf("\n");
40795         }
40796     }
40797     function_tests++;
40798 #endif
40799 
40800     return(test_ret);
40801 }
40802 
40803 
40804 static int
test_xmlUCSIsIPAExtensions(void)40805 test_xmlUCSIsIPAExtensions(void) {
40806     int test_ret = 0;
40807 
40808 #if defined(LIBXML_UNICODE_ENABLED)
40809     int mem_base;
40810     int ret_val;
40811     int code; /* UCS code point */
40812     int n_code;
40813 
40814     for (n_code = 0;n_code < gen_nb_int;n_code++) {
40815         mem_base = xmlMemBlocks();
40816         code = gen_int(n_code, 0);
40817 
40818         ret_val = xmlUCSIsIPAExtensions(code);
40819         desret_int(ret_val);
40820         call_tests++;
40821         des_int(n_code, code, 0);
40822         xmlResetLastError();
40823         if (mem_base != xmlMemBlocks()) {
40824             printf("Leak of %d blocks found in xmlUCSIsIPAExtensions",
40825 	           xmlMemBlocks() - mem_base);
40826 	    test_ret++;
40827             printf(" %d", n_code);
40828             printf("\n");
40829         }
40830     }
40831     function_tests++;
40832 #endif
40833 
40834     return(test_ret);
40835 }
40836 
40837 
40838 static int
test_xmlUCSIsIdeographicDescriptionCharacters(void)40839 test_xmlUCSIsIdeographicDescriptionCharacters(void) {
40840     int test_ret = 0;
40841 
40842 #if defined(LIBXML_UNICODE_ENABLED)
40843     int mem_base;
40844     int ret_val;
40845     int code; /* UCS code point */
40846     int n_code;
40847 
40848     for (n_code = 0;n_code < gen_nb_int;n_code++) {
40849         mem_base = xmlMemBlocks();
40850         code = gen_int(n_code, 0);
40851 
40852         ret_val = xmlUCSIsIdeographicDescriptionCharacters(code);
40853         desret_int(ret_val);
40854         call_tests++;
40855         des_int(n_code, code, 0);
40856         xmlResetLastError();
40857         if (mem_base != xmlMemBlocks()) {
40858             printf("Leak of %d blocks found in xmlUCSIsIdeographicDescriptionCharacters",
40859 	           xmlMemBlocks() - mem_base);
40860 	    test_ret++;
40861             printf(" %d", n_code);
40862             printf("\n");
40863         }
40864     }
40865     function_tests++;
40866 #endif
40867 
40868     return(test_ret);
40869 }
40870 
40871 
40872 static int
test_xmlUCSIsKanbun(void)40873 test_xmlUCSIsKanbun(void) {
40874     int test_ret = 0;
40875 
40876 #if defined(LIBXML_UNICODE_ENABLED)
40877     int mem_base;
40878     int ret_val;
40879     int code; /* UCS code point */
40880     int n_code;
40881 
40882     for (n_code = 0;n_code < gen_nb_int;n_code++) {
40883         mem_base = xmlMemBlocks();
40884         code = gen_int(n_code, 0);
40885 
40886         ret_val = xmlUCSIsKanbun(code);
40887         desret_int(ret_val);
40888         call_tests++;
40889         des_int(n_code, code, 0);
40890         xmlResetLastError();
40891         if (mem_base != xmlMemBlocks()) {
40892             printf("Leak of %d blocks found in xmlUCSIsKanbun",
40893 	           xmlMemBlocks() - mem_base);
40894 	    test_ret++;
40895             printf(" %d", n_code);
40896             printf("\n");
40897         }
40898     }
40899     function_tests++;
40900 #endif
40901 
40902     return(test_ret);
40903 }
40904 
40905 
40906 static int
test_xmlUCSIsKangxiRadicals(void)40907 test_xmlUCSIsKangxiRadicals(void) {
40908     int test_ret = 0;
40909 
40910 #if defined(LIBXML_UNICODE_ENABLED)
40911     int mem_base;
40912     int ret_val;
40913     int code; /* UCS code point */
40914     int n_code;
40915 
40916     for (n_code = 0;n_code < gen_nb_int;n_code++) {
40917         mem_base = xmlMemBlocks();
40918         code = gen_int(n_code, 0);
40919 
40920         ret_val = xmlUCSIsKangxiRadicals(code);
40921         desret_int(ret_val);
40922         call_tests++;
40923         des_int(n_code, code, 0);
40924         xmlResetLastError();
40925         if (mem_base != xmlMemBlocks()) {
40926             printf("Leak of %d blocks found in xmlUCSIsKangxiRadicals",
40927 	           xmlMemBlocks() - mem_base);
40928 	    test_ret++;
40929             printf(" %d", n_code);
40930             printf("\n");
40931         }
40932     }
40933     function_tests++;
40934 #endif
40935 
40936     return(test_ret);
40937 }
40938 
40939 
40940 static int
test_xmlUCSIsKannada(void)40941 test_xmlUCSIsKannada(void) {
40942     int test_ret = 0;
40943 
40944 #if defined(LIBXML_UNICODE_ENABLED)
40945     int mem_base;
40946     int ret_val;
40947     int code; /* UCS code point */
40948     int n_code;
40949 
40950     for (n_code = 0;n_code < gen_nb_int;n_code++) {
40951         mem_base = xmlMemBlocks();
40952         code = gen_int(n_code, 0);
40953 
40954         ret_val = xmlUCSIsKannada(code);
40955         desret_int(ret_val);
40956         call_tests++;
40957         des_int(n_code, code, 0);
40958         xmlResetLastError();
40959         if (mem_base != xmlMemBlocks()) {
40960             printf("Leak of %d blocks found in xmlUCSIsKannada",
40961 	           xmlMemBlocks() - mem_base);
40962 	    test_ret++;
40963             printf(" %d", n_code);
40964             printf("\n");
40965         }
40966     }
40967     function_tests++;
40968 #endif
40969 
40970     return(test_ret);
40971 }
40972 
40973 
40974 static int
test_xmlUCSIsKatakana(void)40975 test_xmlUCSIsKatakana(void) {
40976     int test_ret = 0;
40977 
40978 #if defined(LIBXML_UNICODE_ENABLED)
40979     int mem_base;
40980     int ret_val;
40981     int code; /* UCS code point */
40982     int n_code;
40983 
40984     for (n_code = 0;n_code < gen_nb_int;n_code++) {
40985         mem_base = xmlMemBlocks();
40986         code = gen_int(n_code, 0);
40987 
40988         ret_val = xmlUCSIsKatakana(code);
40989         desret_int(ret_val);
40990         call_tests++;
40991         des_int(n_code, code, 0);
40992         xmlResetLastError();
40993         if (mem_base != xmlMemBlocks()) {
40994             printf("Leak of %d blocks found in xmlUCSIsKatakana",
40995 	           xmlMemBlocks() - mem_base);
40996 	    test_ret++;
40997             printf(" %d", n_code);
40998             printf("\n");
40999         }
41000     }
41001     function_tests++;
41002 #endif
41003 
41004     return(test_ret);
41005 }
41006 
41007 
41008 static int
test_xmlUCSIsKatakanaPhoneticExtensions(void)41009 test_xmlUCSIsKatakanaPhoneticExtensions(void) {
41010     int test_ret = 0;
41011 
41012 #if defined(LIBXML_UNICODE_ENABLED)
41013     int mem_base;
41014     int ret_val;
41015     int code; /* UCS code point */
41016     int n_code;
41017 
41018     for (n_code = 0;n_code < gen_nb_int;n_code++) {
41019         mem_base = xmlMemBlocks();
41020         code = gen_int(n_code, 0);
41021 
41022         ret_val = xmlUCSIsKatakanaPhoneticExtensions(code);
41023         desret_int(ret_val);
41024         call_tests++;
41025         des_int(n_code, code, 0);
41026         xmlResetLastError();
41027         if (mem_base != xmlMemBlocks()) {
41028             printf("Leak of %d blocks found in xmlUCSIsKatakanaPhoneticExtensions",
41029 	           xmlMemBlocks() - mem_base);
41030 	    test_ret++;
41031             printf(" %d", n_code);
41032             printf("\n");
41033         }
41034     }
41035     function_tests++;
41036 #endif
41037 
41038     return(test_ret);
41039 }
41040 
41041 
41042 static int
test_xmlUCSIsKhmer(void)41043 test_xmlUCSIsKhmer(void) {
41044     int test_ret = 0;
41045 
41046 #if defined(LIBXML_UNICODE_ENABLED)
41047     int mem_base;
41048     int ret_val;
41049     int code; /* UCS code point */
41050     int n_code;
41051 
41052     for (n_code = 0;n_code < gen_nb_int;n_code++) {
41053         mem_base = xmlMemBlocks();
41054         code = gen_int(n_code, 0);
41055 
41056         ret_val = xmlUCSIsKhmer(code);
41057         desret_int(ret_val);
41058         call_tests++;
41059         des_int(n_code, code, 0);
41060         xmlResetLastError();
41061         if (mem_base != xmlMemBlocks()) {
41062             printf("Leak of %d blocks found in xmlUCSIsKhmer",
41063 	           xmlMemBlocks() - mem_base);
41064 	    test_ret++;
41065             printf(" %d", n_code);
41066             printf("\n");
41067         }
41068     }
41069     function_tests++;
41070 #endif
41071 
41072     return(test_ret);
41073 }
41074 
41075 
41076 static int
test_xmlUCSIsKhmerSymbols(void)41077 test_xmlUCSIsKhmerSymbols(void) {
41078     int test_ret = 0;
41079 
41080 #if defined(LIBXML_UNICODE_ENABLED)
41081     int mem_base;
41082     int ret_val;
41083     int code; /* UCS code point */
41084     int n_code;
41085 
41086     for (n_code = 0;n_code < gen_nb_int;n_code++) {
41087         mem_base = xmlMemBlocks();
41088         code = gen_int(n_code, 0);
41089 
41090         ret_val = xmlUCSIsKhmerSymbols(code);
41091         desret_int(ret_val);
41092         call_tests++;
41093         des_int(n_code, code, 0);
41094         xmlResetLastError();
41095         if (mem_base != xmlMemBlocks()) {
41096             printf("Leak of %d blocks found in xmlUCSIsKhmerSymbols",
41097 	           xmlMemBlocks() - mem_base);
41098 	    test_ret++;
41099             printf(" %d", n_code);
41100             printf("\n");
41101         }
41102     }
41103     function_tests++;
41104 #endif
41105 
41106     return(test_ret);
41107 }
41108 
41109 
41110 static int
test_xmlUCSIsLao(void)41111 test_xmlUCSIsLao(void) {
41112     int test_ret = 0;
41113 
41114 #if defined(LIBXML_UNICODE_ENABLED)
41115     int mem_base;
41116     int ret_val;
41117     int code; /* UCS code point */
41118     int n_code;
41119 
41120     for (n_code = 0;n_code < gen_nb_int;n_code++) {
41121         mem_base = xmlMemBlocks();
41122         code = gen_int(n_code, 0);
41123 
41124         ret_val = xmlUCSIsLao(code);
41125         desret_int(ret_val);
41126         call_tests++;
41127         des_int(n_code, code, 0);
41128         xmlResetLastError();
41129         if (mem_base != xmlMemBlocks()) {
41130             printf("Leak of %d blocks found in xmlUCSIsLao",
41131 	           xmlMemBlocks() - mem_base);
41132 	    test_ret++;
41133             printf(" %d", n_code);
41134             printf("\n");
41135         }
41136     }
41137     function_tests++;
41138 #endif
41139 
41140     return(test_ret);
41141 }
41142 
41143 
41144 static int
test_xmlUCSIsLatin1Supplement(void)41145 test_xmlUCSIsLatin1Supplement(void) {
41146     int test_ret = 0;
41147 
41148 #if defined(LIBXML_UNICODE_ENABLED)
41149     int mem_base;
41150     int ret_val;
41151     int code; /* UCS code point */
41152     int n_code;
41153 
41154     for (n_code = 0;n_code < gen_nb_int;n_code++) {
41155         mem_base = xmlMemBlocks();
41156         code = gen_int(n_code, 0);
41157 
41158         ret_val = xmlUCSIsLatin1Supplement(code);
41159         desret_int(ret_val);
41160         call_tests++;
41161         des_int(n_code, code, 0);
41162         xmlResetLastError();
41163         if (mem_base != xmlMemBlocks()) {
41164             printf("Leak of %d blocks found in xmlUCSIsLatin1Supplement",
41165 	           xmlMemBlocks() - mem_base);
41166 	    test_ret++;
41167             printf(" %d", n_code);
41168             printf("\n");
41169         }
41170     }
41171     function_tests++;
41172 #endif
41173 
41174     return(test_ret);
41175 }
41176 
41177 
41178 static int
test_xmlUCSIsLatinExtendedA(void)41179 test_xmlUCSIsLatinExtendedA(void) {
41180     int test_ret = 0;
41181 
41182 #if defined(LIBXML_UNICODE_ENABLED)
41183     int mem_base;
41184     int ret_val;
41185     int code; /* UCS code point */
41186     int n_code;
41187 
41188     for (n_code = 0;n_code < gen_nb_int;n_code++) {
41189         mem_base = xmlMemBlocks();
41190         code = gen_int(n_code, 0);
41191 
41192         ret_val = xmlUCSIsLatinExtendedA(code);
41193         desret_int(ret_val);
41194         call_tests++;
41195         des_int(n_code, code, 0);
41196         xmlResetLastError();
41197         if (mem_base != xmlMemBlocks()) {
41198             printf("Leak of %d blocks found in xmlUCSIsLatinExtendedA",
41199 	           xmlMemBlocks() - mem_base);
41200 	    test_ret++;
41201             printf(" %d", n_code);
41202             printf("\n");
41203         }
41204     }
41205     function_tests++;
41206 #endif
41207 
41208     return(test_ret);
41209 }
41210 
41211 
41212 static int
test_xmlUCSIsLatinExtendedAdditional(void)41213 test_xmlUCSIsLatinExtendedAdditional(void) {
41214     int test_ret = 0;
41215 
41216 #if defined(LIBXML_UNICODE_ENABLED)
41217     int mem_base;
41218     int ret_val;
41219     int code; /* UCS code point */
41220     int n_code;
41221 
41222     for (n_code = 0;n_code < gen_nb_int;n_code++) {
41223         mem_base = xmlMemBlocks();
41224         code = gen_int(n_code, 0);
41225 
41226         ret_val = xmlUCSIsLatinExtendedAdditional(code);
41227         desret_int(ret_val);
41228         call_tests++;
41229         des_int(n_code, code, 0);
41230         xmlResetLastError();
41231         if (mem_base != xmlMemBlocks()) {
41232             printf("Leak of %d blocks found in xmlUCSIsLatinExtendedAdditional",
41233 	           xmlMemBlocks() - mem_base);
41234 	    test_ret++;
41235             printf(" %d", n_code);
41236             printf("\n");
41237         }
41238     }
41239     function_tests++;
41240 #endif
41241 
41242     return(test_ret);
41243 }
41244 
41245 
41246 static int
test_xmlUCSIsLatinExtendedB(void)41247 test_xmlUCSIsLatinExtendedB(void) {
41248     int test_ret = 0;
41249 
41250 #if defined(LIBXML_UNICODE_ENABLED)
41251     int mem_base;
41252     int ret_val;
41253     int code; /* UCS code point */
41254     int n_code;
41255 
41256     for (n_code = 0;n_code < gen_nb_int;n_code++) {
41257         mem_base = xmlMemBlocks();
41258         code = gen_int(n_code, 0);
41259 
41260         ret_val = xmlUCSIsLatinExtendedB(code);
41261         desret_int(ret_val);
41262         call_tests++;
41263         des_int(n_code, code, 0);
41264         xmlResetLastError();
41265         if (mem_base != xmlMemBlocks()) {
41266             printf("Leak of %d blocks found in xmlUCSIsLatinExtendedB",
41267 	           xmlMemBlocks() - mem_base);
41268 	    test_ret++;
41269             printf(" %d", n_code);
41270             printf("\n");
41271         }
41272     }
41273     function_tests++;
41274 #endif
41275 
41276     return(test_ret);
41277 }
41278 
41279 
41280 static int
test_xmlUCSIsLetterlikeSymbols(void)41281 test_xmlUCSIsLetterlikeSymbols(void) {
41282     int test_ret = 0;
41283 
41284 #if defined(LIBXML_UNICODE_ENABLED)
41285     int mem_base;
41286     int ret_val;
41287     int code; /* UCS code point */
41288     int n_code;
41289 
41290     for (n_code = 0;n_code < gen_nb_int;n_code++) {
41291         mem_base = xmlMemBlocks();
41292         code = gen_int(n_code, 0);
41293 
41294         ret_val = xmlUCSIsLetterlikeSymbols(code);
41295         desret_int(ret_val);
41296         call_tests++;
41297         des_int(n_code, code, 0);
41298         xmlResetLastError();
41299         if (mem_base != xmlMemBlocks()) {
41300             printf("Leak of %d blocks found in xmlUCSIsLetterlikeSymbols",
41301 	           xmlMemBlocks() - mem_base);
41302 	    test_ret++;
41303             printf(" %d", n_code);
41304             printf("\n");
41305         }
41306     }
41307     function_tests++;
41308 #endif
41309 
41310     return(test_ret);
41311 }
41312 
41313 
41314 static int
test_xmlUCSIsLimbu(void)41315 test_xmlUCSIsLimbu(void) {
41316     int test_ret = 0;
41317 
41318 #if defined(LIBXML_UNICODE_ENABLED)
41319     int mem_base;
41320     int ret_val;
41321     int code; /* UCS code point */
41322     int n_code;
41323 
41324     for (n_code = 0;n_code < gen_nb_int;n_code++) {
41325         mem_base = xmlMemBlocks();
41326         code = gen_int(n_code, 0);
41327 
41328         ret_val = xmlUCSIsLimbu(code);
41329         desret_int(ret_val);
41330         call_tests++;
41331         des_int(n_code, code, 0);
41332         xmlResetLastError();
41333         if (mem_base != xmlMemBlocks()) {
41334             printf("Leak of %d blocks found in xmlUCSIsLimbu",
41335 	           xmlMemBlocks() - mem_base);
41336 	    test_ret++;
41337             printf(" %d", n_code);
41338             printf("\n");
41339         }
41340     }
41341     function_tests++;
41342 #endif
41343 
41344     return(test_ret);
41345 }
41346 
41347 
41348 static int
test_xmlUCSIsLinearBIdeograms(void)41349 test_xmlUCSIsLinearBIdeograms(void) {
41350     int test_ret = 0;
41351 
41352 #if defined(LIBXML_UNICODE_ENABLED)
41353     int mem_base;
41354     int ret_val;
41355     int code; /* UCS code point */
41356     int n_code;
41357 
41358     for (n_code = 0;n_code < gen_nb_int;n_code++) {
41359         mem_base = xmlMemBlocks();
41360         code = gen_int(n_code, 0);
41361 
41362         ret_val = xmlUCSIsLinearBIdeograms(code);
41363         desret_int(ret_val);
41364         call_tests++;
41365         des_int(n_code, code, 0);
41366         xmlResetLastError();
41367         if (mem_base != xmlMemBlocks()) {
41368             printf("Leak of %d blocks found in xmlUCSIsLinearBIdeograms",
41369 	           xmlMemBlocks() - mem_base);
41370 	    test_ret++;
41371             printf(" %d", n_code);
41372             printf("\n");
41373         }
41374     }
41375     function_tests++;
41376 #endif
41377 
41378     return(test_ret);
41379 }
41380 
41381 
41382 static int
test_xmlUCSIsLinearBSyllabary(void)41383 test_xmlUCSIsLinearBSyllabary(void) {
41384     int test_ret = 0;
41385 
41386 #if defined(LIBXML_UNICODE_ENABLED)
41387     int mem_base;
41388     int ret_val;
41389     int code; /* UCS code point */
41390     int n_code;
41391 
41392     for (n_code = 0;n_code < gen_nb_int;n_code++) {
41393         mem_base = xmlMemBlocks();
41394         code = gen_int(n_code, 0);
41395 
41396         ret_val = xmlUCSIsLinearBSyllabary(code);
41397         desret_int(ret_val);
41398         call_tests++;
41399         des_int(n_code, code, 0);
41400         xmlResetLastError();
41401         if (mem_base != xmlMemBlocks()) {
41402             printf("Leak of %d blocks found in xmlUCSIsLinearBSyllabary",
41403 	           xmlMemBlocks() - mem_base);
41404 	    test_ret++;
41405             printf(" %d", n_code);
41406             printf("\n");
41407         }
41408     }
41409     function_tests++;
41410 #endif
41411 
41412     return(test_ret);
41413 }
41414 
41415 
41416 static int
test_xmlUCSIsLowSurrogates(void)41417 test_xmlUCSIsLowSurrogates(void) {
41418     int test_ret = 0;
41419 
41420 #if defined(LIBXML_UNICODE_ENABLED)
41421     int mem_base;
41422     int ret_val;
41423     int code; /* UCS code point */
41424     int n_code;
41425 
41426     for (n_code = 0;n_code < gen_nb_int;n_code++) {
41427         mem_base = xmlMemBlocks();
41428         code = gen_int(n_code, 0);
41429 
41430         ret_val = xmlUCSIsLowSurrogates(code);
41431         desret_int(ret_val);
41432         call_tests++;
41433         des_int(n_code, code, 0);
41434         xmlResetLastError();
41435         if (mem_base != xmlMemBlocks()) {
41436             printf("Leak of %d blocks found in xmlUCSIsLowSurrogates",
41437 	           xmlMemBlocks() - mem_base);
41438 	    test_ret++;
41439             printf(" %d", n_code);
41440             printf("\n");
41441         }
41442     }
41443     function_tests++;
41444 #endif
41445 
41446     return(test_ret);
41447 }
41448 
41449 
41450 static int
test_xmlUCSIsMalayalam(void)41451 test_xmlUCSIsMalayalam(void) {
41452     int test_ret = 0;
41453 
41454 #if defined(LIBXML_UNICODE_ENABLED)
41455     int mem_base;
41456     int ret_val;
41457     int code; /* UCS code point */
41458     int n_code;
41459 
41460     for (n_code = 0;n_code < gen_nb_int;n_code++) {
41461         mem_base = xmlMemBlocks();
41462         code = gen_int(n_code, 0);
41463 
41464         ret_val = xmlUCSIsMalayalam(code);
41465         desret_int(ret_val);
41466         call_tests++;
41467         des_int(n_code, code, 0);
41468         xmlResetLastError();
41469         if (mem_base != xmlMemBlocks()) {
41470             printf("Leak of %d blocks found in xmlUCSIsMalayalam",
41471 	           xmlMemBlocks() - mem_base);
41472 	    test_ret++;
41473             printf(" %d", n_code);
41474             printf("\n");
41475         }
41476     }
41477     function_tests++;
41478 #endif
41479 
41480     return(test_ret);
41481 }
41482 
41483 
41484 static int
test_xmlUCSIsMathematicalAlphanumericSymbols(void)41485 test_xmlUCSIsMathematicalAlphanumericSymbols(void) {
41486     int test_ret = 0;
41487 
41488 #if defined(LIBXML_UNICODE_ENABLED)
41489     int mem_base;
41490     int ret_val;
41491     int code; /* UCS code point */
41492     int n_code;
41493 
41494     for (n_code = 0;n_code < gen_nb_int;n_code++) {
41495         mem_base = xmlMemBlocks();
41496         code = gen_int(n_code, 0);
41497 
41498         ret_val = xmlUCSIsMathematicalAlphanumericSymbols(code);
41499         desret_int(ret_val);
41500         call_tests++;
41501         des_int(n_code, code, 0);
41502         xmlResetLastError();
41503         if (mem_base != xmlMemBlocks()) {
41504             printf("Leak of %d blocks found in xmlUCSIsMathematicalAlphanumericSymbols",
41505 	           xmlMemBlocks() - mem_base);
41506 	    test_ret++;
41507             printf(" %d", n_code);
41508             printf("\n");
41509         }
41510     }
41511     function_tests++;
41512 #endif
41513 
41514     return(test_ret);
41515 }
41516 
41517 
41518 static int
test_xmlUCSIsMathematicalOperators(void)41519 test_xmlUCSIsMathematicalOperators(void) {
41520     int test_ret = 0;
41521 
41522 #if defined(LIBXML_UNICODE_ENABLED)
41523     int mem_base;
41524     int ret_val;
41525     int code; /* UCS code point */
41526     int n_code;
41527 
41528     for (n_code = 0;n_code < gen_nb_int;n_code++) {
41529         mem_base = xmlMemBlocks();
41530         code = gen_int(n_code, 0);
41531 
41532         ret_val = xmlUCSIsMathematicalOperators(code);
41533         desret_int(ret_val);
41534         call_tests++;
41535         des_int(n_code, code, 0);
41536         xmlResetLastError();
41537         if (mem_base != xmlMemBlocks()) {
41538             printf("Leak of %d blocks found in xmlUCSIsMathematicalOperators",
41539 	           xmlMemBlocks() - mem_base);
41540 	    test_ret++;
41541             printf(" %d", n_code);
41542             printf("\n");
41543         }
41544     }
41545     function_tests++;
41546 #endif
41547 
41548     return(test_ret);
41549 }
41550 
41551 
41552 static int
test_xmlUCSIsMiscellaneousMathematicalSymbolsA(void)41553 test_xmlUCSIsMiscellaneousMathematicalSymbolsA(void) {
41554     int test_ret = 0;
41555 
41556 #if defined(LIBXML_UNICODE_ENABLED)
41557     int mem_base;
41558     int ret_val;
41559     int code; /* UCS code point */
41560     int n_code;
41561 
41562     for (n_code = 0;n_code < gen_nb_int;n_code++) {
41563         mem_base = xmlMemBlocks();
41564         code = gen_int(n_code, 0);
41565 
41566         ret_val = xmlUCSIsMiscellaneousMathematicalSymbolsA(code);
41567         desret_int(ret_val);
41568         call_tests++;
41569         des_int(n_code, code, 0);
41570         xmlResetLastError();
41571         if (mem_base != xmlMemBlocks()) {
41572             printf("Leak of %d blocks found in xmlUCSIsMiscellaneousMathematicalSymbolsA",
41573 	           xmlMemBlocks() - mem_base);
41574 	    test_ret++;
41575             printf(" %d", n_code);
41576             printf("\n");
41577         }
41578     }
41579     function_tests++;
41580 #endif
41581 
41582     return(test_ret);
41583 }
41584 
41585 
41586 static int
test_xmlUCSIsMiscellaneousMathematicalSymbolsB(void)41587 test_xmlUCSIsMiscellaneousMathematicalSymbolsB(void) {
41588     int test_ret = 0;
41589 
41590 #if defined(LIBXML_UNICODE_ENABLED)
41591     int mem_base;
41592     int ret_val;
41593     int code; /* UCS code point */
41594     int n_code;
41595 
41596     for (n_code = 0;n_code < gen_nb_int;n_code++) {
41597         mem_base = xmlMemBlocks();
41598         code = gen_int(n_code, 0);
41599 
41600         ret_val = xmlUCSIsMiscellaneousMathematicalSymbolsB(code);
41601         desret_int(ret_val);
41602         call_tests++;
41603         des_int(n_code, code, 0);
41604         xmlResetLastError();
41605         if (mem_base != xmlMemBlocks()) {
41606             printf("Leak of %d blocks found in xmlUCSIsMiscellaneousMathematicalSymbolsB",
41607 	           xmlMemBlocks() - mem_base);
41608 	    test_ret++;
41609             printf(" %d", n_code);
41610             printf("\n");
41611         }
41612     }
41613     function_tests++;
41614 #endif
41615 
41616     return(test_ret);
41617 }
41618 
41619 
41620 static int
test_xmlUCSIsMiscellaneousSymbols(void)41621 test_xmlUCSIsMiscellaneousSymbols(void) {
41622     int test_ret = 0;
41623 
41624 #if defined(LIBXML_UNICODE_ENABLED)
41625     int mem_base;
41626     int ret_val;
41627     int code; /* UCS code point */
41628     int n_code;
41629 
41630     for (n_code = 0;n_code < gen_nb_int;n_code++) {
41631         mem_base = xmlMemBlocks();
41632         code = gen_int(n_code, 0);
41633 
41634         ret_val = xmlUCSIsMiscellaneousSymbols(code);
41635         desret_int(ret_val);
41636         call_tests++;
41637         des_int(n_code, code, 0);
41638         xmlResetLastError();
41639         if (mem_base != xmlMemBlocks()) {
41640             printf("Leak of %d blocks found in xmlUCSIsMiscellaneousSymbols",
41641 	           xmlMemBlocks() - mem_base);
41642 	    test_ret++;
41643             printf(" %d", n_code);
41644             printf("\n");
41645         }
41646     }
41647     function_tests++;
41648 #endif
41649 
41650     return(test_ret);
41651 }
41652 
41653 
41654 static int
test_xmlUCSIsMiscellaneousSymbolsandArrows(void)41655 test_xmlUCSIsMiscellaneousSymbolsandArrows(void) {
41656     int test_ret = 0;
41657 
41658 #if defined(LIBXML_UNICODE_ENABLED)
41659     int mem_base;
41660     int ret_val;
41661     int code; /* UCS code point */
41662     int n_code;
41663 
41664     for (n_code = 0;n_code < gen_nb_int;n_code++) {
41665         mem_base = xmlMemBlocks();
41666         code = gen_int(n_code, 0);
41667 
41668         ret_val = xmlUCSIsMiscellaneousSymbolsandArrows(code);
41669         desret_int(ret_val);
41670         call_tests++;
41671         des_int(n_code, code, 0);
41672         xmlResetLastError();
41673         if (mem_base != xmlMemBlocks()) {
41674             printf("Leak of %d blocks found in xmlUCSIsMiscellaneousSymbolsandArrows",
41675 	           xmlMemBlocks() - mem_base);
41676 	    test_ret++;
41677             printf(" %d", n_code);
41678             printf("\n");
41679         }
41680     }
41681     function_tests++;
41682 #endif
41683 
41684     return(test_ret);
41685 }
41686 
41687 
41688 static int
test_xmlUCSIsMiscellaneousTechnical(void)41689 test_xmlUCSIsMiscellaneousTechnical(void) {
41690     int test_ret = 0;
41691 
41692 #if defined(LIBXML_UNICODE_ENABLED)
41693     int mem_base;
41694     int ret_val;
41695     int code; /* UCS code point */
41696     int n_code;
41697 
41698     for (n_code = 0;n_code < gen_nb_int;n_code++) {
41699         mem_base = xmlMemBlocks();
41700         code = gen_int(n_code, 0);
41701 
41702         ret_val = xmlUCSIsMiscellaneousTechnical(code);
41703         desret_int(ret_val);
41704         call_tests++;
41705         des_int(n_code, code, 0);
41706         xmlResetLastError();
41707         if (mem_base != xmlMemBlocks()) {
41708             printf("Leak of %d blocks found in xmlUCSIsMiscellaneousTechnical",
41709 	           xmlMemBlocks() - mem_base);
41710 	    test_ret++;
41711             printf(" %d", n_code);
41712             printf("\n");
41713         }
41714     }
41715     function_tests++;
41716 #endif
41717 
41718     return(test_ret);
41719 }
41720 
41721 
41722 static int
test_xmlUCSIsMongolian(void)41723 test_xmlUCSIsMongolian(void) {
41724     int test_ret = 0;
41725 
41726 #if defined(LIBXML_UNICODE_ENABLED)
41727     int mem_base;
41728     int ret_val;
41729     int code; /* UCS code point */
41730     int n_code;
41731 
41732     for (n_code = 0;n_code < gen_nb_int;n_code++) {
41733         mem_base = xmlMemBlocks();
41734         code = gen_int(n_code, 0);
41735 
41736         ret_val = xmlUCSIsMongolian(code);
41737         desret_int(ret_val);
41738         call_tests++;
41739         des_int(n_code, code, 0);
41740         xmlResetLastError();
41741         if (mem_base != xmlMemBlocks()) {
41742             printf("Leak of %d blocks found in xmlUCSIsMongolian",
41743 	           xmlMemBlocks() - mem_base);
41744 	    test_ret++;
41745             printf(" %d", n_code);
41746             printf("\n");
41747         }
41748     }
41749     function_tests++;
41750 #endif
41751 
41752     return(test_ret);
41753 }
41754 
41755 
41756 static int
test_xmlUCSIsMusicalSymbols(void)41757 test_xmlUCSIsMusicalSymbols(void) {
41758     int test_ret = 0;
41759 
41760 #if defined(LIBXML_UNICODE_ENABLED)
41761     int mem_base;
41762     int ret_val;
41763     int code; /* UCS code point */
41764     int n_code;
41765 
41766     for (n_code = 0;n_code < gen_nb_int;n_code++) {
41767         mem_base = xmlMemBlocks();
41768         code = gen_int(n_code, 0);
41769 
41770         ret_val = xmlUCSIsMusicalSymbols(code);
41771         desret_int(ret_val);
41772         call_tests++;
41773         des_int(n_code, code, 0);
41774         xmlResetLastError();
41775         if (mem_base != xmlMemBlocks()) {
41776             printf("Leak of %d blocks found in xmlUCSIsMusicalSymbols",
41777 	           xmlMemBlocks() - mem_base);
41778 	    test_ret++;
41779             printf(" %d", n_code);
41780             printf("\n");
41781         }
41782     }
41783     function_tests++;
41784 #endif
41785 
41786     return(test_ret);
41787 }
41788 
41789 
41790 static int
test_xmlUCSIsMyanmar(void)41791 test_xmlUCSIsMyanmar(void) {
41792     int test_ret = 0;
41793 
41794 #if defined(LIBXML_UNICODE_ENABLED)
41795     int mem_base;
41796     int ret_val;
41797     int code; /* UCS code point */
41798     int n_code;
41799 
41800     for (n_code = 0;n_code < gen_nb_int;n_code++) {
41801         mem_base = xmlMemBlocks();
41802         code = gen_int(n_code, 0);
41803 
41804         ret_val = xmlUCSIsMyanmar(code);
41805         desret_int(ret_val);
41806         call_tests++;
41807         des_int(n_code, code, 0);
41808         xmlResetLastError();
41809         if (mem_base != xmlMemBlocks()) {
41810             printf("Leak of %d blocks found in xmlUCSIsMyanmar",
41811 	           xmlMemBlocks() - mem_base);
41812 	    test_ret++;
41813             printf(" %d", n_code);
41814             printf("\n");
41815         }
41816     }
41817     function_tests++;
41818 #endif
41819 
41820     return(test_ret);
41821 }
41822 
41823 
41824 static int
test_xmlUCSIsNumberForms(void)41825 test_xmlUCSIsNumberForms(void) {
41826     int test_ret = 0;
41827 
41828 #if defined(LIBXML_UNICODE_ENABLED)
41829     int mem_base;
41830     int ret_val;
41831     int code; /* UCS code point */
41832     int n_code;
41833 
41834     for (n_code = 0;n_code < gen_nb_int;n_code++) {
41835         mem_base = xmlMemBlocks();
41836         code = gen_int(n_code, 0);
41837 
41838         ret_val = xmlUCSIsNumberForms(code);
41839         desret_int(ret_val);
41840         call_tests++;
41841         des_int(n_code, code, 0);
41842         xmlResetLastError();
41843         if (mem_base != xmlMemBlocks()) {
41844             printf("Leak of %d blocks found in xmlUCSIsNumberForms",
41845 	           xmlMemBlocks() - mem_base);
41846 	    test_ret++;
41847             printf(" %d", n_code);
41848             printf("\n");
41849         }
41850     }
41851     function_tests++;
41852 #endif
41853 
41854     return(test_ret);
41855 }
41856 
41857 
41858 static int
test_xmlUCSIsOgham(void)41859 test_xmlUCSIsOgham(void) {
41860     int test_ret = 0;
41861 
41862 #if defined(LIBXML_UNICODE_ENABLED)
41863     int mem_base;
41864     int ret_val;
41865     int code; /* UCS code point */
41866     int n_code;
41867 
41868     for (n_code = 0;n_code < gen_nb_int;n_code++) {
41869         mem_base = xmlMemBlocks();
41870         code = gen_int(n_code, 0);
41871 
41872         ret_val = xmlUCSIsOgham(code);
41873         desret_int(ret_val);
41874         call_tests++;
41875         des_int(n_code, code, 0);
41876         xmlResetLastError();
41877         if (mem_base != xmlMemBlocks()) {
41878             printf("Leak of %d blocks found in xmlUCSIsOgham",
41879 	           xmlMemBlocks() - mem_base);
41880 	    test_ret++;
41881             printf(" %d", n_code);
41882             printf("\n");
41883         }
41884     }
41885     function_tests++;
41886 #endif
41887 
41888     return(test_ret);
41889 }
41890 
41891 
41892 static int
test_xmlUCSIsOldItalic(void)41893 test_xmlUCSIsOldItalic(void) {
41894     int test_ret = 0;
41895 
41896 #if defined(LIBXML_UNICODE_ENABLED)
41897     int mem_base;
41898     int ret_val;
41899     int code; /* UCS code point */
41900     int n_code;
41901 
41902     for (n_code = 0;n_code < gen_nb_int;n_code++) {
41903         mem_base = xmlMemBlocks();
41904         code = gen_int(n_code, 0);
41905 
41906         ret_val = xmlUCSIsOldItalic(code);
41907         desret_int(ret_val);
41908         call_tests++;
41909         des_int(n_code, code, 0);
41910         xmlResetLastError();
41911         if (mem_base != xmlMemBlocks()) {
41912             printf("Leak of %d blocks found in xmlUCSIsOldItalic",
41913 	           xmlMemBlocks() - mem_base);
41914 	    test_ret++;
41915             printf(" %d", n_code);
41916             printf("\n");
41917         }
41918     }
41919     function_tests++;
41920 #endif
41921 
41922     return(test_ret);
41923 }
41924 
41925 
41926 static int
test_xmlUCSIsOpticalCharacterRecognition(void)41927 test_xmlUCSIsOpticalCharacterRecognition(void) {
41928     int test_ret = 0;
41929 
41930 #if defined(LIBXML_UNICODE_ENABLED)
41931     int mem_base;
41932     int ret_val;
41933     int code; /* UCS code point */
41934     int n_code;
41935 
41936     for (n_code = 0;n_code < gen_nb_int;n_code++) {
41937         mem_base = xmlMemBlocks();
41938         code = gen_int(n_code, 0);
41939 
41940         ret_val = xmlUCSIsOpticalCharacterRecognition(code);
41941         desret_int(ret_val);
41942         call_tests++;
41943         des_int(n_code, code, 0);
41944         xmlResetLastError();
41945         if (mem_base != xmlMemBlocks()) {
41946             printf("Leak of %d blocks found in xmlUCSIsOpticalCharacterRecognition",
41947 	           xmlMemBlocks() - mem_base);
41948 	    test_ret++;
41949             printf(" %d", n_code);
41950             printf("\n");
41951         }
41952     }
41953     function_tests++;
41954 #endif
41955 
41956     return(test_ret);
41957 }
41958 
41959 
41960 static int
test_xmlUCSIsOriya(void)41961 test_xmlUCSIsOriya(void) {
41962     int test_ret = 0;
41963 
41964 #if defined(LIBXML_UNICODE_ENABLED)
41965     int mem_base;
41966     int ret_val;
41967     int code; /* UCS code point */
41968     int n_code;
41969 
41970     for (n_code = 0;n_code < gen_nb_int;n_code++) {
41971         mem_base = xmlMemBlocks();
41972         code = gen_int(n_code, 0);
41973 
41974         ret_val = xmlUCSIsOriya(code);
41975         desret_int(ret_val);
41976         call_tests++;
41977         des_int(n_code, code, 0);
41978         xmlResetLastError();
41979         if (mem_base != xmlMemBlocks()) {
41980             printf("Leak of %d blocks found in xmlUCSIsOriya",
41981 	           xmlMemBlocks() - mem_base);
41982 	    test_ret++;
41983             printf(" %d", n_code);
41984             printf("\n");
41985         }
41986     }
41987     function_tests++;
41988 #endif
41989 
41990     return(test_ret);
41991 }
41992 
41993 
41994 static int
test_xmlUCSIsOsmanya(void)41995 test_xmlUCSIsOsmanya(void) {
41996     int test_ret = 0;
41997 
41998 #if defined(LIBXML_UNICODE_ENABLED)
41999     int mem_base;
42000     int ret_val;
42001     int code; /* UCS code point */
42002     int n_code;
42003 
42004     for (n_code = 0;n_code < gen_nb_int;n_code++) {
42005         mem_base = xmlMemBlocks();
42006         code = gen_int(n_code, 0);
42007 
42008         ret_val = xmlUCSIsOsmanya(code);
42009         desret_int(ret_val);
42010         call_tests++;
42011         des_int(n_code, code, 0);
42012         xmlResetLastError();
42013         if (mem_base != xmlMemBlocks()) {
42014             printf("Leak of %d blocks found in xmlUCSIsOsmanya",
42015 	           xmlMemBlocks() - mem_base);
42016 	    test_ret++;
42017             printf(" %d", n_code);
42018             printf("\n");
42019         }
42020     }
42021     function_tests++;
42022 #endif
42023 
42024     return(test_ret);
42025 }
42026 
42027 
42028 static int
test_xmlUCSIsPhoneticExtensions(void)42029 test_xmlUCSIsPhoneticExtensions(void) {
42030     int test_ret = 0;
42031 
42032 #if defined(LIBXML_UNICODE_ENABLED)
42033     int mem_base;
42034     int ret_val;
42035     int code; /* UCS code point */
42036     int n_code;
42037 
42038     for (n_code = 0;n_code < gen_nb_int;n_code++) {
42039         mem_base = xmlMemBlocks();
42040         code = gen_int(n_code, 0);
42041 
42042         ret_val = xmlUCSIsPhoneticExtensions(code);
42043         desret_int(ret_val);
42044         call_tests++;
42045         des_int(n_code, code, 0);
42046         xmlResetLastError();
42047         if (mem_base != xmlMemBlocks()) {
42048             printf("Leak of %d blocks found in xmlUCSIsPhoneticExtensions",
42049 	           xmlMemBlocks() - mem_base);
42050 	    test_ret++;
42051             printf(" %d", n_code);
42052             printf("\n");
42053         }
42054     }
42055     function_tests++;
42056 #endif
42057 
42058     return(test_ret);
42059 }
42060 
42061 
42062 static int
test_xmlUCSIsPrivateUse(void)42063 test_xmlUCSIsPrivateUse(void) {
42064     int test_ret = 0;
42065 
42066 #if defined(LIBXML_UNICODE_ENABLED)
42067     int mem_base;
42068     int ret_val;
42069     int code; /* UCS code point */
42070     int n_code;
42071 
42072     for (n_code = 0;n_code < gen_nb_int;n_code++) {
42073         mem_base = xmlMemBlocks();
42074         code = gen_int(n_code, 0);
42075 
42076         ret_val = xmlUCSIsPrivateUse(code);
42077         desret_int(ret_val);
42078         call_tests++;
42079         des_int(n_code, code, 0);
42080         xmlResetLastError();
42081         if (mem_base != xmlMemBlocks()) {
42082             printf("Leak of %d blocks found in xmlUCSIsPrivateUse",
42083 	           xmlMemBlocks() - mem_base);
42084 	    test_ret++;
42085             printf(" %d", n_code);
42086             printf("\n");
42087         }
42088     }
42089     function_tests++;
42090 #endif
42091 
42092     return(test_ret);
42093 }
42094 
42095 
42096 static int
test_xmlUCSIsPrivateUseArea(void)42097 test_xmlUCSIsPrivateUseArea(void) {
42098     int test_ret = 0;
42099 
42100 #if defined(LIBXML_UNICODE_ENABLED)
42101     int mem_base;
42102     int ret_val;
42103     int code; /* UCS code point */
42104     int n_code;
42105 
42106     for (n_code = 0;n_code < gen_nb_int;n_code++) {
42107         mem_base = xmlMemBlocks();
42108         code = gen_int(n_code, 0);
42109 
42110         ret_val = xmlUCSIsPrivateUseArea(code);
42111         desret_int(ret_val);
42112         call_tests++;
42113         des_int(n_code, code, 0);
42114         xmlResetLastError();
42115         if (mem_base != xmlMemBlocks()) {
42116             printf("Leak of %d blocks found in xmlUCSIsPrivateUseArea",
42117 	           xmlMemBlocks() - mem_base);
42118 	    test_ret++;
42119             printf(" %d", n_code);
42120             printf("\n");
42121         }
42122     }
42123     function_tests++;
42124 #endif
42125 
42126     return(test_ret);
42127 }
42128 
42129 
42130 static int
test_xmlUCSIsRunic(void)42131 test_xmlUCSIsRunic(void) {
42132     int test_ret = 0;
42133 
42134 #if defined(LIBXML_UNICODE_ENABLED)
42135     int mem_base;
42136     int ret_val;
42137     int code; /* UCS code point */
42138     int n_code;
42139 
42140     for (n_code = 0;n_code < gen_nb_int;n_code++) {
42141         mem_base = xmlMemBlocks();
42142         code = gen_int(n_code, 0);
42143 
42144         ret_val = xmlUCSIsRunic(code);
42145         desret_int(ret_val);
42146         call_tests++;
42147         des_int(n_code, code, 0);
42148         xmlResetLastError();
42149         if (mem_base != xmlMemBlocks()) {
42150             printf("Leak of %d blocks found in xmlUCSIsRunic",
42151 	           xmlMemBlocks() - mem_base);
42152 	    test_ret++;
42153             printf(" %d", n_code);
42154             printf("\n");
42155         }
42156     }
42157     function_tests++;
42158 #endif
42159 
42160     return(test_ret);
42161 }
42162 
42163 
42164 static int
test_xmlUCSIsShavian(void)42165 test_xmlUCSIsShavian(void) {
42166     int test_ret = 0;
42167 
42168 #if defined(LIBXML_UNICODE_ENABLED)
42169     int mem_base;
42170     int ret_val;
42171     int code; /* UCS code point */
42172     int n_code;
42173 
42174     for (n_code = 0;n_code < gen_nb_int;n_code++) {
42175         mem_base = xmlMemBlocks();
42176         code = gen_int(n_code, 0);
42177 
42178         ret_val = xmlUCSIsShavian(code);
42179         desret_int(ret_val);
42180         call_tests++;
42181         des_int(n_code, code, 0);
42182         xmlResetLastError();
42183         if (mem_base != xmlMemBlocks()) {
42184             printf("Leak of %d blocks found in xmlUCSIsShavian",
42185 	           xmlMemBlocks() - mem_base);
42186 	    test_ret++;
42187             printf(" %d", n_code);
42188             printf("\n");
42189         }
42190     }
42191     function_tests++;
42192 #endif
42193 
42194     return(test_ret);
42195 }
42196 
42197 
42198 static int
test_xmlUCSIsSinhala(void)42199 test_xmlUCSIsSinhala(void) {
42200     int test_ret = 0;
42201 
42202 #if defined(LIBXML_UNICODE_ENABLED)
42203     int mem_base;
42204     int ret_val;
42205     int code; /* UCS code point */
42206     int n_code;
42207 
42208     for (n_code = 0;n_code < gen_nb_int;n_code++) {
42209         mem_base = xmlMemBlocks();
42210         code = gen_int(n_code, 0);
42211 
42212         ret_val = xmlUCSIsSinhala(code);
42213         desret_int(ret_val);
42214         call_tests++;
42215         des_int(n_code, code, 0);
42216         xmlResetLastError();
42217         if (mem_base != xmlMemBlocks()) {
42218             printf("Leak of %d blocks found in xmlUCSIsSinhala",
42219 	           xmlMemBlocks() - mem_base);
42220 	    test_ret++;
42221             printf(" %d", n_code);
42222             printf("\n");
42223         }
42224     }
42225     function_tests++;
42226 #endif
42227 
42228     return(test_ret);
42229 }
42230 
42231 
42232 static int
test_xmlUCSIsSmallFormVariants(void)42233 test_xmlUCSIsSmallFormVariants(void) {
42234     int test_ret = 0;
42235 
42236 #if defined(LIBXML_UNICODE_ENABLED)
42237     int mem_base;
42238     int ret_val;
42239     int code; /* UCS code point */
42240     int n_code;
42241 
42242     for (n_code = 0;n_code < gen_nb_int;n_code++) {
42243         mem_base = xmlMemBlocks();
42244         code = gen_int(n_code, 0);
42245 
42246         ret_val = xmlUCSIsSmallFormVariants(code);
42247         desret_int(ret_val);
42248         call_tests++;
42249         des_int(n_code, code, 0);
42250         xmlResetLastError();
42251         if (mem_base != xmlMemBlocks()) {
42252             printf("Leak of %d blocks found in xmlUCSIsSmallFormVariants",
42253 	           xmlMemBlocks() - mem_base);
42254 	    test_ret++;
42255             printf(" %d", n_code);
42256             printf("\n");
42257         }
42258     }
42259     function_tests++;
42260 #endif
42261 
42262     return(test_ret);
42263 }
42264 
42265 
42266 static int
test_xmlUCSIsSpacingModifierLetters(void)42267 test_xmlUCSIsSpacingModifierLetters(void) {
42268     int test_ret = 0;
42269 
42270 #if defined(LIBXML_UNICODE_ENABLED)
42271     int mem_base;
42272     int ret_val;
42273     int code; /* UCS code point */
42274     int n_code;
42275 
42276     for (n_code = 0;n_code < gen_nb_int;n_code++) {
42277         mem_base = xmlMemBlocks();
42278         code = gen_int(n_code, 0);
42279 
42280         ret_val = xmlUCSIsSpacingModifierLetters(code);
42281         desret_int(ret_val);
42282         call_tests++;
42283         des_int(n_code, code, 0);
42284         xmlResetLastError();
42285         if (mem_base != xmlMemBlocks()) {
42286             printf("Leak of %d blocks found in xmlUCSIsSpacingModifierLetters",
42287 	           xmlMemBlocks() - mem_base);
42288 	    test_ret++;
42289             printf(" %d", n_code);
42290             printf("\n");
42291         }
42292     }
42293     function_tests++;
42294 #endif
42295 
42296     return(test_ret);
42297 }
42298 
42299 
42300 static int
test_xmlUCSIsSpecials(void)42301 test_xmlUCSIsSpecials(void) {
42302     int test_ret = 0;
42303 
42304 #if defined(LIBXML_UNICODE_ENABLED)
42305     int mem_base;
42306     int ret_val;
42307     int code; /* UCS code point */
42308     int n_code;
42309 
42310     for (n_code = 0;n_code < gen_nb_int;n_code++) {
42311         mem_base = xmlMemBlocks();
42312         code = gen_int(n_code, 0);
42313 
42314         ret_val = xmlUCSIsSpecials(code);
42315         desret_int(ret_val);
42316         call_tests++;
42317         des_int(n_code, code, 0);
42318         xmlResetLastError();
42319         if (mem_base != xmlMemBlocks()) {
42320             printf("Leak of %d blocks found in xmlUCSIsSpecials",
42321 	           xmlMemBlocks() - mem_base);
42322 	    test_ret++;
42323             printf(" %d", n_code);
42324             printf("\n");
42325         }
42326     }
42327     function_tests++;
42328 #endif
42329 
42330     return(test_ret);
42331 }
42332 
42333 
42334 static int
test_xmlUCSIsSuperscriptsandSubscripts(void)42335 test_xmlUCSIsSuperscriptsandSubscripts(void) {
42336     int test_ret = 0;
42337 
42338 #if defined(LIBXML_UNICODE_ENABLED)
42339     int mem_base;
42340     int ret_val;
42341     int code; /* UCS code point */
42342     int n_code;
42343 
42344     for (n_code = 0;n_code < gen_nb_int;n_code++) {
42345         mem_base = xmlMemBlocks();
42346         code = gen_int(n_code, 0);
42347 
42348         ret_val = xmlUCSIsSuperscriptsandSubscripts(code);
42349         desret_int(ret_val);
42350         call_tests++;
42351         des_int(n_code, code, 0);
42352         xmlResetLastError();
42353         if (mem_base != xmlMemBlocks()) {
42354             printf("Leak of %d blocks found in xmlUCSIsSuperscriptsandSubscripts",
42355 	           xmlMemBlocks() - mem_base);
42356 	    test_ret++;
42357             printf(" %d", n_code);
42358             printf("\n");
42359         }
42360     }
42361     function_tests++;
42362 #endif
42363 
42364     return(test_ret);
42365 }
42366 
42367 
42368 static int
test_xmlUCSIsSupplementalArrowsA(void)42369 test_xmlUCSIsSupplementalArrowsA(void) {
42370     int test_ret = 0;
42371 
42372 #if defined(LIBXML_UNICODE_ENABLED)
42373     int mem_base;
42374     int ret_val;
42375     int code; /* UCS code point */
42376     int n_code;
42377 
42378     for (n_code = 0;n_code < gen_nb_int;n_code++) {
42379         mem_base = xmlMemBlocks();
42380         code = gen_int(n_code, 0);
42381 
42382         ret_val = xmlUCSIsSupplementalArrowsA(code);
42383         desret_int(ret_val);
42384         call_tests++;
42385         des_int(n_code, code, 0);
42386         xmlResetLastError();
42387         if (mem_base != xmlMemBlocks()) {
42388             printf("Leak of %d blocks found in xmlUCSIsSupplementalArrowsA",
42389 	           xmlMemBlocks() - mem_base);
42390 	    test_ret++;
42391             printf(" %d", n_code);
42392             printf("\n");
42393         }
42394     }
42395     function_tests++;
42396 #endif
42397 
42398     return(test_ret);
42399 }
42400 
42401 
42402 static int
test_xmlUCSIsSupplementalArrowsB(void)42403 test_xmlUCSIsSupplementalArrowsB(void) {
42404     int test_ret = 0;
42405 
42406 #if defined(LIBXML_UNICODE_ENABLED)
42407     int mem_base;
42408     int ret_val;
42409     int code; /* UCS code point */
42410     int n_code;
42411 
42412     for (n_code = 0;n_code < gen_nb_int;n_code++) {
42413         mem_base = xmlMemBlocks();
42414         code = gen_int(n_code, 0);
42415 
42416         ret_val = xmlUCSIsSupplementalArrowsB(code);
42417         desret_int(ret_val);
42418         call_tests++;
42419         des_int(n_code, code, 0);
42420         xmlResetLastError();
42421         if (mem_base != xmlMemBlocks()) {
42422             printf("Leak of %d blocks found in xmlUCSIsSupplementalArrowsB",
42423 	           xmlMemBlocks() - mem_base);
42424 	    test_ret++;
42425             printf(" %d", n_code);
42426             printf("\n");
42427         }
42428     }
42429     function_tests++;
42430 #endif
42431 
42432     return(test_ret);
42433 }
42434 
42435 
42436 static int
test_xmlUCSIsSupplementalMathematicalOperators(void)42437 test_xmlUCSIsSupplementalMathematicalOperators(void) {
42438     int test_ret = 0;
42439 
42440 #if defined(LIBXML_UNICODE_ENABLED)
42441     int mem_base;
42442     int ret_val;
42443     int code; /* UCS code point */
42444     int n_code;
42445 
42446     for (n_code = 0;n_code < gen_nb_int;n_code++) {
42447         mem_base = xmlMemBlocks();
42448         code = gen_int(n_code, 0);
42449 
42450         ret_val = xmlUCSIsSupplementalMathematicalOperators(code);
42451         desret_int(ret_val);
42452         call_tests++;
42453         des_int(n_code, code, 0);
42454         xmlResetLastError();
42455         if (mem_base != xmlMemBlocks()) {
42456             printf("Leak of %d blocks found in xmlUCSIsSupplementalMathematicalOperators",
42457 	           xmlMemBlocks() - mem_base);
42458 	    test_ret++;
42459             printf(" %d", n_code);
42460             printf("\n");
42461         }
42462     }
42463     function_tests++;
42464 #endif
42465 
42466     return(test_ret);
42467 }
42468 
42469 
42470 static int
test_xmlUCSIsSupplementaryPrivateUseAreaA(void)42471 test_xmlUCSIsSupplementaryPrivateUseAreaA(void) {
42472     int test_ret = 0;
42473 
42474 #if defined(LIBXML_UNICODE_ENABLED)
42475     int mem_base;
42476     int ret_val;
42477     int code; /* UCS code point */
42478     int n_code;
42479 
42480     for (n_code = 0;n_code < gen_nb_int;n_code++) {
42481         mem_base = xmlMemBlocks();
42482         code = gen_int(n_code, 0);
42483 
42484         ret_val = xmlUCSIsSupplementaryPrivateUseAreaA(code);
42485         desret_int(ret_val);
42486         call_tests++;
42487         des_int(n_code, code, 0);
42488         xmlResetLastError();
42489         if (mem_base != xmlMemBlocks()) {
42490             printf("Leak of %d blocks found in xmlUCSIsSupplementaryPrivateUseAreaA",
42491 	           xmlMemBlocks() - mem_base);
42492 	    test_ret++;
42493             printf(" %d", n_code);
42494             printf("\n");
42495         }
42496     }
42497     function_tests++;
42498 #endif
42499 
42500     return(test_ret);
42501 }
42502 
42503 
42504 static int
test_xmlUCSIsSupplementaryPrivateUseAreaB(void)42505 test_xmlUCSIsSupplementaryPrivateUseAreaB(void) {
42506     int test_ret = 0;
42507 
42508 #if defined(LIBXML_UNICODE_ENABLED)
42509     int mem_base;
42510     int ret_val;
42511     int code; /* UCS code point */
42512     int n_code;
42513 
42514     for (n_code = 0;n_code < gen_nb_int;n_code++) {
42515         mem_base = xmlMemBlocks();
42516         code = gen_int(n_code, 0);
42517 
42518         ret_val = xmlUCSIsSupplementaryPrivateUseAreaB(code);
42519         desret_int(ret_val);
42520         call_tests++;
42521         des_int(n_code, code, 0);
42522         xmlResetLastError();
42523         if (mem_base != xmlMemBlocks()) {
42524             printf("Leak of %d blocks found in xmlUCSIsSupplementaryPrivateUseAreaB",
42525 	           xmlMemBlocks() - mem_base);
42526 	    test_ret++;
42527             printf(" %d", n_code);
42528             printf("\n");
42529         }
42530     }
42531     function_tests++;
42532 #endif
42533 
42534     return(test_ret);
42535 }
42536 
42537 
42538 static int
test_xmlUCSIsSyriac(void)42539 test_xmlUCSIsSyriac(void) {
42540     int test_ret = 0;
42541 
42542 #if defined(LIBXML_UNICODE_ENABLED)
42543     int mem_base;
42544     int ret_val;
42545     int code; /* UCS code point */
42546     int n_code;
42547 
42548     for (n_code = 0;n_code < gen_nb_int;n_code++) {
42549         mem_base = xmlMemBlocks();
42550         code = gen_int(n_code, 0);
42551 
42552         ret_val = xmlUCSIsSyriac(code);
42553         desret_int(ret_val);
42554         call_tests++;
42555         des_int(n_code, code, 0);
42556         xmlResetLastError();
42557         if (mem_base != xmlMemBlocks()) {
42558             printf("Leak of %d blocks found in xmlUCSIsSyriac",
42559 	           xmlMemBlocks() - mem_base);
42560 	    test_ret++;
42561             printf(" %d", n_code);
42562             printf("\n");
42563         }
42564     }
42565     function_tests++;
42566 #endif
42567 
42568     return(test_ret);
42569 }
42570 
42571 
42572 static int
test_xmlUCSIsTagalog(void)42573 test_xmlUCSIsTagalog(void) {
42574     int test_ret = 0;
42575 
42576 #if defined(LIBXML_UNICODE_ENABLED)
42577     int mem_base;
42578     int ret_val;
42579     int code; /* UCS code point */
42580     int n_code;
42581 
42582     for (n_code = 0;n_code < gen_nb_int;n_code++) {
42583         mem_base = xmlMemBlocks();
42584         code = gen_int(n_code, 0);
42585 
42586         ret_val = xmlUCSIsTagalog(code);
42587         desret_int(ret_val);
42588         call_tests++;
42589         des_int(n_code, code, 0);
42590         xmlResetLastError();
42591         if (mem_base != xmlMemBlocks()) {
42592             printf("Leak of %d blocks found in xmlUCSIsTagalog",
42593 	           xmlMemBlocks() - mem_base);
42594 	    test_ret++;
42595             printf(" %d", n_code);
42596             printf("\n");
42597         }
42598     }
42599     function_tests++;
42600 #endif
42601 
42602     return(test_ret);
42603 }
42604 
42605 
42606 static int
test_xmlUCSIsTagbanwa(void)42607 test_xmlUCSIsTagbanwa(void) {
42608     int test_ret = 0;
42609 
42610 #if defined(LIBXML_UNICODE_ENABLED)
42611     int mem_base;
42612     int ret_val;
42613     int code; /* UCS code point */
42614     int n_code;
42615 
42616     for (n_code = 0;n_code < gen_nb_int;n_code++) {
42617         mem_base = xmlMemBlocks();
42618         code = gen_int(n_code, 0);
42619 
42620         ret_val = xmlUCSIsTagbanwa(code);
42621         desret_int(ret_val);
42622         call_tests++;
42623         des_int(n_code, code, 0);
42624         xmlResetLastError();
42625         if (mem_base != xmlMemBlocks()) {
42626             printf("Leak of %d blocks found in xmlUCSIsTagbanwa",
42627 	           xmlMemBlocks() - mem_base);
42628 	    test_ret++;
42629             printf(" %d", n_code);
42630             printf("\n");
42631         }
42632     }
42633     function_tests++;
42634 #endif
42635 
42636     return(test_ret);
42637 }
42638 
42639 
42640 static int
test_xmlUCSIsTags(void)42641 test_xmlUCSIsTags(void) {
42642     int test_ret = 0;
42643 
42644 #if defined(LIBXML_UNICODE_ENABLED)
42645     int mem_base;
42646     int ret_val;
42647     int code; /* UCS code point */
42648     int n_code;
42649 
42650     for (n_code = 0;n_code < gen_nb_int;n_code++) {
42651         mem_base = xmlMemBlocks();
42652         code = gen_int(n_code, 0);
42653 
42654         ret_val = xmlUCSIsTags(code);
42655         desret_int(ret_val);
42656         call_tests++;
42657         des_int(n_code, code, 0);
42658         xmlResetLastError();
42659         if (mem_base != xmlMemBlocks()) {
42660             printf("Leak of %d blocks found in xmlUCSIsTags",
42661 	           xmlMemBlocks() - mem_base);
42662 	    test_ret++;
42663             printf(" %d", n_code);
42664             printf("\n");
42665         }
42666     }
42667     function_tests++;
42668 #endif
42669 
42670     return(test_ret);
42671 }
42672 
42673 
42674 static int
test_xmlUCSIsTaiLe(void)42675 test_xmlUCSIsTaiLe(void) {
42676     int test_ret = 0;
42677 
42678 #if defined(LIBXML_UNICODE_ENABLED)
42679     int mem_base;
42680     int ret_val;
42681     int code; /* UCS code point */
42682     int n_code;
42683 
42684     for (n_code = 0;n_code < gen_nb_int;n_code++) {
42685         mem_base = xmlMemBlocks();
42686         code = gen_int(n_code, 0);
42687 
42688         ret_val = xmlUCSIsTaiLe(code);
42689         desret_int(ret_val);
42690         call_tests++;
42691         des_int(n_code, code, 0);
42692         xmlResetLastError();
42693         if (mem_base != xmlMemBlocks()) {
42694             printf("Leak of %d blocks found in xmlUCSIsTaiLe",
42695 	           xmlMemBlocks() - mem_base);
42696 	    test_ret++;
42697             printf(" %d", n_code);
42698             printf("\n");
42699         }
42700     }
42701     function_tests++;
42702 #endif
42703 
42704     return(test_ret);
42705 }
42706 
42707 
42708 static int
test_xmlUCSIsTaiXuanJingSymbols(void)42709 test_xmlUCSIsTaiXuanJingSymbols(void) {
42710     int test_ret = 0;
42711 
42712 #if defined(LIBXML_UNICODE_ENABLED)
42713     int mem_base;
42714     int ret_val;
42715     int code; /* UCS code point */
42716     int n_code;
42717 
42718     for (n_code = 0;n_code < gen_nb_int;n_code++) {
42719         mem_base = xmlMemBlocks();
42720         code = gen_int(n_code, 0);
42721 
42722         ret_val = xmlUCSIsTaiXuanJingSymbols(code);
42723         desret_int(ret_val);
42724         call_tests++;
42725         des_int(n_code, code, 0);
42726         xmlResetLastError();
42727         if (mem_base != xmlMemBlocks()) {
42728             printf("Leak of %d blocks found in xmlUCSIsTaiXuanJingSymbols",
42729 	           xmlMemBlocks() - mem_base);
42730 	    test_ret++;
42731             printf(" %d", n_code);
42732             printf("\n");
42733         }
42734     }
42735     function_tests++;
42736 #endif
42737 
42738     return(test_ret);
42739 }
42740 
42741 
42742 static int
test_xmlUCSIsTamil(void)42743 test_xmlUCSIsTamil(void) {
42744     int test_ret = 0;
42745 
42746 #if defined(LIBXML_UNICODE_ENABLED)
42747     int mem_base;
42748     int ret_val;
42749     int code; /* UCS code point */
42750     int n_code;
42751 
42752     for (n_code = 0;n_code < gen_nb_int;n_code++) {
42753         mem_base = xmlMemBlocks();
42754         code = gen_int(n_code, 0);
42755 
42756         ret_val = xmlUCSIsTamil(code);
42757         desret_int(ret_val);
42758         call_tests++;
42759         des_int(n_code, code, 0);
42760         xmlResetLastError();
42761         if (mem_base != xmlMemBlocks()) {
42762             printf("Leak of %d blocks found in xmlUCSIsTamil",
42763 	           xmlMemBlocks() - mem_base);
42764 	    test_ret++;
42765             printf(" %d", n_code);
42766             printf("\n");
42767         }
42768     }
42769     function_tests++;
42770 #endif
42771 
42772     return(test_ret);
42773 }
42774 
42775 
42776 static int
test_xmlUCSIsTelugu(void)42777 test_xmlUCSIsTelugu(void) {
42778     int test_ret = 0;
42779 
42780 #if defined(LIBXML_UNICODE_ENABLED)
42781     int mem_base;
42782     int ret_val;
42783     int code; /* UCS code point */
42784     int n_code;
42785 
42786     for (n_code = 0;n_code < gen_nb_int;n_code++) {
42787         mem_base = xmlMemBlocks();
42788         code = gen_int(n_code, 0);
42789 
42790         ret_val = xmlUCSIsTelugu(code);
42791         desret_int(ret_val);
42792         call_tests++;
42793         des_int(n_code, code, 0);
42794         xmlResetLastError();
42795         if (mem_base != xmlMemBlocks()) {
42796             printf("Leak of %d blocks found in xmlUCSIsTelugu",
42797 	           xmlMemBlocks() - mem_base);
42798 	    test_ret++;
42799             printf(" %d", n_code);
42800             printf("\n");
42801         }
42802     }
42803     function_tests++;
42804 #endif
42805 
42806     return(test_ret);
42807 }
42808 
42809 
42810 static int
test_xmlUCSIsThaana(void)42811 test_xmlUCSIsThaana(void) {
42812     int test_ret = 0;
42813 
42814 #if defined(LIBXML_UNICODE_ENABLED)
42815     int mem_base;
42816     int ret_val;
42817     int code; /* UCS code point */
42818     int n_code;
42819 
42820     for (n_code = 0;n_code < gen_nb_int;n_code++) {
42821         mem_base = xmlMemBlocks();
42822         code = gen_int(n_code, 0);
42823 
42824         ret_val = xmlUCSIsThaana(code);
42825         desret_int(ret_val);
42826         call_tests++;
42827         des_int(n_code, code, 0);
42828         xmlResetLastError();
42829         if (mem_base != xmlMemBlocks()) {
42830             printf("Leak of %d blocks found in xmlUCSIsThaana",
42831 	           xmlMemBlocks() - mem_base);
42832 	    test_ret++;
42833             printf(" %d", n_code);
42834             printf("\n");
42835         }
42836     }
42837     function_tests++;
42838 #endif
42839 
42840     return(test_ret);
42841 }
42842 
42843 
42844 static int
test_xmlUCSIsThai(void)42845 test_xmlUCSIsThai(void) {
42846     int test_ret = 0;
42847 
42848 #if defined(LIBXML_UNICODE_ENABLED)
42849     int mem_base;
42850     int ret_val;
42851     int code; /* UCS code point */
42852     int n_code;
42853 
42854     for (n_code = 0;n_code < gen_nb_int;n_code++) {
42855         mem_base = xmlMemBlocks();
42856         code = gen_int(n_code, 0);
42857 
42858         ret_val = xmlUCSIsThai(code);
42859         desret_int(ret_val);
42860         call_tests++;
42861         des_int(n_code, code, 0);
42862         xmlResetLastError();
42863         if (mem_base != xmlMemBlocks()) {
42864             printf("Leak of %d blocks found in xmlUCSIsThai",
42865 	           xmlMemBlocks() - mem_base);
42866 	    test_ret++;
42867             printf(" %d", n_code);
42868             printf("\n");
42869         }
42870     }
42871     function_tests++;
42872 #endif
42873 
42874     return(test_ret);
42875 }
42876 
42877 
42878 static int
test_xmlUCSIsTibetan(void)42879 test_xmlUCSIsTibetan(void) {
42880     int test_ret = 0;
42881 
42882 #if defined(LIBXML_UNICODE_ENABLED)
42883     int mem_base;
42884     int ret_val;
42885     int code; /* UCS code point */
42886     int n_code;
42887 
42888     for (n_code = 0;n_code < gen_nb_int;n_code++) {
42889         mem_base = xmlMemBlocks();
42890         code = gen_int(n_code, 0);
42891 
42892         ret_val = xmlUCSIsTibetan(code);
42893         desret_int(ret_val);
42894         call_tests++;
42895         des_int(n_code, code, 0);
42896         xmlResetLastError();
42897         if (mem_base != xmlMemBlocks()) {
42898             printf("Leak of %d blocks found in xmlUCSIsTibetan",
42899 	           xmlMemBlocks() - mem_base);
42900 	    test_ret++;
42901             printf(" %d", n_code);
42902             printf("\n");
42903         }
42904     }
42905     function_tests++;
42906 #endif
42907 
42908     return(test_ret);
42909 }
42910 
42911 
42912 static int
test_xmlUCSIsUgaritic(void)42913 test_xmlUCSIsUgaritic(void) {
42914     int test_ret = 0;
42915 
42916 #if defined(LIBXML_UNICODE_ENABLED)
42917     int mem_base;
42918     int ret_val;
42919     int code; /* UCS code point */
42920     int n_code;
42921 
42922     for (n_code = 0;n_code < gen_nb_int;n_code++) {
42923         mem_base = xmlMemBlocks();
42924         code = gen_int(n_code, 0);
42925 
42926         ret_val = xmlUCSIsUgaritic(code);
42927         desret_int(ret_val);
42928         call_tests++;
42929         des_int(n_code, code, 0);
42930         xmlResetLastError();
42931         if (mem_base != xmlMemBlocks()) {
42932             printf("Leak of %d blocks found in xmlUCSIsUgaritic",
42933 	           xmlMemBlocks() - mem_base);
42934 	    test_ret++;
42935             printf(" %d", n_code);
42936             printf("\n");
42937         }
42938     }
42939     function_tests++;
42940 #endif
42941 
42942     return(test_ret);
42943 }
42944 
42945 
42946 static int
test_xmlUCSIsUnifiedCanadianAboriginalSyllabics(void)42947 test_xmlUCSIsUnifiedCanadianAboriginalSyllabics(void) {
42948     int test_ret = 0;
42949 
42950 #if defined(LIBXML_UNICODE_ENABLED)
42951     int mem_base;
42952     int ret_val;
42953     int code; /* UCS code point */
42954     int n_code;
42955 
42956     for (n_code = 0;n_code < gen_nb_int;n_code++) {
42957         mem_base = xmlMemBlocks();
42958         code = gen_int(n_code, 0);
42959 
42960         ret_val = xmlUCSIsUnifiedCanadianAboriginalSyllabics(code);
42961         desret_int(ret_val);
42962         call_tests++;
42963         des_int(n_code, code, 0);
42964         xmlResetLastError();
42965         if (mem_base != xmlMemBlocks()) {
42966             printf("Leak of %d blocks found in xmlUCSIsUnifiedCanadianAboriginalSyllabics",
42967 	           xmlMemBlocks() - mem_base);
42968 	    test_ret++;
42969             printf(" %d", n_code);
42970             printf("\n");
42971         }
42972     }
42973     function_tests++;
42974 #endif
42975 
42976     return(test_ret);
42977 }
42978 
42979 
42980 static int
test_xmlUCSIsVariationSelectors(void)42981 test_xmlUCSIsVariationSelectors(void) {
42982     int test_ret = 0;
42983 
42984 #if defined(LIBXML_UNICODE_ENABLED)
42985     int mem_base;
42986     int ret_val;
42987     int code; /* UCS code point */
42988     int n_code;
42989 
42990     for (n_code = 0;n_code < gen_nb_int;n_code++) {
42991         mem_base = xmlMemBlocks();
42992         code = gen_int(n_code, 0);
42993 
42994         ret_val = xmlUCSIsVariationSelectors(code);
42995         desret_int(ret_val);
42996         call_tests++;
42997         des_int(n_code, code, 0);
42998         xmlResetLastError();
42999         if (mem_base != xmlMemBlocks()) {
43000             printf("Leak of %d blocks found in xmlUCSIsVariationSelectors",
43001 	           xmlMemBlocks() - mem_base);
43002 	    test_ret++;
43003             printf(" %d", n_code);
43004             printf("\n");
43005         }
43006     }
43007     function_tests++;
43008 #endif
43009 
43010     return(test_ret);
43011 }
43012 
43013 
43014 static int
test_xmlUCSIsVariationSelectorsSupplement(void)43015 test_xmlUCSIsVariationSelectorsSupplement(void) {
43016     int test_ret = 0;
43017 
43018 #if defined(LIBXML_UNICODE_ENABLED)
43019     int mem_base;
43020     int ret_val;
43021     int code; /* UCS code point */
43022     int n_code;
43023 
43024     for (n_code = 0;n_code < gen_nb_int;n_code++) {
43025         mem_base = xmlMemBlocks();
43026         code = gen_int(n_code, 0);
43027 
43028         ret_val = xmlUCSIsVariationSelectorsSupplement(code);
43029         desret_int(ret_val);
43030         call_tests++;
43031         des_int(n_code, code, 0);
43032         xmlResetLastError();
43033         if (mem_base != xmlMemBlocks()) {
43034             printf("Leak of %d blocks found in xmlUCSIsVariationSelectorsSupplement",
43035 	           xmlMemBlocks() - mem_base);
43036 	    test_ret++;
43037             printf(" %d", n_code);
43038             printf("\n");
43039         }
43040     }
43041     function_tests++;
43042 #endif
43043 
43044     return(test_ret);
43045 }
43046 
43047 
43048 static int
test_xmlUCSIsYiRadicals(void)43049 test_xmlUCSIsYiRadicals(void) {
43050     int test_ret = 0;
43051 
43052 #if defined(LIBXML_UNICODE_ENABLED)
43053     int mem_base;
43054     int ret_val;
43055     int code; /* UCS code point */
43056     int n_code;
43057 
43058     for (n_code = 0;n_code < gen_nb_int;n_code++) {
43059         mem_base = xmlMemBlocks();
43060         code = gen_int(n_code, 0);
43061 
43062         ret_val = xmlUCSIsYiRadicals(code);
43063         desret_int(ret_val);
43064         call_tests++;
43065         des_int(n_code, code, 0);
43066         xmlResetLastError();
43067         if (mem_base != xmlMemBlocks()) {
43068             printf("Leak of %d blocks found in xmlUCSIsYiRadicals",
43069 	           xmlMemBlocks() - mem_base);
43070 	    test_ret++;
43071             printf(" %d", n_code);
43072             printf("\n");
43073         }
43074     }
43075     function_tests++;
43076 #endif
43077 
43078     return(test_ret);
43079 }
43080 
43081 
43082 static int
test_xmlUCSIsYiSyllables(void)43083 test_xmlUCSIsYiSyllables(void) {
43084     int test_ret = 0;
43085 
43086 #if defined(LIBXML_UNICODE_ENABLED)
43087     int mem_base;
43088     int ret_val;
43089     int code; /* UCS code point */
43090     int n_code;
43091 
43092     for (n_code = 0;n_code < gen_nb_int;n_code++) {
43093         mem_base = xmlMemBlocks();
43094         code = gen_int(n_code, 0);
43095 
43096         ret_val = xmlUCSIsYiSyllables(code);
43097         desret_int(ret_val);
43098         call_tests++;
43099         des_int(n_code, code, 0);
43100         xmlResetLastError();
43101         if (mem_base != xmlMemBlocks()) {
43102             printf("Leak of %d blocks found in xmlUCSIsYiSyllables",
43103 	           xmlMemBlocks() - mem_base);
43104 	    test_ret++;
43105             printf(" %d", n_code);
43106             printf("\n");
43107         }
43108     }
43109     function_tests++;
43110 #endif
43111 
43112     return(test_ret);
43113 }
43114 
43115 
43116 static int
test_xmlUCSIsYijingHexagramSymbols(void)43117 test_xmlUCSIsYijingHexagramSymbols(void) {
43118     int test_ret = 0;
43119 
43120 #if defined(LIBXML_UNICODE_ENABLED)
43121     int mem_base;
43122     int ret_val;
43123     int code; /* UCS code point */
43124     int n_code;
43125 
43126     for (n_code = 0;n_code < gen_nb_int;n_code++) {
43127         mem_base = xmlMemBlocks();
43128         code = gen_int(n_code, 0);
43129 
43130         ret_val = xmlUCSIsYijingHexagramSymbols(code);
43131         desret_int(ret_val);
43132         call_tests++;
43133         des_int(n_code, code, 0);
43134         xmlResetLastError();
43135         if (mem_base != xmlMemBlocks()) {
43136             printf("Leak of %d blocks found in xmlUCSIsYijingHexagramSymbols",
43137 	           xmlMemBlocks() - mem_base);
43138 	    test_ret++;
43139             printf(" %d", n_code);
43140             printf("\n");
43141         }
43142     }
43143     function_tests++;
43144 #endif
43145 
43146     return(test_ret);
43147 }
43148 
43149 static int
test_xmlunicode(void)43150 test_xmlunicode(void) {
43151     int test_ret = 0;
43152 
43153     if (quiet == 0) printf("Testing xmlunicode : 166 of 166 functions ...\n");
43154     test_ret += test_xmlUCSIsAegeanNumbers();
43155     test_ret += test_xmlUCSIsAlphabeticPresentationForms();
43156     test_ret += test_xmlUCSIsArabic();
43157     test_ret += test_xmlUCSIsArabicPresentationFormsA();
43158     test_ret += test_xmlUCSIsArabicPresentationFormsB();
43159     test_ret += test_xmlUCSIsArmenian();
43160     test_ret += test_xmlUCSIsArrows();
43161     test_ret += test_xmlUCSIsBasicLatin();
43162     test_ret += test_xmlUCSIsBengali();
43163     test_ret += test_xmlUCSIsBlock();
43164     test_ret += test_xmlUCSIsBlockElements();
43165     test_ret += test_xmlUCSIsBopomofo();
43166     test_ret += test_xmlUCSIsBopomofoExtended();
43167     test_ret += test_xmlUCSIsBoxDrawing();
43168     test_ret += test_xmlUCSIsBraillePatterns();
43169     test_ret += test_xmlUCSIsBuhid();
43170     test_ret += test_xmlUCSIsByzantineMusicalSymbols();
43171     test_ret += test_xmlUCSIsCJKCompatibility();
43172     test_ret += test_xmlUCSIsCJKCompatibilityForms();
43173     test_ret += test_xmlUCSIsCJKCompatibilityIdeographs();
43174     test_ret += test_xmlUCSIsCJKCompatibilityIdeographsSupplement();
43175     test_ret += test_xmlUCSIsCJKRadicalsSupplement();
43176     test_ret += test_xmlUCSIsCJKSymbolsandPunctuation();
43177     test_ret += test_xmlUCSIsCJKUnifiedIdeographs();
43178     test_ret += test_xmlUCSIsCJKUnifiedIdeographsExtensionA();
43179     test_ret += test_xmlUCSIsCJKUnifiedIdeographsExtensionB();
43180     test_ret += test_xmlUCSIsCat();
43181     test_ret += test_xmlUCSIsCatC();
43182     test_ret += test_xmlUCSIsCatCc();
43183     test_ret += test_xmlUCSIsCatCf();
43184     test_ret += test_xmlUCSIsCatCo();
43185     test_ret += test_xmlUCSIsCatCs();
43186     test_ret += test_xmlUCSIsCatL();
43187     test_ret += test_xmlUCSIsCatLl();
43188     test_ret += test_xmlUCSIsCatLm();
43189     test_ret += test_xmlUCSIsCatLo();
43190     test_ret += test_xmlUCSIsCatLt();
43191     test_ret += test_xmlUCSIsCatLu();
43192     test_ret += test_xmlUCSIsCatM();
43193     test_ret += test_xmlUCSIsCatMc();
43194     test_ret += test_xmlUCSIsCatMe();
43195     test_ret += test_xmlUCSIsCatMn();
43196     test_ret += test_xmlUCSIsCatN();
43197     test_ret += test_xmlUCSIsCatNd();
43198     test_ret += test_xmlUCSIsCatNl();
43199     test_ret += test_xmlUCSIsCatNo();
43200     test_ret += test_xmlUCSIsCatP();
43201     test_ret += test_xmlUCSIsCatPc();
43202     test_ret += test_xmlUCSIsCatPd();
43203     test_ret += test_xmlUCSIsCatPe();
43204     test_ret += test_xmlUCSIsCatPf();
43205     test_ret += test_xmlUCSIsCatPi();
43206     test_ret += test_xmlUCSIsCatPo();
43207     test_ret += test_xmlUCSIsCatPs();
43208     test_ret += test_xmlUCSIsCatS();
43209     test_ret += test_xmlUCSIsCatSc();
43210     test_ret += test_xmlUCSIsCatSk();
43211     test_ret += test_xmlUCSIsCatSm();
43212     test_ret += test_xmlUCSIsCatSo();
43213     test_ret += test_xmlUCSIsCatZ();
43214     test_ret += test_xmlUCSIsCatZl();
43215     test_ret += test_xmlUCSIsCatZp();
43216     test_ret += test_xmlUCSIsCatZs();
43217     test_ret += test_xmlUCSIsCherokee();
43218     test_ret += test_xmlUCSIsCombiningDiacriticalMarks();
43219     test_ret += test_xmlUCSIsCombiningDiacriticalMarksforSymbols();
43220     test_ret += test_xmlUCSIsCombiningHalfMarks();
43221     test_ret += test_xmlUCSIsCombiningMarksforSymbols();
43222     test_ret += test_xmlUCSIsControlPictures();
43223     test_ret += test_xmlUCSIsCurrencySymbols();
43224     test_ret += test_xmlUCSIsCypriotSyllabary();
43225     test_ret += test_xmlUCSIsCyrillic();
43226     test_ret += test_xmlUCSIsCyrillicSupplement();
43227     test_ret += test_xmlUCSIsDeseret();
43228     test_ret += test_xmlUCSIsDevanagari();
43229     test_ret += test_xmlUCSIsDingbats();
43230     test_ret += test_xmlUCSIsEnclosedAlphanumerics();
43231     test_ret += test_xmlUCSIsEnclosedCJKLettersandMonths();
43232     test_ret += test_xmlUCSIsEthiopic();
43233     test_ret += test_xmlUCSIsGeneralPunctuation();
43234     test_ret += test_xmlUCSIsGeometricShapes();
43235     test_ret += test_xmlUCSIsGeorgian();
43236     test_ret += test_xmlUCSIsGothic();
43237     test_ret += test_xmlUCSIsGreek();
43238     test_ret += test_xmlUCSIsGreekExtended();
43239     test_ret += test_xmlUCSIsGreekandCoptic();
43240     test_ret += test_xmlUCSIsGujarati();
43241     test_ret += test_xmlUCSIsGurmukhi();
43242     test_ret += test_xmlUCSIsHalfwidthandFullwidthForms();
43243     test_ret += test_xmlUCSIsHangulCompatibilityJamo();
43244     test_ret += test_xmlUCSIsHangulJamo();
43245     test_ret += test_xmlUCSIsHangulSyllables();
43246     test_ret += test_xmlUCSIsHanunoo();
43247     test_ret += test_xmlUCSIsHebrew();
43248     test_ret += test_xmlUCSIsHighPrivateUseSurrogates();
43249     test_ret += test_xmlUCSIsHighSurrogates();
43250     test_ret += test_xmlUCSIsHiragana();
43251     test_ret += test_xmlUCSIsIPAExtensions();
43252     test_ret += test_xmlUCSIsIdeographicDescriptionCharacters();
43253     test_ret += test_xmlUCSIsKanbun();
43254     test_ret += test_xmlUCSIsKangxiRadicals();
43255     test_ret += test_xmlUCSIsKannada();
43256     test_ret += test_xmlUCSIsKatakana();
43257     test_ret += test_xmlUCSIsKatakanaPhoneticExtensions();
43258     test_ret += test_xmlUCSIsKhmer();
43259     test_ret += test_xmlUCSIsKhmerSymbols();
43260     test_ret += test_xmlUCSIsLao();
43261     test_ret += test_xmlUCSIsLatin1Supplement();
43262     test_ret += test_xmlUCSIsLatinExtendedA();
43263     test_ret += test_xmlUCSIsLatinExtendedAdditional();
43264     test_ret += test_xmlUCSIsLatinExtendedB();
43265     test_ret += test_xmlUCSIsLetterlikeSymbols();
43266     test_ret += test_xmlUCSIsLimbu();
43267     test_ret += test_xmlUCSIsLinearBIdeograms();
43268     test_ret += test_xmlUCSIsLinearBSyllabary();
43269     test_ret += test_xmlUCSIsLowSurrogates();
43270     test_ret += test_xmlUCSIsMalayalam();
43271     test_ret += test_xmlUCSIsMathematicalAlphanumericSymbols();
43272     test_ret += test_xmlUCSIsMathematicalOperators();
43273     test_ret += test_xmlUCSIsMiscellaneousMathematicalSymbolsA();
43274     test_ret += test_xmlUCSIsMiscellaneousMathematicalSymbolsB();
43275     test_ret += test_xmlUCSIsMiscellaneousSymbols();
43276     test_ret += test_xmlUCSIsMiscellaneousSymbolsandArrows();
43277     test_ret += test_xmlUCSIsMiscellaneousTechnical();
43278     test_ret += test_xmlUCSIsMongolian();
43279     test_ret += test_xmlUCSIsMusicalSymbols();
43280     test_ret += test_xmlUCSIsMyanmar();
43281     test_ret += test_xmlUCSIsNumberForms();
43282     test_ret += test_xmlUCSIsOgham();
43283     test_ret += test_xmlUCSIsOldItalic();
43284     test_ret += test_xmlUCSIsOpticalCharacterRecognition();
43285     test_ret += test_xmlUCSIsOriya();
43286     test_ret += test_xmlUCSIsOsmanya();
43287     test_ret += test_xmlUCSIsPhoneticExtensions();
43288     test_ret += test_xmlUCSIsPrivateUse();
43289     test_ret += test_xmlUCSIsPrivateUseArea();
43290     test_ret += test_xmlUCSIsRunic();
43291     test_ret += test_xmlUCSIsShavian();
43292     test_ret += test_xmlUCSIsSinhala();
43293     test_ret += test_xmlUCSIsSmallFormVariants();
43294     test_ret += test_xmlUCSIsSpacingModifierLetters();
43295     test_ret += test_xmlUCSIsSpecials();
43296     test_ret += test_xmlUCSIsSuperscriptsandSubscripts();
43297     test_ret += test_xmlUCSIsSupplementalArrowsA();
43298     test_ret += test_xmlUCSIsSupplementalArrowsB();
43299     test_ret += test_xmlUCSIsSupplementalMathematicalOperators();
43300     test_ret += test_xmlUCSIsSupplementaryPrivateUseAreaA();
43301     test_ret += test_xmlUCSIsSupplementaryPrivateUseAreaB();
43302     test_ret += test_xmlUCSIsSyriac();
43303     test_ret += test_xmlUCSIsTagalog();
43304     test_ret += test_xmlUCSIsTagbanwa();
43305     test_ret += test_xmlUCSIsTags();
43306     test_ret += test_xmlUCSIsTaiLe();
43307     test_ret += test_xmlUCSIsTaiXuanJingSymbols();
43308     test_ret += test_xmlUCSIsTamil();
43309     test_ret += test_xmlUCSIsTelugu();
43310     test_ret += test_xmlUCSIsThaana();
43311     test_ret += test_xmlUCSIsThai();
43312     test_ret += test_xmlUCSIsTibetan();
43313     test_ret += test_xmlUCSIsUgaritic();
43314     test_ret += test_xmlUCSIsUnifiedCanadianAboriginalSyllabics();
43315     test_ret += test_xmlUCSIsVariationSelectors();
43316     test_ret += test_xmlUCSIsVariationSelectorsSupplement();
43317     test_ret += test_xmlUCSIsYiRadicals();
43318     test_ret += test_xmlUCSIsYiSyllables();
43319     test_ret += test_xmlUCSIsYijingHexagramSymbols();
43320 
43321     if (test_ret != 0)
43322 	printf("Module xmlunicode: %d errors\n", test_ret);
43323     return(test_ret);
43324 }
43325 
43326 static int
test_xmlNewTextWriter(void)43327 test_xmlNewTextWriter(void) {
43328     int test_ret = 0;
43329 
43330 #if defined(LIBXML_WRITER_ENABLED)
43331     int mem_base;
43332     xmlTextWriterPtr ret_val;
43333     xmlOutputBufferPtr out; /* an xmlOutputBufferPtr */
43334     int n_out;
43335 
43336     for (n_out = 0;n_out < gen_nb_xmlOutputBufferPtr;n_out++) {
43337         mem_base = xmlMemBlocks();
43338         out = gen_xmlOutputBufferPtr(n_out, 0);
43339 
43340         ret_val = xmlNewTextWriter(out);
43341         if (ret_val != NULL) out = NULL;
43342         desret_xmlTextWriterPtr(ret_val);
43343         call_tests++;
43344         des_xmlOutputBufferPtr(n_out, out, 0);
43345         xmlResetLastError();
43346         if (mem_base != xmlMemBlocks()) {
43347             printf("Leak of %d blocks found in xmlNewTextWriter",
43348 	           xmlMemBlocks() - mem_base);
43349 	    test_ret++;
43350             printf(" %d", n_out);
43351             printf("\n");
43352         }
43353     }
43354     function_tests++;
43355 #endif
43356 
43357     return(test_ret);
43358 }
43359 
43360 
43361 static int
test_xmlNewTextWriterFilename(void)43362 test_xmlNewTextWriterFilename(void) {
43363     int test_ret = 0;
43364 
43365 #if defined(LIBXML_WRITER_ENABLED)
43366     int mem_base;
43367     xmlTextWriterPtr ret_val;
43368     const char * uri; /* the URI of the resource for the output */
43369     int n_uri;
43370     int compression; /* compress the output? */
43371     int n_compression;
43372 
43373     for (n_uri = 0;n_uri < gen_nb_fileoutput;n_uri++) {
43374     for (n_compression = 0;n_compression < gen_nb_int;n_compression++) {
43375         mem_base = xmlMemBlocks();
43376         uri = gen_fileoutput(n_uri, 0);
43377         compression = gen_int(n_compression, 1);
43378 
43379         ret_val = xmlNewTextWriterFilename(uri, compression);
43380         desret_xmlTextWriterPtr(ret_val);
43381         call_tests++;
43382         des_fileoutput(n_uri, uri, 0);
43383         des_int(n_compression, compression, 1);
43384         xmlResetLastError();
43385         if (mem_base != xmlMemBlocks()) {
43386             printf("Leak of %d blocks found in xmlNewTextWriterFilename",
43387 	           xmlMemBlocks() - mem_base);
43388 	    test_ret++;
43389             printf(" %d", n_uri);
43390             printf(" %d", n_compression);
43391             printf("\n");
43392         }
43393     }
43394     }
43395     function_tests++;
43396 #endif
43397 
43398     return(test_ret);
43399 }
43400 
43401 
43402 static int
test_xmlNewTextWriterMemory(void)43403 test_xmlNewTextWriterMemory(void) {
43404     int test_ret = 0;
43405 
43406 #if defined(LIBXML_WRITER_ENABLED)
43407     int mem_base;
43408     xmlTextWriterPtr ret_val;
43409     xmlBufferPtr buf; /* xmlBufferPtr */
43410     int n_buf;
43411     int compression; /* compress the output? */
43412     int n_compression;
43413 
43414     for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
43415     for (n_compression = 0;n_compression < gen_nb_int;n_compression++) {
43416         mem_base = xmlMemBlocks();
43417         buf = gen_xmlBufferPtr(n_buf, 0);
43418         compression = gen_int(n_compression, 1);
43419 
43420         ret_val = xmlNewTextWriterMemory(buf, compression);
43421         desret_xmlTextWriterPtr(ret_val);
43422         call_tests++;
43423         des_xmlBufferPtr(n_buf, buf, 0);
43424         des_int(n_compression, compression, 1);
43425         xmlResetLastError();
43426         if (mem_base != xmlMemBlocks()) {
43427             printf("Leak of %d blocks found in xmlNewTextWriterMemory",
43428 	           xmlMemBlocks() - mem_base);
43429 	    test_ret++;
43430             printf(" %d", n_buf);
43431             printf(" %d", n_compression);
43432             printf("\n");
43433         }
43434     }
43435     }
43436     function_tests++;
43437 #endif
43438 
43439     return(test_ret);
43440 }
43441 
43442 
43443 static int
test_xmlNewTextWriterPushParser(void)43444 test_xmlNewTextWriterPushParser(void) {
43445     int test_ret = 0;
43446 
43447 #if defined(LIBXML_WRITER_ENABLED)
43448     int mem_base;
43449     xmlTextWriterPtr ret_val;
43450     xmlParserCtxtPtr ctxt; /* xmlParserCtxtPtr to hold the new XML document tree */
43451     int n_ctxt;
43452     int compression; /* compress the output? */
43453     int n_compression;
43454 
43455     for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
43456     for (n_compression = 0;n_compression < gen_nb_int;n_compression++) {
43457         mem_base = xmlMemBlocks();
43458         ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
43459         compression = gen_int(n_compression, 1);
43460 
43461         ret_val = xmlNewTextWriterPushParser(ctxt, compression);
43462         if (ctxt != NULL) {xmlFreeDoc(ctxt->myDoc); ctxt->myDoc = NULL;} if (ret_val != NULL) ctxt = NULL;
43463         desret_xmlTextWriterPtr(ret_val);
43464         call_tests++;
43465         des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
43466         des_int(n_compression, compression, 1);
43467         xmlResetLastError();
43468         if (mem_base != xmlMemBlocks()) {
43469             printf("Leak of %d blocks found in xmlNewTextWriterPushParser",
43470 	           xmlMemBlocks() - mem_base);
43471 	    test_ret++;
43472             printf(" %d", n_ctxt);
43473             printf(" %d", n_compression);
43474             printf("\n");
43475         }
43476     }
43477     }
43478     function_tests++;
43479 #endif
43480 
43481     return(test_ret);
43482 }
43483 
43484 
43485 static int
test_xmlNewTextWriterTree(void)43486 test_xmlNewTextWriterTree(void) {
43487     int test_ret = 0;
43488 
43489 #if defined(LIBXML_WRITER_ENABLED)
43490     int mem_base;
43491     xmlTextWriterPtr ret_val;
43492     xmlDocPtr doc; /* xmlDocPtr */
43493     int n_doc;
43494     xmlNodePtr node; /* xmlNodePtr or NULL for doc->children */
43495     int n_node;
43496     int compression; /* compress the output? */
43497     int n_compression;
43498 
43499     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
43500     for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
43501     for (n_compression = 0;n_compression < gen_nb_int;n_compression++) {
43502         mem_base = xmlMemBlocks();
43503         doc = gen_xmlDocPtr(n_doc, 0);
43504         node = gen_xmlNodePtr(n_node, 1);
43505         compression = gen_int(n_compression, 2);
43506 
43507         ret_val = xmlNewTextWriterTree(doc, node, compression);
43508         desret_xmlTextWriterPtr(ret_val);
43509         call_tests++;
43510         des_xmlDocPtr(n_doc, doc, 0);
43511         des_xmlNodePtr(n_node, node, 1);
43512         des_int(n_compression, compression, 2);
43513         xmlResetLastError();
43514         if (mem_base != xmlMemBlocks()) {
43515             printf("Leak of %d blocks found in xmlNewTextWriterTree",
43516 	           xmlMemBlocks() - mem_base);
43517 	    test_ret++;
43518             printf(" %d", n_doc);
43519             printf(" %d", n_node);
43520             printf(" %d", n_compression);
43521             printf("\n");
43522         }
43523     }
43524     }
43525     }
43526     function_tests++;
43527 #endif
43528 
43529     return(test_ret);
43530 }
43531 
43532 
43533 static int
test_xmlTextWriterEndAttribute(void)43534 test_xmlTextWriterEndAttribute(void) {
43535     int test_ret = 0;
43536 
43537 #if defined(LIBXML_WRITER_ENABLED)
43538     int mem_base;
43539     int ret_val;
43540     xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
43541     int n_writer;
43542 
43543     for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
43544         mem_base = xmlMemBlocks();
43545         writer = gen_xmlTextWriterPtr(n_writer, 0);
43546 
43547         ret_val = xmlTextWriterEndAttribute(writer);
43548         desret_int(ret_val);
43549         call_tests++;
43550         des_xmlTextWriterPtr(n_writer, writer, 0);
43551         xmlResetLastError();
43552         if (mem_base != xmlMemBlocks()) {
43553             printf("Leak of %d blocks found in xmlTextWriterEndAttribute",
43554 	           xmlMemBlocks() - mem_base);
43555 	    test_ret++;
43556             printf(" %d", n_writer);
43557             printf("\n");
43558         }
43559     }
43560     function_tests++;
43561 #endif
43562 
43563     return(test_ret);
43564 }
43565 
43566 
43567 static int
test_xmlTextWriterEndCDATA(void)43568 test_xmlTextWriterEndCDATA(void) {
43569     int test_ret = 0;
43570 
43571 #if defined(LIBXML_WRITER_ENABLED)
43572     int mem_base;
43573     int ret_val;
43574     xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
43575     int n_writer;
43576 
43577     for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
43578         mem_base = xmlMemBlocks();
43579         writer = gen_xmlTextWriterPtr(n_writer, 0);
43580 
43581         ret_val = xmlTextWriterEndCDATA(writer);
43582         desret_int(ret_val);
43583         call_tests++;
43584         des_xmlTextWriterPtr(n_writer, writer, 0);
43585         xmlResetLastError();
43586         if (mem_base != xmlMemBlocks()) {
43587             printf("Leak of %d blocks found in xmlTextWriterEndCDATA",
43588 	           xmlMemBlocks() - mem_base);
43589 	    test_ret++;
43590             printf(" %d", n_writer);
43591             printf("\n");
43592         }
43593     }
43594     function_tests++;
43595 #endif
43596 
43597     return(test_ret);
43598 }
43599 
43600 
43601 static int
test_xmlTextWriterEndComment(void)43602 test_xmlTextWriterEndComment(void) {
43603     int test_ret = 0;
43604 
43605 #if defined(LIBXML_WRITER_ENABLED)
43606     int mem_base;
43607     int ret_val;
43608     xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
43609     int n_writer;
43610 
43611     for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
43612         mem_base = xmlMemBlocks();
43613         writer = gen_xmlTextWriterPtr(n_writer, 0);
43614 
43615         ret_val = xmlTextWriterEndComment(writer);
43616         desret_int(ret_val);
43617         call_tests++;
43618         des_xmlTextWriterPtr(n_writer, writer, 0);
43619         xmlResetLastError();
43620         if (mem_base != xmlMemBlocks()) {
43621             printf("Leak of %d blocks found in xmlTextWriterEndComment",
43622 	           xmlMemBlocks() - mem_base);
43623 	    test_ret++;
43624             printf(" %d", n_writer);
43625             printf("\n");
43626         }
43627     }
43628     function_tests++;
43629 #endif
43630 
43631     return(test_ret);
43632 }
43633 
43634 
43635 static int
test_xmlTextWriterEndDTD(void)43636 test_xmlTextWriterEndDTD(void) {
43637     int test_ret = 0;
43638 
43639 #if defined(LIBXML_WRITER_ENABLED)
43640     int mem_base;
43641     int ret_val;
43642     xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
43643     int n_writer;
43644 
43645     for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
43646         mem_base = xmlMemBlocks();
43647         writer = gen_xmlTextWriterPtr(n_writer, 0);
43648 
43649         ret_val = xmlTextWriterEndDTD(writer);
43650         desret_int(ret_val);
43651         call_tests++;
43652         des_xmlTextWriterPtr(n_writer, writer, 0);
43653         xmlResetLastError();
43654         if (mem_base != xmlMemBlocks()) {
43655             printf("Leak of %d blocks found in xmlTextWriterEndDTD",
43656 	           xmlMemBlocks() - mem_base);
43657 	    test_ret++;
43658             printf(" %d", n_writer);
43659             printf("\n");
43660         }
43661     }
43662     function_tests++;
43663 #endif
43664 
43665     return(test_ret);
43666 }
43667 
43668 
43669 static int
test_xmlTextWriterEndDTDAttlist(void)43670 test_xmlTextWriterEndDTDAttlist(void) {
43671     int test_ret = 0;
43672 
43673 #if defined(LIBXML_WRITER_ENABLED)
43674     int mem_base;
43675     int ret_val;
43676     xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
43677     int n_writer;
43678 
43679     for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
43680         mem_base = xmlMemBlocks();
43681         writer = gen_xmlTextWriterPtr(n_writer, 0);
43682 
43683         ret_val = xmlTextWriterEndDTDAttlist(writer);
43684         desret_int(ret_val);
43685         call_tests++;
43686         des_xmlTextWriterPtr(n_writer, writer, 0);
43687         xmlResetLastError();
43688         if (mem_base != xmlMemBlocks()) {
43689             printf("Leak of %d blocks found in xmlTextWriterEndDTDAttlist",
43690 	           xmlMemBlocks() - mem_base);
43691 	    test_ret++;
43692             printf(" %d", n_writer);
43693             printf("\n");
43694         }
43695     }
43696     function_tests++;
43697 #endif
43698 
43699     return(test_ret);
43700 }
43701 
43702 
43703 static int
test_xmlTextWriterEndDTDElement(void)43704 test_xmlTextWriterEndDTDElement(void) {
43705     int test_ret = 0;
43706 
43707 #if defined(LIBXML_WRITER_ENABLED)
43708     int mem_base;
43709     int ret_val;
43710     xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
43711     int n_writer;
43712 
43713     for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
43714         mem_base = xmlMemBlocks();
43715         writer = gen_xmlTextWriterPtr(n_writer, 0);
43716 
43717         ret_val = xmlTextWriterEndDTDElement(writer);
43718         desret_int(ret_val);
43719         call_tests++;
43720         des_xmlTextWriterPtr(n_writer, writer, 0);
43721         xmlResetLastError();
43722         if (mem_base != xmlMemBlocks()) {
43723             printf("Leak of %d blocks found in xmlTextWriterEndDTDElement",
43724 	           xmlMemBlocks() - mem_base);
43725 	    test_ret++;
43726             printf(" %d", n_writer);
43727             printf("\n");
43728         }
43729     }
43730     function_tests++;
43731 #endif
43732 
43733     return(test_ret);
43734 }
43735 
43736 
43737 static int
test_xmlTextWriterEndDTDEntity(void)43738 test_xmlTextWriterEndDTDEntity(void) {
43739     int test_ret = 0;
43740 
43741 #if defined(LIBXML_WRITER_ENABLED)
43742     int mem_base;
43743     int ret_val;
43744     xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
43745     int n_writer;
43746 
43747     for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
43748         mem_base = xmlMemBlocks();
43749         writer = gen_xmlTextWriterPtr(n_writer, 0);
43750 
43751         ret_val = xmlTextWriterEndDTDEntity(writer);
43752         desret_int(ret_val);
43753         call_tests++;
43754         des_xmlTextWriterPtr(n_writer, writer, 0);
43755         xmlResetLastError();
43756         if (mem_base != xmlMemBlocks()) {
43757             printf("Leak of %d blocks found in xmlTextWriterEndDTDEntity",
43758 	           xmlMemBlocks() - mem_base);
43759 	    test_ret++;
43760             printf(" %d", n_writer);
43761             printf("\n");
43762         }
43763     }
43764     function_tests++;
43765 #endif
43766 
43767     return(test_ret);
43768 }
43769 
43770 
43771 static int
test_xmlTextWriterEndDocument(void)43772 test_xmlTextWriterEndDocument(void) {
43773     int test_ret = 0;
43774 
43775 #if defined(LIBXML_WRITER_ENABLED)
43776     int mem_base;
43777     int ret_val;
43778     xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
43779     int n_writer;
43780 
43781     for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
43782         mem_base = xmlMemBlocks();
43783         writer = gen_xmlTextWriterPtr(n_writer, 0);
43784 
43785         ret_val = xmlTextWriterEndDocument(writer);
43786         desret_int(ret_val);
43787         call_tests++;
43788         des_xmlTextWriterPtr(n_writer, writer, 0);
43789         xmlResetLastError();
43790         if (mem_base != xmlMemBlocks()) {
43791             printf("Leak of %d blocks found in xmlTextWriterEndDocument",
43792 	           xmlMemBlocks() - mem_base);
43793 	    test_ret++;
43794             printf(" %d", n_writer);
43795             printf("\n");
43796         }
43797     }
43798     function_tests++;
43799 #endif
43800 
43801     return(test_ret);
43802 }
43803 
43804 
43805 static int
test_xmlTextWriterEndElement(void)43806 test_xmlTextWriterEndElement(void) {
43807     int test_ret = 0;
43808 
43809 #if defined(LIBXML_WRITER_ENABLED)
43810     int mem_base;
43811     int ret_val;
43812     xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
43813     int n_writer;
43814 
43815     for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
43816         mem_base = xmlMemBlocks();
43817         writer = gen_xmlTextWriterPtr(n_writer, 0);
43818 
43819         ret_val = xmlTextWriterEndElement(writer);
43820         desret_int(ret_val);
43821         call_tests++;
43822         des_xmlTextWriterPtr(n_writer, writer, 0);
43823         xmlResetLastError();
43824         if (mem_base != xmlMemBlocks()) {
43825             printf("Leak of %d blocks found in xmlTextWriterEndElement",
43826 	           xmlMemBlocks() - mem_base);
43827 	    test_ret++;
43828             printf(" %d", n_writer);
43829             printf("\n");
43830         }
43831     }
43832     function_tests++;
43833 #endif
43834 
43835     return(test_ret);
43836 }
43837 
43838 
43839 static int
test_xmlTextWriterEndPI(void)43840 test_xmlTextWriterEndPI(void) {
43841     int test_ret = 0;
43842 
43843 #if defined(LIBXML_WRITER_ENABLED)
43844     int mem_base;
43845     int ret_val;
43846     xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
43847     int n_writer;
43848 
43849     for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
43850         mem_base = xmlMemBlocks();
43851         writer = gen_xmlTextWriterPtr(n_writer, 0);
43852 
43853         ret_val = xmlTextWriterEndPI(writer);
43854         desret_int(ret_val);
43855         call_tests++;
43856         des_xmlTextWriterPtr(n_writer, writer, 0);
43857         xmlResetLastError();
43858         if (mem_base != xmlMemBlocks()) {
43859             printf("Leak of %d blocks found in xmlTextWriterEndPI",
43860 	           xmlMemBlocks() - mem_base);
43861 	    test_ret++;
43862             printf(" %d", n_writer);
43863             printf("\n");
43864         }
43865     }
43866     function_tests++;
43867 #endif
43868 
43869     return(test_ret);
43870 }
43871 
43872 
43873 static int
test_xmlTextWriterFlush(void)43874 test_xmlTextWriterFlush(void) {
43875     int test_ret = 0;
43876 
43877 #if defined(LIBXML_WRITER_ENABLED)
43878     int mem_base;
43879     int ret_val;
43880     xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
43881     int n_writer;
43882 
43883     for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
43884         mem_base = xmlMemBlocks();
43885         writer = gen_xmlTextWriterPtr(n_writer, 0);
43886 
43887         ret_val = xmlTextWriterFlush(writer);
43888         desret_int(ret_val);
43889         call_tests++;
43890         des_xmlTextWriterPtr(n_writer, writer, 0);
43891         xmlResetLastError();
43892         if (mem_base != xmlMemBlocks()) {
43893             printf("Leak of %d blocks found in xmlTextWriterFlush",
43894 	           xmlMemBlocks() - mem_base);
43895 	    test_ret++;
43896             printf(" %d", n_writer);
43897             printf("\n");
43898         }
43899     }
43900     function_tests++;
43901 #endif
43902 
43903     return(test_ret);
43904 }
43905 
43906 
43907 static int
test_xmlTextWriterFullEndElement(void)43908 test_xmlTextWriterFullEndElement(void) {
43909     int test_ret = 0;
43910 
43911 #if defined(LIBXML_WRITER_ENABLED)
43912     int mem_base;
43913     int ret_val;
43914     xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
43915     int n_writer;
43916 
43917     for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
43918         mem_base = xmlMemBlocks();
43919         writer = gen_xmlTextWriterPtr(n_writer, 0);
43920 
43921         ret_val = xmlTextWriterFullEndElement(writer);
43922         desret_int(ret_val);
43923         call_tests++;
43924         des_xmlTextWriterPtr(n_writer, writer, 0);
43925         xmlResetLastError();
43926         if (mem_base != xmlMemBlocks()) {
43927             printf("Leak of %d blocks found in xmlTextWriterFullEndElement",
43928 	           xmlMemBlocks() - mem_base);
43929 	    test_ret++;
43930             printf(" %d", n_writer);
43931             printf("\n");
43932         }
43933     }
43934     function_tests++;
43935 #endif
43936 
43937     return(test_ret);
43938 }
43939 
43940 
43941 static int
test_xmlTextWriterSetIndent(void)43942 test_xmlTextWriterSetIndent(void) {
43943     int test_ret = 0;
43944 
43945 #if defined(LIBXML_WRITER_ENABLED)
43946     int mem_base;
43947     int ret_val;
43948     xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
43949     int n_writer;
43950     int indent; /* do indentation? */
43951     int n_indent;
43952 
43953     for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
43954     for (n_indent = 0;n_indent < gen_nb_int;n_indent++) {
43955         mem_base = xmlMemBlocks();
43956         writer = gen_xmlTextWriterPtr(n_writer, 0);
43957         indent = gen_int(n_indent, 1);
43958 
43959         ret_val = xmlTextWriterSetIndent(writer, indent);
43960         desret_int(ret_val);
43961         call_tests++;
43962         des_xmlTextWriterPtr(n_writer, writer, 0);
43963         des_int(n_indent, indent, 1);
43964         xmlResetLastError();
43965         if (mem_base != xmlMemBlocks()) {
43966             printf("Leak of %d blocks found in xmlTextWriterSetIndent",
43967 	           xmlMemBlocks() - mem_base);
43968 	    test_ret++;
43969             printf(" %d", n_writer);
43970             printf(" %d", n_indent);
43971             printf("\n");
43972         }
43973     }
43974     }
43975     function_tests++;
43976 #endif
43977 
43978     return(test_ret);
43979 }
43980 
43981 
43982 static int
test_xmlTextWriterSetIndentString(void)43983 test_xmlTextWriterSetIndentString(void) {
43984     int test_ret = 0;
43985 
43986 #if defined(LIBXML_WRITER_ENABLED)
43987     int mem_base;
43988     int ret_val;
43989     xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
43990     int n_writer;
43991     xmlChar * str; /* the xmlChar string */
43992     int n_str;
43993 
43994     for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
43995     for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) {
43996         mem_base = xmlMemBlocks();
43997         writer = gen_xmlTextWriterPtr(n_writer, 0);
43998         str = gen_const_xmlChar_ptr(n_str, 1);
43999 
44000         ret_val = xmlTextWriterSetIndentString(writer, (const xmlChar *)str);
44001         desret_int(ret_val);
44002         call_tests++;
44003         des_xmlTextWriterPtr(n_writer, writer, 0);
44004         des_const_xmlChar_ptr(n_str, (const xmlChar *)str, 1);
44005         xmlResetLastError();
44006         if (mem_base != xmlMemBlocks()) {
44007             printf("Leak of %d blocks found in xmlTextWriterSetIndentString",
44008 	           xmlMemBlocks() - mem_base);
44009 	    test_ret++;
44010             printf(" %d", n_writer);
44011             printf(" %d", n_str);
44012             printf("\n");
44013         }
44014     }
44015     }
44016     function_tests++;
44017 #endif
44018 
44019     return(test_ret);
44020 }
44021 
44022 
44023 static int
test_xmlTextWriterSetQuoteChar(void)44024 test_xmlTextWriterSetQuoteChar(void) {
44025     int test_ret = 0;
44026 
44027 #if defined(LIBXML_WRITER_ENABLED)
44028     int mem_base;
44029     int ret_val;
44030     xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
44031     int n_writer;
44032     xmlChar quotechar; /* the quote character */
44033     int n_quotechar;
44034 
44035     for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
44036     for (n_quotechar = 0;n_quotechar < gen_nb_xmlChar;n_quotechar++) {
44037         mem_base = xmlMemBlocks();
44038         writer = gen_xmlTextWriterPtr(n_writer, 0);
44039         quotechar = gen_xmlChar(n_quotechar, 1);
44040 
44041         ret_val = xmlTextWriterSetQuoteChar(writer, quotechar);
44042         desret_int(ret_val);
44043         call_tests++;
44044         des_xmlTextWriterPtr(n_writer, writer, 0);
44045         des_xmlChar(n_quotechar, quotechar, 1);
44046         xmlResetLastError();
44047         if (mem_base != xmlMemBlocks()) {
44048             printf("Leak of %d blocks found in xmlTextWriterSetQuoteChar",
44049 	           xmlMemBlocks() - mem_base);
44050 	    test_ret++;
44051             printf(" %d", n_writer);
44052             printf(" %d", n_quotechar);
44053             printf("\n");
44054         }
44055     }
44056     }
44057     function_tests++;
44058 #endif
44059 
44060     return(test_ret);
44061 }
44062 
44063 
44064 static int
test_xmlTextWriterStartAttribute(void)44065 test_xmlTextWriterStartAttribute(void) {
44066     int test_ret = 0;
44067 
44068 #if defined(LIBXML_WRITER_ENABLED)
44069     int mem_base;
44070     int ret_val;
44071     xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
44072     int n_writer;
44073     xmlChar * name; /* element name */
44074     int n_name;
44075 
44076     for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
44077     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
44078         mem_base = xmlMemBlocks();
44079         writer = gen_xmlTextWriterPtr(n_writer, 0);
44080         name = gen_const_xmlChar_ptr(n_name, 1);
44081 
44082         ret_val = xmlTextWriterStartAttribute(writer, (const xmlChar *)name);
44083         desret_int(ret_val);
44084         call_tests++;
44085         des_xmlTextWriterPtr(n_writer, writer, 0);
44086         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
44087         xmlResetLastError();
44088         if (mem_base != xmlMemBlocks()) {
44089             printf("Leak of %d blocks found in xmlTextWriterStartAttribute",
44090 	           xmlMemBlocks() - mem_base);
44091 	    test_ret++;
44092             printf(" %d", n_writer);
44093             printf(" %d", n_name);
44094             printf("\n");
44095         }
44096     }
44097     }
44098     function_tests++;
44099 #endif
44100 
44101     return(test_ret);
44102 }
44103 
44104 
44105 static int
test_xmlTextWriterStartAttributeNS(void)44106 test_xmlTextWriterStartAttributeNS(void) {
44107     int test_ret = 0;
44108 
44109 #if defined(LIBXML_WRITER_ENABLED)
44110     int mem_base;
44111     int ret_val;
44112     xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
44113     int n_writer;
44114     xmlChar * prefix; /* namespace prefix or NULL */
44115     int n_prefix;
44116     xmlChar * name; /* element local name */
44117     int n_name;
44118     xmlChar * namespaceURI; /* namespace URI or NULL */
44119     int n_namespaceURI;
44120 
44121     for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
44122     for (n_prefix = 0;n_prefix < gen_nb_const_xmlChar_ptr;n_prefix++) {
44123     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
44124     for (n_namespaceURI = 0;n_namespaceURI < gen_nb_const_xmlChar_ptr;n_namespaceURI++) {
44125         mem_base = xmlMemBlocks();
44126         writer = gen_xmlTextWriterPtr(n_writer, 0);
44127         prefix = gen_const_xmlChar_ptr(n_prefix, 1);
44128         name = gen_const_xmlChar_ptr(n_name, 2);
44129         namespaceURI = gen_const_xmlChar_ptr(n_namespaceURI, 3);
44130 
44131         ret_val = xmlTextWriterStartAttributeNS(writer, (const xmlChar *)prefix, (const xmlChar *)name, (const xmlChar *)namespaceURI);
44132         desret_int(ret_val);
44133         call_tests++;
44134         des_xmlTextWriterPtr(n_writer, writer, 0);
44135         des_const_xmlChar_ptr(n_prefix, (const xmlChar *)prefix, 1);
44136         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 2);
44137         des_const_xmlChar_ptr(n_namespaceURI, (const xmlChar *)namespaceURI, 3);
44138         xmlResetLastError();
44139         if (mem_base != xmlMemBlocks()) {
44140             printf("Leak of %d blocks found in xmlTextWriterStartAttributeNS",
44141 	           xmlMemBlocks() - mem_base);
44142 	    test_ret++;
44143             printf(" %d", n_writer);
44144             printf(" %d", n_prefix);
44145             printf(" %d", n_name);
44146             printf(" %d", n_namespaceURI);
44147             printf("\n");
44148         }
44149     }
44150     }
44151     }
44152     }
44153     function_tests++;
44154 #endif
44155 
44156     return(test_ret);
44157 }
44158 
44159 
44160 static int
test_xmlTextWriterStartCDATA(void)44161 test_xmlTextWriterStartCDATA(void) {
44162     int test_ret = 0;
44163 
44164 #if defined(LIBXML_WRITER_ENABLED)
44165     int mem_base;
44166     int ret_val;
44167     xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
44168     int n_writer;
44169 
44170     for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
44171         mem_base = xmlMemBlocks();
44172         writer = gen_xmlTextWriterPtr(n_writer, 0);
44173 
44174         ret_val = xmlTextWriterStartCDATA(writer);
44175         desret_int(ret_val);
44176         call_tests++;
44177         des_xmlTextWriterPtr(n_writer, writer, 0);
44178         xmlResetLastError();
44179         if (mem_base != xmlMemBlocks()) {
44180             printf("Leak of %d blocks found in xmlTextWriterStartCDATA",
44181 	           xmlMemBlocks() - mem_base);
44182 	    test_ret++;
44183             printf(" %d", n_writer);
44184             printf("\n");
44185         }
44186     }
44187     function_tests++;
44188 #endif
44189 
44190     return(test_ret);
44191 }
44192 
44193 
44194 static int
test_xmlTextWriterStartComment(void)44195 test_xmlTextWriterStartComment(void) {
44196     int test_ret = 0;
44197 
44198 #if defined(LIBXML_WRITER_ENABLED)
44199     int mem_base;
44200     int ret_val;
44201     xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
44202     int n_writer;
44203 
44204     for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
44205         mem_base = xmlMemBlocks();
44206         writer = gen_xmlTextWriterPtr(n_writer, 0);
44207 
44208         ret_val = xmlTextWriterStartComment(writer);
44209         desret_int(ret_val);
44210         call_tests++;
44211         des_xmlTextWriterPtr(n_writer, writer, 0);
44212         xmlResetLastError();
44213         if (mem_base != xmlMemBlocks()) {
44214             printf("Leak of %d blocks found in xmlTextWriterStartComment",
44215 	           xmlMemBlocks() - mem_base);
44216 	    test_ret++;
44217             printf(" %d", n_writer);
44218             printf("\n");
44219         }
44220     }
44221     function_tests++;
44222 #endif
44223 
44224     return(test_ret);
44225 }
44226 
44227 
44228 static int
test_xmlTextWriterStartDTD(void)44229 test_xmlTextWriterStartDTD(void) {
44230     int test_ret = 0;
44231 
44232 #if defined(LIBXML_WRITER_ENABLED)
44233     int mem_base;
44234     int ret_val;
44235     xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
44236     int n_writer;
44237     xmlChar * name; /* the name of the DTD */
44238     int n_name;
44239     xmlChar * pubid; /* the public identifier, which is an alternative to the system identifier */
44240     int n_pubid;
44241     xmlChar * sysid; /* the system identifier, which is the URI of the DTD */
44242     int n_sysid;
44243 
44244     for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
44245     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
44246     for (n_pubid = 0;n_pubid < gen_nb_const_xmlChar_ptr;n_pubid++) {
44247     for (n_sysid = 0;n_sysid < gen_nb_const_xmlChar_ptr;n_sysid++) {
44248         mem_base = xmlMemBlocks();
44249         writer = gen_xmlTextWriterPtr(n_writer, 0);
44250         name = gen_const_xmlChar_ptr(n_name, 1);
44251         pubid = gen_const_xmlChar_ptr(n_pubid, 2);
44252         sysid = gen_const_xmlChar_ptr(n_sysid, 3);
44253 
44254         ret_val = xmlTextWriterStartDTD(writer, (const xmlChar *)name, (const xmlChar *)pubid, (const xmlChar *)sysid);
44255         desret_int(ret_val);
44256         call_tests++;
44257         des_xmlTextWriterPtr(n_writer, writer, 0);
44258         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
44259         des_const_xmlChar_ptr(n_pubid, (const xmlChar *)pubid, 2);
44260         des_const_xmlChar_ptr(n_sysid, (const xmlChar *)sysid, 3);
44261         xmlResetLastError();
44262         if (mem_base != xmlMemBlocks()) {
44263             printf("Leak of %d blocks found in xmlTextWriterStartDTD",
44264 	           xmlMemBlocks() - mem_base);
44265 	    test_ret++;
44266             printf(" %d", n_writer);
44267             printf(" %d", n_name);
44268             printf(" %d", n_pubid);
44269             printf(" %d", n_sysid);
44270             printf("\n");
44271         }
44272     }
44273     }
44274     }
44275     }
44276     function_tests++;
44277 #endif
44278 
44279     return(test_ret);
44280 }
44281 
44282 
44283 static int
test_xmlTextWriterStartDTDAttlist(void)44284 test_xmlTextWriterStartDTDAttlist(void) {
44285     int test_ret = 0;
44286 
44287 #if defined(LIBXML_WRITER_ENABLED)
44288     int mem_base;
44289     int ret_val;
44290     xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
44291     int n_writer;
44292     xmlChar * name; /* the name of the DTD ATTLIST */
44293     int n_name;
44294 
44295     for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
44296     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
44297         mem_base = xmlMemBlocks();
44298         writer = gen_xmlTextWriterPtr(n_writer, 0);
44299         name = gen_const_xmlChar_ptr(n_name, 1);
44300 
44301         ret_val = xmlTextWriterStartDTDAttlist(writer, (const xmlChar *)name);
44302         desret_int(ret_val);
44303         call_tests++;
44304         des_xmlTextWriterPtr(n_writer, writer, 0);
44305         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
44306         xmlResetLastError();
44307         if (mem_base != xmlMemBlocks()) {
44308             printf("Leak of %d blocks found in xmlTextWriterStartDTDAttlist",
44309 	           xmlMemBlocks() - mem_base);
44310 	    test_ret++;
44311             printf(" %d", n_writer);
44312             printf(" %d", n_name);
44313             printf("\n");
44314         }
44315     }
44316     }
44317     function_tests++;
44318 #endif
44319 
44320     return(test_ret);
44321 }
44322 
44323 
44324 static int
test_xmlTextWriterStartDTDElement(void)44325 test_xmlTextWriterStartDTDElement(void) {
44326     int test_ret = 0;
44327 
44328 #if defined(LIBXML_WRITER_ENABLED)
44329     int mem_base;
44330     int ret_val;
44331     xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
44332     int n_writer;
44333     xmlChar * name; /* the name of the DTD element */
44334     int n_name;
44335 
44336     for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
44337     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
44338         mem_base = xmlMemBlocks();
44339         writer = gen_xmlTextWriterPtr(n_writer, 0);
44340         name = gen_const_xmlChar_ptr(n_name, 1);
44341 
44342         ret_val = xmlTextWriterStartDTDElement(writer, (const xmlChar *)name);
44343         desret_int(ret_val);
44344         call_tests++;
44345         des_xmlTextWriterPtr(n_writer, writer, 0);
44346         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
44347         xmlResetLastError();
44348         if (mem_base != xmlMemBlocks()) {
44349             printf("Leak of %d blocks found in xmlTextWriterStartDTDElement",
44350 	           xmlMemBlocks() - mem_base);
44351 	    test_ret++;
44352             printf(" %d", n_writer);
44353             printf(" %d", n_name);
44354             printf("\n");
44355         }
44356     }
44357     }
44358     function_tests++;
44359 #endif
44360 
44361     return(test_ret);
44362 }
44363 
44364 
44365 static int
test_xmlTextWriterStartDTDEntity(void)44366 test_xmlTextWriterStartDTDEntity(void) {
44367     int test_ret = 0;
44368 
44369 #if defined(LIBXML_WRITER_ENABLED)
44370     int mem_base;
44371     int ret_val;
44372     xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
44373     int n_writer;
44374     int pe; /* TRUE if this is a parameter entity, FALSE if not */
44375     int n_pe;
44376     xmlChar * name; /* the name of the DTD ATTLIST */
44377     int n_name;
44378 
44379     for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
44380     for (n_pe = 0;n_pe < gen_nb_int;n_pe++) {
44381     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
44382         mem_base = xmlMemBlocks();
44383         writer = gen_xmlTextWriterPtr(n_writer, 0);
44384         pe = gen_int(n_pe, 1);
44385         name = gen_const_xmlChar_ptr(n_name, 2);
44386 
44387         ret_val = xmlTextWriterStartDTDEntity(writer, pe, (const xmlChar *)name);
44388         desret_int(ret_val);
44389         call_tests++;
44390         des_xmlTextWriterPtr(n_writer, writer, 0);
44391         des_int(n_pe, pe, 1);
44392         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 2);
44393         xmlResetLastError();
44394         if (mem_base != xmlMemBlocks()) {
44395             printf("Leak of %d blocks found in xmlTextWriterStartDTDEntity",
44396 	           xmlMemBlocks() - mem_base);
44397 	    test_ret++;
44398             printf(" %d", n_writer);
44399             printf(" %d", n_pe);
44400             printf(" %d", n_name);
44401             printf("\n");
44402         }
44403     }
44404     }
44405     }
44406     function_tests++;
44407 #endif
44408 
44409     return(test_ret);
44410 }
44411 
44412 
44413 static int
test_xmlTextWriterStartDocument(void)44414 test_xmlTextWriterStartDocument(void) {
44415     int test_ret = 0;
44416 
44417 #if defined(LIBXML_WRITER_ENABLED)
44418     int mem_base;
44419     int ret_val;
44420     xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
44421     int n_writer;
44422     char * version; /* the xml version ("1.0") or NULL for default ("1.0") */
44423     int n_version;
44424     char * encoding; /* the encoding or NULL for default */
44425     int n_encoding;
44426     char * standalone; /* "yes" or "no" or NULL for default */
44427     int n_standalone;
44428 
44429     for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
44430     for (n_version = 0;n_version < gen_nb_const_char_ptr;n_version++) {
44431     for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
44432     for (n_standalone = 0;n_standalone < gen_nb_const_char_ptr;n_standalone++) {
44433         mem_base = xmlMemBlocks();
44434         writer = gen_xmlTextWriterPtr(n_writer, 0);
44435         version = gen_const_char_ptr(n_version, 1);
44436         encoding = gen_const_char_ptr(n_encoding, 2);
44437         standalone = gen_const_char_ptr(n_standalone, 3);
44438 
44439         ret_val = xmlTextWriterStartDocument(writer, (const char *)version, (const char *)encoding, (const char *)standalone);
44440         desret_int(ret_val);
44441         call_tests++;
44442         des_xmlTextWriterPtr(n_writer, writer, 0);
44443         des_const_char_ptr(n_version, (const char *)version, 1);
44444         des_const_char_ptr(n_encoding, (const char *)encoding, 2);
44445         des_const_char_ptr(n_standalone, (const char *)standalone, 3);
44446         xmlResetLastError();
44447         if (mem_base != xmlMemBlocks()) {
44448             printf("Leak of %d blocks found in xmlTextWriterStartDocument",
44449 	           xmlMemBlocks() - mem_base);
44450 	    test_ret++;
44451             printf(" %d", n_writer);
44452             printf(" %d", n_version);
44453             printf(" %d", n_encoding);
44454             printf(" %d", n_standalone);
44455             printf("\n");
44456         }
44457     }
44458     }
44459     }
44460     }
44461     function_tests++;
44462 #endif
44463 
44464     return(test_ret);
44465 }
44466 
44467 
44468 static int
test_xmlTextWriterStartElement(void)44469 test_xmlTextWriterStartElement(void) {
44470     int test_ret = 0;
44471 
44472 #if defined(LIBXML_WRITER_ENABLED)
44473     int mem_base;
44474     int ret_val;
44475     xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
44476     int n_writer;
44477     xmlChar * name; /* element name */
44478     int n_name;
44479 
44480     for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
44481     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
44482         mem_base = xmlMemBlocks();
44483         writer = gen_xmlTextWriterPtr(n_writer, 0);
44484         name = gen_const_xmlChar_ptr(n_name, 1);
44485 
44486         ret_val = xmlTextWriterStartElement(writer, (const xmlChar *)name);
44487         desret_int(ret_val);
44488         call_tests++;
44489         des_xmlTextWriterPtr(n_writer, writer, 0);
44490         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
44491         xmlResetLastError();
44492         if (mem_base != xmlMemBlocks()) {
44493             printf("Leak of %d blocks found in xmlTextWriterStartElement",
44494 	           xmlMemBlocks() - mem_base);
44495 	    test_ret++;
44496             printf(" %d", n_writer);
44497             printf(" %d", n_name);
44498             printf("\n");
44499         }
44500     }
44501     }
44502     function_tests++;
44503 #endif
44504 
44505     return(test_ret);
44506 }
44507 
44508 
44509 static int
test_xmlTextWriterStartElementNS(void)44510 test_xmlTextWriterStartElementNS(void) {
44511     int test_ret = 0;
44512 
44513 #if defined(LIBXML_WRITER_ENABLED)
44514     int mem_base;
44515     int ret_val;
44516     xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
44517     int n_writer;
44518     xmlChar * prefix; /* namespace prefix or NULL */
44519     int n_prefix;
44520     xmlChar * name; /* element local name */
44521     int n_name;
44522     xmlChar * namespaceURI; /* namespace URI or NULL */
44523     int n_namespaceURI;
44524 
44525     for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
44526     for (n_prefix = 0;n_prefix < gen_nb_const_xmlChar_ptr;n_prefix++) {
44527     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
44528     for (n_namespaceURI = 0;n_namespaceURI < gen_nb_const_xmlChar_ptr;n_namespaceURI++) {
44529         mem_base = xmlMemBlocks();
44530         writer = gen_xmlTextWriterPtr(n_writer, 0);
44531         prefix = gen_const_xmlChar_ptr(n_prefix, 1);
44532         name = gen_const_xmlChar_ptr(n_name, 2);
44533         namespaceURI = gen_const_xmlChar_ptr(n_namespaceURI, 3);
44534 
44535         ret_val = xmlTextWriterStartElementNS(writer, (const xmlChar *)prefix, (const xmlChar *)name, (const xmlChar *)namespaceURI);
44536         desret_int(ret_val);
44537         call_tests++;
44538         des_xmlTextWriterPtr(n_writer, writer, 0);
44539         des_const_xmlChar_ptr(n_prefix, (const xmlChar *)prefix, 1);
44540         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 2);
44541         des_const_xmlChar_ptr(n_namespaceURI, (const xmlChar *)namespaceURI, 3);
44542         xmlResetLastError();
44543         if (mem_base != xmlMemBlocks()) {
44544             printf("Leak of %d blocks found in xmlTextWriterStartElementNS",
44545 	           xmlMemBlocks() - mem_base);
44546 	    test_ret++;
44547             printf(" %d", n_writer);
44548             printf(" %d", n_prefix);
44549             printf(" %d", n_name);
44550             printf(" %d", n_namespaceURI);
44551             printf("\n");
44552         }
44553     }
44554     }
44555     }
44556     }
44557     function_tests++;
44558 #endif
44559 
44560     return(test_ret);
44561 }
44562 
44563 
44564 static int
test_xmlTextWriterStartPI(void)44565 test_xmlTextWriterStartPI(void) {
44566     int test_ret = 0;
44567 
44568 #if defined(LIBXML_WRITER_ENABLED)
44569     int mem_base;
44570     int ret_val;
44571     xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
44572     int n_writer;
44573     xmlChar * target; /* PI target */
44574     int n_target;
44575 
44576     for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
44577     for (n_target = 0;n_target < gen_nb_const_xmlChar_ptr;n_target++) {
44578         mem_base = xmlMemBlocks();
44579         writer = gen_xmlTextWriterPtr(n_writer, 0);
44580         target = gen_const_xmlChar_ptr(n_target, 1);
44581 
44582         ret_val = xmlTextWriterStartPI(writer, (const xmlChar *)target);
44583         desret_int(ret_val);
44584         call_tests++;
44585         des_xmlTextWriterPtr(n_writer, writer, 0);
44586         des_const_xmlChar_ptr(n_target, (const xmlChar *)target, 1);
44587         xmlResetLastError();
44588         if (mem_base != xmlMemBlocks()) {
44589             printf("Leak of %d blocks found in xmlTextWriterStartPI",
44590 	           xmlMemBlocks() - mem_base);
44591 	    test_ret++;
44592             printf(" %d", n_writer);
44593             printf(" %d", n_target);
44594             printf("\n");
44595         }
44596     }
44597     }
44598     function_tests++;
44599 #endif
44600 
44601     return(test_ret);
44602 }
44603 
44604 
44605 static int
test_xmlTextWriterWriteAttribute(void)44606 test_xmlTextWriterWriteAttribute(void) {
44607     int test_ret = 0;
44608 
44609 #if defined(LIBXML_WRITER_ENABLED)
44610     int mem_base;
44611     int ret_val;
44612     xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
44613     int n_writer;
44614     xmlChar * name; /* attribute name */
44615     int n_name;
44616     xmlChar * content; /* attribute content */
44617     int n_content;
44618 
44619     for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
44620     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
44621     for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
44622         mem_base = xmlMemBlocks();
44623         writer = gen_xmlTextWriterPtr(n_writer, 0);
44624         name = gen_const_xmlChar_ptr(n_name, 1);
44625         content = gen_const_xmlChar_ptr(n_content, 2);
44626 
44627         ret_val = xmlTextWriterWriteAttribute(writer, (const xmlChar *)name, (const xmlChar *)content);
44628         desret_int(ret_val);
44629         call_tests++;
44630         des_xmlTextWriterPtr(n_writer, writer, 0);
44631         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
44632         des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 2);
44633         xmlResetLastError();
44634         if (mem_base != xmlMemBlocks()) {
44635             printf("Leak of %d blocks found in xmlTextWriterWriteAttribute",
44636 	           xmlMemBlocks() - mem_base);
44637 	    test_ret++;
44638             printf(" %d", n_writer);
44639             printf(" %d", n_name);
44640             printf(" %d", n_content);
44641             printf("\n");
44642         }
44643     }
44644     }
44645     }
44646     function_tests++;
44647 #endif
44648 
44649     return(test_ret);
44650 }
44651 
44652 
44653 static int
test_xmlTextWriterWriteAttributeNS(void)44654 test_xmlTextWriterWriteAttributeNS(void) {
44655     int test_ret = 0;
44656 
44657 #if defined(LIBXML_WRITER_ENABLED)
44658     int mem_base;
44659     int ret_val;
44660     xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
44661     int n_writer;
44662     xmlChar * prefix; /* namespace prefix */
44663     int n_prefix;
44664     xmlChar * name; /* attribute local name */
44665     int n_name;
44666     xmlChar * namespaceURI; /* namespace URI */
44667     int n_namespaceURI;
44668     xmlChar * content; /* attribute content */
44669     int n_content;
44670 
44671     for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
44672     for (n_prefix = 0;n_prefix < gen_nb_const_xmlChar_ptr;n_prefix++) {
44673     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
44674     for (n_namespaceURI = 0;n_namespaceURI < gen_nb_const_xmlChar_ptr;n_namespaceURI++) {
44675     for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
44676         mem_base = xmlMemBlocks();
44677         writer = gen_xmlTextWriterPtr(n_writer, 0);
44678         prefix = gen_const_xmlChar_ptr(n_prefix, 1);
44679         name = gen_const_xmlChar_ptr(n_name, 2);
44680         namespaceURI = gen_const_xmlChar_ptr(n_namespaceURI, 3);
44681         content = gen_const_xmlChar_ptr(n_content, 4);
44682 
44683         ret_val = xmlTextWriterWriteAttributeNS(writer, (const xmlChar *)prefix, (const xmlChar *)name, (const xmlChar *)namespaceURI, (const xmlChar *)content);
44684         desret_int(ret_val);
44685         call_tests++;
44686         des_xmlTextWriterPtr(n_writer, writer, 0);
44687         des_const_xmlChar_ptr(n_prefix, (const xmlChar *)prefix, 1);
44688         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 2);
44689         des_const_xmlChar_ptr(n_namespaceURI, (const xmlChar *)namespaceURI, 3);
44690         des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 4);
44691         xmlResetLastError();
44692         if (mem_base != xmlMemBlocks()) {
44693             printf("Leak of %d blocks found in xmlTextWriterWriteAttributeNS",
44694 	           xmlMemBlocks() - mem_base);
44695 	    test_ret++;
44696             printf(" %d", n_writer);
44697             printf(" %d", n_prefix);
44698             printf(" %d", n_name);
44699             printf(" %d", n_namespaceURI);
44700             printf(" %d", n_content);
44701             printf("\n");
44702         }
44703     }
44704     }
44705     }
44706     }
44707     }
44708     function_tests++;
44709 #endif
44710 
44711     return(test_ret);
44712 }
44713 
44714 
44715 static int
test_xmlTextWriterWriteBase64(void)44716 test_xmlTextWriterWriteBase64(void) {
44717     int test_ret = 0;
44718 
44719 #if defined(LIBXML_WRITER_ENABLED)
44720     int mem_base;
44721     int ret_val;
44722     xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
44723     int n_writer;
44724     char * data; /* binary data */
44725     int n_data;
44726     int start; /* the position within the data of the first byte to encode */
44727     int n_start;
44728     int len; /* the number of bytes to encode */
44729     int n_len;
44730 
44731     for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
44732     for (n_data = 0;n_data < gen_nb_const_char_ptr;n_data++) {
44733     for (n_start = 0;n_start < gen_nb_int;n_start++) {
44734     for (n_len = 0;n_len < gen_nb_int;n_len++) {
44735         mem_base = xmlMemBlocks();
44736         writer = gen_xmlTextWriterPtr(n_writer, 0);
44737         data = gen_const_char_ptr(n_data, 1);
44738         start = gen_int(n_start, 2);
44739         len = gen_int(n_len, 3);
44740         if ((data != NULL) &&
44741             (start > (int) strlen((const char *) data) + 1))
44742             continue;
44743         if ((data != NULL) &&
44744             (len > (int) strlen((const char *) data) + 1))
44745             continue;
44746 
44747         ret_val = xmlTextWriterWriteBase64(writer, (const char *)data, start, len);
44748         desret_int(ret_val);
44749         call_tests++;
44750         des_xmlTextWriterPtr(n_writer, writer, 0);
44751         des_const_char_ptr(n_data, (const char *)data, 1);
44752         des_int(n_start, start, 2);
44753         des_int(n_len, len, 3);
44754         xmlResetLastError();
44755         if (mem_base != xmlMemBlocks()) {
44756             printf("Leak of %d blocks found in xmlTextWriterWriteBase64",
44757 	           xmlMemBlocks() - mem_base);
44758 	    test_ret++;
44759             printf(" %d", n_writer);
44760             printf(" %d", n_data);
44761             printf(" %d", n_start);
44762             printf(" %d", n_len);
44763             printf("\n");
44764         }
44765     }
44766     }
44767     }
44768     }
44769     function_tests++;
44770 #endif
44771 
44772     return(test_ret);
44773 }
44774 
44775 
44776 static int
test_xmlTextWriterWriteBinHex(void)44777 test_xmlTextWriterWriteBinHex(void) {
44778     int test_ret = 0;
44779 
44780 #if defined(LIBXML_WRITER_ENABLED)
44781     int mem_base;
44782     int ret_val;
44783     xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
44784     int n_writer;
44785     char * data; /* binary data */
44786     int n_data;
44787     int start; /* the position within the data of the first byte to encode */
44788     int n_start;
44789     int len; /* the number of bytes to encode */
44790     int n_len;
44791 
44792     for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
44793     for (n_data = 0;n_data < gen_nb_const_char_ptr;n_data++) {
44794     for (n_start = 0;n_start < gen_nb_int;n_start++) {
44795     for (n_len = 0;n_len < gen_nb_int;n_len++) {
44796         mem_base = xmlMemBlocks();
44797         writer = gen_xmlTextWriterPtr(n_writer, 0);
44798         data = gen_const_char_ptr(n_data, 1);
44799         start = gen_int(n_start, 2);
44800         len = gen_int(n_len, 3);
44801         if ((data != NULL) &&
44802             (start > (int) strlen((const char *) data) + 1))
44803             continue;
44804         if ((data != NULL) &&
44805             (len > (int) strlen((const char *) data) + 1))
44806             continue;
44807 
44808         ret_val = xmlTextWriterWriteBinHex(writer, (const char *)data, start, len);
44809         desret_int(ret_val);
44810         call_tests++;
44811         des_xmlTextWriterPtr(n_writer, writer, 0);
44812         des_const_char_ptr(n_data, (const char *)data, 1);
44813         des_int(n_start, start, 2);
44814         des_int(n_len, len, 3);
44815         xmlResetLastError();
44816         if (mem_base != xmlMemBlocks()) {
44817             printf("Leak of %d blocks found in xmlTextWriterWriteBinHex",
44818 	           xmlMemBlocks() - mem_base);
44819 	    test_ret++;
44820             printf(" %d", n_writer);
44821             printf(" %d", n_data);
44822             printf(" %d", n_start);
44823             printf(" %d", n_len);
44824             printf("\n");
44825         }
44826     }
44827     }
44828     }
44829     }
44830     function_tests++;
44831 #endif
44832 
44833     return(test_ret);
44834 }
44835 
44836 
44837 static int
test_xmlTextWriterWriteCDATA(void)44838 test_xmlTextWriterWriteCDATA(void) {
44839     int test_ret = 0;
44840 
44841 #if defined(LIBXML_WRITER_ENABLED)
44842     int mem_base;
44843     int ret_val;
44844     xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
44845     int n_writer;
44846     xmlChar * content; /* CDATA content */
44847     int n_content;
44848 
44849     for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
44850     for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
44851         mem_base = xmlMemBlocks();
44852         writer = gen_xmlTextWriterPtr(n_writer, 0);
44853         content = gen_const_xmlChar_ptr(n_content, 1);
44854 
44855         ret_val = xmlTextWriterWriteCDATA(writer, (const xmlChar *)content);
44856         desret_int(ret_val);
44857         call_tests++;
44858         des_xmlTextWriterPtr(n_writer, writer, 0);
44859         des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 1);
44860         xmlResetLastError();
44861         if (mem_base != xmlMemBlocks()) {
44862             printf("Leak of %d blocks found in xmlTextWriterWriteCDATA",
44863 	           xmlMemBlocks() - mem_base);
44864 	    test_ret++;
44865             printf(" %d", n_writer);
44866             printf(" %d", n_content);
44867             printf("\n");
44868         }
44869     }
44870     }
44871     function_tests++;
44872 #endif
44873 
44874     return(test_ret);
44875 }
44876 
44877 
44878 static int
test_xmlTextWriterWriteComment(void)44879 test_xmlTextWriterWriteComment(void) {
44880     int test_ret = 0;
44881 
44882 #if defined(LIBXML_WRITER_ENABLED)
44883     int mem_base;
44884     int ret_val;
44885     xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
44886     int n_writer;
44887     xmlChar * content; /* comment string */
44888     int n_content;
44889 
44890     for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
44891     for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
44892         mem_base = xmlMemBlocks();
44893         writer = gen_xmlTextWriterPtr(n_writer, 0);
44894         content = gen_const_xmlChar_ptr(n_content, 1);
44895 
44896         ret_val = xmlTextWriterWriteComment(writer, (const xmlChar *)content);
44897         desret_int(ret_val);
44898         call_tests++;
44899         des_xmlTextWriterPtr(n_writer, writer, 0);
44900         des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 1);
44901         xmlResetLastError();
44902         if (mem_base != xmlMemBlocks()) {
44903             printf("Leak of %d blocks found in xmlTextWriterWriteComment",
44904 	           xmlMemBlocks() - mem_base);
44905 	    test_ret++;
44906             printf(" %d", n_writer);
44907             printf(" %d", n_content);
44908             printf("\n");
44909         }
44910     }
44911     }
44912     function_tests++;
44913 #endif
44914 
44915     return(test_ret);
44916 }
44917 
44918 
44919 static int
test_xmlTextWriterWriteDTD(void)44920 test_xmlTextWriterWriteDTD(void) {
44921     int test_ret = 0;
44922 
44923 #if defined(LIBXML_WRITER_ENABLED)
44924     int mem_base;
44925     int ret_val;
44926     xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
44927     int n_writer;
44928     xmlChar * name; /* the name of the DTD */
44929     int n_name;
44930     xmlChar * pubid; /* the public identifier, which is an alternative to the system identifier */
44931     int n_pubid;
44932     xmlChar * sysid; /* the system identifier, which is the URI of the DTD */
44933     int n_sysid;
44934     xmlChar * subset; /* string content of the DTD */
44935     int n_subset;
44936 
44937     for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
44938     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
44939     for (n_pubid = 0;n_pubid < gen_nb_const_xmlChar_ptr;n_pubid++) {
44940     for (n_sysid = 0;n_sysid < gen_nb_const_xmlChar_ptr;n_sysid++) {
44941     for (n_subset = 0;n_subset < gen_nb_const_xmlChar_ptr;n_subset++) {
44942         mem_base = xmlMemBlocks();
44943         writer = gen_xmlTextWriterPtr(n_writer, 0);
44944         name = gen_const_xmlChar_ptr(n_name, 1);
44945         pubid = gen_const_xmlChar_ptr(n_pubid, 2);
44946         sysid = gen_const_xmlChar_ptr(n_sysid, 3);
44947         subset = gen_const_xmlChar_ptr(n_subset, 4);
44948 
44949         ret_val = xmlTextWriterWriteDTD(writer, (const xmlChar *)name, (const xmlChar *)pubid, (const xmlChar *)sysid, (const xmlChar *)subset);
44950         desret_int(ret_val);
44951         call_tests++;
44952         des_xmlTextWriterPtr(n_writer, writer, 0);
44953         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
44954         des_const_xmlChar_ptr(n_pubid, (const xmlChar *)pubid, 2);
44955         des_const_xmlChar_ptr(n_sysid, (const xmlChar *)sysid, 3);
44956         des_const_xmlChar_ptr(n_subset, (const xmlChar *)subset, 4);
44957         xmlResetLastError();
44958         if (mem_base != xmlMemBlocks()) {
44959             printf("Leak of %d blocks found in xmlTextWriterWriteDTD",
44960 	           xmlMemBlocks() - mem_base);
44961 	    test_ret++;
44962             printf(" %d", n_writer);
44963             printf(" %d", n_name);
44964             printf(" %d", n_pubid);
44965             printf(" %d", n_sysid);
44966             printf(" %d", n_subset);
44967             printf("\n");
44968         }
44969     }
44970     }
44971     }
44972     }
44973     }
44974     function_tests++;
44975 #endif
44976 
44977     return(test_ret);
44978 }
44979 
44980 
44981 static int
test_xmlTextWriterWriteDTDAttlist(void)44982 test_xmlTextWriterWriteDTDAttlist(void) {
44983     int test_ret = 0;
44984 
44985 #if defined(LIBXML_WRITER_ENABLED)
44986     int mem_base;
44987     int ret_val;
44988     xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
44989     int n_writer;
44990     xmlChar * name; /* the name of the DTD ATTLIST */
44991     int n_name;
44992     xmlChar * content; /* content of the ATTLIST */
44993     int n_content;
44994 
44995     for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
44996     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
44997     for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
44998         mem_base = xmlMemBlocks();
44999         writer = gen_xmlTextWriterPtr(n_writer, 0);
45000         name = gen_const_xmlChar_ptr(n_name, 1);
45001         content = gen_const_xmlChar_ptr(n_content, 2);
45002 
45003         ret_val = xmlTextWriterWriteDTDAttlist(writer, (const xmlChar *)name, (const xmlChar *)content);
45004         desret_int(ret_val);
45005         call_tests++;
45006         des_xmlTextWriterPtr(n_writer, writer, 0);
45007         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
45008         des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 2);
45009         xmlResetLastError();
45010         if (mem_base != xmlMemBlocks()) {
45011             printf("Leak of %d blocks found in xmlTextWriterWriteDTDAttlist",
45012 	           xmlMemBlocks() - mem_base);
45013 	    test_ret++;
45014             printf(" %d", n_writer);
45015             printf(" %d", n_name);
45016             printf(" %d", n_content);
45017             printf("\n");
45018         }
45019     }
45020     }
45021     }
45022     function_tests++;
45023 #endif
45024 
45025     return(test_ret);
45026 }
45027 
45028 
45029 static int
test_xmlTextWriterWriteDTDElement(void)45030 test_xmlTextWriterWriteDTDElement(void) {
45031     int test_ret = 0;
45032 
45033 #if defined(LIBXML_WRITER_ENABLED)
45034     int mem_base;
45035     int ret_val;
45036     xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
45037     int n_writer;
45038     xmlChar * name; /* the name of the DTD element */
45039     int n_name;
45040     xmlChar * content; /* content of the element */
45041     int n_content;
45042 
45043     for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
45044     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
45045     for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
45046         mem_base = xmlMemBlocks();
45047         writer = gen_xmlTextWriterPtr(n_writer, 0);
45048         name = gen_const_xmlChar_ptr(n_name, 1);
45049         content = gen_const_xmlChar_ptr(n_content, 2);
45050 
45051         ret_val = xmlTextWriterWriteDTDElement(writer, (const xmlChar *)name, (const xmlChar *)content);
45052         desret_int(ret_val);
45053         call_tests++;
45054         des_xmlTextWriterPtr(n_writer, writer, 0);
45055         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
45056         des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 2);
45057         xmlResetLastError();
45058         if (mem_base != xmlMemBlocks()) {
45059             printf("Leak of %d blocks found in xmlTextWriterWriteDTDElement",
45060 	           xmlMemBlocks() - mem_base);
45061 	    test_ret++;
45062             printf(" %d", n_writer);
45063             printf(" %d", n_name);
45064             printf(" %d", n_content);
45065             printf("\n");
45066         }
45067     }
45068     }
45069     }
45070     function_tests++;
45071 #endif
45072 
45073     return(test_ret);
45074 }
45075 
45076 
45077 static int
test_xmlTextWriterWriteDTDEntity(void)45078 test_xmlTextWriterWriteDTDEntity(void) {
45079     int test_ret = 0;
45080 
45081 #if defined(LIBXML_WRITER_ENABLED)
45082     int mem_base;
45083     int ret_val;
45084     xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
45085     int n_writer;
45086     int pe; /* TRUE if this is a parameter entity, FALSE if not */
45087     int n_pe;
45088     xmlChar * name; /* the name of the DTD entity */
45089     int n_name;
45090     xmlChar * pubid; /* the public identifier, which is an alternative to the system identifier */
45091     int n_pubid;
45092     xmlChar * sysid; /* the system identifier, which is the URI of the DTD */
45093     int n_sysid;
45094     xmlChar * ndataid; /* the xml notation name. */
45095     int n_ndataid;
45096     xmlChar * content; /* content of the entity */
45097     int n_content;
45098 
45099     for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
45100     for (n_pe = 0;n_pe < gen_nb_int;n_pe++) {
45101     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
45102     for (n_pubid = 0;n_pubid < gen_nb_const_xmlChar_ptr;n_pubid++) {
45103     for (n_sysid = 0;n_sysid < gen_nb_const_xmlChar_ptr;n_sysid++) {
45104     for (n_ndataid = 0;n_ndataid < gen_nb_const_xmlChar_ptr;n_ndataid++) {
45105     for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
45106         mem_base = xmlMemBlocks();
45107         writer = gen_xmlTextWriterPtr(n_writer, 0);
45108         pe = gen_int(n_pe, 1);
45109         name = gen_const_xmlChar_ptr(n_name, 2);
45110         pubid = gen_const_xmlChar_ptr(n_pubid, 3);
45111         sysid = gen_const_xmlChar_ptr(n_sysid, 4);
45112         ndataid = gen_const_xmlChar_ptr(n_ndataid, 5);
45113         content = gen_const_xmlChar_ptr(n_content, 6);
45114 
45115         ret_val = xmlTextWriterWriteDTDEntity(writer, pe, (const xmlChar *)name, (const xmlChar *)pubid, (const xmlChar *)sysid, (const xmlChar *)ndataid, (const xmlChar *)content);
45116         desret_int(ret_val);
45117         call_tests++;
45118         des_xmlTextWriterPtr(n_writer, writer, 0);
45119         des_int(n_pe, pe, 1);
45120         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 2);
45121         des_const_xmlChar_ptr(n_pubid, (const xmlChar *)pubid, 3);
45122         des_const_xmlChar_ptr(n_sysid, (const xmlChar *)sysid, 4);
45123         des_const_xmlChar_ptr(n_ndataid, (const xmlChar *)ndataid, 5);
45124         des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 6);
45125         xmlResetLastError();
45126         if (mem_base != xmlMemBlocks()) {
45127             printf("Leak of %d blocks found in xmlTextWriterWriteDTDEntity",
45128 	           xmlMemBlocks() - mem_base);
45129 	    test_ret++;
45130             printf(" %d", n_writer);
45131             printf(" %d", n_pe);
45132             printf(" %d", n_name);
45133             printf(" %d", n_pubid);
45134             printf(" %d", n_sysid);
45135             printf(" %d", n_ndataid);
45136             printf(" %d", n_content);
45137             printf("\n");
45138         }
45139     }
45140     }
45141     }
45142     }
45143     }
45144     }
45145     }
45146     function_tests++;
45147 #endif
45148 
45149     return(test_ret);
45150 }
45151 
45152 
45153 static int
test_xmlTextWriterWriteDTDExternalEntity(void)45154 test_xmlTextWriterWriteDTDExternalEntity(void) {
45155     int test_ret = 0;
45156 
45157 #if defined(LIBXML_WRITER_ENABLED)
45158     int mem_base;
45159     int ret_val;
45160     xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
45161     int n_writer;
45162     int pe; /* TRUE if this is a parameter entity, FALSE if not */
45163     int n_pe;
45164     xmlChar * name; /* the name of the DTD entity */
45165     int n_name;
45166     xmlChar * pubid; /* the public identifier, which is an alternative to the system identifier */
45167     int n_pubid;
45168     xmlChar * sysid; /* the system identifier, which is the URI of the DTD */
45169     int n_sysid;
45170     xmlChar * ndataid; /* the xml notation name. */
45171     int n_ndataid;
45172 
45173     for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
45174     for (n_pe = 0;n_pe < gen_nb_int;n_pe++) {
45175     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
45176     for (n_pubid = 0;n_pubid < gen_nb_const_xmlChar_ptr;n_pubid++) {
45177     for (n_sysid = 0;n_sysid < gen_nb_const_xmlChar_ptr;n_sysid++) {
45178     for (n_ndataid = 0;n_ndataid < gen_nb_const_xmlChar_ptr;n_ndataid++) {
45179         mem_base = xmlMemBlocks();
45180         writer = gen_xmlTextWriterPtr(n_writer, 0);
45181         pe = gen_int(n_pe, 1);
45182         name = gen_const_xmlChar_ptr(n_name, 2);
45183         pubid = gen_const_xmlChar_ptr(n_pubid, 3);
45184         sysid = gen_const_xmlChar_ptr(n_sysid, 4);
45185         ndataid = gen_const_xmlChar_ptr(n_ndataid, 5);
45186 
45187         ret_val = xmlTextWriterWriteDTDExternalEntity(writer, pe, (const xmlChar *)name, (const xmlChar *)pubid, (const xmlChar *)sysid, (const xmlChar *)ndataid);
45188         desret_int(ret_val);
45189         call_tests++;
45190         des_xmlTextWriterPtr(n_writer, writer, 0);
45191         des_int(n_pe, pe, 1);
45192         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 2);
45193         des_const_xmlChar_ptr(n_pubid, (const xmlChar *)pubid, 3);
45194         des_const_xmlChar_ptr(n_sysid, (const xmlChar *)sysid, 4);
45195         des_const_xmlChar_ptr(n_ndataid, (const xmlChar *)ndataid, 5);
45196         xmlResetLastError();
45197         if (mem_base != xmlMemBlocks()) {
45198             printf("Leak of %d blocks found in xmlTextWriterWriteDTDExternalEntity",
45199 	           xmlMemBlocks() - mem_base);
45200 	    test_ret++;
45201             printf(" %d", n_writer);
45202             printf(" %d", n_pe);
45203             printf(" %d", n_name);
45204             printf(" %d", n_pubid);
45205             printf(" %d", n_sysid);
45206             printf(" %d", n_ndataid);
45207             printf("\n");
45208         }
45209     }
45210     }
45211     }
45212     }
45213     }
45214     }
45215     function_tests++;
45216 #endif
45217 
45218     return(test_ret);
45219 }
45220 
45221 
45222 static int
test_xmlTextWriterWriteDTDExternalEntityContents(void)45223 test_xmlTextWriterWriteDTDExternalEntityContents(void) {
45224     int test_ret = 0;
45225 
45226 #if defined(LIBXML_WRITER_ENABLED)
45227     int mem_base;
45228     int ret_val;
45229     xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
45230     int n_writer;
45231     xmlChar * pubid; /* the public identifier, which is an alternative to the system identifier */
45232     int n_pubid;
45233     xmlChar * sysid; /* the system identifier, which is the URI of the DTD */
45234     int n_sysid;
45235     xmlChar * ndataid; /* the xml notation name. */
45236     int n_ndataid;
45237 
45238     for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
45239     for (n_pubid = 0;n_pubid < gen_nb_const_xmlChar_ptr;n_pubid++) {
45240     for (n_sysid = 0;n_sysid < gen_nb_const_xmlChar_ptr;n_sysid++) {
45241     for (n_ndataid = 0;n_ndataid < gen_nb_const_xmlChar_ptr;n_ndataid++) {
45242         mem_base = xmlMemBlocks();
45243         writer = gen_xmlTextWriterPtr(n_writer, 0);
45244         pubid = gen_const_xmlChar_ptr(n_pubid, 1);
45245         sysid = gen_const_xmlChar_ptr(n_sysid, 2);
45246         ndataid = gen_const_xmlChar_ptr(n_ndataid, 3);
45247 
45248         ret_val = xmlTextWriterWriteDTDExternalEntityContents(writer, (const xmlChar *)pubid, (const xmlChar *)sysid, (const xmlChar *)ndataid);
45249         desret_int(ret_val);
45250         call_tests++;
45251         des_xmlTextWriterPtr(n_writer, writer, 0);
45252         des_const_xmlChar_ptr(n_pubid, (const xmlChar *)pubid, 1);
45253         des_const_xmlChar_ptr(n_sysid, (const xmlChar *)sysid, 2);
45254         des_const_xmlChar_ptr(n_ndataid, (const xmlChar *)ndataid, 3);
45255         xmlResetLastError();
45256         if (mem_base != xmlMemBlocks()) {
45257             printf("Leak of %d blocks found in xmlTextWriterWriteDTDExternalEntityContents",
45258 	           xmlMemBlocks() - mem_base);
45259 	    test_ret++;
45260             printf(" %d", n_writer);
45261             printf(" %d", n_pubid);
45262             printf(" %d", n_sysid);
45263             printf(" %d", n_ndataid);
45264             printf("\n");
45265         }
45266     }
45267     }
45268     }
45269     }
45270     function_tests++;
45271 #endif
45272 
45273     return(test_ret);
45274 }
45275 
45276 
45277 static int
test_xmlTextWriterWriteDTDInternalEntity(void)45278 test_xmlTextWriterWriteDTDInternalEntity(void) {
45279     int test_ret = 0;
45280 
45281 #if defined(LIBXML_WRITER_ENABLED)
45282     int mem_base;
45283     int ret_val;
45284     xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
45285     int n_writer;
45286     int pe; /* TRUE if this is a parameter entity, FALSE if not */
45287     int n_pe;
45288     xmlChar * name; /* the name of the DTD entity */
45289     int n_name;
45290     xmlChar * content; /* content of the entity */
45291     int n_content;
45292 
45293     for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
45294     for (n_pe = 0;n_pe < gen_nb_int;n_pe++) {
45295     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
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         pe = gen_int(n_pe, 1);
45300         name = gen_const_xmlChar_ptr(n_name, 2);
45301         content = gen_const_xmlChar_ptr(n_content, 3);
45302 
45303         ret_val = xmlTextWriterWriteDTDInternalEntity(writer, pe, (const xmlChar *)name, (const xmlChar *)content);
45304         desret_int(ret_val);
45305         call_tests++;
45306         des_xmlTextWriterPtr(n_writer, writer, 0);
45307         des_int(n_pe, pe, 1);
45308         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 2);
45309         des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 3);
45310         xmlResetLastError();
45311         if (mem_base != xmlMemBlocks()) {
45312             printf("Leak of %d blocks found in xmlTextWriterWriteDTDInternalEntity",
45313 	           xmlMemBlocks() - mem_base);
45314 	    test_ret++;
45315             printf(" %d", n_writer);
45316             printf(" %d", n_pe);
45317             printf(" %d", n_name);
45318             printf(" %d", n_content);
45319             printf("\n");
45320         }
45321     }
45322     }
45323     }
45324     }
45325     function_tests++;
45326 #endif
45327 
45328     return(test_ret);
45329 }
45330 
45331 
45332 static int
test_xmlTextWriterWriteDTDNotation(void)45333 test_xmlTextWriterWriteDTDNotation(void) {
45334     int test_ret = 0;
45335 
45336 #if defined(LIBXML_WRITER_ENABLED)
45337     int mem_base;
45338     int ret_val;
45339     xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
45340     int n_writer;
45341     xmlChar * name; /* the name of the xml notation */
45342     int n_name;
45343     xmlChar * pubid; /* the public identifier, which is an alternative to the system identifier */
45344     int n_pubid;
45345     xmlChar * sysid; /* the system identifier, which is the URI of the DTD */
45346     int n_sysid;
45347 
45348     for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
45349     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
45350     for (n_pubid = 0;n_pubid < gen_nb_const_xmlChar_ptr;n_pubid++) {
45351     for (n_sysid = 0;n_sysid < gen_nb_const_xmlChar_ptr;n_sysid++) {
45352         mem_base = xmlMemBlocks();
45353         writer = gen_xmlTextWriterPtr(n_writer, 0);
45354         name = gen_const_xmlChar_ptr(n_name, 1);
45355         pubid = gen_const_xmlChar_ptr(n_pubid, 2);
45356         sysid = gen_const_xmlChar_ptr(n_sysid, 3);
45357 
45358         ret_val = xmlTextWriterWriteDTDNotation(writer, (const xmlChar *)name, (const xmlChar *)pubid, (const xmlChar *)sysid);
45359         desret_int(ret_val);
45360         call_tests++;
45361         des_xmlTextWriterPtr(n_writer, writer, 0);
45362         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
45363         des_const_xmlChar_ptr(n_pubid, (const xmlChar *)pubid, 2);
45364         des_const_xmlChar_ptr(n_sysid, (const xmlChar *)sysid, 3);
45365         xmlResetLastError();
45366         if (mem_base != xmlMemBlocks()) {
45367             printf("Leak of %d blocks found in xmlTextWriterWriteDTDNotation",
45368 	           xmlMemBlocks() - mem_base);
45369 	    test_ret++;
45370             printf(" %d", n_writer);
45371             printf(" %d", n_name);
45372             printf(" %d", n_pubid);
45373             printf(" %d", n_sysid);
45374             printf("\n");
45375         }
45376     }
45377     }
45378     }
45379     }
45380     function_tests++;
45381 #endif
45382 
45383     return(test_ret);
45384 }
45385 
45386 
45387 static int
test_xmlTextWriterWriteElement(void)45388 test_xmlTextWriterWriteElement(void) {
45389     int test_ret = 0;
45390 
45391 #if defined(LIBXML_WRITER_ENABLED)
45392     int mem_base;
45393     int ret_val;
45394     xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
45395     int n_writer;
45396     xmlChar * name; /* element name */
45397     int n_name;
45398     xmlChar * content; /* element content */
45399     int n_content;
45400 
45401     for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
45402     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
45403     for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
45404         mem_base = xmlMemBlocks();
45405         writer = gen_xmlTextWriterPtr(n_writer, 0);
45406         name = gen_const_xmlChar_ptr(n_name, 1);
45407         content = gen_const_xmlChar_ptr(n_content, 2);
45408 
45409         ret_val = xmlTextWriterWriteElement(writer, (const xmlChar *)name, (const xmlChar *)content);
45410         desret_int(ret_val);
45411         call_tests++;
45412         des_xmlTextWriterPtr(n_writer, writer, 0);
45413         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
45414         des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 2);
45415         xmlResetLastError();
45416         if (mem_base != xmlMemBlocks()) {
45417             printf("Leak of %d blocks found in xmlTextWriterWriteElement",
45418 	           xmlMemBlocks() - mem_base);
45419 	    test_ret++;
45420             printf(" %d", n_writer);
45421             printf(" %d", n_name);
45422             printf(" %d", n_content);
45423             printf("\n");
45424         }
45425     }
45426     }
45427     }
45428     function_tests++;
45429 #endif
45430 
45431     return(test_ret);
45432 }
45433 
45434 
45435 static int
test_xmlTextWriterWriteElementNS(void)45436 test_xmlTextWriterWriteElementNS(void) {
45437     int test_ret = 0;
45438 
45439 #if defined(LIBXML_WRITER_ENABLED)
45440     int mem_base;
45441     int ret_val;
45442     xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
45443     int n_writer;
45444     xmlChar * prefix; /* namespace prefix */
45445     int n_prefix;
45446     xmlChar * name; /* element local name */
45447     int n_name;
45448     xmlChar * namespaceURI; /* namespace URI */
45449     int n_namespaceURI;
45450     xmlChar * content; /* element content */
45451     int n_content;
45452 
45453     for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
45454     for (n_prefix = 0;n_prefix < gen_nb_const_xmlChar_ptr;n_prefix++) {
45455     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
45456     for (n_namespaceURI = 0;n_namespaceURI < gen_nb_const_xmlChar_ptr;n_namespaceURI++) {
45457     for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
45458         mem_base = xmlMemBlocks();
45459         writer = gen_xmlTextWriterPtr(n_writer, 0);
45460         prefix = gen_const_xmlChar_ptr(n_prefix, 1);
45461         name = gen_const_xmlChar_ptr(n_name, 2);
45462         namespaceURI = gen_const_xmlChar_ptr(n_namespaceURI, 3);
45463         content = gen_const_xmlChar_ptr(n_content, 4);
45464 
45465         ret_val = xmlTextWriterWriteElementNS(writer, (const xmlChar *)prefix, (const xmlChar *)name, (const xmlChar *)namespaceURI, (const xmlChar *)content);
45466         desret_int(ret_val);
45467         call_tests++;
45468         des_xmlTextWriterPtr(n_writer, writer, 0);
45469         des_const_xmlChar_ptr(n_prefix, (const xmlChar *)prefix, 1);
45470         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 2);
45471         des_const_xmlChar_ptr(n_namespaceURI, (const xmlChar *)namespaceURI, 3);
45472         des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 4);
45473         xmlResetLastError();
45474         if (mem_base != xmlMemBlocks()) {
45475             printf("Leak of %d blocks found in xmlTextWriterWriteElementNS",
45476 	           xmlMemBlocks() - mem_base);
45477 	    test_ret++;
45478             printf(" %d", n_writer);
45479             printf(" %d", n_prefix);
45480             printf(" %d", n_name);
45481             printf(" %d", n_namespaceURI);
45482             printf(" %d", n_content);
45483             printf("\n");
45484         }
45485     }
45486     }
45487     }
45488     }
45489     }
45490     function_tests++;
45491 #endif
45492 
45493     return(test_ret);
45494 }
45495 
45496 
45497 static int
test_xmlTextWriterWriteFormatAttribute(void)45498 test_xmlTextWriterWriteFormatAttribute(void) {
45499     int test_ret = 0;
45500 
45501 
45502     /* missing type support */
45503     return(test_ret);
45504 }
45505 
45506 
45507 static int
test_xmlTextWriterWriteFormatAttributeNS(void)45508 test_xmlTextWriterWriteFormatAttributeNS(void) {
45509     int test_ret = 0;
45510 
45511 
45512     /* missing type support */
45513     return(test_ret);
45514 }
45515 
45516 
45517 static int
test_xmlTextWriterWriteFormatCDATA(void)45518 test_xmlTextWriterWriteFormatCDATA(void) {
45519     int test_ret = 0;
45520 
45521 
45522     /* missing type support */
45523     return(test_ret);
45524 }
45525 
45526 
45527 static int
test_xmlTextWriterWriteFormatComment(void)45528 test_xmlTextWriterWriteFormatComment(void) {
45529     int test_ret = 0;
45530 
45531 
45532     /* missing type support */
45533     return(test_ret);
45534 }
45535 
45536 
45537 static int
test_xmlTextWriterWriteFormatDTD(void)45538 test_xmlTextWriterWriteFormatDTD(void) {
45539     int test_ret = 0;
45540 
45541 
45542     /* missing type support */
45543     return(test_ret);
45544 }
45545 
45546 
45547 static int
test_xmlTextWriterWriteFormatDTDAttlist(void)45548 test_xmlTextWriterWriteFormatDTDAttlist(void) {
45549     int test_ret = 0;
45550 
45551 
45552     /* missing type support */
45553     return(test_ret);
45554 }
45555 
45556 
45557 static int
test_xmlTextWriterWriteFormatDTDElement(void)45558 test_xmlTextWriterWriteFormatDTDElement(void) {
45559     int test_ret = 0;
45560 
45561 
45562     /* missing type support */
45563     return(test_ret);
45564 }
45565 
45566 
45567 static int
test_xmlTextWriterWriteFormatDTDInternalEntity(void)45568 test_xmlTextWriterWriteFormatDTDInternalEntity(void) {
45569     int test_ret = 0;
45570 
45571 
45572     /* missing type support */
45573     return(test_ret);
45574 }
45575 
45576 
45577 static int
test_xmlTextWriterWriteFormatElement(void)45578 test_xmlTextWriterWriteFormatElement(void) {
45579     int test_ret = 0;
45580 
45581 
45582     /* missing type support */
45583     return(test_ret);
45584 }
45585 
45586 
45587 static int
test_xmlTextWriterWriteFormatElementNS(void)45588 test_xmlTextWriterWriteFormatElementNS(void) {
45589     int test_ret = 0;
45590 
45591 
45592     /* missing type support */
45593     return(test_ret);
45594 }
45595 
45596 
45597 static int
test_xmlTextWriterWriteFormatPI(void)45598 test_xmlTextWriterWriteFormatPI(void) {
45599     int test_ret = 0;
45600 
45601 
45602     /* missing type support */
45603     return(test_ret);
45604 }
45605 
45606 
45607 static int
test_xmlTextWriterWriteFormatRaw(void)45608 test_xmlTextWriterWriteFormatRaw(void) {
45609     int test_ret = 0;
45610 
45611 
45612     /* missing type support */
45613     return(test_ret);
45614 }
45615 
45616 
45617 static int
test_xmlTextWriterWriteFormatString(void)45618 test_xmlTextWriterWriteFormatString(void) {
45619     int test_ret = 0;
45620 
45621 
45622     /* missing type support */
45623     return(test_ret);
45624 }
45625 
45626 
45627 static int
test_xmlTextWriterWritePI(void)45628 test_xmlTextWriterWritePI(void) {
45629     int test_ret = 0;
45630 
45631 #if defined(LIBXML_WRITER_ENABLED)
45632     int mem_base;
45633     int ret_val;
45634     xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
45635     int n_writer;
45636     xmlChar * target; /* PI target */
45637     int n_target;
45638     xmlChar * content; /* PI content */
45639     int n_content;
45640 
45641     for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
45642     for (n_target = 0;n_target < gen_nb_const_xmlChar_ptr;n_target++) {
45643     for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
45644         mem_base = xmlMemBlocks();
45645         writer = gen_xmlTextWriterPtr(n_writer, 0);
45646         target = gen_const_xmlChar_ptr(n_target, 1);
45647         content = gen_const_xmlChar_ptr(n_content, 2);
45648 
45649         ret_val = xmlTextWriterWritePI(writer, (const xmlChar *)target, (const xmlChar *)content);
45650         desret_int(ret_val);
45651         call_tests++;
45652         des_xmlTextWriterPtr(n_writer, writer, 0);
45653         des_const_xmlChar_ptr(n_target, (const xmlChar *)target, 1);
45654         des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 2);
45655         xmlResetLastError();
45656         if (mem_base != xmlMemBlocks()) {
45657             printf("Leak of %d blocks found in xmlTextWriterWritePI",
45658 	           xmlMemBlocks() - mem_base);
45659 	    test_ret++;
45660             printf(" %d", n_writer);
45661             printf(" %d", n_target);
45662             printf(" %d", n_content);
45663             printf("\n");
45664         }
45665     }
45666     }
45667     }
45668     function_tests++;
45669 #endif
45670 
45671     return(test_ret);
45672 }
45673 
45674 
45675 static int
test_xmlTextWriterWriteRaw(void)45676 test_xmlTextWriterWriteRaw(void) {
45677     int test_ret = 0;
45678 
45679 #if defined(LIBXML_WRITER_ENABLED)
45680     int mem_base;
45681     int ret_val;
45682     xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
45683     int n_writer;
45684     xmlChar * content; /* text string */
45685     int n_content;
45686 
45687     for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
45688     for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
45689         mem_base = xmlMemBlocks();
45690         writer = gen_xmlTextWriterPtr(n_writer, 0);
45691         content = gen_const_xmlChar_ptr(n_content, 1);
45692 
45693         ret_val = xmlTextWriterWriteRaw(writer, (const xmlChar *)content);
45694         desret_int(ret_val);
45695         call_tests++;
45696         des_xmlTextWriterPtr(n_writer, writer, 0);
45697         des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 1);
45698         xmlResetLastError();
45699         if (mem_base != xmlMemBlocks()) {
45700             printf("Leak of %d blocks found in xmlTextWriterWriteRaw",
45701 	           xmlMemBlocks() - mem_base);
45702 	    test_ret++;
45703             printf(" %d", n_writer);
45704             printf(" %d", n_content);
45705             printf("\n");
45706         }
45707     }
45708     }
45709     function_tests++;
45710 #endif
45711 
45712     return(test_ret);
45713 }
45714 
45715 
45716 static int
test_xmlTextWriterWriteRawLen(void)45717 test_xmlTextWriterWriteRawLen(void) {
45718     int test_ret = 0;
45719 
45720 #if defined(LIBXML_WRITER_ENABLED)
45721     int mem_base;
45722     int ret_val;
45723     xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
45724     int n_writer;
45725     xmlChar * content; /* text string */
45726     int n_content;
45727     int len; /* length of the text string */
45728     int n_len;
45729 
45730     for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
45731     for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
45732     for (n_len = 0;n_len < gen_nb_int;n_len++) {
45733         mem_base = xmlMemBlocks();
45734         writer = gen_xmlTextWriterPtr(n_writer, 0);
45735         content = gen_const_xmlChar_ptr(n_content, 1);
45736         len = gen_int(n_len, 2);
45737         if ((content != NULL) &&
45738             (len > (int) strlen((const char *) content) + 1))
45739             continue;
45740 
45741         ret_val = xmlTextWriterWriteRawLen(writer, (const xmlChar *)content, len);
45742         desret_int(ret_val);
45743         call_tests++;
45744         des_xmlTextWriterPtr(n_writer, writer, 0);
45745         des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 1);
45746         des_int(n_len, len, 2);
45747         xmlResetLastError();
45748         if (mem_base != xmlMemBlocks()) {
45749             printf("Leak of %d blocks found in xmlTextWriterWriteRawLen",
45750 	           xmlMemBlocks() - mem_base);
45751 	    test_ret++;
45752             printf(" %d", n_writer);
45753             printf(" %d", n_content);
45754             printf(" %d", n_len);
45755             printf("\n");
45756         }
45757     }
45758     }
45759     }
45760     function_tests++;
45761 #endif
45762 
45763     return(test_ret);
45764 }
45765 
45766 
45767 static int
test_xmlTextWriterWriteString(void)45768 test_xmlTextWriterWriteString(void) {
45769     int test_ret = 0;
45770 
45771 #if defined(LIBXML_WRITER_ENABLED)
45772     int mem_base;
45773     int ret_val;
45774     xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
45775     int n_writer;
45776     xmlChar * content; /* text string */
45777     int n_content;
45778 
45779     for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
45780     for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
45781         mem_base = xmlMemBlocks();
45782         writer = gen_xmlTextWriterPtr(n_writer, 0);
45783         content = gen_const_xmlChar_ptr(n_content, 1);
45784 
45785         ret_val = xmlTextWriterWriteString(writer, (const xmlChar *)content);
45786         desret_int(ret_val);
45787         call_tests++;
45788         des_xmlTextWriterPtr(n_writer, writer, 0);
45789         des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 1);
45790         xmlResetLastError();
45791         if (mem_base != xmlMemBlocks()) {
45792             printf("Leak of %d blocks found in xmlTextWriterWriteString",
45793 	           xmlMemBlocks() - mem_base);
45794 	    test_ret++;
45795             printf(" %d", n_writer);
45796             printf(" %d", n_content);
45797             printf("\n");
45798         }
45799     }
45800     }
45801     function_tests++;
45802 #endif
45803 
45804     return(test_ret);
45805 }
45806 
45807 
45808 static int
test_xmlTextWriterWriteVFormatAttribute(void)45809 test_xmlTextWriterWriteVFormatAttribute(void) {
45810     int test_ret = 0;
45811 
45812 
45813     /* missing type support */
45814     return(test_ret);
45815 }
45816 
45817 
45818 static int
test_xmlTextWriterWriteVFormatAttributeNS(void)45819 test_xmlTextWriterWriteVFormatAttributeNS(void) {
45820     int test_ret = 0;
45821 
45822 
45823     /* missing type support */
45824     return(test_ret);
45825 }
45826 
45827 
45828 static int
test_xmlTextWriterWriteVFormatCDATA(void)45829 test_xmlTextWriterWriteVFormatCDATA(void) {
45830     int test_ret = 0;
45831 
45832 
45833     /* missing type support */
45834     return(test_ret);
45835 }
45836 
45837 
45838 static int
test_xmlTextWriterWriteVFormatComment(void)45839 test_xmlTextWriterWriteVFormatComment(void) {
45840     int test_ret = 0;
45841 
45842 
45843     /* missing type support */
45844     return(test_ret);
45845 }
45846 
45847 
45848 static int
test_xmlTextWriterWriteVFormatDTD(void)45849 test_xmlTextWriterWriteVFormatDTD(void) {
45850     int test_ret = 0;
45851 
45852 
45853     /* missing type support */
45854     return(test_ret);
45855 }
45856 
45857 
45858 static int
test_xmlTextWriterWriteVFormatDTDAttlist(void)45859 test_xmlTextWriterWriteVFormatDTDAttlist(void) {
45860     int test_ret = 0;
45861 
45862 
45863     /* missing type support */
45864     return(test_ret);
45865 }
45866 
45867 
45868 static int
test_xmlTextWriterWriteVFormatDTDElement(void)45869 test_xmlTextWriterWriteVFormatDTDElement(void) {
45870     int test_ret = 0;
45871 
45872 
45873     /* missing type support */
45874     return(test_ret);
45875 }
45876 
45877 
45878 static int
test_xmlTextWriterWriteVFormatDTDInternalEntity(void)45879 test_xmlTextWriterWriteVFormatDTDInternalEntity(void) {
45880     int test_ret = 0;
45881 
45882 
45883     /* missing type support */
45884     return(test_ret);
45885 }
45886 
45887 
45888 static int
test_xmlTextWriterWriteVFormatElement(void)45889 test_xmlTextWriterWriteVFormatElement(void) {
45890     int test_ret = 0;
45891 
45892 
45893     /* missing type support */
45894     return(test_ret);
45895 }
45896 
45897 
45898 static int
test_xmlTextWriterWriteVFormatElementNS(void)45899 test_xmlTextWriterWriteVFormatElementNS(void) {
45900     int test_ret = 0;
45901 
45902 
45903     /* missing type support */
45904     return(test_ret);
45905 }
45906 
45907 
45908 static int
test_xmlTextWriterWriteVFormatPI(void)45909 test_xmlTextWriterWriteVFormatPI(void) {
45910     int test_ret = 0;
45911 
45912 
45913     /* missing type support */
45914     return(test_ret);
45915 }
45916 
45917 
45918 static int
test_xmlTextWriterWriteVFormatRaw(void)45919 test_xmlTextWriterWriteVFormatRaw(void) {
45920     int test_ret = 0;
45921 
45922 
45923     /* missing type support */
45924     return(test_ret);
45925 }
45926 
45927 
45928 static int
test_xmlTextWriterWriteVFormatString(void)45929 test_xmlTextWriterWriteVFormatString(void) {
45930     int test_ret = 0;
45931 
45932 
45933     /* missing type support */
45934     return(test_ret);
45935 }
45936 
45937 static int
test_xmlwriter(void)45938 test_xmlwriter(void) {
45939     int test_ret = 0;
45940 
45941     if (quiet == 0) printf("Testing xmlwriter : 52 of 80 functions ...\n");
45942     test_ret += test_xmlNewTextWriter();
45943     test_ret += test_xmlNewTextWriterFilename();
45944     test_ret += test_xmlNewTextWriterMemory();
45945     test_ret += test_xmlNewTextWriterPushParser();
45946     test_ret += test_xmlNewTextWriterTree();
45947     test_ret += test_xmlTextWriterEndAttribute();
45948     test_ret += test_xmlTextWriterEndCDATA();
45949     test_ret += test_xmlTextWriterEndComment();
45950     test_ret += test_xmlTextWriterEndDTD();
45951     test_ret += test_xmlTextWriterEndDTDAttlist();
45952     test_ret += test_xmlTextWriterEndDTDElement();
45953     test_ret += test_xmlTextWriterEndDTDEntity();
45954     test_ret += test_xmlTextWriterEndDocument();
45955     test_ret += test_xmlTextWriterEndElement();
45956     test_ret += test_xmlTextWriterEndPI();
45957     test_ret += test_xmlTextWriterFlush();
45958     test_ret += test_xmlTextWriterFullEndElement();
45959     test_ret += test_xmlTextWriterSetIndent();
45960     test_ret += test_xmlTextWriterSetIndentString();
45961     test_ret += test_xmlTextWriterSetQuoteChar();
45962     test_ret += test_xmlTextWriterStartAttribute();
45963     test_ret += test_xmlTextWriterStartAttributeNS();
45964     test_ret += test_xmlTextWriterStartCDATA();
45965     test_ret += test_xmlTextWriterStartComment();
45966     test_ret += test_xmlTextWriterStartDTD();
45967     test_ret += test_xmlTextWriterStartDTDAttlist();
45968     test_ret += test_xmlTextWriterStartDTDElement();
45969     test_ret += test_xmlTextWriterStartDTDEntity();
45970     test_ret += test_xmlTextWriterStartDocument();
45971     test_ret += test_xmlTextWriterStartElement();
45972     test_ret += test_xmlTextWriterStartElementNS();
45973     test_ret += test_xmlTextWriterStartPI();
45974     test_ret += test_xmlTextWriterWriteAttribute();
45975     test_ret += test_xmlTextWriterWriteAttributeNS();
45976     test_ret += test_xmlTextWriterWriteBase64();
45977     test_ret += test_xmlTextWriterWriteBinHex();
45978     test_ret += test_xmlTextWriterWriteCDATA();
45979     test_ret += test_xmlTextWriterWriteComment();
45980     test_ret += test_xmlTextWriterWriteDTD();
45981     test_ret += test_xmlTextWriterWriteDTDAttlist();
45982     test_ret += test_xmlTextWriterWriteDTDElement();
45983     test_ret += test_xmlTextWriterWriteDTDEntity();
45984     test_ret += test_xmlTextWriterWriteDTDExternalEntity();
45985     test_ret += test_xmlTextWriterWriteDTDExternalEntityContents();
45986     test_ret += test_xmlTextWriterWriteDTDInternalEntity();
45987     test_ret += test_xmlTextWriterWriteDTDNotation();
45988     test_ret += test_xmlTextWriterWriteElement();
45989     test_ret += test_xmlTextWriterWriteElementNS();
45990     test_ret += test_xmlTextWriterWriteFormatAttribute();
45991     test_ret += test_xmlTextWriterWriteFormatAttributeNS();
45992     test_ret += test_xmlTextWriterWriteFormatCDATA();
45993     test_ret += test_xmlTextWriterWriteFormatComment();
45994     test_ret += test_xmlTextWriterWriteFormatDTD();
45995     test_ret += test_xmlTextWriterWriteFormatDTDAttlist();
45996     test_ret += test_xmlTextWriterWriteFormatDTDElement();
45997     test_ret += test_xmlTextWriterWriteFormatDTDInternalEntity();
45998     test_ret += test_xmlTextWriterWriteFormatElement();
45999     test_ret += test_xmlTextWriterWriteFormatElementNS();
46000     test_ret += test_xmlTextWriterWriteFormatPI();
46001     test_ret += test_xmlTextWriterWriteFormatRaw();
46002     test_ret += test_xmlTextWriterWriteFormatString();
46003     test_ret += test_xmlTextWriterWritePI();
46004     test_ret += test_xmlTextWriterWriteRaw();
46005     test_ret += test_xmlTextWriterWriteRawLen();
46006     test_ret += test_xmlTextWriterWriteString();
46007     test_ret += test_xmlTextWriterWriteVFormatAttribute();
46008     test_ret += test_xmlTextWriterWriteVFormatAttributeNS();
46009     test_ret += test_xmlTextWriterWriteVFormatCDATA();
46010     test_ret += test_xmlTextWriterWriteVFormatComment();
46011     test_ret += test_xmlTextWriterWriteVFormatDTD();
46012     test_ret += test_xmlTextWriterWriteVFormatDTDAttlist();
46013     test_ret += test_xmlTextWriterWriteVFormatDTDElement();
46014     test_ret += test_xmlTextWriterWriteVFormatDTDInternalEntity();
46015     test_ret += test_xmlTextWriterWriteVFormatElement();
46016     test_ret += test_xmlTextWriterWriteVFormatElementNS();
46017     test_ret += test_xmlTextWriterWriteVFormatPI();
46018     test_ret += test_xmlTextWriterWriteVFormatRaw();
46019     test_ret += test_xmlTextWriterWriteVFormatString();
46020 
46021     if (test_ret != 0)
46022 	printf("Module xmlwriter: %d errors\n", test_ret);
46023     return(test_ret);
46024 }
46025 
46026 static int
test_xmlXPathCastBooleanToNumber(void)46027 test_xmlXPathCastBooleanToNumber(void) {
46028     int test_ret = 0;
46029 
46030 #if defined(LIBXML_XPATH_ENABLED)
46031     int mem_base;
46032     double ret_val;
46033     int val; /* a boolean */
46034     int n_val;
46035 
46036     for (n_val = 0;n_val < gen_nb_int;n_val++) {
46037         mem_base = xmlMemBlocks();
46038         val = gen_int(n_val, 0);
46039 
46040         ret_val = xmlXPathCastBooleanToNumber(val);
46041         desret_double(ret_val);
46042         call_tests++;
46043         des_int(n_val, val, 0);
46044         xmlResetLastError();
46045         if (mem_base != xmlMemBlocks()) {
46046             printf("Leak of %d blocks found in xmlXPathCastBooleanToNumber",
46047 	           xmlMemBlocks() - mem_base);
46048 	    test_ret++;
46049             printf(" %d", n_val);
46050             printf("\n");
46051         }
46052     }
46053     function_tests++;
46054 #endif
46055 
46056     return(test_ret);
46057 }
46058 
46059 
46060 static int
test_xmlXPathCastBooleanToString(void)46061 test_xmlXPathCastBooleanToString(void) {
46062     int test_ret = 0;
46063 
46064 #if defined(LIBXML_XPATH_ENABLED)
46065     int mem_base;
46066     xmlChar * ret_val;
46067     int val; /* a boolean */
46068     int n_val;
46069 
46070     for (n_val = 0;n_val < gen_nb_int;n_val++) {
46071         mem_base = xmlMemBlocks();
46072         val = gen_int(n_val, 0);
46073 
46074         ret_val = xmlXPathCastBooleanToString(val);
46075         desret_xmlChar_ptr(ret_val);
46076         call_tests++;
46077         des_int(n_val, val, 0);
46078         xmlResetLastError();
46079         if (mem_base != xmlMemBlocks()) {
46080             printf("Leak of %d blocks found in xmlXPathCastBooleanToString",
46081 	           xmlMemBlocks() - mem_base);
46082 	    test_ret++;
46083             printf(" %d", n_val);
46084             printf("\n");
46085         }
46086     }
46087     function_tests++;
46088 #endif
46089 
46090     return(test_ret);
46091 }
46092 
46093 
46094 static int
test_xmlXPathCastNodeSetToBoolean(void)46095 test_xmlXPathCastNodeSetToBoolean(void) {
46096     int test_ret = 0;
46097 
46098 #if defined(LIBXML_XPATH_ENABLED)
46099     int mem_base;
46100     int ret_val;
46101     xmlNodeSetPtr ns; /* a node-set */
46102     int n_ns;
46103 
46104     for (n_ns = 0;n_ns < gen_nb_xmlNodeSetPtr;n_ns++) {
46105         mem_base = xmlMemBlocks();
46106         ns = gen_xmlNodeSetPtr(n_ns, 0);
46107 
46108         ret_val = xmlXPathCastNodeSetToBoolean(ns);
46109         desret_int(ret_val);
46110         call_tests++;
46111         des_xmlNodeSetPtr(n_ns, ns, 0);
46112         xmlResetLastError();
46113         if (mem_base != xmlMemBlocks()) {
46114             printf("Leak of %d blocks found in xmlXPathCastNodeSetToBoolean",
46115 	           xmlMemBlocks() - mem_base);
46116 	    test_ret++;
46117             printf(" %d", n_ns);
46118             printf("\n");
46119         }
46120     }
46121     function_tests++;
46122 #endif
46123 
46124     return(test_ret);
46125 }
46126 
46127 
46128 static int
test_xmlXPathCastNodeSetToNumber(void)46129 test_xmlXPathCastNodeSetToNumber(void) {
46130     int test_ret = 0;
46131 
46132 #if defined(LIBXML_XPATH_ENABLED)
46133     int mem_base;
46134     double ret_val;
46135     xmlNodeSetPtr ns; /* a node-set */
46136     int n_ns;
46137 
46138     for (n_ns = 0;n_ns < gen_nb_xmlNodeSetPtr;n_ns++) {
46139         mem_base = xmlMemBlocks();
46140         ns = gen_xmlNodeSetPtr(n_ns, 0);
46141 
46142         ret_val = xmlXPathCastNodeSetToNumber(ns);
46143         desret_double(ret_val);
46144         call_tests++;
46145         des_xmlNodeSetPtr(n_ns, ns, 0);
46146         xmlResetLastError();
46147         if (mem_base != xmlMemBlocks()) {
46148             printf("Leak of %d blocks found in xmlXPathCastNodeSetToNumber",
46149 	           xmlMemBlocks() - mem_base);
46150 	    test_ret++;
46151             printf(" %d", n_ns);
46152             printf("\n");
46153         }
46154     }
46155     function_tests++;
46156 #endif
46157 
46158     return(test_ret);
46159 }
46160 
46161 
46162 static int
test_xmlXPathCastNodeSetToString(void)46163 test_xmlXPathCastNodeSetToString(void) {
46164     int test_ret = 0;
46165 
46166 #if defined(LIBXML_XPATH_ENABLED)
46167     int mem_base;
46168     xmlChar * ret_val;
46169     xmlNodeSetPtr ns; /* a node-set */
46170     int n_ns;
46171 
46172     for (n_ns = 0;n_ns < gen_nb_xmlNodeSetPtr;n_ns++) {
46173         mem_base = xmlMemBlocks();
46174         ns = gen_xmlNodeSetPtr(n_ns, 0);
46175 
46176         ret_val = xmlXPathCastNodeSetToString(ns);
46177         desret_xmlChar_ptr(ret_val);
46178         call_tests++;
46179         des_xmlNodeSetPtr(n_ns, ns, 0);
46180         xmlResetLastError();
46181         if (mem_base != xmlMemBlocks()) {
46182             printf("Leak of %d blocks found in xmlXPathCastNodeSetToString",
46183 	           xmlMemBlocks() - mem_base);
46184 	    test_ret++;
46185             printf(" %d", n_ns);
46186             printf("\n");
46187         }
46188     }
46189     function_tests++;
46190 #endif
46191 
46192     return(test_ret);
46193 }
46194 
46195 
46196 static int
test_xmlXPathCastNodeToNumber(void)46197 test_xmlXPathCastNodeToNumber(void) {
46198     int test_ret = 0;
46199 
46200 #if defined(LIBXML_XPATH_ENABLED)
46201     int mem_base;
46202     double ret_val;
46203     xmlNodePtr node; /* a node */
46204     int n_node;
46205 
46206     for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
46207         mem_base = xmlMemBlocks();
46208         node = gen_xmlNodePtr(n_node, 0);
46209 
46210         ret_val = xmlXPathCastNodeToNumber(node);
46211         desret_double(ret_val);
46212         call_tests++;
46213         des_xmlNodePtr(n_node, node, 0);
46214         xmlResetLastError();
46215         if (mem_base != xmlMemBlocks()) {
46216             printf("Leak of %d blocks found in xmlXPathCastNodeToNumber",
46217 	           xmlMemBlocks() - mem_base);
46218 	    test_ret++;
46219             printf(" %d", n_node);
46220             printf("\n");
46221         }
46222     }
46223     function_tests++;
46224 #endif
46225 
46226     return(test_ret);
46227 }
46228 
46229 
46230 static int
test_xmlXPathCastNodeToString(void)46231 test_xmlXPathCastNodeToString(void) {
46232     int test_ret = 0;
46233 
46234 #if defined(LIBXML_XPATH_ENABLED)
46235     int mem_base;
46236     xmlChar * ret_val;
46237     xmlNodePtr node; /* a node */
46238     int n_node;
46239 
46240     for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
46241         mem_base = xmlMemBlocks();
46242         node = gen_xmlNodePtr(n_node, 0);
46243 
46244         ret_val = xmlXPathCastNodeToString(node);
46245         desret_xmlChar_ptr(ret_val);
46246         call_tests++;
46247         des_xmlNodePtr(n_node, node, 0);
46248         xmlResetLastError();
46249         if (mem_base != xmlMemBlocks()) {
46250             printf("Leak of %d blocks found in xmlXPathCastNodeToString",
46251 	           xmlMemBlocks() - mem_base);
46252 	    test_ret++;
46253             printf(" %d", n_node);
46254             printf("\n");
46255         }
46256     }
46257     function_tests++;
46258 #endif
46259 
46260     return(test_ret);
46261 }
46262 
46263 
46264 static int
test_xmlXPathCastNumberToBoolean(void)46265 test_xmlXPathCastNumberToBoolean(void) {
46266     int test_ret = 0;
46267 
46268 #if defined(LIBXML_XPATH_ENABLED)
46269     int mem_base;
46270     int ret_val;
46271     double val; /* a number */
46272     int n_val;
46273 
46274     for (n_val = 0;n_val < gen_nb_double;n_val++) {
46275         mem_base = xmlMemBlocks();
46276         val = gen_double(n_val, 0);
46277 
46278         ret_val = xmlXPathCastNumberToBoolean(val);
46279         desret_int(ret_val);
46280         call_tests++;
46281         des_double(n_val, val, 0);
46282         xmlResetLastError();
46283         if (mem_base != xmlMemBlocks()) {
46284             printf("Leak of %d blocks found in xmlXPathCastNumberToBoolean",
46285 	           xmlMemBlocks() - mem_base);
46286 	    test_ret++;
46287             printf(" %d", n_val);
46288             printf("\n");
46289         }
46290     }
46291     function_tests++;
46292 #endif
46293 
46294     return(test_ret);
46295 }
46296 
46297 
46298 static int
test_xmlXPathCastNumberToString(void)46299 test_xmlXPathCastNumberToString(void) {
46300     int test_ret = 0;
46301 
46302 #if defined(LIBXML_XPATH_ENABLED)
46303     int mem_base;
46304     xmlChar * ret_val;
46305     double val; /* a number */
46306     int n_val;
46307 
46308     for (n_val = 0;n_val < gen_nb_double;n_val++) {
46309         mem_base = xmlMemBlocks();
46310         val = gen_double(n_val, 0);
46311 
46312         ret_val = xmlXPathCastNumberToString(val);
46313         desret_xmlChar_ptr(ret_val);
46314         call_tests++;
46315         des_double(n_val, val, 0);
46316         xmlResetLastError();
46317         if (mem_base != xmlMemBlocks()) {
46318             printf("Leak of %d blocks found in xmlXPathCastNumberToString",
46319 	           xmlMemBlocks() - mem_base);
46320 	    test_ret++;
46321             printf(" %d", n_val);
46322             printf("\n");
46323         }
46324     }
46325     function_tests++;
46326 #endif
46327 
46328     return(test_ret);
46329 }
46330 
46331 
46332 static int
test_xmlXPathCastStringToBoolean(void)46333 test_xmlXPathCastStringToBoolean(void) {
46334     int test_ret = 0;
46335 
46336 #if defined(LIBXML_XPATH_ENABLED)
46337     int mem_base;
46338     int ret_val;
46339     xmlChar * val; /* a string */
46340     int n_val;
46341 
46342     for (n_val = 0;n_val < gen_nb_const_xmlChar_ptr;n_val++) {
46343         mem_base = xmlMemBlocks();
46344         val = gen_const_xmlChar_ptr(n_val, 0);
46345 
46346         ret_val = xmlXPathCastStringToBoolean((const xmlChar *)val);
46347         desret_int(ret_val);
46348         call_tests++;
46349         des_const_xmlChar_ptr(n_val, (const xmlChar *)val, 0);
46350         xmlResetLastError();
46351         if (mem_base != xmlMemBlocks()) {
46352             printf("Leak of %d blocks found in xmlXPathCastStringToBoolean",
46353 	           xmlMemBlocks() - mem_base);
46354 	    test_ret++;
46355             printf(" %d", n_val);
46356             printf("\n");
46357         }
46358     }
46359     function_tests++;
46360 #endif
46361 
46362     return(test_ret);
46363 }
46364 
46365 
46366 static int
test_xmlXPathCastStringToNumber(void)46367 test_xmlXPathCastStringToNumber(void) {
46368     int test_ret = 0;
46369 
46370 #if defined(LIBXML_XPATH_ENABLED)
46371     int mem_base;
46372     double ret_val;
46373     xmlChar * val; /* a string */
46374     int n_val;
46375 
46376     for (n_val = 0;n_val < gen_nb_const_xmlChar_ptr;n_val++) {
46377         mem_base = xmlMemBlocks();
46378         val = gen_const_xmlChar_ptr(n_val, 0);
46379 
46380         ret_val = xmlXPathCastStringToNumber((const xmlChar *)val);
46381         desret_double(ret_val);
46382         call_tests++;
46383         des_const_xmlChar_ptr(n_val, (const xmlChar *)val, 0);
46384         xmlResetLastError();
46385         if (mem_base != xmlMemBlocks()) {
46386             printf("Leak of %d blocks found in xmlXPathCastStringToNumber",
46387 	           xmlMemBlocks() - mem_base);
46388 	    test_ret++;
46389             printf(" %d", n_val);
46390             printf("\n");
46391         }
46392     }
46393     function_tests++;
46394 #endif
46395 
46396     return(test_ret);
46397 }
46398 
46399 
46400 static int
test_xmlXPathCastToBoolean(void)46401 test_xmlXPathCastToBoolean(void) {
46402     int test_ret = 0;
46403 
46404 #if defined(LIBXML_XPATH_ENABLED)
46405     int mem_base;
46406     int ret_val;
46407     xmlXPathObjectPtr val; /* an XPath object */
46408     int n_val;
46409 
46410     for (n_val = 0;n_val < gen_nb_xmlXPathObjectPtr;n_val++) {
46411         mem_base = xmlMemBlocks();
46412         val = gen_xmlXPathObjectPtr(n_val, 0);
46413 
46414         ret_val = xmlXPathCastToBoolean(val);
46415         desret_int(ret_val);
46416         call_tests++;
46417         des_xmlXPathObjectPtr(n_val, val, 0);
46418         xmlResetLastError();
46419         if (mem_base != xmlMemBlocks()) {
46420             printf("Leak of %d blocks found in xmlXPathCastToBoolean",
46421 	           xmlMemBlocks() - mem_base);
46422 	    test_ret++;
46423             printf(" %d", n_val);
46424             printf("\n");
46425         }
46426     }
46427     function_tests++;
46428 #endif
46429 
46430     return(test_ret);
46431 }
46432 
46433 
46434 static int
test_xmlXPathCastToNumber(void)46435 test_xmlXPathCastToNumber(void) {
46436     int test_ret = 0;
46437 
46438 #if defined(LIBXML_XPATH_ENABLED)
46439     int mem_base;
46440     double ret_val;
46441     xmlXPathObjectPtr val; /* an XPath object */
46442     int n_val;
46443 
46444     for (n_val = 0;n_val < gen_nb_xmlXPathObjectPtr;n_val++) {
46445         mem_base = xmlMemBlocks();
46446         val = gen_xmlXPathObjectPtr(n_val, 0);
46447 
46448         ret_val = xmlXPathCastToNumber(val);
46449         desret_double(ret_val);
46450         call_tests++;
46451         des_xmlXPathObjectPtr(n_val, val, 0);
46452         xmlResetLastError();
46453         if (mem_base != xmlMemBlocks()) {
46454             printf("Leak of %d blocks found in xmlXPathCastToNumber",
46455 	           xmlMemBlocks() - mem_base);
46456 	    test_ret++;
46457             printf(" %d", n_val);
46458             printf("\n");
46459         }
46460     }
46461     function_tests++;
46462 #endif
46463 
46464     return(test_ret);
46465 }
46466 
46467 
46468 static int
test_xmlXPathCastToString(void)46469 test_xmlXPathCastToString(void) {
46470     int test_ret = 0;
46471 
46472 #if defined(LIBXML_XPATH_ENABLED)
46473     int mem_base;
46474     xmlChar * ret_val;
46475     xmlXPathObjectPtr val; /* an XPath object */
46476     int n_val;
46477 
46478     for (n_val = 0;n_val < gen_nb_xmlXPathObjectPtr;n_val++) {
46479         mem_base = xmlMemBlocks();
46480         val = gen_xmlXPathObjectPtr(n_val, 0);
46481 
46482         ret_val = xmlXPathCastToString(val);
46483         desret_xmlChar_ptr(ret_val);
46484         call_tests++;
46485         des_xmlXPathObjectPtr(n_val, val, 0);
46486         xmlResetLastError();
46487         if (mem_base != xmlMemBlocks()) {
46488             printf("Leak of %d blocks found in xmlXPathCastToString",
46489 	           xmlMemBlocks() - mem_base);
46490 	    test_ret++;
46491             printf(" %d", n_val);
46492             printf("\n");
46493         }
46494     }
46495     function_tests++;
46496 #endif
46497 
46498     return(test_ret);
46499 }
46500 
46501 
46502 static int
test_xmlXPathCmpNodes(void)46503 test_xmlXPathCmpNodes(void) {
46504     int test_ret = 0;
46505 
46506 #if defined(LIBXML_XPATH_ENABLED)
46507     int mem_base;
46508     int ret_val;
46509     xmlNodePtr node1; /* the first node */
46510     int n_node1;
46511     xmlNodePtr node2; /* the second node */
46512     int n_node2;
46513 
46514     for (n_node1 = 0;n_node1 < gen_nb_xmlNodePtr;n_node1++) {
46515     for (n_node2 = 0;n_node2 < gen_nb_xmlNodePtr;n_node2++) {
46516         mem_base = xmlMemBlocks();
46517         node1 = gen_xmlNodePtr(n_node1, 0);
46518         node2 = gen_xmlNodePtr(n_node2, 1);
46519 
46520         ret_val = xmlXPathCmpNodes(node1, node2);
46521         desret_int(ret_val);
46522         call_tests++;
46523         des_xmlNodePtr(n_node1, node1, 0);
46524         des_xmlNodePtr(n_node2, node2, 1);
46525         xmlResetLastError();
46526         if (mem_base != xmlMemBlocks()) {
46527             printf("Leak of %d blocks found in xmlXPathCmpNodes",
46528 	           xmlMemBlocks() - mem_base);
46529 	    test_ret++;
46530             printf(" %d", n_node1);
46531             printf(" %d", n_node2);
46532             printf("\n");
46533         }
46534     }
46535     }
46536     function_tests++;
46537 #endif
46538 
46539     return(test_ret);
46540 }
46541 
46542 
46543 static int
test_xmlXPathCompile(void)46544 test_xmlXPathCompile(void) {
46545     int test_ret = 0;
46546 
46547 
46548     /* missing type support */
46549     return(test_ret);
46550 }
46551 
46552 #ifdef LIBXML_XPATH_ENABLED
46553 
46554 #define gen_nb_xmlXPathCompExprPtr 1
gen_xmlXPathCompExprPtr(int no ATTRIBUTE_UNUSED,int nr ATTRIBUTE_UNUSED)46555 static xmlXPathCompExprPtr gen_xmlXPathCompExprPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
46556     return(NULL);
46557 }
des_xmlXPathCompExprPtr(int no ATTRIBUTE_UNUSED,xmlXPathCompExprPtr val ATTRIBUTE_UNUSED,int nr ATTRIBUTE_UNUSED)46558 static void des_xmlXPathCompExprPtr(int no ATTRIBUTE_UNUSED, xmlXPathCompExprPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
46559 }
46560 #endif
46561 
46562 #ifdef LIBXML_XPATH_ENABLED
46563 
46564 #define gen_nb_xmlXPathContextPtr 1
gen_xmlXPathContextPtr(int no ATTRIBUTE_UNUSED,int nr ATTRIBUTE_UNUSED)46565 static xmlXPathContextPtr gen_xmlXPathContextPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
46566     return(NULL);
46567 }
des_xmlXPathContextPtr(int no ATTRIBUTE_UNUSED,xmlXPathContextPtr val ATTRIBUTE_UNUSED,int nr ATTRIBUTE_UNUSED)46568 static void des_xmlXPathContextPtr(int no ATTRIBUTE_UNUSED, xmlXPathContextPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
46569 }
46570 #endif
46571 
46572 
46573 static int
test_xmlXPathCompiledEval(void)46574 test_xmlXPathCompiledEval(void) {
46575     int test_ret = 0;
46576 
46577 #if defined(LIBXML_XPATH_ENABLED)
46578     int mem_base;
46579     xmlXPathObjectPtr ret_val;
46580     xmlXPathCompExprPtr comp; /* the compiled XPath expression */
46581     int n_comp;
46582     xmlXPathContextPtr ctx; /* the XPath context */
46583     int n_ctx;
46584 
46585     for (n_comp = 0;n_comp < gen_nb_xmlXPathCompExprPtr;n_comp++) {
46586     for (n_ctx = 0;n_ctx < gen_nb_xmlXPathContextPtr;n_ctx++) {
46587         mem_base = xmlMemBlocks();
46588         comp = gen_xmlXPathCompExprPtr(n_comp, 0);
46589         ctx = gen_xmlXPathContextPtr(n_ctx, 1);
46590 
46591         ret_val = xmlXPathCompiledEval(comp, ctx);
46592         desret_xmlXPathObjectPtr(ret_val);
46593         call_tests++;
46594         des_xmlXPathCompExprPtr(n_comp, comp, 0);
46595         des_xmlXPathContextPtr(n_ctx, ctx, 1);
46596         xmlResetLastError();
46597         if (mem_base != xmlMemBlocks()) {
46598             printf("Leak of %d blocks found in xmlXPathCompiledEval",
46599 	           xmlMemBlocks() - mem_base);
46600 	    test_ret++;
46601             printf(" %d", n_comp);
46602             printf(" %d", n_ctx);
46603             printf("\n");
46604         }
46605     }
46606     }
46607     function_tests++;
46608 #endif
46609 
46610     return(test_ret);
46611 }
46612 
46613 
46614 static int
test_xmlXPathCompiledEvalToBoolean(void)46615 test_xmlXPathCompiledEvalToBoolean(void) {
46616     int test_ret = 0;
46617 
46618 #if defined(LIBXML_XPATH_ENABLED)
46619     int mem_base;
46620     int ret_val;
46621     xmlXPathCompExprPtr comp; /* the compiled XPath expression */
46622     int n_comp;
46623     xmlXPathContextPtr ctxt; /* the XPath context */
46624     int n_ctxt;
46625 
46626     for (n_comp = 0;n_comp < gen_nb_xmlXPathCompExprPtr;n_comp++) {
46627     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathContextPtr;n_ctxt++) {
46628         mem_base = xmlMemBlocks();
46629         comp = gen_xmlXPathCompExprPtr(n_comp, 0);
46630         ctxt = gen_xmlXPathContextPtr(n_ctxt, 1);
46631 
46632         ret_val = xmlXPathCompiledEvalToBoolean(comp, ctxt);
46633         desret_int(ret_val);
46634         call_tests++;
46635         des_xmlXPathCompExprPtr(n_comp, comp, 0);
46636         des_xmlXPathContextPtr(n_ctxt, ctxt, 1);
46637         xmlResetLastError();
46638         if (mem_base != xmlMemBlocks()) {
46639             printf("Leak of %d blocks found in xmlXPathCompiledEvalToBoolean",
46640 	           xmlMemBlocks() - mem_base);
46641 	    test_ret++;
46642             printf(" %d", n_comp);
46643             printf(" %d", n_ctxt);
46644             printf("\n");
46645         }
46646     }
46647     }
46648     function_tests++;
46649 #endif
46650 
46651     return(test_ret);
46652 }
46653 
46654 
46655 static int
test_xmlXPathContextSetCache(void)46656 test_xmlXPathContextSetCache(void) {
46657     int test_ret = 0;
46658 
46659 #if defined(LIBXML_XPATH_ENABLED)
46660     int mem_base;
46661     int ret_val;
46662     xmlXPathContextPtr ctxt; /* the XPath context */
46663     int n_ctxt;
46664     int active; /* enables/disables (creates/frees) the cache */
46665     int n_active;
46666     int value; /* a value with semantics dependant on @options */
46667     int n_value;
46668     int options; /* options (currently only the value 0 is used) */
46669     int n_options;
46670 
46671     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathContextPtr;n_ctxt++) {
46672     for (n_active = 0;n_active < gen_nb_int;n_active++) {
46673     for (n_value = 0;n_value < gen_nb_int;n_value++) {
46674     for (n_options = 0;n_options < gen_nb_int;n_options++) {
46675         mem_base = xmlMemBlocks();
46676         ctxt = gen_xmlXPathContextPtr(n_ctxt, 0);
46677         active = gen_int(n_active, 1);
46678         value = gen_int(n_value, 2);
46679         options = gen_int(n_options, 3);
46680 
46681         ret_val = xmlXPathContextSetCache(ctxt, active, value, options);
46682         desret_int(ret_val);
46683         call_tests++;
46684         des_xmlXPathContextPtr(n_ctxt, ctxt, 0);
46685         des_int(n_active, active, 1);
46686         des_int(n_value, value, 2);
46687         des_int(n_options, options, 3);
46688         xmlResetLastError();
46689         if (mem_base != xmlMemBlocks()) {
46690             printf("Leak of %d blocks found in xmlXPathContextSetCache",
46691 	           xmlMemBlocks() - mem_base);
46692 	    test_ret++;
46693             printf(" %d", n_ctxt);
46694             printf(" %d", n_active);
46695             printf(" %d", n_value);
46696             printf(" %d", n_options);
46697             printf("\n");
46698         }
46699     }
46700     }
46701     }
46702     }
46703     function_tests++;
46704 #endif
46705 
46706     return(test_ret);
46707 }
46708 
46709 
46710 static int
test_xmlXPathConvertBoolean(void)46711 test_xmlXPathConvertBoolean(void) {
46712     int test_ret = 0;
46713 
46714 #if defined(LIBXML_XPATH_ENABLED)
46715     int mem_base;
46716     xmlXPathObjectPtr ret_val;
46717     xmlXPathObjectPtr val; /* an XPath object */
46718     int n_val;
46719 
46720     for (n_val = 0;n_val < gen_nb_xmlXPathObjectPtr;n_val++) {
46721         mem_base = xmlMemBlocks();
46722         val = gen_xmlXPathObjectPtr(n_val, 0);
46723 
46724         ret_val = xmlXPathConvertBoolean(val);
46725         val = NULL;
46726         desret_xmlXPathObjectPtr(ret_val);
46727         call_tests++;
46728         des_xmlXPathObjectPtr(n_val, val, 0);
46729         xmlResetLastError();
46730         if (mem_base != xmlMemBlocks()) {
46731             printf("Leak of %d blocks found in xmlXPathConvertBoolean",
46732 	           xmlMemBlocks() - mem_base);
46733 	    test_ret++;
46734             printf(" %d", n_val);
46735             printf("\n");
46736         }
46737     }
46738     function_tests++;
46739 #endif
46740 
46741     return(test_ret);
46742 }
46743 
46744 
46745 static int
test_xmlXPathConvertNumber(void)46746 test_xmlXPathConvertNumber(void) {
46747     int test_ret = 0;
46748 
46749 #if defined(LIBXML_XPATH_ENABLED)
46750     int mem_base;
46751     xmlXPathObjectPtr ret_val;
46752     xmlXPathObjectPtr val; /* an XPath object */
46753     int n_val;
46754 
46755     for (n_val = 0;n_val < gen_nb_xmlXPathObjectPtr;n_val++) {
46756         mem_base = xmlMemBlocks();
46757         val = gen_xmlXPathObjectPtr(n_val, 0);
46758 
46759         ret_val = xmlXPathConvertNumber(val);
46760         val = NULL;
46761         desret_xmlXPathObjectPtr(ret_val);
46762         call_tests++;
46763         des_xmlXPathObjectPtr(n_val, val, 0);
46764         xmlResetLastError();
46765         if (mem_base != xmlMemBlocks()) {
46766             printf("Leak of %d blocks found in xmlXPathConvertNumber",
46767 	           xmlMemBlocks() - mem_base);
46768 	    test_ret++;
46769             printf(" %d", n_val);
46770             printf("\n");
46771         }
46772     }
46773     function_tests++;
46774 #endif
46775 
46776     return(test_ret);
46777 }
46778 
46779 
46780 static int
test_xmlXPathConvertString(void)46781 test_xmlXPathConvertString(void) {
46782     int test_ret = 0;
46783 
46784 #if defined(LIBXML_XPATH_ENABLED)
46785     int mem_base;
46786     xmlXPathObjectPtr ret_val;
46787     xmlXPathObjectPtr val; /* an XPath object */
46788     int n_val;
46789 
46790     for (n_val = 0;n_val < gen_nb_xmlXPathObjectPtr;n_val++) {
46791         mem_base = xmlMemBlocks();
46792         val = gen_xmlXPathObjectPtr(n_val, 0);
46793 
46794         ret_val = xmlXPathConvertString(val);
46795         val = NULL;
46796         desret_xmlXPathObjectPtr(ret_val);
46797         call_tests++;
46798         des_xmlXPathObjectPtr(n_val, val, 0);
46799         xmlResetLastError();
46800         if (mem_base != xmlMemBlocks()) {
46801             printf("Leak of %d blocks found in xmlXPathConvertString",
46802 	           xmlMemBlocks() - mem_base);
46803 	    test_ret++;
46804             printf(" %d", n_val);
46805             printf("\n");
46806         }
46807     }
46808     function_tests++;
46809 #endif
46810 
46811     return(test_ret);
46812 }
46813 
46814 
46815 static int
test_xmlXPathCtxtCompile(void)46816 test_xmlXPathCtxtCompile(void) {
46817     int test_ret = 0;
46818 
46819 
46820     /* missing type support */
46821     return(test_ret);
46822 }
46823 
46824 
46825 static int
test_xmlXPathEval(void)46826 test_xmlXPathEval(void) {
46827     int test_ret = 0;
46828 
46829 #if defined(LIBXML_XPATH_ENABLED)
46830     int mem_base;
46831     xmlXPathObjectPtr ret_val;
46832     xmlChar * str; /* the XPath expression */
46833     int n_str;
46834     xmlXPathContextPtr ctx; /* the XPath context */
46835     int n_ctx;
46836 
46837     for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) {
46838     for (n_ctx = 0;n_ctx < gen_nb_xmlXPathContextPtr;n_ctx++) {
46839         mem_base = xmlMemBlocks();
46840         str = gen_const_xmlChar_ptr(n_str, 0);
46841         ctx = gen_xmlXPathContextPtr(n_ctx, 1);
46842 
46843         ret_val = xmlXPathEval((const xmlChar *)str, ctx);
46844         desret_xmlXPathObjectPtr(ret_val);
46845         call_tests++;
46846         des_const_xmlChar_ptr(n_str, (const xmlChar *)str, 0);
46847         des_xmlXPathContextPtr(n_ctx, ctx, 1);
46848         xmlResetLastError();
46849         if (mem_base != xmlMemBlocks()) {
46850             printf("Leak of %d blocks found in xmlXPathEval",
46851 	           xmlMemBlocks() - mem_base);
46852 	    test_ret++;
46853             printf(" %d", n_str);
46854             printf(" %d", n_ctx);
46855             printf("\n");
46856         }
46857     }
46858     }
46859     function_tests++;
46860 #endif
46861 
46862     return(test_ret);
46863 }
46864 
46865 
46866 static int
test_xmlXPathEvalExpression(void)46867 test_xmlXPathEvalExpression(void) {
46868     int test_ret = 0;
46869 
46870 #if defined(LIBXML_XPATH_ENABLED)
46871     int mem_base;
46872     xmlXPathObjectPtr ret_val;
46873     xmlChar * str; /* the XPath expression */
46874     int n_str;
46875     xmlXPathContextPtr ctxt; /* the XPath context */
46876     int n_ctxt;
46877 
46878     for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) {
46879     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathContextPtr;n_ctxt++) {
46880         mem_base = xmlMemBlocks();
46881         str = gen_const_xmlChar_ptr(n_str, 0);
46882         ctxt = gen_xmlXPathContextPtr(n_ctxt, 1);
46883 
46884         ret_val = xmlXPathEvalExpression((const xmlChar *)str, ctxt);
46885         desret_xmlXPathObjectPtr(ret_val);
46886         call_tests++;
46887         des_const_xmlChar_ptr(n_str, (const xmlChar *)str, 0);
46888         des_xmlXPathContextPtr(n_ctxt, ctxt, 1);
46889         xmlResetLastError();
46890         if (mem_base != xmlMemBlocks()) {
46891             printf("Leak of %d blocks found in xmlXPathEvalExpression",
46892 	           xmlMemBlocks() - mem_base);
46893 	    test_ret++;
46894             printf(" %d", n_str);
46895             printf(" %d", n_ctxt);
46896             printf("\n");
46897         }
46898     }
46899     }
46900     function_tests++;
46901 #endif
46902 
46903     return(test_ret);
46904 }
46905 
46906 
46907 static int
test_xmlXPathEvalPredicate(void)46908 test_xmlXPathEvalPredicate(void) {
46909     int test_ret = 0;
46910 
46911 #if defined(LIBXML_XPATH_ENABLED)
46912     int mem_base;
46913     int ret_val;
46914     xmlXPathContextPtr ctxt; /* the XPath context */
46915     int n_ctxt;
46916     xmlXPathObjectPtr res; /* the Predicate Expression evaluation result */
46917     int n_res;
46918 
46919     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathContextPtr;n_ctxt++) {
46920     for (n_res = 0;n_res < gen_nb_xmlXPathObjectPtr;n_res++) {
46921         mem_base = xmlMemBlocks();
46922         ctxt = gen_xmlXPathContextPtr(n_ctxt, 0);
46923         res = gen_xmlXPathObjectPtr(n_res, 1);
46924 
46925         ret_val = xmlXPathEvalPredicate(ctxt, res);
46926         desret_int(ret_val);
46927         call_tests++;
46928         des_xmlXPathContextPtr(n_ctxt, ctxt, 0);
46929         des_xmlXPathObjectPtr(n_res, res, 1);
46930         xmlResetLastError();
46931         if (mem_base != xmlMemBlocks()) {
46932             printf("Leak of %d blocks found in xmlXPathEvalPredicate",
46933 	           xmlMemBlocks() - mem_base);
46934 	    test_ret++;
46935             printf(" %d", n_ctxt);
46936             printf(" %d", n_res);
46937             printf("\n");
46938         }
46939     }
46940     }
46941     function_tests++;
46942 #endif
46943 
46944     return(test_ret);
46945 }
46946 
46947 
46948 static int
test_xmlXPathInit(void)46949 test_xmlXPathInit(void) {
46950     int test_ret = 0;
46951 
46952 #if defined(LIBXML_XPATH_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED)
46953     int mem_base;
46954 
46955         mem_base = xmlMemBlocks();
46956 
46957         xmlXPathInit();
46958         call_tests++;
46959         xmlResetLastError();
46960         if (mem_base != xmlMemBlocks()) {
46961             printf("Leak of %d blocks found in xmlXPathInit",
46962 	           xmlMemBlocks() - mem_base);
46963 	    test_ret++;
46964             printf("\n");
46965         }
46966     function_tests++;
46967 #endif
46968 
46969     return(test_ret);
46970 }
46971 
46972 
46973 static int
test_xmlXPathIsInf(void)46974 test_xmlXPathIsInf(void) {
46975     int test_ret = 0;
46976 
46977 #if defined(LIBXML_XPATH_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED)
46978     int mem_base;
46979     int ret_val;
46980     double val; /* a double value */
46981     int n_val;
46982 
46983     for (n_val = 0;n_val < gen_nb_double;n_val++) {
46984         mem_base = xmlMemBlocks();
46985         val = gen_double(n_val, 0);
46986 
46987         ret_val = xmlXPathIsInf(val);
46988         desret_int(ret_val);
46989         call_tests++;
46990         des_double(n_val, val, 0);
46991         xmlResetLastError();
46992         if (mem_base != xmlMemBlocks()) {
46993             printf("Leak of %d blocks found in xmlXPathIsInf",
46994 	           xmlMemBlocks() - mem_base);
46995 	    test_ret++;
46996             printf(" %d", n_val);
46997             printf("\n");
46998         }
46999     }
47000     function_tests++;
47001 #endif
47002 
47003     return(test_ret);
47004 }
47005 
47006 
47007 static int
test_xmlXPathIsNaN(void)47008 test_xmlXPathIsNaN(void) {
47009     int test_ret = 0;
47010 
47011 #if defined(LIBXML_XPATH_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED)
47012     int mem_base;
47013     int ret_val;
47014     double val; /* a double value */
47015     int n_val;
47016 
47017     for (n_val = 0;n_val < gen_nb_double;n_val++) {
47018         mem_base = xmlMemBlocks();
47019         val = gen_double(n_val, 0);
47020 
47021         ret_val = xmlXPathIsNaN(val);
47022         desret_int(ret_val);
47023         call_tests++;
47024         des_double(n_val, val, 0);
47025         xmlResetLastError();
47026         if (mem_base != xmlMemBlocks()) {
47027             printf("Leak of %d blocks found in xmlXPathIsNaN",
47028 	           xmlMemBlocks() - mem_base);
47029 	    test_ret++;
47030             printf(" %d", n_val);
47031             printf("\n");
47032         }
47033     }
47034     function_tests++;
47035 #endif
47036 
47037     return(test_ret);
47038 }
47039 
47040 
47041 static int
test_xmlXPathNewContext(void)47042 test_xmlXPathNewContext(void) {
47043     int test_ret = 0;
47044 
47045 
47046     /* missing type support */
47047     return(test_ret);
47048 }
47049 
47050 
47051 static int
test_xmlXPathNodeEval(void)47052 test_xmlXPathNodeEval(void) {
47053     int test_ret = 0;
47054 
47055 #if defined(LIBXML_XPATH_ENABLED)
47056     int mem_base;
47057     xmlXPathObjectPtr ret_val;
47058     xmlNodePtr node; /* the node to to use as the context node */
47059     int n_node;
47060     xmlChar * str; /* the XPath expression */
47061     int n_str;
47062     xmlXPathContextPtr ctx; /* the XPath context */
47063     int n_ctx;
47064 
47065     for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
47066     for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) {
47067     for (n_ctx = 0;n_ctx < gen_nb_xmlXPathContextPtr;n_ctx++) {
47068         mem_base = xmlMemBlocks();
47069         node = gen_xmlNodePtr(n_node, 0);
47070         str = gen_const_xmlChar_ptr(n_str, 1);
47071         ctx = gen_xmlXPathContextPtr(n_ctx, 2);
47072 
47073         ret_val = xmlXPathNodeEval(node, (const xmlChar *)str, ctx);
47074         desret_xmlXPathObjectPtr(ret_val);
47075         call_tests++;
47076         des_xmlNodePtr(n_node, node, 0);
47077         des_const_xmlChar_ptr(n_str, (const xmlChar *)str, 1);
47078         des_xmlXPathContextPtr(n_ctx, ctx, 2);
47079         xmlResetLastError();
47080         if (mem_base != xmlMemBlocks()) {
47081             printf("Leak of %d blocks found in xmlXPathNodeEval",
47082 	           xmlMemBlocks() - mem_base);
47083 	    test_ret++;
47084             printf(" %d", n_node);
47085             printf(" %d", n_str);
47086             printf(" %d", n_ctx);
47087             printf("\n");
47088         }
47089     }
47090     }
47091     }
47092     function_tests++;
47093 #endif
47094 
47095     return(test_ret);
47096 }
47097 
47098 
47099 static int
test_xmlXPathNodeSetCreate(void)47100 test_xmlXPathNodeSetCreate(void) {
47101     int test_ret = 0;
47102 
47103 #if defined(LIBXML_XPATH_ENABLED)
47104     int mem_base;
47105     xmlNodeSetPtr ret_val;
47106     xmlNodePtr val; /* an initial xmlNodePtr, or NULL */
47107     int n_val;
47108 
47109     for (n_val = 0;n_val < gen_nb_xmlNodePtr;n_val++) {
47110         mem_base = xmlMemBlocks();
47111         val = gen_xmlNodePtr(n_val, 0);
47112 
47113         ret_val = xmlXPathNodeSetCreate(val);
47114         desret_xmlNodeSetPtr(ret_val);
47115         call_tests++;
47116         des_xmlNodePtr(n_val, val, 0);
47117         xmlResetLastError();
47118         if (mem_base != xmlMemBlocks()) {
47119             printf("Leak of %d blocks found in xmlXPathNodeSetCreate",
47120 	           xmlMemBlocks() - mem_base);
47121 	    test_ret++;
47122             printf(" %d", n_val);
47123             printf("\n");
47124         }
47125     }
47126     function_tests++;
47127 #endif
47128 
47129     return(test_ret);
47130 }
47131 
47132 
47133 static int
test_xmlXPathObjectCopy(void)47134 test_xmlXPathObjectCopy(void) {
47135     int test_ret = 0;
47136 
47137 #if defined(LIBXML_XPATH_ENABLED)
47138     int mem_base;
47139     xmlXPathObjectPtr ret_val;
47140     xmlXPathObjectPtr val; /* the original object */
47141     int n_val;
47142 
47143     for (n_val = 0;n_val < gen_nb_xmlXPathObjectPtr;n_val++) {
47144         mem_base = xmlMemBlocks();
47145         val = gen_xmlXPathObjectPtr(n_val, 0);
47146 
47147         ret_val = xmlXPathObjectCopy(val);
47148         desret_xmlXPathObjectPtr(ret_val);
47149         call_tests++;
47150         des_xmlXPathObjectPtr(n_val, val, 0);
47151         xmlResetLastError();
47152         if (mem_base != xmlMemBlocks()) {
47153             printf("Leak of %d blocks found in xmlXPathObjectCopy",
47154 	           xmlMemBlocks() - mem_base);
47155 	    test_ret++;
47156             printf(" %d", n_val);
47157             printf("\n");
47158         }
47159     }
47160     function_tests++;
47161 #endif
47162 
47163     return(test_ret);
47164 }
47165 
47166 
47167 static int
test_xmlXPathOrderDocElems(void)47168 test_xmlXPathOrderDocElems(void) {
47169     int test_ret = 0;
47170 
47171 #if defined(LIBXML_XPATH_ENABLED)
47172     int mem_base;
47173     long ret_val;
47174     xmlDocPtr doc; /* an input document */
47175     int n_doc;
47176 
47177     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
47178         mem_base = xmlMemBlocks();
47179         doc = gen_xmlDocPtr(n_doc, 0);
47180 
47181         ret_val = xmlXPathOrderDocElems(doc);
47182         desret_long(ret_val);
47183         call_tests++;
47184         des_xmlDocPtr(n_doc, doc, 0);
47185         xmlResetLastError();
47186         if (mem_base != xmlMemBlocks()) {
47187             printf("Leak of %d blocks found in xmlXPathOrderDocElems",
47188 	           xmlMemBlocks() - mem_base);
47189 	    test_ret++;
47190             printf(" %d", n_doc);
47191             printf("\n");
47192         }
47193     }
47194     function_tests++;
47195 #endif
47196 
47197     return(test_ret);
47198 }
47199 
47200 
47201 static int
test_xmlXPathSetContextNode(void)47202 test_xmlXPathSetContextNode(void) {
47203     int test_ret = 0;
47204 
47205 #if defined(LIBXML_XPATH_ENABLED)
47206     int mem_base;
47207     int ret_val;
47208     xmlNodePtr node; /* the node to to use as the context node */
47209     int n_node;
47210     xmlXPathContextPtr ctx; /* the XPath context */
47211     int n_ctx;
47212 
47213     for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
47214     for (n_ctx = 0;n_ctx < gen_nb_xmlXPathContextPtr;n_ctx++) {
47215         mem_base = xmlMemBlocks();
47216         node = gen_xmlNodePtr(n_node, 0);
47217         ctx = gen_xmlXPathContextPtr(n_ctx, 1);
47218 
47219         ret_val = xmlXPathSetContextNode(node, ctx);
47220         desret_int(ret_val);
47221         call_tests++;
47222         des_xmlNodePtr(n_node, node, 0);
47223         des_xmlXPathContextPtr(n_ctx, ctx, 1);
47224         xmlResetLastError();
47225         if (mem_base != xmlMemBlocks()) {
47226             printf("Leak of %d blocks found in xmlXPathSetContextNode",
47227 	           xmlMemBlocks() - mem_base);
47228 	    test_ret++;
47229             printf(" %d", n_node);
47230             printf(" %d", n_ctx);
47231             printf("\n");
47232         }
47233     }
47234     }
47235     function_tests++;
47236 #endif
47237 
47238     return(test_ret);
47239 }
47240 
47241 static int
test_xpath(void)47242 test_xpath(void) {
47243     int test_ret = 0;
47244 
47245     if (quiet == 0) printf("Testing xpath : 32 of 40 functions ...\n");
47246     test_ret += test_xmlXPathCastBooleanToNumber();
47247     test_ret += test_xmlXPathCastBooleanToString();
47248     test_ret += test_xmlXPathCastNodeSetToBoolean();
47249     test_ret += test_xmlXPathCastNodeSetToNumber();
47250     test_ret += test_xmlXPathCastNodeSetToString();
47251     test_ret += test_xmlXPathCastNodeToNumber();
47252     test_ret += test_xmlXPathCastNodeToString();
47253     test_ret += test_xmlXPathCastNumberToBoolean();
47254     test_ret += test_xmlXPathCastNumberToString();
47255     test_ret += test_xmlXPathCastStringToBoolean();
47256     test_ret += test_xmlXPathCastStringToNumber();
47257     test_ret += test_xmlXPathCastToBoolean();
47258     test_ret += test_xmlXPathCastToNumber();
47259     test_ret += test_xmlXPathCastToString();
47260     test_ret += test_xmlXPathCmpNodes();
47261     test_ret += test_xmlXPathCompile();
47262     test_ret += test_xmlXPathCompiledEval();
47263     test_ret += test_xmlXPathCompiledEvalToBoolean();
47264     test_ret += test_xmlXPathContextSetCache();
47265     test_ret += test_xmlXPathConvertBoolean();
47266     test_ret += test_xmlXPathConvertNumber();
47267     test_ret += test_xmlXPathConvertString();
47268     test_ret += test_xmlXPathCtxtCompile();
47269     test_ret += test_xmlXPathEval();
47270     test_ret += test_xmlXPathEvalExpression();
47271     test_ret += test_xmlXPathEvalPredicate();
47272     test_ret += test_xmlXPathInit();
47273     test_ret += test_xmlXPathIsInf();
47274     test_ret += test_xmlXPathIsNaN();
47275     test_ret += test_xmlXPathNewContext();
47276     test_ret += test_xmlXPathNodeEval();
47277     test_ret += test_xmlXPathNodeSetCreate();
47278     test_ret += test_xmlXPathObjectCopy();
47279     test_ret += test_xmlXPathOrderDocElems();
47280     test_ret += test_xmlXPathSetContextNode();
47281 
47282     if (test_ret != 0)
47283 	printf("Module xpath: %d errors\n", test_ret);
47284     return(test_ret);
47285 }
47286 #ifdef LIBXML_XPATH_ENABLED
47287 
47288 #define gen_nb_xmlXPathParserContextPtr 1
gen_xmlXPathParserContextPtr(int no ATTRIBUTE_UNUSED,int nr ATTRIBUTE_UNUSED)47289 static xmlXPathParserContextPtr gen_xmlXPathParserContextPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
47290     return(NULL);
47291 }
des_xmlXPathParserContextPtr(int no ATTRIBUTE_UNUSED,xmlXPathParserContextPtr val ATTRIBUTE_UNUSED,int nr ATTRIBUTE_UNUSED)47292 static void des_xmlXPathParserContextPtr(int no ATTRIBUTE_UNUSED, xmlXPathParserContextPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
47293 }
47294 #endif
47295 
47296 
47297 static int
test_valuePop(void)47298 test_valuePop(void) {
47299     int test_ret = 0;
47300 
47301 #if defined(LIBXML_XPATH_ENABLED)
47302     int mem_base;
47303     xmlXPathObjectPtr ret_val;
47304     xmlXPathParserContextPtr ctxt; /* an XPath evaluation context */
47305     int n_ctxt;
47306 
47307     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
47308         mem_base = xmlMemBlocks();
47309         ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
47310 
47311         ret_val = valuePop(ctxt);
47312         desret_xmlXPathObjectPtr(ret_val);
47313         call_tests++;
47314         des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
47315         xmlResetLastError();
47316         if (mem_base != xmlMemBlocks()) {
47317             printf("Leak of %d blocks found in valuePop",
47318 	           xmlMemBlocks() - mem_base);
47319 	    test_ret++;
47320             printf(" %d", n_ctxt);
47321             printf("\n");
47322         }
47323     }
47324     function_tests++;
47325 #endif
47326 
47327     return(test_ret);
47328 }
47329 
47330 
47331 static int
test_valuePush(void)47332 test_valuePush(void) {
47333     int test_ret = 0;
47334 
47335 #if defined(LIBXML_XPATH_ENABLED)
47336     int mem_base;
47337     int ret_val;
47338     xmlXPathParserContextPtr ctxt; /* an XPath evaluation context */
47339     int n_ctxt;
47340     xmlXPathObjectPtr value; /* the XPath object */
47341     int n_value;
47342 
47343     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
47344     for (n_value = 0;n_value < gen_nb_xmlXPathObjectPtr;n_value++) {
47345         mem_base = xmlMemBlocks();
47346         ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
47347         value = gen_xmlXPathObjectPtr(n_value, 1);
47348 
47349         ret_val = valuePush(ctxt, value);
47350         desret_int(ret_val);
47351         call_tests++;
47352         des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
47353         des_xmlXPathObjectPtr(n_value, value, 1);
47354         xmlResetLastError();
47355         if (mem_base != xmlMemBlocks()) {
47356             printf("Leak of %d blocks found in valuePush",
47357 	           xmlMemBlocks() - mem_base);
47358 	    test_ret++;
47359             printf(" %d", n_ctxt);
47360             printf(" %d", n_value);
47361             printf("\n");
47362         }
47363     }
47364     }
47365     function_tests++;
47366 #endif
47367 
47368     return(test_ret);
47369 }
47370 
47371 
47372 static int
test_xmlXPathAddValues(void)47373 test_xmlXPathAddValues(void) {
47374     int test_ret = 0;
47375 
47376 #if defined(LIBXML_XPATH_ENABLED)
47377     int mem_base;
47378     xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
47379     int n_ctxt;
47380 
47381     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
47382         mem_base = xmlMemBlocks();
47383         ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
47384 
47385         xmlXPathAddValues(ctxt);
47386         call_tests++;
47387         des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
47388         xmlResetLastError();
47389         if (mem_base != xmlMemBlocks()) {
47390             printf("Leak of %d blocks found in xmlXPathAddValues",
47391 	           xmlMemBlocks() - mem_base);
47392 	    test_ret++;
47393             printf(" %d", n_ctxt);
47394             printf("\n");
47395         }
47396     }
47397     function_tests++;
47398 #endif
47399 
47400     return(test_ret);
47401 }
47402 
47403 
47404 static int
test_xmlXPathBooleanFunction(void)47405 test_xmlXPathBooleanFunction(void) {
47406     int test_ret = 0;
47407 
47408 #if defined(LIBXML_XPATH_ENABLED)
47409     int mem_base;
47410     xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
47411     int n_ctxt;
47412     int nargs; /* the number of arguments */
47413     int n_nargs;
47414 
47415     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
47416     for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
47417         mem_base = xmlMemBlocks();
47418         ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
47419         nargs = gen_int(n_nargs, 1);
47420 
47421         xmlXPathBooleanFunction(ctxt, nargs);
47422         call_tests++;
47423         des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
47424         des_int(n_nargs, nargs, 1);
47425         xmlResetLastError();
47426         if (mem_base != xmlMemBlocks()) {
47427             printf("Leak of %d blocks found in xmlXPathBooleanFunction",
47428 	           xmlMemBlocks() - mem_base);
47429 	    test_ret++;
47430             printf(" %d", n_ctxt);
47431             printf(" %d", n_nargs);
47432             printf("\n");
47433         }
47434     }
47435     }
47436     function_tests++;
47437 #endif
47438 
47439     return(test_ret);
47440 }
47441 
47442 
47443 static int
test_xmlXPathCeilingFunction(void)47444 test_xmlXPathCeilingFunction(void) {
47445     int test_ret = 0;
47446 
47447 #if defined(LIBXML_XPATH_ENABLED)
47448     int mem_base;
47449     xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
47450     int n_ctxt;
47451     int nargs; /* the number of arguments */
47452     int n_nargs;
47453 
47454     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
47455     for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
47456         mem_base = xmlMemBlocks();
47457         ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
47458         nargs = gen_int(n_nargs, 1);
47459 
47460         xmlXPathCeilingFunction(ctxt, nargs);
47461         call_tests++;
47462         des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
47463         des_int(n_nargs, nargs, 1);
47464         xmlResetLastError();
47465         if (mem_base != xmlMemBlocks()) {
47466             printf("Leak of %d blocks found in xmlXPathCeilingFunction",
47467 	           xmlMemBlocks() - mem_base);
47468 	    test_ret++;
47469             printf(" %d", n_ctxt);
47470             printf(" %d", n_nargs);
47471             printf("\n");
47472         }
47473     }
47474     }
47475     function_tests++;
47476 #endif
47477 
47478     return(test_ret);
47479 }
47480 
47481 
47482 static int
test_xmlXPathCompareValues(void)47483 test_xmlXPathCompareValues(void) {
47484     int test_ret = 0;
47485 
47486 #if defined(LIBXML_XPATH_ENABLED)
47487     int mem_base;
47488     int ret_val;
47489     xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
47490     int n_ctxt;
47491     int inf; /* less than (1) or greater than (0) */
47492     int n_inf;
47493     int strict; /* is the comparison strict */
47494     int n_strict;
47495 
47496     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
47497     for (n_inf = 0;n_inf < gen_nb_int;n_inf++) {
47498     for (n_strict = 0;n_strict < gen_nb_int;n_strict++) {
47499         mem_base = xmlMemBlocks();
47500         ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
47501         inf = gen_int(n_inf, 1);
47502         strict = gen_int(n_strict, 2);
47503 
47504         ret_val = xmlXPathCompareValues(ctxt, inf, strict);
47505         desret_int(ret_val);
47506         call_tests++;
47507         des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
47508         des_int(n_inf, inf, 1);
47509         des_int(n_strict, strict, 2);
47510         xmlResetLastError();
47511         if (mem_base != xmlMemBlocks()) {
47512             printf("Leak of %d blocks found in xmlXPathCompareValues",
47513 	           xmlMemBlocks() - mem_base);
47514 	    test_ret++;
47515             printf(" %d", n_ctxt);
47516             printf(" %d", n_inf);
47517             printf(" %d", n_strict);
47518             printf("\n");
47519         }
47520     }
47521     }
47522     }
47523     function_tests++;
47524 #endif
47525 
47526     return(test_ret);
47527 }
47528 
47529 
47530 static int
test_xmlXPathConcatFunction(void)47531 test_xmlXPathConcatFunction(void) {
47532     int test_ret = 0;
47533 
47534 #if defined(LIBXML_XPATH_ENABLED)
47535     int mem_base;
47536     xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
47537     int n_ctxt;
47538     int nargs; /* the number of arguments */
47539     int n_nargs;
47540 
47541     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
47542     for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
47543         mem_base = xmlMemBlocks();
47544         ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
47545         nargs = gen_int(n_nargs, 1);
47546 
47547         xmlXPathConcatFunction(ctxt, nargs);
47548         call_tests++;
47549         des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
47550         des_int(n_nargs, nargs, 1);
47551         xmlResetLastError();
47552         if (mem_base != xmlMemBlocks()) {
47553             printf("Leak of %d blocks found in xmlXPathConcatFunction",
47554 	           xmlMemBlocks() - mem_base);
47555 	    test_ret++;
47556             printf(" %d", n_ctxt);
47557             printf(" %d", n_nargs);
47558             printf("\n");
47559         }
47560     }
47561     }
47562     function_tests++;
47563 #endif
47564 
47565     return(test_ret);
47566 }
47567 
47568 
47569 static int
test_xmlXPathContainsFunction(void)47570 test_xmlXPathContainsFunction(void) {
47571     int test_ret = 0;
47572 
47573 #if defined(LIBXML_XPATH_ENABLED)
47574     int mem_base;
47575     xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
47576     int n_ctxt;
47577     int nargs; /* the number of arguments */
47578     int n_nargs;
47579 
47580     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
47581     for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
47582         mem_base = xmlMemBlocks();
47583         ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
47584         nargs = gen_int(n_nargs, 1);
47585 
47586         xmlXPathContainsFunction(ctxt, nargs);
47587         call_tests++;
47588         des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
47589         des_int(n_nargs, nargs, 1);
47590         xmlResetLastError();
47591         if (mem_base != xmlMemBlocks()) {
47592             printf("Leak of %d blocks found in xmlXPathContainsFunction",
47593 	           xmlMemBlocks() - mem_base);
47594 	    test_ret++;
47595             printf(" %d", n_ctxt);
47596             printf(" %d", n_nargs);
47597             printf("\n");
47598         }
47599     }
47600     }
47601     function_tests++;
47602 #endif
47603 
47604     return(test_ret);
47605 }
47606 
47607 
47608 static int
test_xmlXPathCountFunction(void)47609 test_xmlXPathCountFunction(void) {
47610     int test_ret = 0;
47611 
47612 #if defined(LIBXML_XPATH_ENABLED)
47613     int mem_base;
47614     xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
47615     int n_ctxt;
47616     int nargs; /* the number of arguments */
47617     int n_nargs;
47618 
47619     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
47620     for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
47621         mem_base = xmlMemBlocks();
47622         ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
47623         nargs = gen_int(n_nargs, 1);
47624 
47625         xmlXPathCountFunction(ctxt, nargs);
47626         call_tests++;
47627         des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
47628         des_int(n_nargs, nargs, 1);
47629         xmlResetLastError();
47630         if (mem_base != xmlMemBlocks()) {
47631             printf("Leak of %d blocks found in xmlXPathCountFunction",
47632 	           xmlMemBlocks() - mem_base);
47633 	    test_ret++;
47634             printf(" %d", n_ctxt);
47635             printf(" %d", n_nargs);
47636             printf("\n");
47637         }
47638     }
47639     }
47640     function_tests++;
47641 #endif
47642 
47643     return(test_ret);
47644 }
47645 
47646 
47647 static int
test_xmlXPathDebugDumpCompExpr(void)47648 test_xmlXPathDebugDumpCompExpr(void) {
47649     int test_ret = 0;
47650 
47651 #if defined(LIBXML_XPATH_ENABLED) && defined(LIBXML_DEBUG_ENABLED)
47652     int mem_base;
47653     FILE * output; /* the FILE * for the output */
47654     int n_output;
47655     xmlXPathCompExprPtr comp; /* the precompiled XPath expression */
47656     int n_comp;
47657     int depth; /* the indentation level. */
47658     int n_depth;
47659 
47660     for (n_output = 0;n_output < gen_nb_FILE_ptr;n_output++) {
47661     for (n_comp = 0;n_comp < gen_nb_xmlXPathCompExprPtr;n_comp++) {
47662     for (n_depth = 0;n_depth < gen_nb_int;n_depth++) {
47663         mem_base = xmlMemBlocks();
47664         output = gen_FILE_ptr(n_output, 0);
47665         comp = gen_xmlXPathCompExprPtr(n_comp, 1);
47666         depth = gen_int(n_depth, 2);
47667 
47668         xmlXPathDebugDumpCompExpr(output, comp, depth);
47669         call_tests++;
47670         des_FILE_ptr(n_output, output, 0);
47671         des_xmlXPathCompExprPtr(n_comp, comp, 1);
47672         des_int(n_depth, depth, 2);
47673         xmlResetLastError();
47674         if (mem_base != xmlMemBlocks()) {
47675             printf("Leak of %d blocks found in xmlXPathDebugDumpCompExpr",
47676 	           xmlMemBlocks() - mem_base);
47677 	    test_ret++;
47678             printf(" %d", n_output);
47679             printf(" %d", n_comp);
47680             printf(" %d", n_depth);
47681             printf("\n");
47682         }
47683     }
47684     }
47685     }
47686     function_tests++;
47687 #endif
47688 
47689     return(test_ret);
47690 }
47691 
47692 
47693 static int
test_xmlXPathDebugDumpObject(void)47694 test_xmlXPathDebugDumpObject(void) {
47695     int test_ret = 0;
47696 
47697 #if defined(LIBXML_XPATH_ENABLED) && defined(LIBXML_DEBUG_ENABLED)
47698     int mem_base;
47699     FILE * output; /* the FILE * to dump the output */
47700     int n_output;
47701     xmlXPathObjectPtr cur; /* the object to inspect */
47702     int n_cur;
47703     int depth; /* indentation level */
47704     int n_depth;
47705 
47706     for (n_output = 0;n_output < gen_nb_FILE_ptr;n_output++) {
47707     for (n_cur = 0;n_cur < gen_nb_xmlXPathObjectPtr;n_cur++) {
47708     for (n_depth = 0;n_depth < gen_nb_int;n_depth++) {
47709         mem_base = xmlMemBlocks();
47710         output = gen_FILE_ptr(n_output, 0);
47711         cur = gen_xmlXPathObjectPtr(n_cur, 1);
47712         depth = gen_int(n_depth, 2);
47713 
47714         xmlXPathDebugDumpObject(output, cur, depth);
47715         call_tests++;
47716         des_FILE_ptr(n_output, output, 0);
47717         des_xmlXPathObjectPtr(n_cur, cur, 1);
47718         des_int(n_depth, depth, 2);
47719         xmlResetLastError();
47720         if (mem_base != xmlMemBlocks()) {
47721             printf("Leak of %d blocks found in xmlXPathDebugDumpObject",
47722 	           xmlMemBlocks() - mem_base);
47723 	    test_ret++;
47724             printf(" %d", n_output);
47725             printf(" %d", n_cur);
47726             printf(" %d", n_depth);
47727             printf("\n");
47728         }
47729     }
47730     }
47731     }
47732     function_tests++;
47733 #endif
47734 
47735     return(test_ret);
47736 }
47737 
47738 
47739 static int
test_xmlXPathDifference(void)47740 test_xmlXPathDifference(void) {
47741     int test_ret = 0;
47742 
47743 #if defined(LIBXML_XPATH_ENABLED)
47744     int mem_base;
47745     xmlNodeSetPtr ret_val;
47746     xmlNodeSetPtr nodes1; /* a node-set */
47747     int n_nodes1;
47748     xmlNodeSetPtr nodes2; /* a node-set */
47749     int n_nodes2;
47750 
47751     for (n_nodes1 = 0;n_nodes1 < gen_nb_xmlNodeSetPtr;n_nodes1++) {
47752     for (n_nodes2 = 0;n_nodes2 < gen_nb_xmlNodeSetPtr;n_nodes2++) {
47753         mem_base = xmlMemBlocks();
47754         nodes1 = gen_xmlNodeSetPtr(n_nodes1, 0);
47755         nodes2 = gen_xmlNodeSetPtr(n_nodes2, 1);
47756 
47757         ret_val = xmlXPathDifference(nodes1, nodes2);
47758         desret_xmlNodeSetPtr(ret_val);
47759         call_tests++;
47760         des_xmlNodeSetPtr(n_nodes1, nodes1, 0);
47761         des_xmlNodeSetPtr(n_nodes2, nodes2, 1);
47762         xmlResetLastError();
47763         if (mem_base != xmlMemBlocks()) {
47764             printf("Leak of %d blocks found in xmlXPathDifference",
47765 	           xmlMemBlocks() - mem_base);
47766 	    test_ret++;
47767             printf(" %d", n_nodes1);
47768             printf(" %d", n_nodes2);
47769             printf("\n");
47770         }
47771     }
47772     }
47773     function_tests++;
47774 #endif
47775 
47776     return(test_ret);
47777 }
47778 
47779 
47780 static int
test_xmlXPathDistinct(void)47781 test_xmlXPathDistinct(void) {
47782     int test_ret = 0;
47783 
47784 #if defined(LIBXML_XPATH_ENABLED)
47785     int mem_base;
47786     xmlNodeSetPtr ret_val;
47787     xmlNodeSetPtr nodes; /* a node-set */
47788     int n_nodes;
47789 
47790     for (n_nodes = 0;n_nodes < gen_nb_xmlNodeSetPtr;n_nodes++) {
47791         mem_base = xmlMemBlocks();
47792         nodes = gen_xmlNodeSetPtr(n_nodes, 0);
47793 
47794         ret_val = xmlXPathDistinct(nodes);
47795         desret_xmlNodeSetPtr(ret_val);
47796         call_tests++;
47797         des_xmlNodeSetPtr(n_nodes, nodes, 0);
47798         xmlResetLastError();
47799         if (mem_base != xmlMemBlocks()) {
47800             printf("Leak of %d blocks found in xmlXPathDistinct",
47801 	           xmlMemBlocks() - mem_base);
47802 	    test_ret++;
47803             printf(" %d", n_nodes);
47804             printf("\n");
47805         }
47806     }
47807     function_tests++;
47808 #endif
47809 
47810     return(test_ret);
47811 }
47812 
47813 
47814 static int
test_xmlXPathDistinctSorted(void)47815 test_xmlXPathDistinctSorted(void) {
47816     int test_ret = 0;
47817 
47818 #if defined(LIBXML_XPATH_ENABLED)
47819     int mem_base;
47820     xmlNodeSetPtr ret_val;
47821     xmlNodeSetPtr nodes; /* a node-set, sorted by document order */
47822     int n_nodes;
47823 
47824     for (n_nodes = 0;n_nodes < gen_nb_xmlNodeSetPtr;n_nodes++) {
47825         mem_base = xmlMemBlocks();
47826         nodes = gen_xmlNodeSetPtr(n_nodes, 0);
47827 
47828         ret_val = xmlXPathDistinctSorted(nodes);
47829         desret_xmlNodeSetPtr(ret_val);
47830         call_tests++;
47831         des_xmlNodeSetPtr(n_nodes, nodes, 0);
47832         xmlResetLastError();
47833         if (mem_base != xmlMemBlocks()) {
47834             printf("Leak of %d blocks found in xmlXPathDistinctSorted",
47835 	           xmlMemBlocks() - mem_base);
47836 	    test_ret++;
47837             printf(" %d", n_nodes);
47838             printf("\n");
47839         }
47840     }
47841     function_tests++;
47842 #endif
47843 
47844     return(test_ret);
47845 }
47846 
47847 
47848 static int
test_xmlXPathDivValues(void)47849 test_xmlXPathDivValues(void) {
47850     int test_ret = 0;
47851 
47852 #if defined(LIBXML_XPATH_ENABLED)
47853     int mem_base;
47854     xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
47855     int n_ctxt;
47856 
47857     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
47858         mem_base = xmlMemBlocks();
47859         ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
47860 
47861         xmlXPathDivValues(ctxt);
47862         call_tests++;
47863         des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
47864         xmlResetLastError();
47865         if (mem_base != xmlMemBlocks()) {
47866             printf("Leak of %d blocks found in xmlXPathDivValues",
47867 	           xmlMemBlocks() - mem_base);
47868 	    test_ret++;
47869             printf(" %d", n_ctxt);
47870             printf("\n");
47871         }
47872     }
47873     function_tests++;
47874 #endif
47875 
47876     return(test_ret);
47877 }
47878 
47879 
47880 static int
test_xmlXPathEqualValues(void)47881 test_xmlXPathEqualValues(void) {
47882     int test_ret = 0;
47883 
47884 #if defined(LIBXML_XPATH_ENABLED)
47885     int mem_base;
47886     int ret_val;
47887     xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
47888     int n_ctxt;
47889 
47890     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
47891         mem_base = xmlMemBlocks();
47892         ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
47893 
47894         ret_val = xmlXPathEqualValues(ctxt);
47895         desret_int(ret_val);
47896         call_tests++;
47897         des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
47898         xmlResetLastError();
47899         if (mem_base != xmlMemBlocks()) {
47900             printf("Leak of %d blocks found in xmlXPathEqualValues",
47901 	           xmlMemBlocks() - mem_base);
47902 	    test_ret++;
47903             printf(" %d", n_ctxt);
47904             printf("\n");
47905         }
47906     }
47907     function_tests++;
47908 #endif
47909 
47910     return(test_ret);
47911 }
47912 
47913 
47914 static int
test_xmlXPathErr(void)47915 test_xmlXPathErr(void) {
47916     int test_ret = 0;
47917 
47918 #if defined(LIBXML_XPATH_ENABLED)
47919     int mem_base;
47920     xmlXPathParserContextPtr ctxt; /* a XPath parser context */
47921     int n_ctxt;
47922     int error; /* the error code */
47923     int n_error;
47924 
47925     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
47926     for (n_error = 0;n_error < gen_nb_int;n_error++) {
47927         mem_base = xmlMemBlocks();
47928         ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
47929         error = gen_int(n_error, 1);
47930 
47931         xmlXPathErr(ctxt, error);
47932         call_tests++;
47933         des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
47934         des_int(n_error, error, 1);
47935         xmlResetLastError();
47936         if (mem_base != xmlMemBlocks()) {
47937             printf("Leak of %d blocks found in xmlXPathErr",
47938 	           xmlMemBlocks() - mem_base);
47939 	    test_ret++;
47940             printf(" %d", n_ctxt);
47941             printf(" %d", n_error);
47942             printf("\n");
47943         }
47944     }
47945     }
47946     function_tests++;
47947 #endif
47948 
47949     return(test_ret);
47950 }
47951 
47952 
47953 static int
test_xmlXPathEvalExpr(void)47954 test_xmlXPathEvalExpr(void) {
47955     int test_ret = 0;
47956 
47957 #if defined(LIBXML_XPATH_ENABLED)
47958     int mem_base;
47959     xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
47960     int n_ctxt;
47961 
47962     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
47963         mem_base = xmlMemBlocks();
47964         ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
47965 
47966         xmlXPathEvalExpr(ctxt);
47967         call_tests++;
47968         des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
47969         xmlResetLastError();
47970         if (mem_base != xmlMemBlocks()) {
47971             printf("Leak of %d blocks found in xmlXPathEvalExpr",
47972 	           xmlMemBlocks() - mem_base);
47973 	    test_ret++;
47974             printf(" %d", n_ctxt);
47975             printf("\n");
47976         }
47977     }
47978     function_tests++;
47979 #endif
47980 
47981     return(test_ret);
47982 }
47983 
47984 
47985 static int
test_xmlXPathEvaluatePredicateResult(void)47986 test_xmlXPathEvaluatePredicateResult(void) {
47987     int test_ret = 0;
47988 
47989 #if defined(LIBXML_XPATH_ENABLED)
47990     int mem_base;
47991     int ret_val;
47992     xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
47993     int n_ctxt;
47994     xmlXPathObjectPtr res; /* the Predicate Expression evaluation result */
47995     int n_res;
47996 
47997     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
47998     for (n_res = 0;n_res < gen_nb_xmlXPathObjectPtr;n_res++) {
47999         mem_base = xmlMemBlocks();
48000         ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
48001         res = gen_xmlXPathObjectPtr(n_res, 1);
48002 
48003         ret_val = xmlXPathEvaluatePredicateResult(ctxt, res);
48004         desret_int(ret_val);
48005         call_tests++;
48006         des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
48007         des_xmlXPathObjectPtr(n_res, res, 1);
48008         xmlResetLastError();
48009         if (mem_base != xmlMemBlocks()) {
48010             printf("Leak of %d blocks found in xmlXPathEvaluatePredicateResult",
48011 	           xmlMemBlocks() - mem_base);
48012 	    test_ret++;
48013             printf(" %d", n_ctxt);
48014             printf(" %d", n_res);
48015             printf("\n");
48016         }
48017     }
48018     }
48019     function_tests++;
48020 #endif
48021 
48022     return(test_ret);
48023 }
48024 
48025 
48026 static int
test_xmlXPathFalseFunction(void)48027 test_xmlXPathFalseFunction(void) {
48028     int test_ret = 0;
48029 
48030 #if defined(LIBXML_XPATH_ENABLED)
48031     int mem_base;
48032     xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
48033     int n_ctxt;
48034     int nargs; /* the number of arguments */
48035     int n_nargs;
48036 
48037     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
48038     for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
48039         mem_base = xmlMemBlocks();
48040         ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
48041         nargs = gen_int(n_nargs, 1);
48042 
48043         xmlXPathFalseFunction(ctxt, nargs);
48044         call_tests++;
48045         des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
48046         des_int(n_nargs, nargs, 1);
48047         xmlResetLastError();
48048         if (mem_base != xmlMemBlocks()) {
48049             printf("Leak of %d blocks found in xmlXPathFalseFunction",
48050 	           xmlMemBlocks() - mem_base);
48051 	    test_ret++;
48052             printf(" %d", n_ctxt);
48053             printf(" %d", n_nargs);
48054             printf("\n");
48055         }
48056     }
48057     }
48058     function_tests++;
48059 #endif
48060 
48061     return(test_ret);
48062 }
48063 
48064 
48065 static int
test_xmlXPathFloorFunction(void)48066 test_xmlXPathFloorFunction(void) {
48067     int test_ret = 0;
48068 
48069 #if defined(LIBXML_XPATH_ENABLED)
48070     int mem_base;
48071     xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
48072     int n_ctxt;
48073     int nargs; /* the number of arguments */
48074     int n_nargs;
48075 
48076     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
48077     for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
48078         mem_base = xmlMemBlocks();
48079         ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
48080         nargs = gen_int(n_nargs, 1);
48081 
48082         xmlXPathFloorFunction(ctxt, nargs);
48083         call_tests++;
48084         des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
48085         des_int(n_nargs, nargs, 1);
48086         xmlResetLastError();
48087         if (mem_base != xmlMemBlocks()) {
48088             printf("Leak of %d blocks found in xmlXPathFloorFunction",
48089 	           xmlMemBlocks() - mem_base);
48090 	    test_ret++;
48091             printf(" %d", n_ctxt);
48092             printf(" %d", n_nargs);
48093             printf("\n");
48094         }
48095     }
48096     }
48097     function_tests++;
48098 #endif
48099 
48100     return(test_ret);
48101 }
48102 
48103 
48104 static int
test_xmlXPathFunctionLookup(void)48105 test_xmlXPathFunctionLookup(void) {
48106     int test_ret = 0;
48107 
48108 
48109     /* missing type support */
48110     return(test_ret);
48111 }
48112 
48113 
48114 static int
test_xmlXPathFunctionLookupNS(void)48115 test_xmlXPathFunctionLookupNS(void) {
48116     int test_ret = 0;
48117 
48118 
48119     /* missing type support */
48120     return(test_ret);
48121 }
48122 
48123 
48124 static int
test_xmlXPathHasSameNodes(void)48125 test_xmlXPathHasSameNodes(void) {
48126     int test_ret = 0;
48127 
48128 #if defined(LIBXML_XPATH_ENABLED)
48129     int mem_base;
48130     int ret_val;
48131     xmlNodeSetPtr nodes1; /* a node-set */
48132     int n_nodes1;
48133     xmlNodeSetPtr nodes2; /* a node-set */
48134     int n_nodes2;
48135 
48136     for (n_nodes1 = 0;n_nodes1 < gen_nb_xmlNodeSetPtr;n_nodes1++) {
48137     for (n_nodes2 = 0;n_nodes2 < gen_nb_xmlNodeSetPtr;n_nodes2++) {
48138         mem_base = xmlMemBlocks();
48139         nodes1 = gen_xmlNodeSetPtr(n_nodes1, 0);
48140         nodes2 = gen_xmlNodeSetPtr(n_nodes2, 1);
48141 
48142         ret_val = xmlXPathHasSameNodes(nodes1, nodes2);
48143         desret_int(ret_val);
48144         call_tests++;
48145         des_xmlNodeSetPtr(n_nodes1, nodes1, 0);
48146         des_xmlNodeSetPtr(n_nodes2, nodes2, 1);
48147         xmlResetLastError();
48148         if (mem_base != xmlMemBlocks()) {
48149             printf("Leak of %d blocks found in xmlXPathHasSameNodes",
48150 	           xmlMemBlocks() - mem_base);
48151 	    test_ret++;
48152             printf(" %d", n_nodes1);
48153             printf(" %d", n_nodes2);
48154             printf("\n");
48155         }
48156     }
48157     }
48158     function_tests++;
48159 #endif
48160 
48161     return(test_ret);
48162 }
48163 
48164 
48165 static int
test_xmlXPathIdFunction(void)48166 test_xmlXPathIdFunction(void) {
48167     int test_ret = 0;
48168 
48169 #if defined(LIBXML_XPATH_ENABLED)
48170     int mem_base;
48171     xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
48172     int n_ctxt;
48173     int nargs; /* the number of arguments */
48174     int n_nargs;
48175 
48176     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
48177     for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
48178         mem_base = xmlMemBlocks();
48179         ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
48180         nargs = gen_int(n_nargs, 1);
48181 
48182         xmlXPathIdFunction(ctxt, nargs);
48183         call_tests++;
48184         des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
48185         des_int(n_nargs, nargs, 1);
48186         xmlResetLastError();
48187         if (mem_base != xmlMemBlocks()) {
48188             printf("Leak of %d blocks found in xmlXPathIdFunction",
48189 	           xmlMemBlocks() - mem_base);
48190 	    test_ret++;
48191             printf(" %d", n_ctxt);
48192             printf(" %d", n_nargs);
48193             printf("\n");
48194         }
48195     }
48196     }
48197     function_tests++;
48198 #endif
48199 
48200     return(test_ret);
48201 }
48202 
48203 
48204 static int
test_xmlXPathIntersection(void)48205 test_xmlXPathIntersection(void) {
48206     int test_ret = 0;
48207 
48208 #if defined(LIBXML_XPATH_ENABLED)
48209     int mem_base;
48210     xmlNodeSetPtr ret_val;
48211     xmlNodeSetPtr nodes1; /* a node-set */
48212     int n_nodes1;
48213     xmlNodeSetPtr nodes2; /* a node-set */
48214     int n_nodes2;
48215 
48216     for (n_nodes1 = 0;n_nodes1 < gen_nb_xmlNodeSetPtr;n_nodes1++) {
48217     for (n_nodes2 = 0;n_nodes2 < gen_nb_xmlNodeSetPtr;n_nodes2++) {
48218         mem_base = xmlMemBlocks();
48219         nodes1 = gen_xmlNodeSetPtr(n_nodes1, 0);
48220         nodes2 = gen_xmlNodeSetPtr(n_nodes2, 1);
48221 
48222         ret_val = xmlXPathIntersection(nodes1, nodes2);
48223         desret_xmlNodeSetPtr(ret_val);
48224         call_tests++;
48225         des_xmlNodeSetPtr(n_nodes1, nodes1, 0);
48226         des_xmlNodeSetPtr(n_nodes2, nodes2, 1);
48227         xmlResetLastError();
48228         if (mem_base != xmlMemBlocks()) {
48229             printf("Leak of %d blocks found in xmlXPathIntersection",
48230 	           xmlMemBlocks() - mem_base);
48231 	    test_ret++;
48232             printf(" %d", n_nodes1);
48233             printf(" %d", n_nodes2);
48234             printf("\n");
48235         }
48236     }
48237     }
48238     function_tests++;
48239 #endif
48240 
48241     return(test_ret);
48242 }
48243 
48244 
48245 static int
test_xmlXPathIsNodeType(void)48246 test_xmlXPathIsNodeType(void) {
48247     int test_ret = 0;
48248 
48249 #if defined(LIBXML_XPATH_ENABLED)
48250     int mem_base;
48251     int ret_val;
48252     xmlChar * name; /* a name string */
48253     int n_name;
48254 
48255     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
48256         mem_base = xmlMemBlocks();
48257         name = gen_const_xmlChar_ptr(n_name, 0);
48258 
48259         ret_val = xmlXPathIsNodeType((const xmlChar *)name);
48260         desret_int(ret_val);
48261         call_tests++;
48262         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 0);
48263         xmlResetLastError();
48264         if (mem_base != xmlMemBlocks()) {
48265             printf("Leak of %d blocks found in xmlXPathIsNodeType",
48266 	           xmlMemBlocks() - mem_base);
48267 	    test_ret++;
48268             printf(" %d", n_name);
48269             printf("\n");
48270         }
48271     }
48272     function_tests++;
48273 #endif
48274 
48275     return(test_ret);
48276 }
48277 
48278 
48279 static int
test_xmlXPathLangFunction(void)48280 test_xmlXPathLangFunction(void) {
48281     int test_ret = 0;
48282 
48283 #if defined(LIBXML_XPATH_ENABLED)
48284     int mem_base;
48285     xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
48286     int n_ctxt;
48287     int nargs; /* the number of arguments */
48288     int n_nargs;
48289 
48290     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
48291     for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
48292         mem_base = xmlMemBlocks();
48293         ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
48294         nargs = gen_int(n_nargs, 1);
48295 
48296         xmlXPathLangFunction(ctxt, nargs);
48297         call_tests++;
48298         des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
48299         des_int(n_nargs, nargs, 1);
48300         xmlResetLastError();
48301         if (mem_base != xmlMemBlocks()) {
48302             printf("Leak of %d blocks found in xmlXPathLangFunction",
48303 	           xmlMemBlocks() - mem_base);
48304 	    test_ret++;
48305             printf(" %d", n_ctxt);
48306             printf(" %d", n_nargs);
48307             printf("\n");
48308         }
48309     }
48310     }
48311     function_tests++;
48312 #endif
48313 
48314     return(test_ret);
48315 }
48316 
48317 
48318 static int
test_xmlXPathLastFunction(void)48319 test_xmlXPathLastFunction(void) {
48320     int test_ret = 0;
48321 
48322 #if defined(LIBXML_XPATH_ENABLED)
48323     int mem_base;
48324     xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
48325     int n_ctxt;
48326     int nargs; /* the number of arguments */
48327     int n_nargs;
48328 
48329     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
48330     for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
48331         mem_base = xmlMemBlocks();
48332         ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
48333         nargs = gen_int(n_nargs, 1);
48334 
48335         xmlXPathLastFunction(ctxt, nargs);
48336         call_tests++;
48337         des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
48338         des_int(n_nargs, nargs, 1);
48339         xmlResetLastError();
48340         if (mem_base != xmlMemBlocks()) {
48341             printf("Leak of %d blocks found in xmlXPathLastFunction",
48342 	           xmlMemBlocks() - mem_base);
48343 	    test_ret++;
48344             printf(" %d", n_ctxt);
48345             printf(" %d", n_nargs);
48346             printf("\n");
48347         }
48348     }
48349     }
48350     function_tests++;
48351 #endif
48352 
48353     return(test_ret);
48354 }
48355 
48356 
48357 static int
test_xmlXPathLeading(void)48358 test_xmlXPathLeading(void) {
48359     int test_ret = 0;
48360 
48361 #if defined(LIBXML_XPATH_ENABLED)
48362     int mem_base;
48363     xmlNodeSetPtr ret_val;
48364     xmlNodeSetPtr nodes1; /* a node-set */
48365     int n_nodes1;
48366     xmlNodeSetPtr nodes2; /* a node-set */
48367     int n_nodes2;
48368 
48369     for (n_nodes1 = 0;n_nodes1 < gen_nb_xmlNodeSetPtr;n_nodes1++) {
48370     for (n_nodes2 = 0;n_nodes2 < gen_nb_xmlNodeSetPtr;n_nodes2++) {
48371         mem_base = xmlMemBlocks();
48372         nodes1 = gen_xmlNodeSetPtr(n_nodes1, 0);
48373         nodes2 = gen_xmlNodeSetPtr(n_nodes2, 1);
48374 
48375         ret_val = xmlXPathLeading(nodes1, nodes2);
48376         desret_xmlNodeSetPtr(ret_val);
48377         call_tests++;
48378         des_xmlNodeSetPtr(n_nodes1, nodes1, 0);
48379         des_xmlNodeSetPtr(n_nodes2, nodes2, 1);
48380         xmlResetLastError();
48381         if (mem_base != xmlMemBlocks()) {
48382             printf("Leak of %d blocks found in xmlXPathLeading",
48383 	           xmlMemBlocks() - mem_base);
48384 	    test_ret++;
48385             printf(" %d", n_nodes1);
48386             printf(" %d", n_nodes2);
48387             printf("\n");
48388         }
48389     }
48390     }
48391     function_tests++;
48392 #endif
48393 
48394     return(test_ret);
48395 }
48396 
48397 
48398 static int
test_xmlXPathLeadingSorted(void)48399 test_xmlXPathLeadingSorted(void) {
48400     int test_ret = 0;
48401 
48402 #if defined(LIBXML_XPATH_ENABLED)
48403     int mem_base;
48404     xmlNodeSetPtr ret_val;
48405     xmlNodeSetPtr nodes1; /* a node-set, sorted by document order */
48406     int n_nodes1;
48407     xmlNodeSetPtr nodes2; /* a node-set, sorted by document order */
48408     int n_nodes2;
48409 
48410     for (n_nodes1 = 0;n_nodes1 < gen_nb_xmlNodeSetPtr;n_nodes1++) {
48411     for (n_nodes2 = 0;n_nodes2 < gen_nb_xmlNodeSetPtr;n_nodes2++) {
48412         mem_base = xmlMemBlocks();
48413         nodes1 = gen_xmlNodeSetPtr(n_nodes1, 0);
48414         nodes2 = gen_xmlNodeSetPtr(n_nodes2, 1);
48415 
48416         ret_val = xmlXPathLeadingSorted(nodes1, nodes2);
48417         desret_xmlNodeSetPtr(ret_val);
48418         call_tests++;
48419         des_xmlNodeSetPtr(n_nodes1, nodes1, 0);
48420         des_xmlNodeSetPtr(n_nodes2, nodes2, 1);
48421         xmlResetLastError();
48422         if (mem_base != xmlMemBlocks()) {
48423             printf("Leak of %d blocks found in xmlXPathLeadingSorted",
48424 	           xmlMemBlocks() - mem_base);
48425 	    test_ret++;
48426             printf(" %d", n_nodes1);
48427             printf(" %d", n_nodes2);
48428             printf("\n");
48429         }
48430     }
48431     }
48432     function_tests++;
48433 #endif
48434 
48435     return(test_ret);
48436 }
48437 
48438 
48439 static int
test_xmlXPathLocalNameFunction(void)48440 test_xmlXPathLocalNameFunction(void) {
48441     int test_ret = 0;
48442 
48443 #if defined(LIBXML_XPATH_ENABLED)
48444     int mem_base;
48445     xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
48446     int n_ctxt;
48447     int nargs; /* the number of arguments */
48448     int n_nargs;
48449 
48450     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
48451     for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
48452         mem_base = xmlMemBlocks();
48453         ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
48454         nargs = gen_int(n_nargs, 1);
48455 
48456         xmlXPathLocalNameFunction(ctxt, nargs);
48457         call_tests++;
48458         des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
48459         des_int(n_nargs, nargs, 1);
48460         xmlResetLastError();
48461         if (mem_base != xmlMemBlocks()) {
48462             printf("Leak of %d blocks found in xmlXPathLocalNameFunction",
48463 	           xmlMemBlocks() - mem_base);
48464 	    test_ret++;
48465             printf(" %d", n_ctxt);
48466             printf(" %d", n_nargs);
48467             printf("\n");
48468         }
48469     }
48470     }
48471     function_tests++;
48472 #endif
48473 
48474     return(test_ret);
48475 }
48476 
48477 
48478 static int
test_xmlXPathModValues(void)48479 test_xmlXPathModValues(void) {
48480     int test_ret = 0;
48481 
48482 #if defined(LIBXML_XPATH_ENABLED)
48483     int mem_base;
48484     xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
48485     int n_ctxt;
48486 
48487     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
48488         mem_base = xmlMemBlocks();
48489         ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
48490 
48491         xmlXPathModValues(ctxt);
48492         call_tests++;
48493         des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
48494         xmlResetLastError();
48495         if (mem_base != xmlMemBlocks()) {
48496             printf("Leak of %d blocks found in xmlXPathModValues",
48497 	           xmlMemBlocks() - mem_base);
48498 	    test_ret++;
48499             printf(" %d", n_ctxt);
48500             printf("\n");
48501         }
48502     }
48503     function_tests++;
48504 #endif
48505 
48506     return(test_ret);
48507 }
48508 
48509 
48510 static int
test_xmlXPathMultValues(void)48511 test_xmlXPathMultValues(void) {
48512     int test_ret = 0;
48513 
48514 #if defined(LIBXML_XPATH_ENABLED)
48515     int mem_base;
48516     xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
48517     int n_ctxt;
48518 
48519     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
48520         mem_base = xmlMemBlocks();
48521         ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
48522 
48523         xmlXPathMultValues(ctxt);
48524         call_tests++;
48525         des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
48526         xmlResetLastError();
48527         if (mem_base != xmlMemBlocks()) {
48528             printf("Leak of %d blocks found in xmlXPathMultValues",
48529 	           xmlMemBlocks() - mem_base);
48530 	    test_ret++;
48531             printf(" %d", n_ctxt);
48532             printf("\n");
48533         }
48534     }
48535     function_tests++;
48536 #endif
48537 
48538     return(test_ret);
48539 }
48540 
48541 
48542 static int
test_xmlXPathNamespaceURIFunction(void)48543 test_xmlXPathNamespaceURIFunction(void) {
48544     int test_ret = 0;
48545 
48546 #if defined(LIBXML_XPATH_ENABLED)
48547     int mem_base;
48548     xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
48549     int n_ctxt;
48550     int nargs; /* the number of arguments */
48551     int n_nargs;
48552 
48553     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
48554     for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
48555         mem_base = xmlMemBlocks();
48556         ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
48557         nargs = gen_int(n_nargs, 1);
48558 
48559         xmlXPathNamespaceURIFunction(ctxt, nargs);
48560         call_tests++;
48561         des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
48562         des_int(n_nargs, nargs, 1);
48563         xmlResetLastError();
48564         if (mem_base != xmlMemBlocks()) {
48565             printf("Leak of %d blocks found in xmlXPathNamespaceURIFunction",
48566 	           xmlMemBlocks() - mem_base);
48567 	    test_ret++;
48568             printf(" %d", n_ctxt);
48569             printf(" %d", n_nargs);
48570             printf("\n");
48571         }
48572     }
48573     }
48574     function_tests++;
48575 #endif
48576 
48577     return(test_ret);
48578 }
48579 
48580 
48581 static int
test_xmlXPathNewBoolean(void)48582 test_xmlXPathNewBoolean(void) {
48583     int test_ret = 0;
48584 
48585 #if defined(LIBXML_XPATH_ENABLED)
48586     int mem_base;
48587     xmlXPathObjectPtr ret_val;
48588     int val; /* the boolean value */
48589     int n_val;
48590 
48591     for (n_val = 0;n_val < gen_nb_int;n_val++) {
48592         mem_base = xmlMemBlocks();
48593         val = gen_int(n_val, 0);
48594 
48595         ret_val = xmlXPathNewBoolean(val);
48596         desret_xmlXPathObjectPtr(ret_val);
48597         call_tests++;
48598         des_int(n_val, val, 0);
48599         xmlResetLastError();
48600         if (mem_base != xmlMemBlocks()) {
48601             printf("Leak of %d blocks found in xmlXPathNewBoolean",
48602 	           xmlMemBlocks() - mem_base);
48603 	    test_ret++;
48604             printf(" %d", n_val);
48605             printf("\n");
48606         }
48607     }
48608     function_tests++;
48609 #endif
48610 
48611     return(test_ret);
48612 }
48613 
48614 
48615 static int
test_xmlXPathNewCString(void)48616 test_xmlXPathNewCString(void) {
48617     int test_ret = 0;
48618 
48619 #if defined(LIBXML_XPATH_ENABLED)
48620     int mem_base;
48621     xmlXPathObjectPtr ret_val;
48622     char * val; /* the char * value */
48623     int n_val;
48624 
48625     for (n_val = 0;n_val < gen_nb_const_char_ptr;n_val++) {
48626         mem_base = xmlMemBlocks();
48627         val = gen_const_char_ptr(n_val, 0);
48628 
48629         ret_val = xmlXPathNewCString((const char *)val);
48630         desret_xmlXPathObjectPtr(ret_val);
48631         call_tests++;
48632         des_const_char_ptr(n_val, (const char *)val, 0);
48633         xmlResetLastError();
48634         if (mem_base != xmlMemBlocks()) {
48635             printf("Leak of %d blocks found in xmlXPathNewCString",
48636 	           xmlMemBlocks() - mem_base);
48637 	    test_ret++;
48638             printf(" %d", n_val);
48639             printf("\n");
48640         }
48641     }
48642     function_tests++;
48643 #endif
48644 
48645     return(test_ret);
48646 }
48647 
48648 
48649 static int
test_xmlXPathNewFloat(void)48650 test_xmlXPathNewFloat(void) {
48651     int test_ret = 0;
48652 
48653 #if defined(LIBXML_XPATH_ENABLED)
48654     int mem_base;
48655     xmlXPathObjectPtr ret_val;
48656     double val; /* the double value */
48657     int n_val;
48658 
48659     for (n_val = 0;n_val < gen_nb_double;n_val++) {
48660         mem_base = xmlMemBlocks();
48661         val = gen_double(n_val, 0);
48662 
48663         ret_val = xmlXPathNewFloat(val);
48664         desret_xmlXPathObjectPtr(ret_val);
48665         call_tests++;
48666         des_double(n_val, val, 0);
48667         xmlResetLastError();
48668         if (mem_base != xmlMemBlocks()) {
48669             printf("Leak of %d blocks found in xmlXPathNewFloat",
48670 	           xmlMemBlocks() - mem_base);
48671 	    test_ret++;
48672             printf(" %d", n_val);
48673             printf("\n");
48674         }
48675     }
48676     function_tests++;
48677 #endif
48678 
48679     return(test_ret);
48680 }
48681 
48682 
48683 static int
test_xmlXPathNewNodeSet(void)48684 test_xmlXPathNewNodeSet(void) {
48685     int test_ret = 0;
48686 
48687 #if defined(LIBXML_XPATH_ENABLED)
48688     int mem_base;
48689     xmlXPathObjectPtr ret_val;
48690     xmlNodePtr val; /* the NodePtr value */
48691     int n_val;
48692 
48693     for (n_val = 0;n_val < gen_nb_xmlNodePtr;n_val++) {
48694         mem_base = xmlMemBlocks();
48695         val = gen_xmlNodePtr(n_val, 0);
48696 
48697         ret_val = xmlXPathNewNodeSet(val);
48698         desret_xmlXPathObjectPtr(ret_val);
48699         call_tests++;
48700         des_xmlNodePtr(n_val, val, 0);
48701         xmlResetLastError();
48702         if (mem_base != xmlMemBlocks()) {
48703             printf("Leak of %d blocks found in xmlXPathNewNodeSet",
48704 	           xmlMemBlocks() - mem_base);
48705 	    test_ret++;
48706             printf(" %d", n_val);
48707             printf("\n");
48708         }
48709     }
48710     function_tests++;
48711 #endif
48712 
48713     return(test_ret);
48714 }
48715 
48716 
48717 static int
test_xmlXPathNewNodeSetList(void)48718 test_xmlXPathNewNodeSetList(void) {
48719     int test_ret = 0;
48720 
48721 #if defined(LIBXML_XPATH_ENABLED)
48722     int mem_base;
48723     xmlXPathObjectPtr ret_val;
48724     xmlNodeSetPtr val; /* an existing NodeSet */
48725     int n_val;
48726 
48727     for (n_val = 0;n_val < gen_nb_xmlNodeSetPtr;n_val++) {
48728         mem_base = xmlMemBlocks();
48729         val = gen_xmlNodeSetPtr(n_val, 0);
48730 
48731         ret_val = xmlXPathNewNodeSetList(val);
48732         desret_xmlXPathObjectPtr(ret_val);
48733         call_tests++;
48734         des_xmlNodeSetPtr(n_val, val, 0);
48735         xmlResetLastError();
48736         if (mem_base != xmlMemBlocks()) {
48737             printf("Leak of %d blocks found in xmlXPathNewNodeSetList",
48738 	           xmlMemBlocks() - mem_base);
48739 	    test_ret++;
48740             printf(" %d", n_val);
48741             printf("\n");
48742         }
48743     }
48744     function_tests++;
48745 #endif
48746 
48747     return(test_ret);
48748 }
48749 
48750 
48751 static int
test_xmlXPathNewParserContext(void)48752 test_xmlXPathNewParserContext(void) {
48753     int test_ret = 0;
48754 
48755 
48756     /* missing type support */
48757     return(test_ret);
48758 }
48759 
48760 
48761 static int
test_xmlXPathNewString(void)48762 test_xmlXPathNewString(void) {
48763     int test_ret = 0;
48764 
48765 #if defined(LIBXML_XPATH_ENABLED)
48766     int mem_base;
48767     xmlXPathObjectPtr ret_val;
48768     xmlChar * val; /* the xmlChar * value */
48769     int n_val;
48770 
48771     for (n_val = 0;n_val < gen_nb_const_xmlChar_ptr;n_val++) {
48772         mem_base = xmlMemBlocks();
48773         val = gen_const_xmlChar_ptr(n_val, 0);
48774 
48775         ret_val = xmlXPathNewString((const xmlChar *)val);
48776         desret_xmlXPathObjectPtr(ret_val);
48777         call_tests++;
48778         des_const_xmlChar_ptr(n_val, (const xmlChar *)val, 0);
48779         xmlResetLastError();
48780         if (mem_base != xmlMemBlocks()) {
48781             printf("Leak of %d blocks found in xmlXPathNewString",
48782 	           xmlMemBlocks() - mem_base);
48783 	    test_ret++;
48784             printf(" %d", n_val);
48785             printf("\n");
48786         }
48787     }
48788     function_tests++;
48789 #endif
48790 
48791     return(test_ret);
48792 }
48793 
48794 
48795 static int
test_xmlXPathNextAncestor(void)48796 test_xmlXPathNextAncestor(void) {
48797     int test_ret = 0;
48798 
48799 #if defined(LIBXML_XPATH_ENABLED)
48800     int mem_base;
48801     xmlNodePtr ret_val;
48802     xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
48803     int n_ctxt;
48804     xmlNodePtr cur; /* the current node in the traversal */
48805     int n_cur;
48806 
48807     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
48808     for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
48809         mem_base = xmlMemBlocks();
48810         ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
48811         cur = gen_xmlNodePtr(n_cur, 1);
48812 
48813         ret_val = xmlXPathNextAncestor(ctxt, cur);
48814         desret_xmlNodePtr(ret_val);
48815         call_tests++;
48816         des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
48817         des_xmlNodePtr(n_cur, cur, 1);
48818         xmlResetLastError();
48819         if (mem_base != xmlMemBlocks()) {
48820             printf("Leak of %d blocks found in xmlXPathNextAncestor",
48821 	           xmlMemBlocks() - mem_base);
48822 	    test_ret++;
48823             printf(" %d", n_ctxt);
48824             printf(" %d", n_cur);
48825             printf("\n");
48826         }
48827     }
48828     }
48829     function_tests++;
48830 #endif
48831 
48832     return(test_ret);
48833 }
48834 
48835 
48836 static int
test_xmlXPathNextAncestorOrSelf(void)48837 test_xmlXPathNextAncestorOrSelf(void) {
48838     int test_ret = 0;
48839 
48840 #if defined(LIBXML_XPATH_ENABLED)
48841     int mem_base;
48842     xmlNodePtr ret_val;
48843     xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
48844     int n_ctxt;
48845     xmlNodePtr cur; /* the current node in the traversal */
48846     int n_cur;
48847 
48848     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
48849     for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
48850         mem_base = xmlMemBlocks();
48851         ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
48852         cur = gen_xmlNodePtr(n_cur, 1);
48853 
48854         ret_val = xmlXPathNextAncestorOrSelf(ctxt, cur);
48855         desret_xmlNodePtr(ret_val);
48856         call_tests++;
48857         des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
48858         des_xmlNodePtr(n_cur, cur, 1);
48859         xmlResetLastError();
48860         if (mem_base != xmlMemBlocks()) {
48861             printf("Leak of %d blocks found in xmlXPathNextAncestorOrSelf",
48862 	           xmlMemBlocks() - mem_base);
48863 	    test_ret++;
48864             printf(" %d", n_ctxt);
48865             printf(" %d", n_cur);
48866             printf("\n");
48867         }
48868     }
48869     }
48870     function_tests++;
48871 #endif
48872 
48873     return(test_ret);
48874 }
48875 
48876 
48877 static int
test_xmlXPathNextAttribute(void)48878 test_xmlXPathNextAttribute(void) {
48879     int test_ret = 0;
48880 
48881 #if defined(LIBXML_XPATH_ENABLED)
48882     int mem_base;
48883     xmlNodePtr ret_val;
48884     xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
48885     int n_ctxt;
48886     xmlNodePtr cur; /* the current attribute in the traversal */
48887     int n_cur;
48888 
48889     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
48890     for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
48891         mem_base = xmlMemBlocks();
48892         ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
48893         cur = gen_xmlNodePtr(n_cur, 1);
48894 
48895         ret_val = xmlXPathNextAttribute(ctxt, cur);
48896         desret_xmlNodePtr(ret_val);
48897         call_tests++;
48898         des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
48899         des_xmlNodePtr(n_cur, cur, 1);
48900         xmlResetLastError();
48901         if (mem_base != xmlMemBlocks()) {
48902             printf("Leak of %d blocks found in xmlXPathNextAttribute",
48903 	           xmlMemBlocks() - mem_base);
48904 	    test_ret++;
48905             printf(" %d", n_ctxt);
48906             printf(" %d", n_cur);
48907             printf("\n");
48908         }
48909     }
48910     }
48911     function_tests++;
48912 #endif
48913 
48914     return(test_ret);
48915 }
48916 
48917 
48918 static int
test_xmlXPathNextChild(void)48919 test_xmlXPathNextChild(void) {
48920     int test_ret = 0;
48921 
48922 #if defined(LIBXML_XPATH_ENABLED)
48923     int mem_base;
48924     xmlNodePtr ret_val;
48925     xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
48926     int n_ctxt;
48927     xmlNodePtr cur; /* the current node in the traversal */
48928     int n_cur;
48929 
48930     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
48931     for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
48932         mem_base = xmlMemBlocks();
48933         ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
48934         cur = gen_xmlNodePtr(n_cur, 1);
48935 
48936         ret_val = xmlXPathNextChild(ctxt, cur);
48937         desret_xmlNodePtr(ret_val);
48938         call_tests++;
48939         des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
48940         des_xmlNodePtr(n_cur, cur, 1);
48941         xmlResetLastError();
48942         if (mem_base != xmlMemBlocks()) {
48943             printf("Leak of %d blocks found in xmlXPathNextChild",
48944 	           xmlMemBlocks() - mem_base);
48945 	    test_ret++;
48946             printf(" %d", n_ctxt);
48947             printf(" %d", n_cur);
48948             printf("\n");
48949         }
48950     }
48951     }
48952     function_tests++;
48953 #endif
48954 
48955     return(test_ret);
48956 }
48957 
48958 
48959 static int
test_xmlXPathNextDescendant(void)48960 test_xmlXPathNextDescendant(void) {
48961     int test_ret = 0;
48962 
48963 #if defined(LIBXML_XPATH_ENABLED)
48964     int mem_base;
48965     xmlNodePtr ret_val;
48966     xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
48967     int n_ctxt;
48968     xmlNodePtr cur; /* the current node in the traversal */
48969     int n_cur;
48970 
48971     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
48972     for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
48973         mem_base = xmlMemBlocks();
48974         ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
48975         cur = gen_xmlNodePtr(n_cur, 1);
48976 
48977         ret_val = xmlXPathNextDescendant(ctxt, cur);
48978         desret_xmlNodePtr(ret_val);
48979         call_tests++;
48980         des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
48981         des_xmlNodePtr(n_cur, cur, 1);
48982         xmlResetLastError();
48983         if (mem_base != xmlMemBlocks()) {
48984             printf("Leak of %d blocks found in xmlXPathNextDescendant",
48985 	           xmlMemBlocks() - mem_base);
48986 	    test_ret++;
48987             printf(" %d", n_ctxt);
48988             printf(" %d", n_cur);
48989             printf("\n");
48990         }
48991     }
48992     }
48993     function_tests++;
48994 #endif
48995 
48996     return(test_ret);
48997 }
48998 
48999 
49000 static int
test_xmlXPathNextDescendantOrSelf(void)49001 test_xmlXPathNextDescendantOrSelf(void) {
49002     int test_ret = 0;
49003 
49004 #if defined(LIBXML_XPATH_ENABLED)
49005     int mem_base;
49006     xmlNodePtr ret_val;
49007     xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
49008     int n_ctxt;
49009     xmlNodePtr cur; /* the current node in the traversal */
49010     int n_cur;
49011 
49012     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
49013     for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
49014         mem_base = xmlMemBlocks();
49015         ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
49016         cur = gen_xmlNodePtr(n_cur, 1);
49017 
49018         ret_val = xmlXPathNextDescendantOrSelf(ctxt, cur);
49019         desret_xmlNodePtr(ret_val);
49020         call_tests++;
49021         des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
49022         des_xmlNodePtr(n_cur, cur, 1);
49023         xmlResetLastError();
49024         if (mem_base != xmlMemBlocks()) {
49025             printf("Leak of %d blocks found in xmlXPathNextDescendantOrSelf",
49026 	           xmlMemBlocks() - mem_base);
49027 	    test_ret++;
49028             printf(" %d", n_ctxt);
49029             printf(" %d", n_cur);
49030             printf("\n");
49031         }
49032     }
49033     }
49034     function_tests++;
49035 #endif
49036 
49037     return(test_ret);
49038 }
49039 
49040 
49041 static int
test_xmlXPathNextFollowing(void)49042 test_xmlXPathNextFollowing(void) {
49043     int test_ret = 0;
49044 
49045 #if defined(LIBXML_XPATH_ENABLED)
49046     int mem_base;
49047     xmlNodePtr ret_val;
49048     xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
49049     int n_ctxt;
49050     xmlNodePtr cur; /* the current node in the traversal */
49051     int n_cur;
49052 
49053     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
49054     for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
49055         mem_base = xmlMemBlocks();
49056         ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
49057         cur = gen_xmlNodePtr(n_cur, 1);
49058 
49059         ret_val = xmlXPathNextFollowing(ctxt, cur);
49060         desret_xmlNodePtr(ret_val);
49061         call_tests++;
49062         des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
49063         des_xmlNodePtr(n_cur, cur, 1);
49064         xmlResetLastError();
49065         if (mem_base != xmlMemBlocks()) {
49066             printf("Leak of %d blocks found in xmlXPathNextFollowing",
49067 	           xmlMemBlocks() - mem_base);
49068 	    test_ret++;
49069             printf(" %d", n_ctxt);
49070             printf(" %d", n_cur);
49071             printf("\n");
49072         }
49073     }
49074     }
49075     function_tests++;
49076 #endif
49077 
49078     return(test_ret);
49079 }
49080 
49081 
49082 static int
test_xmlXPathNextFollowingSibling(void)49083 test_xmlXPathNextFollowingSibling(void) {
49084     int test_ret = 0;
49085 
49086 #if defined(LIBXML_XPATH_ENABLED)
49087     int mem_base;
49088     xmlNodePtr ret_val;
49089     xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
49090     int n_ctxt;
49091     xmlNodePtr cur; /* the current node in the traversal */
49092     int n_cur;
49093 
49094     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
49095     for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
49096         mem_base = xmlMemBlocks();
49097         ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
49098         cur = gen_xmlNodePtr(n_cur, 1);
49099 
49100         ret_val = xmlXPathNextFollowingSibling(ctxt, cur);
49101         desret_xmlNodePtr(ret_val);
49102         call_tests++;
49103         des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
49104         des_xmlNodePtr(n_cur, cur, 1);
49105         xmlResetLastError();
49106         if (mem_base != xmlMemBlocks()) {
49107             printf("Leak of %d blocks found in xmlXPathNextFollowingSibling",
49108 	           xmlMemBlocks() - mem_base);
49109 	    test_ret++;
49110             printf(" %d", n_ctxt);
49111             printf(" %d", n_cur);
49112             printf("\n");
49113         }
49114     }
49115     }
49116     function_tests++;
49117 #endif
49118 
49119     return(test_ret);
49120 }
49121 
49122 
49123 static int
test_xmlXPathNextNamespace(void)49124 test_xmlXPathNextNamespace(void) {
49125     int test_ret = 0;
49126 
49127 #if defined(LIBXML_XPATH_ENABLED)
49128     int mem_base;
49129     xmlNodePtr ret_val;
49130     xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
49131     int n_ctxt;
49132     xmlNodePtr cur; /* the current attribute in the traversal */
49133     int n_cur;
49134 
49135     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
49136     for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
49137         mem_base = xmlMemBlocks();
49138         ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
49139         cur = gen_xmlNodePtr(n_cur, 1);
49140 
49141         ret_val = xmlXPathNextNamespace(ctxt, cur);
49142         desret_xmlNodePtr(ret_val);
49143         call_tests++;
49144         des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
49145         des_xmlNodePtr(n_cur, cur, 1);
49146         xmlResetLastError();
49147         if (mem_base != xmlMemBlocks()) {
49148             printf("Leak of %d blocks found in xmlXPathNextNamespace",
49149 	           xmlMemBlocks() - mem_base);
49150 	    test_ret++;
49151             printf(" %d", n_ctxt);
49152             printf(" %d", n_cur);
49153             printf("\n");
49154         }
49155     }
49156     }
49157     function_tests++;
49158 #endif
49159 
49160     return(test_ret);
49161 }
49162 
49163 
49164 static int
test_xmlXPathNextParent(void)49165 test_xmlXPathNextParent(void) {
49166     int test_ret = 0;
49167 
49168 #if defined(LIBXML_XPATH_ENABLED)
49169     int mem_base;
49170     xmlNodePtr ret_val;
49171     xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
49172     int n_ctxt;
49173     xmlNodePtr cur; /* the current node in the traversal */
49174     int n_cur;
49175 
49176     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
49177     for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
49178         mem_base = xmlMemBlocks();
49179         ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
49180         cur = gen_xmlNodePtr(n_cur, 1);
49181 
49182         ret_val = xmlXPathNextParent(ctxt, cur);
49183         desret_xmlNodePtr(ret_val);
49184         call_tests++;
49185         des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
49186         des_xmlNodePtr(n_cur, cur, 1);
49187         xmlResetLastError();
49188         if (mem_base != xmlMemBlocks()) {
49189             printf("Leak of %d blocks found in xmlXPathNextParent",
49190 	           xmlMemBlocks() - mem_base);
49191 	    test_ret++;
49192             printf(" %d", n_ctxt);
49193             printf(" %d", n_cur);
49194             printf("\n");
49195         }
49196     }
49197     }
49198     function_tests++;
49199 #endif
49200 
49201     return(test_ret);
49202 }
49203 
49204 
49205 static int
test_xmlXPathNextPreceding(void)49206 test_xmlXPathNextPreceding(void) {
49207     int test_ret = 0;
49208 
49209 #if defined(LIBXML_XPATH_ENABLED)
49210     int mem_base;
49211     xmlNodePtr ret_val;
49212     xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
49213     int n_ctxt;
49214     xmlNodePtr cur; /* the current node in the traversal */
49215     int n_cur;
49216 
49217     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
49218     for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
49219         mem_base = xmlMemBlocks();
49220         ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
49221         cur = gen_xmlNodePtr(n_cur, 1);
49222 
49223         ret_val = xmlXPathNextPreceding(ctxt, cur);
49224         desret_xmlNodePtr(ret_val);
49225         call_tests++;
49226         des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
49227         des_xmlNodePtr(n_cur, cur, 1);
49228         xmlResetLastError();
49229         if (mem_base != xmlMemBlocks()) {
49230             printf("Leak of %d blocks found in xmlXPathNextPreceding",
49231 	           xmlMemBlocks() - mem_base);
49232 	    test_ret++;
49233             printf(" %d", n_ctxt);
49234             printf(" %d", n_cur);
49235             printf("\n");
49236         }
49237     }
49238     }
49239     function_tests++;
49240 #endif
49241 
49242     return(test_ret);
49243 }
49244 
49245 
49246 static int
test_xmlXPathNextPrecedingSibling(void)49247 test_xmlXPathNextPrecedingSibling(void) {
49248     int test_ret = 0;
49249 
49250 #if defined(LIBXML_XPATH_ENABLED)
49251     int mem_base;
49252     xmlNodePtr ret_val;
49253     xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
49254     int n_ctxt;
49255     xmlNodePtr cur; /* the current node in the traversal */
49256     int n_cur;
49257 
49258     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
49259     for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
49260         mem_base = xmlMemBlocks();
49261         ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
49262         cur = gen_xmlNodePtr(n_cur, 1);
49263 
49264         ret_val = xmlXPathNextPrecedingSibling(ctxt, cur);
49265         desret_xmlNodePtr(ret_val);
49266         call_tests++;
49267         des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
49268         des_xmlNodePtr(n_cur, cur, 1);
49269         xmlResetLastError();
49270         if (mem_base != xmlMemBlocks()) {
49271             printf("Leak of %d blocks found in xmlXPathNextPrecedingSibling",
49272 	           xmlMemBlocks() - mem_base);
49273 	    test_ret++;
49274             printf(" %d", n_ctxt);
49275             printf(" %d", n_cur);
49276             printf("\n");
49277         }
49278     }
49279     }
49280     function_tests++;
49281 #endif
49282 
49283     return(test_ret);
49284 }
49285 
49286 
49287 static int
test_xmlXPathNextSelf(void)49288 test_xmlXPathNextSelf(void) {
49289     int test_ret = 0;
49290 
49291 #if defined(LIBXML_XPATH_ENABLED)
49292     int mem_base;
49293     xmlNodePtr ret_val;
49294     xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
49295     int n_ctxt;
49296     xmlNodePtr cur; /* the current node in the traversal */
49297     int n_cur;
49298 
49299     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
49300     for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
49301         mem_base = xmlMemBlocks();
49302         ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
49303         cur = gen_xmlNodePtr(n_cur, 1);
49304 
49305         ret_val = xmlXPathNextSelf(ctxt, cur);
49306         desret_xmlNodePtr(ret_val);
49307         call_tests++;
49308         des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
49309         des_xmlNodePtr(n_cur, cur, 1);
49310         xmlResetLastError();
49311         if (mem_base != xmlMemBlocks()) {
49312             printf("Leak of %d blocks found in xmlXPathNextSelf",
49313 	           xmlMemBlocks() - mem_base);
49314 	    test_ret++;
49315             printf(" %d", n_ctxt);
49316             printf(" %d", n_cur);
49317             printf("\n");
49318         }
49319     }
49320     }
49321     function_tests++;
49322 #endif
49323 
49324     return(test_ret);
49325 }
49326 
49327 
49328 static int
test_xmlXPathNodeLeading(void)49329 test_xmlXPathNodeLeading(void) {
49330     int test_ret = 0;
49331 
49332 #if defined(LIBXML_XPATH_ENABLED)
49333     int mem_base;
49334     xmlNodeSetPtr ret_val;
49335     xmlNodeSetPtr nodes; /* a node-set */
49336     int n_nodes;
49337     xmlNodePtr node; /* a node */
49338     int n_node;
49339 
49340     for (n_nodes = 0;n_nodes < gen_nb_xmlNodeSetPtr;n_nodes++) {
49341     for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
49342         mem_base = xmlMemBlocks();
49343         nodes = gen_xmlNodeSetPtr(n_nodes, 0);
49344         node = gen_xmlNodePtr(n_node, 1);
49345 
49346         ret_val = xmlXPathNodeLeading(nodes, node);
49347         desret_xmlNodeSetPtr(ret_val);
49348         call_tests++;
49349         des_xmlNodeSetPtr(n_nodes, nodes, 0);
49350         des_xmlNodePtr(n_node, node, 1);
49351         xmlResetLastError();
49352         if (mem_base != xmlMemBlocks()) {
49353             printf("Leak of %d blocks found in xmlXPathNodeLeading",
49354 	           xmlMemBlocks() - mem_base);
49355 	    test_ret++;
49356             printf(" %d", n_nodes);
49357             printf(" %d", n_node);
49358             printf("\n");
49359         }
49360     }
49361     }
49362     function_tests++;
49363 #endif
49364 
49365     return(test_ret);
49366 }
49367 
49368 
49369 static int
test_xmlXPathNodeLeadingSorted(void)49370 test_xmlXPathNodeLeadingSorted(void) {
49371     int test_ret = 0;
49372 
49373 #if defined(LIBXML_XPATH_ENABLED)
49374     int mem_base;
49375     xmlNodeSetPtr ret_val;
49376     xmlNodeSetPtr nodes; /* a node-set, sorted by document order */
49377     int n_nodes;
49378     xmlNodePtr node; /* a node */
49379     int n_node;
49380 
49381     for (n_nodes = 0;n_nodes < gen_nb_xmlNodeSetPtr;n_nodes++) {
49382     for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
49383         mem_base = xmlMemBlocks();
49384         nodes = gen_xmlNodeSetPtr(n_nodes, 0);
49385         node = gen_xmlNodePtr(n_node, 1);
49386 
49387         ret_val = xmlXPathNodeLeadingSorted(nodes, node);
49388         desret_xmlNodeSetPtr(ret_val);
49389         call_tests++;
49390         des_xmlNodeSetPtr(n_nodes, nodes, 0);
49391         des_xmlNodePtr(n_node, node, 1);
49392         xmlResetLastError();
49393         if (mem_base != xmlMemBlocks()) {
49394             printf("Leak of %d blocks found in xmlXPathNodeLeadingSorted",
49395 	           xmlMemBlocks() - mem_base);
49396 	    test_ret++;
49397             printf(" %d", n_nodes);
49398             printf(" %d", n_node);
49399             printf("\n");
49400         }
49401     }
49402     }
49403     function_tests++;
49404 #endif
49405 
49406     return(test_ret);
49407 }
49408 
49409 
49410 static int
test_xmlXPathNodeSetAdd(void)49411 test_xmlXPathNodeSetAdd(void) {
49412     int test_ret = 0;
49413 
49414 #if defined(LIBXML_XPATH_ENABLED)
49415     int mem_base;
49416     int ret_val;
49417     xmlNodeSetPtr cur; /* the initial node set */
49418     int n_cur;
49419     xmlNodePtr val; /* a new xmlNodePtr */
49420     int n_val;
49421 
49422     for (n_cur = 0;n_cur < gen_nb_xmlNodeSetPtr;n_cur++) {
49423     for (n_val = 0;n_val < gen_nb_xmlNodePtr;n_val++) {
49424         mem_base = xmlMemBlocks();
49425         cur = gen_xmlNodeSetPtr(n_cur, 0);
49426         val = gen_xmlNodePtr(n_val, 1);
49427 
49428         ret_val = xmlXPathNodeSetAdd(cur, val);
49429         desret_int(ret_val);
49430         call_tests++;
49431         des_xmlNodeSetPtr(n_cur, cur, 0);
49432         des_xmlNodePtr(n_val, val, 1);
49433         xmlResetLastError();
49434         if (mem_base != xmlMemBlocks()) {
49435             printf("Leak of %d blocks found in xmlXPathNodeSetAdd",
49436 	           xmlMemBlocks() - mem_base);
49437 	    test_ret++;
49438             printf(" %d", n_cur);
49439             printf(" %d", n_val);
49440             printf("\n");
49441         }
49442     }
49443     }
49444     function_tests++;
49445 #endif
49446 
49447     return(test_ret);
49448 }
49449 
49450 
49451 static int
test_xmlXPathNodeSetAddNs(void)49452 test_xmlXPathNodeSetAddNs(void) {
49453     int test_ret = 0;
49454 
49455 #if defined(LIBXML_XPATH_ENABLED)
49456     int mem_base;
49457     int ret_val;
49458     xmlNodeSetPtr cur; /* the initial node set */
49459     int n_cur;
49460     xmlNodePtr node; /* the hosting node */
49461     int n_node;
49462     xmlNsPtr ns; /* a the namespace node */
49463     int n_ns;
49464 
49465     for (n_cur = 0;n_cur < gen_nb_xmlNodeSetPtr;n_cur++) {
49466     for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
49467     for (n_ns = 0;n_ns < gen_nb_xmlNsPtr;n_ns++) {
49468         mem_base = xmlMemBlocks();
49469         cur = gen_xmlNodeSetPtr(n_cur, 0);
49470         node = gen_xmlNodePtr(n_node, 1);
49471         ns = gen_xmlNsPtr(n_ns, 2);
49472 
49473         ret_val = xmlXPathNodeSetAddNs(cur, node, ns);
49474         desret_int(ret_val);
49475         call_tests++;
49476         des_xmlNodeSetPtr(n_cur, cur, 0);
49477         des_xmlNodePtr(n_node, node, 1);
49478         des_xmlNsPtr(n_ns, ns, 2);
49479         xmlResetLastError();
49480         if (mem_base != xmlMemBlocks()) {
49481             printf("Leak of %d blocks found in xmlXPathNodeSetAddNs",
49482 	           xmlMemBlocks() - mem_base);
49483 	    test_ret++;
49484             printf(" %d", n_cur);
49485             printf(" %d", n_node);
49486             printf(" %d", n_ns);
49487             printf("\n");
49488         }
49489     }
49490     }
49491     }
49492     function_tests++;
49493 #endif
49494 
49495     return(test_ret);
49496 }
49497 
49498 
49499 static int
test_xmlXPathNodeSetAddUnique(void)49500 test_xmlXPathNodeSetAddUnique(void) {
49501     int test_ret = 0;
49502 
49503 #if defined(LIBXML_XPATH_ENABLED)
49504     int mem_base;
49505     int ret_val;
49506     xmlNodeSetPtr cur; /* the initial node set */
49507     int n_cur;
49508     xmlNodePtr val; /* a new xmlNodePtr */
49509     int n_val;
49510 
49511     for (n_cur = 0;n_cur < gen_nb_xmlNodeSetPtr;n_cur++) {
49512     for (n_val = 0;n_val < gen_nb_xmlNodePtr;n_val++) {
49513         mem_base = xmlMemBlocks();
49514         cur = gen_xmlNodeSetPtr(n_cur, 0);
49515         val = gen_xmlNodePtr(n_val, 1);
49516 
49517         ret_val = xmlXPathNodeSetAddUnique(cur, val);
49518         desret_int(ret_val);
49519         call_tests++;
49520         des_xmlNodeSetPtr(n_cur, cur, 0);
49521         des_xmlNodePtr(n_val, val, 1);
49522         xmlResetLastError();
49523         if (mem_base != xmlMemBlocks()) {
49524             printf("Leak of %d blocks found in xmlXPathNodeSetAddUnique",
49525 	           xmlMemBlocks() - mem_base);
49526 	    test_ret++;
49527             printf(" %d", n_cur);
49528             printf(" %d", n_val);
49529             printf("\n");
49530         }
49531     }
49532     }
49533     function_tests++;
49534 #endif
49535 
49536     return(test_ret);
49537 }
49538 
49539 
49540 static int
test_xmlXPathNodeSetContains(void)49541 test_xmlXPathNodeSetContains(void) {
49542     int test_ret = 0;
49543 
49544 #if defined(LIBXML_XPATH_ENABLED)
49545     int mem_base;
49546     int ret_val;
49547     xmlNodeSetPtr cur; /* the node-set */
49548     int n_cur;
49549     xmlNodePtr val; /* the node */
49550     int n_val;
49551 
49552     for (n_cur = 0;n_cur < gen_nb_xmlNodeSetPtr;n_cur++) {
49553     for (n_val = 0;n_val < gen_nb_xmlNodePtr;n_val++) {
49554         mem_base = xmlMemBlocks();
49555         cur = gen_xmlNodeSetPtr(n_cur, 0);
49556         val = gen_xmlNodePtr(n_val, 1);
49557 
49558         ret_val = xmlXPathNodeSetContains(cur, val);
49559         desret_int(ret_val);
49560         call_tests++;
49561         des_xmlNodeSetPtr(n_cur, cur, 0);
49562         des_xmlNodePtr(n_val, val, 1);
49563         xmlResetLastError();
49564         if (mem_base != xmlMemBlocks()) {
49565             printf("Leak of %d blocks found in xmlXPathNodeSetContains",
49566 	           xmlMemBlocks() - mem_base);
49567 	    test_ret++;
49568             printf(" %d", n_cur);
49569             printf(" %d", n_val);
49570             printf("\n");
49571         }
49572     }
49573     }
49574     function_tests++;
49575 #endif
49576 
49577     return(test_ret);
49578 }
49579 
49580 
49581 static int
test_xmlXPathNodeSetDel(void)49582 test_xmlXPathNodeSetDel(void) {
49583     int test_ret = 0;
49584 
49585 #if defined(LIBXML_XPATH_ENABLED)
49586     int mem_base;
49587     xmlNodeSetPtr cur; /* the initial node set */
49588     int n_cur;
49589     xmlNodePtr val; /* an xmlNodePtr */
49590     int n_val;
49591 
49592     for (n_cur = 0;n_cur < gen_nb_xmlNodeSetPtr;n_cur++) {
49593     for (n_val = 0;n_val < gen_nb_xmlNodePtr;n_val++) {
49594         mem_base = xmlMemBlocks();
49595         cur = gen_xmlNodeSetPtr(n_cur, 0);
49596         val = gen_xmlNodePtr(n_val, 1);
49597 
49598         xmlXPathNodeSetDel(cur, val);
49599         call_tests++;
49600         des_xmlNodeSetPtr(n_cur, cur, 0);
49601         des_xmlNodePtr(n_val, val, 1);
49602         xmlResetLastError();
49603         if (mem_base != xmlMemBlocks()) {
49604             printf("Leak of %d blocks found in xmlXPathNodeSetDel",
49605 	           xmlMemBlocks() - mem_base);
49606 	    test_ret++;
49607             printf(" %d", n_cur);
49608             printf(" %d", n_val);
49609             printf("\n");
49610         }
49611     }
49612     }
49613     function_tests++;
49614 #endif
49615 
49616     return(test_ret);
49617 }
49618 
49619 
49620 static int
test_xmlXPathNodeSetMerge(void)49621 test_xmlXPathNodeSetMerge(void) {
49622     int test_ret = 0;
49623 
49624 #if defined(LIBXML_XPATH_ENABLED)
49625     int mem_base;
49626     xmlNodeSetPtr ret_val;
49627     xmlNodeSetPtr val1; /* the first NodeSet or NULL */
49628     int n_val1;
49629     xmlNodeSetPtr val2; /* the second NodeSet */
49630     int n_val2;
49631 
49632     for (n_val1 = 0;n_val1 < gen_nb_xmlNodeSetPtr;n_val1++) {
49633     for (n_val2 = 0;n_val2 < gen_nb_xmlNodeSetPtr;n_val2++) {
49634         mem_base = xmlMemBlocks();
49635         val1 = gen_xmlNodeSetPtr(n_val1, 0);
49636         val2 = gen_xmlNodeSetPtr(n_val2, 1);
49637 
49638         ret_val = xmlXPathNodeSetMerge(val1, val2);
49639         desret_xmlNodeSetPtr(ret_val);
49640         call_tests++;
49641         des_xmlNodeSetPtr(n_val1, val1, 0);
49642         des_xmlNodeSetPtr(n_val2, val2, 1);
49643         xmlResetLastError();
49644         if (mem_base != xmlMemBlocks()) {
49645             printf("Leak of %d blocks found in xmlXPathNodeSetMerge",
49646 	           xmlMemBlocks() - mem_base);
49647 	    test_ret++;
49648             printf(" %d", n_val1);
49649             printf(" %d", n_val2);
49650             printf("\n");
49651         }
49652     }
49653     }
49654     function_tests++;
49655 #endif
49656 
49657     return(test_ret);
49658 }
49659 
49660 
49661 static int
test_xmlXPathNodeSetRemove(void)49662 test_xmlXPathNodeSetRemove(void) {
49663     int test_ret = 0;
49664 
49665 #if defined(LIBXML_XPATH_ENABLED)
49666     int mem_base;
49667     xmlNodeSetPtr cur; /* the initial node set */
49668     int n_cur;
49669     int val; /* the index to remove */
49670     int n_val;
49671 
49672     for (n_cur = 0;n_cur < gen_nb_xmlNodeSetPtr;n_cur++) {
49673     for (n_val = 0;n_val < gen_nb_int;n_val++) {
49674         mem_base = xmlMemBlocks();
49675         cur = gen_xmlNodeSetPtr(n_cur, 0);
49676         val = gen_int(n_val, 1);
49677 
49678         xmlXPathNodeSetRemove(cur, val);
49679         call_tests++;
49680         des_xmlNodeSetPtr(n_cur, cur, 0);
49681         des_int(n_val, val, 1);
49682         xmlResetLastError();
49683         if (mem_base != xmlMemBlocks()) {
49684             printf("Leak of %d blocks found in xmlXPathNodeSetRemove",
49685 	           xmlMemBlocks() - mem_base);
49686 	    test_ret++;
49687             printf(" %d", n_cur);
49688             printf(" %d", n_val);
49689             printf("\n");
49690         }
49691     }
49692     }
49693     function_tests++;
49694 #endif
49695 
49696     return(test_ret);
49697 }
49698 
49699 
49700 static int
test_xmlXPathNodeSetSort(void)49701 test_xmlXPathNodeSetSort(void) {
49702     int test_ret = 0;
49703 
49704 #if defined(LIBXML_XPATH_ENABLED)
49705     int mem_base;
49706     xmlNodeSetPtr set; /* the node set */
49707     int n_set;
49708 
49709     for (n_set = 0;n_set < gen_nb_xmlNodeSetPtr;n_set++) {
49710         mem_base = xmlMemBlocks();
49711         set = gen_xmlNodeSetPtr(n_set, 0);
49712 
49713         xmlXPathNodeSetSort(set);
49714         call_tests++;
49715         des_xmlNodeSetPtr(n_set, set, 0);
49716         xmlResetLastError();
49717         if (mem_base != xmlMemBlocks()) {
49718             printf("Leak of %d blocks found in xmlXPathNodeSetSort",
49719 	           xmlMemBlocks() - mem_base);
49720 	    test_ret++;
49721             printf(" %d", n_set);
49722             printf("\n");
49723         }
49724     }
49725     function_tests++;
49726 #endif
49727 
49728     return(test_ret);
49729 }
49730 
49731 
49732 static int
test_xmlXPathNodeTrailing(void)49733 test_xmlXPathNodeTrailing(void) {
49734     int test_ret = 0;
49735 
49736 #if defined(LIBXML_XPATH_ENABLED)
49737     int mem_base;
49738     xmlNodeSetPtr ret_val;
49739     xmlNodeSetPtr nodes; /* a node-set */
49740     int n_nodes;
49741     xmlNodePtr node; /* a node */
49742     int n_node;
49743 
49744     for (n_nodes = 0;n_nodes < gen_nb_xmlNodeSetPtr;n_nodes++) {
49745     for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
49746         mem_base = xmlMemBlocks();
49747         nodes = gen_xmlNodeSetPtr(n_nodes, 0);
49748         node = gen_xmlNodePtr(n_node, 1);
49749 
49750         ret_val = xmlXPathNodeTrailing(nodes, node);
49751         desret_xmlNodeSetPtr(ret_val);
49752         call_tests++;
49753         des_xmlNodeSetPtr(n_nodes, nodes, 0);
49754         des_xmlNodePtr(n_node, node, 1);
49755         xmlResetLastError();
49756         if (mem_base != xmlMemBlocks()) {
49757             printf("Leak of %d blocks found in xmlXPathNodeTrailing",
49758 	           xmlMemBlocks() - mem_base);
49759 	    test_ret++;
49760             printf(" %d", n_nodes);
49761             printf(" %d", n_node);
49762             printf("\n");
49763         }
49764     }
49765     }
49766     function_tests++;
49767 #endif
49768 
49769     return(test_ret);
49770 }
49771 
49772 
49773 static int
test_xmlXPathNodeTrailingSorted(void)49774 test_xmlXPathNodeTrailingSorted(void) {
49775     int test_ret = 0;
49776 
49777 #if defined(LIBXML_XPATH_ENABLED)
49778     int mem_base;
49779     xmlNodeSetPtr ret_val;
49780     xmlNodeSetPtr nodes; /* a node-set, sorted by document order */
49781     int n_nodes;
49782     xmlNodePtr node; /* a node */
49783     int n_node;
49784 
49785     for (n_nodes = 0;n_nodes < gen_nb_xmlNodeSetPtr;n_nodes++) {
49786     for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
49787         mem_base = xmlMemBlocks();
49788         nodes = gen_xmlNodeSetPtr(n_nodes, 0);
49789         node = gen_xmlNodePtr(n_node, 1);
49790 
49791         ret_val = xmlXPathNodeTrailingSorted(nodes, node);
49792         desret_xmlNodeSetPtr(ret_val);
49793         call_tests++;
49794         des_xmlNodeSetPtr(n_nodes, nodes, 0);
49795         des_xmlNodePtr(n_node, node, 1);
49796         xmlResetLastError();
49797         if (mem_base != xmlMemBlocks()) {
49798             printf("Leak of %d blocks found in xmlXPathNodeTrailingSorted",
49799 	           xmlMemBlocks() - mem_base);
49800 	    test_ret++;
49801             printf(" %d", n_nodes);
49802             printf(" %d", n_node);
49803             printf("\n");
49804         }
49805     }
49806     }
49807     function_tests++;
49808 #endif
49809 
49810     return(test_ret);
49811 }
49812 
49813 
49814 static int
test_xmlXPathNormalizeFunction(void)49815 test_xmlXPathNormalizeFunction(void) {
49816     int test_ret = 0;
49817 
49818 #if defined(LIBXML_XPATH_ENABLED)
49819     int mem_base;
49820     xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
49821     int n_ctxt;
49822     int nargs; /* the number of arguments */
49823     int n_nargs;
49824 
49825     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
49826     for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
49827         mem_base = xmlMemBlocks();
49828         ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
49829         nargs = gen_int(n_nargs, 1);
49830 
49831         xmlXPathNormalizeFunction(ctxt, nargs);
49832         call_tests++;
49833         des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
49834         des_int(n_nargs, nargs, 1);
49835         xmlResetLastError();
49836         if (mem_base != xmlMemBlocks()) {
49837             printf("Leak of %d blocks found in xmlXPathNormalizeFunction",
49838 	           xmlMemBlocks() - mem_base);
49839 	    test_ret++;
49840             printf(" %d", n_ctxt);
49841             printf(" %d", n_nargs);
49842             printf("\n");
49843         }
49844     }
49845     }
49846     function_tests++;
49847 #endif
49848 
49849     return(test_ret);
49850 }
49851 
49852 
49853 static int
test_xmlXPathNotEqualValues(void)49854 test_xmlXPathNotEqualValues(void) {
49855     int test_ret = 0;
49856 
49857 #if defined(LIBXML_XPATH_ENABLED)
49858     int mem_base;
49859     int ret_val;
49860     xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
49861     int n_ctxt;
49862 
49863     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
49864         mem_base = xmlMemBlocks();
49865         ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
49866 
49867         ret_val = xmlXPathNotEqualValues(ctxt);
49868         desret_int(ret_val);
49869         call_tests++;
49870         des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
49871         xmlResetLastError();
49872         if (mem_base != xmlMemBlocks()) {
49873             printf("Leak of %d blocks found in xmlXPathNotEqualValues",
49874 	           xmlMemBlocks() - mem_base);
49875 	    test_ret++;
49876             printf(" %d", n_ctxt);
49877             printf("\n");
49878         }
49879     }
49880     function_tests++;
49881 #endif
49882 
49883     return(test_ret);
49884 }
49885 
49886 
49887 static int
test_xmlXPathNotFunction(void)49888 test_xmlXPathNotFunction(void) {
49889     int test_ret = 0;
49890 
49891 #if defined(LIBXML_XPATH_ENABLED)
49892     int mem_base;
49893     xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
49894     int n_ctxt;
49895     int nargs; /* the number of arguments */
49896     int n_nargs;
49897 
49898     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
49899     for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
49900         mem_base = xmlMemBlocks();
49901         ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
49902         nargs = gen_int(n_nargs, 1);
49903 
49904         xmlXPathNotFunction(ctxt, nargs);
49905         call_tests++;
49906         des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
49907         des_int(n_nargs, nargs, 1);
49908         xmlResetLastError();
49909         if (mem_base != xmlMemBlocks()) {
49910             printf("Leak of %d blocks found in xmlXPathNotFunction",
49911 	           xmlMemBlocks() - mem_base);
49912 	    test_ret++;
49913             printf(" %d", n_ctxt);
49914             printf(" %d", n_nargs);
49915             printf("\n");
49916         }
49917     }
49918     }
49919     function_tests++;
49920 #endif
49921 
49922     return(test_ret);
49923 }
49924 
49925 
49926 static int
test_xmlXPathNsLookup(void)49927 test_xmlXPathNsLookup(void) {
49928     int test_ret = 0;
49929 
49930 #if defined(LIBXML_XPATH_ENABLED)
49931     int mem_base;
49932     const xmlChar * ret_val;
49933     xmlXPathContextPtr ctxt; /* the XPath context */
49934     int n_ctxt;
49935     xmlChar * prefix; /* the namespace prefix value */
49936     int n_prefix;
49937 
49938     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathContextPtr;n_ctxt++) {
49939     for (n_prefix = 0;n_prefix < gen_nb_const_xmlChar_ptr;n_prefix++) {
49940         mem_base = xmlMemBlocks();
49941         ctxt = gen_xmlXPathContextPtr(n_ctxt, 0);
49942         prefix = gen_const_xmlChar_ptr(n_prefix, 1);
49943 
49944         ret_val = xmlXPathNsLookup(ctxt, (const xmlChar *)prefix);
49945         desret_const_xmlChar_ptr(ret_val);
49946         call_tests++;
49947         des_xmlXPathContextPtr(n_ctxt, ctxt, 0);
49948         des_const_xmlChar_ptr(n_prefix, (const xmlChar *)prefix, 1);
49949         xmlResetLastError();
49950         if (mem_base != xmlMemBlocks()) {
49951             printf("Leak of %d blocks found in xmlXPathNsLookup",
49952 	           xmlMemBlocks() - mem_base);
49953 	    test_ret++;
49954             printf(" %d", n_ctxt);
49955             printf(" %d", n_prefix);
49956             printf("\n");
49957         }
49958     }
49959     }
49960     function_tests++;
49961 #endif
49962 
49963     return(test_ret);
49964 }
49965 
49966 
49967 static int
test_xmlXPathNumberFunction(void)49968 test_xmlXPathNumberFunction(void) {
49969     int test_ret = 0;
49970 
49971 #if defined(LIBXML_XPATH_ENABLED)
49972     int mem_base;
49973     xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
49974     int n_ctxt;
49975     int nargs; /* the number of arguments */
49976     int n_nargs;
49977 
49978     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
49979     for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
49980         mem_base = xmlMemBlocks();
49981         ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
49982         nargs = gen_int(n_nargs, 1);
49983 
49984         xmlXPathNumberFunction(ctxt, nargs);
49985         call_tests++;
49986         des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
49987         des_int(n_nargs, nargs, 1);
49988         xmlResetLastError();
49989         if (mem_base != xmlMemBlocks()) {
49990             printf("Leak of %d blocks found in xmlXPathNumberFunction",
49991 	           xmlMemBlocks() - mem_base);
49992 	    test_ret++;
49993             printf(" %d", n_ctxt);
49994             printf(" %d", n_nargs);
49995             printf("\n");
49996         }
49997     }
49998     }
49999     function_tests++;
50000 #endif
50001 
50002     return(test_ret);
50003 }
50004 
50005 
50006 static int
test_xmlXPathParseNCName(void)50007 test_xmlXPathParseNCName(void) {
50008     int test_ret = 0;
50009 
50010 #if defined(LIBXML_XPATH_ENABLED)
50011     int mem_base;
50012     xmlChar * ret_val;
50013     xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
50014     int n_ctxt;
50015 
50016     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
50017         mem_base = xmlMemBlocks();
50018         ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
50019 
50020         ret_val = xmlXPathParseNCName(ctxt);
50021         desret_xmlChar_ptr(ret_val);
50022         call_tests++;
50023         des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
50024         xmlResetLastError();
50025         if (mem_base != xmlMemBlocks()) {
50026             printf("Leak of %d blocks found in xmlXPathParseNCName",
50027 	           xmlMemBlocks() - mem_base);
50028 	    test_ret++;
50029             printf(" %d", n_ctxt);
50030             printf("\n");
50031         }
50032     }
50033     function_tests++;
50034 #endif
50035 
50036     return(test_ret);
50037 }
50038 
50039 
50040 static int
test_xmlXPathParseName(void)50041 test_xmlXPathParseName(void) {
50042     int test_ret = 0;
50043 
50044 #if defined(LIBXML_XPATH_ENABLED)
50045     int mem_base;
50046     xmlChar * ret_val;
50047     xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
50048     int n_ctxt;
50049 
50050     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
50051         mem_base = xmlMemBlocks();
50052         ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
50053 
50054         ret_val = xmlXPathParseName(ctxt);
50055         desret_xmlChar_ptr(ret_val);
50056         call_tests++;
50057         des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
50058         xmlResetLastError();
50059         if (mem_base != xmlMemBlocks()) {
50060             printf("Leak of %d blocks found in xmlXPathParseName",
50061 	           xmlMemBlocks() - mem_base);
50062 	    test_ret++;
50063             printf(" %d", n_ctxt);
50064             printf("\n");
50065         }
50066     }
50067     function_tests++;
50068 #endif
50069 
50070     return(test_ret);
50071 }
50072 
50073 
50074 static int
test_xmlXPathPopBoolean(void)50075 test_xmlXPathPopBoolean(void) {
50076     int test_ret = 0;
50077 
50078 #if defined(LIBXML_XPATH_ENABLED)
50079     int mem_base;
50080     int ret_val;
50081     xmlXPathParserContextPtr ctxt; /* an XPath parser context */
50082     int n_ctxt;
50083 
50084     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
50085         mem_base = xmlMemBlocks();
50086         ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
50087 
50088         ret_val = xmlXPathPopBoolean(ctxt);
50089         desret_int(ret_val);
50090         call_tests++;
50091         des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
50092         xmlResetLastError();
50093         if (mem_base != xmlMemBlocks()) {
50094             printf("Leak of %d blocks found in xmlXPathPopBoolean",
50095 	           xmlMemBlocks() - mem_base);
50096 	    test_ret++;
50097             printf(" %d", n_ctxt);
50098             printf("\n");
50099         }
50100     }
50101     function_tests++;
50102 #endif
50103 
50104     return(test_ret);
50105 }
50106 
50107 
50108 static int
test_xmlXPathPopExternal(void)50109 test_xmlXPathPopExternal(void) {
50110     int test_ret = 0;
50111 
50112 #if defined(LIBXML_XPATH_ENABLED)
50113     int mem_base;
50114     void * ret_val;
50115     xmlXPathParserContextPtr ctxt; /* an XPath parser context */
50116     int n_ctxt;
50117 
50118     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
50119         mem_base = xmlMemBlocks();
50120         ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
50121 
50122         ret_val = xmlXPathPopExternal(ctxt);
50123         desret_void_ptr(ret_val);
50124         call_tests++;
50125         des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
50126         xmlResetLastError();
50127         if (mem_base != xmlMemBlocks()) {
50128             printf("Leak of %d blocks found in xmlXPathPopExternal",
50129 	           xmlMemBlocks() - mem_base);
50130 	    test_ret++;
50131             printf(" %d", n_ctxt);
50132             printf("\n");
50133         }
50134     }
50135     function_tests++;
50136 #endif
50137 
50138     return(test_ret);
50139 }
50140 
50141 
50142 static int
test_xmlXPathPopNodeSet(void)50143 test_xmlXPathPopNodeSet(void) {
50144     int test_ret = 0;
50145 
50146 #if defined(LIBXML_XPATH_ENABLED)
50147     int mem_base;
50148     xmlNodeSetPtr ret_val;
50149     xmlXPathParserContextPtr ctxt; /* an XPath parser context */
50150     int n_ctxt;
50151 
50152     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
50153         mem_base = xmlMemBlocks();
50154         ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
50155 
50156         ret_val = xmlXPathPopNodeSet(ctxt);
50157         desret_xmlNodeSetPtr(ret_val);
50158         call_tests++;
50159         des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
50160         xmlResetLastError();
50161         if (mem_base != xmlMemBlocks()) {
50162             printf("Leak of %d blocks found in xmlXPathPopNodeSet",
50163 	           xmlMemBlocks() - mem_base);
50164 	    test_ret++;
50165             printf(" %d", n_ctxt);
50166             printf("\n");
50167         }
50168     }
50169     function_tests++;
50170 #endif
50171 
50172     return(test_ret);
50173 }
50174 
50175 
50176 static int
test_xmlXPathPopNumber(void)50177 test_xmlXPathPopNumber(void) {
50178     int test_ret = 0;
50179 
50180 #if defined(LIBXML_XPATH_ENABLED)
50181     int mem_base;
50182     double ret_val;
50183     xmlXPathParserContextPtr ctxt; /* an XPath parser context */
50184     int n_ctxt;
50185 
50186     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
50187         mem_base = xmlMemBlocks();
50188         ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
50189 
50190         ret_val = xmlXPathPopNumber(ctxt);
50191         desret_double(ret_val);
50192         call_tests++;
50193         des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
50194         xmlResetLastError();
50195         if (mem_base != xmlMemBlocks()) {
50196             printf("Leak of %d blocks found in xmlXPathPopNumber",
50197 	           xmlMemBlocks() - mem_base);
50198 	    test_ret++;
50199             printf(" %d", n_ctxt);
50200             printf("\n");
50201         }
50202     }
50203     function_tests++;
50204 #endif
50205 
50206     return(test_ret);
50207 }
50208 
50209 
50210 static int
test_xmlXPathPopString(void)50211 test_xmlXPathPopString(void) {
50212     int test_ret = 0;
50213 
50214 #if defined(LIBXML_XPATH_ENABLED)
50215     int mem_base;
50216     xmlChar * ret_val;
50217     xmlXPathParserContextPtr ctxt; /* an XPath parser context */
50218     int n_ctxt;
50219 
50220     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
50221         mem_base = xmlMemBlocks();
50222         ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
50223 
50224         ret_val = xmlXPathPopString(ctxt);
50225         desret_xmlChar_ptr(ret_val);
50226         call_tests++;
50227         des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
50228         xmlResetLastError();
50229         if (mem_base != xmlMemBlocks()) {
50230             printf("Leak of %d blocks found in xmlXPathPopString",
50231 	           xmlMemBlocks() - mem_base);
50232 	    test_ret++;
50233             printf(" %d", n_ctxt);
50234             printf("\n");
50235         }
50236     }
50237     function_tests++;
50238 #endif
50239 
50240     return(test_ret);
50241 }
50242 
50243 
50244 static int
test_xmlXPathPositionFunction(void)50245 test_xmlXPathPositionFunction(void) {
50246     int test_ret = 0;
50247 
50248 #if defined(LIBXML_XPATH_ENABLED)
50249     int mem_base;
50250     xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
50251     int n_ctxt;
50252     int nargs; /* the number of arguments */
50253     int n_nargs;
50254 
50255     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
50256     for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
50257         mem_base = xmlMemBlocks();
50258         ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
50259         nargs = gen_int(n_nargs, 1);
50260 
50261         xmlXPathPositionFunction(ctxt, nargs);
50262         call_tests++;
50263         des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
50264         des_int(n_nargs, nargs, 1);
50265         xmlResetLastError();
50266         if (mem_base != xmlMemBlocks()) {
50267             printf("Leak of %d blocks found in xmlXPathPositionFunction",
50268 	           xmlMemBlocks() - mem_base);
50269 	    test_ret++;
50270             printf(" %d", n_ctxt);
50271             printf(" %d", n_nargs);
50272             printf("\n");
50273         }
50274     }
50275     }
50276     function_tests++;
50277 #endif
50278 
50279     return(test_ret);
50280 }
50281 
50282 
50283 static int
test_xmlXPathRegisterAllFunctions(void)50284 test_xmlXPathRegisterAllFunctions(void) {
50285     int test_ret = 0;
50286 
50287 #if defined(LIBXML_XPATH_ENABLED)
50288     int mem_base;
50289     xmlXPathContextPtr ctxt; /* the XPath context */
50290     int n_ctxt;
50291 
50292     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathContextPtr;n_ctxt++) {
50293         mem_base = xmlMemBlocks();
50294         ctxt = gen_xmlXPathContextPtr(n_ctxt, 0);
50295 
50296         xmlXPathRegisterAllFunctions(ctxt);
50297         call_tests++;
50298         des_xmlXPathContextPtr(n_ctxt, ctxt, 0);
50299         xmlResetLastError();
50300         if (mem_base != xmlMemBlocks()) {
50301             printf("Leak of %d blocks found in xmlXPathRegisterAllFunctions",
50302 	           xmlMemBlocks() - mem_base);
50303 	    test_ret++;
50304             printf(" %d", n_ctxt);
50305             printf("\n");
50306         }
50307     }
50308     function_tests++;
50309 #endif
50310 
50311     return(test_ret);
50312 }
50313 
50314 
50315 static int
test_xmlXPathRegisterFunc(void)50316 test_xmlXPathRegisterFunc(void) {
50317     int test_ret = 0;
50318 
50319 
50320     /* missing type support */
50321     return(test_ret);
50322 }
50323 
50324 
50325 static int
test_xmlXPathRegisterFuncLookup(void)50326 test_xmlXPathRegisterFuncLookup(void) {
50327     int test_ret = 0;
50328 
50329 
50330     /* missing type support */
50331     return(test_ret);
50332 }
50333 
50334 
50335 static int
test_xmlXPathRegisterFuncNS(void)50336 test_xmlXPathRegisterFuncNS(void) {
50337     int test_ret = 0;
50338 
50339 
50340     /* missing type support */
50341     return(test_ret);
50342 }
50343 
50344 
50345 static int
test_xmlXPathRegisterNs(void)50346 test_xmlXPathRegisterNs(void) {
50347     int test_ret = 0;
50348 
50349 #if defined(LIBXML_XPATH_ENABLED)
50350     int mem_base;
50351     int ret_val;
50352     xmlXPathContextPtr ctxt; /* the XPath context */
50353     int n_ctxt;
50354     xmlChar * prefix; /* the namespace prefix cannot be NULL or empty string */
50355     int n_prefix;
50356     xmlChar * ns_uri; /* the namespace name */
50357     int n_ns_uri;
50358 
50359     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathContextPtr;n_ctxt++) {
50360     for (n_prefix = 0;n_prefix < gen_nb_const_xmlChar_ptr;n_prefix++) {
50361     for (n_ns_uri = 0;n_ns_uri < gen_nb_const_xmlChar_ptr;n_ns_uri++) {
50362         mem_base = xmlMemBlocks();
50363         ctxt = gen_xmlXPathContextPtr(n_ctxt, 0);
50364         prefix = gen_const_xmlChar_ptr(n_prefix, 1);
50365         ns_uri = gen_const_xmlChar_ptr(n_ns_uri, 2);
50366 
50367         ret_val = xmlXPathRegisterNs(ctxt, (const xmlChar *)prefix, (const xmlChar *)ns_uri);
50368         desret_int(ret_val);
50369         call_tests++;
50370         des_xmlXPathContextPtr(n_ctxt, ctxt, 0);
50371         des_const_xmlChar_ptr(n_prefix, (const xmlChar *)prefix, 1);
50372         des_const_xmlChar_ptr(n_ns_uri, (const xmlChar *)ns_uri, 2);
50373         xmlResetLastError();
50374         if (mem_base != xmlMemBlocks()) {
50375             printf("Leak of %d blocks found in xmlXPathRegisterNs",
50376 	           xmlMemBlocks() - mem_base);
50377 	    test_ret++;
50378             printf(" %d", n_ctxt);
50379             printf(" %d", n_prefix);
50380             printf(" %d", n_ns_uri);
50381             printf("\n");
50382         }
50383     }
50384     }
50385     }
50386     function_tests++;
50387 #endif
50388 
50389     return(test_ret);
50390 }
50391 
50392 
50393 static int
test_xmlXPathRegisterVariable(void)50394 test_xmlXPathRegisterVariable(void) {
50395     int test_ret = 0;
50396 
50397 #if defined(LIBXML_XPATH_ENABLED)
50398     int mem_base;
50399     int ret_val;
50400     xmlXPathContextPtr ctxt; /* the XPath context */
50401     int n_ctxt;
50402     xmlChar * name; /* the variable name */
50403     int n_name;
50404     xmlXPathObjectPtr value; /* the variable value or NULL */
50405     int n_value;
50406 
50407     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathContextPtr;n_ctxt++) {
50408     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
50409     for (n_value = 0;n_value < gen_nb_xmlXPathObjectPtr;n_value++) {
50410         mem_base = xmlMemBlocks();
50411         ctxt = gen_xmlXPathContextPtr(n_ctxt, 0);
50412         name = gen_const_xmlChar_ptr(n_name, 1);
50413         value = gen_xmlXPathObjectPtr(n_value, 2);
50414 
50415         ret_val = xmlXPathRegisterVariable(ctxt, (const xmlChar *)name, value);
50416         desret_int(ret_val);
50417         call_tests++;
50418         des_xmlXPathContextPtr(n_ctxt, ctxt, 0);
50419         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
50420         des_xmlXPathObjectPtr(n_value, value, 2);
50421         xmlResetLastError();
50422         if (mem_base != xmlMemBlocks()) {
50423             printf("Leak of %d blocks found in xmlXPathRegisterVariable",
50424 	           xmlMemBlocks() - mem_base);
50425 	    test_ret++;
50426             printf(" %d", n_ctxt);
50427             printf(" %d", n_name);
50428             printf(" %d", n_value);
50429             printf("\n");
50430         }
50431     }
50432     }
50433     }
50434     function_tests++;
50435 #endif
50436 
50437     return(test_ret);
50438 }
50439 
50440 
50441 static int
test_xmlXPathRegisterVariableLookup(void)50442 test_xmlXPathRegisterVariableLookup(void) {
50443     int test_ret = 0;
50444 
50445 
50446     /* missing type support */
50447     return(test_ret);
50448 }
50449 
50450 
50451 static int
test_xmlXPathRegisterVariableNS(void)50452 test_xmlXPathRegisterVariableNS(void) {
50453     int test_ret = 0;
50454 
50455 #if defined(LIBXML_XPATH_ENABLED)
50456     int mem_base;
50457     int ret_val;
50458     xmlXPathContextPtr ctxt; /* the XPath context */
50459     int n_ctxt;
50460     xmlChar * name; /* the variable name */
50461     int n_name;
50462     xmlChar * ns_uri; /* the variable namespace URI */
50463     int n_ns_uri;
50464     xmlXPathObjectPtr value; /* the variable value or NULL */
50465     int n_value;
50466 
50467     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathContextPtr;n_ctxt++) {
50468     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
50469     for (n_ns_uri = 0;n_ns_uri < gen_nb_const_xmlChar_ptr;n_ns_uri++) {
50470     for (n_value = 0;n_value < gen_nb_xmlXPathObjectPtr;n_value++) {
50471         mem_base = xmlMemBlocks();
50472         ctxt = gen_xmlXPathContextPtr(n_ctxt, 0);
50473         name = gen_const_xmlChar_ptr(n_name, 1);
50474         ns_uri = gen_const_xmlChar_ptr(n_ns_uri, 2);
50475         value = gen_xmlXPathObjectPtr(n_value, 3);
50476 
50477         ret_val = xmlXPathRegisterVariableNS(ctxt, (const xmlChar *)name, (const xmlChar *)ns_uri, value);
50478         desret_int(ret_val);
50479         call_tests++;
50480         des_xmlXPathContextPtr(n_ctxt, ctxt, 0);
50481         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
50482         des_const_xmlChar_ptr(n_ns_uri, (const xmlChar *)ns_uri, 2);
50483         des_xmlXPathObjectPtr(n_value, value, 3);
50484         xmlResetLastError();
50485         if (mem_base != xmlMemBlocks()) {
50486             printf("Leak of %d blocks found in xmlXPathRegisterVariableNS",
50487 	           xmlMemBlocks() - mem_base);
50488 	    test_ret++;
50489             printf(" %d", n_ctxt);
50490             printf(" %d", n_name);
50491             printf(" %d", n_ns_uri);
50492             printf(" %d", n_value);
50493             printf("\n");
50494         }
50495     }
50496     }
50497     }
50498     }
50499     function_tests++;
50500 #endif
50501 
50502     return(test_ret);
50503 }
50504 
50505 
50506 static int
test_xmlXPathRegisteredFuncsCleanup(void)50507 test_xmlXPathRegisteredFuncsCleanup(void) {
50508     int test_ret = 0;
50509 
50510 #if defined(LIBXML_XPATH_ENABLED)
50511     int mem_base;
50512     xmlXPathContextPtr ctxt; /* the XPath context */
50513     int n_ctxt;
50514 
50515     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathContextPtr;n_ctxt++) {
50516         mem_base = xmlMemBlocks();
50517         ctxt = gen_xmlXPathContextPtr(n_ctxt, 0);
50518 
50519         xmlXPathRegisteredFuncsCleanup(ctxt);
50520         call_tests++;
50521         des_xmlXPathContextPtr(n_ctxt, ctxt, 0);
50522         xmlResetLastError();
50523         if (mem_base != xmlMemBlocks()) {
50524             printf("Leak of %d blocks found in xmlXPathRegisteredFuncsCleanup",
50525 	           xmlMemBlocks() - mem_base);
50526 	    test_ret++;
50527             printf(" %d", n_ctxt);
50528             printf("\n");
50529         }
50530     }
50531     function_tests++;
50532 #endif
50533 
50534     return(test_ret);
50535 }
50536 
50537 
50538 static int
test_xmlXPathRegisteredNsCleanup(void)50539 test_xmlXPathRegisteredNsCleanup(void) {
50540     int test_ret = 0;
50541 
50542 #if defined(LIBXML_XPATH_ENABLED)
50543     int mem_base;
50544     xmlXPathContextPtr ctxt; /* the XPath context */
50545     int n_ctxt;
50546 
50547     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathContextPtr;n_ctxt++) {
50548         mem_base = xmlMemBlocks();
50549         ctxt = gen_xmlXPathContextPtr(n_ctxt, 0);
50550 
50551         xmlXPathRegisteredNsCleanup(ctxt);
50552         call_tests++;
50553         des_xmlXPathContextPtr(n_ctxt, ctxt, 0);
50554         xmlResetLastError();
50555         if (mem_base != xmlMemBlocks()) {
50556             printf("Leak of %d blocks found in xmlXPathRegisteredNsCleanup",
50557 	           xmlMemBlocks() - mem_base);
50558 	    test_ret++;
50559             printf(" %d", n_ctxt);
50560             printf("\n");
50561         }
50562     }
50563     function_tests++;
50564 #endif
50565 
50566     return(test_ret);
50567 }
50568 
50569 
50570 static int
test_xmlXPathRegisteredVariablesCleanup(void)50571 test_xmlXPathRegisteredVariablesCleanup(void) {
50572     int test_ret = 0;
50573 
50574 #if defined(LIBXML_XPATH_ENABLED)
50575     int mem_base;
50576     xmlXPathContextPtr ctxt; /* the XPath context */
50577     int n_ctxt;
50578 
50579     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathContextPtr;n_ctxt++) {
50580         mem_base = xmlMemBlocks();
50581         ctxt = gen_xmlXPathContextPtr(n_ctxt, 0);
50582 
50583         xmlXPathRegisteredVariablesCleanup(ctxt);
50584         call_tests++;
50585         des_xmlXPathContextPtr(n_ctxt, ctxt, 0);
50586         xmlResetLastError();
50587         if (mem_base != xmlMemBlocks()) {
50588             printf("Leak of %d blocks found in xmlXPathRegisteredVariablesCleanup",
50589 	           xmlMemBlocks() - mem_base);
50590 	    test_ret++;
50591             printf(" %d", n_ctxt);
50592             printf("\n");
50593         }
50594     }
50595     function_tests++;
50596 #endif
50597 
50598     return(test_ret);
50599 }
50600 
50601 
50602 static int
test_xmlXPathRoot(void)50603 test_xmlXPathRoot(void) {
50604     int test_ret = 0;
50605 
50606 #if defined(LIBXML_XPATH_ENABLED)
50607     int mem_base;
50608     xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
50609     int n_ctxt;
50610 
50611     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
50612         mem_base = xmlMemBlocks();
50613         ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
50614 
50615         xmlXPathRoot(ctxt);
50616         call_tests++;
50617         des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
50618         xmlResetLastError();
50619         if (mem_base != xmlMemBlocks()) {
50620             printf("Leak of %d blocks found in xmlXPathRoot",
50621 	           xmlMemBlocks() - mem_base);
50622 	    test_ret++;
50623             printf(" %d", n_ctxt);
50624             printf("\n");
50625         }
50626     }
50627     function_tests++;
50628 #endif
50629 
50630     return(test_ret);
50631 }
50632 
50633 
50634 static int
test_xmlXPathRoundFunction(void)50635 test_xmlXPathRoundFunction(void) {
50636     int test_ret = 0;
50637 
50638 #if defined(LIBXML_XPATH_ENABLED)
50639     int mem_base;
50640     xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
50641     int n_ctxt;
50642     int nargs; /* the number of arguments */
50643     int n_nargs;
50644 
50645     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
50646     for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
50647         mem_base = xmlMemBlocks();
50648         ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
50649         nargs = gen_int(n_nargs, 1);
50650 
50651         xmlXPathRoundFunction(ctxt, nargs);
50652         call_tests++;
50653         des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
50654         des_int(n_nargs, nargs, 1);
50655         xmlResetLastError();
50656         if (mem_base != xmlMemBlocks()) {
50657             printf("Leak of %d blocks found in xmlXPathRoundFunction",
50658 	           xmlMemBlocks() - mem_base);
50659 	    test_ret++;
50660             printf(" %d", n_ctxt);
50661             printf(" %d", n_nargs);
50662             printf("\n");
50663         }
50664     }
50665     }
50666     function_tests++;
50667 #endif
50668 
50669     return(test_ret);
50670 }
50671 
50672 
50673 static int
test_xmlXPathStartsWithFunction(void)50674 test_xmlXPathStartsWithFunction(void) {
50675     int test_ret = 0;
50676 
50677 #if defined(LIBXML_XPATH_ENABLED)
50678     int mem_base;
50679     xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
50680     int n_ctxt;
50681     int nargs; /* the number of arguments */
50682     int n_nargs;
50683 
50684     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
50685     for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
50686         mem_base = xmlMemBlocks();
50687         ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
50688         nargs = gen_int(n_nargs, 1);
50689 
50690         xmlXPathStartsWithFunction(ctxt, nargs);
50691         call_tests++;
50692         des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
50693         des_int(n_nargs, nargs, 1);
50694         xmlResetLastError();
50695         if (mem_base != xmlMemBlocks()) {
50696             printf("Leak of %d blocks found in xmlXPathStartsWithFunction",
50697 	           xmlMemBlocks() - mem_base);
50698 	    test_ret++;
50699             printf(" %d", n_ctxt);
50700             printf(" %d", n_nargs);
50701             printf("\n");
50702         }
50703     }
50704     }
50705     function_tests++;
50706 #endif
50707 
50708     return(test_ret);
50709 }
50710 
50711 
50712 static int
test_xmlXPathStringEvalNumber(void)50713 test_xmlXPathStringEvalNumber(void) {
50714     int test_ret = 0;
50715 
50716 #if defined(LIBXML_XPATH_ENABLED)
50717     int mem_base;
50718     double ret_val;
50719     xmlChar * str; /* A string to scan */
50720     int n_str;
50721 
50722     for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) {
50723         mem_base = xmlMemBlocks();
50724         str = gen_const_xmlChar_ptr(n_str, 0);
50725 
50726         ret_val = xmlXPathStringEvalNumber((const xmlChar *)str);
50727         desret_double(ret_val);
50728         call_tests++;
50729         des_const_xmlChar_ptr(n_str, (const xmlChar *)str, 0);
50730         xmlResetLastError();
50731         if (mem_base != xmlMemBlocks()) {
50732             printf("Leak of %d blocks found in xmlXPathStringEvalNumber",
50733 	           xmlMemBlocks() - mem_base);
50734 	    test_ret++;
50735             printf(" %d", n_str);
50736             printf("\n");
50737         }
50738     }
50739     function_tests++;
50740 #endif
50741 
50742     return(test_ret);
50743 }
50744 
50745 
50746 static int
test_xmlXPathStringFunction(void)50747 test_xmlXPathStringFunction(void) {
50748     int test_ret = 0;
50749 
50750 #if defined(LIBXML_XPATH_ENABLED)
50751     int mem_base;
50752     xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
50753     int n_ctxt;
50754     int nargs; /* the number of arguments */
50755     int n_nargs;
50756 
50757     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
50758     for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
50759         mem_base = xmlMemBlocks();
50760         ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
50761         nargs = gen_int(n_nargs, 1);
50762 
50763         xmlXPathStringFunction(ctxt, nargs);
50764         call_tests++;
50765         des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
50766         des_int(n_nargs, nargs, 1);
50767         xmlResetLastError();
50768         if (mem_base != xmlMemBlocks()) {
50769             printf("Leak of %d blocks found in xmlXPathStringFunction",
50770 	           xmlMemBlocks() - mem_base);
50771 	    test_ret++;
50772             printf(" %d", n_ctxt);
50773             printf(" %d", n_nargs);
50774             printf("\n");
50775         }
50776     }
50777     }
50778     function_tests++;
50779 #endif
50780 
50781     return(test_ret);
50782 }
50783 
50784 
50785 static int
test_xmlXPathStringLengthFunction(void)50786 test_xmlXPathStringLengthFunction(void) {
50787     int test_ret = 0;
50788 
50789 #if defined(LIBXML_XPATH_ENABLED)
50790     int mem_base;
50791     xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
50792     int n_ctxt;
50793     int nargs; /* the number of arguments */
50794     int n_nargs;
50795 
50796     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
50797     for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
50798         mem_base = xmlMemBlocks();
50799         ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
50800         nargs = gen_int(n_nargs, 1);
50801 
50802         xmlXPathStringLengthFunction(ctxt, nargs);
50803         call_tests++;
50804         des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
50805         des_int(n_nargs, nargs, 1);
50806         xmlResetLastError();
50807         if (mem_base != xmlMemBlocks()) {
50808             printf("Leak of %d blocks found in xmlXPathStringLengthFunction",
50809 	           xmlMemBlocks() - mem_base);
50810 	    test_ret++;
50811             printf(" %d", n_ctxt);
50812             printf(" %d", n_nargs);
50813             printf("\n");
50814         }
50815     }
50816     }
50817     function_tests++;
50818 #endif
50819 
50820     return(test_ret);
50821 }
50822 
50823 
50824 static int
test_xmlXPathSubValues(void)50825 test_xmlXPathSubValues(void) {
50826     int test_ret = 0;
50827 
50828 #if defined(LIBXML_XPATH_ENABLED)
50829     int mem_base;
50830     xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
50831     int n_ctxt;
50832 
50833     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
50834         mem_base = xmlMemBlocks();
50835         ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
50836 
50837         xmlXPathSubValues(ctxt);
50838         call_tests++;
50839         des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
50840         xmlResetLastError();
50841         if (mem_base != xmlMemBlocks()) {
50842             printf("Leak of %d blocks found in xmlXPathSubValues",
50843 	           xmlMemBlocks() - mem_base);
50844 	    test_ret++;
50845             printf(" %d", n_ctxt);
50846             printf("\n");
50847         }
50848     }
50849     function_tests++;
50850 #endif
50851 
50852     return(test_ret);
50853 }
50854 
50855 
50856 static int
test_xmlXPathSubstringAfterFunction(void)50857 test_xmlXPathSubstringAfterFunction(void) {
50858     int test_ret = 0;
50859 
50860 #if defined(LIBXML_XPATH_ENABLED)
50861     int mem_base;
50862     xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
50863     int n_ctxt;
50864     int nargs; /* the number of arguments */
50865     int n_nargs;
50866 
50867     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
50868     for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
50869         mem_base = xmlMemBlocks();
50870         ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
50871         nargs = gen_int(n_nargs, 1);
50872 
50873         xmlXPathSubstringAfterFunction(ctxt, nargs);
50874         call_tests++;
50875         des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
50876         des_int(n_nargs, nargs, 1);
50877         xmlResetLastError();
50878         if (mem_base != xmlMemBlocks()) {
50879             printf("Leak of %d blocks found in xmlXPathSubstringAfterFunction",
50880 	           xmlMemBlocks() - mem_base);
50881 	    test_ret++;
50882             printf(" %d", n_ctxt);
50883             printf(" %d", n_nargs);
50884             printf("\n");
50885         }
50886     }
50887     }
50888     function_tests++;
50889 #endif
50890 
50891     return(test_ret);
50892 }
50893 
50894 
50895 static int
test_xmlXPathSubstringBeforeFunction(void)50896 test_xmlXPathSubstringBeforeFunction(void) {
50897     int test_ret = 0;
50898 
50899 #if defined(LIBXML_XPATH_ENABLED)
50900     int mem_base;
50901     xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
50902     int n_ctxt;
50903     int nargs; /* the number of arguments */
50904     int n_nargs;
50905 
50906     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
50907     for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
50908         mem_base = xmlMemBlocks();
50909         ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
50910         nargs = gen_int(n_nargs, 1);
50911 
50912         xmlXPathSubstringBeforeFunction(ctxt, nargs);
50913         call_tests++;
50914         des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
50915         des_int(n_nargs, nargs, 1);
50916         xmlResetLastError();
50917         if (mem_base != xmlMemBlocks()) {
50918             printf("Leak of %d blocks found in xmlXPathSubstringBeforeFunction",
50919 	           xmlMemBlocks() - mem_base);
50920 	    test_ret++;
50921             printf(" %d", n_ctxt);
50922             printf(" %d", n_nargs);
50923             printf("\n");
50924         }
50925     }
50926     }
50927     function_tests++;
50928 #endif
50929 
50930     return(test_ret);
50931 }
50932 
50933 
50934 static int
test_xmlXPathSubstringFunction(void)50935 test_xmlXPathSubstringFunction(void) {
50936     int test_ret = 0;
50937 
50938 #if defined(LIBXML_XPATH_ENABLED)
50939     int mem_base;
50940     xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
50941     int n_ctxt;
50942     int nargs; /* the number of arguments */
50943     int n_nargs;
50944 
50945     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
50946     for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
50947         mem_base = xmlMemBlocks();
50948         ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
50949         nargs = gen_int(n_nargs, 1);
50950 
50951         xmlXPathSubstringFunction(ctxt, nargs);
50952         call_tests++;
50953         des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
50954         des_int(n_nargs, nargs, 1);
50955         xmlResetLastError();
50956         if (mem_base != xmlMemBlocks()) {
50957             printf("Leak of %d blocks found in xmlXPathSubstringFunction",
50958 	           xmlMemBlocks() - mem_base);
50959 	    test_ret++;
50960             printf(" %d", n_ctxt);
50961             printf(" %d", n_nargs);
50962             printf("\n");
50963         }
50964     }
50965     }
50966     function_tests++;
50967 #endif
50968 
50969     return(test_ret);
50970 }
50971 
50972 
50973 static int
test_xmlXPathSumFunction(void)50974 test_xmlXPathSumFunction(void) {
50975     int test_ret = 0;
50976 
50977 #if defined(LIBXML_XPATH_ENABLED)
50978     int mem_base;
50979     xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
50980     int n_ctxt;
50981     int nargs; /* the number of arguments */
50982     int n_nargs;
50983 
50984     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
50985     for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
50986         mem_base = xmlMemBlocks();
50987         ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
50988         nargs = gen_int(n_nargs, 1);
50989 
50990         xmlXPathSumFunction(ctxt, nargs);
50991         call_tests++;
50992         des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
50993         des_int(n_nargs, nargs, 1);
50994         xmlResetLastError();
50995         if (mem_base != xmlMemBlocks()) {
50996             printf("Leak of %d blocks found in xmlXPathSumFunction",
50997 	           xmlMemBlocks() - mem_base);
50998 	    test_ret++;
50999             printf(" %d", n_ctxt);
51000             printf(" %d", n_nargs);
51001             printf("\n");
51002         }
51003     }
51004     }
51005     function_tests++;
51006 #endif
51007 
51008     return(test_ret);
51009 }
51010 
51011 
51012 static int
test_xmlXPathTrailing(void)51013 test_xmlXPathTrailing(void) {
51014     int test_ret = 0;
51015 
51016 #if defined(LIBXML_XPATH_ENABLED)
51017     int mem_base;
51018     xmlNodeSetPtr ret_val;
51019     xmlNodeSetPtr nodes1; /* a node-set */
51020     int n_nodes1;
51021     xmlNodeSetPtr nodes2; /* a node-set */
51022     int n_nodes2;
51023 
51024     for (n_nodes1 = 0;n_nodes1 < gen_nb_xmlNodeSetPtr;n_nodes1++) {
51025     for (n_nodes2 = 0;n_nodes2 < gen_nb_xmlNodeSetPtr;n_nodes2++) {
51026         mem_base = xmlMemBlocks();
51027         nodes1 = gen_xmlNodeSetPtr(n_nodes1, 0);
51028         nodes2 = gen_xmlNodeSetPtr(n_nodes2, 1);
51029 
51030         ret_val = xmlXPathTrailing(nodes1, nodes2);
51031         desret_xmlNodeSetPtr(ret_val);
51032         call_tests++;
51033         des_xmlNodeSetPtr(n_nodes1, nodes1, 0);
51034         des_xmlNodeSetPtr(n_nodes2, nodes2, 1);
51035         xmlResetLastError();
51036         if (mem_base != xmlMemBlocks()) {
51037             printf("Leak of %d blocks found in xmlXPathTrailing",
51038 	           xmlMemBlocks() - mem_base);
51039 	    test_ret++;
51040             printf(" %d", n_nodes1);
51041             printf(" %d", n_nodes2);
51042             printf("\n");
51043         }
51044     }
51045     }
51046     function_tests++;
51047 #endif
51048 
51049     return(test_ret);
51050 }
51051 
51052 
51053 static int
test_xmlXPathTrailingSorted(void)51054 test_xmlXPathTrailingSorted(void) {
51055     int test_ret = 0;
51056 
51057 #if defined(LIBXML_XPATH_ENABLED)
51058     int mem_base;
51059     xmlNodeSetPtr ret_val;
51060     xmlNodeSetPtr nodes1; /* a node-set, sorted by document order */
51061     int n_nodes1;
51062     xmlNodeSetPtr nodes2; /* a node-set, sorted by document order */
51063     int n_nodes2;
51064 
51065     for (n_nodes1 = 0;n_nodes1 < gen_nb_xmlNodeSetPtr;n_nodes1++) {
51066     for (n_nodes2 = 0;n_nodes2 < gen_nb_xmlNodeSetPtr;n_nodes2++) {
51067         mem_base = xmlMemBlocks();
51068         nodes1 = gen_xmlNodeSetPtr(n_nodes1, 0);
51069         nodes2 = gen_xmlNodeSetPtr(n_nodes2, 1);
51070 
51071         ret_val = xmlXPathTrailingSorted(nodes1, nodes2);
51072         desret_xmlNodeSetPtr(ret_val);
51073         call_tests++;
51074         des_xmlNodeSetPtr(n_nodes1, nodes1, 0);
51075         des_xmlNodeSetPtr(n_nodes2, nodes2, 1);
51076         xmlResetLastError();
51077         if (mem_base != xmlMemBlocks()) {
51078             printf("Leak of %d blocks found in xmlXPathTrailingSorted",
51079 	           xmlMemBlocks() - mem_base);
51080 	    test_ret++;
51081             printf(" %d", n_nodes1);
51082             printf(" %d", n_nodes2);
51083             printf("\n");
51084         }
51085     }
51086     }
51087     function_tests++;
51088 #endif
51089 
51090     return(test_ret);
51091 }
51092 
51093 
51094 static int
test_xmlXPathTranslateFunction(void)51095 test_xmlXPathTranslateFunction(void) {
51096     int test_ret = 0;
51097 
51098 #if defined(LIBXML_XPATH_ENABLED)
51099     int mem_base;
51100     xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
51101     int n_ctxt;
51102     int nargs; /* the number of arguments */
51103     int n_nargs;
51104 
51105     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
51106     for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
51107         mem_base = xmlMemBlocks();
51108         ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
51109         nargs = gen_int(n_nargs, 1);
51110 
51111         xmlXPathTranslateFunction(ctxt, nargs);
51112         call_tests++;
51113         des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
51114         des_int(n_nargs, nargs, 1);
51115         xmlResetLastError();
51116         if (mem_base != xmlMemBlocks()) {
51117             printf("Leak of %d blocks found in xmlXPathTranslateFunction",
51118 	           xmlMemBlocks() - mem_base);
51119 	    test_ret++;
51120             printf(" %d", n_ctxt);
51121             printf(" %d", n_nargs);
51122             printf("\n");
51123         }
51124     }
51125     }
51126     function_tests++;
51127 #endif
51128 
51129     return(test_ret);
51130 }
51131 
51132 
51133 static int
test_xmlXPathTrueFunction(void)51134 test_xmlXPathTrueFunction(void) {
51135     int test_ret = 0;
51136 
51137 #if defined(LIBXML_XPATH_ENABLED)
51138     int mem_base;
51139     xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
51140     int n_ctxt;
51141     int nargs; /* the number of arguments */
51142     int n_nargs;
51143 
51144     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
51145     for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
51146         mem_base = xmlMemBlocks();
51147         ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
51148         nargs = gen_int(n_nargs, 1);
51149 
51150         xmlXPathTrueFunction(ctxt, nargs);
51151         call_tests++;
51152         des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
51153         des_int(n_nargs, nargs, 1);
51154         xmlResetLastError();
51155         if (mem_base != xmlMemBlocks()) {
51156             printf("Leak of %d blocks found in xmlXPathTrueFunction",
51157 	           xmlMemBlocks() - mem_base);
51158 	    test_ret++;
51159             printf(" %d", n_ctxt);
51160             printf(" %d", n_nargs);
51161             printf("\n");
51162         }
51163     }
51164     }
51165     function_tests++;
51166 #endif
51167 
51168     return(test_ret);
51169 }
51170 
51171 
51172 static int
test_xmlXPathValueFlipSign(void)51173 test_xmlXPathValueFlipSign(void) {
51174     int test_ret = 0;
51175 
51176 #if defined(LIBXML_XPATH_ENABLED)
51177     int mem_base;
51178     xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
51179     int n_ctxt;
51180 
51181     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
51182         mem_base = xmlMemBlocks();
51183         ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
51184 
51185         xmlXPathValueFlipSign(ctxt);
51186         call_tests++;
51187         des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
51188         xmlResetLastError();
51189         if (mem_base != xmlMemBlocks()) {
51190             printf("Leak of %d blocks found in xmlXPathValueFlipSign",
51191 	           xmlMemBlocks() - mem_base);
51192 	    test_ret++;
51193             printf(" %d", n_ctxt);
51194             printf("\n");
51195         }
51196     }
51197     function_tests++;
51198 #endif
51199 
51200     return(test_ret);
51201 }
51202 
51203 
51204 static int
test_xmlXPathVariableLookup(void)51205 test_xmlXPathVariableLookup(void) {
51206     int test_ret = 0;
51207 
51208 #if defined(LIBXML_XPATH_ENABLED)
51209     int mem_base;
51210     xmlXPathObjectPtr ret_val;
51211     xmlXPathContextPtr ctxt; /* the XPath context */
51212     int n_ctxt;
51213     xmlChar * name; /* the variable name */
51214     int n_name;
51215 
51216     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathContextPtr;n_ctxt++) {
51217     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
51218         mem_base = xmlMemBlocks();
51219         ctxt = gen_xmlXPathContextPtr(n_ctxt, 0);
51220         name = gen_const_xmlChar_ptr(n_name, 1);
51221 
51222         ret_val = xmlXPathVariableLookup(ctxt, (const xmlChar *)name);
51223         desret_xmlXPathObjectPtr(ret_val);
51224         call_tests++;
51225         des_xmlXPathContextPtr(n_ctxt, ctxt, 0);
51226         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
51227         xmlResetLastError();
51228         if (mem_base != xmlMemBlocks()) {
51229             printf("Leak of %d blocks found in xmlXPathVariableLookup",
51230 	           xmlMemBlocks() - mem_base);
51231 	    test_ret++;
51232             printf(" %d", n_ctxt);
51233             printf(" %d", n_name);
51234             printf("\n");
51235         }
51236     }
51237     }
51238     function_tests++;
51239 #endif
51240 
51241     return(test_ret);
51242 }
51243 
51244 
51245 static int
test_xmlXPathVariableLookupNS(void)51246 test_xmlXPathVariableLookupNS(void) {
51247     int test_ret = 0;
51248 
51249 #if defined(LIBXML_XPATH_ENABLED)
51250     int mem_base;
51251     xmlXPathObjectPtr ret_val;
51252     xmlXPathContextPtr ctxt; /* the XPath context */
51253     int n_ctxt;
51254     xmlChar * name; /* the variable name */
51255     int n_name;
51256     xmlChar * ns_uri; /* the variable namespace URI */
51257     int n_ns_uri;
51258 
51259     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathContextPtr;n_ctxt++) {
51260     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
51261     for (n_ns_uri = 0;n_ns_uri < gen_nb_const_xmlChar_ptr;n_ns_uri++) {
51262         mem_base = xmlMemBlocks();
51263         ctxt = gen_xmlXPathContextPtr(n_ctxt, 0);
51264         name = gen_const_xmlChar_ptr(n_name, 1);
51265         ns_uri = gen_const_xmlChar_ptr(n_ns_uri, 2);
51266 
51267         ret_val = xmlXPathVariableLookupNS(ctxt, (const xmlChar *)name, (const xmlChar *)ns_uri);
51268         desret_xmlXPathObjectPtr(ret_val);
51269         call_tests++;
51270         des_xmlXPathContextPtr(n_ctxt, ctxt, 0);
51271         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
51272         des_const_xmlChar_ptr(n_ns_uri, (const xmlChar *)ns_uri, 2);
51273         xmlResetLastError();
51274         if (mem_base != xmlMemBlocks()) {
51275             printf("Leak of %d blocks found in xmlXPathVariableLookupNS",
51276 	           xmlMemBlocks() - mem_base);
51277 	    test_ret++;
51278             printf(" %d", n_ctxt);
51279             printf(" %d", n_name);
51280             printf(" %d", n_ns_uri);
51281             printf("\n");
51282         }
51283     }
51284     }
51285     }
51286     function_tests++;
51287 #endif
51288 
51289     return(test_ret);
51290 }
51291 
51292 
51293 static int
test_xmlXPathWrapCString(void)51294 test_xmlXPathWrapCString(void) {
51295     int test_ret = 0;
51296 
51297 #if defined(LIBXML_XPATH_ENABLED)
51298     int mem_base;
51299     xmlXPathObjectPtr ret_val;
51300     char * val; /* the char * value */
51301     int n_val;
51302 
51303     for (n_val = 0;n_val < gen_nb_char_ptr;n_val++) {
51304         mem_base = xmlMemBlocks();
51305         val = gen_char_ptr(n_val, 0);
51306 
51307         ret_val = xmlXPathWrapCString(val);
51308         desret_xmlXPathObjectPtr(ret_val);
51309         call_tests++;
51310         des_char_ptr(n_val, val, 0);
51311         xmlResetLastError();
51312         if (mem_base != xmlMemBlocks()) {
51313             printf("Leak of %d blocks found in xmlXPathWrapCString",
51314 	           xmlMemBlocks() - mem_base);
51315 	    test_ret++;
51316             printf(" %d", n_val);
51317             printf("\n");
51318         }
51319     }
51320     function_tests++;
51321 #endif
51322 
51323     return(test_ret);
51324 }
51325 
51326 
51327 static int
test_xmlXPathWrapExternal(void)51328 test_xmlXPathWrapExternal(void) {
51329     int test_ret = 0;
51330 
51331 #if defined(LIBXML_XPATH_ENABLED)
51332     int mem_base;
51333     xmlXPathObjectPtr ret_val;
51334     void * val; /* the user data */
51335     int n_val;
51336 
51337     for (n_val = 0;n_val < gen_nb_void_ptr;n_val++) {
51338         mem_base = xmlMemBlocks();
51339         val = gen_void_ptr(n_val, 0);
51340 
51341         ret_val = xmlXPathWrapExternal(val);
51342         desret_xmlXPathObjectPtr(ret_val);
51343         call_tests++;
51344         des_void_ptr(n_val, val, 0);
51345         xmlResetLastError();
51346         if (mem_base != xmlMemBlocks()) {
51347             printf("Leak of %d blocks found in xmlXPathWrapExternal",
51348 	           xmlMemBlocks() - mem_base);
51349 	    test_ret++;
51350             printf(" %d", n_val);
51351             printf("\n");
51352         }
51353     }
51354     function_tests++;
51355 #endif
51356 
51357     return(test_ret);
51358 }
51359 
51360 
51361 static int
test_xmlXPathWrapNodeSet(void)51362 test_xmlXPathWrapNodeSet(void) {
51363     int test_ret = 0;
51364 
51365 #if defined(LIBXML_XPATH_ENABLED)
51366     int mem_base;
51367     xmlXPathObjectPtr ret_val;
51368     xmlNodeSetPtr val; /* the NodePtr value */
51369     int n_val;
51370 
51371     for (n_val = 0;n_val < gen_nb_xmlNodeSetPtr;n_val++) {
51372         mem_base = xmlMemBlocks();
51373         val = gen_xmlNodeSetPtr(n_val, 0);
51374 
51375         ret_val = xmlXPathWrapNodeSet(val);
51376         desret_xmlXPathObjectPtr(ret_val);
51377         call_tests++;
51378         des_xmlNodeSetPtr(n_val, val, 0);
51379         xmlResetLastError();
51380         if (mem_base != xmlMemBlocks()) {
51381             printf("Leak of %d blocks found in xmlXPathWrapNodeSet",
51382 	           xmlMemBlocks() - mem_base);
51383 	    test_ret++;
51384             printf(" %d", n_val);
51385             printf("\n");
51386         }
51387     }
51388     function_tests++;
51389 #endif
51390 
51391     return(test_ret);
51392 }
51393 
51394 
51395 static int
test_xmlXPatherror(void)51396 test_xmlXPatherror(void) {
51397     int test_ret = 0;
51398 
51399 #if defined(LIBXML_XPATH_ENABLED)
51400     int mem_base;
51401     xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
51402     int n_ctxt;
51403     const char * file; /* the file name */
51404     int n_file;
51405     int line; /* the line number */
51406     int n_line;
51407     int no; /* the error number */
51408     int n_no;
51409 
51410     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
51411     for (n_file = 0;n_file < gen_nb_filepath;n_file++) {
51412     for (n_line = 0;n_line < gen_nb_int;n_line++) {
51413     for (n_no = 0;n_no < gen_nb_int;n_no++) {
51414         mem_base = xmlMemBlocks();
51415         ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
51416         file = gen_filepath(n_file, 1);
51417         line = gen_int(n_line, 2);
51418         no = gen_int(n_no, 3);
51419 
51420         xmlXPatherror(ctxt, file, line, no);
51421         call_tests++;
51422         des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
51423         des_filepath(n_file, file, 1);
51424         des_int(n_line, line, 2);
51425         des_int(n_no, no, 3);
51426         xmlResetLastError();
51427         if (mem_base != xmlMemBlocks()) {
51428             printf("Leak of %d blocks found in xmlXPatherror",
51429 	           xmlMemBlocks() - mem_base);
51430 	    test_ret++;
51431             printf(" %d", n_ctxt);
51432             printf(" %d", n_file);
51433             printf(" %d", n_line);
51434             printf(" %d", n_no);
51435             printf("\n");
51436         }
51437     }
51438     }
51439     }
51440     }
51441     function_tests++;
51442 #endif
51443 
51444     return(test_ret);
51445 }
51446 
51447 static int
test_xpathInternals(void)51448 test_xpathInternals(void) {
51449     int test_ret = 0;
51450 
51451     if (quiet == 0) printf("Testing xpathInternals : 106 of 117 functions ...\n");
51452     test_ret += test_valuePop();
51453     test_ret += test_valuePush();
51454     test_ret += test_xmlXPathAddValues();
51455     test_ret += test_xmlXPathBooleanFunction();
51456     test_ret += test_xmlXPathCeilingFunction();
51457     test_ret += test_xmlXPathCompareValues();
51458     test_ret += test_xmlXPathConcatFunction();
51459     test_ret += test_xmlXPathContainsFunction();
51460     test_ret += test_xmlXPathCountFunction();
51461     test_ret += test_xmlXPathDebugDumpCompExpr();
51462     test_ret += test_xmlXPathDebugDumpObject();
51463     test_ret += test_xmlXPathDifference();
51464     test_ret += test_xmlXPathDistinct();
51465     test_ret += test_xmlXPathDistinctSorted();
51466     test_ret += test_xmlXPathDivValues();
51467     test_ret += test_xmlXPathEqualValues();
51468     test_ret += test_xmlXPathErr();
51469     test_ret += test_xmlXPathEvalExpr();
51470     test_ret += test_xmlXPathEvaluatePredicateResult();
51471     test_ret += test_xmlXPathFalseFunction();
51472     test_ret += test_xmlXPathFloorFunction();
51473     test_ret += test_xmlXPathFunctionLookup();
51474     test_ret += test_xmlXPathFunctionLookupNS();
51475     test_ret += test_xmlXPathHasSameNodes();
51476     test_ret += test_xmlXPathIdFunction();
51477     test_ret += test_xmlXPathIntersection();
51478     test_ret += test_xmlXPathIsNodeType();
51479     test_ret += test_xmlXPathLangFunction();
51480     test_ret += test_xmlXPathLastFunction();
51481     test_ret += test_xmlXPathLeading();
51482     test_ret += test_xmlXPathLeadingSorted();
51483     test_ret += test_xmlXPathLocalNameFunction();
51484     test_ret += test_xmlXPathModValues();
51485     test_ret += test_xmlXPathMultValues();
51486     test_ret += test_xmlXPathNamespaceURIFunction();
51487     test_ret += test_xmlXPathNewBoolean();
51488     test_ret += test_xmlXPathNewCString();
51489     test_ret += test_xmlXPathNewFloat();
51490     test_ret += test_xmlXPathNewNodeSet();
51491     test_ret += test_xmlXPathNewNodeSetList();
51492     test_ret += test_xmlXPathNewParserContext();
51493     test_ret += test_xmlXPathNewString();
51494     test_ret += test_xmlXPathNextAncestor();
51495     test_ret += test_xmlXPathNextAncestorOrSelf();
51496     test_ret += test_xmlXPathNextAttribute();
51497     test_ret += test_xmlXPathNextChild();
51498     test_ret += test_xmlXPathNextDescendant();
51499     test_ret += test_xmlXPathNextDescendantOrSelf();
51500     test_ret += test_xmlXPathNextFollowing();
51501     test_ret += test_xmlXPathNextFollowingSibling();
51502     test_ret += test_xmlXPathNextNamespace();
51503     test_ret += test_xmlXPathNextParent();
51504     test_ret += test_xmlXPathNextPreceding();
51505     test_ret += test_xmlXPathNextPrecedingSibling();
51506     test_ret += test_xmlXPathNextSelf();
51507     test_ret += test_xmlXPathNodeLeading();
51508     test_ret += test_xmlXPathNodeLeadingSorted();
51509     test_ret += test_xmlXPathNodeSetAdd();
51510     test_ret += test_xmlXPathNodeSetAddNs();
51511     test_ret += test_xmlXPathNodeSetAddUnique();
51512     test_ret += test_xmlXPathNodeSetContains();
51513     test_ret += test_xmlXPathNodeSetDel();
51514     test_ret += test_xmlXPathNodeSetMerge();
51515     test_ret += test_xmlXPathNodeSetRemove();
51516     test_ret += test_xmlXPathNodeSetSort();
51517     test_ret += test_xmlXPathNodeTrailing();
51518     test_ret += test_xmlXPathNodeTrailingSorted();
51519     test_ret += test_xmlXPathNormalizeFunction();
51520     test_ret += test_xmlXPathNotEqualValues();
51521     test_ret += test_xmlXPathNotFunction();
51522     test_ret += test_xmlXPathNsLookup();
51523     test_ret += test_xmlXPathNumberFunction();
51524     test_ret += test_xmlXPathParseNCName();
51525     test_ret += test_xmlXPathParseName();
51526     test_ret += test_xmlXPathPopBoolean();
51527     test_ret += test_xmlXPathPopExternal();
51528     test_ret += test_xmlXPathPopNodeSet();
51529     test_ret += test_xmlXPathPopNumber();
51530     test_ret += test_xmlXPathPopString();
51531     test_ret += test_xmlXPathPositionFunction();
51532     test_ret += test_xmlXPathRegisterAllFunctions();
51533     test_ret += test_xmlXPathRegisterFunc();
51534     test_ret += test_xmlXPathRegisterFuncLookup();
51535     test_ret += test_xmlXPathRegisterFuncNS();
51536     test_ret += test_xmlXPathRegisterNs();
51537     test_ret += test_xmlXPathRegisterVariable();
51538     test_ret += test_xmlXPathRegisterVariableLookup();
51539     test_ret += test_xmlXPathRegisterVariableNS();
51540     test_ret += test_xmlXPathRegisteredFuncsCleanup();
51541     test_ret += test_xmlXPathRegisteredNsCleanup();
51542     test_ret += test_xmlXPathRegisteredVariablesCleanup();
51543     test_ret += test_xmlXPathRoot();
51544     test_ret += test_xmlXPathRoundFunction();
51545     test_ret += test_xmlXPathStartsWithFunction();
51546     test_ret += test_xmlXPathStringEvalNumber();
51547     test_ret += test_xmlXPathStringFunction();
51548     test_ret += test_xmlXPathStringLengthFunction();
51549     test_ret += test_xmlXPathSubValues();
51550     test_ret += test_xmlXPathSubstringAfterFunction();
51551     test_ret += test_xmlXPathSubstringBeforeFunction();
51552     test_ret += test_xmlXPathSubstringFunction();
51553     test_ret += test_xmlXPathSumFunction();
51554     test_ret += test_xmlXPathTrailing();
51555     test_ret += test_xmlXPathTrailingSorted();
51556     test_ret += test_xmlXPathTranslateFunction();
51557     test_ret += test_xmlXPathTrueFunction();
51558     test_ret += test_xmlXPathValueFlipSign();
51559     test_ret += test_xmlXPathVariableLookup();
51560     test_ret += test_xmlXPathVariableLookupNS();
51561     test_ret += test_xmlXPathWrapCString();
51562     test_ret += test_xmlXPathWrapExternal();
51563     test_ret += test_xmlXPathWrapNodeSet();
51564     test_ret += test_xmlXPatherror();
51565 
51566     if (test_ret != 0)
51567 	printf("Module xpathInternals: %d errors\n", test_ret);
51568     return(test_ret);
51569 }
51570 
51571 static int
test_xmlXPtrBuildNodeList(void)51572 test_xmlXPtrBuildNodeList(void) {
51573     int test_ret = 0;
51574 
51575 #if defined(LIBXML_XPTR_ENABLED)
51576     int mem_base;
51577     xmlNodePtr ret_val;
51578     xmlXPathObjectPtr obj; /* the XPointer result from the evaluation. */
51579     int n_obj;
51580 
51581     for (n_obj = 0;n_obj < gen_nb_xmlXPathObjectPtr;n_obj++) {
51582         mem_base = xmlMemBlocks();
51583         obj = gen_xmlXPathObjectPtr(n_obj, 0);
51584 
51585         ret_val = xmlXPtrBuildNodeList(obj);
51586         desret_xmlNodePtr(ret_val);
51587         call_tests++;
51588         des_xmlXPathObjectPtr(n_obj, obj, 0);
51589         xmlResetLastError();
51590         if (mem_base != xmlMemBlocks()) {
51591             printf("Leak of %d blocks found in xmlXPtrBuildNodeList",
51592 	           xmlMemBlocks() - mem_base);
51593 	    test_ret++;
51594             printf(" %d", n_obj);
51595             printf("\n");
51596         }
51597     }
51598     function_tests++;
51599 #endif
51600 
51601     return(test_ret);
51602 }
51603 
51604 
51605 static int
test_xmlXPtrEval(void)51606 test_xmlXPtrEval(void) {
51607     int test_ret = 0;
51608 
51609 #if defined(LIBXML_XPTR_ENABLED)
51610     int mem_base;
51611     xmlXPathObjectPtr ret_val;
51612     xmlChar * str; /* the XPointer expression */
51613     int n_str;
51614     xmlXPathContextPtr ctx; /* the XPointer context */
51615     int n_ctx;
51616 
51617     for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) {
51618     for (n_ctx = 0;n_ctx < gen_nb_xmlXPathContextPtr;n_ctx++) {
51619         mem_base = xmlMemBlocks();
51620         str = gen_const_xmlChar_ptr(n_str, 0);
51621         ctx = gen_xmlXPathContextPtr(n_ctx, 1);
51622 
51623         ret_val = xmlXPtrEval((const xmlChar *)str, ctx);
51624         desret_xmlXPathObjectPtr(ret_val);
51625         call_tests++;
51626         des_const_xmlChar_ptr(n_str, (const xmlChar *)str, 0);
51627         des_xmlXPathContextPtr(n_ctx, ctx, 1);
51628         xmlResetLastError();
51629         if (mem_base != xmlMemBlocks()) {
51630             printf("Leak of %d blocks found in xmlXPtrEval",
51631 	           xmlMemBlocks() - mem_base);
51632 	    test_ret++;
51633             printf(" %d", n_str);
51634             printf(" %d", n_ctx);
51635             printf("\n");
51636         }
51637     }
51638     }
51639     function_tests++;
51640 #endif
51641 
51642     return(test_ret);
51643 }
51644 
51645 
51646 static int
test_xmlXPtrEvalRangePredicate(void)51647 test_xmlXPtrEvalRangePredicate(void) {
51648     int test_ret = 0;
51649 
51650 #if defined(LIBXML_XPTR_ENABLED)
51651     int mem_base;
51652     xmlXPathParserContextPtr ctxt; /* the XPointer Parser context */
51653     int n_ctxt;
51654 
51655     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
51656         mem_base = xmlMemBlocks();
51657         ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
51658 
51659         xmlXPtrEvalRangePredicate(ctxt);
51660         call_tests++;
51661         des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
51662         xmlResetLastError();
51663         if (mem_base != xmlMemBlocks()) {
51664             printf("Leak of %d blocks found in xmlXPtrEvalRangePredicate",
51665 	           xmlMemBlocks() - mem_base);
51666 	    test_ret++;
51667             printf(" %d", n_ctxt);
51668             printf("\n");
51669         }
51670     }
51671     function_tests++;
51672 #endif
51673 
51674     return(test_ret);
51675 }
51676 
51677 #ifdef LIBXML_XPTR_ENABLED
51678 
51679 #define gen_nb_xmlLocationSetPtr 1
gen_xmlLocationSetPtr(int no ATTRIBUTE_UNUSED,int nr ATTRIBUTE_UNUSED)51680 static xmlLocationSetPtr gen_xmlLocationSetPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
51681     return(NULL);
51682 }
des_xmlLocationSetPtr(int no ATTRIBUTE_UNUSED,xmlLocationSetPtr val ATTRIBUTE_UNUSED,int nr ATTRIBUTE_UNUSED)51683 static void des_xmlLocationSetPtr(int no ATTRIBUTE_UNUSED, xmlLocationSetPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
51684 }
51685 #endif
51686 
51687 
51688 static int
test_xmlXPtrLocationSetAdd(void)51689 test_xmlXPtrLocationSetAdd(void) {
51690     int test_ret = 0;
51691 
51692 #if defined(LIBXML_XPTR_ENABLED)
51693     int mem_base;
51694     xmlLocationSetPtr cur; /* the initial range set */
51695     int n_cur;
51696     xmlXPathObjectPtr val; /* a new xmlXPathObjectPtr */
51697     int n_val;
51698 
51699     for (n_cur = 0;n_cur < gen_nb_xmlLocationSetPtr;n_cur++) {
51700     for (n_val = 0;n_val < gen_nb_xmlXPathObjectPtr;n_val++) {
51701         mem_base = xmlMemBlocks();
51702         cur = gen_xmlLocationSetPtr(n_cur, 0);
51703         val = gen_xmlXPathObjectPtr(n_val, 1);
51704 
51705         xmlXPtrLocationSetAdd(cur, val);
51706         call_tests++;
51707         des_xmlLocationSetPtr(n_cur, cur, 0);
51708         des_xmlXPathObjectPtr(n_val, val, 1);
51709         xmlResetLastError();
51710         if (mem_base != xmlMemBlocks()) {
51711             printf("Leak of %d blocks found in xmlXPtrLocationSetAdd",
51712 	           xmlMemBlocks() - mem_base);
51713 	    test_ret++;
51714             printf(" %d", n_cur);
51715             printf(" %d", n_val);
51716             printf("\n");
51717         }
51718     }
51719     }
51720     function_tests++;
51721 #endif
51722 
51723     return(test_ret);
51724 }
51725 
51726 
51727 static int
test_xmlXPtrLocationSetCreate(void)51728 test_xmlXPtrLocationSetCreate(void) {
51729     int test_ret = 0;
51730 
51731 
51732     /* missing type support */
51733     return(test_ret);
51734 }
51735 
51736 
51737 static int
test_xmlXPtrLocationSetDel(void)51738 test_xmlXPtrLocationSetDel(void) {
51739     int test_ret = 0;
51740 
51741 #if defined(LIBXML_XPTR_ENABLED)
51742     int mem_base;
51743     xmlLocationSetPtr cur; /* the initial range set */
51744     int n_cur;
51745     xmlXPathObjectPtr val; /* an xmlXPathObjectPtr */
51746     int n_val;
51747 
51748     for (n_cur = 0;n_cur < gen_nb_xmlLocationSetPtr;n_cur++) {
51749     for (n_val = 0;n_val < gen_nb_xmlXPathObjectPtr;n_val++) {
51750         mem_base = xmlMemBlocks();
51751         cur = gen_xmlLocationSetPtr(n_cur, 0);
51752         val = gen_xmlXPathObjectPtr(n_val, 1);
51753 
51754         xmlXPtrLocationSetDel(cur, val);
51755         call_tests++;
51756         des_xmlLocationSetPtr(n_cur, cur, 0);
51757         des_xmlXPathObjectPtr(n_val, val, 1);
51758         xmlResetLastError();
51759         if (mem_base != xmlMemBlocks()) {
51760             printf("Leak of %d blocks found in xmlXPtrLocationSetDel",
51761 	           xmlMemBlocks() - mem_base);
51762 	    test_ret++;
51763             printf(" %d", n_cur);
51764             printf(" %d", n_val);
51765             printf("\n");
51766         }
51767     }
51768     }
51769     function_tests++;
51770 #endif
51771 
51772     return(test_ret);
51773 }
51774 
51775 
51776 static int
test_xmlXPtrLocationSetMerge(void)51777 test_xmlXPtrLocationSetMerge(void) {
51778     int test_ret = 0;
51779 
51780 
51781     /* missing type support */
51782     return(test_ret);
51783 }
51784 
51785 
51786 static int
test_xmlXPtrLocationSetRemove(void)51787 test_xmlXPtrLocationSetRemove(void) {
51788     int test_ret = 0;
51789 
51790 #if defined(LIBXML_XPTR_ENABLED)
51791     int mem_base;
51792     xmlLocationSetPtr cur; /* the initial range set */
51793     int n_cur;
51794     int val; /* the index to remove */
51795     int n_val;
51796 
51797     for (n_cur = 0;n_cur < gen_nb_xmlLocationSetPtr;n_cur++) {
51798     for (n_val = 0;n_val < gen_nb_int;n_val++) {
51799         mem_base = xmlMemBlocks();
51800         cur = gen_xmlLocationSetPtr(n_cur, 0);
51801         val = gen_int(n_val, 1);
51802 
51803         xmlXPtrLocationSetRemove(cur, val);
51804         call_tests++;
51805         des_xmlLocationSetPtr(n_cur, cur, 0);
51806         des_int(n_val, val, 1);
51807         xmlResetLastError();
51808         if (mem_base != xmlMemBlocks()) {
51809             printf("Leak of %d blocks found in xmlXPtrLocationSetRemove",
51810 	           xmlMemBlocks() - mem_base);
51811 	    test_ret++;
51812             printf(" %d", n_cur);
51813             printf(" %d", n_val);
51814             printf("\n");
51815         }
51816     }
51817     }
51818     function_tests++;
51819 #endif
51820 
51821     return(test_ret);
51822 }
51823 
51824 
51825 static int
test_xmlXPtrNewCollapsedRange(void)51826 test_xmlXPtrNewCollapsedRange(void) {
51827     int test_ret = 0;
51828 
51829 #if defined(LIBXML_XPTR_ENABLED)
51830     int mem_base;
51831     xmlXPathObjectPtr ret_val;
51832     xmlNodePtr start; /* the starting and ending node */
51833     int n_start;
51834 
51835     for (n_start = 0;n_start < gen_nb_xmlNodePtr;n_start++) {
51836         mem_base = xmlMemBlocks();
51837         start = gen_xmlNodePtr(n_start, 0);
51838 
51839         ret_val = xmlXPtrNewCollapsedRange(start);
51840         desret_xmlXPathObjectPtr(ret_val);
51841         call_tests++;
51842         des_xmlNodePtr(n_start, start, 0);
51843         xmlResetLastError();
51844         if (mem_base != xmlMemBlocks()) {
51845             printf("Leak of %d blocks found in xmlXPtrNewCollapsedRange",
51846 	           xmlMemBlocks() - mem_base);
51847 	    test_ret++;
51848             printf(" %d", n_start);
51849             printf("\n");
51850         }
51851     }
51852     function_tests++;
51853 #endif
51854 
51855     return(test_ret);
51856 }
51857 
51858 
51859 static int
test_xmlXPtrNewContext(void)51860 test_xmlXPtrNewContext(void) {
51861     int test_ret = 0;
51862 
51863 
51864     /* missing type support */
51865     return(test_ret);
51866 }
51867 
51868 
51869 static int
test_xmlXPtrNewLocationSetNodeSet(void)51870 test_xmlXPtrNewLocationSetNodeSet(void) {
51871     int test_ret = 0;
51872 
51873 #if defined(LIBXML_XPTR_ENABLED)
51874     int mem_base;
51875     xmlXPathObjectPtr ret_val;
51876     xmlNodeSetPtr set; /* a node set */
51877     int n_set;
51878 
51879     for (n_set = 0;n_set < gen_nb_xmlNodeSetPtr;n_set++) {
51880         mem_base = xmlMemBlocks();
51881         set = gen_xmlNodeSetPtr(n_set, 0);
51882 
51883         ret_val = xmlXPtrNewLocationSetNodeSet(set);
51884         desret_xmlXPathObjectPtr(ret_val);
51885         call_tests++;
51886         des_xmlNodeSetPtr(n_set, set, 0);
51887         xmlResetLastError();
51888         if (mem_base != xmlMemBlocks()) {
51889             printf("Leak of %d blocks found in xmlXPtrNewLocationSetNodeSet",
51890 	           xmlMemBlocks() - mem_base);
51891 	    test_ret++;
51892             printf(" %d", n_set);
51893             printf("\n");
51894         }
51895     }
51896     function_tests++;
51897 #endif
51898 
51899     return(test_ret);
51900 }
51901 
51902 
51903 static int
test_xmlXPtrNewLocationSetNodes(void)51904 test_xmlXPtrNewLocationSetNodes(void) {
51905     int test_ret = 0;
51906 
51907 #if defined(LIBXML_XPTR_ENABLED)
51908     int mem_base;
51909     xmlXPathObjectPtr ret_val;
51910     xmlNodePtr start; /* the start NodePtr value */
51911     int n_start;
51912     xmlNodePtr end; /* the end NodePtr value or NULL */
51913     int n_end;
51914 
51915     for (n_start = 0;n_start < gen_nb_xmlNodePtr;n_start++) {
51916     for (n_end = 0;n_end < gen_nb_xmlNodePtr;n_end++) {
51917         mem_base = xmlMemBlocks();
51918         start = gen_xmlNodePtr(n_start, 0);
51919         end = gen_xmlNodePtr(n_end, 1);
51920 
51921         ret_val = xmlXPtrNewLocationSetNodes(start, end);
51922         desret_xmlXPathObjectPtr(ret_val);
51923         call_tests++;
51924         des_xmlNodePtr(n_start, start, 0);
51925         des_xmlNodePtr(n_end, end, 1);
51926         xmlResetLastError();
51927         if (mem_base != xmlMemBlocks()) {
51928             printf("Leak of %d blocks found in xmlXPtrNewLocationSetNodes",
51929 	           xmlMemBlocks() - mem_base);
51930 	    test_ret++;
51931             printf(" %d", n_start);
51932             printf(" %d", n_end);
51933             printf("\n");
51934         }
51935     }
51936     }
51937     function_tests++;
51938 #endif
51939 
51940     return(test_ret);
51941 }
51942 
51943 
51944 static int
test_xmlXPtrNewRange(void)51945 test_xmlXPtrNewRange(void) {
51946     int test_ret = 0;
51947 
51948 #if defined(LIBXML_XPTR_ENABLED)
51949     int mem_base;
51950     xmlXPathObjectPtr ret_val;
51951     xmlNodePtr start; /* the starting node */
51952     int n_start;
51953     int startindex; /* the start index */
51954     int n_startindex;
51955     xmlNodePtr end; /* the ending point */
51956     int n_end;
51957     int endindex; /* the ending index */
51958     int n_endindex;
51959 
51960     for (n_start = 0;n_start < gen_nb_xmlNodePtr;n_start++) {
51961     for (n_startindex = 0;n_startindex < gen_nb_int;n_startindex++) {
51962     for (n_end = 0;n_end < gen_nb_xmlNodePtr;n_end++) {
51963     for (n_endindex = 0;n_endindex < gen_nb_int;n_endindex++) {
51964         mem_base = xmlMemBlocks();
51965         start = gen_xmlNodePtr(n_start, 0);
51966         startindex = gen_int(n_startindex, 1);
51967         end = gen_xmlNodePtr(n_end, 2);
51968         endindex = gen_int(n_endindex, 3);
51969 
51970         ret_val = xmlXPtrNewRange(start, startindex, end, endindex);
51971         desret_xmlXPathObjectPtr(ret_val);
51972         call_tests++;
51973         des_xmlNodePtr(n_start, start, 0);
51974         des_int(n_startindex, startindex, 1);
51975         des_xmlNodePtr(n_end, end, 2);
51976         des_int(n_endindex, endindex, 3);
51977         xmlResetLastError();
51978         if (mem_base != xmlMemBlocks()) {
51979             printf("Leak of %d blocks found in xmlXPtrNewRange",
51980 	           xmlMemBlocks() - mem_base);
51981 	    test_ret++;
51982             printf(" %d", n_start);
51983             printf(" %d", n_startindex);
51984             printf(" %d", n_end);
51985             printf(" %d", n_endindex);
51986             printf("\n");
51987         }
51988     }
51989     }
51990     }
51991     }
51992     function_tests++;
51993 #endif
51994 
51995     return(test_ret);
51996 }
51997 
51998 
51999 static int
test_xmlXPtrNewRangeNodeObject(void)52000 test_xmlXPtrNewRangeNodeObject(void) {
52001     int test_ret = 0;
52002 
52003 #if defined(LIBXML_XPTR_ENABLED)
52004     int mem_base;
52005     xmlXPathObjectPtr ret_val;
52006     xmlNodePtr start; /* the starting node */
52007     int n_start;
52008     xmlXPathObjectPtr end; /* the ending object */
52009     int n_end;
52010 
52011     for (n_start = 0;n_start < gen_nb_xmlNodePtr;n_start++) {
52012     for (n_end = 0;n_end < gen_nb_xmlXPathObjectPtr;n_end++) {
52013         mem_base = xmlMemBlocks();
52014         start = gen_xmlNodePtr(n_start, 0);
52015         end = gen_xmlXPathObjectPtr(n_end, 1);
52016 
52017         ret_val = xmlXPtrNewRangeNodeObject(start, end);
52018         desret_xmlXPathObjectPtr(ret_val);
52019         call_tests++;
52020         des_xmlNodePtr(n_start, start, 0);
52021         des_xmlXPathObjectPtr(n_end, end, 1);
52022         xmlResetLastError();
52023         if (mem_base != xmlMemBlocks()) {
52024             printf("Leak of %d blocks found in xmlXPtrNewRangeNodeObject",
52025 	           xmlMemBlocks() - mem_base);
52026 	    test_ret++;
52027             printf(" %d", n_start);
52028             printf(" %d", n_end);
52029             printf("\n");
52030         }
52031     }
52032     }
52033     function_tests++;
52034 #endif
52035 
52036     return(test_ret);
52037 }
52038 
52039 
52040 static int
test_xmlXPtrNewRangeNodePoint(void)52041 test_xmlXPtrNewRangeNodePoint(void) {
52042     int test_ret = 0;
52043 
52044 #if defined(LIBXML_XPTR_ENABLED)
52045     int mem_base;
52046     xmlXPathObjectPtr ret_val;
52047     xmlNodePtr start; /* the starting node */
52048     int n_start;
52049     xmlXPathObjectPtr end; /* the ending point */
52050     int n_end;
52051 
52052     for (n_start = 0;n_start < gen_nb_xmlNodePtr;n_start++) {
52053     for (n_end = 0;n_end < gen_nb_xmlXPathObjectPtr;n_end++) {
52054         mem_base = xmlMemBlocks();
52055         start = gen_xmlNodePtr(n_start, 0);
52056         end = gen_xmlXPathObjectPtr(n_end, 1);
52057 
52058         ret_val = xmlXPtrNewRangeNodePoint(start, end);
52059         desret_xmlXPathObjectPtr(ret_val);
52060         call_tests++;
52061         des_xmlNodePtr(n_start, start, 0);
52062         des_xmlXPathObjectPtr(n_end, end, 1);
52063         xmlResetLastError();
52064         if (mem_base != xmlMemBlocks()) {
52065             printf("Leak of %d blocks found in xmlXPtrNewRangeNodePoint",
52066 	           xmlMemBlocks() - mem_base);
52067 	    test_ret++;
52068             printf(" %d", n_start);
52069             printf(" %d", n_end);
52070             printf("\n");
52071         }
52072     }
52073     }
52074     function_tests++;
52075 #endif
52076 
52077     return(test_ret);
52078 }
52079 
52080 
52081 static int
test_xmlXPtrNewRangeNodes(void)52082 test_xmlXPtrNewRangeNodes(void) {
52083     int test_ret = 0;
52084 
52085 #if defined(LIBXML_XPTR_ENABLED)
52086     int mem_base;
52087     xmlXPathObjectPtr ret_val;
52088     xmlNodePtr start; /* the starting node */
52089     int n_start;
52090     xmlNodePtr end; /* the ending node */
52091     int n_end;
52092 
52093     for (n_start = 0;n_start < gen_nb_xmlNodePtr;n_start++) {
52094     for (n_end = 0;n_end < gen_nb_xmlNodePtr;n_end++) {
52095         mem_base = xmlMemBlocks();
52096         start = gen_xmlNodePtr(n_start, 0);
52097         end = gen_xmlNodePtr(n_end, 1);
52098 
52099         ret_val = xmlXPtrNewRangeNodes(start, end);
52100         desret_xmlXPathObjectPtr(ret_val);
52101         call_tests++;
52102         des_xmlNodePtr(n_start, start, 0);
52103         des_xmlNodePtr(n_end, end, 1);
52104         xmlResetLastError();
52105         if (mem_base != xmlMemBlocks()) {
52106             printf("Leak of %d blocks found in xmlXPtrNewRangeNodes",
52107 	           xmlMemBlocks() - mem_base);
52108 	    test_ret++;
52109             printf(" %d", n_start);
52110             printf(" %d", n_end);
52111             printf("\n");
52112         }
52113     }
52114     }
52115     function_tests++;
52116 #endif
52117 
52118     return(test_ret);
52119 }
52120 
52121 
52122 static int
test_xmlXPtrNewRangePointNode(void)52123 test_xmlXPtrNewRangePointNode(void) {
52124     int test_ret = 0;
52125 
52126 #if defined(LIBXML_XPTR_ENABLED)
52127     int mem_base;
52128     xmlXPathObjectPtr ret_val;
52129     xmlXPathObjectPtr start; /* the starting point */
52130     int n_start;
52131     xmlNodePtr end; /* the ending node */
52132     int n_end;
52133 
52134     for (n_start = 0;n_start < gen_nb_xmlXPathObjectPtr;n_start++) {
52135     for (n_end = 0;n_end < gen_nb_xmlNodePtr;n_end++) {
52136         mem_base = xmlMemBlocks();
52137         start = gen_xmlXPathObjectPtr(n_start, 0);
52138         end = gen_xmlNodePtr(n_end, 1);
52139 
52140         ret_val = xmlXPtrNewRangePointNode(start, end);
52141         desret_xmlXPathObjectPtr(ret_val);
52142         call_tests++;
52143         des_xmlXPathObjectPtr(n_start, start, 0);
52144         des_xmlNodePtr(n_end, end, 1);
52145         xmlResetLastError();
52146         if (mem_base != xmlMemBlocks()) {
52147             printf("Leak of %d blocks found in xmlXPtrNewRangePointNode",
52148 	           xmlMemBlocks() - mem_base);
52149 	    test_ret++;
52150             printf(" %d", n_start);
52151             printf(" %d", n_end);
52152             printf("\n");
52153         }
52154     }
52155     }
52156     function_tests++;
52157 #endif
52158 
52159     return(test_ret);
52160 }
52161 
52162 
52163 static int
test_xmlXPtrNewRangePoints(void)52164 test_xmlXPtrNewRangePoints(void) {
52165     int test_ret = 0;
52166 
52167 #if defined(LIBXML_XPTR_ENABLED)
52168     int mem_base;
52169     xmlXPathObjectPtr ret_val;
52170     xmlXPathObjectPtr start; /* the starting point */
52171     int n_start;
52172     xmlXPathObjectPtr end; /* the ending point */
52173     int n_end;
52174 
52175     for (n_start = 0;n_start < gen_nb_xmlXPathObjectPtr;n_start++) {
52176     for (n_end = 0;n_end < gen_nb_xmlXPathObjectPtr;n_end++) {
52177         mem_base = xmlMemBlocks();
52178         start = gen_xmlXPathObjectPtr(n_start, 0);
52179         end = gen_xmlXPathObjectPtr(n_end, 1);
52180 
52181         ret_val = xmlXPtrNewRangePoints(start, end);
52182         desret_xmlXPathObjectPtr(ret_val);
52183         call_tests++;
52184         des_xmlXPathObjectPtr(n_start, start, 0);
52185         des_xmlXPathObjectPtr(n_end, end, 1);
52186         xmlResetLastError();
52187         if (mem_base != xmlMemBlocks()) {
52188             printf("Leak of %d blocks found in xmlXPtrNewRangePoints",
52189 	           xmlMemBlocks() - mem_base);
52190 	    test_ret++;
52191             printf(" %d", n_start);
52192             printf(" %d", n_end);
52193             printf("\n");
52194         }
52195     }
52196     }
52197     function_tests++;
52198 #endif
52199 
52200     return(test_ret);
52201 }
52202 
52203 
52204 static int
test_xmlXPtrRangeToFunction(void)52205 test_xmlXPtrRangeToFunction(void) {
52206     int test_ret = 0;
52207 
52208 #if defined(LIBXML_XPTR_ENABLED)
52209     int mem_base;
52210     xmlXPathParserContextPtr ctxt; /* the XPointer Parser context */
52211     int n_ctxt;
52212     int nargs; /* the number of args */
52213     int n_nargs;
52214 
52215     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
52216     for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
52217         mem_base = xmlMemBlocks();
52218         ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
52219         nargs = gen_int(n_nargs, 1);
52220 
52221         xmlXPtrRangeToFunction(ctxt, nargs);
52222         call_tests++;
52223         des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
52224         des_int(n_nargs, nargs, 1);
52225         xmlResetLastError();
52226         if (mem_base != xmlMemBlocks()) {
52227             printf("Leak of %d blocks found in xmlXPtrRangeToFunction",
52228 	           xmlMemBlocks() - mem_base);
52229 	    test_ret++;
52230             printf(" %d", n_ctxt);
52231             printf(" %d", n_nargs);
52232             printf("\n");
52233         }
52234     }
52235     }
52236     function_tests++;
52237 #endif
52238 
52239     return(test_ret);
52240 }
52241 
52242 
52243 static int
test_xmlXPtrWrapLocationSet(void)52244 test_xmlXPtrWrapLocationSet(void) {
52245     int test_ret = 0;
52246 
52247 #if defined(LIBXML_XPTR_ENABLED)
52248     int mem_base;
52249     xmlXPathObjectPtr ret_val;
52250     xmlLocationSetPtr val; /* the LocationSet value */
52251     int n_val;
52252 
52253     for (n_val = 0;n_val < gen_nb_xmlLocationSetPtr;n_val++) {
52254         mem_base = xmlMemBlocks();
52255         val = gen_xmlLocationSetPtr(n_val, 0);
52256 
52257         ret_val = xmlXPtrWrapLocationSet(val);
52258         desret_xmlXPathObjectPtr(ret_val);
52259         call_tests++;
52260         des_xmlLocationSetPtr(n_val, val, 0);
52261         xmlResetLastError();
52262         if (mem_base != xmlMemBlocks()) {
52263             printf("Leak of %d blocks found in xmlXPtrWrapLocationSet",
52264 	           xmlMemBlocks() - mem_base);
52265 	    test_ret++;
52266             printf(" %d", n_val);
52267             printf("\n");
52268         }
52269     }
52270     function_tests++;
52271 #endif
52272 
52273     return(test_ret);
52274 }
52275 
52276 static int
test_xpointer(void)52277 test_xpointer(void) {
52278     int test_ret = 0;
52279 
52280     if (quiet == 0) printf("Testing xpointer : 17 of 21 functions ...\n");
52281     test_ret += test_xmlXPtrBuildNodeList();
52282     test_ret += test_xmlXPtrEval();
52283     test_ret += test_xmlXPtrEvalRangePredicate();
52284     test_ret += test_xmlXPtrLocationSetAdd();
52285     test_ret += test_xmlXPtrLocationSetCreate();
52286     test_ret += test_xmlXPtrLocationSetDel();
52287     test_ret += test_xmlXPtrLocationSetMerge();
52288     test_ret += test_xmlXPtrLocationSetRemove();
52289     test_ret += test_xmlXPtrNewCollapsedRange();
52290     test_ret += test_xmlXPtrNewContext();
52291     test_ret += test_xmlXPtrNewLocationSetNodeSet();
52292     test_ret += test_xmlXPtrNewLocationSetNodes();
52293     test_ret += test_xmlXPtrNewRange();
52294     test_ret += test_xmlXPtrNewRangeNodeObject();
52295     test_ret += test_xmlXPtrNewRangeNodePoint();
52296     test_ret += test_xmlXPtrNewRangeNodes();
52297     test_ret += test_xmlXPtrNewRangePointNode();
52298     test_ret += test_xmlXPtrNewRangePoints();
52299     test_ret += test_xmlXPtrRangeToFunction();
52300     test_ret += test_xmlXPtrWrapLocationSet();
52301 
52302     if (test_ret != 0)
52303 	printf("Module xpointer: %d errors\n", test_ret);
52304     return(test_ret);
52305 }
52306 static int
test_module(const char * module)52307 test_module(const char *module) {
52308     if (!strcmp(module, "HTMLparser")) return(test_HTMLparser());
52309     if (!strcmp(module, "HTMLtree")) return(test_HTMLtree());
52310     if (!strcmp(module, "SAX2")) return(test_SAX2());
52311     if (!strcmp(module, "c14n")) return(test_c14n());
52312     if (!strcmp(module, "catalog")) return(test_catalog());
52313     if (!strcmp(module, "chvalid")) return(test_chvalid());
52314     if (!strcmp(module, "debugXML")) return(test_debugXML());
52315     if (!strcmp(module, "dict")) return(test_dict());
52316     if (!strcmp(module, "encoding")) return(test_encoding());
52317     if (!strcmp(module, "entities")) return(test_entities());
52318     if (!strcmp(module, "hash")) return(test_hash());
52319     if (!strcmp(module, "list")) return(test_list());
52320     if (!strcmp(module, "nanoftp")) return(test_nanoftp());
52321     if (!strcmp(module, "nanohttp")) return(test_nanohttp());
52322     if (!strcmp(module, "parser")) return(test_parser());
52323     if (!strcmp(module, "parserInternals")) return(test_parserInternals());
52324     if (!strcmp(module, "pattern")) return(test_pattern());
52325     if (!strcmp(module, "relaxng")) return(test_relaxng());
52326     if (!strcmp(module, "schemasInternals")) return(test_schemasInternals());
52327     if (!strcmp(module, "schematron")) return(test_schematron());
52328     if (!strcmp(module, "tree")) return(test_tree());
52329     if (!strcmp(module, "uri")) return(test_uri());
52330     if (!strcmp(module, "valid")) return(test_valid());
52331     if (!strcmp(module, "xinclude")) return(test_xinclude());
52332     if (!strcmp(module, "xmlIO")) return(test_xmlIO());
52333     if (!strcmp(module, "xmlautomata")) return(test_xmlautomata());
52334     if (!strcmp(module, "xmlerror")) return(test_xmlerror());
52335     if (!strcmp(module, "xmlmodule")) return(test_xmlmodule());
52336     if (!strcmp(module, "xmlreader")) return(test_xmlreader());
52337     if (!strcmp(module, "xmlregexp")) return(test_xmlregexp());
52338     if (!strcmp(module, "xmlsave")) return(test_xmlsave());
52339     if (!strcmp(module, "xmlschemas")) return(test_xmlschemas());
52340     if (!strcmp(module, "xmlschemastypes")) return(test_xmlschemastypes());
52341     if (!strcmp(module, "xmlstring")) return(test_xmlstring());
52342     if (!strcmp(module, "xmlunicode")) return(test_xmlunicode());
52343     if (!strcmp(module, "xmlwriter")) return(test_xmlwriter());
52344     if (!strcmp(module, "xpath")) return(test_xpath());
52345     if (!strcmp(module, "xpathInternals")) return(test_xpathInternals());
52346     if (!strcmp(module, "xpointer")) return(test_xpointer());
52347     return(0);
52348 }
52349