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 (unused) */
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 (unused) */
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 (unused) */
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 (unused) */
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 required): -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 encoding 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 encoding 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 encoding 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 (must not be NULL) */
13615     int n_doc;
13616     xmlSAXHandlerPtr sax; /* the SAX handler block (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 (must not be NULL) */
13691     int n_doc;
13692     xmlSAXHandlerPtr sax; /* the SAX handler block (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 block (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 information */
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 instance 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 transcoding */
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 transcoding */
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_xmlPopOutputCallbacks(void)29241 test_xmlPopOutputCallbacks(void) {
29242     int test_ret = 0;
29243 
29244 #if defined(LIBXML_OUTPUT_ENABLED)
29245     int mem_base;
29246     int ret_val;
29247 
29248         mem_base = xmlMemBlocks();
29249 
29250         ret_val = xmlPopOutputCallbacks();
29251         desret_int(ret_val);
29252         call_tests++;
29253         xmlResetLastError();
29254         if (mem_base != xmlMemBlocks()) {
29255             printf("Leak of %d blocks found in xmlPopOutputCallbacks",
29256 	           xmlMemBlocks() - mem_base);
29257 	    test_ret++;
29258             printf("\n");
29259         }
29260     function_tests++;
29261 #endif
29262 
29263     return(test_ret);
29264 }
29265 
29266 
29267 static int
test_xmlRegisterDefaultInputCallbacks(void)29268 test_xmlRegisterDefaultInputCallbacks(void) {
29269     int test_ret = 0;
29270 
29271     int mem_base;
29272 
29273         mem_base = xmlMemBlocks();
29274 
29275         xmlRegisterDefaultInputCallbacks();
29276         call_tests++;
29277         xmlResetLastError();
29278         if (mem_base != xmlMemBlocks()) {
29279             printf("Leak of %d blocks found in xmlRegisterDefaultInputCallbacks",
29280 	           xmlMemBlocks() - mem_base);
29281 	    test_ret++;
29282             printf("\n");
29283         }
29284     function_tests++;
29285 
29286     return(test_ret);
29287 }
29288 
29289 
29290 static int
test_xmlRegisterDefaultOutputCallbacks(void)29291 test_xmlRegisterDefaultOutputCallbacks(void) {
29292     int test_ret = 0;
29293 
29294 #if defined(LIBXML_OUTPUT_ENABLED)
29295     int mem_base;
29296 
29297         mem_base = xmlMemBlocks();
29298 
29299         xmlRegisterDefaultOutputCallbacks();
29300         call_tests++;
29301         xmlResetLastError();
29302         if (mem_base != xmlMemBlocks()) {
29303             printf("Leak of %d blocks found in xmlRegisterDefaultOutputCallbacks",
29304 	           xmlMemBlocks() - mem_base);
29305 	    test_ret++;
29306             printf("\n");
29307         }
29308     function_tests++;
29309 #endif
29310 
29311     return(test_ret);
29312 }
29313 
29314 
29315 static int
test_xmlRegisterHTTPPostCallbacks(void)29316 test_xmlRegisterHTTPPostCallbacks(void) {
29317     int test_ret = 0;
29318 
29319 #if defined(LIBXML_OUTPUT_ENABLED) && defined(LIBXML_HTTP_ENABLED)
29320     int mem_base;
29321 
29322         mem_base = xmlMemBlocks();
29323 
29324         xmlRegisterHTTPPostCallbacks();
29325         call_tests++;
29326         xmlResetLastError();
29327         if (mem_base != xmlMemBlocks()) {
29328             printf("Leak of %d blocks found in xmlRegisterHTTPPostCallbacks",
29329 	           xmlMemBlocks() - mem_base);
29330 	    test_ret++;
29331             printf("\n");
29332         }
29333     function_tests++;
29334 #endif
29335 
29336     return(test_ret);
29337 }
29338 
29339 static int
test_xmlIO(void)29340 test_xmlIO(void) {
29341     int test_ret = 0;
29342 
29343     if (quiet == 0) printf("Testing xmlIO : 41 of 51 functions ...\n");
29344     test_ret += test_xmlAllocOutputBuffer();
29345     test_ret += test_xmlAllocParserInputBuffer();
29346     test_ret += test_xmlCheckFilename();
29347     test_ret += test_xmlCheckHTTPInput();
29348     test_ret += test_xmlCleanupInputCallbacks();
29349     test_ret += test_xmlCleanupOutputCallbacks();
29350     test_ret += test_xmlFileClose();
29351     test_ret += test_xmlFileMatch();
29352     test_ret += test_xmlFileOpen();
29353     test_ret += test_xmlFileRead();
29354     test_ret += test_xmlIOFTPClose();
29355     test_ret += test_xmlIOFTPMatch();
29356     test_ret += test_xmlIOFTPOpen();
29357     test_ret += test_xmlIOFTPRead();
29358     test_ret += test_xmlIOHTTPClose();
29359     test_ret += test_xmlIOHTTPMatch();
29360     test_ret += test_xmlIOHTTPOpen();
29361     test_ret += test_xmlIOHTTPRead();
29362     test_ret += test_xmlNoNetExternalEntityLoader();
29363     test_ret += test_xmlNormalizeWindowsPath();
29364     test_ret += test_xmlOutputBufferCreateBuffer();
29365     test_ret += test_xmlOutputBufferCreateFd();
29366     test_ret += test_xmlOutputBufferCreateFile();
29367     test_ret += test_xmlOutputBufferCreateFilename();
29368     test_ret += test_xmlOutputBufferFlush();
29369     test_ret += test_xmlOutputBufferGetContent();
29370     test_ret += test_xmlOutputBufferGetSize();
29371     test_ret += test_xmlOutputBufferWrite();
29372     test_ret += test_xmlOutputBufferWriteEscape();
29373     test_ret += test_xmlOutputBufferWriteString();
29374     test_ret += test_xmlParserGetDirectory();
29375     test_ret += test_xmlParserInputBufferCreateFd();
29376     test_ret += test_xmlParserInputBufferCreateFile();
29377     test_ret += test_xmlParserInputBufferCreateFilename();
29378     test_ret += test_xmlParserInputBufferCreateMem();
29379     test_ret += test_xmlParserInputBufferCreateStatic();
29380     test_ret += test_xmlParserInputBufferGrow();
29381     test_ret += test_xmlParserInputBufferPush();
29382     test_ret += test_xmlParserInputBufferRead();
29383     test_ret += test_xmlPopInputCallbacks();
29384     test_ret += test_xmlPopOutputCallbacks();
29385     test_ret += test_xmlRegisterDefaultInputCallbacks();
29386     test_ret += test_xmlRegisterDefaultOutputCallbacks();
29387     test_ret += test_xmlRegisterHTTPPostCallbacks();
29388 
29389     if (test_ret != 0)
29390 	printf("Module xmlIO: %d errors\n", test_ret);
29391     return(test_ret);
29392 }
29393 
29394 static int
test_xmlAutomataCompile(void)29395 test_xmlAutomataCompile(void) {
29396     int test_ret = 0;
29397 
29398 
29399     /* missing type support */
29400     return(test_ret);
29401 }
29402 
29403 
29404 static int
test_xmlAutomataGetInitState(void)29405 test_xmlAutomataGetInitState(void) {
29406     int test_ret = 0;
29407 
29408 
29409     /* missing type support */
29410     return(test_ret);
29411 }
29412 
29413 #ifdef LIBXML_AUTOMATA_ENABLED
29414 
29415 #define gen_nb_xmlAutomataPtr 1
gen_xmlAutomataPtr(int no ATTRIBUTE_UNUSED,int nr ATTRIBUTE_UNUSED)29416 static xmlAutomataPtr gen_xmlAutomataPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
29417     return(NULL);
29418 }
des_xmlAutomataPtr(int no ATTRIBUTE_UNUSED,xmlAutomataPtr val ATTRIBUTE_UNUSED,int nr ATTRIBUTE_UNUSED)29419 static void des_xmlAutomataPtr(int no ATTRIBUTE_UNUSED, xmlAutomataPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
29420 }
29421 #endif
29422 
29423 
29424 static int
test_xmlAutomataIsDeterminist(void)29425 test_xmlAutomataIsDeterminist(void) {
29426     int test_ret = 0;
29427 
29428 #if defined(LIBXML_REGEXP_ENABLED) && defined(LIBXML_AUTOMATA_ENABLED)
29429     int mem_base;
29430     int ret_val;
29431     xmlAutomataPtr am; /* an automata */
29432     int n_am;
29433 
29434     for (n_am = 0;n_am < gen_nb_xmlAutomataPtr;n_am++) {
29435         mem_base = xmlMemBlocks();
29436         am = gen_xmlAutomataPtr(n_am, 0);
29437 
29438         ret_val = xmlAutomataIsDeterminist(am);
29439         desret_int(ret_val);
29440         call_tests++;
29441         des_xmlAutomataPtr(n_am, am, 0);
29442         xmlResetLastError();
29443         if (mem_base != xmlMemBlocks()) {
29444             printf("Leak of %d blocks found in xmlAutomataIsDeterminist",
29445 	           xmlMemBlocks() - mem_base);
29446 	    test_ret++;
29447             printf(" %d", n_am);
29448             printf("\n");
29449         }
29450     }
29451     function_tests++;
29452 #endif
29453 
29454     return(test_ret);
29455 }
29456 
29457 
29458 static int
test_xmlAutomataNewAllTrans(void)29459 test_xmlAutomataNewAllTrans(void) {
29460     int test_ret = 0;
29461 
29462 
29463     /* missing type support */
29464     return(test_ret);
29465 }
29466 
29467 
29468 static int
test_xmlAutomataNewCountTrans(void)29469 test_xmlAutomataNewCountTrans(void) {
29470     int test_ret = 0;
29471 
29472 
29473     /* missing type support */
29474     return(test_ret);
29475 }
29476 
29477 
29478 static int
test_xmlAutomataNewCountTrans2(void)29479 test_xmlAutomataNewCountTrans2(void) {
29480     int test_ret = 0;
29481 
29482 
29483     /* missing type support */
29484     return(test_ret);
29485 }
29486 
29487 
29488 static int
test_xmlAutomataNewCountedTrans(void)29489 test_xmlAutomataNewCountedTrans(void) {
29490     int test_ret = 0;
29491 
29492 
29493     /* missing type support */
29494     return(test_ret);
29495 }
29496 
29497 
29498 static int
test_xmlAutomataNewCounter(void)29499 test_xmlAutomataNewCounter(void) {
29500     int test_ret = 0;
29501 
29502 #if defined(LIBXML_REGEXP_ENABLED) && defined(LIBXML_AUTOMATA_ENABLED)
29503     int mem_base;
29504     int ret_val;
29505     xmlAutomataPtr am; /* an automata */
29506     int n_am;
29507     int min; /* the minimal value on the counter */
29508     int n_min;
29509     int max; /* the maximal value on the counter */
29510     int n_max;
29511 
29512     for (n_am = 0;n_am < gen_nb_xmlAutomataPtr;n_am++) {
29513     for (n_min = 0;n_min < gen_nb_int;n_min++) {
29514     for (n_max = 0;n_max < gen_nb_int;n_max++) {
29515         mem_base = xmlMemBlocks();
29516         am = gen_xmlAutomataPtr(n_am, 0);
29517         min = gen_int(n_min, 1);
29518         max = gen_int(n_max, 2);
29519 
29520         ret_val = xmlAutomataNewCounter(am, min, max);
29521         desret_int(ret_val);
29522         call_tests++;
29523         des_xmlAutomataPtr(n_am, am, 0);
29524         des_int(n_min, min, 1);
29525         des_int(n_max, max, 2);
29526         xmlResetLastError();
29527         if (mem_base != xmlMemBlocks()) {
29528             printf("Leak of %d blocks found in xmlAutomataNewCounter",
29529 	           xmlMemBlocks() - mem_base);
29530 	    test_ret++;
29531             printf(" %d", n_am);
29532             printf(" %d", n_min);
29533             printf(" %d", n_max);
29534             printf("\n");
29535         }
29536     }
29537     }
29538     }
29539     function_tests++;
29540 #endif
29541 
29542     return(test_ret);
29543 }
29544 
29545 
29546 static int
test_xmlAutomataNewCounterTrans(void)29547 test_xmlAutomataNewCounterTrans(void) {
29548     int test_ret = 0;
29549 
29550 
29551     /* missing type support */
29552     return(test_ret);
29553 }
29554 
29555 
29556 static int
test_xmlAutomataNewEpsilon(void)29557 test_xmlAutomataNewEpsilon(void) {
29558     int test_ret = 0;
29559 
29560 
29561     /* missing type support */
29562     return(test_ret);
29563 }
29564 
29565 
29566 static int
test_xmlAutomataNewNegTrans(void)29567 test_xmlAutomataNewNegTrans(void) {
29568     int test_ret = 0;
29569 
29570 
29571     /* missing type support */
29572     return(test_ret);
29573 }
29574 
29575 
29576 static int
test_xmlAutomataNewOnceTrans(void)29577 test_xmlAutomataNewOnceTrans(void) {
29578     int test_ret = 0;
29579 
29580 
29581     /* missing type support */
29582     return(test_ret);
29583 }
29584 
29585 
29586 static int
test_xmlAutomataNewOnceTrans2(void)29587 test_xmlAutomataNewOnceTrans2(void) {
29588     int test_ret = 0;
29589 
29590 
29591     /* missing type support */
29592     return(test_ret);
29593 }
29594 
29595 
29596 static int
test_xmlAutomataNewState(void)29597 test_xmlAutomataNewState(void) {
29598     int test_ret = 0;
29599 
29600 
29601     /* missing type support */
29602     return(test_ret);
29603 }
29604 
29605 
29606 static int
test_xmlAutomataNewTransition(void)29607 test_xmlAutomataNewTransition(void) {
29608     int test_ret = 0;
29609 
29610 
29611     /* missing type support */
29612     return(test_ret);
29613 }
29614 
29615 
29616 static int
test_xmlAutomataNewTransition2(void)29617 test_xmlAutomataNewTransition2(void) {
29618     int test_ret = 0;
29619 
29620 
29621     /* missing type support */
29622     return(test_ret);
29623 }
29624 
29625 #ifdef LIBXML_AUTOMATA_ENABLED
29626 
29627 #define gen_nb_xmlAutomataStatePtr 1
gen_xmlAutomataStatePtr(int no ATTRIBUTE_UNUSED,int nr ATTRIBUTE_UNUSED)29628 static xmlAutomataStatePtr gen_xmlAutomataStatePtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
29629     return(NULL);
29630 }
des_xmlAutomataStatePtr(int no ATTRIBUTE_UNUSED,xmlAutomataStatePtr val ATTRIBUTE_UNUSED,int nr ATTRIBUTE_UNUSED)29631 static void des_xmlAutomataStatePtr(int no ATTRIBUTE_UNUSED, xmlAutomataStatePtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
29632 }
29633 #endif
29634 
29635 
29636 static int
test_xmlAutomataSetFinalState(void)29637 test_xmlAutomataSetFinalState(void) {
29638     int test_ret = 0;
29639 
29640 #if defined(LIBXML_REGEXP_ENABLED) && defined(LIBXML_AUTOMATA_ENABLED)
29641     int mem_base;
29642     int ret_val;
29643     xmlAutomataPtr am; /* an automata */
29644     int n_am;
29645     xmlAutomataStatePtr state; /* a state in this automata */
29646     int n_state;
29647 
29648     for (n_am = 0;n_am < gen_nb_xmlAutomataPtr;n_am++) {
29649     for (n_state = 0;n_state < gen_nb_xmlAutomataStatePtr;n_state++) {
29650         mem_base = xmlMemBlocks();
29651         am = gen_xmlAutomataPtr(n_am, 0);
29652         state = gen_xmlAutomataStatePtr(n_state, 1);
29653 
29654         ret_val = xmlAutomataSetFinalState(am, state);
29655         desret_int(ret_val);
29656         call_tests++;
29657         des_xmlAutomataPtr(n_am, am, 0);
29658         des_xmlAutomataStatePtr(n_state, state, 1);
29659         xmlResetLastError();
29660         if (mem_base != xmlMemBlocks()) {
29661             printf("Leak of %d blocks found in xmlAutomataSetFinalState",
29662 	           xmlMemBlocks() - mem_base);
29663 	    test_ret++;
29664             printf(" %d", n_am);
29665             printf(" %d", n_state);
29666             printf("\n");
29667         }
29668     }
29669     }
29670     function_tests++;
29671 #endif
29672 
29673     return(test_ret);
29674 }
29675 
29676 
29677 static int
test_xmlNewAutomata(void)29678 test_xmlNewAutomata(void) {
29679     int test_ret = 0;
29680 
29681 
29682     /* missing type support */
29683     return(test_ret);
29684 }
29685 
29686 static int
test_xmlautomata(void)29687 test_xmlautomata(void) {
29688     int test_ret = 0;
29689 
29690     if (quiet == 0) printf("Testing xmlautomata : 3 of 19 functions ...\n");
29691     test_ret += test_xmlAutomataCompile();
29692     test_ret += test_xmlAutomataGetInitState();
29693     test_ret += test_xmlAutomataIsDeterminist();
29694     test_ret += test_xmlAutomataNewAllTrans();
29695     test_ret += test_xmlAutomataNewCountTrans();
29696     test_ret += test_xmlAutomataNewCountTrans2();
29697     test_ret += test_xmlAutomataNewCountedTrans();
29698     test_ret += test_xmlAutomataNewCounter();
29699     test_ret += test_xmlAutomataNewCounterTrans();
29700     test_ret += test_xmlAutomataNewEpsilon();
29701     test_ret += test_xmlAutomataNewNegTrans();
29702     test_ret += test_xmlAutomataNewOnceTrans();
29703     test_ret += test_xmlAutomataNewOnceTrans2();
29704     test_ret += test_xmlAutomataNewState();
29705     test_ret += test_xmlAutomataNewTransition();
29706     test_ret += test_xmlAutomataNewTransition2();
29707     test_ret += test_xmlAutomataSetFinalState();
29708     test_ret += test_xmlNewAutomata();
29709 
29710     if (test_ret != 0)
29711 	printf("Module xmlautomata: %d errors\n", test_ret);
29712     return(test_ret);
29713 }
29714 
29715 #define gen_nb_xmlGenericErrorFunc_ptr 1
gen_xmlGenericErrorFunc_ptr(int no ATTRIBUTE_UNUSED,int nr ATTRIBUTE_UNUSED)29716 static xmlGenericErrorFunc * gen_xmlGenericErrorFunc_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
29717     return(NULL);
29718 }
des_xmlGenericErrorFunc_ptr(int no ATTRIBUTE_UNUSED,xmlGenericErrorFunc * val ATTRIBUTE_UNUSED,int nr ATTRIBUTE_UNUSED)29719 static void des_xmlGenericErrorFunc_ptr(int no ATTRIBUTE_UNUSED, xmlGenericErrorFunc * val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
29720 }
29721 
29722 static int
test_initGenericErrorDefaultFunc(void)29723 test_initGenericErrorDefaultFunc(void) {
29724     int test_ret = 0;
29725 
29726     int mem_base;
29727     xmlGenericErrorFunc * handler; /* the handler */
29728     int n_handler;
29729 
29730     for (n_handler = 0;n_handler < gen_nb_xmlGenericErrorFunc_ptr;n_handler++) {
29731         mem_base = xmlMemBlocks();
29732         handler = gen_xmlGenericErrorFunc_ptr(n_handler, 0);
29733 
29734         initGenericErrorDefaultFunc(handler);
29735         call_tests++;
29736         des_xmlGenericErrorFunc_ptr(n_handler, handler, 0);
29737         xmlResetLastError();
29738         if (mem_base != xmlMemBlocks()) {
29739             printf("Leak of %d blocks found in initGenericErrorDefaultFunc",
29740 	           xmlMemBlocks() - mem_base);
29741 	    test_ret++;
29742             printf(" %d", n_handler);
29743             printf("\n");
29744         }
29745     }
29746     function_tests++;
29747 
29748     return(test_ret);
29749 }
29750 
29751 
29752 #define gen_nb_xmlErrorPtr 1
gen_xmlErrorPtr(int no ATTRIBUTE_UNUSED,int nr ATTRIBUTE_UNUSED)29753 static xmlErrorPtr gen_xmlErrorPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
29754     return(NULL);
29755 }
des_xmlErrorPtr(int no ATTRIBUTE_UNUSED,xmlErrorPtr val ATTRIBUTE_UNUSED,int nr ATTRIBUTE_UNUSED)29756 static void des_xmlErrorPtr(int no ATTRIBUTE_UNUSED, xmlErrorPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
29757 }
29758 
29759 static int
test_xmlCopyError(void)29760 test_xmlCopyError(void) {
29761     int test_ret = 0;
29762 
29763     int mem_base;
29764     int ret_val;
29765     xmlErrorPtr from; /* a source error */
29766     int n_from;
29767     xmlErrorPtr to; /* a target error */
29768     int n_to;
29769 
29770     for (n_from = 0;n_from < gen_nb_xmlErrorPtr;n_from++) {
29771     for (n_to = 0;n_to < gen_nb_xmlErrorPtr;n_to++) {
29772         mem_base = xmlMemBlocks();
29773         from = gen_xmlErrorPtr(n_from, 0);
29774         to = gen_xmlErrorPtr(n_to, 1);
29775 
29776         ret_val = xmlCopyError(from, to);
29777         desret_int(ret_val);
29778         call_tests++;
29779         des_xmlErrorPtr(n_from, from, 0);
29780         des_xmlErrorPtr(n_to, to, 1);
29781         xmlResetLastError();
29782         if (mem_base != xmlMemBlocks()) {
29783             printf("Leak of %d blocks found in xmlCopyError",
29784 	           xmlMemBlocks() - mem_base);
29785 	    test_ret++;
29786             printf(" %d", n_from);
29787             printf(" %d", n_to);
29788             printf("\n");
29789         }
29790     }
29791     }
29792     function_tests++;
29793 
29794     return(test_ret);
29795 }
29796 
29797 
29798 static int
test_xmlCtxtGetLastError(void)29799 test_xmlCtxtGetLastError(void) {
29800     int test_ret = 0;
29801 
29802 
29803     /* missing type support */
29804     return(test_ret);
29805 }
29806 
29807 
29808 static int
test_xmlCtxtResetLastError(void)29809 test_xmlCtxtResetLastError(void) {
29810     int test_ret = 0;
29811 
29812     int mem_base;
29813     void * ctx; /* an XML parser context */
29814     int n_ctx;
29815 
29816     for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
29817         mem_base = xmlMemBlocks();
29818         ctx = gen_void_ptr(n_ctx, 0);
29819 
29820         xmlCtxtResetLastError(ctx);
29821         call_tests++;
29822         des_void_ptr(n_ctx, ctx, 0);
29823         xmlResetLastError();
29824         if (mem_base != xmlMemBlocks()) {
29825             printf("Leak of %d blocks found in xmlCtxtResetLastError",
29826 	           xmlMemBlocks() - mem_base);
29827 	    test_ret++;
29828             printf(" %d", n_ctx);
29829             printf("\n");
29830         }
29831     }
29832     function_tests++;
29833 
29834     return(test_ret);
29835 }
29836 
29837 
29838 static int
test_xmlGetLastError(void)29839 test_xmlGetLastError(void) {
29840     int test_ret = 0;
29841 
29842 
29843     /* missing type support */
29844     return(test_ret);
29845 }
29846 
29847 
29848 static int
test_xmlParserError(void)29849 test_xmlParserError(void) {
29850     int test_ret = 0;
29851 
29852 
29853     /* missing type support */
29854     return(test_ret);
29855 }
29856 
29857 
29858 static int
test_xmlParserPrintFileContext(void)29859 test_xmlParserPrintFileContext(void) {
29860     int test_ret = 0;
29861 
29862     int mem_base;
29863     xmlParserInputPtr input; /* an xmlParserInputPtr input */
29864     int n_input;
29865 
29866     for (n_input = 0;n_input < gen_nb_xmlParserInputPtr;n_input++) {
29867         mem_base = xmlMemBlocks();
29868         input = gen_xmlParserInputPtr(n_input, 0);
29869 
29870         xmlParserPrintFileContext(input);
29871         call_tests++;
29872         des_xmlParserInputPtr(n_input, input, 0);
29873         xmlResetLastError();
29874         if (mem_base != xmlMemBlocks()) {
29875             printf("Leak of %d blocks found in xmlParserPrintFileContext",
29876 	           xmlMemBlocks() - mem_base);
29877 	    test_ret++;
29878             printf(" %d", n_input);
29879             printf("\n");
29880         }
29881     }
29882     function_tests++;
29883 
29884     return(test_ret);
29885 }
29886 
29887 
29888 static int
test_xmlParserPrintFileInfo(void)29889 test_xmlParserPrintFileInfo(void) {
29890     int test_ret = 0;
29891 
29892     int mem_base;
29893     xmlParserInputPtr input; /* an xmlParserInputPtr input */
29894     int n_input;
29895 
29896     for (n_input = 0;n_input < gen_nb_xmlParserInputPtr;n_input++) {
29897         mem_base = xmlMemBlocks();
29898         input = gen_xmlParserInputPtr(n_input, 0);
29899 
29900         xmlParserPrintFileInfo(input);
29901         call_tests++;
29902         des_xmlParserInputPtr(n_input, input, 0);
29903         xmlResetLastError();
29904         if (mem_base != xmlMemBlocks()) {
29905             printf("Leak of %d blocks found in xmlParserPrintFileInfo",
29906 	           xmlMemBlocks() - mem_base);
29907 	    test_ret++;
29908             printf(" %d", n_input);
29909             printf("\n");
29910         }
29911     }
29912     function_tests++;
29913 
29914     return(test_ret);
29915 }
29916 
29917 
29918 static int
test_xmlParserValidityError(void)29919 test_xmlParserValidityError(void) {
29920     int test_ret = 0;
29921 
29922 
29923     /* missing type support */
29924     return(test_ret);
29925 }
29926 
29927 
29928 static int
test_xmlParserValidityWarning(void)29929 test_xmlParserValidityWarning(void) {
29930     int test_ret = 0;
29931 
29932 
29933     /* missing type support */
29934     return(test_ret);
29935 }
29936 
29937 
29938 static int
test_xmlParserWarning(void)29939 test_xmlParserWarning(void) {
29940     int test_ret = 0;
29941 
29942 
29943     /* missing type support */
29944     return(test_ret);
29945 }
29946 
29947 
29948 static int
test_xmlResetError(void)29949 test_xmlResetError(void) {
29950     int test_ret = 0;
29951 
29952     int mem_base;
29953     xmlErrorPtr err; /* pointer to the error. */
29954     int n_err;
29955 
29956     for (n_err = 0;n_err < gen_nb_xmlErrorPtr;n_err++) {
29957         mem_base = xmlMemBlocks();
29958         err = gen_xmlErrorPtr(n_err, 0);
29959 
29960         xmlResetError(err);
29961         call_tests++;
29962         des_xmlErrorPtr(n_err, err, 0);
29963         xmlResetLastError();
29964         if (mem_base != xmlMemBlocks()) {
29965             printf("Leak of %d blocks found in xmlResetError",
29966 	           xmlMemBlocks() - mem_base);
29967 	    test_ret++;
29968             printf(" %d", n_err);
29969             printf("\n");
29970         }
29971     }
29972     function_tests++;
29973 
29974     return(test_ret);
29975 }
29976 
29977 
29978 static int
test_xmlResetLastError(void)29979 test_xmlResetLastError(void) {
29980     int test_ret = 0;
29981 
29982 
29983 
29984         xmlResetLastError();
29985         call_tests++;
29986         xmlResetLastError();
29987     function_tests++;
29988 
29989     return(test_ret);
29990 }
29991 
29992 
29993 static int
test_xmlSetGenericErrorFunc(void)29994 test_xmlSetGenericErrorFunc(void) {
29995     int test_ret = 0;
29996 
29997 
29998     /* missing type support */
29999     return(test_ret);
30000 }
30001 
30002 
30003 static int
test_xmlSetStructuredErrorFunc(void)30004 test_xmlSetStructuredErrorFunc(void) {
30005     int test_ret = 0;
30006 
30007 
30008     /* missing type support */
30009     return(test_ret);
30010 }
30011 
30012 static int
test_xmlerror(void)30013 test_xmlerror(void) {
30014     int test_ret = 0;
30015 
30016     if (quiet == 0) printf("Testing xmlerror : 7 of 15 functions ...\n");
30017     test_ret += test_initGenericErrorDefaultFunc();
30018     test_ret += test_xmlCopyError();
30019     test_ret += test_xmlCtxtGetLastError();
30020     test_ret += test_xmlCtxtResetLastError();
30021     test_ret += test_xmlGetLastError();
30022     test_ret += test_xmlParserError();
30023     test_ret += test_xmlParserPrintFileContext();
30024     test_ret += test_xmlParserPrintFileInfo();
30025     test_ret += test_xmlParserValidityError();
30026     test_ret += test_xmlParserValidityWarning();
30027     test_ret += test_xmlParserWarning();
30028     test_ret += test_xmlResetError();
30029     test_ret += test_xmlResetLastError();
30030     test_ret += test_xmlSetGenericErrorFunc();
30031     test_ret += test_xmlSetStructuredErrorFunc();
30032 
30033     if (test_ret != 0)
30034 	printf("Module xmlerror: %d errors\n", test_ret);
30035     return(test_ret);
30036 }
30037 #ifdef LIBXML_MODULES_ENABLED
30038 
30039 #define gen_nb_xmlModulePtr 1
gen_xmlModulePtr(int no ATTRIBUTE_UNUSED,int nr ATTRIBUTE_UNUSED)30040 static xmlModulePtr gen_xmlModulePtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
30041     return(NULL);
30042 }
des_xmlModulePtr(int no ATTRIBUTE_UNUSED,xmlModulePtr val ATTRIBUTE_UNUSED,int nr ATTRIBUTE_UNUSED)30043 static void des_xmlModulePtr(int no ATTRIBUTE_UNUSED, xmlModulePtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
30044 }
30045 #endif
30046 
30047 
30048 static int
test_xmlModuleClose(void)30049 test_xmlModuleClose(void) {
30050     int test_ret = 0;
30051 
30052 #if defined(LIBXML_MODULES_ENABLED)
30053     int mem_base;
30054     int ret_val;
30055     xmlModulePtr module; /* the module handle */
30056     int n_module;
30057 
30058     for (n_module = 0;n_module < gen_nb_xmlModulePtr;n_module++) {
30059         mem_base = xmlMemBlocks();
30060         module = gen_xmlModulePtr(n_module, 0);
30061 
30062         ret_val = xmlModuleClose(module);
30063         desret_int(ret_val);
30064         call_tests++;
30065         des_xmlModulePtr(n_module, module, 0);
30066         xmlResetLastError();
30067         if (mem_base != xmlMemBlocks()) {
30068             printf("Leak of %d blocks found in xmlModuleClose",
30069 	           xmlMemBlocks() - mem_base);
30070 	    test_ret++;
30071             printf(" %d", n_module);
30072             printf("\n");
30073         }
30074     }
30075     function_tests++;
30076 #endif
30077 
30078     return(test_ret);
30079 }
30080 
30081 
30082 static int
test_xmlModuleOpen(void)30083 test_xmlModuleOpen(void) {
30084     int test_ret = 0;
30085 
30086 
30087     /* missing type support */
30088     return(test_ret);
30089 }
30090 
30091 
30092 static int
test_xmlModuleSymbol(void)30093 test_xmlModuleSymbol(void) {
30094     int test_ret = 0;
30095 
30096 #if defined(LIBXML_MODULES_ENABLED)
30097     int mem_base;
30098     int ret_val;
30099     xmlModulePtr module; /* the module */
30100     int n_module;
30101     char * name; /* the name of the symbol */
30102     int n_name;
30103     void ** symbol; /* the resulting symbol address */
30104     int n_symbol;
30105 
30106     for (n_module = 0;n_module < gen_nb_xmlModulePtr;n_module++) {
30107     for (n_name = 0;n_name < gen_nb_const_char_ptr;n_name++) {
30108     for (n_symbol = 0;n_symbol < gen_nb_void_ptr_ptr;n_symbol++) {
30109         mem_base = xmlMemBlocks();
30110         module = gen_xmlModulePtr(n_module, 0);
30111         name = gen_const_char_ptr(n_name, 1);
30112         symbol = gen_void_ptr_ptr(n_symbol, 2);
30113 
30114         ret_val = xmlModuleSymbol(module, (const char *)name, symbol);
30115         desret_int(ret_val);
30116         call_tests++;
30117         des_xmlModulePtr(n_module, module, 0);
30118         des_const_char_ptr(n_name, (const char *)name, 1);
30119         des_void_ptr_ptr(n_symbol, symbol, 2);
30120         xmlResetLastError();
30121         if (mem_base != xmlMemBlocks()) {
30122             printf("Leak of %d blocks found in xmlModuleSymbol",
30123 	           xmlMemBlocks() - mem_base);
30124 	    test_ret++;
30125             printf(" %d", n_module);
30126             printf(" %d", n_name);
30127             printf(" %d", n_symbol);
30128             printf("\n");
30129         }
30130     }
30131     }
30132     }
30133     function_tests++;
30134 #endif
30135 
30136     return(test_ret);
30137 }
30138 
30139 static int
test_xmlmodule(void)30140 test_xmlmodule(void) {
30141     int test_ret = 0;
30142 
30143     if (quiet == 0) printf("Testing xmlmodule : 2 of 4 functions ...\n");
30144     test_ret += test_xmlModuleClose();
30145     test_ret += test_xmlModuleOpen();
30146     test_ret += test_xmlModuleSymbol();
30147 
30148     if (test_ret != 0)
30149 	printf("Module xmlmodule: %d errors\n", test_ret);
30150     return(test_ret);
30151 }
30152 
30153 static int
test_xmlNewTextReader(void)30154 test_xmlNewTextReader(void) {
30155     int test_ret = 0;
30156 
30157 #if defined(LIBXML_READER_ENABLED)
30158     int mem_base;
30159     xmlTextReaderPtr ret_val;
30160     xmlParserInputBufferPtr input; /* the xmlParserInputBufferPtr used to read data */
30161     int n_input;
30162     const char * URI; /* the URI information for the source if available */
30163     int n_URI;
30164 
30165     for (n_input = 0;n_input < gen_nb_xmlParserInputBufferPtr;n_input++) {
30166     for (n_URI = 0;n_URI < gen_nb_filepath;n_URI++) {
30167         mem_base = xmlMemBlocks();
30168         input = gen_xmlParserInputBufferPtr(n_input, 0);
30169         URI = gen_filepath(n_URI, 1);
30170 
30171         ret_val = xmlNewTextReader(input, URI);
30172         desret_xmlTextReaderPtr(ret_val);
30173         call_tests++;
30174         des_xmlParserInputBufferPtr(n_input, input, 0);
30175         des_filepath(n_URI, URI, 1);
30176         xmlResetLastError();
30177         if (mem_base != xmlMemBlocks()) {
30178             printf("Leak of %d blocks found in xmlNewTextReader",
30179 	           xmlMemBlocks() - mem_base);
30180 	    test_ret++;
30181             printf(" %d", n_input);
30182             printf(" %d", n_URI);
30183             printf("\n");
30184         }
30185     }
30186     }
30187     function_tests++;
30188 #endif
30189 
30190     return(test_ret);
30191 }
30192 
30193 
30194 static int
test_xmlNewTextReaderFilename(void)30195 test_xmlNewTextReaderFilename(void) {
30196     int test_ret = 0;
30197 
30198 #if defined(LIBXML_READER_ENABLED)
30199     int mem_base;
30200     xmlTextReaderPtr ret_val;
30201     const char * URI; /* the URI of the resource to process */
30202     int n_URI;
30203 
30204     for (n_URI = 0;n_URI < gen_nb_filepath;n_URI++) {
30205         mem_base = xmlMemBlocks();
30206         URI = gen_filepath(n_URI, 0);
30207 
30208         ret_val = xmlNewTextReaderFilename(URI);
30209         desret_xmlTextReaderPtr(ret_val);
30210         call_tests++;
30211         des_filepath(n_URI, URI, 0);
30212         xmlResetLastError();
30213         if (mem_base != xmlMemBlocks()) {
30214             printf("Leak of %d blocks found in xmlNewTextReaderFilename",
30215 	           xmlMemBlocks() - mem_base);
30216 	    test_ret++;
30217             printf(" %d", n_URI);
30218             printf("\n");
30219         }
30220     }
30221     function_tests++;
30222 #endif
30223 
30224     return(test_ret);
30225 }
30226 
30227 
30228 static int
test_xmlReaderForDoc(void)30229 test_xmlReaderForDoc(void) {
30230     int test_ret = 0;
30231 
30232 #if defined(LIBXML_READER_ENABLED)
30233     int mem_base;
30234     xmlTextReaderPtr ret_val;
30235     xmlChar * cur; /* a pointer to a zero terminated string */
30236     int n_cur;
30237     const char * URL; /* the base URL to use for the document */
30238     int n_URL;
30239     char * encoding; /* the document encoding, or NULL */
30240     int n_encoding;
30241     int options; /* a combination of xmlParserOption */
30242     int n_options;
30243 
30244     for (n_cur = 0;n_cur < gen_nb_const_xmlChar_ptr;n_cur++) {
30245     for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) {
30246     for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
30247     for (n_options = 0;n_options < gen_nb_parseroptions;n_options++) {
30248         mem_base = xmlMemBlocks();
30249         cur = gen_const_xmlChar_ptr(n_cur, 0);
30250         URL = gen_filepath(n_URL, 1);
30251         encoding = gen_const_char_ptr(n_encoding, 2);
30252         options = gen_parseroptions(n_options, 3);
30253 
30254         ret_val = xmlReaderForDoc((const xmlChar *)cur, URL, (const char *)encoding, options);
30255         desret_xmlTextReaderPtr(ret_val);
30256         call_tests++;
30257         des_const_xmlChar_ptr(n_cur, (const xmlChar *)cur, 0);
30258         des_filepath(n_URL, URL, 1);
30259         des_const_char_ptr(n_encoding, (const char *)encoding, 2);
30260         des_parseroptions(n_options, options, 3);
30261         xmlResetLastError();
30262         if (mem_base != xmlMemBlocks()) {
30263             printf("Leak of %d blocks found in xmlReaderForDoc",
30264 	           xmlMemBlocks() - mem_base);
30265 	    test_ret++;
30266             printf(" %d", n_cur);
30267             printf(" %d", n_URL);
30268             printf(" %d", n_encoding);
30269             printf(" %d", n_options);
30270             printf("\n");
30271         }
30272     }
30273     }
30274     }
30275     }
30276     function_tests++;
30277 #endif
30278 
30279     return(test_ret);
30280 }
30281 
30282 
30283 static int
test_xmlReaderForFile(void)30284 test_xmlReaderForFile(void) {
30285     int test_ret = 0;
30286 
30287 #if defined(LIBXML_READER_ENABLED)
30288     int mem_base;
30289     xmlTextReaderPtr ret_val;
30290     const char * filename; /* a file or URL */
30291     int n_filename;
30292     char * encoding; /* the document encoding, or NULL */
30293     int n_encoding;
30294     int options; /* a combination of xmlParserOption */
30295     int n_options;
30296 
30297     for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
30298     for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
30299     for (n_options = 0;n_options < gen_nb_parseroptions;n_options++) {
30300         mem_base = xmlMemBlocks();
30301         filename = gen_filepath(n_filename, 0);
30302         encoding = gen_const_char_ptr(n_encoding, 1);
30303         options = gen_parseroptions(n_options, 2);
30304 
30305         ret_val = xmlReaderForFile(filename, (const char *)encoding, options);
30306         desret_xmlTextReaderPtr(ret_val);
30307         call_tests++;
30308         des_filepath(n_filename, filename, 0);
30309         des_const_char_ptr(n_encoding, (const char *)encoding, 1);
30310         des_parseroptions(n_options, options, 2);
30311         xmlResetLastError();
30312         if (mem_base != xmlMemBlocks()) {
30313             printf("Leak of %d blocks found in xmlReaderForFile",
30314 	           xmlMemBlocks() - mem_base);
30315 	    test_ret++;
30316             printf(" %d", n_filename);
30317             printf(" %d", n_encoding);
30318             printf(" %d", n_options);
30319             printf("\n");
30320         }
30321     }
30322     }
30323     }
30324     function_tests++;
30325 #endif
30326 
30327     return(test_ret);
30328 }
30329 
30330 
30331 static int
test_xmlReaderForMemory(void)30332 test_xmlReaderForMemory(void) {
30333     int test_ret = 0;
30334 
30335 #if defined(LIBXML_READER_ENABLED)
30336     int mem_base;
30337     xmlTextReaderPtr ret_val;
30338     char * buffer; /* a pointer to a char array */
30339     int n_buffer;
30340     int size; /* the size of the array */
30341     int n_size;
30342     const char * URL; /* the base URL to use for the document */
30343     int n_URL;
30344     char * encoding; /* the document encoding, or NULL */
30345     int n_encoding;
30346     int options; /* a combination of xmlParserOption */
30347     int n_options;
30348 
30349     for (n_buffer = 0;n_buffer < gen_nb_const_char_ptr;n_buffer++) {
30350     for (n_size = 0;n_size < gen_nb_int;n_size++) {
30351     for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) {
30352     for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
30353     for (n_options = 0;n_options < gen_nb_parseroptions;n_options++) {
30354         mem_base = xmlMemBlocks();
30355         buffer = gen_const_char_ptr(n_buffer, 0);
30356         size = gen_int(n_size, 1);
30357         URL = gen_filepath(n_URL, 2);
30358         encoding = gen_const_char_ptr(n_encoding, 3);
30359         options = gen_parseroptions(n_options, 4);
30360         if ((buffer != NULL) &&
30361             (size > (int) strlen((const char *) buffer) + 1))
30362             continue;
30363 
30364         ret_val = xmlReaderForMemory((const char *)buffer, size, URL, (const char *)encoding, options);
30365         desret_xmlTextReaderPtr(ret_val);
30366         call_tests++;
30367         des_const_char_ptr(n_buffer, (const char *)buffer, 0);
30368         des_int(n_size, size, 1);
30369         des_filepath(n_URL, URL, 2);
30370         des_const_char_ptr(n_encoding, (const char *)encoding, 3);
30371         des_parseroptions(n_options, options, 4);
30372         xmlResetLastError();
30373         if (mem_base != xmlMemBlocks()) {
30374             printf("Leak of %d blocks found in xmlReaderForMemory",
30375 	           xmlMemBlocks() - mem_base);
30376 	    test_ret++;
30377             printf(" %d", n_buffer);
30378             printf(" %d", n_size);
30379             printf(" %d", n_URL);
30380             printf(" %d", n_encoding);
30381             printf(" %d", n_options);
30382             printf("\n");
30383         }
30384     }
30385     }
30386     }
30387     }
30388     }
30389     function_tests++;
30390 #endif
30391 
30392     return(test_ret);
30393 }
30394 
30395 
30396 static int
test_xmlReaderNewDoc(void)30397 test_xmlReaderNewDoc(void) {
30398     int test_ret = 0;
30399 
30400 #if defined(LIBXML_READER_ENABLED)
30401     int mem_base;
30402     int ret_val;
30403     xmlTextReaderPtr reader; /* an XML reader */
30404     int n_reader;
30405     xmlChar * cur; /* a pointer to a zero terminated string */
30406     int n_cur;
30407     const char * URL; /* the base URL to use for the document */
30408     int n_URL;
30409     char * encoding; /* the document encoding, or NULL */
30410     int n_encoding;
30411     int options; /* a combination of xmlParserOption */
30412     int n_options;
30413 
30414     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
30415     for (n_cur = 0;n_cur < gen_nb_const_xmlChar_ptr;n_cur++) {
30416     for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) {
30417     for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
30418     for (n_options = 0;n_options < gen_nb_parseroptions;n_options++) {
30419         mem_base = xmlMemBlocks();
30420         reader = gen_xmlTextReaderPtr(n_reader, 0);
30421         cur = gen_const_xmlChar_ptr(n_cur, 1);
30422         URL = gen_filepath(n_URL, 2);
30423         encoding = gen_const_char_ptr(n_encoding, 3);
30424         options = gen_parseroptions(n_options, 4);
30425 
30426         ret_val = xmlReaderNewDoc(reader, (const xmlChar *)cur, URL, (const char *)encoding, options);
30427         desret_int(ret_val);
30428         call_tests++;
30429         des_xmlTextReaderPtr(n_reader, reader, 0);
30430         des_const_xmlChar_ptr(n_cur, (const xmlChar *)cur, 1);
30431         des_filepath(n_URL, URL, 2);
30432         des_const_char_ptr(n_encoding, (const char *)encoding, 3);
30433         des_parseroptions(n_options, options, 4);
30434         xmlResetLastError();
30435         if (mem_base != xmlMemBlocks()) {
30436             printf("Leak of %d blocks found in xmlReaderNewDoc",
30437 	           xmlMemBlocks() - mem_base);
30438 	    test_ret++;
30439             printf(" %d", n_reader);
30440             printf(" %d", n_cur);
30441             printf(" %d", n_URL);
30442             printf(" %d", n_encoding);
30443             printf(" %d", n_options);
30444             printf("\n");
30445         }
30446     }
30447     }
30448     }
30449     }
30450     }
30451     function_tests++;
30452 #endif
30453 
30454     return(test_ret);
30455 }
30456 
30457 
30458 static int
test_xmlReaderNewFile(void)30459 test_xmlReaderNewFile(void) {
30460     int test_ret = 0;
30461 
30462 #if defined(LIBXML_READER_ENABLED)
30463     int mem_base;
30464     int ret_val;
30465     xmlTextReaderPtr reader; /* an XML reader */
30466     int n_reader;
30467     const char * filename; /* a file or URL */
30468     int n_filename;
30469     char * encoding; /* the document encoding, or NULL */
30470     int n_encoding;
30471     int options; /* a combination of xmlParserOption */
30472     int n_options;
30473 
30474     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
30475     for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
30476     for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
30477     for (n_options = 0;n_options < gen_nb_parseroptions;n_options++) {
30478         mem_base = xmlMemBlocks();
30479         reader = gen_xmlTextReaderPtr(n_reader, 0);
30480         filename = gen_filepath(n_filename, 1);
30481         encoding = gen_const_char_ptr(n_encoding, 2);
30482         options = gen_parseroptions(n_options, 3);
30483 
30484         ret_val = xmlReaderNewFile(reader, filename, (const char *)encoding, options);
30485         desret_int(ret_val);
30486         call_tests++;
30487         des_xmlTextReaderPtr(n_reader, reader, 0);
30488         des_filepath(n_filename, filename, 1);
30489         des_const_char_ptr(n_encoding, (const char *)encoding, 2);
30490         des_parseroptions(n_options, options, 3);
30491         xmlResetLastError();
30492         if (mem_base != xmlMemBlocks()) {
30493             printf("Leak of %d blocks found in xmlReaderNewFile",
30494 	           xmlMemBlocks() - mem_base);
30495 	    test_ret++;
30496             printf(" %d", n_reader);
30497             printf(" %d", n_filename);
30498             printf(" %d", n_encoding);
30499             printf(" %d", n_options);
30500             printf("\n");
30501         }
30502     }
30503     }
30504     }
30505     }
30506     function_tests++;
30507 #endif
30508 
30509     return(test_ret);
30510 }
30511 
30512 
30513 static int
test_xmlReaderNewMemory(void)30514 test_xmlReaderNewMemory(void) {
30515     int test_ret = 0;
30516 
30517 #if defined(LIBXML_READER_ENABLED)
30518     int mem_base;
30519     int ret_val;
30520     xmlTextReaderPtr reader; /* an XML reader */
30521     int n_reader;
30522     char * buffer; /* a pointer to a char array */
30523     int n_buffer;
30524     int size; /* the size of the array */
30525     int n_size;
30526     const char * URL; /* the base URL to use for the document */
30527     int n_URL;
30528     char * encoding; /* the document encoding, or NULL */
30529     int n_encoding;
30530     int options; /* a combination of xmlParserOption */
30531     int n_options;
30532 
30533     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
30534     for (n_buffer = 0;n_buffer < gen_nb_const_char_ptr;n_buffer++) {
30535     for (n_size = 0;n_size < gen_nb_int;n_size++) {
30536     for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) {
30537     for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
30538     for (n_options = 0;n_options < gen_nb_parseroptions;n_options++) {
30539         mem_base = xmlMemBlocks();
30540         reader = gen_xmlTextReaderPtr(n_reader, 0);
30541         buffer = gen_const_char_ptr(n_buffer, 1);
30542         size = gen_int(n_size, 2);
30543         URL = gen_filepath(n_URL, 3);
30544         encoding = gen_const_char_ptr(n_encoding, 4);
30545         options = gen_parseroptions(n_options, 5);
30546         if ((buffer != NULL) &&
30547             (size > (int) strlen((const char *) buffer) + 1))
30548             continue;
30549 
30550         ret_val = xmlReaderNewMemory(reader, (const char *)buffer, size, URL, (const char *)encoding, options);
30551         desret_int(ret_val);
30552         call_tests++;
30553         des_xmlTextReaderPtr(n_reader, reader, 0);
30554         des_const_char_ptr(n_buffer, (const char *)buffer, 1);
30555         des_int(n_size, size, 2);
30556         des_filepath(n_URL, URL, 3);
30557         des_const_char_ptr(n_encoding, (const char *)encoding, 4);
30558         des_parseroptions(n_options, options, 5);
30559         xmlResetLastError();
30560         if (mem_base != xmlMemBlocks()) {
30561             printf("Leak of %d blocks found in xmlReaderNewMemory",
30562 	           xmlMemBlocks() - mem_base);
30563 	    test_ret++;
30564             printf(" %d", n_reader);
30565             printf(" %d", n_buffer);
30566             printf(" %d", n_size);
30567             printf(" %d", n_URL);
30568             printf(" %d", n_encoding);
30569             printf(" %d", n_options);
30570             printf("\n");
30571         }
30572     }
30573     }
30574     }
30575     }
30576     }
30577     }
30578     function_tests++;
30579 #endif
30580 
30581     return(test_ret);
30582 }
30583 
30584 
30585 static int
test_xmlReaderNewWalker(void)30586 test_xmlReaderNewWalker(void) {
30587     int test_ret = 0;
30588 
30589 #if defined(LIBXML_READER_ENABLED)
30590     int mem_base;
30591     int ret_val;
30592     xmlTextReaderPtr reader; /* an XML reader */
30593     int n_reader;
30594     xmlDocPtr doc; /* a preparsed document */
30595     int n_doc;
30596 
30597     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
30598     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
30599         mem_base = xmlMemBlocks();
30600         reader = gen_xmlTextReaderPtr(n_reader, 0);
30601         doc = gen_xmlDocPtr(n_doc, 1);
30602 
30603         ret_val = xmlReaderNewWalker(reader, doc);
30604         desret_int(ret_val);
30605         call_tests++;
30606         des_xmlTextReaderPtr(n_reader, reader, 0);
30607         des_xmlDocPtr(n_doc, doc, 1);
30608         xmlResetLastError();
30609         if (mem_base != xmlMemBlocks()) {
30610             printf("Leak of %d blocks found in xmlReaderNewWalker",
30611 	           xmlMemBlocks() - mem_base);
30612 	    test_ret++;
30613             printf(" %d", n_reader);
30614             printf(" %d", n_doc);
30615             printf("\n");
30616         }
30617     }
30618     }
30619     function_tests++;
30620 #endif
30621 
30622     return(test_ret);
30623 }
30624 
30625 
30626 static int
test_xmlReaderWalker(void)30627 test_xmlReaderWalker(void) {
30628     int test_ret = 0;
30629 
30630 #if defined(LIBXML_READER_ENABLED)
30631     int mem_base;
30632     xmlTextReaderPtr ret_val;
30633     xmlDocPtr doc; /* a preparsed document */
30634     int n_doc;
30635 
30636     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
30637         mem_base = xmlMemBlocks();
30638         doc = gen_xmlDocPtr(n_doc, 0);
30639 
30640         ret_val = xmlReaderWalker(doc);
30641         desret_xmlTextReaderPtr(ret_val);
30642         call_tests++;
30643         des_xmlDocPtr(n_doc, doc, 0);
30644         xmlResetLastError();
30645         if (mem_base != xmlMemBlocks()) {
30646             printf("Leak of %d blocks found in xmlReaderWalker",
30647 	           xmlMemBlocks() - mem_base);
30648 	    test_ret++;
30649             printf(" %d", n_doc);
30650             printf("\n");
30651         }
30652     }
30653     function_tests++;
30654 #endif
30655 
30656     return(test_ret);
30657 }
30658 
30659 
30660 static int
test_xmlTextReaderAttributeCount(void)30661 test_xmlTextReaderAttributeCount(void) {
30662     int test_ret = 0;
30663 
30664 #if defined(LIBXML_READER_ENABLED)
30665     int mem_base;
30666     int ret_val;
30667     xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
30668     int n_reader;
30669 
30670     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
30671         mem_base = xmlMemBlocks();
30672         reader = gen_xmlTextReaderPtr(n_reader, 0);
30673 
30674         ret_val = xmlTextReaderAttributeCount(reader);
30675         desret_int(ret_val);
30676         call_tests++;
30677         des_xmlTextReaderPtr(n_reader, reader, 0);
30678         xmlResetLastError();
30679         if (mem_base != xmlMemBlocks()) {
30680             printf("Leak of %d blocks found in xmlTextReaderAttributeCount",
30681 	           xmlMemBlocks() - mem_base);
30682 	    test_ret++;
30683             printf(" %d", n_reader);
30684             printf("\n");
30685         }
30686     }
30687     function_tests++;
30688 #endif
30689 
30690     return(test_ret);
30691 }
30692 
30693 
30694 static int
test_xmlTextReaderBaseUri(void)30695 test_xmlTextReaderBaseUri(void) {
30696     int test_ret = 0;
30697 
30698 #if defined(LIBXML_READER_ENABLED)
30699     int mem_base;
30700     xmlChar * ret_val;
30701     xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
30702     int n_reader;
30703 
30704     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
30705         mem_base = xmlMemBlocks();
30706         reader = gen_xmlTextReaderPtr(n_reader, 0);
30707 
30708         ret_val = xmlTextReaderBaseUri(reader);
30709         desret_xmlChar_ptr(ret_val);
30710         call_tests++;
30711         des_xmlTextReaderPtr(n_reader, reader, 0);
30712         xmlResetLastError();
30713         if (mem_base != xmlMemBlocks()) {
30714             printf("Leak of %d blocks found in xmlTextReaderBaseUri",
30715 	           xmlMemBlocks() - mem_base);
30716 	    test_ret++;
30717             printf(" %d", n_reader);
30718             printf("\n");
30719         }
30720     }
30721     function_tests++;
30722 #endif
30723 
30724     return(test_ret);
30725 }
30726 
30727 
30728 static int
test_xmlTextReaderByteConsumed(void)30729 test_xmlTextReaderByteConsumed(void) {
30730     int test_ret = 0;
30731 
30732 #if defined(LIBXML_READER_ENABLED)
30733     int mem_base;
30734     long ret_val;
30735     xmlTextReaderPtr reader; /* an XML reader */
30736     int n_reader;
30737 
30738     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
30739         mem_base = xmlMemBlocks();
30740         reader = gen_xmlTextReaderPtr(n_reader, 0);
30741 
30742         ret_val = xmlTextReaderByteConsumed(reader);
30743         desret_long(ret_val);
30744         call_tests++;
30745         des_xmlTextReaderPtr(n_reader, reader, 0);
30746         xmlResetLastError();
30747         if (mem_base != xmlMemBlocks()) {
30748             printf("Leak of %d blocks found in xmlTextReaderByteConsumed",
30749 	           xmlMemBlocks() - mem_base);
30750 	    test_ret++;
30751             printf(" %d", n_reader);
30752             printf("\n");
30753         }
30754     }
30755     function_tests++;
30756 #endif
30757 
30758     return(test_ret);
30759 }
30760 
30761 
30762 static int
test_xmlTextReaderClose(void)30763 test_xmlTextReaderClose(void) {
30764     int test_ret = 0;
30765 
30766 #if defined(LIBXML_READER_ENABLED)
30767     int mem_base;
30768     int ret_val;
30769     xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
30770     int n_reader;
30771 
30772     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
30773         mem_base = xmlMemBlocks();
30774         reader = gen_xmlTextReaderPtr(n_reader, 0);
30775 
30776         ret_val = xmlTextReaderClose(reader);
30777         desret_int(ret_val);
30778         call_tests++;
30779         des_xmlTextReaderPtr(n_reader, reader, 0);
30780         xmlResetLastError();
30781         if (mem_base != xmlMemBlocks()) {
30782             printf("Leak of %d blocks found in xmlTextReaderClose",
30783 	           xmlMemBlocks() - mem_base);
30784 	    test_ret++;
30785             printf(" %d", n_reader);
30786             printf("\n");
30787         }
30788     }
30789     function_tests++;
30790 #endif
30791 
30792     return(test_ret);
30793 }
30794 
30795 
30796 static int
test_xmlTextReaderConstBaseUri(void)30797 test_xmlTextReaderConstBaseUri(void) {
30798     int test_ret = 0;
30799 
30800 #if defined(LIBXML_READER_ENABLED)
30801     int mem_base;
30802     const xmlChar * ret_val;
30803     xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
30804     int n_reader;
30805 
30806     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
30807         mem_base = xmlMemBlocks();
30808         reader = gen_xmlTextReaderPtr(n_reader, 0);
30809 
30810         ret_val = xmlTextReaderConstBaseUri(reader);
30811         desret_const_xmlChar_ptr(ret_val);
30812         call_tests++;
30813         des_xmlTextReaderPtr(n_reader, reader, 0);
30814         xmlResetLastError();
30815         if (mem_base != xmlMemBlocks()) {
30816             printf("Leak of %d blocks found in xmlTextReaderConstBaseUri",
30817 	           xmlMemBlocks() - mem_base);
30818 	    test_ret++;
30819             printf(" %d", n_reader);
30820             printf("\n");
30821         }
30822     }
30823     function_tests++;
30824 #endif
30825 
30826     return(test_ret);
30827 }
30828 
30829 
30830 static int
test_xmlTextReaderConstEncoding(void)30831 test_xmlTextReaderConstEncoding(void) {
30832     int test_ret = 0;
30833 
30834 #if defined(LIBXML_READER_ENABLED)
30835     int mem_base;
30836     const xmlChar * ret_val;
30837     xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
30838     int n_reader;
30839 
30840     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
30841         mem_base = xmlMemBlocks();
30842         reader = gen_xmlTextReaderPtr(n_reader, 0);
30843 
30844         ret_val = xmlTextReaderConstEncoding(reader);
30845         desret_const_xmlChar_ptr(ret_val);
30846         call_tests++;
30847         des_xmlTextReaderPtr(n_reader, reader, 0);
30848         xmlResetLastError();
30849         if (mem_base != xmlMemBlocks()) {
30850             printf("Leak of %d blocks found in xmlTextReaderConstEncoding",
30851 	           xmlMemBlocks() - mem_base);
30852 	    test_ret++;
30853             printf(" %d", n_reader);
30854             printf("\n");
30855         }
30856     }
30857     function_tests++;
30858 #endif
30859 
30860     return(test_ret);
30861 }
30862 
30863 
30864 static int
test_xmlTextReaderConstLocalName(void)30865 test_xmlTextReaderConstLocalName(void) {
30866     int test_ret = 0;
30867 
30868 #if defined(LIBXML_READER_ENABLED)
30869     int mem_base;
30870     const xmlChar * ret_val;
30871     xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
30872     int n_reader;
30873 
30874     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
30875         mem_base = xmlMemBlocks();
30876         reader = gen_xmlTextReaderPtr(n_reader, 0);
30877 
30878         ret_val = xmlTextReaderConstLocalName(reader);
30879         desret_const_xmlChar_ptr(ret_val);
30880         call_tests++;
30881         des_xmlTextReaderPtr(n_reader, reader, 0);
30882         xmlResetLastError();
30883         if (mem_base != xmlMemBlocks()) {
30884             printf("Leak of %d blocks found in xmlTextReaderConstLocalName",
30885 	           xmlMemBlocks() - mem_base);
30886 	    test_ret++;
30887             printf(" %d", n_reader);
30888             printf("\n");
30889         }
30890     }
30891     function_tests++;
30892 #endif
30893 
30894     return(test_ret);
30895 }
30896 
30897 
30898 static int
test_xmlTextReaderConstName(void)30899 test_xmlTextReaderConstName(void) {
30900     int test_ret = 0;
30901 
30902 #if defined(LIBXML_READER_ENABLED)
30903     int mem_base;
30904     const xmlChar * ret_val;
30905     xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
30906     int n_reader;
30907 
30908     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
30909         mem_base = xmlMemBlocks();
30910         reader = gen_xmlTextReaderPtr(n_reader, 0);
30911 
30912         ret_val = xmlTextReaderConstName(reader);
30913         desret_const_xmlChar_ptr(ret_val);
30914         call_tests++;
30915         des_xmlTextReaderPtr(n_reader, reader, 0);
30916         xmlResetLastError();
30917         if (mem_base != xmlMemBlocks()) {
30918             printf("Leak of %d blocks found in xmlTextReaderConstName",
30919 	           xmlMemBlocks() - mem_base);
30920 	    test_ret++;
30921             printf(" %d", n_reader);
30922             printf("\n");
30923         }
30924     }
30925     function_tests++;
30926 #endif
30927 
30928     return(test_ret);
30929 }
30930 
30931 
30932 static int
test_xmlTextReaderConstNamespaceUri(void)30933 test_xmlTextReaderConstNamespaceUri(void) {
30934     int test_ret = 0;
30935 
30936 #if defined(LIBXML_READER_ENABLED)
30937     int mem_base;
30938     const xmlChar * ret_val;
30939     xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
30940     int n_reader;
30941 
30942     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
30943         mem_base = xmlMemBlocks();
30944         reader = gen_xmlTextReaderPtr(n_reader, 0);
30945 
30946         ret_val = xmlTextReaderConstNamespaceUri(reader);
30947         desret_const_xmlChar_ptr(ret_val);
30948         call_tests++;
30949         des_xmlTextReaderPtr(n_reader, reader, 0);
30950         xmlResetLastError();
30951         if (mem_base != xmlMemBlocks()) {
30952             printf("Leak of %d blocks found in xmlTextReaderConstNamespaceUri",
30953 	           xmlMemBlocks() - mem_base);
30954 	    test_ret++;
30955             printf(" %d", n_reader);
30956             printf("\n");
30957         }
30958     }
30959     function_tests++;
30960 #endif
30961 
30962     return(test_ret);
30963 }
30964 
30965 
30966 static int
test_xmlTextReaderConstPrefix(void)30967 test_xmlTextReaderConstPrefix(void) {
30968     int test_ret = 0;
30969 
30970 #if defined(LIBXML_READER_ENABLED)
30971     int mem_base;
30972     const xmlChar * ret_val;
30973     xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
30974     int n_reader;
30975 
30976     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
30977         mem_base = xmlMemBlocks();
30978         reader = gen_xmlTextReaderPtr(n_reader, 0);
30979 
30980         ret_val = xmlTextReaderConstPrefix(reader);
30981         desret_const_xmlChar_ptr(ret_val);
30982         call_tests++;
30983         des_xmlTextReaderPtr(n_reader, reader, 0);
30984         xmlResetLastError();
30985         if (mem_base != xmlMemBlocks()) {
30986             printf("Leak of %d blocks found in xmlTextReaderConstPrefix",
30987 	           xmlMemBlocks() - mem_base);
30988 	    test_ret++;
30989             printf(" %d", n_reader);
30990             printf("\n");
30991         }
30992     }
30993     function_tests++;
30994 #endif
30995 
30996     return(test_ret);
30997 }
30998 
30999 
31000 static int
test_xmlTextReaderConstString(void)31001 test_xmlTextReaderConstString(void) {
31002     int test_ret = 0;
31003 
31004 #if defined(LIBXML_READER_ENABLED)
31005     int mem_base;
31006     const xmlChar * ret_val;
31007     xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
31008     int n_reader;
31009     xmlChar * str; /* the string to intern. */
31010     int n_str;
31011 
31012     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
31013     for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) {
31014         mem_base = xmlMemBlocks();
31015         reader = gen_xmlTextReaderPtr(n_reader, 0);
31016         str = gen_const_xmlChar_ptr(n_str, 1);
31017 
31018         ret_val = xmlTextReaderConstString(reader, (const xmlChar *)str);
31019         desret_const_xmlChar_ptr(ret_val);
31020         call_tests++;
31021         des_xmlTextReaderPtr(n_reader, reader, 0);
31022         des_const_xmlChar_ptr(n_str, (const xmlChar *)str, 1);
31023         xmlResetLastError();
31024         if (mem_base != xmlMemBlocks()) {
31025             printf("Leak of %d blocks found in xmlTextReaderConstString",
31026 	           xmlMemBlocks() - mem_base);
31027 	    test_ret++;
31028             printf(" %d", n_reader);
31029             printf(" %d", n_str);
31030             printf("\n");
31031         }
31032     }
31033     }
31034     function_tests++;
31035 #endif
31036 
31037     return(test_ret);
31038 }
31039 
31040 
31041 static int
test_xmlTextReaderConstValue(void)31042 test_xmlTextReaderConstValue(void) {
31043     int test_ret = 0;
31044 
31045 #if defined(LIBXML_READER_ENABLED)
31046     int mem_base;
31047     const xmlChar * ret_val;
31048     xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
31049     int n_reader;
31050 
31051     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
31052         mem_base = xmlMemBlocks();
31053         reader = gen_xmlTextReaderPtr(n_reader, 0);
31054 
31055         ret_val = xmlTextReaderConstValue(reader);
31056         desret_const_xmlChar_ptr(ret_val);
31057         call_tests++;
31058         des_xmlTextReaderPtr(n_reader, reader, 0);
31059         xmlResetLastError();
31060         if (mem_base != xmlMemBlocks()) {
31061             printf("Leak of %d blocks found in xmlTextReaderConstValue",
31062 	           xmlMemBlocks() - mem_base);
31063 	    test_ret++;
31064             printf(" %d", n_reader);
31065             printf("\n");
31066         }
31067     }
31068     function_tests++;
31069 #endif
31070 
31071     return(test_ret);
31072 }
31073 
31074 
31075 static int
test_xmlTextReaderConstXmlLang(void)31076 test_xmlTextReaderConstXmlLang(void) {
31077     int test_ret = 0;
31078 
31079 #if defined(LIBXML_READER_ENABLED)
31080     int mem_base;
31081     const xmlChar * ret_val;
31082     xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
31083     int n_reader;
31084 
31085     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
31086         mem_base = xmlMemBlocks();
31087         reader = gen_xmlTextReaderPtr(n_reader, 0);
31088 
31089         ret_val = xmlTextReaderConstXmlLang(reader);
31090         desret_const_xmlChar_ptr(ret_val);
31091         call_tests++;
31092         des_xmlTextReaderPtr(n_reader, reader, 0);
31093         xmlResetLastError();
31094         if (mem_base != xmlMemBlocks()) {
31095             printf("Leak of %d blocks found in xmlTextReaderConstXmlLang",
31096 	           xmlMemBlocks() - mem_base);
31097 	    test_ret++;
31098             printf(" %d", n_reader);
31099             printf("\n");
31100         }
31101     }
31102     function_tests++;
31103 #endif
31104 
31105     return(test_ret);
31106 }
31107 
31108 
31109 static int
test_xmlTextReaderConstXmlVersion(void)31110 test_xmlTextReaderConstXmlVersion(void) {
31111     int test_ret = 0;
31112 
31113 #if defined(LIBXML_READER_ENABLED)
31114     int mem_base;
31115     const xmlChar * ret_val;
31116     xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
31117     int n_reader;
31118 
31119     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
31120         mem_base = xmlMemBlocks();
31121         reader = gen_xmlTextReaderPtr(n_reader, 0);
31122 
31123         ret_val = xmlTextReaderConstXmlVersion(reader);
31124         desret_const_xmlChar_ptr(ret_val);
31125         call_tests++;
31126         des_xmlTextReaderPtr(n_reader, reader, 0);
31127         xmlResetLastError();
31128         if (mem_base != xmlMemBlocks()) {
31129             printf("Leak of %d blocks found in xmlTextReaderConstXmlVersion",
31130 	           xmlMemBlocks() - mem_base);
31131 	    test_ret++;
31132             printf(" %d", n_reader);
31133             printf("\n");
31134         }
31135     }
31136     function_tests++;
31137 #endif
31138 
31139     return(test_ret);
31140 }
31141 
31142 
31143 static int
test_xmlTextReaderCurrentDoc(void)31144 test_xmlTextReaderCurrentDoc(void) {
31145     int test_ret = 0;
31146 
31147 #if defined(LIBXML_READER_ENABLED)
31148     int mem_base;
31149     xmlDocPtr ret_val;
31150     xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
31151     int n_reader;
31152 
31153     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
31154         mem_base = xmlMemBlocks();
31155         reader = gen_xmlTextReaderPtr(n_reader, 0);
31156 
31157         ret_val = xmlTextReaderCurrentDoc(reader);
31158         desret_xmlDocPtr(ret_val);
31159         call_tests++;
31160         des_xmlTextReaderPtr(n_reader, reader, 0);
31161         xmlResetLastError();
31162         if (mem_base != xmlMemBlocks()) {
31163             printf("Leak of %d blocks found in xmlTextReaderCurrentDoc",
31164 	           xmlMemBlocks() - mem_base);
31165 	    test_ret++;
31166             printf(" %d", n_reader);
31167             printf("\n");
31168         }
31169     }
31170     function_tests++;
31171 #endif
31172 
31173     return(test_ret);
31174 }
31175 
31176 
31177 static int
test_xmlTextReaderCurrentNode(void)31178 test_xmlTextReaderCurrentNode(void) {
31179     int test_ret = 0;
31180 
31181 #if defined(LIBXML_READER_ENABLED)
31182     int mem_base;
31183     xmlNodePtr ret_val;
31184     xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
31185     int n_reader;
31186 
31187     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
31188         mem_base = xmlMemBlocks();
31189         reader = gen_xmlTextReaderPtr(n_reader, 0);
31190 
31191         ret_val = xmlTextReaderCurrentNode(reader);
31192         desret_xmlNodePtr(ret_val);
31193         call_tests++;
31194         des_xmlTextReaderPtr(n_reader, reader, 0);
31195         xmlResetLastError();
31196         if (mem_base != xmlMemBlocks()) {
31197             printf("Leak of %d blocks found in xmlTextReaderCurrentNode",
31198 	           xmlMemBlocks() - mem_base);
31199 	    test_ret++;
31200             printf(" %d", n_reader);
31201             printf("\n");
31202         }
31203     }
31204     function_tests++;
31205 #endif
31206 
31207     return(test_ret);
31208 }
31209 
31210 
31211 static int
test_xmlTextReaderDepth(void)31212 test_xmlTextReaderDepth(void) {
31213     int test_ret = 0;
31214 
31215 #if defined(LIBXML_READER_ENABLED)
31216     int mem_base;
31217     int ret_val;
31218     xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
31219     int n_reader;
31220 
31221     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
31222         mem_base = xmlMemBlocks();
31223         reader = gen_xmlTextReaderPtr(n_reader, 0);
31224 
31225         ret_val = xmlTextReaderDepth(reader);
31226         desret_int(ret_val);
31227         call_tests++;
31228         des_xmlTextReaderPtr(n_reader, reader, 0);
31229         xmlResetLastError();
31230         if (mem_base != xmlMemBlocks()) {
31231             printf("Leak of %d blocks found in xmlTextReaderDepth",
31232 	           xmlMemBlocks() - mem_base);
31233 	    test_ret++;
31234             printf(" %d", n_reader);
31235             printf("\n");
31236         }
31237     }
31238     function_tests++;
31239 #endif
31240 
31241     return(test_ret);
31242 }
31243 
31244 
31245 static int
test_xmlTextReaderExpand(void)31246 test_xmlTextReaderExpand(void) {
31247     int test_ret = 0;
31248 
31249 #if defined(LIBXML_READER_ENABLED)
31250     int mem_base;
31251     xmlNodePtr ret_val;
31252     xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
31253     int n_reader;
31254 
31255     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
31256         mem_base = xmlMemBlocks();
31257         reader = gen_xmlTextReaderPtr(n_reader, 0);
31258 
31259         ret_val = xmlTextReaderExpand(reader);
31260         desret_xmlNodePtr(ret_val);
31261         call_tests++;
31262         des_xmlTextReaderPtr(n_reader, reader, 0);
31263         xmlResetLastError();
31264         if (mem_base != xmlMemBlocks()) {
31265             printf("Leak of %d blocks found in xmlTextReaderExpand",
31266 	           xmlMemBlocks() - mem_base);
31267 	    test_ret++;
31268             printf(" %d", n_reader);
31269             printf("\n");
31270         }
31271     }
31272     function_tests++;
31273 #endif
31274 
31275     return(test_ret);
31276 }
31277 
31278 
31279 static int
test_xmlTextReaderGetAttribute(void)31280 test_xmlTextReaderGetAttribute(void) {
31281     int test_ret = 0;
31282 
31283 #if defined(LIBXML_READER_ENABLED)
31284     int mem_base;
31285     xmlChar * ret_val;
31286     xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
31287     int n_reader;
31288     xmlChar * name; /* the qualified name of the attribute. */
31289     int n_name;
31290 
31291     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
31292     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
31293         mem_base = xmlMemBlocks();
31294         reader = gen_xmlTextReaderPtr(n_reader, 0);
31295         name = gen_const_xmlChar_ptr(n_name, 1);
31296 
31297         ret_val = xmlTextReaderGetAttribute(reader, (const xmlChar *)name);
31298         desret_xmlChar_ptr(ret_val);
31299         call_tests++;
31300         des_xmlTextReaderPtr(n_reader, reader, 0);
31301         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
31302         xmlResetLastError();
31303         if (mem_base != xmlMemBlocks()) {
31304             printf("Leak of %d blocks found in xmlTextReaderGetAttribute",
31305 	           xmlMemBlocks() - mem_base);
31306 	    test_ret++;
31307             printf(" %d", n_reader);
31308             printf(" %d", n_name);
31309             printf("\n");
31310         }
31311     }
31312     }
31313     function_tests++;
31314 #endif
31315 
31316     return(test_ret);
31317 }
31318 
31319 
31320 static int
test_xmlTextReaderGetAttributeNo(void)31321 test_xmlTextReaderGetAttributeNo(void) {
31322     int test_ret = 0;
31323 
31324 #if defined(LIBXML_READER_ENABLED)
31325     int mem_base;
31326     xmlChar * ret_val;
31327     xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
31328     int n_reader;
31329     int no; /* the zero-based index of the attribute relative to the containing element */
31330     int n_no;
31331 
31332     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
31333     for (n_no = 0;n_no < gen_nb_int;n_no++) {
31334         mem_base = xmlMemBlocks();
31335         reader = gen_xmlTextReaderPtr(n_reader, 0);
31336         no = gen_int(n_no, 1);
31337 
31338         ret_val = xmlTextReaderGetAttributeNo(reader, no);
31339         desret_xmlChar_ptr(ret_val);
31340         call_tests++;
31341         des_xmlTextReaderPtr(n_reader, reader, 0);
31342         des_int(n_no, no, 1);
31343         xmlResetLastError();
31344         if (mem_base != xmlMemBlocks()) {
31345             printf("Leak of %d blocks found in xmlTextReaderGetAttributeNo",
31346 	           xmlMemBlocks() - mem_base);
31347 	    test_ret++;
31348             printf(" %d", n_reader);
31349             printf(" %d", n_no);
31350             printf("\n");
31351         }
31352     }
31353     }
31354     function_tests++;
31355 #endif
31356 
31357     return(test_ret);
31358 }
31359 
31360 
31361 static int
test_xmlTextReaderGetAttributeNs(void)31362 test_xmlTextReaderGetAttributeNs(void) {
31363     int test_ret = 0;
31364 
31365 #if defined(LIBXML_READER_ENABLED)
31366     int mem_base;
31367     xmlChar * ret_val;
31368     xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
31369     int n_reader;
31370     xmlChar * localName; /* the local name of the attribute. */
31371     int n_localName;
31372     xmlChar * namespaceURI; /* the namespace URI of the attribute. */
31373     int n_namespaceURI;
31374 
31375     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
31376     for (n_localName = 0;n_localName < gen_nb_const_xmlChar_ptr;n_localName++) {
31377     for (n_namespaceURI = 0;n_namespaceURI < gen_nb_const_xmlChar_ptr;n_namespaceURI++) {
31378         mem_base = xmlMemBlocks();
31379         reader = gen_xmlTextReaderPtr(n_reader, 0);
31380         localName = gen_const_xmlChar_ptr(n_localName, 1);
31381         namespaceURI = gen_const_xmlChar_ptr(n_namespaceURI, 2);
31382 
31383         ret_val = xmlTextReaderGetAttributeNs(reader, (const xmlChar *)localName, (const xmlChar *)namespaceURI);
31384         desret_xmlChar_ptr(ret_val);
31385         call_tests++;
31386         des_xmlTextReaderPtr(n_reader, reader, 0);
31387         des_const_xmlChar_ptr(n_localName, (const xmlChar *)localName, 1);
31388         des_const_xmlChar_ptr(n_namespaceURI, (const xmlChar *)namespaceURI, 2);
31389         xmlResetLastError();
31390         if (mem_base != xmlMemBlocks()) {
31391             printf("Leak of %d blocks found in xmlTextReaderGetAttributeNs",
31392 	           xmlMemBlocks() - mem_base);
31393 	    test_ret++;
31394             printf(" %d", n_reader);
31395             printf(" %d", n_localName);
31396             printf(" %d", n_namespaceURI);
31397             printf("\n");
31398         }
31399     }
31400     }
31401     }
31402     function_tests++;
31403 #endif
31404 
31405     return(test_ret);
31406 }
31407 
31408 #ifdef LIBXML_READER_ENABLED
31409 
31410 #define gen_nb_xmlTextReaderErrorFunc_ptr 1
gen_xmlTextReaderErrorFunc_ptr(int no ATTRIBUTE_UNUSED,int nr ATTRIBUTE_UNUSED)31411 static xmlTextReaderErrorFunc * gen_xmlTextReaderErrorFunc_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
31412     return(NULL);
31413 }
des_xmlTextReaderErrorFunc_ptr(int no ATTRIBUTE_UNUSED,xmlTextReaderErrorFunc * val ATTRIBUTE_UNUSED,int nr ATTRIBUTE_UNUSED)31414 static void des_xmlTextReaderErrorFunc_ptr(int no ATTRIBUTE_UNUSED, xmlTextReaderErrorFunc * val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
31415 }
31416 #endif
31417 
31418 
31419 static int
test_xmlTextReaderGetErrorHandler(void)31420 test_xmlTextReaderGetErrorHandler(void) {
31421     int test_ret = 0;
31422 
31423 #if defined(LIBXML_READER_ENABLED)
31424     int mem_base;
31425     xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
31426     int n_reader;
31427     xmlTextReaderErrorFunc * f; /* the callback function or NULL is no callback has been registered */
31428     int n_f;
31429     void ** arg; /* a user argument */
31430     int n_arg;
31431 
31432     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
31433     for (n_f = 0;n_f < gen_nb_xmlTextReaderErrorFunc_ptr;n_f++) {
31434     for (n_arg = 0;n_arg < gen_nb_void_ptr_ptr;n_arg++) {
31435         mem_base = xmlMemBlocks();
31436         reader = gen_xmlTextReaderPtr(n_reader, 0);
31437         f = gen_xmlTextReaderErrorFunc_ptr(n_f, 1);
31438         arg = gen_void_ptr_ptr(n_arg, 2);
31439 
31440         xmlTextReaderGetErrorHandler(reader, f, arg);
31441         call_tests++;
31442         des_xmlTextReaderPtr(n_reader, reader, 0);
31443         des_xmlTextReaderErrorFunc_ptr(n_f, f, 1);
31444         des_void_ptr_ptr(n_arg, arg, 2);
31445         xmlResetLastError();
31446         if (mem_base != xmlMemBlocks()) {
31447             printf("Leak of %d blocks found in xmlTextReaderGetErrorHandler",
31448 	           xmlMemBlocks() - mem_base);
31449 	    test_ret++;
31450             printf(" %d", n_reader);
31451             printf(" %d", n_f);
31452             printf(" %d", n_arg);
31453             printf("\n");
31454         }
31455     }
31456     }
31457     }
31458     function_tests++;
31459 #endif
31460 
31461     return(test_ret);
31462 }
31463 
31464 
31465 static int
test_xmlTextReaderGetParserColumnNumber(void)31466 test_xmlTextReaderGetParserColumnNumber(void) {
31467     int test_ret = 0;
31468 
31469 #if defined(LIBXML_READER_ENABLED)
31470     int mem_base;
31471     int ret_val;
31472     xmlTextReaderPtr reader; /* the user data (XML reader context) */
31473     int n_reader;
31474 
31475     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
31476         mem_base = xmlMemBlocks();
31477         reader = gen_xmlTextReaderPtr(n_reader, 0);
31478 
31479         ret_val = xmlTextReaderGetParserColumnNumber(reader);
31480         desret_int(ret_val);
31481         call_tests++;
31482         des_xmlTextReaderPtr(n_reader, reader, 0);
31483         xmlResetLastError();
31484         if (mem_base != xmlMemBlocks()) {
31485             printf("Leak of %d blocks found in xmlTextReaderGetParserColumnNumber",
31486 	           xmlMemBlocks() - mem_base);
31487 	    test_ret++;
31488             printf(" %d", n_reader);
31489             printf("\n");
31490         }
31491     }
31492     function_tests++;
31493 #endif
31494 
31495     return(test_ret);
31496 }
31497 
31498 
31499 static int
test_xmlTextReaderGetParserLineNumber(void)31500 test_xmlTextReaderGetParserLineNumber(void) {
31501     int test_ret = 0;
31502 
31503 #if defined(LIBXML_READER_ENABLED)
31504     int mem_base;
31505     int ret_val;
31506     xmlTextReaderPtr reader; /* the user data (XML reader context) */
31507     int n_reader;
31508 
31509     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
31510         mem_base = xmlMemBlocks();
31511         reader = gen_xmlTextReaderPtr(n_reader, 0);
31512 
31513         ret_val = xmlTextReaderGetParserLineNumber(reader);
31514         desret_int(ret_val);
31515         call_tests++;
31516         des_xmlTextReaderPtr(n_reader, reader, 0);
31517         xmlResetLastError();
31518         if (mem_base != xmlMemBlocks()) {
31519             printf("Leak of %d blocks found in xmlTextReaderGetParserLineNumber",
31520 	           xmlMemBlocks() - mem_base);
31521 	    test_ret++;
31522             printf(" %d", n_reader);
31523             printf("\n");
31524         }
31525     }
31526     function_tests++;
31527 #endif
31528 
31529     return(test_ret);
31530 }
31531 
31532 
31533 static int
test_xmlTextReaderGetParserProp(void)31534 test_xmlTextReaderGetParserProp(void) {
31535     int test_ret = 0;
31536 
31537 #if defined(LIBXML_READER_ENABLED)
31538     int mem_base;
31539     int ret_val;
31540     xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
31541     int n_reader;
31542     int prop; /* the xmlParserProperties to get */
31543     int n_prop;
31544 
31545     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
31546     for (n_prop = 0;n_prop < gen_nb_int;n_prop++) {
31547         mem_base = xmlMemBlocks();
31548         reader = gen_xmlTextReaderPtr(n_reader, 0);
31549         prop = gen_int(n_prop, 1);
31550 
31551         ret_val = xmlTextReaderGetParserProp(reader, prop);
31552         desret_int(ret_val);
31553         call_tests++;
31554         des_xmlTextReaderPtr(n_reader, reader, 0);
31555         des_int(n_prop, prop, 1);
31556         xmlResetLastError();
31557         if (mem_base != xmlMemBlocks()) {
31558             printf("Leak of %d blocks found in xmlTextReaderGetParserProp",
31559 	           xmlMemBlocks() - mem_base);
31560 	    test_ret++;
31561             printf(" %d", n_reader);
31562             printf(" %d", n_prop);
31563             printf("\n");
31564         }
31565     }
31566     }
31567     function_tests++;
31568 #endif
31569 
31570     return(test_ret);
31571 }
31572 
31573 
31574 static int
test_xmlTextReaderGetRemainder(void)31575 test_xmlTextReaderGetRemainder(void) {
31576     int test_ret = 0;
31577 
31578 #if defined(LIBXML_READER_ENABLED)
31579     int mem_base;
31580     xmlParserInputBufferPtr ret_val;
31581     xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
31582     int n_reader;
31583 
31584     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
31585         mem_base = xmlMemBlocks();
31586         reader = gen_xmlTextReaderPtr(n_reader, 0);
31587 
31588         ret_val = xmlTextReaderGetRemainder(reader);
31589         desret_xmlParserInputBufferPtr(ret_val);
31590         call_tests++;
31591         des_xmlTextReaderPtr(n_reader, reader, 0);
31592         xmlResetLastError();
31593         if (mem_base != xmlMemBlocks()) {
31594             printf("Leak of %d blocks found in xmlTextReaderGetRemainder",
31595 	           xmlMemBlocks() - mem_base);
31596 	    test_ret++;
31597             printf(" %d", n_reader);
31598             printf("\n");
31599         }
31600     }
31601     function_tests++;
31602 #endif
31603 
31604     return(test_ret);
31605 }
31606 
31607 
31608 static int
test_xmlTextReaderHasAttributes(void)31609 test_xmlTextReaderHasAttributes(void) {
31610     int test_ret = 0;
31611 
31612 #if defined(LIBXML_READER_ENABLED)
31613     int mem_base;
31614     int ret_val;
31615     xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
31616     int n_reader;
31617 
31618     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
31619         mem_base = xmlMemBlocks();
31620         reader = gen_xmlTextReaderPtr(n_reader, 0);
31621 
31622         ret_val = xmlTextReaderHasAttributes(reader);
31623         desret_int(ret_val);
31624         call_tests++;
31625         des_xmlTextReaderPtr(n_reader, reader, 0);
31626         xmlResetLastError();
31627         if (mem_base != xmlMemBlocks()) {
31628             printf("Leak of %d blocks found in xmlTextReaderHasAttributes",
31629 	           xmlMemBlocks() - mem_base);
31630 	    test_ret++;
31631             printf(" %d", n_reader);
31632             printf("\n");
31633         }
31634     }
31635     function_tests++;
31636 #endif
31637 
31638     return(test_ret);
31639 }
31640 
31641 
31642 static int
test_xmlTextReaderHasValue(void)31643 test_xmlTextReaderHasValue(void) {
31644     int test_ret = 0;
31645 
31646 #if defined(LIBXML_READER_ENABLED)
31647     int mem_base;
31648     int ret_val;
31649     xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
31650     int n_reader;
31651 
31652     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
31653         mem_base = xmlMemBlocks();
31654         reader = gen_xmlTextReaderPtr(n_reader, 0);
31655 
31656         ret_val = xmlTextReaderHasValue(reader);
31657         desret_int(ret_val);
31658         call_tests++;
31659         des_xmlTextReaderPtr(n_reader, reader, 0);
31660         xmlResetLastError();
31661         if (mem_base != xmlMemBlocks()) {
31662             printf("Leak of %d blocks found in xmlTextReaderHasValue",
31663 	           xmlMemBlocks() - mem_base);
31664 	    test_ret++;
31665             printf(" %d", n_reader);
31666             printf("\n");
31667         }
31668     }
31669     function_tests++;
31670 #endif
31671 
31672     return(test_ret);
31673 }
31674 
31675 
31676 static int
test_xmlTextReaderIsDefault(void)31677 test_xmlTextReaderIsDefault(void) {
31678     int test_ret = 0;
31679 
31680 #if defined(LIBXML_READER_ENABLED)
31681     int mem_base;
31682     int ret_val;
31683     xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
31684     int n_reader;
31685 
31686     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
31687         mem_base = xmlMemBlocks();
31688         reader = gen_xmlTextReaderPtr(n_reader, 0);
31689 
31690         ret_val = xmlTextReaderIsDefault(reader);
31691         desret_int(ret_val);
31692         call_tests++;
31693         des_xmlTextReaderPtr(n_reader, reader, 0);
31694         xmlResetLastError();
31695         if (mem_base != xmlMemBlocks()) {
31696             printf("Leak of %d blocks found in xmlTextReaderIsDefault",
31697 	           xmlMemBlocks() - mem_base);
31698 	    test_ret++;
31699             printf(" %d", n_reader);
31700             printf("\n");
31701         }
31702     }
31703     function_tests++;
31704 #endif
31705 
31706     return(test_ret);
31707 }
31708 
31709 
31710 static int
test_xmlTextReaderIsEmptyElement(void)31711 test_xmlTextReaderIsEmptyElement(void) {
31712     int test_ret = 0;
31713 
31714 #if defined(LIBXML_READER_ENABLED)
31715     int mem_base;
31716     int ret_val;
31717     xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
31718     int n_reader;
31719 
31720     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
31721         mem_base = xmlMemBlocks();
31722         reader = gen_xmlTextReaderPtr(n_reader, 0);
31723 
31724         ret_val = xmlTextReaderIsEmptyElement(reader);
31725         desret_int(ret_val);
31726         call_tests++;
31727         des_xmlTextReaderPtr(n_reader, reader, 0);
31728         xmlResetLastError();
31729         if (mem_base != xmlMemBlocks()) {
31730             printf("Leak of %d blocks found in xmlTextReaderIsEmptyElement",
31731 	           xmlMemBlocks() - mem_base);
31732 	    test_ret++;
31733             printf(" %d", n_reader);
31734             printf("\n");
31735         }
31736     }
31737     function_tests++;
31738 #endif
31739 
31740     return(test_ret);
31741 }
31742 
31743 
31744 static int
test_xmlTextReaderIsNamespaceDecl(void)31745 test_xmlTextReaderIsNamespaceDecl(void) {
31746     int test_ret = 0;
31747 
31748 #if defined(LIBXML_READER_ENABLED)
31749     int mem_base;
31750     int ret_val;
31751     xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
31752     int n_reader;
31753 
31754     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
31755         mem_base = xmlMemBlocks();
31756         reader = gen_xmlTextReaderPtr(n_reader, 0);
31757 
31758         ret_val = xmlTextReaderIsNamespaceDecl(reader);
31759         desret_int(ret_val);
31760         call_tests++;
31761         des_xmlTextReaderPtr(n_reader, reader, 0);
31762         xmlResetLastError();
31763         if (mem_base != xmlMemBlocks()) {
31764             printf("Leak of %d blocks found in xmlTextReaderIsNamespaceDecl",
31765 	           xmlMemBlocks() - mem_base);
31766 	    test_ret++;
31767             printf(" %d", n_reader);
31768             printf("\n");
31769         }
31770     }
31771     function_tests++;
31772 #endif
31773 
31774     return(test_ret);
31775 }
31776 
31777 
31778 static int
test_xmlTextReaderIsValid(void)31779 test_xmlTextReaderIsValid(void) {
31780     int test_ret = 0;
31781 
31782 #if defined(LIBXML_READER_ENABLED)
31783     int mem_base;
31784     int ret_val;
31785     xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
31786     int n_reader;
31787 
31788     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
31789         mem_base = xmlMemBlocks();
31790         reader = gen_xmlTextReaderPtr(n_reader, 0);
31791 
31792         ret_val = xmlTextReaderIsValid(reader);
31793         desret_int(ret_val);
31794         call_tests++;
31795         des_xmlTextReaderPtr(n_reader, reader, 0);
31796         xmlResetLastError();
31797         if (mem_base != xmlMemBlocks()) {
31798             printf("Leak of %d blocks found in xmlTextReaderIsValid",
31799 	           xmlMemBlocks() - mem_base);
31800 	    test_ret++;
31801             printf(" %d", n_reader);
31802             printf("\n");
31803         }
31804     }
31805     function_tests++;
31806 #endif
31807 
31808     return(test_ret);
31809 }
31810 
31811 
31812 static int
test_xmlTextReaderLocalName(void)31813 test_xmlTextReaderLocalName(void) {
31814     int test_ret = 0;
31815 
31816 #if defined(LIBXML_READER_ENABLED)
31817     int mem_base;
31818     xmlChar * ret_val;
31819     xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
31820     int n_reader;
31821 
31822     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
31823         mem_base = xmlMemBlocks();
31824         reader = gen_xmlTextReaderPtr(n_reader, 0);
31825 
31826         ret_val = xmlTextReaderLocalName(reader);
31827         desret_xmlChar_ptr(ret_val);
31828         call_tests++;
31829         des_xmlTextReaderPtr(n_reader, reader, 0);
31830         xmlResetLastError();
31831         if (mem_base != xmlMemBlocks()) {
31832             printf("Leak of %d blocks found in xmlTextReaderLocalName",
31833 	           xmlMemBlocks() - mem_base);
31834 	    test_ret++;
31835             printf(" %d", n_reader);
31836             printf("\n");
31837         }
31838     }
31839     function_tests++;
31840 #endif
31841 
31842     return(test_ret);
31843 }
31844 
31845 #ifdef LIBXML_READER_ENABLED
31846 
31847 #define gen_nb_xmlTextReaderLocatorPtr 1
gen_xmlTextReaderLocatorPtr(int no ATTRIBUTE_UNUSED,int nr ATTRIBUTE_UNUSED)31848 static xmlTextReaderLocatorPtr gen_xmlTextReaderLocatorPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
31849     return(NULL);
31850 }
des_xmlTextReaderLocatorPtr(int no ATTRIBUTE_UNUSED,xmlTextReaderLocatorPtr val ATTRIBUTE_UNUSED,int nr ATTRIBUTE_UNUSED)31851 static void des_xmlTextReaderLocatorPtr(int no ATTRIBUTE_UNUSED, xmlTextReaderLocatorPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
31852 }
31853 #endif
31854 
31855 
31856 static int
test_xmlTextReaderLocatorBaseURI(void)31857 test_xmlTextReaderLocatorBaseURI(void) {
31858     int test_ret = 0;
31859 
31860 #if defined(LIBXML_READER_ENABLED)
31861     int mem_base;
31862     xmlChar * ret_val;
31863     xmlTextReaderLocatorPtr locator; /* the xmlTextReaderLocatorPtr used */
31864     int n_locator;
31865 
31866     for (n_locator = 0;n_locator < gen_nb_xmlTextReaderLocatorPtr;n_locator++) {
31867         mem_base = xmlMemBlocks();
31868         locator = gen_xmlTextReaderLocatorPtr(n_locator, 0);
31869 
31870         ret_val = xmlTextReaderLocatorBaseURI(locator);
31871         desret_xmlChar_ptr(ret_val);
31872         call_tests++;
31873         des_xmlTextReaderLocatorPtr(n_locator, locator, 0);
31874         xmlResetLastError();
31875         if (mem_base != xmlMemBlocks()) {
31876             printf("Leak of %d blocks found in xmlTextReaderLocatorBaseURI",
31877 	           xmlMemBlocks() - mem_base);
31878 	    test_ret++;
31879             printf(" %d", n_locator);
31880             printf("\n");
31881         }
31882     }
31883     function_tests++;
31884 #endif
31885 
31886     return(test_ret);
31887 }
31888 
31889 
31890 static int
test_xmlTextReaderLocatorLineNumber(void)31891 test_xmlTextReaderLocatorLineNumber(void) {
31892     int test_ret = 0;
31893 
31894 #if defined(LIBXML_READER_ENABLED)
31895     int mem_base;
31896     int ret_val;
31897     xmlTextReaderLocatorPtr locator; /* the xmlTextReaderLocatorPtr used */
31898     int n_locator;
31899 
31900     for (n_locator = 0;n_locator < gen_nb_xmlTextReaderLocatorPtr;n_locator++) {
31901         mem_base = xmlMemBlocks();
31902         locator = gen_xmlTextReaderLocatorPtr(n_locator, 0);
31903 
31904         ret_val = xmlTextReaderLocatorLineNumber(locator);
31905         desret_int(ret_val);
31906         call_tests++;
31907         des_xmlTextReaderLocatorPtr(n_locator, locator, 0);
31908         xmlResetLastError();
31909         if (mem_base != xmlMemBlocks()) {
31910             printf("Leak of %d blocks found in xmlTextReaderLocatorLineNumber",
31911 	           xmlMemBlocks() - mem_base);
31912 	    test_ret++;
31913             printf(" %d", n_locator);
31914             printf("\n");
31915         }
31916     }
31917     function_tests++;
31918 #endif
31919 
31920     return(test_ret);
31921 }
31922 
31923 
31924 static int
test_xmlTextReaderLookupNamespace(void)31925 test_xmlTextReaderLookupNamespace(void) {
31926     int test_ret = 0;
31927 
31928 #if defined(LIBXML_READER_ENABLED)
31929     int mem_base;
31930     xmlChar * ret_val;
31931     xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
31932     int n_reader;
31933     xmlChar * prefix; /* the prefix whose namespace URI is to be resolved. To return the default namespace, specify NULL */
31934     int n_prefix;
31935 
31936     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
31937     for (n_prefix = 0;n_prefix < gen_nb_const_xmlChar_ptr;n_prefix++) {
31938         mem_base = xmlMemBlocks();
31939         reader = gen_xmlTextReaderPtr(n_reader, 0);
31940         prefix = gen_const_xmlChar_ptr(n_prefix, 1);
31941 
31942         ret_val = xmlTextReaderLookupNamespace(reader, (const xmlChar *)prefix);
31943         desret_xmlChar_ptr(ret_val);
31944         call_tests++;
31945         des_xmlTextReaderPtr(n_reader, reader, 0);
31946         des_const_xmlChar_ptr(n_prefix, (const xmlChar *)prefix, 1);
31947         xmlResetLastError();
31948         if (mem_base != xmlMemBlocks()) {
31949             printf("Leak of %d blocks found in xmlTextReaderLookupNamespace",
31950 	           xmlMemBlocks() - mem_base);
31951 	    test_ret++;
31952             printf(" %d", n_reader);
31953             printf(" %d", n_prefix);
31954             printf("\n");
31955         }
31956     }
31957     }
31958     function_tests++;
31959 #endif
31960 
31961     return(test_ret);
31962 }
31963 
31964 
31965 static int
test_xmlTextReaderMoveToAttribute(void)31966 test_xmlTextReaderMoveToAttribute(void) {
31967     int test_ret = 0;
31968 
31969 #if defined(LIBXML_READER_ENABLED)
31970     int mem_base;
31971     int ret_val;
31972     xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
31973     int n_reader;
31974     xmlChar * name; /* the qualified name of the attribute. */
31975     int n_name;
31976 
31977     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
31978     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
31979         mem_base = xmlMemBlocks();
31980         reader = gen_xmlTextReaderPtr(n_reader, 0);
31981         name = gen_const_xmlChar_ptr(n_name, 1);
31982 
31983         ret_val = xmlTextReaderMoveToAttribute(reader, (const xmlChar *)name);
31984         desret_int(ret_val);
31985         call_tests++;
31986         des_xmlTextReaderPtr(n_reader, reader, 0);
31987         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
31988         xmlResetLastError();
31989         if (mem_base != xmlMemBlocks()) {
31990             printf("Leak of %d blocks found in xmlTextReaderMoveToAttribute",
31991 	           xmlMemBlocks() - mem_base);
31992 	    test_ret++;
31993             printf(" %d", n_reader);
31994             printf(" %d", n_name);
31995             printf("\n");
31996         }
31997     }
31998     }
31999     function_tests++;
32000 #endif
32001 
32002     return(test_ret);
32003 }
32004 
32005 
32006 static int
test_xmlTextReaderMoveToAttributeNo(void)32007 test_xmlTextReaderMoveToAttributeNo(void) {
32008     int test_ret = 0;
32009 
32010 #if defined(LIBXML_READER_ENABLED)
32011     int mem_base;
32012     int ret_val;
32013     xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
32014     int n_reader;
32015     int no; /* the zero-based index of the attribute relative to the containing element. */
32016     int n_no;
32017 
32018     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
32019     for (n_no = 0;n_no < gen_nb_int;n_no++) {
32020         mem_base = xmlMemBlocks();
32021         reader = gen_xmlTextReaderPtr(n_reader, 0);
32022         no = gen_int(n_no, 1);
32023 
32024         ret_val = xmlTextReaderMoveToAttributeNo(reader, no);
32025         desret_int(ret_val);
32026         call_tests++;
32027         des_xmlTextReaderPtr(n_reader, reader, 0);
32028         des_int(n_no, no, 1);
32029         xmlResetLastError();
32030         if (mem_base != xmlMemBlocks()) {
32031             printf("Leak of %d blocks found in xmlTextReaderMoveToAttributeNo",
32032 	           xmlMemBlocks() - mem_base);
32033 	    test_ret++;
32034             printf(" %d", n_reader);
32035             printf(" %d", n_no);
32036             printf("\n");
32037         }
32038     }
32039     }
32040     function_tests++;
32041 #endif
32042 
32043     return(test_ret);
32044 }
32045 
32046 
32047 static int
test_xmlTextReaderMoveToAttributeNs(void)32048 test_xmlTextReaderMoveToAttributeNs(void) {
32049     int test_ret = 0;
32050 
32051 #if defined(LIBXML_READER_ENABLED)
32052     int mem_base;
32053     int ret_val;
32054     xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
32055     int n_reader;
32056     xmlChar * localName; /* the local name of the attribute. */
32057     int n_localName;
32058     xmlChar * namespaceURI; /* the namespace URI of the attribute. */
32059     int n_namespaceURI;
32060 
32061     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
32062     for (n_localName = 0;n_localName < gen_nb_const_xmlChar_ptr;n_localName++) {
32063     for (n_namespaceURI = 0;n_namespaceURI < gen_nb_const_xmlChar_ptr;n_namespaceURI++) {
32064         mem_base = xmlMemBlocks();
32065         reader = gen_xmlTextReaderPtr(n_reader, 0);
32066         localName = gen_const_xmlChar_ptr(n_localName, 1);
32067         namespaceURI = gen_const_xmlChar_ptr(n_namespaceURI, 2);
32068 
32069         ret_val = xmlTextReaderMoveToAttributeNs(reader, (const xmlChar *)localName, (const xmlChar *)namespaceURI);
32070         desret_int(ret_val);
32071         call_tests++;
32072         des_xmlTextReaderPtr(n_reader, reader, 0);
32073         des_const_xmlChar_ptr(n_localName, (const xmlChar *)localName, 1);
32074         des_const_xmlChar_ptr(n_namespaceURI, (const xmlChar *)namespaceURI, 2);
32075         xmlResetLastError();
32076         if (mem_base != xmlMemBlocks()) {
32077             printf("Leak of %d blocks found in xmlTextReaderMoveToAttributeNs",
32078 	           xmlMemBlocks() - mem_base);
32079 	    test_ret++;
32080             printf(" %d", n_reader);
32081             printf(" %d", n_localName);
32082             printf(" %d", n_namespaceURI);
32083             printf("\n");
32084         }
32085     }
32086     }
32087     }
32088     function_tests++;
32089 #endif
32090 
32091     return(test_ret);
32092 }
32093 
32094 
32095 static int
test_xmlTextReaderMoveToElement(void)32096 test_xmlTextReaderMoveToElement(void) {
32097     int test_ret = 0;
32098 
32099 #if defined(LIBXML_READER_ENABLED)
32100     int mem_base;
32101     int ret_val;
32102     xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
32103     int n_reader;
32104 
32105     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
32106         mem_base = xmlMemBlocks();
32107         reader = gen_xmlTextReaderPtr(n_reader, 0);
32108 
32109         ret_val = xmlTextReaderMoveToElement(reader);
32110         desret_int(ret_val);
32111         call_tests++;
32112         des_xmlTextReaderPtr(n_reader, reader, 0);
32113         xmlResetLastError();
32114         if (mem_base != xmlMemBlocks()) {
32115             printf("Leak of %d blocks found in xmlTextReaderMoveToElement",
32116 	           xmlMemBlocks() - mem_base);
32117 	    test_ret++;
32118             printf(" %d", n_reader);
32119             printf("\n");
32120         }
32121     }
32122     function_tests++;
32123 #endif
32124 
32125     return(test_ret);
32126 }
32127 
32128 
32129 static int
test_xmlTextReaderMoveToFirstAttribute(void)32130 test_xmlTextReaderMoveToFirstAttribute(void) {
32131     int test_ret = 0;
32132 
32133 #if defined(LIBXML_READER_ENABLED)
32134     int mem_base;
32135     int ret_val;
32136     xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
32137     int n_reader;
32138 
32139     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
32140         mem_base = xmlMemBlocks();
32141         reader = gen_xmlTextReaderPtr(n_reader, 0);
32142 
32143         ret_val = xmlTextReaderMoveToFirstAttribute(reader);
32144         desret_int(ret_val);
32145         call_tests++;
32146         des_xmlTextReaderPtr(n_reader, reader, 0);
32147         xmlResetLastError();
32148         if (mem_base != xmlMemBlocks()) {
32149             printf("Leak of %d blocks found in xmlTextReaderMoveToFirstAttribute",
32150 	           xmlMemBlocks() - mem_base);
32151 	    test_ret++;
32152             printf(" %d", n_reader);
32153             printf("\n");
32154         }
32155     }
32156     function_tests++;
32157 #endif
32158 
32159     return(test_ret);
32160 }
32161 
32162 
32163 static int
test_xmlTextReaderMoveToNextAttribute(void)32164 test_xmlTextReaderMoveToNextAttribute(void) {
32165     int test_ret = 0;
32166 
32167 #if defined(LIBXML_READER_ENABLED)
32168     int mem_base;
32169     int ret_val;
32170     xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
32171     int n_reader;
32172 
32173     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
32174         mem_base = xmlMemBlocks();
32175         reader = gen_xmlTextReaderPtr(n_reader, 0);
32176 
32177         ret_val = xmlTextReaderMoveToNextAttribute(reader);
32178         desret_int(ret_val);
32179         call_tests++;
32180         des_xmlTextReaderPtr(n_reader, reader, 0);
32181         xmlResetLastError();
32182         if (mem_base != xmlMemBlocks()) {
32183             printf("Leak of %d blocks found in xmlTextReaderMoveToNextAttribute",
32184 	           xmlMemBlocks() - mem_base);
32185 	    test_ret++;
32186             printf(" %d", n_reader);
32187             printf("\n");
32188         }
32189     }
32190     function_tests++;
32191 #endif
32192 
32193     return(test_ret);
32194 }
32195 
32196 
32197 static int
test_xmlTextReaderName(void)32198 test_xmlTextReaderName(void) {
32199     int test_ret = 0;
32200 
32201 #if defined(LIBXML_READER_ENABLED)
32202     int mem_base;
32203     xmlChar * ret_val;
32204     xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
32205     int n_reader;
32206 
32207     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
32208         mem_base = xmlMemBlocks();
32209         reader = gen_xmlTextReaderPtr(n_reader, 0);
32210 
32211         ret_val = xmlTextReaderName(reader);
32212         desret_xmlChar_ptr(ret_val);
32213         call_tests++;
32214         des_xmlTextReaderPtr(n_reader, reader, 0);
32215         xmlResetLastError();
32216         if (mem_base != xmlMemBlocks()) {
32217             printf("Leak of %d blocks found in xmlTextReaderName",
32218 	           xmlMemBlocks() - mem_base);
32219 	    test_ret++;
32220             printf(" %d", n_reader);
32221             printf("\n");
32222         }
32223     }
32224     function_tests++;
32225 #endif
32226 
32227     return(test_ret);
32228 }
32229 
32230 
32231 static int
test_xmlTextReaderNamespaceUri(void)32232 test_xmlTextReaderNamespaceUri(void) {
32233     int test_ret = 0;
32234 
32235 #if defined(LIBXML_READER_ENABLED)
32236     int mem_base;
32237     xmlChar * ret_val;
32238     xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
32239     int n_reader;
32240 
32241     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
32242         mem_base = xmlMemBlocks();
32243         reader = gen_xmlTextReaderPtr(n_reader, 0);
32244 
32245         ret_val = xmlTextReaderNamespaceUri(reader);
32246         desret_xmlChar_ptr(ret_val);
32247         call_tests++;
32248         des_xmlTextReaderPtr(n_reader, reader, 0);
32249         xmlResetLastError();
32250         if (mem_base != xmlMemBlocks()) {
32251             printf("Leak of %d blocks found in xmlTextReaderNamespaceUri",
32252 	           xmlMemBlocks() - mem_base);
32253 	    test_ret++;
32254             printf(" %d", n_reader);
32255             printf("\n");
32256         }
32257     }
32258     function_tests++;
32259 #endif
32260 
32261     return(test_ret);
32262 }
32263 
32264 
32265 static int
test_xmlTextReaderNext(void)32266 test_xmlTextReaderNext(void) {
32267     int test_ret = 0;
32268 
32269 #if defined(LIBXML_READER_ENABLED)
32270     int mem_base;
32271     int ret_val;
32272     xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
32273     int n_reader;
32274 
32275     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
32276         mem_base = xmlMemBlocks();
32277         reader = gen_xmlTextReaderPtr(n_reader, 0);
32278 
32279         ret_val = xmlTextReaderNext(reader);
32280         desret_int(ret_val);
32281         call_tests++;
32282         des_xmlTextReaderPtr(n_reader, reader, 0);
32283         xmlResetLastError();
32284         if (mem_base != xmlMemBlocks()) {
32285             printf("Leak of %d blocks found in xmlTextReaderNext",
32286 	           xmlMemBlocks() - mem_base);
32287 	    test_ret++;
32288             printf(" %d", n_reader);
32289             printf("\n");
32290         }
32291     }
32292     function_tests++;
32293 #endif
32294 
32295     return(test_ret);
32296 }
32297 
32298 
32299 static int
test_xmlTextReaderNextSibling(void)32300 test_xmlTextReaderNextSibling(void) {
32301     int test_ret = 0;
32302 
32303 #if defined(LIBXML_READER_ENABLED)
32304     int mem_base;
32305     int ret_val;
32306     xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
32307     int n_reader;
32308 
32309     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
32310         mem_base = xmlMemBlocks();
32311         reader = gen_xmlTextReaderPtr(n_reader, 0);
32312 
32313         ret_val = xmlTextReaderNextSibling(reader);
32314         desret_int(ret_val);
32315         call_tests++;
32316         des_xmlTextReaderPtr(n_reader, reader, 0);
32317         xmlResetLastError();
32318         if (mem_base != xmlMemBlocks()) {
32319             printf("Leak of %d blocks found in xmlTextReaderNextSibling",
32320 	           xmlMemBlocks() - mem_base);
32321 	    test_ret++;
32322             printf(" %d", n_reader);
32323             printf("\n");
32324         }
32325     }
32326     function_tests++;
32327 #endif
32328 
32329     return(test_ret);
32330 }
32331 
32332 
32333 static int
test_xmlTextReaderNodeType(void)32334 test_xmlTextReaderNodeType(void) {
32335     int test_ret = 0;
32336 
32337 #if defined(LIBXML_READER_ENABLED)
32338     int mem_base;
32339     int ret_val;
32340     xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
32341     int n_reader;
32342 
32343     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
32344         mem_base = xmlMemBlocks();
32345         reader = gen_xmlTextReaderPtr(n_reader, 0);
32346 
32347         ret_val = xmlTextReaderNodeType(reader);
32348         desret_int(ret_val);
32349         call_tests++;
32350         des_xmlTextReaderPtr(n_reader, reader, 0);
32351         xmlResetLastError();
32352         if (mem_base != xmlMemBlocks()) {
32353             printf("Leak of %d blocks found in xmlTextReaderNodeType",
32354 	           xmlMemBlocks() - mem_base);
32355 	    test_ret++;
32356             printf(" %d", n_reader);
32357             printf("\n");
32358         }
32359     }
32360     function_tests++;
32361 #endif
32362 
32363     return(test_ret);
32364 }
32365 
32366 
32367 static int
test_xmlTextReaderNormalization(void)32368 test_xmlTextReaderNormalization(void) {
32369     int test_ret = 0;
32370 
32371 #if defined(LIBXML_READER_ENABLED)
32372     int mem_base;
32373     int ret_val;
32374     xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
32375     int n_reader;
32376 
32377     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
32378         mem_base = xmlMemBlocks();
32379         reader = gen_xmlTextReaderPtr(n_reader, 0);
32380 
32381         ret_val = xmlTextReaderNormalization(reader);
32382         desret_int(ret_val);
32383         call_tests++;
32384         des_xmlTextReaderPtr(n_reader, reader, 0);
32385         xmlResetLastError();
32386         if (mem_base != xmlMemBlocks()) {
32387             printf("Leak of %d blocks found in xmlTextReaderNormalization",
32388 	           xmlMemBlocks() - mem_base);
32389 	    test_ret++;
32390             printf(" %d", n_reader);
32391             printf("\n");
32392         }
32393     }
32394     function_tests++;
32395 #endif
32396 
32397     return(test_ret);
32398 }
32399 
32400 
32401 static int
test_xmlTextReaderPrefix(void)32402 test_xmlTextReaderPrefix(void) {
32403     int test_ret = 0;
32404 
32405 #if defined(LIBXML_READER_ENABLED)
32406     int mem_base;
32407     xmlChar * ret_val;
32408     xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
32409     int n_reader;
32410 
32411     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
32412         mem_base = xmlMemBlocks();
32413         reader = gen_xmlTextReaderPtr(n_reader, 0);
32414 
32415         ret_val = xmlTextReaderPrefix(reader);
32416         desret_xmlChar_ptr(ret_val);
32417         call_tests++;
32418         des_xmlTextReaderPtr(n_reader, reader, 0);
32419         xmlResetLastError();
32420         if (mem_base != xmlMemBlocks()) {
32421             printf("Leak of %d blocks found in xmlTextReaderPrefix",
32422 	           xmlMemBlocks() - mem_base);
32423 	    test_ret++;
32424             printf(" %d", n_reader);
32425             printf("\n");
32426         }
32427     }
32428     function_tests++;
32429 #endif
32430 
32431     return(test_ret);
32432 }
32433 
32434 
32435 static int
test_xmlTextReaderPreserve(void)32436 test_xmlTextReaderPreserve(void) {
32437     int test_ret = 0;
32438 
32439 #if defined(LIBXML_READER_ENABLED)
32440     int mem_base;
32441     xmlNodePtr ret_val;
32442     xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
32443     int n_reader;
32444 
32445     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
32446         mem_base = xmlMemBlocks();
32447         reader = gen_xmlTextReaderPtr(n_reader, 0);
32448 
32449         ret_val = xmlTextReaderPreserve(reader);
32450         desret_xmlNodePtr(ret_val);
32451         call_tests++;
32452         des_xmlTextReaderPtr(n_reader, reader, 0);
32453         xmlResetLastError();
32454         if (mem_base != xmlMemBlocks()) {
32455             printf("Leak of %d blocks found in xmlTextReaderPreserve",
32456 	           xmlMemBlocks() - mem_base);
32457 	    test_ret++;
32458             printf(" %d", n_reader);
32459             printf("\n");
32460         }
32461     }
32462     function_tests++;
32463 #endif
32464 
32465     return(test_ret);
32466 }
32467 
32468 
32469 static int
test_xmlTextReaderPreservePattern(void)32470 test_xmlTextReaderPreservePattern(void) {
32471     int test_ret = 0;
32472 
32473 #if defined(LIBXML_READER_ENABLED) && defined(LIBXML_PATTERN_ENABLED)
32474 #ifdef LIBXML_PATTERN_ENABLED
32475     int mem_base;
32476     int ret_val;
32477     xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
32478     int n_reader;
32479     xmlChar * pattern; /* an XPath subset pattern */
32480     int n_pattern;
32481     xmlChar ** namespaces; /* the prefix definitions, array of [URI, prefix] or NULL */
32482     int n_namespaces;
32483 
32484     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
32485     for (n_pattern = 0;n_pattern < gen_nb_const_xmlChar_ptr;n_pattern++) {
32486     for (n_namespaces = 0;n_namespaces < gen_nb_const_xmlChar_ptr_ptr;n_namespaces++) {
32487         mem_base = xmlMemBlocks();
32488         reader = gen_xmlTextReaderPtr(n_reader, 0);
32489         pattern = gen_const_xmlChar_ptr(n_pattern, 1);
32490         namespaces = gen_const_xmlChar_ptr_ptr(n_namespaces, 2);
32491 
32492         ret_val = xmlTextReaderPreservePattern(reader, (const xmlChar *)pattern, (const xmlChar **)namespaces);
32493         desret_int(ret_val);
32494         call_tests++;
32495         des_xmlTextReaderPtr(n_reader, reader, 0);
32496         des_const_xmlChar_ptr(n_pattern, (const xmlChar *)pattern, 1);
32497         des_const_xmlChar_ptr_ptr(n_namespaces, (const xmlChar **)namespaces, 2);
32498         xmlResetLastError();
32499         if (mem_base != xmlMemBlocks()) {
32500             printf("Leak of %d blocks found in xmlTextReaderPreservePattern",
32501 	           xmlMemBlocks() - mem_base);
32502 	    test_ret++;
32503             printf(" %d", n_reader);
32504             printf(" %d", n_pattern);
32505             printf(" %d", n_namespaces);
32506             printf("\n");
32507         }
32508     }
32509     }
32510     }
32511     function_tests++;
32512 #endif
32513 #endif
32514 
32515     return(test_ret);
32516 }
32517 
32518 
32519 static int
test_xmlTextReaderQuoteChar(void)32520 test_xmlTextReaderQuoteChar(void) {
32521     int test_ret = 0;
32522 
32523 #if defined(LIBXML_READER_ENABLED)
32524     int mem_base;
32525     int ret_val;
32526     xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
32527     int n_reader;
32528 
32529     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
32530         mem_base = xmlMemBlocks();
32531         reader = gen_xmlTextReaderPtr(n_reader, 0);
32532 
32533         ret_val = xmlTextReaderQuoteChar(reader);
32534         desret_int(ret_val);
32535         call_tests++;
32536         des_xmlTextReaderPtr(n_reader, reader, 0);
32537         xmlResetLastError();
32538         if (mem_base != xmlMemBlocks()) {
32539             printf("Leak of %d blocks found in xmlTextReaderQuoteChar",
32540 	           xmlMemBlocks() - mem_base);
32541 	    test_ret++;
32542             printf(" %d", n_reader);
32543             printf("\n");
32544         }
32545     }
32546     function_tests++;
32547 #endif
32548 
32549     return(test_ret);
32550 }
32551 
32552 
32553 static int
test_xmlTextReaderRead(void)32554 test_xmlTextReaderRead(void) {
32555     int test_ret = 0;
32556 
32557 #if defined(LIBXML_READER_ENABLED)
32558     int mem_base;
32559     int ret_val;
32560     xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
32561     int n_reader;
32562 
32563     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
32564         mem_base = xmlMemBlocks();
32565         reader = gen_xmlTextReaderPtr(n_reader, 0);
32566 
32567         ret_val = xmlTextReaderRead(reader);
32568         desret_int(ret_val);
32569         call_tests++;
32570         des_xmlTextReaderPtr(n_reader, reader, 0);
32571         xmlResetLastError();
32572         if (mem_base != xmlMemBlocks()) {
32573             printf("Leak of %d blocks found in xmlTextReaderRead",
32574 	           xmlMemBlocks() - mem_base);
32575 	    test_ret++;
32576             printf(" %d", n_reader);
32577             printf("\n");
32578         }
32579     }
32580     function_tests++;
32581 #endif
32582 
32583     return(test_ret);
32584 }
32585 
32586 
32587 static int
test_xmlTextReaderReadAttributeValue(void)32588 test_xmlTextReaderReadAttributeValue(void) {
32589     int test_ret = 0;
32590 
32591 #if defined(LIBXML_READER_ENABLED)
32592     int mem_base;
32593     int ret_val;
32594     xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
32595     int n_reader;
32596 
32597     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
32598         mem_base = xmlMemBlocks();
32599         reader = gen_xmlTextReaderPtr(n_reader, 0);
32600 
32601         ret_val = xmlTextReaderReadAttributeValue(reader);
32602         desret_int(ret_val);
32603         call_tests++;
32604         des_xmlTextReaderPtr(n_reader, reader, 0);
32605         xmlResetLastError();
32606         if (mem_base != xmlMemBlocks()) {
32607             printf("Leak of %d blocks found in xmlTextReaderReadAttributeValue",
32608 	           xmlMemBlocks() - mem_base);
32609 	    test_ret++;
32610             printf(" %d", n_reader);
32611             printf("\n");
32612         }
32613     }
32614     function_tests++;
32615 #endif
32616 
32617     return(test_ret);
32618 }
32619 
32620 
32621 static int
test_xmlTextReaderReadState(void)32622 test_xmlTextReaderReadState(void) {
32623     int test_ret = 0;
32624 
32625 #if defined(LIBXML_READER_ENABLED)
32626     int mem_base;
32627     int ret_val;
32628     xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
32629     int n_reader;
32630 
32631     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
32632         mem_base = xmlMemBlocks();
32633         reader = gen_xmlTextReaderPtr(n_reader, 0);
32634 
32635         ret_val = xmlTextReaderReadState(reader);
32636         desret_int(ret_val);
32637         call_tests++;
32638         des_xmlTextReaderPtr(n_reader, reader, 0);
32639         xmlResetLastError();
32640         if (mem_base != xmlMemBlocks()) {
32641             printf("Leak of %d blocks found in xmlTextReaderReadState",
32642 	           xmlMemBlocks() - mem_base);
32643 	    test_ret++;
32644             printf(" %d", n_reader);
32645             printf("\n");
32646         }
32647     }
32648     function_tests++;
32649 #endif
32650 
32651     return(test_ret);
32652 }
32653 
32654 
32655 static int
test_xmlTextReaderRelaxNGSetSchema(void)32656 test_xmlTextReaderRelaxNGSetSchema(void) {
32657     int test_ret = 0;
32658 
32659 #if defined(LIBXML_READER_ENABLED) && defined(LIBXML_SCHEMAS_ENABLED)
32660     int mem_base;
32661     int ret_val;
32662     xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
32663     int n_reader;
32664     xmlRelaxNGPtr schema; /* a precompiled RelaxNG schema */
32665     int n_schema;
32666 
32667     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
32668     for (n_schema = 0;n_schema < gen_nb_xmlRelaxNGPtr;n_schema++) {
32669         mem_base = xmlMemBlocks();
32670         reader = gen_xmlTextReaderPtr(n_reader, 0);
32671         schema = gen_xmlRelaxNGPtr(n_schema, 1);
32672 
32673         ret_val = xmlTextReaderRelaxNGSetSchema(reader, schema);
32674         desret_int(ret_val);
32675         call_tests++;
32676         des_xmlTextReaderPtr(n_reader, reader, 0);
32677         des_xmlRelaxNGPtr(n_schema, schema, 1);
32678         xmlResetLastError();
32679         if (mem_base != xmlMemBlocks()) {
32680             printf("Leak of %d blocks found in xmlTextReaderRelaxNGSetSchema",
32681 	           xmlMemBlocks() - mem_base);
32682 	    test_ret++;
32683             printf(" %d", n_reader);
32684             printf(" %d", n_schema);
32685             printf("\n");
32686         }
32687     }
32688     }
32689     function_tests++;
32690 #endif
32691 
32692     return(test_ret);
32693 }
32694 
32695 
32696 static int
test_xmlTextReaderRelaxNGValidate(void)32697 test_xmlTextReaderRelaxNGValidate(void) {
32698     int test_ret = 0;
32699 
32700 #if defined(LIBXML_READER_ENABLED) && defined(LIBXML_SCHEMAS_ENABLED)
32701     int mem_base;
32702     int ret_val;
32703     xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
32704     int n_reader;
32705     char * rng; /* the path to a RelaxNG schema or NULL */
32706     int n_rng;
32707 
32708     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
32709     for (n_rng = 0;n_rng < gen_nb_const_char_ptr;n_rng++) {
32710         mem_base = xmlMemBlocks();
32711         reader = gen_xmlTextReaderPtr(n_reader, 0);
32712         rng = gen_const_char_ptr(n_rng, 1);
32713 
32714         ret_val = xmlTextReaderRelaxNGValidate(reader, (const char *)rng);
32715         desret_int(ret_val);
32716         call_tests++;
32717         des_xmlTextReaderPtr(n_reader, reader, 0);
32718         des_const_char_ptr(n_rng, (const char *)rng, 1);
32719         xmlResetLastError();
32720         if (mem_base != xmlMemBlocks()) {
32721             printf("Leak of %d blocks found in xmlTextReaderRelaxNGValidate",
32722 	           xmlMemBlocks() - mem_base);
32723 	    test_ret++;
32724             printf(" %d", n_reader);
32725             printf(" %d", n_rng);
32726             printf("\n");
32727         }
32728     }
32729     }
32730     function_tests++;
32731 #endif
32732 
32733     return(test_ret);
32734 }
32735 
32736 
32737 static int
test_xmlTextReaderRelaxNGValidateCtxt(void)32738 test_xmlTextReaderRelaxNGValidateCtxt(void) {
32739     int test_ret = 0;
32740 
32741 #if defined(LIBXML_READER_ENABLED) && defined(LIBXML_SCHEMAS_ENABLED)
32742     int mem_base;
32743     int ret_val;
32744     xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
32745     int n_reader;
32746     xmlRelaxNGValidCtxtPtr ctxt; /* the RelaxNG schema validation context or NULL */
32747     int n_ctxt;
32748     int options; /* options (not used yet) */
32749     int n_options;
32750 
32751     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
32752     for (n_ctxt = 0;n_ctxt < gen_nb_xmlRelaxNGValidCtxtPtr;n_ctxt++) {
32753     for (n_options = 0;n_options < gen_nb_parseroptions;n_options++) {
32754         mem_base = xmlMemBlocks();
32755         reader = gen_xmlTextReaderPtr(n_reader, 0);
32756         ctxt = gen_xmlRelaxNGValidCtxtPtr(n_ctxt, 1);
32757         options = gen_parseroptions(n_options, 2);
32758 
32759         ret_val = xmlTextReaderRelaxNGValidateCtxt(reader, ctxt, options);
32760         desret_int(ret_val);
32761         call_tests++;
32762         des_xmlTextReaderPtr(n_reader, reader, 0);
32763         des_xmlRelaxNGValidCtxtPtr(n_ctxt, ctxt, 1);
32764         des_parseroptions(n_options, options, 2);
32765         xmlResetLastError();
32766         if (mem_base != xmlMemBlocks()) {
32767             printf("Leak of %d blocks found in xmlTextReaderRelaxNGValidateCtxt",
32768 	           xmlMemBlocks() - mem_base);
32769 	    test_ret++;
32770             printf(" %d", n_reader);
32771             printf(" %d", n_ctxt);
32772             printf(" %d", n_options);
32773             printf("\n");
32774         }
32775     }
32776     }
32777     }
32778     function_tests++;
32779 #endif
32780 
32781     return(test_ret);
32782 }
32783 
32784 
32785 static int
test_xmlTextReaderSchemaValidate(void)32786 test_xmlTextReaderSchemaValidate(void) {
32787     int test_ret = 0;
32788 
32789 #if defined(LIBXML_READER_ENABLED) && defined(LIBXML_SCHEMAS_ENABLED)
32790     int ret_val;
32791     xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
32792     int n_reader;
32793     char * xsd; /* the path to a W3C XSD schema or NULL */
32794     int n_xsd;
32795 
32796     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
32797     for (n_xsd = 0;n_xsd < gen_nb_const_char_ptr;n_xsd++) {
32798         reader = gen_xmlTextReaderPtr(n_reader, 0);
32799         xsd = gen_const_char_ptr(n_xsd, 1);
32800 
32801         ret_val = xmlTextReaderSchemaValidate(reader, (const char *)xsd);
32802         desret_int(ret_val);
32803         call_tests++;
32804         des_xmlTextReaderPtr(n_reader, reader, 0);
32805         des_const_char_ptr(n_xsd, (const char *)xsd, 1);
32806         xmlResetLastError();
32807     }
32808     }
32809     function_tests++;
32810 #endif
32811 
32812     return(test_ret);
32813 }
32814 
32815 
32816 static int
test_xmlTextReaderSchemaValidateCtxt(void)32817 test_xmlTextReaderSchemaValidateCtxt(void) {
32818     int test_ret = 0;
32819 
32820 #if defined(LIBXML_READER_ENABLED) && defined(LIBXML_SCHEMAS_ENABLED)
32821     int mem_base;
32822     int ret_val;
32823     xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
32824     int n_reader;
32825     xmlSchemaValidCtxtPtr ctxt; /* the XML Schema validation context or NULL */
32826     int n_ctxt;
32827     int options; /* options (not used yet) */
32828     int n_options;
32829 
32830     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
32831     for (n_ctxt = 0;n_ctxt < gen_nb_xmlSchemaValidCtxtPtr;n_ctxt++) {
32832     for (n_options = 0;n_options < gen_nb_parseroptions;n_options++) {
32833         mem_base = xmlMemBlocks();
32834         reader = gen_xmlTextReaderPtr(n_reader, 0);
32835         ctxt = gen_xmlSchemaValidCtxtPtr(n_ctxt, 1);
32836         options = gen_parseroptions(n_options, 2);
32837 
32838         ret_val = xmlTextReaderSchemaValidateCtxt(reader, ctxt, options);
32839         desret_int(ret_val);
32840         call_tests++;
32841         des_xmlTextReaderPtr(n_reader, reader, 0);
32842         des_xmlSchemaValidCtxtPtr(n_ctxt, ctxt, 1);
32843         des_parseroptions(n_options, options, 2);
32844         xmlResetLastError();
32845         if (mem_base != xmlMemBlocks()) {
32846             printf("Leak of %d blocks found in xmlTextReaderSchemaValidateCtxt",
32847 	           xmlMemBlocks() - mem_base);
32848 	    test_ret++;
32849             printf(" %d", n_reader);
32850             printf(" %d", n_ctxt);
32851             printf(" %d", n_options);
32852             printf("\n");
32853         }
32854     }
32855     }
32856     }
32857     function_tests++;
32858 #endif
32859 
32860     return(test_ret);
32861 }
32862 
32863 
32864 static int
test_xmlTextReaderSetErrorHandler(void)32865 test_xmlTextReaderSetErrorHandler(void) {
32866     int test_ret = 0;
32867 
32868 
32869     /* missing type support */
32870     return(test_ret);
32871 }
32872 
32873 
32874 static int
test_xmlTextReaderSetParserProp(void)32875 test_xmlTextReaderSetParserProp(void) {
32876     int test_ret = 0;
32877 
32878 #if defined(LIBXML_READER_ENABLED)
32879     int mem_base;
32880     int ret_val;
32881     xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
32882     int n_reader;
32883     int prop; /* the xmlParserProperties to set */
32884     int n_prop;
32885     int value; /* usually 0 or 1 to (de)activate it */
32886     int n_value;
32887 
32888     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
32889     for (n_prop = 0;n_prop < gen_nb_int;n_prop++) {
32890     for (n_value = 0;n_value < gen_nb_int;n_value++) {
32891         mem_base = xmlMemBlocks();
32892         reader = gen_xmlTextReaderPtr(n_reader, 0);
32893         prop = gen_int(n_prop, 1);
32894         value = gen_int(n_value, 2);
32895 
32896         ret_val = xmlTextReaderSetParserProp(reader, prop, value);
32897         desret_int(ret_val);
32898         call_tests++;
32899         des_xmlTextReaderPtr(n_reader, reader, 0);
32900         des_int(n_prop, prop, 1);
32901         des_int(n_value, value, 2);
32902         xmlResetLastError();
32903         if (mem_base != xmlMemBlocks()) {
32904             printf("Leak of %d blocks found in xmlTextReaderSetParserProp",
32905 	           xmlMemBlocks() - mem_base);
32906 	    test_ret++;
32907             printf(" %d", n_reader);
32908             printf(" %d", n_prop);
32909             printf(" %d", n_value);
32910             printf("\n");
32911         }
32912     }
32913     }
32914     }
32915     function_tests++;
32916 #endif
32917 
32918     return(test_ret);
32919 }
32920 
32921 
32922 static int
test_xmlTextReaderSetSchema(void)32923 test_xmlTextReaderSetSchema(void) {
32924     int test_ret = 0;
32925 
32926 #if defined(LIBXML_READER_ENABLED) && defined(LIBXML_SCHEMAS_ENABLED)
32927     int mem_base;
32928     int ret_val;
32929     xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
32930     int n_reader;
32931     xmlSchemaPtr schema; /* a precompiled Schema schema */
32932     int n_schema;
32933 
32934     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
32935     for (n_schema = 0;n_schema < gen_nb_xmlSchemaPtr;n_schema++) {
32936         mem_base = xmlMemBlocks();
32937         reader = gen_xmlTextReaderPtr(n_reader, 0);
32938         schema = gen_xmlSchemaPtr(n_schema, 1);
32939 
32940         ret_val = xmlTextReaderSetSchema(reader, schema);
32941         desret_int(ret_val);
32942         call_tests++;
32943         des_xmlTextReaderPtr(n_reader, reader, 0);
32944         des_xmlSchemaPtr(n_schema, schema, 1);
32945         xmlResetLastError();
32946         if (mem_base != xmlMemBlocks()) {
32947             printf("Leak of %d blocks found in xmlTextReaderSetSchema",
32948 	           xmlMemBlocks() - mem_base);
32949 	    test_ret++;
32950             printf(" %d", n_reader);
32951             printf(" %d", n_schema);
32952             printf("\n");
32953         }
32954     }
32955     }
32956     function_tests++;
32957 #endif
32958 
32959     return(test_ret);
32960 }
32961 
32962 
32963 static int
test_xmlTextReaderSetStructuredErrorHandler(void)32964 test_xmlTextReaderSetStructuredErrorHandler(void) {
32965     int test_ret = 0;
32966 
32967 
32968     /* missing type support */
32969     return(test_ret);
32970 }
32971 
32972 
32973 static int
test_xmlTextReaderSetup(void)32974 test_xmlTextReaderSetup(void) {
32975     int test_ret = 0;
32976 
32977 #if defined(LIBXML_READER_ENABLED)
32978     int mem_base;
32979     int ret_val;
32980     xmlTextReaderPtr reader; /* an XML reader */
32981     int n_reader;
32982     xmlParserInputBufferPtr input; /* xmlParserInputBufferPtr used to feed the reader, will be destroyed with it. */
32983     int n_input;
32984     const char * URL; /* the base URL to use for the document */
32985     int n_URL;
32986     char * encoding; /* the document encoding, or NULL */
32987     int n_encoding;
32988     int options; /* a combination of xmlParserOption */
32989     int n_options;
32990 
32991     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
32992     for (n_input = 0;n_input < gen_nb_xmlParserInputBufferPtr;n_input++) {
32993     for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) {
32994     for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
32995     for (n_options = 0;n_options < gen_nb_parseroptions;n_options++) {
32996         mem_base = xmlMemBlocks();
32997         reader = gen_xmlTextReaderPtr(n_reader, 0);
32998         input = gen_xmlParserInputBufferPtr(n_input, 1);
32999         URL = gen_filepath(n_URL, 2);
33000         encoding = gen_const_char_ptr(n_encoding, 3);
33001         options = gen_parseroptions(n_options, 4);
33002 
33003         ret_val = xmlTextReaderSetup(reader, input, URL, (const char *)encoding, options);
33004         desret_int(ret_val);
33005         call_tests++;
33006         des_xmlTextReaderPtr(n_reader, reader, 0);
33007         des_filepath(n_URL, URL, 2);
33008         des_const_char_ptr(n_encoding, (const char *)encoding, 3);
33009         des_parseroptions(n_options, options, 4);
33010         xmlResetLastError();
33011         if (mem_base != xmlMemBlocks()) {
33012             printf("Leak of %d blocks found in xmlTextReaderSetup",
33013 	           xmlMemBlocks() - mem_base);
33014 	    test_ret++;
33015             printf(" %d", n_reader);
33016             printf(" %d", n_input);
33017             printf(" %d", n_URL);
33018             printf(" %d", n_encoding);
33019             printf(" %d", n_options);
33020             printf("\n");
33021         }
33022     }
33023     }
33024     }
33025     }
33026     }
33027     function_tests++;
33028 #endif
33029 
33030     return(test_ret);
33031 }
33032 
33033 
33034 static int
test_xmlTextReaderStandalone(void)33035 test_xmlTextReaderStandalone(void) {
33036     int test_ret = 0;
33037 
33038 #if defined(LIBXML_READER_ENABLED)
33039     int mem_base;
33040     int ret_val;
33041     xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
33042     int n_reader;
33043 
33044     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
33045         mem_base = xmlMemBlocks();
33046         reader = gen_xmlTextReaderPtr(n_reader, 0);
33047 
33048         ret_val = xmlTextReaderStandalone(reader);
33049         desret_int(ret_val);
33050         call_tests++;
33051         des_xmlTextReaderPtr(n_reader, reader, 0);
33052         xmlResetLastError();
33053         if (mem_base != xmlMemBlocks()) {
33054             printf("Leak of %d blocks found in xmlTextReaderStandalone",
33055 	           xmlMemBlocks() - mem_base);
33056 	    test_ret++;
33057             printf(" %d", n_reader);
33058             printf("\n");
33059         }
33060     }
33061     function_tests++;
33062 #endif
33063 
33064     return(test_ret);
33065 }
33066 
33067 
33068 static int
test_xmlTextReaderValue(void)33069 test_xmlTextReaderValue(void) {
33070     int test_ret = 0;
33071 
33072 #if defined(LIBXML_READER_ENABLED)
33073     int mem_base;
33074     xmlChar * ret_val;
33075     xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
33076     int n_reader;
33077 
33078     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
33079         mem_base = xmlMemBlocks();
33080         reader = gen_xmlTextReaderPtr(n_reader, 0);
33081 
33082         ret_val = xmlTextReaderValue(reader);
33083         desret_xmlChar_ptr(ret_val);
33084         call_tests++;
33085         des_xmlTextReaderPtr(n_reader, reader, 0);
33086         xmlResetLastError();
33087         if (mem_base != xmlMemBlocks()) {
33088             printf("Leak of %d blocks found in xmlTextReaderValue",
33089 	           xmlMemBlocks() - mem_base);
33090 	    test_ret++;
33091             printf(" %d", n_reader);
33092             printf("\n");
33093         }
33094     }
33095     function_tests++;
33096 #endif
33097 
33098     return(test_ret);
33099 }
33100 
33101 
33102 static int
test_xmlTextReaderXmlLang(void)33103 test_xmlTextReaderXmlLang(void) {
33104     int test_ret = 0;
33105 
33106 #if defined(LIBXML_READER_ENABLED)
33107     int mem_base;
33108     xmlChar * ret_val;
33109     xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
33110     int n_reader;
33111 
33112     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
33113         mem_base = xmlMemBlocks();
33114         reader = gen_xmlTextReaderPtr(n_reader, 0);
33115 
33116         ret_val = xmlTextReaderXmlLang(reader);
33117         desret_xmlChar_ptr(ret_val);
33118         call_tests++;
33119         des_xmlTextReaderPtr(n_reader, reader, 0);
33120         xmlResetLastError();
33121         if (mem_base != xmlMemBlocks()) {
33122             printf("Leak of %d blocks found in xmlTextReaderXmlLang",
33123 	           xmlMemBlocks() - mem_base);
33124 	    test_ret++;
33125             printf(" %d", n_reader);
33126             printf("\n");
33127         }
33128     }
33129     function_tests++;
33130 #endif
33131 
33132     return(test_ret);
33133 }
33134 
33135 static int
test_xmlreader(void)33136 test_xmlreader(void) {
33137     int test_ret = 0;
33138 
33139     if (quiet == 0) printf("Testing xmlreader : 76 of 86 functions ...\n");
33140     test_ret += test_xmlNewTextReader();
33141     test_ret += test_xmlNewTextReaderFilename();
33142     test_ret += test_xmlReaderForDoc();
33143     test_ret += test_xmlReaderForFile();
33144     test_ret += test_xmlReaderForMemory();
33145     test_ret += test_xmlReaderNewDoc();
33146     test_ret += test_xmlReaderNewFile();
33147     test_ret += test_xmlReaderNewMemory();
33148     test_ret += test_xmlReaderNewWalker();
33149     test_ret += test_xmlReaderWalker();
33150     test_ret += test_xmlTextReaderAttributeCount();
33151     test_ret += test_xmlTextReaderBaseUri();
33152     test_ret += test_xmlTextReaderByteConsumed();
33153     test_ret += test_xmlTextReaderClose();
33154     test_ret += test_xmlTextReaderConstBaseUri();
33155     test_ret += test_xmlTextReaderConstEncoding();
33156     test_ret += test_xmlTextReaderConstLocalName();
33157     test_ret += test_xmlTextReaderConstName();
33158     test_ret += test_xmlTextReaderConstNamespaceUri();
33159     test_ret += test_xmlTextReaderConstPrefix();
33160     test_ret += test_xmlTextReaderConstString();
33161     test_ret += test_xmlTextReaderConstValue();
33162     test_ret += test_xmlTextReaderConstXmlLang();
33163     test_ret += test_xmlTextReaderConstXmlVersion();
33164     test_ret += test_xmlTextReaderCurrentDoc();
33165     test_ret += test_xmlTextReaderCurrentNode();
33166     test_ret += test_xmlTextReaderDepth();
33167     test_ret += test_xmlTextReaderExpand();
33168     test_ret += test_xmlTextReaderGetAttribute();
33169     test_ret += test_xmlTextReaderGetAttributeNo();
33170     test_ret += test_xmlTextReaderGetAttributeNs();
33171     test_ret += test_xmlTextReaderGetErrorHandler();
33172     test_ret += test_xmlTextReaderGetParserColumnNumber();
33173     test_ret += test_xmlTextReaderGetParserLineNumber();
33174     test_ret += test_xmlTextReaderGetParserProp();
33175     test_ret += test_xmlTextReaderGetRemainder();
33176     test_ret += test_xmlTextReaderHasAttributes();
33177     test_ret += test_xmlTextReaderHasValue();
33178     test_ret += test_xmlTextReaderIsDefault();
33179     test_ret += test_xmlTextReaderIsEmptyElement();
33180     test_ret += test_xmlTextReaderIsNamespaceDecl();
33181     test_ret += test_xmlTextReaderIsValid();
33182     test_ret += test_xmlTextReaderLocalName();
33183     test_ret += test_xmlTextReaderLocatorBaseURI();
33184     test_ret += test_xmlTextReaderLocatorLineNumber();
33185     test_ret += test_xmlTextReaderLookupNamespace();
33186     test_ret += test_xmlTextReaderMoveToAttribute();
33187     test_ret += test_xmlTextReaderMoveToAttributeNo();
33188     test_ret += test_xmlTextReaderMoveToAttributeNs();
33189     test_ret += test_xmlTextReaderMoveToElement();
33190     test_ret += test_xmlTextReaderMoveToFirstAttribute();
33191     test_ret += test_xmlTextReaderMoveToNextAttribute();
33192     test_ret += test_xmlTextReaderName();
33193     test_ret += test_xmlTextReaderNamespaceUri();
33194     test_ret += test_xmlTextReaderNext();
33195     test_ret += test_xmlTextReaderNextSibling();
33196     test_ret += test_xmlTextReaderNodeType();
33197     test_ret += test_xmlTextReaderNormalization();
33198     test_ret += test_xmlTextReaderPrefix();
33199     test_ret += test_xmlTextReaderPreserve();
33200     test_ret += test_xmlTextReaderPreservePattern();
33201     test_ret += test_xmlTextReaderQuoteChar();
33202     test_ret += test_xmlTextReaderRead();
33203     test_ret += test_xmlTextReaderReadAttributeValue();
33204     test_ret += test_xmlTextReaderReadState();
33205     test_ret += test_xmlTextReaderRelaxNGSetSchema();
33206     test_ret += test_xmlTextReaderRelaxNGValidate();
33207     test_ret += test_xmlTextReaderRelaxNGValidateCtxt();
33208     test_ret += test_xmlTextReaderSchemaValidate();
33209     test_ret += test_xmlTextReaderSchemaValidateCtxt();
33210     test_ret += test_xmlTextReaderSetErrorHandler();
33211     test_ret += test_xmlTextReaderSetParserProp();
33212     test_ret += test_xmlTextReaderSetSchema();
33213     test_ret += test_xmlTextReaderSetStructuredErrorHandler();
33214     test_ret += test_xmlTextReaderSetup();
33215     test_ret += test_xmlTextReaderStandalone();
33216     test_ret += test_xmlTextReaderValue();
33217     test_ret += test_xmlTextReaderXmlLang();
33218 
33219     if (test_ret != 0)
33220 	printf("Module xmlreader: %d errors\n", test_ret);
33221     return(test_ret);
33222 }
33223 
33224 static int
test_xmlExpCtxtNbCons(void)33225 test_xmlExpCtxtNbCons(void) {
33226     int test_ret = 0;
33227 
33228 #if defined(LIBXML_REGEXP_ENABLED) && defined(LIBXML_EXPR_ENABLED)
33229     int mem_base;
33230     int ret_val;
33231     xmlExpCtxtPtr ctxt; /* an expression context */
33232     int n_ctxt;
33233 
33234     for (n_ctxt = 0;n_ctxt < gen_nb_xmlExpCtxtPtr;n_ctxt++) {
33235         mem_base = xmlMemBlocks();
33236         ctxt = gen_xmlExpCtxtPtr(n_ctxt, 0);
33237 
33238         ret_val = xmlExpCtxtNbCons(ctxt);
33239         desret_int(ret_val);
33240         call_tests++;
33241         des_xmlExpCtxtPtr(n_ctxt, ctxt, 0);
33242         xmlResetLastError();
33243         if (mem_base != xmlMemBlocks()) {
33244             printf("Leak of %d blocks found in xmlExpCtxtNbCons",
33245 	           xmlMemBlocks() - mem_base);
33246 	    test_ret++;
33247             printf(" %d", n_ctxt);
33248             printf("\n");
33249         }
33250     }
33251     function_tests++;
33252 #endif
33253 
33254     return(test_ret);
33255 }
33256 
33257 
33258 static int
test_xmlExpCtxtNbNodes(void)33259 test_xmlExpCtxtNbNodes(void) {
33260     int test_ret = 0;
33261 
33262 #if defined(LIBXML_REGEXP_ENABLED) && defined(LIBXML_EXPR_ENABLED)
33263     int mem_base;
33264     int ret_val;
33265     xmlExpCtxtPtr ctxt; /* an expression context */
33266     int n_ctxt;
33267 
33268     for (n_ctxt = 0;n_ctxt < gen_nb_xmlExpCtxtPtr;n_ctxt++) {
33269         mem_base = xmlMemBlocks();
33270         ctxt = gen_xmlExpCtxtPtr(n_ctxt, 0);
33271 
33272         ret_val = xmlExpCtxtNbNodes(ctxt);
33273         desret_int(ret_val);
33274         call_tests++;
33275         des_xmlExpCtxtPtr(n_ctxt, ctxt, 0);
33276         xmlResetLastError();
33277         if (mem_base != xmlMemBlocks()) {
33278             printf("Leak of %d blocks found in xmlExpCtxtNbNodes",
33279 	           xmlMemBlocks() - mem_base);
33280 	    test_ret++;
33281             printf(" %d", n_ctxt);
33282             printf("\n");
33283         }
33284     }
33285     function_tests++;
33286 #endif
33287 
33288     return(test_ret);
33289 }
33290 
33291 
33292 static int
test_xmlExpDump(void)33293 test_xmlExpDump(void) {
33294     int test_ret = 0;
33295 
33296 #if defined(LIBXML_REGEXP_ENABLED) && defined(LIBXML_EXPR_ENABLED)
33297     int mem_base;
33298     xmlBufferPtr buf; /* a buffer to receive the output */
33299     int n_buf;
33300     xmlExpNodePtr expr; /* the compiled expression */
33301     int n_expr;
33302 
33303     for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
33304     for (n_expr = 0;n_expr < gen_nb_xmlExpNodePtr;n_expr++) {
33305         mem_base = xmlMemBlocks();
33306         buf = gen_xmlBufferPtr(n_buf, 0);
33307         expr = gen_xmlExpNodePtr(n_expr, 1);
33308 
33309         xmlExpDump(buf, expr);
33310         call_tests++;
33311         des_xmlBufferPtr(n_buf, buf, 0);
33312         des_xmlExpNodePtr(n_expr, expr, 1);
33313         xmlResetLastError();
33314         if (mem_base != xmlMemBlocks()) {
33315             printf("Leak of %d blocks found in xmlExpDump",
33316 	           xmlMemBlocks() - mem_base);
33317 	    test_ret++;
33318             printf(" %d", n_buf);
33319             printf(" %d", n_expr);
33320             printf("\n");
33321         }
33322     }
33323     }
33324     function_tests++;
33325 #endif
33326 
33327     return(test_ret);
33328 }
33329 
33330 
33331 static int
test_xmlExpExpDerive(void)33332 test_xmlExpExpDerive(void) {
33333     int test_ret = 0;
33334 
33335 
33336     /* missing type support */
33337     return(test_ret);
33338 }
33339 
33340 
33341 static int
test_xmlExpGetLanguage(void)33342 test_xmlExpGetLanguage(void) {
33343     int test_ret = 0;
33344 
33345 #if defined(LIBXML_REGEXP_ENABLED) && defined(LIBXML_EXPR_ENABLED)
33346     int mem_base;
33347     int ret_val;
33348     xmlExpCtxtPtr ctxt; /* the expression context */
33349     int n_ctxt;
33350     xmlExpNodePtr exp; /* the expression */
33351     int n_exp;
33352     xmlChar ** langList; /* where to store the tokens */
33353     int n_langList;
33354     int len; /* the allocated length of @list */
33355     int n_len;
33356 
33357     for (n_ctxt = 0;n_ctxt < gen_nb_xmlExpCtxtPtr;n_ctxt++) {
33358     for (n_exp = 0;n_exp < gen_nb_xmlExpNodePtr;n_exp++) {
33359     for (n_langList = 0;n_langList < gen_nb_const_xmlChar_ptr_ptr;n_langList++) {
33360     for (n_len = 0;n_len < gen_nb_int;n_len++) {
33361         mem_base = xmlMemBlocks();
33362         ctxt = gen_xmlExpCtxtPtr(n_ctxt, 0);
33363         exp = gen_xmlExpNodePtr(n_exp, 1);
33364         langList = gen_const_xmlChar_ptr_ptr(n_langList, 2);
33365         len = gen_int(n_len, 3);
33366 
33367         ret_val = xmlExpGetLanguage(ctxt, exp, (const xmlChar **)langList, len);
33368         desret_int(ret_val);
33369         call_tests++;
33370         des_xmlExpCtxtPtr(n_ctxt, ctxt, 0);
33371         des_xmlExpNodePtr(n_exp, exp, 1);
33372         des_const_xmlChar_ptr_ptr(n_langList, (const xmlChar **)langList, 2);
33373         des_int(n_len, len, 3);
33374         xmlResetLastError();
33375         if (mem_base != xmlMemBlocks()) {
33376             printf("Leak of %d blocks found in xmlExpGetLanguage",
33377 	           xmlMemBlocks() - mem_base);
33378 	    test_ret++;
33379             printf(" %d", n_ctxt);
33380             printf(" %d", n_exp);
33381             printf(" %d", n_langList);
33382             printf(" %d", n_len);
33383             printf("\n");
33384         }
33385     }
33386     }
33387     }
33388     }
33389     function_tests++;
33390 #endif
33391 
33392     return(test_ret);
33393 }
33394 
33395 
33396 static int
test_xmlExpGetStart(void)33397 test_xmlExpGetStart(void) {
33398     int test_ret = 0;
33399 
33400 #if defined(LIBXML_REGEXP_ENABLED) && defined(LIBXML_EXPR_ENABLED)
33401     int mem_base;
33402     int ret_val;
33403     xmlExpCtxtPtr ctxt; /* the expression context */
33404     int n_ctxt;
33405     xmlExpNodePtr exp; /* the expression */
33406     int n_exp;
33407     xmlChar ** tokList; /* where to store the tokens */
33408     int n_tokList;
33409     int len; /* the allocated length of @list */
33410     int n_len;
33411 
33412     for (n_ctxt = 0;n_ctxt < gen_nb_xmlExpCtxtPtr;n_ctxt++) {
33413     for (n_exp = 0;n_exp < gen_nb_xmlExpNodePtr;n_exp++) {
33414     for (n_tokList = 0;n_tokList < gen_nb_const_xmlChar_ptr_ptr;n_tokList++) {
33415     for (n_len = 0;n_len < gen_nb_int;n_len++) {
33416         mem_base = xmlMemBlocks();
33417         ctxt = gen_xmlExpCtxtPtr(n_ctxt, 0);
33418         exp = gen_xmlExpNodePtr(n_exp, 1);
33419         tokList = gen_const_xmlChar_ptr_ptr(n_tokList, 2);
33420         len = gen_int(n_len, 3);
33421 
33422         ret_val = xmlExpGetStart(ctxt, exp, (const xmlChar **)tokList, len);
33423         desret_int(ret_val);
33424         call_tests++;
33425         des_xmlExpCtxtPtr(n_ctxt, ctxt, 0);
33426         des_xmlExpNodePtr(n_exp, exp, 1);
33427         des_const_xmlChar_ptr_ptr(n_tokList, (const xmlChar **)tokList, 2);
33428         des_int(n_len, len, 3);
33429         xmlResetLastError();
33430         if (mem_base != xmlMemBlocks()) {
33431             printf("Leak of %d blocks found in xmlExpGetStart",
33432 	           xmlMemBlocks() - mem_base);
33433 	    test_ret++;
33434             printf(" %d", n_ctxt);
33435             printf(" %d", n_exp);
33436             printf(" %d", n_tokList);
33437             printf(" %d", n_len);
33438             printf("\n");
33439         }
33440     }
33441     }
33442     }
33443     }
33444     function_tests++;
33445 #endif
33446 
33447     return(test_ret);
33448 }
33449 
33450 
33451 static int
test_xmlExpIsNillable(void)33452 test_xmlExpIsNillable(void) {
33453     int test_ret = 0;
33454 
33455 #if defined(LIBXML_REGEXP_ENABLED) && defined(LIBXML_EXPR_ENABLED)
33456     int mem_base;
33457     int ret_val;
33458     xmlExpNodePtr exp; /* the expression */
33459     int n_exp;
33460 
33461     for (n_exp = 0;n_exp < gen_nb_xmlExpNodePtr;n_exp++) {
33462         mem_base = xmlMemBlocks();
33463         exp = gen_xmlExpNodePtr(n_exp, 0);
33464 
33465         ret_val = xmlExpIsNillable(exp);
33466         desret_int(ret_val);
33467         call_tests++;
33468         des_xmlExpNodePtr(n_exp, exp, 0);
33469         xmlResetLastError();
33470         if (mem_base != xmlMemBlocks()) {
33471             printf("Leak of %d blocks found in xmlExpIsNillable",
33472 	           xmlMemBlocks() - mem_base);
33473 	    test_ret++;
33474             printf(" %d", n_exp);
33475             printf("\n");
33476         }
33477     }
33478     function_tests++;
33479 #endif
33480 
33481     return(test_ret);
33482 }
33483 
33484 
33485 static int
test_xmlExpMaxToken(void)33486 test_xmlExpMaxToken(void) {
33487     int test_ret = 0;
33488 
33489 #if defined(LIBXML_REGEXP_ENABLED) && defined(LIBXML_EXPR_ENABLED)
33490     int mem_base;
33491     int ret_val;
33492     xmlExpNodePtr expr; /* a compiled expression */
33493     int n_expr;
33494 
33495     for (n_expr = 0;n_expr < gen_nb_xmlExpNodePtr;n_expr++) {
33496         mem_base = xmlMemBlocks();
33497         expr = gen_xmlExpNodePtr(n_expr, 0);
33498 
33499         ret_val = xmlExpMaxToken(expr);
33500         desret_int(ret_val);
33501         call_tests++;
33502         des_xmlExpNodePtr(n_expr, expr, 0);
33503         xmlResetLastError();
33504         if (mem_base != xmlMemBlocks()) {
33505             printf("Leak of %d blocks found in xmlExpMaxToken",
33506 	           xmlMemBlocks() - mem_base);
33507 	    test_ret++;
33508             printf(" %d", n_expr);
33509             printf("\n");
33510         }
33511     }
33512     function_tests++;
33513 #endif
33514 
33515     return(test_ret);
33516 }
33517 
33518 
33519 static int
test_xmlExpNewAtom(void)33520 test_xmlExpNewAtom(void) {
33521     int test_ret = 0;
33522 
33523 
33524     /* missing type support */
33525     return(test_ret);
33526 }
33527 
33528 
33529 static int
test_xmlExpNewCtxt(void)33530 test_xmlExpNewCtxt(void) {
33531     int test_ret = 0;
33532 
33533 
33534     /* missing type support */
33535     return(test_ret);
33536 }
33537 
33538 
33539 static int
test_xmlExpNewOr(void)33540 test_xmlExpNewOr(void) {
33541     int test_ret = 0;
33542 
33543 
33544     /* missing type support */
33545     return(test_ret);
33546 }
33547 
33548 
33549 static int
test_xmlExpNewRange(void)33550 test_xmlExpNewRange(void) {
33551     int test_ret = 0;
33552 
33553 
33554     /* missing type support */
33555     return(test_ret);
33556 }
33557 
33558 
33559 static int
test_xmlExpNewSeq(void)33560 test_xmlExpNewSeq(void) {
33561     int test_ret = 0;
33562 
33563 
33564     /* missing type support */
33565     return(test_ret);
33566 }
33567 
33568 
33569 static int
test_xmlExpParse(void)33570 test_xmlExpParse(void) {
33571     int test_ret = 0;
33572 
33573 
33574     /* missing type support */
33575     return(test_ret);
33576 }
33577 
33578 
33579 static int
test_xmlExpRef(void)33580 test_xmlExpRef(void) {
33581     int test_ret = 0;
33582 
33583 #if defined(LIBXML_REGEXP_ENABLED) && defined(LIBXML_EXPR_ENABLED)
33584     int mem_base;
33585     xmlExpNodePtr exp; /* the expression */
33586     int n_exp;
33587 
33588     for (n_exp = 0;n_exp < gen_nb_xmlExpNodePtr;n_exp++) {
33589         mem_base = xmlMemBlocks();
33590         exp = gen_xmlExpNodePtr(n_exp, 0);
33591 
33592         xmlExpRef(exp);
33593         call_tests++;
33594         des_xmlExpNodePtr(n_exp, exp, 0);
33595         xmlResetLastError();
33596         if (mem_base != xmlMemBlocks()) {
33597             printf("Leak of %d blocks found in xmlExpRef",
33598 	           xmlMemBlocks() - mem_base);
33599 	    test_ret++;
33600             printf(" %d", n_exp);
33601             printf("\n");
33602         }
33603     }
33604     function_tests++;
33605 #endif
33606 
33607     return(test_ret);
33608 }
33609 
33610 
33611 static int
test_xmlExpStringDerive(void)33612 test_xmlExpStringDerive(void) {
33613     int test_ret = 0;
33614 
33615 
33616     /* missing type support */
33617     return(test_ret);
33618 }
33619 
33620 
33621 static int
test_xmlExpSubsume(void)33622 test_xmlExpSubsume(void) {
33623     int test_ret = 0;
33624 
33625 #if defined(LIBXML_REGEXP_ENABLED) && defined(LIBXML_EXPR_ENABLED)
33626     int mem_base;
33627     int ret_val;
33628     xmlExpCtxtPtr ctxt; /* the expressions context */
33629     int n_ctxt;
33630     xmlExpNodePtr exp; /* the englobing expression */
33631     int n_exp;
33632     xmlExpNodePtr sub; /* the subexpression */
33633     int n_sub;
33634 
33635     for (n_ctxt = 0;n_ctxt < gen_nb_xmlExpCtxtPtr;n_ctxt++) {
33636     for (n_exp = 0;n_exp < gen_nb_xmlExpNodePtr;n_exp++) {
33637     for (n_sub = 0;n_sub < gen_nb_xmlExpNodePtr;n_sub++) {
33638         mem_base = xmlMemBlocks();
33639         ctxt = gen_xmlExpCtxtPtr(n_ctxt, 0);
33640         exp = gen_xmlExpNodePtr(n_exp, 1);
33641         sub = gen_xmlExpNodePtr(n_sub, 2);
33642 
33643         ret_val = xmlExpSubsume(ctxt, exp, sub);
33644         desret_int(ret_val);
33645         call_tests++;
33646         des_xmlExpCtxtPtr(n_ctxt, ctxt, 0);
33647         des_xmlExpNodePtr(n_exp, exp, 1);
33648         des_xmlExpNodePtr(n_sub, sub, 2);
33649         xmlResetLastError();
33650         if (mem_base != xmlMemBlocks()) {
33651             printf("Leak of %d blocks found in xmlExpSubsume",
33652 	           xmlMemBlocks() - mem_base);
33653 	    test_ret++;
33654             printf(" %d", n_ctxt);
33655             printf(" %d", n_exp);
33656             printf(" %d", n_sub);
33657             printf("\n");
33658         }
33659     }
33660     }
33661     }
33662     function_tests++;
33663 #endif
33664 
33665     return(test_ret);
33666 }
33667 
33668 #ifdef LIBXML_REGEXP_ENABLED
33669 
33670 #define gen_nb_xmlRegExecCtxtPtr 1
gen_xmlRegExecCtxtPtr(int no ATTRIBUTE_UNUSED,int nr ATTRIBUTE_UNUSED)33671 static xmlRegExecCtxtPtr gen_xmlRegExecCtxtPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
33672     return(NULL);
33673 }
des_xmlRegExecCtxtPtr(int no ATTRIBUTE_UNUSED,xmlRegExecCtxtPtr val ATTRIBUTE_UNUSED,int nr ATTRIBUTE_UNUSED)33674 static void des_xmlRegExecCtxtPtr(int no ATTRIBUTE_UNUSED, xmlRegExecCtxtPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
33675 }
33676 #endif
33677 
33678 
33679 static int
test_xmlRegExecErrInfo(void)33680 test_xmlRegExecErrInfo(void) {
33681     int test_ret = 0;
33682 
33683 #if defined(LIBXML_REGEXP_ENABLED)
33684     int mem_base;
33685     int ret_val;
33686     xmlRegExecCtxtPtr exec; /* a regexp execution context generating an error */
33687     int n_exec;
33688     xmlChar ** string; /* return value for the error string */
33689     int n_string;
33690     int * nbval; /* pointer to the number of accepted values IN/OUT */
33691     int n_nbval;
33692     int * nbneg; /* return number of negative transitions */
33693     int n_nbneg;
33694     xmlChar ** values; /* pointer to the array of acceptable values */
33695     int n_values;
33696     int * terminal; /* return value if this was a terminal state */
33697     int n_terminal;
33698 
33699     for (n_exec = 0;n_exec < gen_nb_xmlRegExecCtxtPtr;n_exec++) {
33700     for (n_string = 0;n_string < gen_nb_const_xmlChar_ptr_ptr;n_string++) {
33701     for (n_nbval = 0;n_nbval < gen_nb_int_ptr;n_nbval++) {
33702     for (n_nbneg = 0;n_nbneg < gen_nb_int_ptr;n_nbneg++) {
33703     for (n_values = 0;n_values < gen_nb_xmlChar_ptr_ptr;n_values++) {
33704     for (n_terminal = 0;n_terminal < gen_nb_int_ptr;n_terminal++) {
33705         mem_base = xmlMemBlocks();
33706         exec = gen_xmlRegExecCtxtPtr(n_exec, 0);
33707         string = gen_const_xmlChar_ptr_ptr(n_string, 1);
33708         nbval = gen_int_ptr(n_nbval, 2);
33709         nbneg = gen_int_ptr(n_nbneg, 3);
33710         values = gen_xmlChar_ptr_ptr(n_values, 4);
33711         terminal = gen_int_ptr(n_terminal, 5);
33712 
33713         ret_val = xmlRegExecErrInfo(exec, (const xmlChar **)string, nbval, nbneg, values, terminal);
33714         desret_int(ret_val);
33715         call_tests++;
33716         des_xmlRegExecCtxtPtr(n_exec, exec, 0);
33717         des_const_xmlChar_ptr_ptr(n_string, (const xmlChar **)string, 1);
33718         des_int_ptr(n_nbval, nbval, 2);
33719         des_int_ptr(n_nbneg, nbneg, 3);
33720         des_xmlChar_ptr_ptr(n_values, values, 4);
33721         des_int_ptr(n_terminal, terminal, 5);
33722         xmlResetLastError();
33723         if (mem_base != xmlMemBlocks()) {
33724             printf("Leak of %d blocks found in xmlRegExecErrInfo",
33725 	           xmlMemBlocks() - mem_base);
33726 	    test_ret++;
33727             printf(" %d", n_exec);
33728             printf(" %d", n_string);
33729             printf(" %d", n_nbval);
33730             printf(" %d", n_nbneg);
33731             printf(" %d", n_values);
33732             printf(" %d", n_terminal);
33733             printf("\n");
33734         }
33735     }
33736     }
33737     }
33738     }
33739     }
33740     }
33741     function_tests++;
33742 #endif
33743 
33744     return(test_ret);
33745 }
33746 
33747 
33748 static int
test_xmlRegExecNextValues(void)33749 test_xmlRegExecNextValues(void) {
33750     int test_ret = 0;
33751 
33752 #if defined(LIBXML_REGEXP_ENABLED)
33753     int mem_base;
33754     int ret_val;
33755     xmlRegExecCtxtPtr exec; /* a regexp execution context */
33756     int n_exec;
33757     int * nbval; /* pointer to the number of accepted values IN/OUT */
33758     int n_nbval;
33759     int * nbneg; /* return number of negative transitions */
33760     int n_nbneg;
33761     xmlChar ** values; /* pointer to the array of acceptable values */
33762     int n_values;
33763     int * terminal; /* return value if this was a terminal state */
33764     int n_terminal;
33765 
33766     for (n_exec = 0;n_exec < gen_nb_xmlRegExecCtxtPtr;n_exec++) {
33767     for (n_nbval = 0;n_nbval < gen_nb_int_ptr;n_nbval++) {
33768     for (n_nbneg = 0;n_nbneg < gen_nb_int_ptr;n_nbneg++) {
33769     for (n_values = 0;n_values < gen_nb_xmlChar_ptr_ptr;n_values++) {
33770     for (n_terminal = 0;n_terminal < gen_nb_int_ptr;n_terminal++) {
33771         mem_base = xmlMemBlocks();
33772         exec = gen_xmlRegExecCtxtPtr(n_exec, 0);
33773         nbval = gen_int_ptr(n_nbval, 1);
33774         nbneg = gen_int_ptr(n_nbneg, 2);
33775         values = gen_xmlChar_ptr_ptr(n_values, 3);
33776         terminal = gen_int_ptr(n_terminal, 4);
33777 
33778         ret_val = xmlRegExecNextValues(exec, nbval, nbneg, values, terminal);
33779         desret_int(ret_val);
33780         call_tests++;
33781         des_xmlRegExecCtxtPtr(n_exec, exec, 0);
33782         des_int_ptr(n_nbval, nbval, 1);
33783         des_int_ptr(n_nbneg, nbneg, 2);
33784         des_xmlChar_ptr_ptr(n_values, values, 3);
33785         des_int_ptr(n_terminal, terminal, 4);
33786         xmlResetLastError();
33787         if (mem_base != xmlMemBlocks()) {
33788             printf("Leak of %d blocks found in xmlRegExecNextValues",
33789 	           xmlMemBlocks() - mem_base);
33790 	    test_ret++;
33791             printf(" %d", n_exec);
33792             printf(" %d", n_nbval);
33793             printf(" %d", n_nbneg);
33794             printf(" %d", n_values);
33795             printf(" %d", n_terminal);
33796             printf("\n");
33797         }
33798     }
33799     }
33800     }
33801     }
33802     }
33803     function_tests++;
33804 #endif
33805 
33806     return(test_ret);
33807 }
33808 
33809 
33810 static int
test_xmlRegExecPushString(void)33811 test_xmlRegExecPushString(void) {
33812     int test_ret = 0;
33813 
33814 #if defined(LIBXML_REGEXP_ENABLED)
33815     int mem_base;
33816     int ret_val;
33817     xmlRegExecCtxtPtr exec; /* a regexp execution context or NULL to indicate the end */
33818     int n_exec;
33819     xmlChar * value; /* a string token input */
33820     int n_value;
33821     void * data; /* data associated to the token to reuse in callbacks */
33822     int n_data;
33823 
33824     for (n_exec = 0;n_exec < gen_nb_xmlRegExecCtxtPtr;n_exec++) {
33825     for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
33826     for (n_data = 0;n_data < gen_nb_userdata;n_data++) {
33827         mem_base = xmlMemBlocks();
33828         exec = gen_xmlRegExecCtxtPtr(n_exec, 0);
33829         value = gen_const_xmlChar_ptr(n_value, 1);
33830         data = gen_userdata(n_data, 2);
33831 
33832         ret_val = xmlRegExecPushString(exec, (const xmlChar *)value, data);
33833         desret_int(ret_val);
33834         call_tests++;
33835         des_xmlRegExecCtxtPtr(n_exec, exec, 0);
33836         des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 1);
33837         des_userdata(n_data, data, 2);
33838         xmlResetLastError();
33839         if (mem_base != xmlMemBlocks()) {
33840             printf("Leak of %d blocks found in xmlRegExecPushString",
33841 	           xmlMemBlocks() - mem_base);
33842 	    test_ret++;
33843             printf(" %d", n_exec);
33844             printf(" %d", n_value);
33845             printf(" %d", n_data);
33846             printf("\n");
33847         }
33848     }
33849     }
33850     }
33851     function_tests++;
33852 #endif
33853 
33854     return(test_ret);
33855 }
33856 
33857 
33858 static int
test_xmlRegExecPushString2(void)33859 test_xmlRegExecPushString2(void) {
33860     int test_ret = 0;
33861 
33862 #if defined(LIBXML_REGEXP_ENABLED)
33863     int mem_base;
33864     int ret_val;
33865     xmlRegExecCtxtPtr exec; /* a regexp execution context or NULL to indicate the end */
33866     int n_exec;
33867     xmlChar * value; /* the first string token input */
33868     int n_value;
33869     xmlChar * value2; /* the second string token input */
33870     int n_value2;
33871     void * data; /* data associated to the token to reuse in callbacks */
33872     int n_data;
33873 
33874     for (n_exec = 0;n_exec < gen_nb_xmlRegExecCtxtPtr;n_exec++) {
33875     for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
33876     for (n_value2 = 0;n_value2 < gen_nb_const_xmlChar_ptr;n_value2++) {
33877     for (n_data = 0;n_data < gen_nb_userdata;n_data++) {
33878         mem_base = xmlMemBlocks();
33879         exec = gen_xmlRegExecCtxtPtr(n_exec, 0);
33880         value = gen_const_xmlChar_ptr(n_value, 1);
33881         value2 = gen_const_xmlChar_ptr(n_value2, 2);
33882         data = gen_userdata(n_data, 3);
33883 
33884         ret_val = xmlRegExecPushString2(exec, (const xmlChar *)value, (const xmlChar *)value2, data);
33885         desret_int(ret_val);
33886         call_tests++;
33887         des_xmlRegExecCtxtPtr(n_exec, exec, 0);
33888         des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 1);
33889         des_const_xmlChar_ptr(n_value2, (const xmlChar *)value2, 2);
33890         des_userdata(n_data, data, 3);
33891         xmlResetLastError();
33892         if (mem_base != xmlMemBlocks()) {
33893             printf("Leak of %d blocks found in xmlRegExecPushString2",
33894 	           xmlMemBlocks() - mem_base);
33895 	    test_ret++;
33896             printf(" %d", n_exec);
33897             printf(" %d", n_value);
33898             printf(" %d", n_value2);
33899             printf(" %d", n_data);
33900             printf("\n");
33901         }
33902     }
33903     }
33904     }
33905     }
33906     function_tests++;
33907 #endif
33908 
33909     return(test_ret);
33910 }
33911 
33912 
33913 static int
test_xmlRegNewExecCtxt(void)33914 test_xmlRegNewExecCtxt(void) {
33915     int test_ret = 0;
33916 
33917 
33918     /* missing type support */
33919     return(test_ret);
33920 }
33921 
33922 
33923 static int
test_xmlRegexpCompile(void)33924 test_xmlRegexpCompile(void) {
33925     int test_ret = 0;
33926 
33927 
33928     /* missing type support */
33929     return(test_ret);
33930 }
33931 
33932 #ifdef LIBXML_REGEXP_ENABLED
33933 
33934 #define gen_nb_xmlRegexpPtr 1
gen_xmlRegexpPtr(int no ATTRIBUTE_UNUSED,int nr ATTRIBUTE_UNUSED)33935 static xmlRegexpPtr gen_xmlRegexpPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
33936     return(NULL);
33937 }
des_xmlRegexpPtr(int no ATTRIBUTE_UNUSED,xmlRegexpPtr val ATTRIBUTE_UNUSED,int nr ATTRIBUTE_UNUSED)33938 static void des_xmlRegexpPtr(int no ATTRIBUTE_UNUSED, xmlRegexpPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
33939 }
33940 #endif
33941 
33942 
33943 static int
test_xmlRegexpExec(void)33944 test_xmlRegexpExec(void) {
33945     int test_ret = 0;
33946 
33947 #if defined(LIBXML_REGEXP_ENABLED)
33948     int mem_base;
33949     int ret_val;
33950     xmlRegexpPtr comp; /* the compiled regular expression */
33951     int n_comp;
33952     xmlChar * content; /* the value to check against the regular expression */
33953     int n_content;
33954 
33955     for (n_comp = 0;n_comp < gen_nb_xmlRegexpPtr;n_comp++) {
33956     for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
33957         mem_base = xmlMemBlocks();
33958         comp = gen_xmlRegexpPtr(n_comp, 0);
33959         content = gen_const_xmlChar_ptr(n_content, 1);
33960 
33961         ret_val = xmlRegexpExec(comp, (const xmlChar *)content);
33962         desret_int(ret_val);
33963         call_tests++;
33964         des_xmlRegexpPtr(n_comp, comp, 0);
33965         des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 1);
33966         xmlResetLastError();
33967         if (mem_base != xmlMemBlocks()) {
33968             printf("Leak of %d blocks found in xmlRegexpExec",
33969 	           xmlMemBlocks() - mem_base);
33970 	    test_ret++;
33971             printf(" %d", n_comp);
33972             printf(" %d", n_content);
33973             printf("\n");
33974         }
33975     }
33976     }
33977     function_tests++;
33978 #endif
33979 
33980     return(test_ret);
33981 }
33982 
33983 
33984 static int
test_xmlRegexpIsDeterminist(void)33985 test_xmlRegexpIsDeterminist(void) {
33986     int test_ret = 0;
33987 
33988 #if defined(LIBXML_REGEXP_ENABLED)
33989     int mem_base;
33990     int ret_val;
33991     xmlRegexpPtr comp; /* the compiled regular expression */
33992     int n_comp;
33993 
33994     for (n_comp = 0;n_comp < gen_nb_xmlRegexpPtr;n_comp++) {
33995         mem_base = xmlMemBlocks();
33996         comp = gen_xmlRegexpPtr(n_comp, 0);
33997 
33998         ret_val = xmlRegexpIsDeterminist(comp);
33999         desret_int(ret_val);
34000         call_tests++;
34001         des_xmlRegexpPtr(n_comp, comp, 0);
34002         xmlResetLastError();
34003         if (mem_base != xmlMemBlocks()) {
34004             printf("Leak of %d blocks found in xmlRegexpIsDeterminist",
34005 	           xmlMemBlocks() - mem_base);
34006 	    test_ret++;
34007             printf(" %d", n_comp);
34008             printf("\n");
34009         }
34010     }
34011     function_tests++;
34012 #endif
34013 
34014     return(test_ret);
34015 }
34016 
34017 
34018 static int
test_xmlRegexpPrint(void)34019 test_xmlRegexpPrint(void) {
34020     int test_ret = 0;
34021 
34022 #if defined(LIBXML_REGEXP_ENABLED)
34023     int mem_base;
34024     FILE * output; /* the file for the output debug */
34025     int n_output;
34026     xmlRegexpPtr regexp; /* the compiled regexp */
34027     int n_regexp;
34028 
34029     for (n_output = 0;n_output < gen_nb_FILE_ptr;n_output++) {
34030     for (n_regexp = 0;n_regexp < gen_nb_xmlRegexpPtr;n_regexp++) {
34031         mem_base = xmlMemBlocks();
34032         output = gen_FILE_ptr(n_output, 0);
34033         regexp = gen_xmlRegexpPtr(n_regexp, 1);
34034 
34035         xmlRegexpPrint(output, regexp);
34036         call_tests++;
34037         des_FILE_ptr(n_output, output, 0);
34038         des_xmlRegexpPtr(n_regexp, regexp, 1);
34039         xmlResetLastError();
34040         if (mem_base != xmlMemBlocks()) {
34041             printf("Leak of %d blocks found in xmlRegexpPrint",
34042 	           xmlMemBlocks() - mem_base);
34043 	    test_ret++;
34044             printf(" %d", n_output);
34045             printf(" %d", n_regexp);
34046             printf("\n");
34047         }
34048     }
34049     }
34050     function_tests++;
34051 #endif
34052 
34053     return(test_ret);
34054 }
34055 
34056 static int
test_xmlregexp(void)34057 test_xmlregexp(void) {
34058     int test_ret = 0;
34059 
34060     if (quiet == 0) printf("Testing xmlregexp : 16 of 30 functions ...\n");
34061     test_ret += test_xmlExpCtxtNbCons();
34062     test_ret += test_xmlExpCtxtNbNodes();
34063     test_ret += test_xmlExpDump();
34064     test_ret += test_xmlExpExpDerive();
34065     test_ret += test_xmlExpGetLanguage();
34066     test_ret += test_xmlExpGetStart();
34067     test_ret += test_xmlExpIsNillable();
34068     test_ret += test_xmlExpMaxToken();
34069     test_ret += test_xmlExpNewAtom();
34070     test_ret += test_xmlExpNewCtxt();
34071     test_ret += test_xmlExpNewOr();
34072     test_ret += test_xmlExpNewRange();
34073     test_ret += test_xmlExpNewSeq();
34074     test_ret += test_xmlExpParse();
34075     test_ret += test_xmlExpRef();
34076     test_ret += test_xmlExpStringDerive();
34077     test_ret += test_xmlExpSubsume();
34078     test_ret += test_xmlRegExecErrInfo();
34079     test_ret += test_xmlRegExecNextValues();
34080     test_ret += test_xmlRegExecPushString();
34081     test_ret += test_xmlRegExecPushString2();
34082     test_ret += test_xmlRegNewExecCtxt();
34083     test_ret += test_xmlRegexpCompile();
34084     test_ret += test_xmlRegexpExec();
34085     test_ret += test_xmlRegexpIsDeterminist();
34086     test_ret += test_xmlRegexpPrint();
34087 
34088     if (test_ret != 0)
34089 	printf("Module xmlregexp: %d errors\n", test_ret);
34090     return(test_ret);
34091 }
34092 #ifdef LIBXML_OUTPUT_ENABLED
34093 
34094 #define gen_nb_xmlSaveCtxtPtr 1
gen_xmlSaveCtxtPtr(int no ATTRIBUTE_UNUSED,int nr ATTRIBUTE_UNUSED)34095 static xmlSaveCtxtPtr gen_xmlSaveCtxtPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
34096     return(NULL);
34097 }
des_xmlSaveCtxtPtr(int no ATTRIBUTE_UNUSED,xmlSaveCtxtPtr val ATTRIBUTE_UNUSED,int nr ATTRIBUTE_UNUSED)34098 static void des_xmlSaveCtxtPtr(int no ATTRIBUTE_UNUSED, xmlSaveCtxtPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
34099 }
34100 #endif
34101 
34102 
34103 static int
test_xmlSaveClose(void)34104 test_xmlSaveClose(void) {
34105     int test_ret = 0;
34106 
34107 #if defined(LIBXML_OUTPUT_ENABLED)
34108     int mem_base;
34109     int ret_val;
34110     xmlSaveCtxtPtr ctxt; /* a document saving context */
34111     int n_ctxt;
34112 
34113     for (n_ctxt = 0;n_ctxt < gen_nb_xmlSaveCtxtPtr;n_ctxt++) {
34114         mem_base = xmlMemBlocks();
34115         ctxt = gen_xmlSaveCtxtPtr(n_ctxt, 0);
34116 
34117         ret_val = xmlSaveClose(ctxt);
34118         desret_int(ret_val);
34119         call_tests++;
34120         des_xmlSaveCtxtPtr(n_ctxt, ctxt, 0);
34121         xmlResetLastError();
34122         if (mem_base != xmlMemBlocks()) {
34123             printf("Leak of %d blocks found in xmlSaveClose",
34124 	           xmlMemBlocks() - mem_base);
34125 	    test_ret++;
34126             printf(" %d", n_ctxt);
34127             printf("\n");
34128         }
34129     }
34130     function_tests++;
34131 #endif
34132 
34133     return(test_ret);
34134 }
34135 
34136 
34137 static int
test_xmlSaveDoc(void)34138 test_xmlSaveDoc(void) {
34139     int test_ret = 0;
34140 
34141 #if defined(LIBXML_OUTPUT_ENABLED)
34142     int mem_base;
34143     long ret_val;
34144     xmlSaveCtxtPtr ctxt; /* a document saving context */
34145     int n_ctxt;
34146     xmlDocPtr doc; /* a document */
34147     int n_doc;
34148 
34149     for (n_ctxt = 0;n_ctxt < gen_nb_xmlSaveCtxtPtr;n_ctxt++) {
34150     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
34151         mem_base = xmlMemBlocks();
34152         ctxt = gen_xmlSaveCtxtPtr(n_ctxt, 0);
34153         doc = gen_xmlDocPtr(n_doc, 1);
34154 
34155         ret_val = xmlSaveDoc(ctxt, doc);
34156         desret_long(ret_val);
34157         call_tests++;
34158         des_xmlSaveCtxtPtr(n_ctxt, ctxt, 0);
34159         des_xmlDocPtr(n_doc, doc, 1);
34160         xmlResetLastError();
34161         if (mem_base != xmlMemBlocks()) {
34162             printf("Leak of %d blocks found in xmlSaveDoc",
34163 	           xmlMemBlocks() - mem_base);
34164 	    test_ret++;
34165             printf(" %d", n_ctxt);
34166             printf(" %d", n_doc);
34167             printf("\n");
34168         }
34169     }
34170     }
34171     function_tests++;
34172 #endif
34173 
34174     return(test_ret);
34175 }
34176 
34177 
34178 static int
test_xmlSaveFlush(void)34179 test_xmlSaveFlush(void) {
34180     int test_ret = 0;
34181 
34182 #if defined(LIBXML_OUTPUT_ENABLED)
34183     int mem_base;
34184     int ret_val;
34185     xmlSaveCtxtPtr ctxt; /* a document saving context */
34186     int n_ctxt;
34187 
34188     for (n_ctxt = 0;n_ctxt < gen_nb_xmlSaveCtxtPtr;n_ctxt++) {
34189         mem_base = xmlMemBlocks();
34190         ctxt = gen_xmlSaveCtxtPtr(n_ctxt, 0);
34191 
34192         ret_val = xmlSaveFlush(ctxt);
34193         desret_int(ret_val);
34194         call_tests++;
34195         des_xmlSaveCtxtPtr(n_ctxt, ctxt, 0);
34196         xmlResetLastError();
34197         if (mem_base != xmlMemBlocks()) {
34198             printf("Leak of %d blocks found in xmlSaveFlush",
34199 	           xmlMemBlocks() - mem_base);
34200 	    test_ret++;
34201             printf(" %d", n_ctxt);
34202             printf("\n");
34203         }
34204     }
34205     function_tests++;
34206 #endif
34207 
34208     return(test_ret);
34209 }
34210 
34211 
34212 static int
test_xmlSaveSetAttrEscape(void)34213 test_xmlSaveSetAttrEscape(void) {
34214     int test_ret = 0;
34215 
34216 
34217     /* missing type support */
34218     return(test_ret);
34219 }
34220 
34221 
34222 static int
test_xmlSaveSetEscape(void)34223 test_xmlSaveSetEscape(void) {
34224     int test_ret = 0;
34225 
34226 
34227     /* missing type support */
34228     return(test_ret);
34229 }
34230 
34231 
34232 static int
test_xmlSaveToBuffer(void)34233 test_xmlSaveToBuffer(void) {
34234     int test_ret = 0;
34235 
34236 
34237     /* missing type support */
34238     return(test_ret);
34239 }
34240 
34241 
34242 static int
test_xmlSaveToFd(void)34243 test_xmlSaveToFd(void) {
34244     int test_ret = 0;
34245 
34246 
34247     /* missing type support */
34248     return(test_ret);
34249 }
34250 
34251 
34252 static int
test_xmlSaveToFilename(void)34253 test_xmlSaveToFilename(void) {
34254     int test_ret = 0;
34255 
34256 
34257     /* missing type support */
34258     return(test_ret);
34259 }
34260 
34261 
34262 static int
test_xmlSaveTree(void)34263 test_xmlSaveTree(void) {
34264     int test_ret = 0;
34265 
34266 #if defined(LIBXML_OUTPUT_ENABLED)
34267     int mem_base;
34268     long ret_val;
34269     xmlSaveCtxtPtr ctxt; /* a document saving context */
34270     int n_ctxt;
34271     xmlNodePtr cur; /*  */
34272     int n_cur;
34273 
34274     for (n_ctxt = 0;n_ctxt < gen_nb_xmlSaveCtxtPtr;n_ctxt++) {
34275     for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
34276         mem_base = xmlMemBlocks();
34277         ctxt = gen_xmlSaveCtxtPtr(n_ctxt, 0);
34278         cur = gen_xmlNodePtr(n_cur, 1);
34279 
34280         ret_val = xmlSaveTree(ctxt, cur);
34281         desret_long(ret_val);
34282         call_tests++;
34283         des_xmlSaveCtxtPtr(n_ctxt, ctxt, 0);
34284         des_xmlNodePtr(n_cur, cur, 1);
34285         xmlResetLastError();
34286         if (mem_base != xmlMemBlocks()) {
34287             printf("Leak of %d blocks found in xmlSaveTree",
34288 	           xmlMemBlocks() - mem_base);
34289 	    test_ret++;
34290             printf(" %d", n_ctxt);
34291             printf(" %d", n_cur);
34292             printf("\n");
34293         }
34294     }
34295     }
34296     function_tests++;
34297 #endif
34298 
34299     return(test_ret);
34300 }
34301 
34302 static int
test_xmlsave(void)34303 test_xmlsave(void) {
34304     int test_ret = 0;
34305 
34306     if (quiet == 0) printf("Testing xmlsave : 4 of 10 functions ...\n");
34307     test_ret += test_xmlSaveClose();
34308     test_ret += test_xmlSaveDoc();
34309     test_ret += test_xmlSaveFlush();
34310     test_ret += test_xmlSaveSetAttrEscape();
34311     test_ret += test_xmlSaveSetEscape();
34312     test_ret += test_xmlSaveToBuffer();
34313     test_ret += test_xmlSaveToFd();
34314     test_ret += test_xmlSaveToFilename();
34315     test_ret += test_xmlSaveTree();
34316 
34317     if (test_ret != 0)
34318 	printf("Module xmlsave: %d errors\n", test_ret);
34319     return(test_ret);
34320 }
34321 
34322 static int
test_xmlSchemaDump(void)34323 test_xmlSchemaDump(void) {
34324     int test_ret = 0;
34325 
34326 #if defined(LIBXML_SCHEMAS_ENABLED) && defined(LIBXML_OUTPUT_ENABLED)
34327     int mem_base;
34328     FILE * output; /* the file output */
34329     int n_output;
34330     xmlSchemaPtr schema; /* a schema structure */
34331     int n_schema;
34332 
34333     for (n_output = 0;n_output < gen_nb_FILE_ptr;n_output++) {
34334     for (n_schema = 0;n_schema < gen_nb_xmlSchemaPtr;n_schema++) {
34335         mem_base = xmlMemBlocks();
34336         output = gen_FILE_ptr(n_output, 0);
34337         schema = gen_xmlSchemaPtr(n_schema, 1);
34338 
34339         xmlSchemaDump(output, schema);
34340         call_tests++;
34341         des_FILE_ptr(n_output, output, 0);
34342         des_xmlSchemaPtr(n_schema, schema, 1);
34343         xmlResetLastError();
34344         if (mem_base != xmlMemBlocks()) {
34345             printf("Leak of %d blocks found in xmlSchemaDump",
34346 	           xmlMemBlocks() - mem_base);
34347 	    test_ret++;
34348             printf(" %d", n_output);
34349             printf(" %d", n_schema);
34350             printf("\n");
34351         }
34352     }
34353     }
34354     function_tests++;
34355 #endif
34356 
34357     return(test_ret);
34358 }
34359 
34360 #ifdef LIBXML_SCHEMAS_ENABLED
34361 
34362 #define gen_nb_xmlSchemaParserCtxtPtr 1
gen_xmlSchemaParserCtxtPtr(int no ATTRIBUTE_UNUSED,int nr ATTRIBUTE_UNUSED)34363 static xmlSchemaParserCtxtPtr gen_xmlSchemaParserCtxtPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
34364     return(NULL);
34365 }
des_xmlSchemaParserCtxtPtr(int no ATTRIBUTE_UNUSED,xmlSchemaParserCtxtPtr val ATTRIBUTE_UNUSED,int nr ATTRIBUTE_UNUSED)34366 static void des_xmlSchemaParserCtxtPtr(int no ATTRIBUTE_UNUSED, xmlSchemaParserCtxtPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
34367 }
34368 #endif
34369 
34370 #ifdef LIBXML_SCHEMAS_ENABLED
34371 
34372 #define gen_nb_xmlSchemaValidityErrorFunc_ptr 1
gen_xmlSchemaValidityErrorFunc_ptr(int no ATTRIBUTE_UNUSED,int nr ATTRIBUTE_UNUSED)34373 static xmlSchemaValidityErrorFunc * gen_xmlSchemaValidityErrorFunc_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
34374     return(NULL);
34375 }
des_xmlSchemaValidityErrorFunc_ptr(int no ATTRIBUTE_UNUSED,xmlSchemaValidityErrorFunc * val ATTRIBUTE_UNUSED,int nr ATTRIBUTE_UNUSED)34376 static void des_xmlSchemaValidityErrorFunc_ptr(int no ATTRIBUTE_UNUSED, xmlSchemaValidityErrorFunc * val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
34377 }
34378 #endif
34379 
34380 #ifdef LIBXML_SCHEMAS_ENABLED
34381 
34382 #define gen_nb_xmlSchemaValidityWarningFunc_ptr 1
gen_xmlSchemaValidityWarningFunc_ptr(int no ATTRIBUTE_UNUSED,int nr ATTRIBUTE_UNUSED)34383 static xmlSchemaValidityWarningFunc * gen_xmlSchemaValidityWarningFunc_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
34384     return(NULL);
34385 }
des_xmlSchemaValidityWarningFunc_ptr(int no ATTRIBUTE_UNUSED,xmlSchemaValidityWarningFunc * val ATTRIBUTE_UNUSED,int nr ATTRIBUTE_UNUSED)34386 static void des_xmlSchemaValidityWarningFunc_ptr(int no ATTRIBUTE_UNUSED, xmlSchemaValidityWarningFunc * val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
34387 }
34388 #endif
34389 
34390 
34391 static int
test_xmlSchemaGetParserErrors(void)34392 test_xmlSchemaGetParserErrors(void) {
34393     int test_ret = 0;
34394 
34395 #if defined(LIBXML_SCHEMAS_ENABLED)
34396     int mem_base;
34397     int ret_val;
34398     xmlSchemaParserCtxtPtr ctxt; /* a XMl-Schema parser context */
34399     int n_ctxt;
34400     xmlSchemaValidityErrorFunc * err; /* the error callback result */
34401     int n_err;
34402     xmlSchemaValidityWarningFunc * warn; /* the warning callback result */
34403     int n_warn;
34404     void ** ctx; /* contextual data for the callbacks result */
34405     int n_ctx;
34406 
34407     for (n_ctxt = 0;n_ctxt < gen_nb_xmlSchemaParserCtxtPtr;n_ctxt++) {
34408     for (n_err = 0;n_err < gen_nb_xmlSchemaValidityErrorFunc_ptr;n_err++) {
34409     for (n_warn = 0;n_warn < gen_nb_xmlSchemaValidityWarningFunc_ptr;n_warn++) {
34410     for (n_ctx = 0;n_ctx < gen_nb_void_ptr_ptr;n_ctx++) {
34411         mem_base = xmlMemBlocks();
34412         ctxt = gen_xmlSchemaParserCtxtPtr(n_ctxt, 0);
34413         err = gen_xmlSchemaValidityErrorFunc_ptr(n_err, 1);
34414         warn = gen_xmlSchemaValidityWarningFunc_ptr(n_warn, 2);
34415         ctx = gen_void_ptr_ptr(n_ctx, 3);
34416 
34417         ret_val = xmlSchemaGetParserErrors(ctxt, err, warn, ctx);
34418         desret_int(ret_val);
34419         call_tests++;
34420         des_xmlSchemaParserCtxtPtr(n_ctxt, ctxt, 0);
34421         des_xmlSchemaValidityErrorFunc_ptr(n_err, err, 1);
34422         des_xmlSchemaValidityWarningFunc_ptr(n_warn, warn, 2);
34423         des_void_ptr_ptr(n_ctx, ctx, 3);
34424         xmlResetLastError();
34425         if (mem_base != xmlMemBlocks()) {
34426             printf("Leak of %d blocks found in xmlSchemaGetParserErrors",
34427 	           xmlMemBlocks() - mem_base);
34428 	    test_ret++;
34429             printf(" %d", n_ctxt);
34430             printf(" %d", n_err);
34431             printf(" %d", n_warn);
34432             printf(" %d", n_ctx);
34433             printf("\n");
34434         }
34435     }
34436     }
34437     }
34438     }
34439     function_tests++;
34440 #endif
34441 
34442     return(test_ret);
34443 }
34444 
34445 
34446 static int
test_xmlSchemaGetValidErrors(void)34447 test_xmlSchemaGetValidErrors(void) {
34448     int test_ret = 0;
34449 
34450 #if defined(LIBXML_SCHEMAS_ENABLED)
34451     int mem_base;
34452     int ret_val;
34453     xmlSchemaValidCtxtPtr ctxt; /* a XML-Schema validation context */
34454     int n_ctxt;
34455     xmlSchemaValidityErrorFunc * err; /* the error function result */
34456     int n_err;
34457     xmlSchemaValidityWarningFunc * warn; /* the warning function result */
34458     int n_warn;
34459     void ** ctx; /* the functions context result */
34460     int n_ctx;
34461 
34462     for (n_ctxt = 0;n_ctxt < gen_nb_xmlSchemaValidCtxtPtr;n_ctxt++) {
34463     for (n_err = 0;n_err < gen_nb_xmlSchemaValidityErrorFunc_ptr;n_err++) {
34464     for (n_warn = 0;n_warn < gen_nb_xmlSchemaValidityWarningFunc_ptr;n_warn++) {
34465     for (n_ctx = 0;n_ctx < gen_nb_void_ptr_ptr;n_ctx++) {
34466         mem_base = xmlMemBlocks();
34467         ctxt = gen_xmlSchemaValidCtxtPtr(n_ctxt, 0);
34468         err = gen_xmlSchemaValidityErrorFunc_ptr(n_err, 1);
34469         warn = gen_xmlSchemaValidityWarningFunc_ptr(n_warn, 2);
34470         ctx = gen_void_ptr_ptr(n_ctx, 3);
34471 
34472         ret_val = xmlSchemaGetValidErrors(ctxt, err, warn, ctx);
34473         desret_int(ret_val);
34474         call_tests++;
34475         des_xmlSchemaValidCtxtPtr(n_ctxt, ctxt, 0);
34476         des_xmlSchemaValidityErrorFunc_ptr(n_err, err, 1);
34477         des_xmlSchemaValidityWarningFunc_ptr(n_warn, warn, 2);
34478         des_void_ptr_ptr(n_ctx, ctx, 3);
34479         xmlResetLastError();
34480         if (mem_base != xmlMemBlocks()) {
34481             printf("Leak of %d blocks found in xmlSchemaGetValidErrors",
34482 	           xmlMemBlocks() - mem_base);
34483 	    test_ret++;
34484             printf(" %d", n_ctxt);
34485             printf(" %d", n_err);
34486             printf(" %d", n_warn);
34487             printf(" %d", n_ctx);
34488             printf("\n");
34489         }
34490     }
34491     }
34492     }
34493     }
34494     function_tests++;
34495 #endif
34496 
34497     return(test_ret);
34498 }
34499 
34500 
34501 static int
test_xmlSchemaIsValid(void)34502 test_xmlSchemaIsValid(void) {
34503     int test_ret = 0;
34504 
34505 #if defined(LIBXML_SCHEMAS_ENABLED)
34506     int mem_base;
34507     int ret_val;
34508     xmlSchemaValidCtxtPtr ctxt; /* the schema validation context */
34509     int n_ctxt;
34510 
34511     for (n_ctxt = 0;n_ctxt < gen_nb_xmlSchemaValidCtxtPtr;n_ctxt++) {
34512         mem_base = xmlMemBlocks();
34513         ctxt = gen_xmlSchemaValidCtxtPtr(n_ctxt, 0);
34514 
34515         ret_val = xmlSchemaIsValid(ctxt);
34516         desret_int(ret_val);
34517         call_tests++;
34518         des_xmlSchemaValidCtxtPtr(n_ctxt, ctxt, 0);
34519         xmlResetLastError();
34520         if (mem_base != xmlMemBlocks()) {
34521             printf("Leak of %d blocks found in xmlSchemaIsValid",
34522 	           xmlMemBlocks() - mem_base);
34523 	    test_ret++;
34524             printf(" %d", n_ctxt);
34525             printf("\n");
34526         }
34527     }
34528     function_tests++;
34529 #endif
34530 
34531     return(test_ret);
34532 }
34533 
34534 
34535 static int
test_xmlSchemaNewDocParserCtxt(void)34536 test_xmlSchemaNewDocParserCtxt(void) {
34537     int test_ret = 0;
34538 
34539 #if defined(LIBXML_SCHEMAS_ENABLED)
34540     int mem_base;
34541     xmlSchemaParserCtxtPtr ret_val;
34542     xmlDocPtr doc; /* a preparsed document tree */
34543     int n_doc;
34544 
34545     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
34546         mem_base = xmlMemBlocks();
34547         doc = gen_xmlDocPtr(n_doc, 0);
34548 
34549         ret_val = xmlSchemaNewDocParserCtxt(doc);
34550         desret_xmlSchemaParserCtxtPtr(ret_val);
34551         call_tests++;
34552         des_xmlDocPtr(n_doc, doc, 0);
34553         xmlResetLastError();
34554         if (mem_base != xmlMemBlocks()) {
34555             printf("Leak of %d blocks found in xmlSchemaNewDocParserCtxt",
34556 	           xmlMemBlocks() - mem_base);
34557 	    test_ret++;
34558             printf(" %d", n_doc);
34559             printf("\n");
34560         }
34561     }
34562     function_tests++;
34563 #endif
34564 
34565     return(test_ret);
34566 }
34567 
34568 
34569 static int
test_xmlSchemaNewMemParserCtxt(void)34570 test_xmlSchemaNewMemParserCtxt(void) {
34571     int test_ret = 0;
34572 
34573 #if defined(LIBXML_SCHEMAS_ENABLED)
34574     int mem_base;
34575     xmlSchemaParserCtxtPtr ret_val;
34576     char * buffer; /* a pointer to a char array containing the schemas */
34577     int n_buffer;
34578     int size; /* the size of the array */
34579     int n_size;
34580 
34581     for (n_buffer = 0;n_buffer < gen_nb_const_char_ptr;n_buffer++) {
34582     for (n_size = 0;n_size < gen_nb_int;n_size++) {
34583         mem_base = xmlMemBlocks();
34584         buffer = gen_const_char_ptr(n_buffer, 0);
34585         size = gen_int(n_size, 1);
34586         if ((buffer != NULL) &&
34587             (size > (int) strlen((const char *) buffer) + 1))
34588             continue;
34589 
34590         ret_val = xmlSchemaNewMemParserCtxt((const char *)buffer, size);
34591         desret_xmlSchemaParserCtxtPtr(ret_val);
34592         call_tests++;
34593         des_const_char_ptr(n_buffer, (const char *)buffer, 0);
34594         des_int(n_size, size, 1);
34595         xmlResetLastError();
34596         if (mem_base != xmlMemBlocks()) {
34597             printf("Leak of %d blocks found in xmlSchemaNewMemParserCtxt",
34598 	           xmlMemBlocks() - mem_base);
34599 	    test_ret++;
34600             printf(" %d", n_buffer);
34601             printf(" %d", n_size);
34602             printf("\n");
34603         }
34604     }
34605     }
34606     function_tests++;
34607 #endif
34608 
34609     return(test_ret);
34610 }
34611 
34612 
34613 static int
test_xmlSchemaNewParserCtxt(void)34614 test_xmlSchemaNewParserCtxt(void) {
34615     int test_ret = 0;
34616 
34617 #if defined(LIBXML_SCHEMAS_ENABLED)
34618     int mem_base;
34619     xmlSchemaParserCtxtPtr ret_val;
34620     char * URL; /* the location of the schema */
34621     int n_URL;
34622 
34623     for (n_URL = 0;n_URL < gen_nb_const_char_ptr;n_URL++) {
34624         mem_base = xmlMemBlocks();
34625         URL = gen_const_char_ptr(n_URL, 0);
34626 
34627         ret_val = xmlSchemaNewParserCtxt((const char *)URL);
34628         desret_xmlSchemaParserCtxtPtr(ret_val);
34629         call_tests++;
34630         des_const_char_ptr(n_URL, (const char *)URL, 0);
34631         xmlResetLastError();
34632         if (mem_base != xmlMemBlocks()) {
34633             printf("Leak of %d blocks found in xmlSchemaNewParserCtxt",
34634 	           xmlMemBlocks() - mem_base);
34635 	    test_ret++;
34636             printf(" %d", n_URL);
34637             printf("\n");
34638         }
34639     }
34640     function_tests++;
34641 #endif
34642 
34643     return(test_ret);
34644 }
34645 
34646 
34647 static int
test_xmlSchemaNewValidCtxt(void)34648 test_xmlSchemaNewValidCtxt(void) {
34649     int test_ret = 0;
34650 
34651 
34652     /* missing type support */
34653     return(test_ret);
34654 }
34655 
34656 
34657 static int
test_xmlSchemaParse(void)34658 test_xmlSchemaParse(void) {
34659     int test_ret = 0;
34660 
34661 
34662     /* missing type support */
34663     return(test_ret);
34664 }
34665 
34666 
34667 static int
test_xmlSchemaSAXPlug(void)34668 test_xmlSchemaSAXPlug(void) {
34669     int test_ret = 0;
34670 
34671 
34672     /* missing type support */
34673     return(test_ret);
34674 }
34675 
34676 #ifdef LIBXML_SCHEMAS_ENABLED
34677 
34678 #define gen_nb_xmlSchemaSAXPlugPtr 1
gen_xmlSchemaSAXPlugPtr(int no ATTRIBUTE_UNUSED,int nr ATTRIBUTE_UNUSED)34679 static xmlSchemaSAXPlugPtr gen_xmlSchemaSAXPlugPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
34680     return(NULL);
34681 }
des_xmlSchemaSAXPlugPtr(int no ATTRIBUTE_UNUSED,xmlSchemaSAXPlugPtr val ATTRIBUTE_UNUSED,int nr ATTRIBUTE_UNUSED)34682 static void des_xmlSchemaSAXPlugPtr(int no ATTRIBUTE_UNUSED, xmlSchemaSAXPlugPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
34683 }
34684 #endif
34685 
34686 
34687 static int
test_xmlSchemaSAXUnplug(void)34688 test_xmlSchemaSAXUnplug(void) {
34689     int test_ret = 0;
34690 
34691 #if defined(LIBXML_SCHEMAS_ENABLED)
34692     int mem_base;
34693     int ret_val;
34694     xmlSchemaSAXPlugPtr plug; /* a data structure returned by xmlSchemaSAXPlug */
34695     int n_plug;
34696 
34697     for (n_plug = 0;n_plug < gen_nb_xmlSchemaSAXPlugPtr;n_plug++) {
34698         mem_base = xmlMemBlocks();
34699         plug = gen_xmlSchemaSAXPlugPtr(n_plug, 0);
34700 
34701         ret_val = xmlSchemaSAXUnplug(plug);
34702         desret_int(ret_val);
34703         call_tests++;
34704         des_xmlSchemaSAXPlugPtr(n_plug, plug, 0);
34705         xmlResetLastError();
34706         if (mem_base != xmlMemBlocks()) {
34707             printf("Leak of %d blocks found in xmlSchemaSAXUnplug",
34708 	           xmlMemBlocks() - mem_base);
34709 	    test_ret++;
34710             printf(" %d", n_plug);
34711             printf("\n");
34712         }
34713     }
34714     function_tests++;
34715 #endif
34716 
34717     return(test_ret);
34718 }
34719 
34720 
34721 static int
test_xmlSchemaSetParserErrors(void)34722 test_xmlSchemaSetParserErrors(void) {
34723     int test_ret = 0;
34724 
34725 
34726     /* missing type support */
34727     return(test_ret);
34728 }
34729 
34730 
34731 static int
test_xmlSchemaSetParserStructuredErrors(void)34732 test_xmlSchemaSetParserStructuredErrors(void) {
34733     int test_ret = 0;
34734 
34735 
34736     /* missing type support */
34737     return(test_ret);
34738 }
34739 
34740 
34741 static int
test_xmlSchemaSetValidErrors(void)34742 test_xmlSchemaSetValidErrors(void) {
34743     int test_ret = 0;
34744 
34745 
34746     /* missing type support */
34747     return(test_ret);
34748 }
34749 
34750 
34751 static int
test_xmlSchemaSetValidOptions(void)34752 test_xmlSchemaSetValidOptions(void) {
34753     int test_ret = 0;
34754 
34755 #if defined(LIBXML_SCHEMAS_ENABLED)
34756     int mem_base;
34757     int ret_val;
34758     xmlSchemaValidCtxtPtr ctxt; /* a schema validation context */
34759     int n_ctxt;
34760     int options; /* a combination of xmlSchemaValidOption */
34761     int n_options;
34762 
34763     for (n_ctxt = 0;n_ctxt < gen_nb_xmlSchemaValidCtxtPtr;n_ctxt++) {
34764     for (n_options = 0;n_options < gen_nb_int;n_options++) {
34765         mem_base = xmlMemBlocks();
34766         ctxt = gen_xmlSchemaValidCtxtPtr(n_ctxt, 0);
34767         options = gen_int(n_options, 1);
34768 
34769         ret_val = xmlSchemaSetValidOptions(ctxt, options);
34770         desret_int(ret_val);
34771         call_tests++;
34772         des_xmlSchemaValidCtxtPtr(n_ctxt, ctxt, 0);
34773         des_int(n_options, options, 1);
34774         xmlResetLastError();
34775         if (mem_base != xmlMemBlocks()) {
34776             printf("Leak of %d blocks found in xmlSchemaSetValidOptions",
34777 	           xmlMemBlocks() - mem_base);
34778 	    test_ret++;
34779             printf(" %d", n_ctxt);
34780             printf(" %d", n_options);
34781             printf("\n");
34782         }
34783     }
34784     }
34785     function_tests++;
34786 #endif
34787 
34788     return(test_ret);
34789 }
34790 
34791 
34792 static int
test_xmlSchemaSetValidStructuredErrors(void)34793 test_xmlSchemaSetValidStructuredErrors(void) {
34794     int test_ret = 0;
34795 
34796 
34797     /* missing type support */
34798     return(test_ret);
34799 }
34800 
34801 
34802 static int
test_xmlSchemaValidCtxtGetOptions(void)34803 test_xmlSchemaValidCtxtGetOptions(void) {
34804     int test_ret = 0;
34805 
34806 #if defined(LIBXML_SCHEMAS_ENABLED)
34807     int mem_base;
34808     int ret_val;
34809     xmlSchemaValidCtxtPtr ctxt; /* a schema validation context */
34810     int n_ctxt;
34811 
34812     for (n_ctxt = 0;n_ctxt < gen_nb_xmlSchemaValidCtxtPtr;n_ctxt++) {
34813         mem_base = xmlMemBlocks();
34814         ctxt = gen_xmlSchemaValidCtxtPtr(n_ctxt, 0);
34815 
34816         ret_val = xmlSchemaValidCtxtGetOptions(ctxt);
34817         desret_int(ret_val);
34818         call_tests++;
34819         des_xmlSchemaValidCtxtPtr(n_ctxt, ctxt, 0);
34820         xmlResetLastError();
34821         if (mem_base != xmlMemBlocks()) {
34822             printf("Leak of %d blocks found in xmlSchemaValidCtxtGetOptions",
34823 	           xmlMemBlocks() - mem_base);
34824 	    test_ret++;
34825             printf(" %d", n_ctxt);
34826             printf("\n");
34827         }
34828     }
34829     function_tests++;
34830 #endif
34831 
34832     return(test_ret);
34833 }
34834 
34835 
34836 static int
test_xmlSchemaValidCtxtGetParserCtxt(void)34837 test_xmlSchemaValidCtxtGetParserCtxt(void) {
34838     int test_ret = 0;
34839 
34840 #if defined(LIBXML_SCHEMAS_ENABLED)
34841     int mem_base;
34842     xmlParserCtxtPtr ret_val;
34843     xmlSchemaValidCtxtPtr ctxt; /* a schema validation context */
34844     int n_ctxt;
34845 
34846     for (n_ctxt = 0;n_ctxt < gen_nb_xmlSchemaValidCtxtPtr;n_ctxt++) {
34847         mem_base = xmlMemBlocks();
34848         ctxt = gen_xmlSchemaValidCtxtPtr(n_ctxt, 0);
34849 
34850         ret_val = xmlSchemaValidCtxtGetParserCtxt(ctxt);
34851         desret_xmlParserCtxtPtr(ret_val);
34852         call_tests++;
34853         des_xmlSchemaValidCtxtPtr(n_ctxt, ctxt, 0);
34854         xmlResetLastError();
34855         if (mem_base != xmlMemBlocks()) {
34856             printf("Leak of %d blocks found in xmlSchemaValidCtxtGetParserCtxt",
34857 	           xmlMemBlocks() - mem_base);
34858 	    test_ret++;
34859             printf(" %d", n_ctxt);
34860             printf("\n");
34861         }
34862     }
34863     function_tests++;
34864 #endif
34865 
34866     return(test_ret);
34867 }
34868 
34869 
34870 static int
test_xmlSchemaValidateDoc(void)34871 test_xmlSchemaValidateDoc(void) {
34872     int test_ret = 0;
34873 
34874 #if defined(LIBXML_SCHEMAS_ENABLED)
34875     int mem_base;
34876     int ret_val;
34877     xmlSchemaValidCtxtPtr ctxt; /* a schema validation context */
34878     int n_ctxt;
34879     xmlDocPtr doc; /* a parsed document tree */
34880     int n_doc;
34881 
34882     for (n_ctxt = 0;n_ctxt < gen_nb_xmlSchemaValidCtxtPtr;n_ctxt++) {
34883     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
34884         mem_base = xmlMemBlocks();
34885         ctxt = gen_xmlSchemaValidCtxtPtr(n_ctxt, 0);
34886         doc = gen_xmlDocPtr(n_doc, 1);
34887 
34888         ret_val = xmlSchemaValidateDoc(ctxt, doc);
34889         desret_int(ret_val);
34890         call_tests++;
34891         des_xmlSchemaValidCtxtPtr(n_ctxt, ctxt, 0);
34892         des_xmlDocPtr(n_doc, doc, 1);
34893         xmlResetLastError();
34894         if (mem_base != xmlMemBlocks()) {
34895             printf("Leak of %d blocks found in xmlSchemaValidateDoc",
34896 	           xmlMemBlocks() - mem_base);
34897 	    test_ret++;
34898             printf(" %d", n_ctxt);
34899             printf(" %d", n_doc);
34900             printf("\n");
34901         }
34902     }
34903     }
34904     function_tests++;
34905 #endif
34906 
34907     return(test_ret);
34908 }
34909 
34910 
34911 static int
test_xmlSchemaValidateFile(void)34912 test_xmlSchemaValidateFile(void) {
34913     int test_ret = 0;
34914 
34915 #if defined(LIBXML_SCHEMAS_ENABLED)
34916     int mem_base;
34917     int ret_val;
34918     xmlSchemaValidCtxtPtr ctxt; /* a schema validation context */
34919     int n_ctxt;
34920     const char * filename; /* the URI of the instance */
34921     int n_filename;
34922     int options; /* a future set of options, currently unused */
34923     int n_options;
34924 
34925     for (n_ctxt = 0;n_ctxt < gen_nb_xmlSchemaValidCtxtPtr;n_ctxt++) {
34926     for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
34927     for (n_options = 0;n_options < gen_nb_int;n_options++) {
34928         mem_base = xmlMemBlocks();
34929         ctxt = gen_xmlSchemaValidCtxtPtr(n_ctxt, 0);
34930         filename = gen_filepath(n_filename, 1);
34931         options = gen_int(n_options, 2);
34932 
34933         ret_val = xmlSchemaValidateFile(ctxt, filename, options);
34934         desret_int(ret_val);
34935         call_tests++;
34936         des_xmlSchemaValidCtxtPtr(n_ctxt, ctxt, 0);
34937         des_filepath(n_filename, filename, 1);
34938         des_int(n_options, options, 2);
34939         xmlResetLastError();
34940         if (mem_base != xmlMemBlocks()) {
34941             printf("Leak of %d blocks found in xmlSchemaValidateFile",
34942 	           xmlMemBlocks() - mem_base);
34943 	    test_ret++;
34944             printf(" %d", n_ctxt);
34945             printf(" %d", n_filename);
34946             printf(" %d", n_options);
34947             printf("\n");
34948         }
34949     }
34950     }
34951     }
34952     function_tests++;
34953 #endif
34954 
34955     return(test_ret);
34956 }
34957 
34958 
34959 static int
test_xmlSchemaValidateOneElement(void)34960 test_xmlSchemaValidateOneElement(void) {
34961     int test_ret = 0;
34962 
34963 #if defined(LIBXML_SCHEMAS_ENABLED)
34964     int mem_base;
34965     int ret_val;
34966     xmlSchemaValidCtxtPtr ctxt; /* a schema validation context */
34967     int n_ctxt;
34968     xmlNodePtr elem; /* an element node */
34969     int n_elem;
34970 
34971     for (n_ctxt = 0;n_ctxt < gen_nb_xmlSchemaValidCtxtPtr;n_ctxt++) {
34972     for (n_elem = 0;n_elem < gen_nb_xmlNodePtr;n_elem++) {
34973         mem_base = xmlMemBlocks();
34974         ctxt = gen_xmlSchemaValidCtxtPtr(n_ctxt, 0);
34975         elem = gen_xmlNodePtr(n_elem, 1);
34976 
34977         ret_val = xmlSchemaValidateOneElement(ctxt, elem);
34978         desret_int(ret_val);
34979         call_tests++;
34980         des_xmlSchemaValidCtxtPtr(n_ctxt, ctxt, 0);
34981         des_xmlNodePtr(n_elem, elem, 1);
34982         xmlResetLastError();
34983         if (mem_base != xmlMemBlocks()) {
34984             printf("Leak of %d blocks found in xmlSchemaValidateOneElement",
34985 	           xmlMemBlocks() - mem_base);
34986 	    test_ret++;
34987             printf(" %d", n_ctxt);
34988             printf(" %d", n_elem);
34989             printf("\n");
34990         }
34991     }
34992     }
34993     function_tests++;
34994 #endif
34995 
34996     return(test_ret);
34997 }
34998 
34999 
35000 static int
test_xmlSchemaValidateSetFilename(void)35001 test_xmlSchemaValidateSetFilename(void) {
35002     int test_ret = 0;
35003 
35004 #if defined(LIBXML_SCHEMAS_ENABLED)
35005     int mem_base;
35006     xmlSchemaValidCtxtPtr vctxt; /* the schema validation context */
35007     int n_vctxt;
35008     const char * filename; /* the file name */
35009     int n_filename;
35010 
35011     for (n_vctxt = 0;n_vctxt < gen_nb_xmlSchemaValidCtxtPtr;n_vctxt++) {
35012     for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
35013         mem_base = xmlMemBlocks();
35014         vctxt = gen_xmlSchemaValidCtxtPtr(n_vctxt, 0);
35015         filename = gen_filepath(n_filename, 1);
35016 
35017         xmlSchemaValidateSetFilename(vctxt, filename);
35018         call_tests++;
35019         des_xmlSchemaValidCtxtPtr(n_vctxt, vctxt, 0);
35020         des_filepath(n_filename, filename, 1);
35021         xmlResetLastError();
35022         if (mem_base != xmlMemBlocks()) {
35023             printf("Leak of %d blocks found in xmlSchemaValidateSetFilename",
35024 	           xmlMemBlocks() - mem_base);
35025 	    test_ret++;
35026             printf(" %d", n_vctxt);
35027             printf(" %d", n_filename);
35028             printf("\n");
35029         }
35030     }
35031     }
35032     function_tests++;
35033 #endif
35034 
35035     return(test_ret);
35036 }
35037 
35038 
35039 static int
test_xmlSchemaValidateSetLocator(void)35040 test_xmlSchemaValidateSetLocator(void) {
35041     int test_ret = 0;
35042 
35043 
35044     /* missing type support */
35045     return(test_ret);
35046 }
35047 
35048 
35049 static int
test_xmlSchemaValidateStream(void)35050 test_xmlSchemaValidateStream(void) {
35051     int test_ret = 0;
35052 
35053 #if defined(LIBXML_SCHEMAS_ENABLED)
35054     int mem_base;
35055     int ret_val;
35056     xmlSchemaValidCtxtPtr ctxt; /* a schema validation context */
35057     int n_ctxt;
35058     xmlParserInputBufferPtr input; /* the input to use for reading the data */
35059     int n_input;
35060     xmlCharEncoding enc; /* an optional encoding information */
35061     int n_enc;
35062     xmlSAXHandlerPtr sax; /* a SAX handler for the resulting events */
35063     int n_sax;
35064     void * user_data; /* the context to provide to the SAX handler. */
35065     int n_user_data;
35066 
35067     for (n_ctxt = 0;n_ctxt < gen_nb_xmlSchemaValidCtxtPtr;n_ctxt++) {
35068     for (n_input = 0;n_input < gen_nb_xmlParserInputBufferPtr;n_input++) {
35069     for (n_enc = 0;n_enc < gen_nb_xmlCharEncoding;n_enc++) {
35070     for (n_sax = 0;n_sax < gen_nb_xmlSAXHandlerPtr;n_sax++) {
35071     for (n_user_data = 0;n_user_data < gen_nb_userdata;n_user_data++) {
35072         mem_base = xmlMemBlocks();
35073         ctxt = gen_xmlSchemaValidCtxtPtr(n_ctxt, 0);
35074         input = gen_xmlParserInputBufferPtr(n_input, 1);
35075         enc = gen_xmlCharEncoding(n_enc, 2);
35076         sax = gen_xmlSAXHandlerPtr(n_sax, 3);
35077         user_data = gen_userdata(n_user_data, 4);
35078 
35079         ret_val = xmlSchemaValidateStream(ctxt, input, enc, sax, user_data);
35080         desret_int(ret_val);
35081         call_tests++;
35082         des_xmlSchemaValidCtxtPtr(n_ctxt, ctxt, 0);
35083         des_xmlParserInputBufferPtr(n_input, input, 1);
35084         des_xmlCharEncoding(n_enc, enc, 2);
35085         des_xmlSAXHandlerPtr(n_sax, sax, 3);
35086         des_userdata(n_user_data, user_data, 4);
35087         xmlResetLastError();
35088         if (mem_base != xmlMemBlocks()) {
35089             printf("Leak of %d blocks found in xmlSchemaValidateStream",
35090 	           xmlMemBlocks() - mem_base);
35091 	    test_ret++;
35092             printf(" %d", n_ctxt);
35093             printf(" %d", n_input);
35094             printf(" %d", n_enc);
35095             printf(" %d", n_sax);
35096             printf(" %d", n_user_data);
35097             printf("\n");
35098         }
35099     }
35100     }
35101     }
35102     }
35103     }
35104     function_tests++;
35105 #endif
35106 
35107     return(test_ret);
35108 }
35109 
35110 static int
test_xmlschemas(void)35111 test_xmlschemas(void) {
35112     int test_ret = 0;
35113 
35114     if (quiet == 0) printf("Testing xmlschemas : 16 of 27 functions ...\n");
35115     test_ret += test_xmlSchemaDump();
35116     test_ret += test_xmlSchemaGetParserErrors();
35117     test_ret += test_xmlSchemaGetValidErrors();
35118     test_ret += test_xmlSchemaIsValid();
35119     test_ret += test_xmlSchemaNewDocParserCtxt();
35120     test_ret += test_xmlSchemaNewMemParserCtxt();
35121     test_ret += test_xmlSchemaNewParserCtxt();
35122     test_ret += test_xmlSchemaNewValidCtxt();
35123     test_ret += test_xmlSchemaParse();
35124     test_ret += test_xmlSchemaSAXPlug();
35125     test_ret += test_xmlSchemaSAXUnplug();
35126     test_ret += test_xmlSchemaSetParserErrors();
35127     test_ret += test_xmlSchemaSetParserStructuredErrors();
35128     test_ret += test_xmlSchemaSetValidErrors();
35129     test_ret += test_xmlSchemaSetValidOptions();
35130     test_ret += test_xmlSchemaSetValidStructuredErrors();
35131     test_ret += test_xmlSchemaValidCtxtGetOptions();
35132     test_ret += test_xmlSchemaValidCtxtGetParserCtxt();
35133     test_ret += test_xmlSchemaValidateDoc();
35134     test_ret += test_xmlSchemaValidateFile();
35135     test_ret += test_xmlSchemaValidateOneElement();
35136     test_ret += test_xmlSchemaValidateSetFilename();
35137     test_ret += test_xmlSchemaValidateSetLocator();
35138     test_ret += test_xmlSchemaValidateStream();
35139 
35140     if (test_ret != 0)
35141 	printf("Module xmlschemas: %d errors\n", test_ret);
35142     return(test_ret);
35143 }
35144 #ifdef LIBXML_SCHEMAS_ENABLED
35145 
35146 #define gen_nb_xmlSchemaFacetPtr 1
gen_xmlSchemaFacetPtr(int no ATTRIBUTE_UNUSED,int nr ATTRIBUTE_UNUSED)35147 static xmlSchemaFacetPtr gen_xmlSchemaFacetPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
35148     return(NULL);
35149 }
des_xmlSchemaFacetPtr(int no ATTRIBUTE_UNUSED,xmlSchemaFacetPtr val ATTRIBUTE_UNUSED,int nr ATTRIBUTE_UNUSED)35150 static void des_xmlSchemaFacetPtr(int no ATTRIBUTE_UNUSED, xmlSchemaFacetPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
35151 }
35152 #endif
35153 
35154 #ifdef LIBXML_SCHEMAS_ENABLED
35155 
35156 #define gen_nb_xmlSchemaTypePtr 1
gen_xmlSchemaTypePtr(int no ATTRIBUTE_UNUSED,int nr ATTRIBUTE_UNUSED)35157 static xmlSchemaTypePtr gen_xmlSchemaTypePtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
35158     return(NULL);
35159 }
des_xmlSchemaTypePtr(int no ATTRIBUTE_UNUSED,xmlSchemaTypePtr val ATTRIBUTE_UNUSED,int nr ATTRIBUTE_UNUSED)35160 static void des_xmlSchemaTypePtr(int no ATTRIBUTE_UNUSED, xmlSchemaTypePtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
35161 }
35162 #endif
35163 
35164 
35165 static int
test_xmlSchemaCheckFacet(void)35166 test_xmlSchemaCheckFacet(void) {
35167     int test_ret = 0;
35168 
35169 #if defined(LIBXML_SCHEMAS_ENABLED)
35170     int mem_base;
35171     int ret_val;
35172     xmlSchemaFacetPtr facet; /* the facet */
35173     int n_facet;
35174     xmlSchemaTypePtr typeDecl; /* the schema type definition */
35175     int n_typeDecl;
35176     xmlSchemaParserCtxtPtr pctxt; /* the schema parser context or NULL */
35177     int n_pctxt;
35178     xmlChar * name; /* the optional name of the type */
35179     int n_name;
35180 
35181     for (n_facet = 0;n_facet < gen_nb_xmlSchemaFacetPtr;n_facet++) {
35182     for (n_typeDecl = 0;n_typeDecl < gen_nb_xmlSchemaTypePtr;n_typeDecl++) {
35183     for (n_pctxt = 0;n_pctxt < gen_nb_xmlSchemaParserCtxtPtr;n_pctxt++) {
35184     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
35185         mem_base = xmlMemBlocks();
35186         facet = gen_xmlSchemaFacetPtr(n_facet, 0);
35187         typeDecl = gen_xmlSchemaTypePtr(n_typeDecl, 1);
35188         pctxt = gen_xmlSchemaParserCtxtPtr(n_pctxt, 2);
35189         name = gen_const_xmlChar_ptr(n_name, 3);
35190 
35191         ret_val = xmlSchemaCheckFacet(facet, typeDecl, pctxt, (const xmlChar *)name);
35192         desret_int(ret_val);
35193         call_tests++;
35194         des_xmlSchemaFacetPtr(n_facet, facet, 0);
35195         des_xmlSchemaTypePtr(n_typeDecl, typeDecl, 1);
35196         des_xmlSchemaParserCtxtPtr(n_pctxt, pctxt, 2);
35197         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 3);
35198         xmlResetLastError();
35199         if (mem_base != xmlMemBlocks()) {
35200             printf("Leak of %d blocks found in xmlSchemaCheckFacet",
35201 	           xmlMemBlocks() - mem_base);
35202 	    test_ret++;
35203             printf(" %d", n_facet);
35204             printf(" %d", n_typeDecl);
35205             printf(" %d", n_pctxt);
35206             printf(" %d", n_name);
35207             printf("\n");
35208         }
35209     }
35210     }
35211     }
35212     }
35213     function_tests++;
35214 #endif
35215 
35216     return(test_ret);
35217 }
35218 
35219 
35220 static int
test_xmlSchemaCleanupTypes(void)35221 test_xmlSchemaCleanupTypes(void) {
35222     int test_ret = 0;
35223 
35224 #if defined(LIBXML_SCHEMAS_ENABLED)
35225 
35226 
35227         xmlSchemaCleanupTypes();
35228         call_tests++;
35229         xmlResetLastError();
35230     function_tests++;
35231 #endif
35232 
35233     return(test_ret);
35234 }
35235 
35236 
35237 static int
test_xmlSchemaCollapseString(void)35238 test_xmlSchemaCollapseString(void) {
35239     int test_ret = 0;
35240 
35241 #if defined(LIBXML_SCHEMAS_ENABLED)
35242     int mem_base;
35243     xmlChar * ret_val;
35244     xmlChar * value; /* a value */
35245     int n_value;
35246 
35247     for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
35248         mem_base = xmlMemBlocks();
35249         value = gen_const_xmlChar_ptr(n_value, 0);
35250 
35251         ret_val = xmlSchemaCollapseString((const xmlChar *)value);
35252         desret_xmlChar_ptr(ret_val);
35253         call_tests++;
35254         des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 0);
35255         xmlResetLastError();
35256         if (mem_base != xmlMemBlocks()) {
35257             printf("Leak of %d blocks found in xmlSchemaCollapseString",
35258 	           xmlMemBlocks() - mem_base);
35259 	    test_ret++;
35260             printf(" %d", n_value);
35261             printf("\n");
35262         }
35263     }
35264     function_tests++;
35265 #endif
35266 
35267     return(test_ret);
35268 }
35269 
35270 #ifdef LIBXML_SCHEMAS_ENABLED
35271 
35272 #define gen_nb_xmlSchemaValPtr 1
gen_xmlSchemaValPtr(int no ATTRIBUTE_UNUSED,int nr ATTRIBUTE_UNUSED)35273 static xmlSchemaValPtr gen_xmlSchemaValPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
35274     return(NULL);
35275 }
des_xmlSchemaValPtr(int no ATTRIBUTE_UNUSED,xmlSchemaValPtr val ATTRIBUTE_UNUSED,int nr ATTRIBUTE_UNUSED)35276 static void des_xmlSchemaValPtr(int no ATTRIBUTE_UNUSED, xmlSchemaValPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
35277 }
35278 #endif
35279 
35280 
35281 static int
test_xmlSchemaCompareValues(void)35282 test_xmlSchemaCompareValues(void) {
35283     int test_ret = 0;
35284 
35285 #if defined(LIBXML_SCHEMAS_ENABLED)
35286     int mem_base;
35287     int ret_val;
35288     xmlSchemaValPtr x; /* a first value */
35289     int n_x;
35290     xmlSchemaValPtr y; /* a second value */
35291     int n_y;
35292 
35293     for (n_x = 0;n_x < gen_nb_xmlSchemaValPtr;n_x++) {
35294     for (n_y = 0;n_y < gen_nb_xmlSchemaValPtr;n_y++) {
35295         mem_base = xmlMemBlocks();
35296         x = gen_xmlSchemaValPtr(n_x, 0);
35297         y = gen_xmlSchemaValPtr(n_y, 1);
35298 
35299         ret_val = xmlSchemaCompareValues(x, y);
35300         desret_int(ret_val);
35301         call_tests++;
35302         des_xmlSchemaValPtr(n_x, x, 0);
35303         des_xmlSchemaValPtr(n_y, y, 1);
35304         xmlResetLastError();
35305         if (mem_base != xmlMemBlocks()) {
35306             printf("Leak of %d blocks found in xmlSchemaCompareValues",
35307 	           xmlMemBlocks() - mem_base);
35308 	    test_ret++;
35309             printf(" %d", n_x);
35310             printf(" %d", n_y);
35311             printf("\n");
35312         }
35313     }
35314     }
35315     function_tests++;
35316 #endif
35317 
35318     return(test_ret);
35319 }
35320 
35321 
35322 static int
test_xmlSchemaCompareValuesWhtsp(void)35323 test_xmlSchemaCompareValuesWhtsp(void) {
35324     int test_ret = 0;
35325 
35326 #if defined(LIBXML_SCHEMAS_ENABLED)
35327     int mem_base;
35328     int ret_val;
35329     xmlSchemaValPtr x; /* a first value */
35330     int n_x;
35331     xmlSchemaWhitespaceValueType xws; /* the whitespace value of x */
35332     int n_xws;
35333     xmlSchemaValPtr y; /* a second value */
35334     int n_y;
35335     xmlSchemaWhitespaceValueType yws; /* the whitespace value of y */
35336     int n_yws;
35337 
35338     for (n_x = 0;n_x < gen_nb_xmlSchemaValPtr;n_x++) {
35339     for (n_xws = 0;n_xws < gen_nb_xmlSchemaWhitespaceValueType;n_xws++) {
35340     for (n_y = 0;n_y < gen_nb_xmlSchemaValPtr;n_y++) {
35341     for (n_yws = 0;n_yws < gen_nb_xmlSchemaWhitespaceValueType;n_yws++) {
35342         mem_base = xmlMemBlocks();
35343         x = gen_xmlSchemaValPtr(n_x, 0);
35344         xws = gen_xmlSchemaWhitespaceValueType(n_xws, 1);
35345         y = gen_xmlSchemaValPtr(n_y, 2);
35346         yws = gen_xmlSchemaWhitespaceValueType(n_yws, 3);
35347 
35348         ret_val = xmlSchemaCompareValuesWhtsp(x, xws, y, yws);
35349         desret_int(ret_val);
35350         call_tests++;
35351         des_xmlSchemaValPtr(n_x, x, 0);
35352         des_xmlSchemaWhitespaceValueType(n_xws, xws, 1);
35353         des_xmlSchemaValPtr(n_y, y, 2);
35354         des_xmlSchemaWhitespaceValueType(n_yws, yws, 3);
35355         xmlResetLastError();
35356         if (mem_base != xmlMemBlocks()) {
35357             printf("Leak of %d blocks found in xmlSchemaCompareValuesWhtsp",
35358 	           xmlMemBlocks() - mem_base);
35359 	    test_ret++;
35360             printf(" %d", n_x);
35361             printf(" %d", n_xws);
35362             printf(" %d", n_y);
35363             printf(" %d", n_yws);
35364             printf("\n");
35365         }
35366     }
35367     }
35368     }
35369     }
35370     function_tests++;
35371 #endif
35372 
35373     return(test_ret);
35374 }
35375 
35376 
35377 static int
test_xmlSchemaCopyValue(void)35378 test_xmlSchemaCopyValue(void) {
35379     int test_ret = 0;
35380 
35381 
35382     /* missing type support */
35383     return(test_ret);
35384 }
35385 
35386 
35387 static int
test_xmlSchemaGetBuiltInListSimpleTypeItemType(void)35388 test_xmlSchemaGetBuiltInListSimpleTypeItemType(void) {
35389     int test_ret = 0;
35390 
35391 #if defined(LIBXML_SCHEMAS_ENABLED)
35392     int mem_base;
35393     xmlSchemaTypePtr ret_val;
35394     xmlSchemaTypePtr type; /* the built-in simple type. */
35395     int n_type;
35396 
35397     for (n_type = 0;n_type < gen_nb_xmlSchemaTypePtr;n_type++) {
35398         mem_base = xmlMemBlocks();
35399         type = gen_xmlSchemaTypePtr(n_type, 0);
35400 
35401         ret_val = xmlSchemaGetBuiltInListSimpleTypeItemType(type);
35402         desret_xmlSchemaTypePtr(ret_val);
35403         call_tests++;
35404         des_xmlSchemaTypePtr(n_type, type, 0);
35405         xmlResetLastError();
35406         if (mem_base != xmlMemBlocks()) {
35407             printf("Leak of %d blocks found in xmlSchemaGetBuiltInListSimpleTypeItemType",
35408 	           xmlMemBlocks() - mem_base);
35409 	    test_ret++;
35410             printf(" %d", n_type);
35411             printf("\n");
35412         }
35413     }
35414     function_tests++;
35415 #endif
35416 
35417     return(test_ret);
35418 }
35419 
35420 
35421 static int
test_xmlSchemaGetBuiltInType(void)35422 test_xmlSchemaGetBuiltInType(void) {
35423     int test_ret = 0;
35424 
35425 #if defined(LIBXML_SCHEMAS_ENABLED)
35426     xmlSchemaTypePtr ret_val;
35427     xmlSchemaValType type; /* the type of the built in type */
35428     int n_type;
35429 
35430     for (n_type = 0;n_type < gen_nb_xmlSchemaValType;n_type++) {
35431         type = gen_xmlSchemaValType(n_type, 0);
35432 
35433         ret_val = xmlSchemaGetBuiltInType(type);
35434         desret_xmlSchemaTypePtr(ret_val);
35435         call_tests++;
35436         des_xmlSchemaValType(n_type, type, 0);
35437         xmlResetLastError();
35438     }
35439     function_tests++;
35440 #endif
35441 
35442     return(test_ret);
35443 }
35444 
35445 
35446 static int
test_xmlSchemaGetCanonValue(void)35447 test_xmlSchemaGetCanonValue(void) {
35448     int test_ret = 0;
35449 
35450 #if defined(LIBXML_SCHEMAS_ENABLED)
35451     int mem_base;
35452     int ret_val;
35453     xmlSchemaValPtr val; /* the precomputed value */
35454     int n_val;
35455     xmlChar ** retValue; /* the returned value */
35456     int n_retValue;
35457 
35458     for (n_val = 0;n_val < gen_nb_xmlSchemaValPtr;n_val++) {
35459     for (n_retValue = 0;n_retValue < gen_nb_const_xmlChar_ptr_ptr;n_retValue++) {
35460         mem_base = xmlMemBlocks();
35461         val = gen_xmlSchemaValPtr(n_val, 0);
35462         retValue = gen_const_xmlChar_ptr_ptr(n_retValue, 1);
35463 
35464         ret_val = xmlSchemaGetCanonValue(val, (const xmlChar **)retValue);
35465         desret_int(ret_val);
35466         call_tests++;
35467         des_xmlSchemaValPtr(n_val, val, 0);
35468         des_const_xmlChar_ptr_ptr(n_retValue, (const xmlChar **)retValue, 1);
35469         xmlResetLastError();
35470         if (mem_base != xmlMemBlocks()) {
35471             printf("Leak of %d blocks found in xmlSchemaGetCanonValue",
35472 	           xmlMemBlocks() - mem_base);
35473 	    test_ret++;
35474             printf(" %d", n_val);
35475             printf(" %d", n_retValue);
35476             printf("\n");
35477         }
35478     }
35479     }
35480     function_tests++;
35481 #endif
35482 
35483     return(test_ret);
35484 }
35485 
35486 
35487 static int
test_xmlSchemaGetCanonValueWhtsp(void)35488 test_xmlSchemaGetCanonValueWhtsp(void) {
35489     int test_ret = 0;
35490 
35491 #if defined(LIBXML_SCHEMAS_ENABLED)
35492     int mem_base;
35493     int ret_val;
35494     xmlSchemaValPtr val; /* the precomputed value */
35495     int n_val;
35496     xmlChar ** retValue; /* the returned value */
35497     int n_retValue;
35498     xmlSchemaWhitespaceValueType ws; /* the whitespace type of the value */
35499     int n_ws;
35500 
35501     for (n_val = 0;n_val < gen_nb_xmlSchemaValPtr;n_val++) {
35502     for (n_retValue = 0;n_retValue < gen_nb_const_xmlChar_ptr_ptr;n_retValue++) {
35503     for (n_ws = 0;n_ws < gen_nb_xmlSchemaWhitespaceValueType;n_ws++) {
35504         mem_base = xmlMemBlocks();
35505         val = gen_xmlSchemaValPtr(n_val, 0);
35506         retValue = gen_const_xmlChar_ptr_ptr(n_retValue, 1);
35507         ws = gen_xmlSchemaWhitespaceValueType(n_ws, 2);
35508 
35509         ret_val = xmlSchemaGetCanonValueWhtsp(val, (const xmlChar **)retValue, ws);
35510         desret_int(ret_val);
35511         call_tests++;
35512         des_xmlSchemaValPtr(n_val, val, 0);
35513         des_const_xmlChar_ptr_ptr(n_retValue, (const xmlChar **)retValue, 1);
35514         des_xmlSchemaWhitespaceValueType(n_ws, ws, 2);
35515         xmlResetLastError();
35516         if (mem_base != xmlMemBlocks()) {
35517             printf("Leak of %d blocks found in xmlSchemaGetCanonValueWhtsp",
35518 	           xmlMemBlocks() - mem_base);
35519 	    test_ret++;
35520             printf(" %d", n_val);
35521             printf(" %d", n_retValue);
35522             printf(" %d", n_ws);
35523             printf("\n");
35524         }
35525     }
35526     }
35527     }
35528     function_tests++;
35529 #endif
35530 
35531     return(test_ret);
35532 }
35533 
35534 
35535 static int
test_xmlSchemaGetFacetValueAsULong(void)35536 test_xmlSchemaGetFacetValueAsULong(void) {
35537     int test_ret = 0;
35538 
35539 #if defined(LIBXML_SCHEMAS_ENABLED)
35540     int mem_base;
35541     unsigned long ret_val;
35542     xmlSchemaFacetPtr facet; /* an schemas type facet */
35543     int n_facet;
35544 
35545     for (n_facet = 0;n_facet < gen_nb_xmlSchemaFacetPtr;n_facet++) {
35546         mem_base = xmlMemBlocks();
35547         facet = gen_xmlSchemaFacetPtr(n_facet, 0);
35548 
35549         ret_val = xmlSchemaGetFacetValueAsULong(facet);
35550         desret_unsigned_long(ret_val);
35551         call_tests++;
35552         des_xmlSchemaFacetPtr(n_facet, facet, 0);
35553         xmlResetLastError();
35554         if (mem_base != xmlMemBlocks()) {
35555             printf("Leak of %d blocks found in xmlSchemaGetFacetValueAsULong",
35556 	           xmlMemBlocks() - mem_base);
35557 	    test_ret++;
35558             printf(" %d", n_facet);
35559             printf("\n");
35560         }
35561     }
35562     function_tests++;
35563 #endif
35564 
35565     return(test_ret);
35566 }
35567 
35568 
35569 static int
test_xmlSchemaGetPredefinedType(void)35570 test_xmlSchemaGetPredefinedType(void) {
35571     int test_ret = 0;
35572 
35573 #if defined(LIBXML_SCHEMAS_ENABLED)
35574     int mem_base;
35575     xmlSchemaTypePtr ret_val;
35576     xmlChar * name; /* the type name */
35577     int n_name;
35578     xmlChar * ns; /* the URI of the namespace usually "http://www.w3.org/2001/XMLSchema" */
35579     int n_ns;
35580 
35581     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
35582     for (n_ns = 0;n_ns < gen_nb_const_xmlChar_ptr;n_ns++) {
35583         mem_base = xmlMemBlocks();
35584         name = gen_const_xmlChar_ptr(n_name, 0);
35585         ns = gen_const_xmlChar_ptr(n_ns, 1);
35586 
35587         ret_val = xmlSchemaGetPredefinedType((const xmlChar *)name, (const xmlChar *)ns);
35588         desret_xmlSchemaTypePtr(ret_val);
35589         call_tests++;
35590         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 0);
35591         des_const_xmlChar_ptr(n_ns, (const xmlChar *)ns, 1);
35592         xmlResetLastError();
35593         if (mem_base != xmlMemBlocks()) {
35594             printf("Leak of %d blocks found in xmlSchemaGetPredefinedType",
35595 	           xmlMemBlocks() - mem_base);
35596 	    test_ret++;
35597             printf(" %d", n_name);
35598             printf(" %d", n_ns);
35599             printf("\n");
35600         }
35601     }
35602     }
35603     function_tests++;
35604 #endif
35605 
35606     return(test_ret);
35607 }
35608 
35609 
35610 static int
test_xmlSchemaGetValType(void)35611 test_xmlSchemaGetValType(void) {
35612     int test_ret = 0;
35613 
35614 #if defined(LIBXML_SCHEMAS_ENABLED)
35615     int mem_base;
35616     xmlSchemaValType ret_val;
35617     xmlSchemaValPtr val; /* a schemas value */
35618     int n_val;
35619 
35620     for (n_val = 0;n_val < gen_nb_xmlSchemaValPtr;n_val++) {
35621         mem_base = xmlMemBlocks();
35622         val = gen_xmlSchemaValPtr(n_val, 0);
35623 
35624         ret_val = xmlSchemaGetValType(val);
35625         desret_xmlSchemaValType(ret_val);
35626         call_tests++;
35627         des_xmlSchemaValPtr(n_val, val, 0);
35628         xmlResetLastError();
35629         if (mem_base != xmlMemBlocks()) {
35630             printf("Leak of %d blocks found in xmlSchemaGetValType",
35631 	           xmlMemBlocks() - mem_base);
35632 	    test_ret++;
35633             printf(" %d", n_val);
35634             printf("\n");
35635         }
35636     }
35637     function_tests++;
35638 #endif
35639 
35640     return(test_ret);
35641 }
35642 
35643 
35644 static int
test_xmlSchemaInitTypes(void)35645 test_xmlSchemaInitTypes(void) {
35646     int test_ret = 0;
35647 
35648 #if defined(LIBXML_SCHEMAS_ENABLED)
35649 
35650 
35651         xmlSchemaInitTypes();
35652         call_tests++;
35653         xmlResetLastError();
35654     function_tests++;
35655 #endif
35656 
35657     return(test_ret);
35658 }
35659 
35660 
35661 static int
test_xmlSchemaIsBuiltInTypeFacet(void)35662 test_xmlSchemaIsBuiltInTypeFacet(void) {
35663     int test_ret = 0;
35664 
35665 #if defined(LIBXML_SCHEMAS_ENABLED)
35666     int mem_base;
35667     int ret_val;
35668     xmlSchemaTypePtr type; /* the built-in type */
35669     int n_type;
35670     int facetType; /* the facet type */
35671     int n_facetType;
35672 
35673     for (n_type = 0;n_type < gen_nb_xmlSchemaTypePtr;n_type++) {
35674     for (n_facetType = 0;n_facetType < gen_nb_int;n_facetType++) {
35675         mem_base = xmlMemBlocks();
35676         type = gen_xmlSchemaTypePtr(n_type, 0);
35677         facetType = gen_int(n_facetType, 1);
35678 
35679         ret_val = xmlSchemaIsBuiltInTypeFacet(type, facetType);
35680         desret_int(ret_val);
35681         call_tests++;
35682         des_xmlSchemaTypePtr(n_type, type, 0);
35683         des_int(n_facetType, facetType, 1);
35684         xmlResetLastError();
35685         if (mem_base != xmlMemBlocks()) {
35686             printf("Leak of %d blocks found in xmlSchemaIsBuiltInTypeFacet",
35687 	           xmlMemBlocks() - mem_base);
35688 	    test_ret++;
35689             printf(" %d", n_type);
35690             printf(" %d", n_facetType);
35691             printf("\n");
35692         }
35693     }
35694     }
35695     function_tests++;
35696 #endif
35697 
35698     return(test_ret);
35699 }
35700 
35701 
35702 static int
test_xmlSchemaNewFacet(void)35703 test_xmlSchemaNewFacet(void) {
35704     int test_ret = 0;
35705 
35706 
35707     /* missing type support */
35708     return(test_ret);
35709 }
35710 
35711 
35712 static int
test_xmlSchemaNewNOTATIONValue(void)35713 test_xmlSchemaNewNOTATIONValue(void) {
35714     int test_ret = 0;
35715 
35716 
35717     /* missing type support */
35718     return(test_ret);
35719 }
35720 
35721 
35722 static int
test_xmlSchemaNewQNameValue(void)35723 test_xmlSchemaNewQNameValue(void) {
35724     int test_ret = 0;
35725 
35726 
35727     /* missing type support */
35728     return(test_ret);
35729 }
35730 
35731 
35732 static int
test_xmlSchemaNewStringValue(void)35733 test_xmlSchemaNewStringValue(void) {
35734     int test_ret = 0;
35735 
35736 
35737     /* missing type support */
35738     return(test_ret);
35739 }
35740 
35741 #ifdef LIBXML_SCHEMAS_ENABLED
35742 
35743 #define gen_nb_xmlSchemaValPtr_ptr 1
gen_xmlSchemaValPtr_ptr(int no ATTRIBUTE_UNUSED,int nr ATTRIBUTE_UNUSED)35744 static xmlSchemaValPtr * gen_xmlSchemaValPtr_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
35745     return(NULL);
35746 }
des_xmlSchemaValPtr_ptr(int no ATTRIBUTE_UNUSED,xmlSchemaValPtr * val ATTRIBUTE_UNUSED,int nr ATTRIBUTE_UNUSED)35747 static void des_xmlSchemaValPtr_ptr(int no ATTRIBUTE_UNUSED, xmlSchemaValPtr * val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
35748 }
35749 #endif
35750 
35751 
35752 static int
test_xmlSchemaValPredefTypeNode(void)35753 test_xmlSchemaValPredefTypeNode(void) {
35754     int test_ret = 0;
35755 
35756 #if defined(LIBXML_SCHEMAS_ENABLED)
35757     int mem_base;
35758     int ret_val;
35759     xmlSchemaTypePtr type; /* the predefined type */
35760     int n_type;
35761     xmlChar * value; /* the value to check */
35762     int n_value;
35763     xmlSchemaValPtr * val; /* the return computed value */
35764     int n_val;
35765     xmlNodePtr node; /* the node containing the value */
35766     int n_node;
35767 
35768     for (n_type = 0;n_type < gen_nb_xmlSchemaTypePtr;n_type++) {
35769     for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
35770     for (n_val = 0;n_val < gen_nb_xmlSchemaValPtr_ptr;n_val++) {
35771     for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
35772         mem_base = xmlMemBlocks();
35773         type = gen_xmlSchemaTypePtr(n_type, 0);
35774         value = gen_const_xmlChar_ptr(n_value, 1);
35775         val = gen_xmlSchemaValPtr_ptr(n_val, 2);
35776         node = gen_xmlNodePtr(n_node, 3);
35777 
35778         ret_val = xmlSchemaValPredefTypeNode(type, (const xmlChar *)value, val, node);
35779         desret_int(ret_val);
35780         call_tests++;
35781         des_xmlSchemaTypePtr(n_type, type, 0);
35782         des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 1);
35783         des_xmlSchemaValPtr_ptr(n_val, val, 2);
35784         des_xmlNodePtr(n_node, node, 3);
35785         xmlResetLastError();
35786         if (mem_base != xmlMemBlocks()) {
35787             printf("Leak of %d blocks found in xmlSchemaValPredefTypeNode",
35788 	           xmlMemBlocks() - mem_base);
35789 	    test_ret++;
35790             printf(" %d", n_type);
35791             printf(" %d", n_value);
35792             printf(" %d", n_val);
35793             printf(" %d", n_node);
35794             printf("\n");
35795         }
35796     }
35797     }
35798     }
35799     }
35800     function_tests++;
35801 #endif
35802 
35803     return(test_ret);
35804 }
35805 
35806 
35807 static int
test_xmlSchemaValPredefTypeNodeNoNorm(void)35808 test_xmlSchemaValPredefTypeNodeNoNorm(void) {
35809     int test_ret = 0;
35810 
35811 #if defined(LIBXML_SCHEMAS_ENABLED)
35812     int mem_base;
35813     int ret_val;
35814     xmlSchemaTypePtr type; /* the predefined type */
35815     int n_type;
35816     xmlChar * value; /* the value to check */
35817     int n_value;
35818     xmlSchemaValPtr * val; /* the return computed value */
35819     int n_val;
35820     xmlNodePtr node; /* the node containing the value */
35821     int n_node;
35822 
35823     for (n_type = 0;n_type < gen_nb_xmlSchemaTypePtr;n_type++) {
35824     for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
35825     for (n_val = 0;n_val < gen_nb_xmlSchemaValPtr_ptr;n_val++) {
35826     for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
35827         mem_base = xmlMemBlocks();
35828         type = gen_xmlSchemaTypePtr(n_type, 0);
35829         value = gen_const_xmlChar_ptr(n_value, 1);
35830         val = gen_xmlSchemaValPtr_ptr(n_val, 2);
35831         node = gen_xmlNodePtr(n_node, 3);
35832 
35833         ret_val = xmlSchemaValPredefTypeNodeNoNorm(type, (const xmlChar *)value, val, node);
35834         desret_int(ret_val);
35835         call_tests++;
35836         des_xmlSchemaTypePtr(n_type, type, 0);
35837         des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 1);
35838         des_xmlSchemaValPtr_ptr(n_val, val, 2);
35839         des_xmlNodePtr(n_node, node, 3);
35840         xmlResetLastError();
35841         if (mem_base != xmlMemBlocks()) {
35842             printf("Leak of %d blocks found in xmlSchemaValPredefTypeNodeNoNorm",
35843 	           xmlMemBlocks() - mem_base);
35844 	    test_ret++;
35845             printf(" %d", n_type);
35846             printf(" %d", n_value);
35847             printf(" %d", n_val);
35848             printf(" %d", n_node);
35849             printf("\n");
35850         }
35851     }
35852     }
35853     }
35854     }
35855     function_tests++;
35856 #endif
35857 
35858     return(test_ret);
35859 }
35860 
35861 
35862 static int
test_xmlSchemaValidateFacet(void)35863 test_xmlSchemaValidateFacet(void) {
35864     int test_ret = 0;
35865 
35866 #if defined(LIBXML_SCHEMAS_ENABLED)
35867     int mem_base;
35868     int ret_val;
35869     xmlSchemaTypePtr base; /* the base type */
35870     int n_base;
35871     xmlSchemaFacetPtr facet; /* the facet to check */
35872     int n_facet;
35873     xmlChar * value; /* the lexical repr of the value to validate */
35874     int n_value;
35875     xmlSchemaValPtr val; /* the precomputed value */
35876     int n_val;
35877 
35878     for (n_base = 0;n_base < gen_nb_xmlSchemaTypePtr;n_base++) {
35879     for (n_facet = 0;n_facet < gen_nb_xmlSchemaFacetPtr;n_facet++) {
35880     for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
35881     for (n_val = 0;n_val < gen_nb_xmlSchemaValPtr;n_val++) {
35882         mem_base = xmlMemBlocks();
35883         base = gen_xmlSchemaTypePtr(n_base, 0);
35884         facet = gen_xmlSchemaFacetPtr(n_facet, 1);
35885         value = gen_const_xmlChar_ptr(n_value, 2);
35886         val = gen_xmlSchemaValPtr(n_val, 3);
35887 
35888         ret_val = xmlSchemaValidateFacet(base, facet, (const xmlChar *)value, val);
35889         desret_int(ret_val);
35890         call_tests++;
35891         des_xmlSchemaTypePtr(n_base, base, 0);
35892         des_xmlSchemaFacetPtr(n_facet, facet, 1);
35893         des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 2);
35894         des_xmlSchemaValPtr(n_val, val, 3);
35895         xmlResetLastError();
35896         if (mem_base != xmlMemBlocks()) {
35897             printf("Leak of %d blocks found in xmlSchemaValidateFacet",
35898 	           xmlMemBlocks() - mem_base);
35899 	    test_ret++;
35900             printf(" %d", n_base);
35901             printf(" %d", n_facet);
35902             printf(" %d", n_value);
35903             printf(" %d", n_val);
35904             printf("\n");
35905         }
35906     }
35907     }
35908     }
35909     }
35910     function_tests++;
35911 #endif
35912 
35913     return(test_ret);
35914 }
35915 
35916 
35917 static int
test_xmlSchemaValidateFacetWhtsp(void)35918 test_xmlSchemaValidateFacetWhtsp(void) {
35919     int test_ret = 0;
35920 
35921 #if defined(LIBXML_SCHEMAS_ENABLED)
35922     int mem_base;
35923     int ret_val;
35924     xmlSchemaFacetPtr facet; /* the facet to check */
35925     int n_facet;
35926     xmlSchemaWhitespaceValueType fws; /* the whitespace type of the facet's value */
35927     int n_fws;
35928     xmlSchemaValType valType; /* the built-in type of the value */
35929     int n_valType;
35930     xmlChar * value; /* the lexical (or normalized for pattern) repr of the value to validate */
35931     int n_value;
35932     xmlSchemaValPtr val; /* the precomputed value */
35933     int n_val;
35934     xmlSchemaWhitespaceValueType ws; /* the whitespace type of the value */
35935     int n_ws;
35936 
35937     for (n_facet = 0;n_facet < gen_nb_xmlSchemaFacetPtr;n_facet++) {
35938     for (n_fws = 0;n_fws < gen_nb_xmlSchemaWhitespaceValueType;n_fws++) {
35939     for (n_valType = 0;n_valType < gen_nb_xmlSchemaValType;n_valType++) {
35940     for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
35941     for (n_val = 0;n_val < gen_nb_xmlSchemaValPtr;n_val++) {
35942     for (n_ws = 0;n_ws < gen_nb_xmlSchemaWhitespaceValueType;n_ws++) {
35943         mem_base = xmlMemBlocks();
35944         facet = gen_xmlSchemaFacetPtr(n_facet, 0);
35945         fws = gen_xmlSchemaWhitespaceValueType(n_fws, 1);
35946         valType = gen_xmlSchemaValType(n_valType, 2);
35947         value = gen_const_xmlChar_ptr(n_value, 3);
35948         val = gen_xmlSchemaValPtr(n_val, 4);
35949         ws = gen_xmlSchemaWhitespaceValueType(n_ws, 5);
35950 
35951         ret_val = xmlSchemaValidateFacetWhtsp(facet, fws, valType, (const xmlChar *)value, val, ws);
35952         desret_int(ret_val);
35953         call_tests++;
35954         des_xmlSchemaFacetPtr(n_facet, facet, 0);
35955         des_xmlSchemaWhitespaceValueType(n_fws, fws, 1);
35956         des_xmlSchemaValType(n_valType, valType, 2);
35957         des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 3);
35958         des_xmlSchemaValPtr(n_val, val, 4);
35959         des_xmlSchemaWhitespaceValueType(n_ws, ws, 5);
35960         xmlResetLastError();
35961         if (mem_base != xmlMemBlocks()) {
35962             printf("Leak of %d blocks found in xmlSchemaValidateFacetWhtsp",
35963 	           xmlMemBlocks() - mem_base);
35964 	    test_ret++;
35965             printf(" %d", n_facet);
35966             printf(" %d", n_fws);
35967             printf(" %d", n_valType);
35968             printf(" %d", n_value);
35969             printf(" %d", n_val);
35970             printf(" %d", n_ws);
35971             printf("\n");
35972         }
35973     }
35974     }
35975     }
35976     }
35977     }
35978     }
35979     function_tests++;
35980 #endif
35981 
35982     return(test_ret);
35983 }
35984 
35985 
35986 static int
test_xmlSchemaValidateLengthFacet(void)35987 test_xmlSchemaValidateLengthFacet(void) {
35988     int test_ret = 0;
35989 
35990 #if defined(LIBXML_SCHEMAS_ENABLED)
35991     int mem_base;
35992     int ret_val;
35993     xmlSchemaTypePtr type; /* the built-in type */
35994     int n_type;
35995     xmlSchemaFacetPtr facet; /* the facet to check */
35996     int n_facet;
35997     xmlChar * value; /* the lexical repr. of the value to be validated */
35998     int n_value;
35999     xmlSchemaValPtr val; /* the precomputed value */
36000     int n_val;
36001     unsigned long * length; /* the actual length of the value */
36002     int n_length;
36003 
36004     for (n_type = 0;n_type < gen_nb_xmlSchemaTypePtr;n_type++) {
36005     for (n_facet = 0;n_facet < gen_nb_xmlSchemaFacetPtr;n_facet++) {
36006     for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
36007     for (n_val = 0;n_val < gen_nb_xmlSchemaValPtr;n_val++) {
36008     for (n_length = 0;n_length < gen_nb_unsigned_long_ptr;n_length++) {
36009         mem_base = xmlMemBlocks();
36010         type = gen_xmlSchemaTypePtr(n_type, 0);
36011         facet = gen_xmlSchemaFacetPtr(n_facet, 1);
36012         value = gen_const_xmlChar_ptr(n_value, 2);
36013         val = gen_xmlSchemaValPtr(n_val, 3);
36014         length = gen_unsigned_long_ptr(n_length, 4);
36015 
36016         ret_val = xmlSchemaValidateLengthFacet(type, facet, (const xmlChar *)value, val, length);
36017         desret_int(ret_val);
36018         call_tests++;
36019         des_xmlSchemaTypePtr(n_type, type, 0);
36020         des_xmlSchemaFacetPtr(n_facet, facet, 1);
36021         des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 2);
36022         des_xmlSchemaValPtr(n_val, val, 3);
36023         des_unsigned_long_ptr(n_length, length, 4);
36024         xmlResetLastError();
36025         if (mem_base != xmlMemBlocks()) {
36026             printf("Leak of %d blocks found in xmlSchemaValidateLengthFacet",
36027 	           xmlMemBlocks() - mem_base);
36028 	    test_ret++;
36029             printf(" %d", n_type);
36030             printf(" %d", n_facet);
36031             printf(" %d", n_value);
36032             printf(" %d", n_val);
36033             printf(" %d", n_length);
36034             printf("\n");
36035         }
36036     }
36037     }
36038     }
36039     }
36040     }
36041     function_tests++;
36042 #endif
36043 
36044     return(test_ret);
36045 }
36046 
36047 
36048 static int
test_xmlSchemaValidateLengthFacetWhtsp(void)36049 test_xmlSchemaValidateLengthFacetWhtsp(void) {
36050     int test_ret = 0;
36051 
36052 #if defined(LIBXML_SCHEMAS_ENABLED)
36053     int mem_base;
36054     int ret_val;
36055     xmlSchemaFacetPtr facet; /* the facet to check */
36056     int n_facet;
36057     xmlSchemaValType valType; /* the built-in type */
36058     int n_valType;
36059     xmlChar * value; /* the lexical repr. of the value to be validated */
36060     int n_value;
36061     xmlSchemaValPtr val; /* the precomputed value */
36062     int n_val;
36063     unsigned long * length; /* the actual length of the value */
36064     int n_length;
36065     xmlSchemaWhitespaceValueType ws; /* the whitespace type of the value */
36066     int n_ws;
36067 
36068     for (n_facet = 0;n_facet < gen_nb_xmlSchemaFacetPtr;n_facet++) {
36069     for (n_valType = 0;n_valType < gen_nb_xmlSchemaValType;n_valType++) {
36070     for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
36071     for (n_val = 0;n_val < gen_nb_xmlSchemaValPtr;n_val++) {
36072     for (n_length = 0;n_length < gen_nb_unsigned_long_ptr;n_length++) {
36073     for (n_ws = 0;n_ws < gen_nb_xmlSchemaWhitespaceValueType;n_ws++) {
36074         mem_base = xmlMemBlocks();
36075         facet = gen_xmlSchemaFacetPtr(n_facet, 0);
36076         valType = gen_xmlSchemaValType(n_valType, 1);
36077         value = gen_const_xmlChar_ptr(n_value, 2);
36078         val = gen_xmlSchemaValPtr(n_val, 3);
36079         length = gen_unsigned_long_ptr(n_length, 4);
36080         ws = gen_xmlSchemaWhitespaceValueType(n_ws, 5);
36081 
36082         ret_val = xmlSchemaValidateLengthFacetWhtsp(facet, valType, (const xmlChar *)value, val, length, ws);
36083         desret_int(ret_val);
36084         call_tests++;
36085         des_xmlSchemaFacetPtr(n_facet, facet, 0);
36086         des_xmlSchemaValType(n_valType, valType, 1);
36087         des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 2);
36088         des_xmlSchemaValPtr(n_val, val, 3);
36089         des_unsigned_long_ptr(n_length, length, 4);
36090         des_xmlSchemaWhitespaceValueType(n_ws, ws, 5);
36091         xmlResetLastError();
36092         if (mem_base != xmlMemBlocks()) {
36093             printf("Leak of %d blocks found in xmlSchemaValidateLengthFacetWhtsp",
36094 	           xmlMemBlocks() - mem_base);
36095 	    test_ret++;
36096             printf(" %d", n_facet);
36097             printf(" %d", n_valType);
36098             printf(" %d", n_value);
36099             printf(" %d", n_val);
36100             printf(" %d", n_length);
36101             printf(" %d", n_ws);
36102             printf("\n");
36103         }
36104     }
36105     }
36106     }
36107     }
36108     }
36109     }
36110     function_tests++;
36111 #endif
36112 
36113     return(test_ret);
36114 }
36115 
36116 
36117 static int
test_xmlSchemaValidateListSimpleTypeFacet(void)36118 test_xmlSchemaValidateListSimpleTypeFacet(void) {
36119     int test_ret = 0;
36120 
36121 #if defined(LIBXML_SCHEMAS_ENABLED)
36122     int mem_base;
36123     int ret_val;
36124     xmlSchemaFacetPtr facet; /* the facet to check */
36125     int n_facet;
36126     xmlChar * value; /* the lexical repr of the value to validate */
36127     int n_value;
36128     unsigned long actualLen; /* the number of list items */
36129     int n_actualLen;
36130     unsigned long * expectedLen; /* the resulting expected number of list items */
36131     int n_expectedLen;
36132 
36133     for (n_facet = 0;n_facet < gen_nb_xmlSchemaFacetPtr;n_facet++) {
36134     for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
36135     for (n_actualLen = 0;n_actualLen < gen_nb_unsigned_long;n_actualLen++) {
36136     for (n_expectedLen = 0;n_expectedLen < gen_nb_unsigned_long_ptr;n_expectedLen++) {
36137         mem_base = xmlMemBlocks();
36138         facet = gen_xmlSchemaFacetPtr(n_facet, 0);
36139         value = gen_const_xmlChar_ptr(n_value, 1);
36140         actualLen = gen_unsigned_long(n_actualLen, 2);
36141         expectedLen = gen_unsigned_long_ptr(n_expectedLen, 3);
36142 
36143         ret_val = xmlSchemaValidateListSimpleTypeFacet(facet, (const xmlChar *)value, actualLen, expectedLen);
36144         desret_int(ret_val);
36145         call_tests++;
36146         des_xmlSchemaFacetPtr(n_facet, facet, 0);
36147         des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 1);
36148         des_unsigned_long(n_actualLen, actualLen, 2);
36149         des_unsigned_long_ptr(n_expectedLen, expectedLen, 3);
36150         xmlResetLastError();
36151         if (mem_base != xmlMemBlocks()) {
36152             printf("Leak of %d blocks found in xmlSchemaValidateListSimpleTypeFacet",
36153 	           xmlMemBlocks() - mem_base);
36154 	    test_ret++;
36155             printf(" %d", n_facet);
36156             printf(" %d", n_value);
36157             printf(" %d", n_actualLen);
36158             printf(" %d", n_expectedLen);
36159             printf("\n");
36160         }
36161     }
36162     }
36163     }
36164     }
36165     function_tests++;
36166 #endif
36167 
36168     return(test_ret);
36169 }
36170 
36171 
36172 static int
test_xmlSchemaValidatePredefinedType(void)36173 test_xmlSchemaValidatePredefinedType(void) {
36174     int test_ret = 0;
36175 
36176 #if defined(LIBXML_SCHEMAS_ENABLED)
36177     int mem_base;
36178     int ret_val;
36179     xmlSchemaTypePtr type; /* the predefined type */
36180     int n_type;
36181     xmlChar * value; /* the value to check */
36182     int n_value;
36183     xmlSchemaValPtr * val; /* the return computed value */
36184     int n_val;
36185 
36186     for (n_type = 0;n_type < gen_nb_xmlSchemaTypePtr;n_type++) {
36187     for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
36188     for (n_val = 0;n_val < gen_nb_xmlSchemaValPtr_ptr;n_val++) {
36189         mem_base = xmlMemBlocks();
36190         type = gen_xmlSchemaTypePtr(n_type, 0);
36191         value = gen_const_xmlChar_ptr(n_value, 1);
36192         val = gen_xmlSchemaValPtr_ptr(n_val, 2);
36193 
36194         ret_val = xmlSchemaValidatePredefinedType(type, (const xmlChar *)value, val);
36195         desret_int(ret_val);
36196         call_tests++;
36197         des_xmlSchemaTypePtr(n_type, type, 0);
36198         des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 1);
36199         des_xmlSchemaValPtr_ptr(n_val, val, 2);
36200         xmlResetLastError();
36201         if (mem_base != xmlMemBlocks()) {
36202             printf("Leak of %d blocks found in xmlSchemaValidatePredefinedType",
36203 	           xmlMemBlocks() - mem_base);
36204 	    test_ret++;
36205             printf(" %d", n_type);
36206             printf(" %d", n_value);
36207             printf(" %d", n_val);
36208             printf("\n");
36209         }
36210     }
36211     }
36212     }
36213     function_tests++;
36214 #endif
36215 
36216     return(test_ret);
36217 }
36218 
36219 
36220 static int
test_xmlSchemaValueAppend(void)36221 test_xmlSchemaValueAppend(void) {
36222     int test_ret = 0;
36223 
36224 #if defined(LIBXML_SCHEMAS_ENABLED)
36225     int mem_base;
36226     int ret_val;
36227     xmlSchemaValPtr prev; /* the value */
36228     int n_prev;
36229     xmlSchemaValPtr cur; /* the value to be appended */
36230     int n_cur;
36231 
36232     for (n_prev = 0;n_prev < gen_nb_xmlSchemaValPtr;n_prev++) {
36233     for (n_cur = 0;n_cur < gen_nb_xmlSchemaValPtr;n_cur++) {
36234         mem_base = xmlMemBlocks();
36235         prev = gen_xmlSchemaValPtr(n_prev, 0);
36236         cur = gen_xmlSchemaValPtr(n_cur, 1);
36237 
36238         ret_val = xmlSchemaValueAppend(prev, cur);
36239         desret_int(ret_val);
36240         call_tests++;
36241         des_xmlSchemaValPtr(n_prev, prev, 0);
36242         des_xmlSchemaValPtr(n_cur, cur, 1);
36243         xmlResetLastError();
36244         if (mem_base != xmlMemBlocks()) {
36245             printf("Leak of %d blocks found in xmlSchemaValueAppend",
36246 	           xmlMemBlocks() - mem_base);
36247 	    test_ret++;
36248             printf(" %d", n_prev);
36249             printf(" %d", n_cur);
36250             printf("\n");
36251         }
36252     }
36253     }
36254     function_tests++;
36255 #endif
36256 
36257     return(test_ret);
36258 }
36259 
36260 
36261 static int
test_xmlSchemaValueGetAsBoolean(void)36262 test_xmlSchemaValueGetAsBoolean(void) {
36263     int test_ret = 0;
36264 
36265 #if defined(LIBXML_SCHEMAS_ENABLED)
36266     int mem_base;
36267     int ret_val;
36268     xmlSchemaValPtr val; /* the value */
36269     int n_val;
36270 
36271     for (n_val = 0;n_val < gen_nb_xmlSchemaValPtr;n_val++) {
36272         mem_base = xmlMemBlocks();
36273         val = gen_xmlSchemaValPtr(n_val, 0);
36274 
36275         ret_val = xmlSchemaValueGetAsBoolean(val);
36276         desret_int(ret_val);
36277         call_tests++;
36278         des_xmlSchemaValPtr(n_val, val, 0);
36279         xmlResetLastError();
36280         if (mem_base != xmlMemBlocks()) {
36281             printf("Leak of %d blocks found in xmlSchemaValueGetAsBoolean",
36282 	           xmlMemBlocks() - mem_base);
36283 	    test_ret++;
36284             printf(" %d", n_val);
36285             printf("\n");
36286         }
36287     }
36288     function_tests++;
36289 #endif
36290 
36291     return(test_ret);
36292 }
36293 
36294 
36295 static int
test_xmlSchemaValueGetAsString(void)36296 test_xmlSchemaValueGetAsString(void) {
36297     int test_ret = 0;
36298 
36299 #if defined(LIBXML_SCHEMAS_ENABLED)
36300     int mem_base;
36301     const xmlChar * ret_val;
36302     xmlSchemaValPtr val; /* the value */
36303     int n_val;
36304 
36305     for (n_val = 0;n_val < gen_nb_xmlSchemaValPtr;n_val++) {
36306         mem_base = xmlMemBlocks();
36307         val = gen_xmlSchemaValPtr(n_val, 0);
36308 
36309         ret_val = xmlSchemaValueGetAsString(val);
36310         desret_const_xmlChar_ptr(ret_val);
36311         call_tests++;
36312         des_xmlSchemaValPtr(n_val, val, 0);
36313         xmlResetLastError();
36314         if (mem_base != xmlMemBlocks()) {
36315             printf("Leak of %d blocks found in xmlSchemaValueGetAsString",
36316 	           xmlMemBlocks() - mem_base);
36317 	    test_ret++;
36318             printf(" %d", n_val);
36319             printf("\n");
36320         }
36321     }
36322     function_tests++;
36323 #endif
36324 
36325     return(test_ret);
36326 }
36327 
36328 
36329 static int
test_xmlSchemaValueGetNext(void)36330 test_xmlSchemaValueGetNext(void) {
36331     int test_ret = 0;
36332 
36333 
36334     /* missing type support */
36335     return(test_ret);
36336 }
36337 
36338 
36339 static int
test_xmlSchemaWhiteSpaceReplace(void)36340 test_xmlSchemaWhiteSpaceReplace(void) {
36341     int test_ret = 0;
36342 
36343 #if defined(LIBXML_SCHEMAS_ENABLED)
36344     int mem_base;
36345     xmlChar * ret_val;
36346     xmlChar * value; /* a value */
36347     int n_value;
36348 
36349     for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
36350         mem_base = xmlMemBlocks();
36351         value = gen_const_xmlChar_ptr(n_value, 0);
36352 
36353         ret_val = xmlSchemaWhiteSpaceReplace((const xmlChar *)value);
36354         desret_xmlChar_ptr(ret_val);
36355         call_tests++;
36356         des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 0);
36357         xmlResetLastError();
36358         if (mem_base != xmlMemBlocks()) {
36359             printf("Leak of %d blocks found in xmlSchemaWhiteSpaceReplace",
36360 	           xmlMemBlocks() - mem_base);
36361 	    test_ret++;
36362             printf(" %d", n_value);
36363             printf("\n");
36364         }
36365     }
36366     function_tests++;
36367 #endif
36368 
36369     return(test_ret);
36370 }
36371 
36372 static int
test_xmlschemastypes(void)36373 test_xmlschemastypes(void) {
36374     int test_ret = 0;
36375 
36376     if (quiet == 0) printf("Testing xmlschemastypes : 26 of 34 functions ...\n");
36377     test_ret += test_xmlSchemaCheckFacet();
36378     test_ret += test_xmlSchemaCleanupTypes();
36379     test_ret += test_xmlSchemaCollapseString();
36380     test_ret += test_xmlSchemaCompareValues();
36381     test_ret += test_xmlSchemaCompareValuesWhtsp();
36382     test_ret += test_xmlSchemaCopyValue();
36383     test_ret += test_xmlSchemaGetBuiltInListSimpleTypeItemType();
36384     test_ret += test_xmlSchemaGetBuiltInType();
36385     test_ret += test_xmlSchemaGetCanonValue();
36386     test_ret += test_xmlSchemaGetCanonValueWhtsp();
36387     test_ret += test_xmlSchemaGetFacetValueAsULong();
36388     test_ret += test_xmlSchemaGetPredefinedType();
36389     test_ret += test_xmlSchemaGetValType();
36390     test_ret += test_xmlSchemaInitTypes();
36391     test_ret += test_xmlSchemaIsBuiltInTypeFacet();
36392     test_ret += test_xmlSchemaNewFacet();
36393     test_ret += test_xmlSchemaNewNOTATIONValue();
36394     test_ret += test_xmlSchemaNewQNameValue();
36395     test_ret += test_xmlSchemaNewStringValue();
36396     test_ret += test_xmlSchemaValPredefTypeNode();
36397     test_ret += test_xmlSchemaValPredefTypeNodeNoNorm();
36398     test_ret += test_xmlSchemaValidateFacet();
36399     test_ret += test_xmlSchemaValidateFacetWhtsp();
36400     test_ret += test_xmlSchemaValidateLengthFacet();
36401     test_ret += test_xmlSchemaValidateLengthFacetWhtsp();
36402     test_ret += test_xmlSchemaValidateListSimpleTypeFacet();
36403     test_ret += test_xmlSchemaValidatePredefinedType();
36404     test_ret += test_xmlSchemaValueAppend();
36405     test_ret += test_xmlSchemaValueGetAsBoolean();
36406     test_ret += test_xmlSchemaValueGetAsString();
36407     test_ret += test_xmlSchemaValueGetNext();
36408     test_ret += test_xmlSchemaWhiteSpaceReplace();
36409 
36410     if (test_ret != 0)
36411 	printf("Module xmlschemastypes: %d errors\n", test_ret);
36412     return(test_ret);
36413 }
36414 
36415 static int
test_xmlCharStrdup(void)36416 test_xmlCharStrdup(void) {
36417     int test_ret = 0;
36418 
36419     int mem_base;
36420     xmlChar * ret_val;
36421     char * cur; /* the input char * */
36422     int n_cur;
36423 
36424     for (n_cur = 0;n_cur < gen_nb_const_char_ptr;n_cur++) {
36425         mem_base = xmlMemBlocks();
36426         cur = gen_const_char_ptr(n_cur, 0);
36427 
36428         ret_val = xmlCharStrdup((const char *)cur);
36429         desret_xmlChar_ptr(ret_val);
36430         call_tests++;
36431         des_const_char_ptr(n_cur, (const char *)cur, 0);
36432         xmlResetLastError();
36433         if (mem_base != xmlMemBlocks()) {
36434             printf("Leak of %d blocks found in xmlCharStrdup",
36435 	           xmlMemBlocks() - mem_base);
36436 	    test_ret++;
36437             printf(" %d", n_cur);
36438             printf("\n");
36439         }
36440     }
36441     function_tests++;
36442 
36443     return(test_ret);
36444 }
36445 
36446 
36447 static int
test_xmlCharStrndup(void)36448 test_xmlCharStrndup(void) {
36449     int test_ret = 0;
36450 
36451     int mem_base;
36452     xmlChar * ret_val;
36453     char * cur; /* the input char * */
36454     int n_cur;
36455     int len; /* the len of @cur */
36456     int n_len;
36457 
36458     for (n_cur = 0;n_cur < gen_nb_const_char_ptr;n_cur++) {
36459     for (n_len = 0;n_len < gen_nb_int;n_len++) {
36460         mem_base = xmlMemBlocks();
36461         cur = gen_const_char_ptr(n_cur, 0);
36462         len = gen_int(n_len, 1);
36463         if ((cur != NULL) &&
36464             (len > (int) strlen((const char *) cur) + 1))
36465             continue;
36466 
36467         ret_val = xmlCharStrndup((const char *)cur, len);
36468         desret_xmlChar_ptr(ret_val);
36469         call_tests++;
36470         des_const_char_ptr(n_cur, (const char *)cur, 0);
36471         des_int(n_len, len, 1);
36472         xmlResetLastError();
36473         if (mem_base != xmlMemBlocks()) {
36474             printf("Leak of %d blocks found in xmlCharStrndup",
36475 	           xmlMemBlocks() - mem_base);
36476 	    test_ret++;
36477             printf(" %d", n_cur);
36478             printf(" %d", n_len);
36479             printf("\n");
36480         }
36481     }
36482     }
36483     function_tests++;
36484 
36485     return(test_ret);
36486 }
36487 
36488 
36489 static int
test_xmlCheckUTF8(void)36490 test_xmlCheckUTF8(void) {
36491     int test_ret = 0;
36492 
36493     int mem_base;
36494     int ret_val;
36495     unsigned char * utf; /* Pointer to putative UTF-8 encoded string. */
36496     int n_utf;
36497 
36498     for (n_utf = 0;n_utf < gen_nb_const_unsigned_char_ptr;n_utf++) {
36499         mem_base = xmlMemBlocks();
36500         utf = gen_const_unsigned_char_ptr(n_utf, 0);
36501 
36502         ret_val = xmlCheckUTF8((const unsigned char *)utf);
36503         desret_int(ret_val);
36504         call_tests++;
36505         des_const_unsigned_char_ptr(n_utf, (const unsigned char *)utf, 0);
36506         xmlResetLastError();
36507         if (mem_base != xmlMemBlocks()) {
36508             printf("Leak of %d blocks found in xmlCheckUTF8",
36509 	           xmlMemBlocks() - mem_base);
36510 	    test_ret++;
36511             printf(" %d", n_utf);
36512             printf("\n");
36513         }
36514     }
36515     function_tests++;
36516 
36517     return(test_ret);
36518 }
36519 
36520 
36521 static int
test_xmlGetUTF8Char(void)36522 test_xmlGetUTF8Char(void) {
36523     int test_ret = 0;
36524 
36525     int mem_base;
36526     int ret_val;
36527     unsigned char * utf; /* a sequence of UTF-8 encoded bytes */
36528     int n_utf;
36529     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. */
36530     int n_len;
36531 
36532     for (n_utf = 0;n_utf < gen_nb_const_unsigned_char_ptr;n_utf++) {
36533     for (n_len = 0;n_len < gen_nb_int_ptr;n_len++) {
36534         mem_base = xmlMemBlocks();
36535         utf = gen_const_unsigned_char_ptr(n_utf, 0);
36536         len = gen_int_ptr(n_len, 1);
36537 
36538         ret_val = xmlGetUTF8Char((const unsigned char *)utf, len);
36539         desret_int(ret_val);
36540         call_tests++;
36541         des_const_unsigned_char_ptr(n_utf, (const unsigned char *)utf, 0);
36542         des_int_ptr(n_len, len, 1);
36543         xmlResetLastError();
36544         if (mem_base != xmlMemBlocks()) {
36545             printf("Leak of %d blocks found in xmlGetUTF8Char",
36546 	           xmlMemBlocks() - mem_base);
36547 	    test_ret++;
36548             printf(" %d", n_utf);
36549             printf(" %d", n_len);
36550             printf("\n");
36551         }
36552     }
36553     }
36554     function_tests++;
36555 
36556     return(test_ret);
36557 }
36558 
36559 
36560 static int
test_xmlStrEqual(void)36561 test_xmlStrEqual(void) {
36562     int test_ret = 0;
36563 
36564     int mem_base;
36565     int ret_val;
36566     xmlChar * str1; /* the first xmlChar * */
36567     int n_str1;
36568     xmlChar * str2; /* the second xmlChar * */
36569     int n_str2;
36570 
36571     for (n_str1 = 0;n_str1 < gen_nb_const_xmlChar_ptr;n_str1++) {
36572     for (n_str2 = 0;n_str2 < gen_nb_const_xmlChar_ptr;n_str2++) {
36573         mem_base = xmlMemBlocks();
36574         str1 = gen_const_xmlChar_ptr(n_str1, 0);
36575         str2 = gen_const_xmlChar_ptr(n_str2, 1);
36576 
36577         ret_val = xmlStrEqual((const xmlChar *)str1, (const xmlChar *)str2);
36578         desret_int(ret_val);
36579         call_tests++;
36580         des_const_xmlChar_ptr(n_str1, (const xmlChar *)str1, 0);
36581         des_const_xmlChar_ptr(n_str2, (const xmlChar *)str2, 1);
36582         xmlResetLastError();
36583         if (mem_base != xmlMemBlocks()) {
36584             printf("Leak of %d blocks found in xmlStrEqual",
36585 	           xmlMemBlocks() - mem_base);
36586 	    test_ret++;
36587             printf(" %d", n_str1);
36588             printf(" %d", n_str2);
36589             printf("\n");
36590         }
36591     }
36592     }
36593     function_tests++;
36594 
36595     return(test_ret);
36596 }
36597 
36598 
36599 static int
test_xmlStrPrintf(void)36600 test_xmlStrPrintf(void) {
36601     int test_ret = 0;
36602 
36603 
36604     /* missing type support */
36605     return(test_ret);
36606 }
36607 
36608 
36609 static int
test_xmlStrQEqual(void)36610 test_xmlStrQEqual(void) {
36611     int test_ret = 0;
36612 
36613     int mem_base;
36614     int ret_val;
36615     xmlChar * pref; /* the prefix of the QName */
36616     int n_pref;
36617     xmlChar * name; /* the localname of the QName */
36618     int n_name;
36619     xmlChar * str; /* the second xmlChar * */
36620     int n_str;
36621 
36622     for (n_pref = 0;n_pref < gen_nb_const_xmlChar_ptr;n_pref++) {
36623     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
36624     for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) {
36625         mem_base = xmlMemBlocks();
36626         pref = gen_const_xmlChar_ptr(n_pref, 0);
36627         name = gen_const_xmlChar_ptr(n_name, 1);
36628         str = gen_const_xmlChar_ptr(n_str, 2);
36629 
36630         ret_val = xmlStrQEqual((const xmlChar *)pref, (const xmlChar *)name, (const xmlChar *)str);
36631         desret_int(ret_val);
36632         call_tests++;
36633         des_const_xmlChar_ptr(n_pref, (const xmlChar *)pref, 0);
36634         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
36635         des_const_xmlChar_ptr(n_str, (const xmlChar *)str, 2);
36636         xmlResetLastError();
36637         if (mem_base != xmlMemBlocks()) {
36638             printf("Leak of %d blocks found in xmlStrQEqual",
36639 	           xmlMemBlocks() - mem_base);
36640 	    test_ret++;
36641             printf(" %d", n_pref);
36642             printf(" %d", n_name);
36643             printf(" %d", n_str);
36644             printf("\n");
36645         }
36646     }
36647     }
36648     }
36649     function_tests++;
36650 
36651     return(test_ret);
36652 }
36653 
36654 
36655 static int
test_xmlStrVPrintf(void)36656 test_xmlStrVPrintf(void) {
36657     int test_ret = 0;
36658 
36659 
36660     /* missing type support */
36661     return(test_ret);
36662 }
36663 
36664 
36665 static int
test_xmlStrcasecmp(void)36666 test_xmlStrcasecmp(void) {
36667     int test_ret = 0;
36668 
36669     int mem_base;
36670     int ret_val;
36671     xmlChar * str1; /* the first xmlChar * */
36672     int n_str1;
36673     xmlChar * str2; /* the second xmlChar * */
36674     int n_str2;
36675 
36676     for (n_str1 = 0;n_str1 < gen_nb_const_xmlChar_ptr;n_str1++) {
36677     for (n_str2 = 0;n_str2 < gen_nb_const_xmlChar_ptr;n_str2++) {
36678         mem_base = xmlMemBlocks();
36679         str1 = gen_const_xmlChar_ptr(n_str1, 0);
36680         str2 = gen_const_xmlChar_ptr(n_str2, 1);
36681 
36682         ret_val = xmlStrcasecmp((const xmlChar *)str1, (const xmlChar *)str2);
36683         desret_int(ret_val);
36684         call_tests++;
36685         des_const_xmlChar_ptr(n_str1, (const xmlChar *)str1, 0);
36686         des_const_xmlChar_ptr(n_str2, (const xmlChar *)str2, 1);
36687         xmlResetLastError();
36688         if (mem_base != xmlMemBlocks()) {
36689             printf("Leak of %d blocks found in xmlStrcasecmp",
36690 	           xmlMemBlocks() - mem_base);
36691 	    test_ret++;
36692             printf(" %d", n_str1);
36693             printf(" %d", n_str2);
36694             printf("\n");
36695         }
36696     }
36697     }
36698     function_tests++;
36699 
36700     return(test_ret);
36701 }
36702 
36703 
36704 static int
test_xmlStrcasestr(void)36705 test_xmlStrcasestr(void) {
36706     int test_ret = 0;
36707 
36708     int mem_base;
36709     const xmlChar * ret_val;
36710     xmlChar * str; /* the xmlChar * array (haystack) */
36711     int n_str;
36712     xmlChar * val; /* the xmlChar to search (needle) */
36713     int n_val;
36714 
36715     for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) {
36716     for (n_val = 0;n_val < gen_nb_const_xmlChar_ptr;n_val++) {
36717         mem_base = xmlMemBlocks();
36718         str = gen_const_xmlChar_ptr(n_str, 0);
36719         val = gen_const_xmlChar_ptr(n_val, 1);
36720 
36721         ret_val = xmlStrcasestr((const xmlChar *)str, (const xmlChar *)val);
36722         desret_const_xmlChar_ptr(ret_val);
36723         call_tests++;
36724         des_const_xmlChar_ptr(n_str, (const xmlChar *)str, 0);
36725         des_const_xmlChar_ptr(n_val, (const xmlChar *)val, 1);
36726         xmlResetLastError();
36727         if (mem_base != xmlMemBlocks()) {
36728             printf("Leak of %d blocks found in xmlStrcasestr",
36729 	           xmlMemBlocks() - mem_base);
36730 	    test_ret++;
36731             printf(" %d", n_str);
36732             printf(" %d", n_val);
36733             printf("\n");
36734         }
36735     }
36736     }
36737     function_tests++;
36738 
36739     return(test_ret);
36740 }
36741 
36742 
36743 static int
test_xmlStrchr(void)36744 test_xmlStrchr(void) {
36745     int test_ret = 0;
36746 
36747     int mem_base;
36748     const xmlChar * ret_val;
36749     xmlChar * str; /* the xmlChar * array */
36750     int n_str;
36751     xmlChar val; /* the xmlChar to search */
36752     int n_val;
36753 
36754     for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) {
36755     for (n_val = 0;n_val < gen_nb_xmlChar;n_val++) {
36756         mem_base = xmlMemBlocks();
36757         str = gen_const_xmlChar_ptr(n_str, 0);
36758         val = gen_xmlChar(n_val, 1);
36759 
36760         ret_val = xmlStrchr((const xmlChar *)str, val);
36761         desret_const_xmlChar_ptr(ret_val);
36762         call_tests++;
36763         des_const_xmlChar_ptr(n_str, (const xmlChar *)str, 0);
36764         des_xmlChar(n_val, val, 1);
36765         xmlResetLastError();
36766         if (mem_base != xmlMemBlocks()) {
36767             printf("Leak of %d blocks found in xmlStrchr",
36768 	           xmlMemBlocks() - mem_base);
36769 	    test_ret++;
36770             printf(" %d", n_str);
36771             printf(" %d", n_val);
36772             printf("\n");
36773         }
36774     }
36775     }
36776     function_tests++;
36777 
36778     return(test_ret);
36779 }
36780 
36781 
36782 static int
test_xmlStrcmp(void)36783 test_xmlStrcmp(void) {
36784     int test_ret = 0;
36785 
36786     int mem_base;
36787     int ret_val;
36788     xmlChar * str1; /* the first xmlChar * */
36789     int n_str1;
36790     xmlChar * str2; /* the second xmlChar * */
36791     int n_str2;
36792 
36793     for (n_str1 = 0;n_str1 < gen_nb_const_xmlChar_ptr;n_str1++) {
36794     for (n_str2 = 0;n_str2 < gen_nb_const_xmlChar_ptr;n_str2++) {
36795         mem_base = xmlMemBlocks();
36796         str1 = gen_const_xmlChar_ptr(n_str1, 0);
36797         str2 = gen_const_xmlChar_ptr(n_str2, 1);
36798 
36799         ret_val = xmlStrcmp((const xmlChar *)str1, (const xmlChar *)str2);
36800         desret_int(ret_val);
36801         call_tests++;
36802         des_const_xmlChar_ptr(n_str1, (const xmlChar *)str1, 0);
36803         des_const_xmlChar_ptr(n_str2, (const xmlChar *)str2, 1);
36804         xmlResetLastError();
36805         if (mem_base != xmlMemBlocks()) {
36806             printf("Leak of %d blocks found in xmlStrcmp",
36807 	           xmlMemBlocks() - mem_base);
36808 	    test_ret++;
36809             printf(" %d", n_str1);
36810             printf(" %d", n_str2);
36811             printf("\n");
36812         }
36813     }
36814     }
36815     function_tests++;
36816 
36817     return(test_ret);
36818 }
36819 
36820 
36821 static int
test_xmlStrdup(void)36822 test_xmlStrdup(void) {
36823     int test_ret = 0;
36824 
36825     int mem_base;
36826     xmlChar * ret_val;
36827     xmlChar * cur; /* the input xmlChar * */
36828     int n_cur;
36829 
36830     for (n_cur = 0;n_cur < gen_nb_const_xmlChar_ptr;n_cur++) {
36831         mem_base = xmlMemBlocks();
36832         cur = gen_const_xmlChar_ptr(n_cur, 0);
36833 
36834         ret_val = xmlStrdup((const xmlChar *)cur);
36835         desret_xmlChar_ptr(ret_val);
36836         call_tests++;
36837         des_const_xmlChar_ptr(n_cur, (const xmlChar *)cur, 0);
36838         xmlResetLastError();
36839         if (mem_base != xmlMemBlocks()) {
36840             printf("Leak of %d blocks found in xmlStrdup",
36841 	           xmlMemBlocks() - mem_base);
36842 	    test_ret++;
36843             printf(" %d", n_cur);
36844             printf("\n");
36845         }
36846     }
36847     function_tests++;
36848 
36849     return(test_ret);
36850 }
36851 
36852 
36853 static int
test_xmlStrlen(void)36854 test_xmlStrlen(void) {
36855     int test_ret = 0;
36856 
36857     int mem_base;
36858     int ret_val;
36859     xmlChar * str; /* the xmlChar * array */
36860     int n_str;
36861 
36862     for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) {
36863         mem_base = xmlMemBlocks();
36864         str = gen_const_xmlChar_ptr(n_str, 0);
36865 
36866         ret_val = xmlStrlen((const xmlChar *)str);
36867         desret_int(ret_val);
36868         call_tests++;
36869         des_const_xmlChar_ptr(n_str, (const xmlChar *)str, 0);
36870         xmlResetLastError();
36871         if (mem_base != xmlMemBlocks()) {
36872             printf("Leak of %d blocks found in xmlStrlen",
36873 	           xmlMemBlocks() - mem_base);
36874 	    test_ret++;
36875             printf(" %d", n_str);
36876             printf("\n");
36877         }
36878     }
36879     function_tests++;
36880 
36881     return(test_ret);
36882 }
36883 
36884 
36885 static int
test_xmlStrncasecmp(void)36886 test_xmlStrncasecmp(void) {
36887     int test_ret = 0;
36888 
36889     int mem_base;
36890     int ret_val;
36891     xmlChar * str1; /* the first xmlChar * */
36892     int n_str1;
36893     xmlChar * str2; /* the second xmlChar * */
36894     int n_str2;
36895     int len; /* the max comparison length */
36896     int n_len;
36897 
36898     for (n_str1 = 0;n_str1 < gen_nb_const_xmlChar_ptr;n_str1++) {
36899     for (n_str2 = 0;n_str2 < gen_nb_const_xmlChar_ptr;n_str2++) {
36900     for (n_len = 0;n_len < gen_nb_int;n_len++) {
36901         mem_base = xmlMemBlocks();
36902         str1 = gen_const_xmlChar_ptr(n_str1, 0);
36903         str2 = gen_const_xmlChar_ptr(n_str2, 1);
36904         len = gen_int(n_len, 2);
36905         if ((str2 != NULL) &&
36906             (len > (int) strlen((const char *) str2) + 1))
36907             continue;
36908 
36909         ret_val = xmlStrncasecmp((const xmlChar *)str1, (const xmlChar *)str2, len);
36910         desret_int(ret_val);
36911         call_tests++;
36912         des_const_xmlChar_ptr(n_str1, (const xmlChar *)str1, 0);
36913         des_const_xmlChar_ptr(n_str2, (const xmlChar *)str2, 1);
36914         des_int(n_len, len, 2);
36915         xmlResetLastError();
36916         if (mem_base != xmlMemBlocks()) {
36917             printf("Leak of %d blocks found in xmlStrncasecmp",
36918 	           xmlMemBlocks() - mem_base);
36919 	    test_ret++;
36920             printf(" %d", n_str1);
36921             printf(" %d", n_str2);
36922             printf(" %d", n_len);
36923             printf("\n");
36924         }
36925     }
36926     }
36927     }
36928     function_tests++;
36929 
36930     return(test_ret);
36931 }
36932 
36933 
36934 static int
test_xmlStrncatNew(void)36935 test_xmlStrncatNew(void) {
36936     int test_ret = 0;
36937 
36938     int mem_base;
36939     xmlChar * ret_val;
36940     xmlChar * str1; /* first xmlChar string */
36941     int n_str1;
36942     xmlChar * str2; /* second xmlChar string */
36943     int n_str2;
36944     int len; /* the len of @str2 or < 0 */
36945     int n_len;
36946 
36947     for (n_str1 = 0;n_str1 < gen_nb_const_xmlChar_ptr;n_str1++) {
36948     for (n_str2 = 0;n_str2 < gen_nb_const_xmlChar_ptr;n_str2++) {
36949     for (n_len = 0;n_len < gen_nb_int;n_len++) {
36950         mem_base = xmlMemBlocks();
36951         str1 = gen_const_xmlChar_ptr(n_str1, 0);
36952         str2 = gen_const_xmlChar_ptr(n_str2, 1);
36953         len = gen_int(n_len, 2);
36954         if ((str2 != NULL) &&
36955             (len > (int) strlen((const char *) str2) + 1))
36956             continue;
36957 
36958         ret_val = xmlStrncatNew((const xmlChar *)str1, (const xmlChar *)str2, len);
36959         desret_xmlChar_ptr(ret_val);
36960         call_tests++;
36961         des_const_xmlChar_ptr(n_str1, (const xmlChar *)str1, 0);
36962         des_const_xmlChar_ptr(n_str2, (const xmlChar *)str2, 1);
36963         des_int(n_len, len, 2);
36964         xmlResetLastError();
36965         if (mem_base != xmlMemBlocks()) {
36966             printf("Leak of %d blocks found in xmlStrncatNew",
36967 	           xmlMemBlocks() - mem_base);
36968 	    test_ret++;
36969             printf(" %d", n_str1);
36970             printf(" %d", n_str2);
36971             printf(" %d", n_len);
36972             printf("\n");
36973         }
36974     }
36975     }
36976     }
36977     function_tests++;
36978 
36979     return(test_ret);
36980 }
36981 
36982 
36983 static int
test_xmlStrncmp(void)36984 test_xmlStrncmp(void) {
36985     int test_ret = 0;
36986 
36987     int mem_base;
36988     int ret_val;
36989     xmlChar * str1; /* the first xmlChar * */
36990     int n_str1;
36991     xmlChar * str2; /* the second xmlChar * */
36992     int n_str2;
36993     int len; /* the max comparison length */
36994     int n_len;
36995 
36996     for (n_str1 = 0;n_str1 < gen_nb_const_xmlChar_ptr;n_str1++) {
36997     for (n_str2 = 0;n_str2 < gen_nb_const_xmlChar_ptr;n_str2++) {
36998     for (n_len = 0;n_len < gen_nb_int;n_len++) {
36999         mem_base = xmlMemBlocks();
37000         str1 = gen_const_xmlChar_ptr(n_str1, 0);
37001         str2 = gen_const_xmlChar_ptr(n_str2, 1);
37002         len = gen_int(n_len, 2);
37003         if ((str2 != NULL) &&
37004             (len > (int) strlen((const char *) str2) + 1))
37005             continue;
37006 
37007         ret_val = xmlStrncmp((const xmlChar *)str1, (const xmlChar *)str2, len);
37008         desret_int(ret_val);
37009         call_tests++;
37010         des_const_xmlChar_ptr(n_str1, (const xmlChar *)str1, 0);
37011         des_const_xmlChar_ptr(n_str2, (const xmlChar *)str2, 1);
37012         des_int(n_len, len, 2);
37013         xmlResetLastError();
37014         if (mem_base != xmlMemBlocks()) {
37015             printf("Leak of %d blocks found in xmlStrncmp",
37016 	           xmlMemBlocks() - mem_base);
37017 	    test_ret++;
37018             printf(" %d", n_str1);
37019             printf(" %d", n_str2);
37020             printf(" %d", n_len);
37021             printf("\n");
37022         }
37023     }
37024     }
37025     }
37026     function_tests++;
37027 
37028     return(test_ret);
37029 }
37030 
37031 
37032 static int
test_xmlStrndup(void)37033 test_xmlStrndup(void) {
37034     int test_ret = 0;
37035 
37036     int mem_base;
37037     xmlChar * ret_val;
37038     xmlChar * cur; /* the input xmlChar * */
37039     int n_cur;
37040     int len; /* the len of @cur */
37041     int n_len;
37042 
37043     for (n_cur = 0;n_cur < gen_nb_const_xmlChar_ptr;n_cur++) {
37044     for (n_len = 0;n_len < gen_nb_int;n_len++) {
37045         mem_base = xmlMemBlocks();
37046         cur = gen_const_xmlChar_ptr(n_cur, 0);
37047         len = gen_int(n_len, 1);
37048         if ((cur != NULL) &&
37049             (len > (int) strlen((const char *) cur) + 1))
37050             continue;
37051 
37052         ret_val = xmlStrndup((const xmlChar *)cur, len);
37053         desret_xmlChar_ptr(ret_val);
37054         call_tests++;
37055         des_const_xmlChar_ptr(n_cur, (const xmlChar *)cur, 0);
37056         des_int(n_len, len, 1);
37057         xmlResetLastError();
37058         if (mem_base != xmlMemBlocks()) {
37059             printf("Leak of %d blocks found in xmlStrndup",
37060 	           xmlMemBlocks() - mem_base);
37061 	    test_ret++;
37062             printf(" %d", n_cur);
37063             printf(" %d", n_len);
37064             printf("\n");
37065         }
37066     }
37067     }
37068     function_tests++;
37069 
37070     return(test_ret);
37071 }
37072 
37073 
37074 static int
test_xmlStrstr(void)37075 test_xmlStrstr(void) {
37076     int test_ret = 0;
37077 
37078     int mem_base;
37079     const xmlChar * ret_val;
37080     xmlChar * str; /* the xmlChar * array (haystack) */
37081     int n_str;
37082     xmlChar * val; /* the xmlChar to search (needle) */
37083     int n_val;
37084 
37085     for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) {
37086     for (n_val = 0;n_val < gen_nb_const_xmlChar_ptr;n_val++) {
37087         mem_base = xmlMemBlocks();
37088         str = gen_const_xmlChar_ptr(n_str, 0);
37089         val = gen_const_xmlChar_ptr(n_val, 1);
37090 
37091         ret_val = xmlStrstr((const xmlChar *)str, (const xmlChar *)val);
37092         desret_const_xmlChar_ptr(ret_val);
37093         call_tests++;
37094         des_const_xmlChar_ptr(n_str, (const xmlChar *)str, 0);
37095         des_const_xmlChar_ptr(n_val, (const xmlChar *)val, 1);
37096         xmlResetLastError();
37097         if (mem_base != xmlMemBlocks()) {
37098             printf("Leak of %d blocks found in xmlStrstr",
37099 	           xmlMemBlocks() - mem_base);
37100 	    test_ret++;
37101             printf(" %d", n_str);
37102             printf(" %d", n_val);
37103             printf("\n");
37104         }
37105     }
37106     }
37107     function_tests++;
37108 
37109     return(test_ret);
37110 }
37111 
37112 
37113 static int
test_xmlStrsub(void)37114 test_xmlStrsub(void) {
37115     int test_ret = 0;
37116 
37117     int mem_base;
37118     xmlChar * ret_val;
37119     xmlChar * str; /* the xmlChar * array (haystack) */
37120     int n_str;
37121     int start; /* the index of the first char (zero based) */
37122     int n_start;
37123     int len; /* the length of the substring */
37124     int n_len;
37125 
37126     for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) {
37127     for (n_start = 0;n_start < gen_nb_int;n_start++) {
37128     for (n_len = 0;n_len < gen_nb_int;n_len++) {
37129         mem_base = xmlMemBlocks();
37130         str = gen_const_xmlChar_ptr(n_str, 0);
37131         start = gen_int(n_start, 1);
37132         len = gen_int(n_len, 2);
37133         if ((str != NULL) &&
37134             (start > (int) strlen((const char *) str) + 1))
37135             continue;
37136         if ((str != NULL) &&
37137             (len > (int) strlen((const char *) str) + 1))
37138             continue;
37139 
37140         ret_val = xmlStrsub((const xmlChar *)str, start, len);
37141         desret_xmlChar_ptr(ret_val);
37142         call_tests++;
37143         des_const_xmlChar_ptr(n_str, (const xmlChar *)str, 0);
37144         des_int(n_start, start, 1);
37145         des_int(n_len, len, 2);
37146         xmlResetLastError();
37147         if (mem_base != xmlMemBlocks()) {
37148             printf("Leak of %d blocks found in xmlStrsub",
37149 	           xmlMemBlocks() - mem_base);
37150 	    test_ret++;
37151             printf(" %d", n_str);
37152             printf(" %d", n_start);
37153             printf(" %d", n_len);
37154             printf("\n");
37155         }
37156     }
37157     }
37158     }
37159     function_tests++;
37160 
37161     return(test_ret);
37162 }
37163 
37164 
37165 static int
test_xmlUTF8Charcmp(void)37166 test_xmlUTF8Charcmp(void) {
37167     int test_ret = 0;
37168 
37169     int mem_base;
37170     int ret_val;
37171     xmlChar * utf1; /* pointer to first UTF8 char */
37172     int n_utf1;
37173     xmlChar * utf2; /* pointer to second UTF8 char */
37174     int n_utf2;
37175 
37176     for (n_utf1 = 0;n_utf1 < gen_nb_const_xmlChar_ptr;n_utf1++) {
37177     for (n_utf2 = 0;n_utf2 < gen_nb_const_xmlChar_ptr;n_utf2++) {
37178         mem_base = xmlMemBlocks();
37179         utf1 = gen_const_xmlChar_ptr(n_utf1, 0);
37180         utf2 = gen_const_xmlChar_ptr(n_utf2, 1);
37181 
37182         ret_val = xmlUTF8Charcmp((const xmlChar *)utf1, (const xmlChar *)utf2);
37183         desret_int(ret_val);
37184         call_tests++;
37185         des_const_xmlChar_ptr(n_utf1, (const xmlChar *)utf1, 0);
37186         des_const_xmlChar_ptr(n_utf2, (const xmlChar *)utf2, 1);
37187         xmlResetLastError();
37188         if (mem_base != xmlMemBlocks()) {
37189             printf("Leak of %d blocks found in xmlUTF8Charcmp",
37190 	           xmlMemBlocks() - mem_base);
37191 	    test_ret++;
37192             printf(" %d", n_utf1);
37193             printf(" %d", n_utf2);
37194             printf("\n");
37195         }
37196     }
37197     }
37198     function_tests++;
37199 
37200     return(test_ret);
37201 }
37202 
37203 
37204 static int
test_xmlUTF8Size(void)37205 test_xmlUTF8Size(void) {
37206     int test_ret = 0;
37207 
37208     int mem_base;
37209     int ret_val;
37210     xmlChar * utf; /* pointer to the UTF8 character */
37211     int n_utf;
37212 
37213     for (n_utf = 0;n_utf < gen_nb_const_xmlChar_ptr;n_utf++) {
37214         mem_base = xmlMemBlocks();
37215         utf = gen_const_xmlChar_ptr(n_utf, 0);
37216 
37217         ret_val = xmlUTF8Size((const xmlChar *)utf);
37218         desret_int(ret_val);
37219         call_tests++;
37220         des_const_xmlChar_ptr(n_utf, (const xmlChar *)utf, 0);
37221         xmlResetLastError();
37222         if (mem_base != xmlMemBlocks()) {
37223             printf("Leak of %d blocks found in xmlUTF8Size",
37224 	           xmlMemBlocks() - mem_base);
37225 	    test_ret++;
37226             printf(" %d", n_utf);
37227             printf("\n");
37228         }
37229     }
37230     function_tests++;
37231 
37232     return(test_ret);
37233 }
37234 
37235 
37236 static int
test_xmlUTF8Strlen(void)37237 test_xmlUTF8Strlen(void) {
37238     int test_ret = 0;
37239 
37240     int mem_base;
37241     int ret_val;
37242     xmlChar * utf; /* a sequence of UTF-8 encoded bytes */
37243     int n_utf;
37244 
37245     for (n_utf = 0;n_utf < gen_nb_const_xmlChar_ptr;n_utf++) {
37246         mem_base = xmlMemBlocks();
37247         utf = gen_const_xmlChar_ptr(n_utf, 0);
37248 
37249         ret_val = xmlUTF8Strlen((const xmlChar *)utf);
37250         desret_int(ret_val);
37251         call_tests++;
37252         des_const_xmlChar_ptr(n_utf, (const xmlChar *)utf, 0);
37253         xmlResetLastError();
37254         if (mem_base != xmlMemBlocks()) {
37255             printf("Leak of %d blocks found in xmlUTF8Strlen",
37256 	           xmlMemBlocks() - mem_base);
37257 	    test_ret++;
37258             printf(" %d", n_utf);
37259             printf("\n");
37260         }
37261     }
37262     function_tests++;
37263 
37264     return(test_ret);
37265 }
37266 
37267 
37268 static int
test_xmlUTF8Strloc(void)37269 test_xmlUTF8Strloc(void) {
37270     int test_ret = 0;
37271 
37272     int mem_base;
37273     int ret_val;
37274     xmlChar * utf; /* the input UTF8 * */
37275     int n_utf;
37276     xmlChar * utfchar; /* the UTF8 character to be found */
37277     int n_utfchar;
37278 
37279     for (n_utf = 0;n_utf < gen_nb_const_xmlChar_ptr;n_utf++) {
37280     for (n_utfchar = 0;n_utfchar < gen_nb_const_xmlChar_ptr;n_utfchar++) {
37281         mem_base = xmlMemBlocks();
37282         utf = gen_const_xmlChar_ptr(n_utf, 0);
37283         utfchar = gen_const_xmlChar_ptr(n_utfchar, 1);
37284 
37285         ret_val = xmlUTF8Strloc((const xmlChar *)utf, (const xmlChar *)utfchar);
37286         desret_int(ret_val);
37287         call_tests++;
37288         des_const_xmlChar_ptr(n_utf, (const xmlChar *)utf, 0);
37289         des_const_xmlChar_ptr(n_utfchar, (const xmlChar *)utfchar, 1);
37290         xmlResetLastError();
37291         if (mem_base != xmlMemBlocks()) {
37292             printf("Leak of %d blocks found in xmlUTF8Strloc",
37293 	           xmlMemBlocks() - mem_base);
37294 	    test_ret++;
37295             printf(" %d", n_utf);
37296             printf(" %d", n_utfchar);
37297             printf("\n");
37298         }
37299     }
37300     }
37301     function_tests++;
37302 
37303     return(test_ret);
37304 }
37305 
37306 
37307 static int
test_xmlUTF8Strndup(void)37308 test_xmlUTF8Strndup(void) {
37309     int test_ret = 0;
37310 
37311     int mem_base;
37312     xmlChar * ret_val;
37313     xmlChar * utf; /* the input UTF8 * */
37314     int n_utf;
37315     int len; /* the len of @utf (in chars) */
37316     int n_len;
37317 
37318     for (n_utf = 0;n_utf < gen_nb_const_xmlChar_ptr;n_utf++) {
37319     for (n_len = 0;n_len < gen_nb_int;n_len++) {
37320         mem_base = xmlMemBlocks();
37321         utf = gen_const_xmlChar_ptr(n_utf, 0);
37322         len = gen_int(n_len, 1);
37323         if ((utf != NULL) &&
37324             (len > (int) strlen((const char *) utf) + 1))
37325             continue;
37326 
37327         ret_val = xmlUTF8Strndup((const xmlChar *)utf, len);
37328         desret_xmlChar_ptr(ret_val);
37329         call_tests++;
37330         des_const_xmlChar_ptr(n_utf, (const xmlChar *)utf, 0);
37331         des_int(n_len, len, 1);
37332         xmlResetLastError();
37333         if (mem_base != xmlMemBlocks()) {
37334             printf("Leak of %d blocks found in xmlUTF8Strndup",
37335 	           xmlMemBlocks() - mem_base);
37336 	    test_ret++;
37337             printf(" %d", n_utf);
37338             printf(" %d", n_len);
37339             printf("\n");
37340         }
37341     }
37342     }
37343     function_tests++;
37344 
37345     return(test_ret);
37346 }
37347 
37348 
37349 static int
test_xmlUTF8Strpos(void)37350 test_xmlUTF8Strpos(void) {
37351     int test_ret = 0;
37352 
37353     int mem_base;
37354     const xmlChar * ret_val;
37355     xmlChar * utf; /* the input UTF8 * */
37356     int n_utf;
37357     int pos; /* the position of the desired UTF8 char (in chars) */
37358     int n_pos;
37359 
37360     for (n_utf = 0;n_utf < gen_nb_const_xmlChar_ptr;n_utf++) {
37361     for (n_pos = 0;n_pos < gen_nb_int;n_pos++) {
37362         mem_base = xmlMemBlocks();
37363         utf = gen_const_xmlChar_ptr(n_utf, 0);
37364         pos = gen_int(n_pos, 1);
37365 
37366         ret_val = xmlUTF8Strpos((const xmlChar *)utf, pos);
37367         desret_const_xmlChar_ptr(ret_val);
37368         call_tests++;
37369         des_const_xmlChar_ptr(n_utf, (const xmlChar *)utf, 0);
37370         des_int(n_pos, pos, 1);
37371         xmlResetLastError();
37372         if (mem_base != xmlMemBlocks()) {
37373             printf("Leak of %d blocks found in xmlUTF8Strpos",
37374 	           xmlMemBlocks() - mem_base);
37375 	    test_ret++;
37376             printf(" %d", n_utf);
37377             printf(" %d", n_pos);
37378             printf("\n");
37379         }
37380     }
37381     }
37382     function_tests++;
37383 
37384     return(test_ret);
37385 }
37386 
37387 
37388 static int
test_xmlUTF8Strsize(void)37389 test_xmlUTF8Strsize(void) {
37390     int test_ret = 0;
37391 
37392     int mem_base;
37393     int ret_val;
37394     xmlChar * utf; /* a sequence of UTF-8 encoded bytes */
37395     int n_utf;
37396     int len; /* the number of characters in the array */
37397     int n_len;
37398 
37399     for (n_utf = 0;n_utf < gen_nb_const_xmlChar_ptr;n_utf++) {
37400     for (n_len = 0;n_len < gen_nb_int;n_len++) {
37401         mem_base = xmlMemBlocks();
37402         utf = gen_const_xmlChar_ptr(n_utf, 0);
37403         len = gen_int(n_len, 1);
37404         if ((utf != NULL) &&
37405             (len > (int) strlen((const char *) utf) + 1))
37406             continue;
37407 
37408         ret_val = xmlUTF8Strsize((const xmlChar *)utf, len);
37409         desret_int(ret_val);
37410         call_tests++;
37411         des_const_xmlChar_ptr(n_utf, (const xmlChar *)utf, 0);
37412         des_int(n_len, len, 1);
37413         xmlResetLastError();
37414         if (mem_base != xmlMemBlocks()) {
37415             printf("Leak of %d blocks found in xmlUTF8Strsize",
37416 	           xmlMemBlocks() - mem_base);
37417 	    test_ret++;
37418             printf(" %d", n_utf);
37419             printf(" %d", n_len);
37420             printf("\n");
37421         }
37422     }
37423     }
37424     function_tests++;
37425 
37426     return(test_ret);
37427 }
37428 
37429 
37430 static int
test_xmlUTF8Strsub(void)37431 test_xmlUTF8Strsub(void) {
37432     int test_ret = 0;
37433 
37434     int mem_base;
37435     xmlChar * ret_val;
37436     xmlChar * utf; /* a sequence of UTF-8 encoded bytes */
37437     int n_utf;
37438     int start; /* relative pos of first char */
37439     int n_start;
37440     int len; /* total number to copy */
37441     int n_len;
37442 
37443     for (n_utf = 0;n_utf < gen_nb_const_xmlChar_ptr;n_utf++) {
37444     for (n_start = 0;n_start < gen_nb_int;n_start++) {
37445     for (n_len = 0;n_len < gen_nb_int;n_len++) {
37446         mem_base = xmlMemBlocks();
37447         utf = gen_const_xmlChar_ptr(n_utf, 0);
37448         start = gen_int(n_start, 1);
37449         len = gen_int(n_len, 2);
37450         if ((utf != NULL) &&
37451             (start > (int) strlen((const char *) utf) + 1))
37452             continue;
37453         if ((utf != NULL) &&
37454             (len > (int) strlen((const char *) utf) + 1))
37455             continue;
37456 
37457         ret_val = xmlUTF8Strsub((const xmlChar *)utf, start, len);
37458         desret_xmlChar_ptr(ret_val);
37459         call_tests++;
37460         des_const_xmlChar_ptr(n_utf, (const xmlChar *)utf, 0);
37461         des_int(n_start, start, 1);
37462         des_int(n_len, len, 2);
37463         xmlResetLastError();
37464         if (mem_base != xmlMemBlocks()) {
37465             printf("Leak of %d blocks found in xmlUTF8Strsub",
37466 	           xmlMemBlocks() - mem_base);
37467 	    test_ret++;
37468             printf(" %d", n_utf);
37469             printf(" %d", n_start);
37470             printf(" %d", n_len);
37471             printf("\n");
37472         }
37473     }
37474     }
37475     }
37476     function_tests++;
37477 
37478     return(test_ret);
37479 }
37480 
37481 static int
test_xmlstring(void)37482 test_xmlstring(void) {
37483     int test_ret = 0;
37484 
37485     if (quiet == 0) printf("Testing xmlstring : 26 of 30 functions ...\n");
37486     test_ret += test_xmlCharStrdup();
37487     test_ret += test_xmlCharStrndup();
37488     test_ret += test_xmlCheckUTF8();
37489     test_ret += test_xmlGetUTF8Char();
37490     test_ret += test_xmlStrEqual();
37491     test_ret += test_xmlStrPrintf();
37492     test_ret += test_xmlStrQEqual();
37493     test_ret += test_xmlStrVPrintf();
37494     test_ret += test_xmlStrcasecmp();
37495     test_ret += test_xmlStrcasestr();
37496     test_ret += test_xmlStrchr();
37497     test_ret += test_xmlStrcmp();
37498     test_ret += test_xmlStrdup();
37499     test_ret += test_xmlStrlen();
37500     test_ret += test_xmlStrncasecmp();
37501     test_ret += test_xmlStrncatNew();
37502     test_ret += test_xmlStrncmp();
37503     test_ret += test_xmlStrndup();
37504     test_ret += test_xmlStrstr();
37505     test_ret += test_xmlStrsub();
37506     test_ret += test_xmlUTF8Charcmp();
37507     test_ret += test_xmlUTF8Size();
37508     test_ret += test_xmlUTF8Strlen();
37509     test_ret += test_xmlUTF8Strloc();
37510     test_ret += test_xmlUTF8Strndup();
37511     test_ret += test_xmlUTF8Strpos();
37512     test_ret += test_xmlUTF8Strsize();
37513     test_ret += test_xmlUTF8Strsub();
37514 
37515     if (test_ret != 0)
37516 	printf("Module xmlstring: %d errors\n", test_ret);
37517     return(test_ret);
37518 }
37519 
37520 static int
test_xmlUCSIsAegeanNumbers(void)37521 test_xmlUCSIsAegeanNumbers(void) {
37522     int test_ret = 0;
37523 
37524 #if defined(LIBXML_UNICODE_ENABLED)
37525     int mem_base;
37526     int ret_val;
37527     int code; /* UCS code point */
37528     int n_code;
37529 
37530     for (n_code = 0;n_code < gen_nb_int;n_code++) {
37531         mem_base = xmlMemBlocks();
37532         code = gen_int(n_code, 0);
37533 
37534         ret_val = xmlUCSIsAegeanNumbers(code);
37535         desret_int(ret_val);
37536         call_tests++;
37537         des_int(n_code, code, 0);
37538         xmlResetLastError();
37539         if (mem_base != xmlMemBlocks()) {
37540             printf("Leak of %d blocks found in xmlUCSIsAegeanNumbers",
37541 	           xmlMemBlocks() - mem_base);
37542 	    test_ret++;
37543             printf(" %d", n_code);
37544             printf("\n");
37545         }
37546     }
37547     function_tests++;
37548 #endif
37549 
37550     return(test_ret);
37551 }
37552 
37553 
37554 static int
test_xmlUCSIsAlphabeticPresentationForms(void)37555 test_xmlUCSIsAlphabeticPresentationForms(void) {
37556     int test_ret = 0;
37557 
37558 #if defined(LIBXML_UNICODE_ENABLED)
37559     int mem_base;
37560     int ret_val;
37561     int code; /* UCS code point */
37562     int n_code;
37563 
37564     for (n_code = 0;n_code < gen_nb_int;n_code++) {
37565         mem_base = xmlMemBlocks();
37566         code = gen_int(n_code, 0);
37567 
37568         ret_val = xmlUCSIsAlphabeticPresentationForms(code);
37569         desret_int(ret_val);
37570         call_tests++;
37571         des_int(n_code, code, 0);
37572         xmlResetLastError();
37573         if (mem_base != xmlMemBlocks()) {
37574             printf("Leak of %d blocks found in xmlUCSIsAlphabeticPresentationForms",
37575 	           xmlMemBlocks() - mem_base);
37576 	    test_ret++;
37577             printf(" %d", n_code);
37578             printf("\n");
37579         }
37580     }
37581     function_tests++;
37582 #endif
37583 
37584     return(test_ret);
37585 }
37586 
37587 
37588 static int
test_xmlUCSIsArabic(void)37589 test_xmlUCSIsArabic(void) {
37590     int test_ret = 0;
37591 
37592 #if defined(LIBXML_UNICODE_ENABLED)
37593     int mem_base;
37594     int ret_val;
37595     int code; /* UCS code point */
37596     int n_code;
37597 
37598     for (n_code = 0;n_code < gen_nb_int;n_code++) {
37599         mem_base = xmlMemBlocks();
37600         code = gen_int(n_code, 0);
37601 
37602         ret_val = xmlUCSIsArabic(code);
37603         desret_int(ret_val);
37604         call_tests++;
37605         des_int(n_code, code, 0);
37606         xmlResetLastError();
37607         if (mem_base != xmlMemBlocks()) {
37608             printf("Leak of %d blocks found in xmlUCSIsArabic",
37609 	           xmlMemBlocks() - mem_base);
37610 	    test_ret++;
37611             printf(" %d", n_code);
37612             printf("\n");
37613         }
37614     }
37615     function_tests++;
37616 #endif
37617 
37618     return(test_ret);
37619 }
37620 
37621 
37622 static int
test_xmlUCSIsArabicPresentationFormsA(void)37623 test_xmlUCSIsArabicPresentationFormsA(void) {
37624     int test_ret = 0;
37625 
37626 #if defined(LIBXML_UNICODE_ENABLED)
37627     int mem_base;
37628     int ret_val;
37629     int code; /* UCS code point */
37630     int n_code;
37631 
37632     for (n_code = 0;n_code < gen_nb_int;n_code++) {
37633         mem_base = xmlMemBlocks();
37634         code = gen_int(n_code, 0);
37635 
37636         ret_val = xmlUCSIsArabicPresentationFormsA(code);
37637         desret_int(ret_val);
37638         call_tests++;
37639         des_int(n_code, code, 0);
37640         xmlResetLastError();
37641         if (mem_base != xmlMemBlocks()) {
37642             printf("Leak of %d blocks found in xmlUCSIsArabicPresentationFormsA",
37643 	           xmlMemBlocks() - mem_base);
37644 	    test_ret++;
37645             printf(" %d", n_code);
37646             printf("\n");
37647         }
37648     }
37649     function_tests++;
37650 #endif
37651 
37652     return(test_ret);
37653 }
37654 
37655 
37656 static int
test_xmlUCSIsArabicPresentationFormsB(void)37657 test_xmlUCSIsArabicPresentationFormsB(void) {
37658     int test_ret = 0;
37659 
37660 #if defined(LIBXML_UNICODE_ENABLED)
37661     int mem_base;
37662     int ret_val;
37663     int code; /* UCS code point */
37664     int n_code;
37665 
37666     for (n_code = 0;n_code < gen_nb_int;n_code++) {
37667         mem_base = xmlMemBlocks();
37668         code = gen_int(n_code, 0);
37669 
37670         ret_val = xmlUCSIsArabicPresentationFormsB(code);
37671         desret_int(ret_val);
37672         call_tests++;
37673         des_int(n_code, code, 0);
37674         xmlResetLastError();
37675         if (mem_base != xmlMemBlocks()) {
37676             printf("Leak of %d blocks found in xmlUCSIsArabicPresentationFormsB",
37677 	           xmlMemBlocks() - mem_base);
37678 	    test_ret++;
37679             printf(" %d", n_code);
37680             printf("\n");
37681         }
37682     }
37683     function_tests++;
37684 #endif
37685 
37686     return(test_ret);
37687 }
37688 
37689 
37690 static int
test_xmlUCSIsArmenian(void)37691 test_xmlUCSIsArmenian(void) {
37692     int test_ret = 0;
37693 
37694 #if defined(LIBXML_UNICODE_ENABLED)
37695     int mem_base;
37696     int ret_val;
37697     int code; /* UCS code point */
37698     int n_code;
37699 
37700     for (n_code = 0;n_code < gen_nb_int;n_code++) {
37701         mem_base = xmlMemBlocks();
37702         code = gen_int(n_code, 0);
37703 
37704         ret_val = xmlUCSIsArmenian(code);
37705         desret_int(ret_val);
37706         call_tests++;
37707         des_int(n_code, code, 0);
37708         xmlResetLastError();
37709         if (mem_base != xmlMemBlocks()) {
37710             printf("Leak of %d blocks found in xmlUCSIsArmenian",
37711 	           xmlMemBlocks() - mem_base);
37712 	    test_ret++;
37713             printf(" %d", n_code);
37714             printf("\n");
37715         }
37716     }
37717     function_tests++;
37718 #endif
37719 
37720     return(test_ret);
37721 }
37722 
37723 
37724 static int
test_xmlUCSIsArrows(void)37725 test_xmlUCSIsArrows(void) {
37726     int test_ret = 0;
37727 
37728 #if defined(LIBXML_UNICODE_ENABLED)
37729     int mem_base;
37730     int ret_val;
37731     int code; /* UCS code point */
37732     int n_code;
37733 
37734     for (n_code = 0;n_code < gen_nb_int;n_code++) {
37735         mem_base = xmlMemBlocks();
37736         code = gen_int(n_code, 0);
37737 
37738         ret_val = xmlUCSIsArrows(code);
37739         desret_int(ret_val);
37740         call_tests++;
37741         des_int(n_code, code, 0);
37742         xmlResetLastError();
37743         if (mem_base != xmlMemBlocks()) {
37744             printf("Leak of %d blocks found in xmlUCSIsArrows",
37745 	           xmlMemBlocks() - mem_base);
37746 	    test_ret++;
37747             printf(" %d", n_code);
37748             printf("\n");
37749         }
37750     }
37751     function_tests++;
37752 #endif
37753 
37754     return(test_ret);
37755 }
37756 
37757 
37758 static int
test_xmlUCSIsBasicLatin(void)37759 test_xmlUCSIsBasicLatin(void) {
37760     int test_ret = 0;
37761 
37762 #if defined(LIBXML_UNICODE_ENABLED)
37763     int mem_base;
37764     int ret_val;
37765     int code; /* UCS code point */
37766     int n_code;
37767 
37768     for (n_code = 0;n_code < gen_nb_int;n_code++) {
37769         mem_base = xmlMemBlocks();
37770         code = gen_int(n_code, 0);
37771 
37772         ret_val = xmlUCSIsBasicLatin(code);
37773         desret_int(ret_val);
37774         call_tests++;
37775         des_int(n_code, code, 0);
37776         xmlResetLastError();
37777         if (mem_base != xmlMemBlocks()) {
37778             printf("Leak of %d blocks found in xmlUCSIsBasicLatin",
37779 	           xmlMemBlocks() - mem_base);
37780 	    test_ret++;
37781             printf(" %d", n_code);
37782             printf("\n");
37783         }
37784     }
37785     function_tests++;
37786 #endif
37787 
37788     return(test_ret);
37789 }
37790 
37791 
37792 static int
test_xmlUCSIsBengali(void)37793 test_xmlUCSIsBengali(void) {
37794     int test_ret = 0;
37795 
37796 #if defined(LIBXML_UNICODE_ENABLED)
37797     int mem_base;
37798     int ret_val;
37799     int code; /* UCS code point */
37800     int n_code;
37801 
37802     for (n_code = 0;n_code < gen_nb_int;n_code++) {
37803         mem_base = xmlMemBlocks();
37804         code = gen_int(n_code, 0);
37805 
37806         ret_val = xmlUCSIsBengali(code);
37807         desret_int(ret_val);
37808         call_tests++;
37809         des_int(n_code, code, 0);
37810         xmlResetLastError();
37811         if (mem_base != xmlMemBlocks()) {
37812             printf("Leak of %d blocks found in xmlUCSIsBengali",
37813 	           xmlMemBlocks() - mem_base);
37814 	    test_ret++;
37815             printf(" %d", n_code);
37816             printf("\n");
37817         }
37818     }
37819     function_tests++;
37820 #endif
37821 
37822     return(test_ret);
37823 }
37824 
37825 
37826 static int
test_xmlUCSIsBlock(void)37827 test_xmlUCSIsBlock(void) {
37828     int test_ret = 0;
37829 
37830 #if defined(LIBXML_UNICODE_ENABLED)
37831     int mem_base;
37832     int ret_val;
37833     int code; /* UCS code point */
37834     int n_code;
37835     char * block; /* UCS block name */
37836     int n_block;
37837 
37838     for (n_code = 0;n_code < gen_nb_int;n_code++) {
37839     for (n_block = 0;n_block < gen_nb_const_char_ptr;n_block++) {
37840         mem_base = xmlMemBlocks();
37841         code = gen_int(n_code, 0);
37842         block = gen_const_char_ptr(n_block, 1);
37843 
37844         ret_val = xmlUCSIsBlock(code, (const char *)block);
37845         desret_int(ret_val);
37846         call_tests++;
37847         des_int(n_code, code, 0);
37848         des_const_char_ptr(n_block, (const char *)block, 1);
37849         xmlResetLastError();
37850         if (mem_base != xmlMemBlocks()) {
37851             printf("Leak of %d blocks found in xmlUCSIsBlock",
37852 	           xmlMemBlocks() - mem_base);
37853 	    test_ret++;
37854             printf(" %d", n_code);
37855             printf(" %d", n_block);
37856             printf("\n");
37857         }
37858     }
37859     }
37860     function_tests++;
37861 #endif
37862 
37863     return(test_ret);
37864 }
37865 
37866 
37867 static int
test_xmlUCSIsBlockElements(void)37868 test_xmlUCSIsBlockElements(void) {
37869     int test_ret = 0;
37870 
37871 #if defined(LIBXML_UNICODE_ENABLED)
37872     int mem_base;
37873     int ret_val;
37874     int code; /* UCS code point */
37875     int n_code;
37876 
37877     for (n_code = 0;n_code < gen_nb_int;n_code++) {
37878         mem_base = xmlMemBlocks();
37879         code = gen_int(n_code, 0);
37880 
37881         ret_val = xmlUCSIsBlockElements(code);
37882         desret_int(ret_val);
37883         call_tests++;
37884         des_int(n_code, code, 0);
37885         xmlResetLastError();
37886         if (mem_base != xmlMemBlocks()) {
37887             printf("Leak of %d blocks found in xmlUCSIsBlockElements",
37888 	           xmlMemBlocks() - mem_base);
37889 	    test_ret++;
37890             printf(" %d", n_code);
37891             printf("\n");
37892         }
37893     }
37894     function_tests++;
37895 #endif
37896 
37897     return(test_ret);
37898 }
37899 
37900 
37901 static int
test_xmlUCSIsBopomofo(void)37902 test_xmlUCSIsBopomofo(void) {
37903     int test_ret = 0;
37904 
37905 #if defined(LIBXML_UNICODE_ENABLED)
37906     int mem_base;
37907     int ret_val;
37908     int code; /* UCS code point */
37909     int n_code;
37910 
37911     for (n_code = 0;n_code < gen_nb_int;n_code++) {
37912         mem_base = xmlMemBlocks();
37913         code = gen_int(n_code, 0);
37914 
37915         ret_val = xmlUCSIsBopomofo(code);
37916         desret_int(ret_val);
37917         call_tests++;
37918         des_int(n_code, code, 0);
37919         xmlResetLastError();
37920         if (mem_base != xmlMemBlocks()) {
37921             printf("Leak of %d blocks found in xmlUCSIsBopomofo",
37922 	           xmlMemBlocks() - mem_base);
37923 	    test_ret++;
37924             printf(" %d", n_code);
37925             printf("\n");
37926         }
37927     }
37928     function_tests++;
37929 #endif
37930 
37931     return(test_ret);
37932 }
37933 
37934 
37935 static int
test_xmlUCSIsBopomofoExtended(void)37936 test_xmlUCSIsBopomofoExtended(void) {
37937     int test_ret = 0;
37938 
37939 #if defined(LIBXML_UNICODE_ENABLED)
37940     int mem_base;
37941     int ret_val;
37942     int code; /* UCS code point */
37943     int n_code;
37944 
37945     for (n_code = 0;n_code < gen_nb_int;n_code++) {
37946         mem_base = xmlMemBlocks();
37947         code = gen_int(n_code, 0);
37948 
37949         ret_val = xmlUCSIsBopomofoExtended(code);
37950         desret_int(ret_val);
37951         call_tests++;
37952         des_int(n_code, code, 0);
37953         xmlResetLastError();
37954         if (mem_base != xmlMemBlocks()) {
37955             printf("Leak of %d blocks found in xmlUCSIsBopomofoExtended",
37956 	           xmlMemBlocks() - mem_base);
37957 	    test_ret++;
37958             printf(" %d", n_code);
37959             printf("\n");
37960         }
37961     }
37962     function_tests++;
37963 #endif
37964 
37965     return(test_ret);
37966 }
37967 
37968 
37969 static int
test_xmlUCSIsBoxDrawing(void)37970 test_xmlUCSIsBoxDrawing(void) {
37971     int test_ret = 0;
37972 
37973 #if defined(LIBXML_UNICODE_ENABLED)
37974     int mem_base;
37975     int ret_val;
37976     int code; /* UCS code point */
37977     int n_code;
37978 
37979     for (n_code = 0;n_code < gen_nb_int;n_code++) {
37980         mem_base = xmlMemBlocks();
37981         code = gen_int(n_code, 0);
37982 
37983         ret_val = xmlUCSIsBoxDrawing(code);
37984         desret_int(ret_val);
37985         call_tests++;
37986         des_int(n_code, code, 0);
37987         xmlResetLastError();
37988         if (mem_base != xmlMemBlocks()) {
37989             printf("Leak of %d blocks found in xmlUCSIsBoxDrawing",
37990 	           xmlMemBlocks() - mem_base);
37991 	    test_ret++;
37992             printf(" %d", n_code);
37993             printf("\n");
37994         }
37995     }
37996     function_tests++;
37997 #endif
37998 
37999     return(test_ret);
38000 }
38001 
38002 
38003 static int
test_xmlUCSIsBraillePatterns(void)38004 test_xmlUCSIsBraillePatterns(void) {
38005     int test_ret = 0;
38006 
38007 #if defined(LIBXML_UNICODE_ENABLED)
38008     int mem_base;
38009     int ret_val;
38010     int code; /* UCS code point */
38011     int n_code;
38012 
38013     for (n_code = 0;n_code < gen_nb_int;n_code++) {
38014         mem_base = xmlMemBlocks();
38015         code = gen_int(n_code, 0);
38016 
38017         ret_val = xmlUCSIsBraillePatterns(code);
38018         desret_int(ret_val);
38019         call_tests++;
38020         des_int(n_code, code, 0);
38021         xmlResetLastError();
38022         if (mem_base != xmlMemBlocks()) {
38023             printf("Leak of %d blocks found in xmlUCSIsBraillePatterns",
38024 	           xmlMemBlocks() - mem_base);
38025 	    test_ret++;
38026             printf(" %d", n_code);
38027             printf("\n");
38028         }
38029     }
38030     function_tests++;
38031 #endif
38032 
38033     return(test_ret);
38034 }
38035 
38036 
38037 static int
test_xmlUCSIsBuhid(void)38038 test_xmlUCSIsBuhid(void) {
38039     int test_ret = 0;
38040 
38041 #if defined(LIBXML_UNICODE_ENABLED)
38042     int mem_base;
38043     int ret_val;
38044     int code; /* UCS code point */
38045     int n_code;
38046 
38047     for (n_code = 0;n_code < gen_nb_int;n_code++) {
38048         mem_base = xmlMemBlocks();
38049         code = gen_int(n_code, 0);
38050 
38051         ret_val = xmlUCSIsBuhid(code);
38052         desret_int(ret_val);
38053         call_tests++;
38054         des_int(n_code, code, 0);
38055         xmlResetLastError();
38056         if (mem_base != xmlMemBlocks()) {
38057             printf("Leak of %d blocks found in xmlUCSIsBuhid",
38058 	           xmlMemBlocks() - mem_base);
38059 	    test_ret++;
38060             printf(" %d", n_code);
38061             printf("\n");
38062         }
38063     }
38064     function_tests++;
38065 #endif
38066 
38067     return(test_ret);
38068 }
38069 
38070 
38071 static int
test_xmlUCSIsByzantineMusicalSymbols(void)38072 test_xmlUCSIsByzantineMusicalSymbols(void) {
38073     int test_ret = 0;
38074 
38075 #if defined(LIBXML_UNICODE_ENABLED)
38076     int mem_base;
38077     int ret_val;
38078     int code; /* UCS code point */
38079     int n_code;
38080 
38081     for (n_code = 0;n_code < gen_nb_int;n_code++) {
38082         mem_base = xmlMemBlocks();
38083         code = gen_int(n_code, 0);
38084 
38085         ret_val = xmlUCSIsByzantineMusicalSymbols(code);
38086         desret_int(ret_val);
38087         call_tests++;
38088         des_int(n_code, code, 0);
38089         xmlResetLastError();
38090         if (mem_base != xmlMemBlocks()) {
38091             printf("Leak of %d blocks found in xmlUCSIsByzantineMusicalSymbols",
38092 	           xmlMemBlocks() - mem_base);
38093 	    test_ret++;
38094             printf(" %d", n_code);
38095             printf("\n");
38096         }
38097     }
38098     function_tests++;
38099 #endif
38100 
38101     return(test_ret);
38102 }
38103 
38104 
38105 static int
test_xmlUCSIsCJKCompatibility(void)38106 test_xmlUCSIsCJKCompatibility(void) {
38107     int test_ret = 0;
38108 
38109 #if defined(LIBXML_UNICODE_ENABLED)
38110     int mem_base;
38111     int ret_val;
38112     int code; /* UCS code point */
38113     int n_code;
38114 
38115     for (n_code = 0;n_code < gen_nb_int;n_code++) {
38116         mem_base = xmlMemBlocks();
38117         code = gen_int(n_code, 0);
38118 
38119         ret_val = xmlUCSIsCJKCompatibility(code);
38120         desret_int(ret_val);
38121         call_tests++;
38122         des_int(n_code, code, 0);
38123         xmlResetLastError();
38124         if (mem_base != xmlMemBlocks()) {
38125             printf("Leak of %d blocks found in xmlUCSIsCJKCompatibility",
38126 	           xmlMemBlocks() - mem_base);
38127 	    test_ret++;
38128             printf(" %d", n_code);
38129             printf("\n");
38130         }
38131     }
38132     function_tests++;
38133 #endif
38134 
38135     return(test_ret);
38136 }
38137 
38138 
38139 static int
test_xmlUCSIsCJKCompatibilityForms(void)38140 test_xmlUCSIsCJKCompatibilityForms(void) {
38141     int test_ret = 0;
38142 
38143 #if defined(LIBXML_UNICODE_ENABLED)
38144     int mem_base;
38145     int ret_val;
38146     int code; /* UCS code point */
38147     int n_code;
38148 
38149     for (n_code = 0;n_code < gen_nb_int;n_code++) {
38150         mem_base = xmlMemBlocks();
38151         code = gen_int(n_code, 0);
38152 
38153         ret_val = xmlUCSIsCJKCompatibilityForms(code);
38154         desret_int(ret_val);
38155         call_tests++;
38156         des_int(n_code, code, 0);
38157         xmlResetLastError();
38158         if (mem_base != xmlMemBlocks()) {
38159             printf("Leak of %d blocks found in xmlUCSIsCJKCompatibilityForms",
38160 	           xmlMemBlocks() - mem_base);
38161 	    test_ret++;
38162             printf(" %d", n_code);
38163             printf("\n");
38164         }
38165     }
38166     function_tests++;
38167 #endif
38168 
38169     return(test_ret);
38170 }
38171 
38172 
38173 static int
test_xmlUCSIsCJKCompatibilityIdeographs(void)38174 test_xmlUCSIsCJKCompatibilityIdeographs(void) {
38175     int test_ret = 0;
38176 
38177 #if defined(LIBXML_UNICODE_ENABLED)
38178     int mem_base;
38179     int ret_val;
38180     int code; /* UCS code point */
38181     int n_code;
38182 
38183     for (n_code = 0;n_code < gen_nb_int;n_code++) {
38184         mem_base = xmlMemBlocks();
38185         code = gen_int(n_code, 0);
38186 
38187         ret_val = xmlUCSIsCJKCompatibilityIdeographs(code);
38188         desret_int(ret_val);
38189         call_tests++;
38190         des_int(n_code, code, 0);
38191         xmlResetLastError();
38192         if (mem_base != xmlMemBlocks()) {
38193             printf("Leak of %d blocks found in xmlUCSIsCJKCompatibilityIdeographs",
38194 	           xmlMemBlocks() - mem_base);
38195 	    test_ret++;
38196             printf(" %d", n_code);
38197             printf("\n");
38198         }
38199     }
38200     function_tests++;
38201 #endif
38202 
38203     return(test_ret);
38204 }
38205 
38206 
38207 static int
test_xmlUCSIsCJKCompatibilityIdeographsSupplement(void)38208 test_xmlUCSIsCJKCompatibilityIdeographsSupplement(void) {
38209     int test_ret = 0;
38210 
38211 #if defined(LIBXML_UNICODE_ENABLED)
38212     int mem_base;
38213     int ret_val;
38214     int code; /* UCS code point */
38215     int n_code;
38216 
38217     for (n_code = 0;n_code < gen_nb_int;n_code++) {
38218         mem_base = xmlMemBlocks();
38219         code = gen_int(n_code, 0);
38220 
38221         ret_val = xmlUCSIsCJKCompatibilityIdeographsSupplement(code);
38222         desret_int(ret_val);
38223         call_tests++;
38224         des_int(n_code, code, 0);
38225         xmlResetLastError();
38226         if (mem_base != xmlMemBlocks()) {
38227             printf("Leak of %d blocks found in xmlUCSIsCJKCompatibilityIdeographsSupplement",
38228 	           xmlMemBlocks() - mem_base);
38229 	    test_ret++;
38230             printf(" %d", n_code);
38231             printf("\n");
38232         }
38233     }
38234     function_tests++;
38235 #endif
38236 
38237     return(test_ret);
38238 }
38239 
38240 
38241 static int
test_xmlUCSIsCJKRadicalsSupplement(void)38242 test_xmlUCSIsCJKRadicalsSupplement(void) {
38243     int test_ret = 0;
38244 
38245 #if defined(LIBXML_UNICODE_ENABLED)
38246     int mem_base;
38247     int ret_val;
38248     int code; /* UCS code point */
38249     int n_code;
38250 
38251     for (n_code = 0;n_code < gen_nb_int;n_code++) {
38252         mem_base = xmlMemBlocks();
38253         code = gen_int(n_code, 0);
38254 
38255         ret_val = xmlUCSIsCJKRadicalsSupplement(code);
38256         desret_int(ret_val);
38257         call_tests++;
38258         des_int(n_code, code, 0);
38259         xmlResetLastError();
38260         if (mem_base != xmlMemBlocks()) {
38261             printf("Leak of %d blocks found in xmlUCSIsCJKRadicalsSupplement",
38262 	           xmlMemBlocks() - mem_base);
38263 	    test_ret++;
38264             printf(" %d", n_code);
38265             printf("\n");
38266         }
38267     }
38268     function_tests++;
38269 #endif
38270 
38271     return(test_ret);
38272 }
38273 
38274 
38275 static int
test_xmlUCSIsCJKSymbolsandPunctuation(void)38276 test_xmlUCSIsCJKSymbolsandPunctuation(void) {
38277     int test_ret = 0;
38278 
38279 #if defined(LIBXML_UNICODE_ENABLED)
38280     int mem_base;
38281     int ret_val;
38282     int code; /* UCS code point */
38283     int n_code;
38284 
38285     for (n_code = 0;n_code < gen_nb_int;n_code++) {
38286         mem_base = xmlMemBlocks();
38287         code = gen_int(n_code, 0);
38288 
38289         ret_val = xmlUCSIsCJKSymbolsandPunctuation(code);
38290         desret_int(ret_val);
38291         call_tests++;
38292         des_int(n_code, code, 0);
38293         xmlResetLastError();
38294         if (mem_base != xmlMemBlocks()) {
38295             printf("Leak of %d blocks found in xmlUCSIsCJKSymbolsandPunctuation",
38296 	           xmlMemBlocks() - mem_base);
38297 	    test_ret++;
38298             printf(" %d", n_code);
38299             printf("\n");
38300         }
38301     }
38302     function_tests++;
38303 #endif
38304 
38305     return(test_ret);
38306 }
38307 
38308 
38309 static int
test_xmlUCSIsCJKUnifiedIdeographs(void)38310 test_xmlUCSIsCJKUnifiedIdeographs(void) {
38311     int test_ret = 0;
38312 
38313 #if defined(LIBXML_UNICODE_ENABLED)
38314     int mem_base;
38315     int ret_val;
38316     int code; /* UCS code point */
38317     int n_code;
38318 
38319     for (n_code = 0;n_code < gen_nb_int;n_code++) {
38320         mem_base = xmlMemBlocks();
38321         code = gen_int(n_code, 0);
38322 
38323         ret_val = xmlUCSIsCJKUnifiedIdeographs(code);
38324         desret_int(ret_val);
38325         call_tests++;
38326         des_int(n_code, code, 0);
38327         xmlResetLastError();
38328         if (mem_base != xmlMemBlocks()) {
38329             printf("Leak of %d blocks found in xmlUCSIsCJKUnifiedIdeographs",
38330 	           xmlMemBlocks() - mem_base);
38331 	    test_ret++;
38332             printf(" %d", n_code);
38333             printf("\n");
38334         }
38335     }
38336     function_tests++;
38337 #endif
38338 
38339     return(test_ret);
38340 }
38341 
38342 
38343 static int
test_xmlUCSIsCJKUnifiedIdeographsExtensionA(void)38344 test_xmlUCSIsCJKUnifiedIdeographsExtensionA(void) {
38345     int test_ret = 0;
38346 
38347 #if defined(LIBXML_UNICODE_ENABLED)
38348     int mem_base;
38349     int ret_val;
38350     int code; /* UCS code point */
38351     int n_code;
38352 
38353     for (n_code = 0;n_code < gen_nb_int;n_code++) {
38354         mem_base = xmlMemBlocks();
38355         code = gen_int(n_code, 0);
38356 
38357         ret_val = xmlUCSIsCJKUnifiedIdeographsExtensionA(code);
38358         desret_int(ret_val);
38359         call_tests++;
38360         des_int(n_code, code, 0);
38361         xmlResetLastError();
38362         if (mem_base != xmlMemBlocks()) {
38363             printf("Leak of %d blocks found in xmlUCSIsCJKUnifiedIdeographsExtensionA",
38364 	           xmlMemBlocks() - mem_base);
38365 	    test_ret++;
38366             printf(" %d", n_code);
38367             printf("\n");
38368         }
38369     }
38370     function_tests++;
38371 #endif
38372 
38373     return(test_ret);
38374 }
38375 
38376 
38377 static int
test_xmlUCSIsCJKUnifiedIdeographsExtensionB(void)38378 test_xmlUCSIsCJKUnifiedIdeographsExtensionB(void) {
38379     int test_ret = 0;
38380 
38381 #if defined(LIBXML_UNICODE_ENABLED)
38382     int mem_base;
38383     int ret_val;
38384     int code; /* UCS code point */
38385     int n_code;
38386 
38387     for (n_code = 0;n_code < gen_nb_int;n_code++) {
38388         mem_base = xmlMemBlocks();
38389         code = gen_int(n_code, 0);
38390 
38391         ret_val = xmlUCSIsCJKUnifiedIdeographsExtensionB(code);
38392         desret_int(ret_val);
38393         call_tests++;
38394         des_int(n_code, code, 0);
38395         xmlResetLastError();
38396         if (mem_base != xmlMemBlocks()) {
38397             printf("Leak of %d blocks found in xmlUCSIsCJKUnifiedIdeographsExtensionB",
38398 	           xmlMemBlocks() - mem_base);
38399 	    test_ret++;
38400             printf(" %d", n_code);
38401             printf("\n");
38402         }
38403     }
38404     function_tests++;
38405 #endif
38406 
38407     return(test_ret);
38408 }
38409 
38410 
38411 static int
test_xmlUCSIsCat(void)38412 test_xmlUCSIsCat(void) {
38413     int test_ret = 0;
38414 
38415 #if defined(LIBXML_UNICODE_ENABLED)
38416     int mem_base;
38417     int ret_val;
38418     int code; /* UCS code point */
38419     int n_code;
38420     char * cat; /* UCS Category name */
38421     int n_cat;
38422 
38423     for (n_code = 0;n_code < gen_nb_int;n_code++) {
38424     for (n_cat = 0;n_cat < gen_nb_const_char_ptr;n_cat++) {
38425         mem_base = xmlMemBlocks();
38426         code = gen_int(n_code, 0);
38427         cat = gen_const_char_ptr(n_cat, 1);
38428 
38429         ret_val = xmlUCSIsCat(code, (const char *)cat);
38430         desret_int(ret_val);
38431         call_tests++;
38432         des_int(n_code, code, 0);
38433         des_const_char_ptr(n_cat, (const char *)cat, 1);
38434         xmlResetLastError();
38435         if (mem_base != xmlMemBlocks()) {
38436             printf("Leak of %d blocks found in xmlUCSIsCat",
38437 	           xmlMemBlocks() - mem_base);
38438 	    test_ret++;
38439             printf(" %d", n_code);
38440             printf(" %d", n_cat);
38441             printf("\n");
38442         }
38443     }
38444     }
38445     function_tests++;
38446 #endif
38447 
38448     return(test_ret);
38449 }
38450 
38451 
38452 static int
test_xmlUCSIsCatC(void)38453 test_xmlUCSIsCatC(void) {
38454     int test_ret = 0;
38455 
38456 #if defined(LIBXML_UNICODE_ENABLED)
38457     int mem_base;
38458     int ret_val;
38459     int code; /* UCS code point */
38460     int n_code;
38461 
38462     for (n_code = 0;n_code < gen_nb_int;n_code++) {
38463         mem_base = xmlMemBlocks();
38464         code = gen_int(n_code, 0);
38465 
38466         ret_val = xmlUCSIsCatC(code);
38467         desret_int(ret_val);
38468         call_tests++;
38469         des_int(n_code, code, 0);
38470         xmlResetLastError();
38471         if (mem_base != xmlMemBlocks()) {
38472             printf("Leak of %d blocks found in xmlUCSIsCatC",
38473 	           xmlMemBlocks() - mem_base);
38474 	    test_ret++;
38475             printf(" %d", n_code);
38476             printf("\n");
38477         }
38478     }
38479     function_tests++;
38480 #endif
38481 
38482     return(test_ret);
38483 }
38484 
38485 
38486 static int
test_xmlUCSIsCatCc(void)38487 test_xmlUCSIsCatCc(void) {
38488     int test_ret = 0;
38489 
38490 #if defined(LIBXML_UNICODE_ENABLED)
38491     int mem_base;
38492     int ret_val;
38493     int code; /* UCS code point */
38494     int n_code;
38495 
38496     for (n_code = 0;n_code < gen_nb_int;n_code++) {
38497         mem_base = xmlMemBlocks();
38498         code = gen_int(n_code, 0);
38499 
38500         ret_val = xmlUCSIsCatCc(code);
38501         desret_int(ret_val);
38502         call_tests++;
38503         des_int(n_code, code, 0);
38504         xmlResetLastError();
38505         if (mem_base != xmlMemBlocks()) {
38506             printf("Leak of %d blocks found in xmlUCSIsCatCc",
38507 	           xmlMemBlocks() - mem_base);
38508 	    test_ret++;
38509             printf(" %d", n_code);
38510             printf("\n");
38511         }
38512     }
38513     function_tests++;
38514 #endif
38515 
38516     return(test_ret);
38517 }
38518 
38519 
38520 static int
test_xmlUCSIsCatCf(void)38521 test_xmlUCSIsCatCf(void) {
38522     int test_ret = 0;
38523 
38524 #if defined(LIBXML_UNICODE_ENABLED)
38525     int mem_base;
38526     int ret_val;
38527     int code; /* UCS code point */
38528     int n_code;
38529 
38530     for (n_code = 0;n_code < gen_nb_int;n_code++) {
38531         mem_base = xmlMemBlocks();
38532         code = gen_int(n_code, 0);
38533 
38534         ret_val = xmlUCSIsCatCf(code);
38535         desret_int(ret_val);
38536         call_tests++;
38537         des_int(n_code, code, 0);
38538         xmlResetLastError();
38539         if (mem_base != xmlMemBlocks()) {
38540             printf("Leak of %d blocks found in xmlUCSIsCatCf",
38541 	           xmlMemBlocks() - mem_base);
38542 	    test_ret++;
38543             printf(" %d", n_code);
38544             printf("\n");
38545         }
38546     }
38547     function_tests++;
38548 #endif
38549 
38550     return(test_ret);
38551 }
38552 
38553 
38554 static int
test_xmlUCSIsCatCo(void)38555 test_xmlUCSIsCatCo(void) {
38556     int test_ret = 0;
38557 
38558 #if defined(LIBXML_UNICODE_ENABLED)
38559     int mem_base;
38560     int ret_val;
38561     int code; /* UCS code point */
38562     int n_code;
38563 
38564     for (n_code = 0;n_code < gen_nb_int;n_code++) {
38565         mem_base = xmlMemBlocks();
38566         code = gen_int(n_code, 0);
38567 
38568         ret_val = xmlUCSIsCatCo(code);
38569         desret_int(ret_val);
38570         call_tests++;
38571         des_int(n_code, code, 0);
38572         xmlResetLastError();
38573         if (mem_base != xmlMemBlocks()) {
38574             printf("Leak of %d blocks found in xmlUCSIsCatCo",
38575 	           xmlMemBlocks() - mem_base);
38576 	    test_ret++;
38577             printf(" %d", n_code);
38578             printf("\n");
38579         }
38580     }
38581     function_tests++;
38582 #endif
38583 
38584     return(test_ret);
38585 }
38586 
38587 
38588 static int
test_xmlUCSIsCatCs(void)38589 test_xmlUCSIsCatCs(void) {
38590     int test_ret = 0;
38591 
38592 #if defined(LIBXML_UNICODE_ENABLED)
38593     int mem_base;
38594     int ret_val;
38595     int code; /* UCS code point */
38596     int n_code;
38597 
38598     for (n_code = 0;n_code < gen_nb_int;n_code++) {
38599         mem_base = xmlMemBlocks();
38600         code = gen_int(n_code, 0);
38601 
38602         ret_val = xmlUCSIsCatCs(code);
38603         desret_int(ret_val);
38604         call_tests++;
38605         des_int(n_code, code, 0);
38606         xmlResetLastError();
38607         if (mem_base != xmlMemBlocks()) {
38608             printf("Leak of %d blocks found in xmlUCSIsCatCs",
38609 	           xmlMemBlocks() - mem_base);
38610 	    test_ret++;
38611             printf(" %d", n_code);
38612             printf("\n");
38613         }
38614     }
38615     function_tests++;
38616 #endif
38617 
38618     return(test_ret);
38619 }
38620 
38621 
38622 static int
test_xmlUCSIsCatL(void)38623 test_xmlUCSIsCatL(void) {
38624     int test_ret = 0;
38625 
38626 #if defined(LIBXML_UNICODE_ENABLED)
38627     int mem_base;
38628     int ret_val;
38629     int code; /* UCS code point */
38630     int n_code;
38631 
38632     for (n_code = 0;n_code < gen_nb_int;n_code++) {
38633         mem_base = xmlMemBlocks();
38634         code = gen_int(n_code, 0);
38635 
38636         ret_val = xmlUCSIsCatL(code);
38637         desret_int(ret_val);
38638         call_tests++;
38639         des_int(n_code, code, 0);
38640         xmlResetLastError();
38641         if (mem_base != xmlMemBlocks()) {
38642             printf("Leak of %d blocks found in xmlUCSIsCatL",
38643 	           xmlMemBlocks() - mem_base);
38644 	    test_ret++;
38645             printf(" %d", n_code);
38646             printf("\n");
38647         }
38648     }
38649     function_tests++;
38650 #endif
38651 
38652     return(test_ret);
38653 }
38654 
38655 
38656 static int
test_xmlUCSIsCatLl(void)38657 test_xmlUCSIsCatLl(void) {
38658     int test_ret = 0;
38659 
38660 #if defined(LIBXML_UNICODE_ENABLED)
38661     int mem_base;
38662     int ret_val;
38663     int code; /* UCS code point */
38664     int n_code;
38665 
38666     for (n_code = 0;n_code < gen_nb_int;n_code++) {
38667         mem_base = xmlMemBlocks();
38668         code = gen_int(n_code, 0);
38669 
38670         ret_val = xmlUCSIsCatLl(code);
38671         desret_int(ret_val);
38672         call_tests++;
38673         des_int(n_code, code, 0);
38674         xmlResetLastError();
38675         if (mem_base != xmlMemBlocks()) {
38676             printf("Leak of %d blocks found in xmlUCSIsCatLl",
38677 	           xmlMemBlocks() - mem_base);
38678 	    test_ret++;
38679             printf(" %d", n_code);
38680             printf("\n");
38681         }
38682     }
38683     function_tests++;
38684 #endif
38685 
38686     return(test_ret);
38687 }
38688 
38689 
38690 static int
test_xmlUCSIsCatLm(void)38691 test_xmlUCSIsCatLm(void) {
38692     int test_ret = 0;
38693 
38694 #if defined(LIBXML_UNICODE_ENABLED)
38695     int mem_base;
38696     int ret_val;
38697     int code; /* UCS code point */
38698     int n_code;
38699 
38700     for (n_code = 0;n_code < gen_nb_int;n_code++) {
38701         mem_base = xmlMemBlocks();
38702         code = gen_int(n_code, 0);
38703 
38704         ret_val = xmlUCSIsCatLm(code);
38705         desret_int(ret_val);
38706         call_tests++;
38707         des_int(n_code, code, 0);
38708         xmlResetLastError();
38709         if (mem_base != xmlMemBlocks()) {
38710             printf("Leak of %d blocks found in xmlUCSIsCatLm",
38711 	           xmlMemBlocks() - mem_base);
38712 	    test_ret++;
38713             printf(" %d", n_code);
38714             printf("\n");
38715         }
38716     }
38717     function_tests++;
38718 #endif
38719 
38720     return(test_ret);
38721 }
38722 
38723 
38724 static int
test_xmlUCSIsCatLo(void)38725 test_xmlUCSIsCatLo(void) {
38726     int test_ret = 0;
38727 
38728 #if defined(LIBXML_UNICODE_ENABLED)
38729     int mem_base;
38730     int ret_val;
38731     int code; /* UCS code point */
38732     int n_code;
38733 
38734     for (n_code = 0;n_code < gen_nb_int;n_code++) {
38735         mem_base = xmlMemBlocks();
38736         code = gen_int(n_code, 0);
38737 
38738         ret_val = xmlUCSIsCatLo(code);
38739         desret_int(ret_val);
38740         call_tests++;
38741         des_int(n_code, code, 0);
38742         xmlResetLastError();
38743         if (mem_base != xmlMemBlocks()) {
38744             printf("Leak of %d blocks found in xmlUCSIsCatLo",
38745 	           xmlMemBlocks() - mem_base);
38746 	    test_ret++;
38747             printf(" %d", n_code);
38748             printf("\n");
38749         }
38750     }
38751     function_tests++;
38752 #endif
38753 
38754     return(test_ret);
38755 }
38756 
38757 
38758 static int
test_xmlUCSIsCatLt(void)38759 test_xmlUCSIsCatLt(void) {
38760     int test_ret = 0;
38761 
38762 #if defined(LIBXML_UNICODE_ENABLED)
38763     int mem_base;
38764     int ret_val;
38765     int code; /* UCS code point */
38766     int n_code;
38767 
38768     for (n_code = 0;n_code < gen_nb_int;n_code++) {
38769         mem_base = xmlMemBlocks();
38770         code = gen_int(n_code, 0);
38771 
38772         ret_val = xmlUCSIsCatLt(code);
38773         desret_int(ret_val);
38774         call_tests++;
38775         des_int(n_code, code, 0);
38776         xmlResetLastError();
38777         if (mem_base != xmlMemBlocks()) {
38778             printf("Leak of %d blocks found in xmlUCSIsCatLt",
38779 	           xmlMemBlocks() - mem_base);
38780 	    test_ret++;
38781             printf(" %d", n_code);
38782             printf("\n");
38783         }
38784     }
38785     function_tests++;
38786 #endif
38787 
38788     return(test_ret);
38789 }
38790 
38791 
38792 static int
test_xmlUCSIsCatLu(void)38793 test_xmlUCSIsCatLu(void) {
38794     int test_ret = 0;
38795 
38796 #if defined(LIBXML_UNICODE_ENABLED)
38797     int mem_base;
38798     int ret_val;
38799     int code; /* UCS code point */
38800     int n_code;
38801 
38802     for (n_code = 0;n_code < gen_nb_int;n_code++) {
38803         mem_base = xmlMemBlocks();
38804         code = gen_int(n_code, 0);
38805 
38806         ret_val = xmlUCSIsCatLu(code);
38807         desret_int(ret_val);
38808         call_tests++;
38809         des_int(n_code, code, 0);
38810         xmlResetLastError();
38811         if (mem_base != xmlMemBlocks()) {
38812             printf("Leak of %d blocks found in xmlUCSIsCatLu",
38813 	           xmlMemBlocks() - mem_base);
38814 	    test_ret++;
38815             printf(" %d", n_code);
38816             printf("\n");
38817         }
38818     }
38819     function_tests++;
38820 #endif
38821 
38822     return(test_ret);
38823 }
38824 
38825 
38826 static int
test_xmlUCSIsCatM(void)38827 test_xmlUCSIsCatM(void) {
38828     int test_ret = 0;
38829 
38830 #if defined(LIBXML_UNICODE_ENABLED)
38831     int mem_base;
38832     int ret_val;
38833     int code; /* UCS code point */
38834     int n_code;
38835 
38836     for (n_code = 0;n_code < gen_nb_int;n_code++) {
38837         mem_base = xmlMemBlocks();
38838         code = gen_int(n_code, 0);
38839 
38840         ret_val = xmlUCSIsCatM(code);
38841         desret_int(ret_val);
38842         call_tests++;
38843         des_int(n_code, code, 0);
38844         xmlResetLastError();
38845         if (mem_base != xmlMemBlocks()) {
38846             printf("Leak of %d blocks found in xmlUCSIsCatM",
38847 	           xmlMemBlocks() - mem_base);
38848 	    test_ret++;
38849             printf(" %d", n_code);
38850             printf("\n");
38851         }
38852     }
38853     function_tests++;
38854 #endif
38855 
38856     return(test_ret);
38857 }
38858 
38859 
38860 static int
test_xmlUCSIsCatMc(void)38861 test_xmlUCSIsCatMc(void) {
38862     int test_ret = 0;
38863 
38864 #if defined(LIBXML_UNICODE_ENABLED)
38865     int mem_base;
38866     int ret_val;
38867     int code; /* UCS code point */
38868     int n_code;
38869 
38870     for (n_code = 0;n_code < gen_nb_int;n_code++) {
38871         mem_base = xmlMemBlocks();
38872         code = gen_int(n_code, 0);
38873 
38874         ret_val = xmlUCSIsCatMc(code);
38875         desret_int(ret_val);
38876         call_tests++;
38877         des_int(n_code, code, 0);
38878         xmlResetLastError();
38879         if (mem_base != xmlMemBlocks()) {
38880             printf("Leak of %d blocks found in xmlUCSIsCatMc",
38881 	           xmlMemBlocks() - mem_base);
38882 	    test_ret++;
38883             printf(" %d", n_code);
38884             printf("\n");
38885         }
38886     }
38887     function_tests++;
38888 #endif
38889 
38890     return(test_ret);
38891 }
38892 
38893 
38894 static int
test_xmlUCSIsCatMe(void)38895 test_xmlUCSIsCatMe(void) {
38896     int test_ret = 0;
38897 
38898 #if defined(LIBXML_UNICODE_ENABLED)
38899     int mem_base;
38900     int ret_val;
38901     int code; /* UCS code point */
38902     int n_code;
38903 
38904     for (n_code = 0;n_code < gen_nb_int;n_code++) {
38905         mem_base = xmlMemBlocks();
38906         code = gen_int(n_code, 0);
38907 
38908         ret_val = xmlUCSIsCatMe(code);
38909         desret_int(ret_val);
38910         call_tests++;
38911         des_int(n_code, code, 0);
38912         xmlResetLastError();
38913         if (mem_base != xmlMemBlocks()) {
38914             printf("Leak of %d blocks found in xmlUCSIsCatMe",
38915 	           xmlMemBlocks() - mem_base);
38916 	    test_ret++;
38917             printf(" %d", n_code);
38918             printf("\n");
38919         }
38920     }
38921     function_tests++;
38922 #endif
38923 
38924     return(test_ret);
38925 }
38926 
38927 
38928 static int
test_xmlUCSIsCatMn(void)38929 test_xmlUCSIsCatMn(void) {
38930     int test_ret = 0;
38931 
38932 #if defined(LIBXML_UNICODE_ENABLED)
38933     int mem_base;
38934     int ret_val;
38935     int code; /* UCS code point */
38936     int n_code;
38937 
38938     for (n_code = 0;n_code < gen_nb_int;n_code++) {
38939         mem_base = xmlMemBlocks();
38940         code = gen_int(n_code, 0);
38941 
38942         ret_val = xmlUCSIsCatMn(code);
38943         desret_int(ret_val);
38944         call_tests++;
38945         des_int(n_code, code, 0);
38946         xmlResetLastError();
38947         if (mem_base != xmlMemBlocks()) {
38948             printf("Leak of %d blocks found in xmlUCSIsCatMn",
38949 	           xmlMemBlocks() - mem_base);
38950 	    test_ret++;
38951             printf(" %d", n_code);
38952             printf("\n");
38953         }
38954     }
38955     function_tests++;
38956 #endif
38957 
38958     return(test_ret);
38959 }
38960 
38961 
38962 static int
test_xmlUCSIsCatN(void)38963 test_xmlUCSIsCatN(void) {
38964     int test_ret = 0;
38965 
38966 #if defined(LIBXML_UNICODE_ENABLED)
38967     int mem_base;
38968     int ret_val;
38969     int code; /* UCS code point */
38970     int n_code;
38971 
38972     for (n_code = 0;n_code < gen_nb_int;n_code++) {
38973         mem_base = xmlMemBlocks();
38974         code = gen_int(n_code, 0);
38975 
38976         ret_val = xmlUCSIsCatN(code);
38977         desret_int(ret_val);
38978         call_tests++;
38979         des_int(n_code, code, 0);
38980         xmlResetLastError();
38981         if (mem_base != xmlMemBlocks()) {
38982             printf("Leak of %d blocks found in xmlUCSIsCatN",
38983 	           xmlMemBlocks() - mem_base);
38984 	    test_ret++;
38985             printf(" %d", n_code);
38986             printf("\n");
38987         }
38988     }
38989     function_tests++;
38990 #endif
38991 
38992     return(test_ret);
38993 }
38994 
38995 
38996 static int
test_xmlUCSIsCatNd(void)38997 test_xmlUCSIsCatNd(void) {
38998     int test_ret = 0;
38999 
39000 #if defined(LIBXML_UNICODE_ENABLED)
39001     int mem_base;
39002     int ret_val;
39003     int code; /* UCS code point */
39004     int n_code;
39005 
39006     for (n_code = 0;n_code < gen_nb_int;n_code++) {
39007         mem_base = xmlMemBlocks();
39008         code = gen_int(n_code, 0);
39009 
39010         ret_val = xmlUCSIsCatNd(code);
39011         desret_int(ret_val);
39012         call_tests++;
39013         des_int(n_code, code, 0);
39014         xmlResetLastError();
39015         if (mem_base != xmlMemBlocks()) {
39016             printf("Leak of %d blocks found in xmlUCSIsCatNd",
39017 	           xmlMemBlocks() - mem_base);
39018 	    test_ret++;
39019             printf(" %d", n_code);
39020             printf("\n");
39021         }
39022     }
39023     function_tests++;
39024 #endif
39025 
39026     return(test_ret);
39027 }
39028 
39029 
39030 static int
test_xmlUCSIsCatNl(void)39031 test_xmlUCSIsCatNl(void) {
39032     int test_ret = 0;
39033 
39034 #if defined(LIBXML_UNICODE_ENABLED)
39035     int mem_base;
39036     int ret_val;
39037     int code; /* UCS code point */
39038     int n_code;
39039 
39040     for (n_code = 0;n_code < gen_nb_int;n_code++) {
39041         mem_base = xmlMemBlocks();
39042         code = gen_int(n_code, 0);
39043 
39044         ret_val = xmlUCSIsCatNl(code);
39045         desret_int(ret_val);
39046         call_tests++;
39047         des_int(n_code, code, 0);
39048         xmlResetLastError();
39049         if (mem_base != xmlMemBlocks()) {
39050             printf("Leak of %d blocks found in xmlUCSIsCatNl",
39051 	           xmlMemBlocks() - mem_base);
39052 	    test_ret++;
39053             printf(" %d", n_code);
39054             printf("\n");
39055         }
39056     }
39057     function_tests++;
39058 #endif
39059 
39060     return(test_ret);
39061 }
39062 
39063 
39064 static int
test_xmlUCSIsCatNo(void)39065 test_xmlUCSIsCatNo(void) {
39066     int test_ret = 0;
39067 
39068 #if defined(LIBXML_UNICODE_ENABLED)
39069     int mem_base;
39070     int ret_val;
39071     int code; /* UCS code point */
39072     int n_code;
39073 
39074     for (n_code = 0;n_code < gen_nb_int;n_code++) {
39075         mem_base = xmlMemBlocks();
39076         code = gen_int(n_code, 0);
39077 
39078         ret_val = xmlUCSIsCatNo(code);
39079         desret_int(ret_val);
39080         call_tests++;
39081         des_int(n_code, code, 0);
39082         xmlResetLastError();
39083         if (mem_base != xmlMemBlocks()) {
39084             printf("Leak of %d blocks found in xmlUCSIsCatNo",
39085 	           xmlMemBlocks() - mem_base);
39086 	    test_ret++;
39087             printf(" %d", n_code);
39088             printf("\n");
39089         }
39090     }
39091     function_tests++;
39092 #endif
39093 
39094     return(test_ret);
39095 }
39096 
39097 
39098 static int
test_xmlUCSIsCatP(void)39099 test_xmlUCSIsCatP(void) {
39100     int test_ret = 0;
39101 
39102 #if defined(LIBXML_UNICODE_ENABLED)
39103     int mem_base;
39104     int ret_val;
39105     int code; /* UCS code point */
39106     int n_code;
39107 
39108     for (n_code = 0;n_code < gen_nb_int;n_code++) {
39109         mem_base = xmlMemBlocks();
39110         code = gen_int(n_code, 0);
39111 
39112         ret_val = xmlUCSIsCatP(code);
39113         desret_int(ret_val);
39114         call_tests++;
39115         des_int(n_code, code, 0);
39116         xmlResetLastError();
39117         if (mem_base != xmlMemBlocks()) {
39118             printf("Leak of %d blocks found in xmlUCSIsCatP",
39119 	           xmlMemBlocks() - mem_base);
39120 	    test_ret++;
39121             printf(" %d", n_code);
39122             printf("\n");
39123         }
39124     }
39125     function_tests++;
39126 #endif
39127 
39128     return(test_ret);
39129 }
39130 
39131 
39132 static int
test_xmlUCSIsCatPc(void)39133 test_xmlUCSIsCatPc(void) {
39134     int test_ret = 0;
39135 
39136 #if defined(LIBXML_UNICODE_ENABLED)
39137     int mem_base;
39138     int ret_val;
39139     int code; /* UCS code point */
39140     int n_code;
39141 
39142     for (n_code = 0;n_code < gen_nb_int;n_code++) {
39143         mem_base = xmlMemBlocks();
39144         code = gen_int(n_code, 0);
39145 
39146         ret_val = xmlUCSIsCatPc(code);
39147         desret_int(ret_val);
39148         call_tests++;
39149         des_int(n_code, code, 0);
39150         xmlResetLastError();
39151         if (mem_base != xmlMemBlocks()) {
39152             printf("Leak of %d blocks found in xmlUCSIsCatPc",
39153 	           xmlMemBlocks() - mem_base);
39154 	    test_ret++;
39155             printf(" %d", n_code);
39156             printf("\n");
39157         }
39158     }
39159     function_tests++;
39160 #endif
39161 
39162     return(test_ret);
39163 }
39164 
39165 
39166 static int
test_xmlUCSIsCatPd(void)39167 test_xmlUCSIsCatPd(void) {
39168     int test_ret = 0;
39169 
39170 #if defined(LIBXML_UNICODE_ENABLED)
39171     int mem_base;
39172     int ret_val;
39173     int code; /* UCS code point */
39174     int n_code;
39175 
39176     for (n_code = 0;n_code < gen_nb_int;n_code++) {
39177         mem_base = xmlMemBlocks();
39178         code = gen_int(n_code, 0);
39179 
39180         ret_val = xmlUCSIsCatPd(code);
39181         desret_int(ret_val);
39182         call_tests++;
39183         des_int(n_code, code, 0);
39184         xmlResetLastError();
39185         if (mem_base != xmlMemBlocks()) {
39186             printf("Leak of %d blocks found in xmlUCSIsCatPd",
39187 	           xmlMemBlocks() - mem_base);
39188 	    test_ret++;
39189             printf(" %d", n_code);
39190             printf("\n");
39191         }
39192     }
39193     function_tests++;
39194 #endif
39195 
39196     return(test_ret);
39197 }
39198 
39199 
39200 static int
test_xmlUCSIsCatPe(void)39201 test_xmlUCSIsCatPe(void) {
39202     int test_ret = 0;
39203 
39204 #if defined(LIBXML_UNICODE_ENABLED)
39205     int mem_base;
39206     int ret_val;
39207     int code; /* UCS code point */
39208     int n_code;
39209 
39210     for (n_code = 0;n_code < gen_nb_int;n_code++) {
39211         mem_base = xmlMemBlocks();
39212         code = gen_int(n_code, 0);
39213 
39214         ret_val = xmlUCSIsCatPe(code);
39215         desret_int(ret_val);
39216         call_tests++;
39217         des_int(n_code, code, 0);
39218         xmlResetLastError();
39219         if (mem_base != xmlMemBlocks()) {
39220             printf("Leak of %d blocks found in xmlUCSIsCatPe",
39221 	           xmlMemBlocks() - mem_base);
39222 	    test_ret++;
39223             printf(" %d", n_code);
39224             printf("\n");
39225         }
39226     }
39227     function_tests++;
39228 #endif
39229 
39230     return(test_ret);
39231 }
39232 
39233 
39234 static int
test_xmlUCSIsCatPf(void)39235 test_xmlUCSIsCatPf(void) {
39236     int test_ret = 0;
39237 
39238 #if defined(LIBXML_UNICODE_ENABLED)
39239     int mem_base;
39240     int ret_val;
39241     int code; /* UCS code point */
39242     int n_code;
39243 
39244     for (n_code = 0;n_code < gen_nb_int;n_code++) {
39245         mem_base = xmlMemBlocks();
39246         code = gen_int(n_code, 0);
39247 
39248         ret_val = xmlUCSIsCatPf(code);
39249         desret_int(ret_val);
39250         call_tests++;
39251         des_int(n_code, code, 0);
39252         xmlResetLastError();
39253         if (mem_base != xmlMemBlocks()) {
39254             printf("Leak of %d blocks found in xmlUCSIsCatPf",
39255 	           xmlMemBlocks() - mem_base);
39256 	    test_ret++;
39257             printf(" %d", n_code);
39258             printf("\n");
39259         }
39260     }
39261     function_tests++;
39262 #endif
39263 
39264     return(test_ret);
39265 }
39266 
39267 
39268 static int
test_xmlUCSIsCatPi(void)39269 test_xmlUCSIsCatPi(void) {
39270     int test_ret = 0;
39271 
39272 #if defined(LIBXML_UNICODE_ENABLED)
39273     int mem_base;
39274     int ret_val;
39275     int code; /* UCS code point */
39276     int n_code;
39277 
39278     for (n_code = 0;n_code < gen_nb_int;n_code++) {
39279         mem_base = xmlMemBlocks();
39280         code = gen_int(n_code, 0);
39281 
39282         ret_val = xmlUCSIsCatPi(code);
39283         desret_int(ret_val);
39284         call_tests++;
39285         des_int(n_code, code, 0);
39286         xmlResetLastError();
39287         if (mem_base != xmlMemBlocks()) {
39288             printf("Leak of %d blocks found in xmlUCSIsCatPi",
39289 	           xmlMemBlocks() - mem_base);
39290 	    test_ret++;
39291             printf(" %d", n_code);
39292             printf("\n");
39293         }
39294     }
39295     function_tests++;
39296 #endif
39297 
39298     return(test_ret);
39299 }
39300 
39301 
39302 static int
test_xmlUCSIsCatPo(void)39303 test_xmlUCSIsCatPo(void) {
39304     int test_ret = 0;
39305 
39306 #if defined(LIBXML_UNICODE_ENABLED)
39307     int mem_base;
39308     int ret_val;
39309     int code; /* UCS code point */
39310     int n_code;
39311 
39312     for (n_code = 0;n_code < gen_nb_int;n_code++) {
39313         mem_base = xmlMemBlocks();
39314         code = gen_int(n_code, 0);
39315 
39316         ret_val = xmlUCSIsCatPo(code);
39317         desret_int(ret_val);
39318         call_tests++;
39319         des_int(n_code, code, 0);
39320         xmlResetLastError();
39321         if (mem_base != xmlMemBlocks()) {
39322             printf("Leak of %d blocks found in xmlUCSIsCatPo",
39323 	           xmlMemBlocks() - mem_base);
39324 	    test_ret++;
39325             printf(" %d", n_code);
39326             printf("\n");
39327         }
39328     }
39329     function_tests++;
39330 #endif
39331 
39332     return(test_ret);
39333 }
39334 
39335 
39336 static int
test_xmlUCSIsCatPs(void)39337 test_xmlUCSIsCatPs(void) {
39338     int test_ret = 0;
39339 
39340 #if defined(LIBXML_UNICODE_ENABLED)
39341     int mem_base;
39342     int ret_val;
39343     int code; /* UCS code point */
39344     int n_code;
39345 
39346     for (n_code = 0;n_code < gen_nb_int;n_code++) {
39347         mem_base = xmlMemBlocks();
39348         code = gen_int(n_code, 0);
39349 
39350         ret_val = xmlUCSIsCatPs(code);
39351         desret_int(ret_val);
39352         call_tests++;
39353         des_int(n_code, code, 0);
39354         xmlResetLastError();
39355         if (mem_base != xmlMemBlocks()) {
39356             printf("Leak of %d blocks found in xmlUCSIsCatPs",
39357 	           xmlMemBlocks() - mem_base);
39358 	    test_ret++;
39359             printf(" %d", n_code);
39360             printf("\n");
39361         }
39362     }
39363     function_tests++;
39364 #endif
39365 
39366     return(test_ret);
39367 }
39368 
39369 
39370 static int
test_xmlUCSIsCatS(void)39371 test_xmlUCSIsCatS(void) {
39372     int test_ret = 0;
39373 
39374 #if defined(LIBXML_UNICODE_ENABLED)
39375     int mem_base;
39376     int ret_val;
39377     int code; /* UCS code point */
39378     int n_code;
39379 
39380     for (n_code = 0;n_code < gen_nb_int;n_code++) {
39381         mem_base = xmlMemBlocks();
39382         code = gen_int(n_code, 0);
39383 
39384         ret_val = xmlUCSIsCatS(code);
39385         desret_int(ret_val);
39386         call_tests++;
39387         des_int(n_code, code, 0);
39388         xmlResetLastError();
39389         if (mem_base != xmlMemBlocks()) {
39390             printf("Leak of %d blocks found in xmlUCSIsCatS",
39391 	           xmlMemBlocks() - mem_base);
39392 	    test_ret++;
39393             printf(" %d", n_code);
39394             printf("\n");
39395         }
39396     }
39397     function_tests++;
39398 #endif
39399 
39400     return(test_ret);
39401 }
39402 
39403 
39404 static int
test_xmlUCSIsCatSc(void)39405 test_xmlUCSIsCatSc(void) {
39406     int test_ret = 0;
39407 
39408 #if defined(LIBXML_UNICODE_ENABLED)
39409     int mem_base;
39410     int ret_val;
39411     int code; /* UCS code point */
39412     int n_code;
39413 
39414     for (n_code = 0;n_code < gen_nb_int;n_code++) {
39415         mem_base = xmlMemBlocks();
39416         code = gen_int(n_code, 0);
39417 
39418         ret_val = xmlUCSIsCatSc(code);
39419         desret_int(ret_val);
39420         call_tests++;
39421         des_int(n_code, code, 0);
39422         xmlResetLastError();
39423         if (mem_base != xmlMemBlocks()) {
39424             printf("Leak of %d blocks found in xmlUCSIsCatSc",
39425 	           xmlMemBlocks() - mem_base);
39426 	    test_ret++;
39427             printf(" %d", n_code);
39428             printf("\n");
39429         }
39430     }
39431     function_tests++;
39432 #endif
39433 
39434     return(test_ret);
39435 }
39436 
39437 
39438 static int
test_xmlUCSIsCatSk(void)39439 test_xmlUCSIsCatSk(void) {
39440     int test_ret = 0;
39441 
39442 #if defined(LIBXML_UNICODE_ENABLED)
39443     int mem_base;
39444     int ret_val;
39445     int code; /* UCS code point */
39446     int n_code;
39447 
39448     for (n_code = 0;n_code < gen_nb_int;n_code++) {
39449         mem_base = xmlMemBlocks();
39450         code = gen_int(n_code, 0);
39451 
39452         ret_val = xmlUCSIsCatSk(code);
39453         desret_int(ret_val);
39454         call_tests++;
39455         des_int(n_code, code, 0);
39456         xmlResetLastError();
39457         if (mem_base != xmlMemBlocks()) {
39458             printf("Leak of %d blocks found in xmlUCSIsCatSk",
39459 	           xmlMemBlocks() - mem_base);
39460 	    test_ret++;
39461             printf(" %d", n_code);
39462             printf("\n");
39463         }
39464     }
39465     function_tests++;
39466 #endif
39467 
39468     return(test_ret);
39469 }
39470 
39471 
39472 static int
test_xmlUCSIsCatSm(void)39473 test_xmlUCSIsCatSm(void) {
39474     int test_ret = 0;
39475 
39476 #if defined(LIBXML_UNICODE_ENABLED)
39477     int mem_base;
39478     int ret_val;
39479     int code; /* UCS code point */
39480     int n_code;
39481 
39482     for (n_code = 0;n_code < gen_nb_int;n_code++) {
39483         mem_base = xmlMemBlocks();
39484         code = gen_int(n_code, 0);
39485 
39486         ret_val = xmlUCSIsCatSm(code);
39487         desret_int(ret_val);
39488         call_tests++;
39489         des_int(n_code, code, 0);
39490         xmlResetLastError();
39491         if (mem_base != xmlMemBlocks()) {
39492             printf("Leak of %d blocks found in xmlUCSIsCatSm",
39493 	           xmlMemBlocks() - mem_base);
39494 	    test_ret++;
39495             printf(" %d", n_code);
39496             printf("\n");
39497         }
39498     }
39499     function_tests++;
39500 #endif
39501 
39502     return(test_ret);
39503 }
39504 
39505 
39506 static int
test_xmlUCSIsCatSo(void)39507 test_xmlUCSIsCatSo(void) {
39508     int test_ret = 0;
39509 
39510 #if defined(LIBXML_UNICODE_ENABLED)
39511     int mem_base;
39512     int ret_val;
39513     int code; /* UCS code point */
39514     int n_code;
39515 
39516     for (n_code = 0;n_code < gen_nb_int;n_code++) {
39517         mem_base = xmlMemBlocks();
39518         code = gen_int(n_code, 0);
39519 
39520         ret_val = xmlUCSIsCatSo(code);
39521         desret_int(ret_val);
39522         call_tests++;
39523         des_int(n_code, code, 0);
39524         xmlResetLastError();
39525         if (mem_base != xmlMemBlocks()) {
39526             printf("Leak of %d blocks found in xmlUCSIsCatSo",
39527 	           xmlMemBlocks() - mem_base);
39528 	    test_ret++;
39529             printf(" %d", n_code);
39530             printf("\n");
39531         }
39532     }
39533     function_tests++;
39534 #endif
39535 
39536     return(test_ret);
39537 }
39538 
39539 
39540 static int
test_xmlUCSIsCatZ(void)39541 test_xmlUCSIsCatZ(void) {
39542     int test_ret = 0;
39543 
39544 #if defined(LIBXML_UNICODE_ENABLED)
39545     int mem_base;
39546     int ret_val;
39547     int code; /* UCS code point */
39548     int n_code;
39549 
39550     for (n_code = 0;n_code < gen_nb_int;n_code++) {
39551         mem_base = xmlMemBlocks();
39552         code = gen_int(n_code, 0);
39553 
39554         ret_val = xmlUCSIsCatZ(code);
39555         desret_int(ret_val);
39556         call_tests++;
39557         des_int(n_code, code, 0);
39558         xmlResetLastError();
39559         if (mem_base != xmlMemBlocks()) {
39560             printf("Leak of %d blocks found in xmlUCSIsCatZ",
39561 	           xmlMemBlocks() - mem_base);
39562 	    test_ret++;
39563             printf(" %d", n_code);
39564             printf("\n");
39565         }
39566     }
39567     function_tests++;
39568 #endif
39569 
39570     return(test_ret);
39571 }
39572 
39573 
39574 static int
test_xmlUCSIsCatZl(void)39575 test_xmlUCSIsCatZl(void) {
39576     int test_ret = 0;
39577 
39578 #if defined(LIBXML_UNICODE_ENABLED)
39579     int mem_base;
39580     int ret_val;
39581     int code; /* UCS code point */
39582     int n_code;
39583 
39584     for (n_code = 0;n_code < gen_nb_int;n_code++) {
39585         mem_base = xmlMemBlocks();
39586         code = gen_int(n_code, 0);
39587 
39588         ret_val = xmlUCSIsCatZl(code);
39589         desret_int(ret_val);
39590         call_tests++;
39591         des_int(n_code, code, 0);
39592         xmlResetLastError();
39593         if (mem_base != xmlMemBlocks()) {
39594             printf("Leak of %d blocks found in xmlUCSIsCatZl",
39595 	           xmlMemBlocks() - mem_base);
39596 	    test_ret++;
39597             printf(" %d", n_code);
39598             printf("\n");
39599         }
39600     }
39601     function_tests++;
39602 #endif
39603 
39604     return(test_ret);
39605 }
39606 
39607 
39608 static int
test_xmlUCSIsCatZp(void)39609 test_xmlUCSIsCatZp(void) {
39610     int test_ret = 0;
39611 
39612 #if defined(LIBXML_UNICODE_ENABLED)
39613     int mem_base;
39614     int ret_val;
39615     int code; /* UCS code point */
39616     int n_code;
39617 
39618     for (n_code = 0;n_code < gen_nb_int;n_code++) {
39619         mem_base = xmlMemBlocks();
39620         code = gen_int(n_code, 0);
39621 
39622         ret_val = xmlUCSIsCatZp(code);
39623         desret_int(ret_val);
39624         call_tests++;
39625         des_int(n_code, code, 0);
39626         xmlResetLastError();
39627         if (mem_base != xmlMemBlocks()) {
39628             printf("Leak of %d blocks found in xmlUCSIsCatZp",
39629 	           xmlMemBlocks() - mem_base);
39630 	    test_ret++;
39631             printf(" %d", n_code);
39632             printf("\n");
39633         }
39634     }
39635     function_tests++;
39636 #endif
39637 
39638     return(test_ret);
39639 }
39640 
39641 
39642 static int
test_xmlUCSIsCatZs(void)39643 test_xmlUCSIsCatZs(void) {
39644     int test_ret = 0;
39645 
39646 #if defined(LIBXML_UNICODE_ENABLED)
39647     int mem_base;
39648     int ret_val;
39649     int code; /* UCS code point */
39650     int n_code;
39651 
39652     for (n_code = 0;n_code < gen_nb_int;n_code++) {
39653         mem_base = xmlMemBlocks();
39654         code = gen_int(n_code, 0);
39655 
39656         ret_val = xmlUCSIsCatZs(code);
39657         desret_int(ret_val);
39658         call_tests++;
39659         des_int(n_code, code, 0);
39660         xmlResetLastError();
39661         if (mem_base != xmlMemBlocks()) {
39662             printf("Leak of %d blocks found in xmlUCSIsCatZs",
39663 	           xmlMemBlocks() - mem_base);
39664 	    test_ret++;
39665             printf(" %d", n_code);
39666             printf("\n");
39667         }
39668     }
39669     function_tests++;
39670 #endif
39671 
39672     return(test_ret);
39673 }
39674 
39675 
39676 static int
test_xmlUCSIsCherokee(void)39677 test_xmlUCSIsCherokee(void) {
39678     int test_ret = 0;
39679 
39680 #if defined(LIBXML_UNICODE_ENABLED)
39681     int mem_base;
39682     int ret_val;
39683     int code; /* UCS code point */
39684     int n_code;
39685 
39686     for (n_code = 0;n_code < gen_nb_int;n_code++) {
39687         mem_base = xmlMemBlocks();
39688         code = gen_int(n_code, 0);
39689 
39690         ret_val = xmlUCSIsCherokee(code);
39691         desret_int(ret_val);
39692         call_tests++;
39693         des_int(n_code, code, 0);
39694         xmlResetLastError();
39695         if (mem_base != xmlMemBlocks()) {
39696             printf("Leak of %d blocks found in xmlUCSIsCherokee",
39697 	           xmlMemBlocks() - mem_base);
39698 	    test_ret++;
39699             printf(" %d", n_code);
39700             printf("\n");
39701         }
39702     }
39703     function_tests++;
39704 #endif
39705 
39706     return(test_ret);
39707 }
39708 
39709 
39710 static int
test_xmlUCSIsCombiningDiacriticalMarks(void)39711 test_xmlUCSIsCombiningDiacriticalMarks(void) {
39712     int test_ret = 0;
39713 
39714 #if defined(LIBXML_UNICODE_ENABLED)
39715     int mem_base;
39716     int ret_val;
39717     int code; /* UCS code point */
39718     int n_code;
39719 
39720     for (n_code = 0;n_code < gen_nb_int;n_code++) {
39721         mem_base = xmlMemBlocks();
39722         code = gen_int(n_code, 0);
39723 
39724         ret_val = xmlUCSIsCombiningDiacriticalMarks(code);
39725         desret_int(ret_val);
39726         call_tests++;
39727         des_int(n_code, code, 0);
39728         xmlResetLastError();
39729         if (mem_base != xmlMemBlocks()) {
39730             printf("Leak of %d blocks found in xmlUCSIsCombiningDiacriticalMarks",
39731 	           xmlMemBlocks() - mem_base);
39732 	    test_ret++;
39733             printf(" %d", n_code);
39734             printf("\n");
39735         }
39736     }
39737     function_tests++;
39738 #endif
39739 
39740     return(test_ret);
39741 }
39742 
39743 
39744 static int
test_xmlUCSIsCombiningDiacriticalMarksforSymbols(void)39745 test_xmlUCSIsCombiningDiacriticalMarksforSymbols(void) {
39746     int test_ret = 0;
39747 
39748 #if defined(LIBXML_UNICODE_ENABLED)
39749     int mem_base;
39750     int ret_val;
39751     int code; /* UCS code point */
39752     int n_code;
39753 
39754     for (n_code = 0;n_code < gen_nb_int;n_code++) {
39755         mem_base = xmlMemBlocks();
39756         code = gen_int(n_code, 0);
39757 
39758         ret_val = xmlUCSIsCombiningDiacriticalMarksforSymbols(code);
39759         desret_int(ret_val);
39760         call_tests++;
39761         des_int(n_code, code, 0);
39762         xmlResetLastError();
39763         if (mem_base != xmlMemBlocks()) {
39764             printf("Leak of %d blocks found in xmlUCSIsCombiningDiacriticalMarksforSymbols",
39765 	           xmlMemBlocks() - mem_base);
39766 	    test_ret++;
39767             printf(" %d", n_code);
39768             printf("\n");
39769         }
39770     }
39771     function_tests++;
39772 #endif
39773 
39774     return(test_ret);
39775 }
39776 
39777 
39778 static int
test_xmlUCSIsCombiningHalfMarks(void)39779 test_xmlUCSIsCombiningHalfMarks(void) {
39780     int test_ret = 0;
39781 
39782 #if defined(LIBXML_UNICODE_ENABLED)
39783     int mem_base;
39784     int ret_val;
39785     int code; /* UCS code point */
39786     int n_code;
39787 
39788     for (n_code = 0;n_code < gen_nb_int;n_code++) {
39789         mem_base = xmlMemBlocks();
39790         code = gen_int(n_code, 0);
39791 
39792         ret_val = xmlUCSIsCombiningHalfMarks(code);
39793         desret_int(ret_val);
39794         call_tests++;
39795         des_int(n_code, code, 0);
39796         xmlResetLastError();
39797         if (mem_base != xmlMemBlocks()) {
39798             printf("Leak of %d blocks found in xmlUCSIsCombiningHalfMarks",
39799 	           xmlMemBlocks() - mem_base);
39800 	    test_ret++;
39801             printf(" %d", n_code);
39802             printf("\n");
39803         }
39804     }
39805     function_tests++;
39806 #endif
39807 
39808     return(test_ret);
39809 }
39810 
39811 
39812 static int
test_xmlUCSIsCombiningMarksforSymbols(void)39813 test_xmlUCSIsCombiningMarksforSymbols(void) {
39814     int test_ret = 0;
39815 
39816 #if defined(LIBXML_UNICODE_ENABLED)
39817     int mem_base;
39818     int ret_val;
39819     int code; /* UCS code point */
39820     int n_code;
39821 
39822     for (n_code = 0;n_code < gen_nb_int;n_code++) {
39823         mem_base = xmlMemBlocks();
39824         code = gen_int(n_code, 0);
39825 
39826         ret_val = xmlUCSIsCombiningMarksforSymbols(code);
39827         desret_int(ret_val);
39828         call_tests++;
39829         des_int(n_code, code, 0);
39830         xmlResetLastError();
39831         if (mem_base != xmlMemBlocks()) {
39832             printf("Leak of %d blocks found in xmlUCSIsCombiningMarksforSymbols",
39833 	           xmlMemBlocks() - mem_base);
39834 	    test_ret++;
39835             printf(" %d", n_code);
39836             printf("\n");
39837         }
39838     }
39839     function_tests++;
39840 #endif
39841 
39842     return(test_ret);
39843 }
39844 
39845 
39846 static int
test_xmlUCSIsControlPictures(void)39847 test_xmlUCSIsControlPictures(void) {
39848     int test_ret = 0;
39849 
39850 #if defined(LIBXML_UNICODE_ENABLED)
39851     int mem_base;
39852     int ret_val;
39853     int code; /* UCS code point */
39854     int n_code;
39855 
39856     for (n_code = 0;n_code < gen_nb_int;n_code++) {
39857         mem_base = xmlMemBlocks();
39858         code = gen_int(n_code, 0);
39859 
39860         ret_val = xmlUCSIsControlPictures(code);
39861         desret_int(ret_val);
39862         call_tests++;
39863         des_int(n_code, code, 0);
39864         xmlResetLastError();
39865         if (mem_base != xmlMemBlocks()) {
39866             printf("Leak of %d blocks found in xmlUCSIsControlPictures",
39867 	           xmlMemBlocks() - mem_base);
39868 	    test_ret++;
39869             printf(" %d", n_code);
39870             printf("\n");
39871         }
39872     }
39873     function_tests++;
39874 #endif
39875 
39876     return(test_ret);
39877 }
39878 
39879 
39880 static int
test_xmlUCSIsCurrencySymbols(void)39881 test_xmlUCSIsCurrencySymbols(void) {
39882     int test_ret = 0;
39883 
39884 #if defined(LIBXML_UNICODE_ENABLED)
39885     int mem_base;
39886     int ret_val;
39887     int code; /* UCS code point */
39888     int n_code;
39889 
39890     for (n_code = 0;n_code < gen_nb_int;n_code++) {
39891         mem_base = xmlMemBlocks();
39892         code = gen_int(n_code, 0);
39893 
39894         ret_val = xmlUCSIsCurrencySymbols(code);
39895         desret_int(ret_val);
39896         call_tests++;
39897         des_int(n_code, code, 0);
39898         xmlResetLastError();
39899         if (mem_base != xmlMemBlocks()) {
39900             printf("Leak of %d blocks found in xmlUCSIsCurrencySymbols",
39901 	           xmlMemBlocks() - mem_base);
39902 	    test_ret++;
39903             printf(" %d", n_code);
39904             printf("\n");
39905         }
39906     }
39907     function_tests++;
39908 #endif
39909 
39910     return(test_ret);
39911 }
39912 
39913 
39914 static int
test_xmlUCSIsCypriotSyllabary(void)39915 test_xmlUCSIsCypriotSyllabary(void) {
39916     int test_ret = 0;
39917 
39918 #if defined(LIBXML_UNICODE_ENABLED)
39919     int mem_base;
39920     int ret_val;
39921     int code; /* UCS code point */
39922     int n_code;
39923 
39924     for (n_code = 0;n_code < gen_nb_int;n_code++) {
39925         mem_base = xmlMemBlocks();
39926         code = gen_int(n_code, 0);
39927 
39928         ret_val = xmlUCSIsCypriotSyllabary(code);
39929         desret_int(ret_val);
39930         call_tests++;
39931         des_int(n_code, code, 0);
39932         xmlResetLastError();
39933         if (mem_base != xmlMemBlocks()) {
39934             printf("Leak of %d blocks found in xmlUCSIsCypriotSyllabary",
39935 	           xmlMemBlocks() - mem_base);
39936 	    test_ret++;
39937             printf(" %d", n_code);
39938             printf("\n");
39939         }
39940     }
39941     function_tests++;
39942 #endif
39943 
39944     return(test_ret);
39945 }
39946 
39947 
39948 static int
test_xmlUCSIsCyrillic(void)39949 test_xmlUCSIsCyrillic(void) {
39950     int test_ret = 0;
39951 
39952 #if defined(LIBXML_UNICODE_ENABLED)
39953     int mem_base;
39954     int ret_val;
39955     int code; /* UCS code point */
39956     int n_code;
39957 
39958     for (n_code = 0;n_code < gen_nb_int;n_code++) {
39959         mem_base = xmlMemBlocks();
39960         code = gen_int(n_code, 0);
39961 
39962         ret_val = xmlUCSIsCyrillic(code);
39963         desret_int(ret_val);
39964         call_tests++;
39965         des_int(n_code, code, 0);
39966         xmlResetLastError();
39967         if (mem_base != xmlMemBlocks()) {
39968             printf("Leak of %d blocks found in xmlUCSIsCyrillic",
39969 	           xmlMemBlocks() - mem_base);
39970 	    test_ret++;
39971             printf(" %d", n_code);
39972             printf("\n");
39973         }
39974     }
39975     function_tests++;
39976 #endif
39977 
39978     return(test_ret);
39979 }
39980 
39981 
39982 static int
test_xmlUCSIsCyrillicSupplement(void)39983 test_xmlUCSIsCyrillicSupplement(void) {
39984     int test_ret = 0;
39985 
39986 #if defined(LIBXML_UNICODE_ENABLED)
39987     int mem_base;
39988     int ret_val;
39989     int code; /* UCS code point */
39990     int n_code;
39991 
39992     for (n_code = 0;n_code < gen_nb_int;n_code++) {
39993         mem_base = xmlMemBlocks();
39994         code = gen_int(n_code, 0);
39995 
39996         ret_val = xmlUCSIsCyrillicSupplement(code);
39997         desret_int(ret_val);
39998         call_tests++;
39999         des_int(n_code, code, 0);
40000         xmlResetLastError();
40001         if (mem_base != xmlMemBlocks()) {
40002             printf("Leak of %d blocks found in xmlUCSIsCyrillicSupplement",
40003 	           xmlMemBlocks() - mem_base);
40004 	    test_ret++;
40005             printf(" %d", n_code);
40006             printf("\n");
40007         }
40008     }
40009     function_tests++;
40010 #endif
40011 
40012     return(test_ret);
40013 }
40014 
40015 
40016 static int
test_xmlUCSIsDeseret(void)40017 test_xmlUCSIsDeseret(void) {
40018     int test_ret = 0;
40019 
40020 #if defined(LIBXML_UNICODE_ENABLED)
40021     int mem_base;
40022     int ret_val;
40023     int code; /* UCS code point */
40024     int n_code;
40025 
40026     for (n_code = 0;n_code < gen_nb_int;n_code++) {
40027         mem_base = xmlMemBlocks();
40028         code = gen_int(n_code, 0);
40029 
40030         ret_val = xmlUCSIsDeseret(code);
40031         desret_int(ret_val);
40032         call_tests++;
40033         des_int(n_code, code, 0);
40034         xmlResetLastError();
40035         if (mem_base != xmlMemBlocks()) {
40036             printf("Leak of %d blocks found in xmlUCSIsDeseret",
40037 	           xmlMemBlocks() - mem_base);
40038 	    test_ret++;
40039             printf(" %d", n_code);
40040             printf("\n");
40041         }
40042     }
40043     function_tests++;
40044 #endif
40045 
40046     return(test_ret);
40047 }
40048 
40049 
40050 static int
test_xmlUCSIsDevanagari(void)40051 test_xmlUCSIsDevanagari(void) {
40052     int test_ret = 0;
40053 
40054 #if defined(LIBXML_UNICODE_ENABLED)
40055     int mem_base;
40056     int ret_val;
40057     int code; /* UCS code point */
40058     int n_code;
40059 
40060     for (n_code = 0;n_code < gen_nb_int;n_code++) {
40061         mem_base = xmlMemBlocks();
40062         code = gen_int(n_code, 0);
40063 
40064         ret_val = xmlUCSIsDevanagari(code);
40065         desret_int(ret_val);
40066         call_tests++;
40067         des_int(n_code, code, 0);
40068         xmlResetLastError();
40069         if (mem_base != xmlMemBlocks()) {
40070             printf("Leak of %d blocks found in xmlUCSIsDevanagari",
40071 	           xmlMemBlocks() - mem_base);
40072 	    test_ret++;
40073             printf(" %d", n_code);
40074             printf("\n");
40075         }
40076     }
40077     function_tests++;
40078 #endif
40079 
40080     return(test_ret);
40081 }
40082 
40083 
40084 static int
test_xmlUCSIsDingbats(void)40085 test_xmlUCSIsDingbats(void) {
40086     int test_ret = 0;
40087 
40088 #if defined(LIBXML_UNICODE_ENABLED)
40089     int mem_base;
40090     int ret_val;
40091     int code; /* UCS code point */
40092     int n_code;
40093 
40094     for (n_code = 0;n_code < gen_nb_int;n_code++) {
40095         mem_base = xmlMemBlocks();
40096         code = gen_int(n_code, 0);
40097 
40098         ret_val = xmlUCSIsDingbats(code);
40099         desret_int(ret_val);
40100         call_tests++;
40101         des_int(n_code, code, 0);
40102         xmlResetLastError();
40103         if (mem_base != xmlMemBlocks()) {
40104             printf("Leak of %d blocks found in xmlUCSIsDingbats",
40105 	           xmlMemBlocks() - mem_base);
40106 	    test_ret++;
40107             printf(" %d", n_code);
40108             printf("\n");
40109         }
40110     }
40111     function_tests++;
40112 #endif
40113 
40114     return(test_ret);
40115 }
40116 
40117 
40118 static int
test_xmlUCSIsEnclosedAlphanumerics(void)40119 test_xmlUCSIsEnclosedAlphanumerics(void) {
40120     int test_ret = 0;
40121 
40122 #if defined(LIBXML_UNICODE_ENABLED)
40123     int mem_base;
40124     int ret_val;
40125     int code; /* UCS code point */
40126     int n_code;
40127 
40128     for (n_code = 0;n_code < gen_nb_int;n_code++) {
40129         mem_base = xmlMemBlocks();
40130         code = gen_int(n_code, 0);
40131 
40132         ret_val = xmlUCSIsEnclosedAlphanumerics(code);
40133         desret_int(ret_val);
40134         call_tests++;
40135         des_int(n_code, code, 0);
40136         xmlResetLastError();
40137         if (mem_base != xmlMemBlocks()) {
40138             printf("Leak of %d blocks found in xmlUCSIsEnclosedAlphanumerics",
40139 	           xmlMemBlocks() - mem_base);
40140 	    test_ret++;
40141             printf(" %d", n_code);
40142             printf("\n");
40143         }
40144     }
40145     function_tests++;
40146 #endif
40147 
40148     return(test_ret);
40149 }
40150 
40151 
40152 static int
test_xmlUCSIsEnclosedCJKLettersandMonths(void)40153 test_xmlUCSIsEnclosedCJKLettersandMonths(void) {
40154     int test_ret = 0;
40155 
40156 #if defined(LIBXML_UNICODE_ENABLED)
40157     int mem_base;
40158     int ret_val;
40159     int code; /* UCS code point */
40160     int n_code;
40161 
40162     for (n_code = 0;n_code < gen_nb_int;n_code++) {
40163         mem_base = xmlMemBlocks();
40164         code = gen_int(n_code, 0);
40165 
40166         ret_val = xmlUCSIsEnclosedCJKLettersandMonths(code);
40167         desret_int(ret_val);
40168         call_tests++;
40169         des_int(n_code, code, 0);
40170         xmlResetLastError();
40171         if (mem_base != xmlMemBlocks()) {
40172             printf("Leak of %d blocks found in xmlUCSIsEnclosedCJKLettersandMonths",
40173 	           xmlMemBlocks() - mem_base);
40174 	    test_ret++;
40175             printf(" %d", n_code);
40176             printf("\n");
40177         }
40178     }
40179     function_tests++;
40180 #endif
40181 
40182     return(test_ret);
40183 }
40184 
40185 
40186 static int
test_xmlUCSIsEthiopic(void)40187 test_xmlUCSIsEthiopic(void) {
40188     int test_ret = 0;
40189 
40190 #if defined(LIBXML_UNICODE_ENABLED)
40191     int mem_base;
40192     int ret_val;
40193     int code; /* UCS code point */
40194     int n_code;
40195 
40196     for (n_code = 0;n_code < gen_nb_int;n_code++) {
40197         mem_base = xmlMemBlocks();
40198         code = gen_int(n_code, 0);
40199 
40200         ret_val = xmlUCSIsEthiopic(code);
40201         desret_int(ret_val);
40202         call_tests++;
40203         des_int(n_code, code, 0);
40204         xmlResetLastError();
40205         if (mem_base != xmlMemBlocks()) {
40206             printf("Leak of %d blocks found in xmlUCSIsEthiopic",
40207 	           xmlMemBlocks() - mem_base);
40208 	    test_ret++;
40209             printf(" %d", n_code);
40210             printf("\n");
40211         }
40212     }
40213     function_tests++;
40214 #endif
40215 
40216     return(test_ret);
40217 }
40218 
40219 
40220 static int
test_xmlUCSIsGeneralPunctuation(void)40221 test_xmlUCSIsGeneralPunctuation(void) {
40222     int test_ret = 0;
40223 
40224 #if defined(LIBXML_UNICODE_ENABLED)
40225     int mem_base;
40226     int ret_val;
40227     int code; /* UCS code point */
40228     int n_code;
40229 
40230     for (n_code = 0;n_code < gen_nb_int;n_code++) {
40231         mem_base = xmlMemBlocks();
40232         code = gen_int(n_code, 0);
40233 
40234         ret_val = xmlUCSIsGeneralPunctuation(code);
40235         desret_int(ret_val);
40236         call_tests++;
40237         des_int(n_code, code, 0);
40238         xmlResetLastError();
40239         if (mem_base != xmlMemBlocks()) {
40240             printf("Leak of %d blocks found in xmlUCSIsGeneralPunctuation",
40241 	           xmlMemBlocks() - mem_base);
40242 	    test_ret++;
40243             printf(" %d", n_code);
40244             printf("\n");
40245         }
40246     }
40247     function_tests++;
40248 #endif
40249 
40250     return(test_ret);
40251 }
40252 
40253 
40254 static int
test_xmlUCSIsGeometricShapes(void)40255 test_xmlUCSIsGeometricShapes(void) {
40256     int test_ret = 0;
40257 
40258 #if defined(LIBXML_UNICODE_ENABLED)
40259     int mem_base;
40260     int ret_val;
40261     int code; /* UCS code point */
40262     int n_code;
40263 
40264     for (n_code = 0;n_code < gen_nb_int;n_code++) {
40265         mem_base = xmlMemBlocks();
40266         code = gen_int(n_code, 0);
40267 
40268         ret_val = xmlUCSIsGeometricShapes(code);
40269         desret_int(ret_val);
40270         call_tests++;
40271         des_int(n_code, code, 0);
40272         xmlResetLastError();
40273         if (mem_base != xmlMemBlocks()) {
40274             printf("Leak of %d blocks found in xmlUCSIsGeometricShapes",
40275 	           xmlMemBlocks() - mem_base);
40276 	    test_ret++;
40277             printf(" %d", n_code);
40278             printf("\n");
40279         }
40280     }
40281     function_tests++;
40282 #endif
40283 
40284     return(test_ret);
40285 }
40286 
40287 
40288 static int
test_xmlUCSIsGeorgian(void)40289 test_xmlUCSIsGeorgian(void) {
40290     int test_ret = 0;
40291 
40292 #if defined(LIBXML_UNICODE_ENABLED)
40293     int mem_base;
40294     int ret_val;
40295     int code; /* UCS code point */
40296     int n_code;
40297 
40298     for (n_code = 0;n_code < gen_nb_int;n_code++) {
40299         mem_base = xmlMemBlocks();
40300         code = gen_int(n_code, 0);
40301 
40302         ret_val = xmlUCSIsGeorgian(code);
40303         desret_int(ret_val);
40304         call_tests++;
40305         des_int(n_code, code, 0);
40306         xmlResetLastError();
40307         if (mem_base != xmlMemBlocks()) {
40308             printf("Leak of %d blocks found in xmlUCSIsGeorgian",
40309 	           xmlMemBlocks() - mem_base);
40310 	    test_ret++;
40311             printf(" %d", n_code);
40312             printf("\n");
40313         }
40314     }
40315     function_tests++;
40316 #endif
40317 
40318     return(test_ret);
40319 }
40320 
40321 
40322 static int
test_xmlUCSIsGothic(void)40323 test_xmlUCSIsGothic(void) {
40324     int test_ret = 0;
40325 
40326 #if defined(LIBXML_UNICODE_ENABLED)
40327     int mem_base;
40328     int ret_val;
40329     int code; /* UCS code point */
40330     int n_code;
40331 
40332     for (n_code = 0;n_code < gen_nb_int;n_code++) {
40333         mem_base = xmlMemBlocks();
40334         code = gen_int(n_code, 0);
40335 
40336         ret_val = xmlUCSIsGothic(code);
40337         desret_int(ret_val);
40338         call_tests++;
40339         des_int(n_code, code, 0);
40340         xmlResetLastError();
40341         if (mem_base != xmlMemBlocks()) {
40342             printf("Leak of %d blocks found in xmlUCSIsGothic",
40343 	           xmlMemBlocks() - mem_base);
40344 	    test_ret++;
40345             printf(" %d", n_code);
40346             printf("\n");
40347         }
40348     }
40349     function_tests++;
40350 #endif
40351 
40352     return(test_ret);
40353 }
40354 
40355 
40356 static int
test_xmlUCSIsGreek(void)40357 test_xmlUCSIsGreek(void) {
40358     int test_ret = 0;
40359 
40360 #if defined(LIBXML_UNICODE_ENABLED)
40361     int mem_base;
40362     int ret_val;
40363     int code; /* UCS code point */
40364     int n_code;
40365 
40366     for (n_code = 0;n_code < gen_nb_int;n_code++) {
40367         mem_base = xmlMemBlocks();
40368         code = gen_int(n_code, 0);
40369 
40370         ret_val = xmlUCSIsGreek(code);
40371         desret_int(ret_val);
40372         call_tests++;
40373         des_int(n_code, code, 0);
40374         xmlResetLastError();
40375         if (mem_base != xmlMemBlocks()) {
40376             printf("Leak of %d blocks found in xmlUCSIsGreek",
40377 	           xmlMemBlocks() - mem_base);
40378 	    test_ret++;
40379             printf(" %d", n_code);
40380             printf("\n");
40381         }
40382     }
40383     function_tests++;
40384 #endif
40385 
40386     return(test_ret);
40387 }
40388 
40389 
40390 static int
test_xmlUCSIsGreekExtended(void)40391 test_xmlUCSIsGreekExtended(void) {
40392     int test_ret = 0;
40393 
40394 #if defined(LIBXML_UNICODE_ENABLED)
40395     int mem_base;
40396     int ret_val;
40397     int code; /* UCS code point */
40398     int n_code;
40399 
40400     for (n_code = 0;n_code < gen_nb_int;n_code++) {
40401         mem_base = xmlMemBlocks();
40402         code = gen_int(n_code, 0);
40403 
40404         ret_val = xmlUCSIsGreekExtended(code);
40405         desret_int(ret_val);
40406         call_tests++;
40407         des_int(n_code, code, 0);
40408         xmlResetLastError();
40409         if (mem_base != xmlMemBlocks()) {
40410             printf("Leak of %d blocks found in xmlUCSIsGreekExtended",
40411 	           xmlMemBlocks() - mem_base);
40412 	    test_ret++;
40413             printf(" %d", n_code);
40414             printf("\n");
40415         }
40416     }
40417     function_tests++;
40418 #endif
40419 
40420     return(test_ret);
40421 }
40422 
40423 
40424 static int
test_xmlUCSIsGreekandCoptic(void)40425 test_xmlUCSIsGreekandCoptic(void) {
40426     int test_ret = 0;
40427 
40428 #if defined(LIBXML_UNICODE_ENABLED)
40429     int mem_base;
40430     int ret_val;
40431     int code; /* UCS code point */
40432     int n_code;
40433 
40434     for (n_code = 0;n_code < gen_nb_int;n_code++) {
40435         mem_base = xmlMemBlocks();
40436         code = gen_int(n_code, 0);
40437 
40438         ret_val = xmlUCSIsGreekandCoptic(code);
40439         desret_int(ret_val);
40440         call_tests++;
40441         des_int(n_code, code, 0);
40442         xmlResetLastError();
40443         if (mem_base != xmlMemBlocks()) {
40444             printf("Leak of %d blocks found in xmlUCSIsGreekandCoptic",
40445 	           xmlMemBlocks() - mem_base);
40446 	    test_ret++;
40447             printf(" %d", n_code);
40448             printf("\n");
40449         }
40450     }
40451     function_tests++;
40452 #endif
40453 
40454     return(test_ret);
40455 }
40456 
40457 
40458 static int
test_xmlUCSIsGujarati(void)40459 test_xmlUCSIsGujarati(void) {
40460     int test_ret = 0;
40461 
40462 #if defined(LIBXML_UNICODE_ENABLED)
40463     int mem_base;
40464     int ret_val;
40465     int code; /* UCS code point */
40466     int n_code;
40467 
40468     for (n_code = 0;n_code < gen_nb_int;n_code++) {
40469         mem_base = xmlMemBlocks();
40470         code = gen_int(n_code, 0);
40471 
40472         ret_val = xmlUCSIsGujarati(code);
40473         desret_int(ret_val);
40474         call_tests++;
40475         des_int(n_code, code, 0);
40476         xmlResetLastError();
40477         if (mem_base != xmlMemBlocks()) {
40478             printf("Leak of %d blocks found in xmlUCSIsGujarati",
40479 	           xmlMemBlocks() - mem_base);
40480 	    test_ret++;
40481             printf(" %d", n_code);
40482             printf("\n");
40483         }
40484     }
40485     function_tests++;
40486 #endif
40487 
40488     return(test_ret);
40489 }
40490 
40491 
40492 static int
test_xmlUCSIsGurmukhi(void)40493 test_xmlUCSIsGurmukhi(void) {
40494     int test_ret = 0;
40495 
40496 #if defined(LIBXML_UNICODE_ENABLED)
40497     int mem_base;
40498     int ret_val;
40499     int code; /* UCS code point */
40500     int n_code;
40501 
40502     for (n_code = 0;n_code < gen_nb_int;n_code++) {
40503         mem_base = xmlMemBlocks();
40504         code = gen_int(n_code, 0);
40505 
40506         ret_val = xmlUCSIsGurmukhi(code);
40507         desret_int(ret_val);
40508         call_tests++;
40509         des_int(n_code, code, 0);
40510         xmlResetLastError();
40511         if (mem_base != xmlMemBlocks()) {
40512             printf("Leak of %d blocks found in xmlUCSIsGurmukhi",
40513 	           xmlMemBlocks() - mem_base);
40514 	    test_ret++;
40515             printf(" %d", n_code);
40516             printf("\n");
40517         }
40518     }
40519     function_tests++;
40520 #endif
40521 
40522     return(test_ret);
40523 }
40524 
40525 
40526 static int
test_xmlUCSIsHalfwidthandFullwidthForms(void)40527 test_xmlUCSIsHalfwidthandFullwidthForms(void) {
40528     int test_ret = 0;
40529 
40530 #if defined(LIBXML_UNICODE_ENABLED)
40531     int mem_base;
40532     int ret_val;
40533     int code; /* UCS code point */
40534     int n_code;
40535 
40536     for (n_code = 0;n_code < gen_nb_int;n_code++) {
40537         mem_base = xmlMemBlocks();
40538         code = gen_int(n_code, 0);
40539 
40540         ret_val = xmlUCSIsHalfwidthandFullwidthForms(code);
40541         desret_int(ret_val);
40542         call_tests++;
40543         des_int(n_code, code, 0);
40544         xmlResetLastError();
40545         if (mem_base != xmlMemBlocks()) {
40546             printf("Leak of %d blocks found in xmlUCSIsHalfwidthandFullwidthForms",
40547 	           xmlMemBlocks() - mem_base);
40548 	    test_ret++;
40549             printf(" %d", n_code);
40550             printf("\n");
40551         }
40552     }
40553     function_tests++;
40554 #endif
40555 
40556     return(test_ret);
40557 }
40558 
40559 
40560 static int
test_xmlUCSIsHangulCompatibilityJamo(void)40561 test_xmlUCSIsHangulCompatibilityJamo(void) {
40562     int test_ret = 0;
40563 
40564 #if defined(LIBXML_UNICODE_ENABLED)
40565     int mem_base;
40566     int ret_val;
40567     int code; /* UCS code point */
40568     int n_code;
40569 
40570     for (n_code = 0;n_code < gen_nb_int;n_code++) {
40571         mem_base = xmlMemBlocks();
40572         code = gen_int(n_code, 0);
40573 
40574         ret_val = xmlUCSIsHangulCompatibilityJamo(code);
40575         desret_int(ret_val);
40576         call_tests++;
40577         des_int(n_code, code, 0);
40578         xmlResetLastError();
40579         if (mem_base != xmlMemBlocks()) {
40580             printf("Leak of %d blocks found in xmlUCSIsHangulCompatibilityJamo",
40581 	           xmlMemBlocks() - mem_base);
40582 	    test_ret++;
40583             printf(" %d", n_code);
40584             printf("\n");
40585         }
40586     }
40587     function_tests++;
40588 #endif
40589 
40590     return(test_ret);
40591 }
40592 
40593 
40594 static int
test_xmlUCSIsHangulJamo(void)40595 test_xmlUCSIsHangulJamo(void) {
40596     int test_ret = 0;
40597 
40598 #if defined(LIBXML_UNICODE_ENABLED)
40599     int mem_base;
40600     int ret_val;
40601     int code; /* UCS code point */
40602     int n_code;
40603 
40604     for (n_code = 0;n_code < gen_nb_int;n_code++) {
40605         mem_base = xmlMemBlocks();
40606         code = gen_int(n_code, 0);
40607 
40608         ret_val = xmlUCSIsHangulJamo(code);
40609         desret_int(ret_val);
40610         call_tests++;
40611         des_int(n_code, code, 0);
40612         xmlResetLastError();
40613         if (mem_base != xmlMemBlocks()) {
40614             printf("Leak of %d blocks found in xmlUCSIsHangulJamo",
40615 	           xmlMemBlocks() - mem_base);
40616 	    test_ret++;
40617             printf(" %d", n_code);
40618             printf("\n");
40619         }
40620     }
40621     function_tests++;
40622 #endif
40623 
40624     return(test_ret);
40625 }
40626 
40627 
40628 static int
test_xmlUCSIsHangulSyllables(void)40629 test_xmlUCSIsHangulSyllables(void) {
40630     int test_ret = 0;
40631 
40632 #if defined(LIBXML_UNICODE_ENABLED)
40633     int mem_base;
40634     int ret_val;
40635     int code; /* UCS code point */
40636     int n_code;
40637 
40638     for (n_code = 0;n_code < gen_nb_int;n_code++) {
40639         mem_base = xmlMemBlocks();
40640         code = gen_int(n_code, 0);
40641 
40642         ret_val = xmlUCSIsHangulSyllables(code);
40643         desret_int(ret_val);
40644         call_tests++;
40645         des_int(n_code, code, 0);
40646         xmlResetLastError();
40647         if (mem_base != xmlMemBlocks()) {
40648             printf("Leak of %d blocks found in xmlUCSIsHangulSyllables",
40649 	           xmlMemBlocks() - mem_base);
40650 	    test_ret++;
40651             printf(" %d", n_code);
40652             printf("\n");
40653         }
40654     }
40655     function_tests++;
40656 #endif
40657 
40658     return(test_ret);
40659 }
40660 
40661 
40662 static int
test_xmlUCSIsHanunoo(void)40663 test_xmlUCSIsHanunoo(void) {
40664     int test_ret = 0;
40665 
40666 #if defined(LIBXML_UNICODE_ENABLED)
40667     int mem_base;
40668     int ret_val;
40669     int code; /* UCS code point */
40670     int n_code;
40671 
40672     for (n_code = 0;n_code < gen_nb_int;n_code++) {
40673         mem_base = xmlMemBlocks();
40674         code = gen_int(n_code, 0);
40675 
40676         ret_val = xmlUCSIsHanunoo(code);
40677         desret_int(ret_val);
40678         call_tests++;
40679         des_int(n_code, code, 0);
40680         xmlResetLastError();
40681         if (mem_base != xmlMemBlocks()) {
40682             printf("Leak of %d blocks found in xmlUCSIsHanunoo",
40683 	           xmlMemBlocks() - mem_base);
40684 	    test_ret++;
40685             printf(" %d", n_code);
40686             printf("\n");
40687         }
40688     }
40689     function_tests++;
40690 #endif
40691 
40692     return(test_ret);
40693 }
40694 
40695 
40696 static int
test_xmlUCSIsHebrew(void)40697 test_xmlUCSIsHebrew(void) {
40698     int test_ret = 0;
40699 
40700 #if defined(LIBXML_UNICODE_ENABLED)
40701     int mem_base;
40702     int ret_val;
40703     int code; /* UCS code point */
40704     int n_code;
40705 
40706     for (n_code = 0;n_code < gen_nb_int;n_code++) {
40707         mem_base = xmlMemBlocks();
40708         code = gen_int(n_code, 0);
40709 
40710         ret_val = xmlUCSIsHebrew(code);
40711         desret_int(ret_val);
40712         call_tests++;
40713         des_int(n_code, code, 0);
40714         xmlResetLastError();
40715         if (mem_base != xmlMemBlocks()) {
40716             printf("Leak of %d blocks found in xmlUCSIsHebrew",
40717 	           xmlMemBlocks() - mem_base);
40718 	    test_ret++;
40719             printf(" %d", n_code);
40720             printf("\n");
40721         }
40722     }
40723     function_tests++;
40724 #endif
40725 
40726     return(test_ret);
40727 }
40728 
40729 
40730 static int
test_xmlUCSIsHighPrivateUseSurrogates(void)40731 test_xmlUCSIsHighPrivateUseSurrogates(void) {
40732     int test_ret = 0;
40733 
40734 #if defined(LIBXML_UNICODE_ENABLED)
40735     int mem_base;
40736     int ret_val;
40737     int code; /* UCS code point */
40738     int n_code;
40739 
40740     for (n_code = 0;n_code < gen_nb_int;n_code++) {
40741         mem_base = xmlMemBlocks();
40742         code = gen_int(n_code, 0);
40743 
40744         ret_val = xmlUCSIsHighPrivateUseSurrogates(code);
40745         desret_int(ret_val);
40746         call_tests++;
40747         des_int(n_code, code, 0);
40748         xmlResetLastError();
40749         if (mem_base != xmlMemBlocks()) {
40750             printf("Leak of %d blocks found in xmlUCSIsHighPrivateUseSurrogates",
40751 	           xmlMemBlocks() - mem_base);
40752 	    test_ret++;
40753             printf(" %d", n_code);
40754             printf("\n");
40755         }
40756     }
40757     function_tests++;
40758 #endif
40759 
40760     return(test_ret);
40761 }
40762 
40763 
40764 static int
test_xmlUCSIsHighSurrogates(void)40765 test_xmlUCSIsHighSurrogates(void) {
40766     int test_ret = 0;
40767 
40768 #if defined(LIBXML_UNICODE_ENABLED)
40769     int mem_base;
40770     int ret_val;
40771     int code; /* UCS code point */
40772     int n_code;
40773 
40774     for (n_code = 0;n_code < gen_nb_int;n_code++) {
40775         mem_base = xmlMemBlocks();
40776         code = gen_int(n_code, 0);
40777 
40778         ret_val = xmlUCSIsHighSurrogates(code);
40779         desret_int(ret_val);
40780         call_tests++;
40781         des_int(n_code, code, 0);
40782         xmlResetLastError();
40783         if (mem_base != xmlMemBlocks()) {
40784             printf("Leak of %d blocks found in xmlUCSIsHighSurrogates",
40785 	           xmlMemBlocks() - mem_base);
40786 	    test_ret++;
40787             printf(" %d", n_code);
40788             printf("\n");
40789         }
40790     }
40791     function_tests++;
40792 #endif
40793 
40794     return(test_ret);
40795 }
40796 
40797 
40798 static int
test_xmlUCSIsHiragana(void)40799 test_xmlUCSIsHiragana(void) {
40800     int test_ret = 0;
40801 
40802 #if defined(LIBXML_UNICODE_ENABLED)
40803     int mem_base;
40804     int ret_val;
40805     int code; /* UCS code point */
40806     int n_code;
40807 
40808     for (n_code = 0;n_code < gen_nb_int;n_code++) {
40809         mem_base = xmlMemBlocks();
40810         code = gen_int(n_code, 0);
40811 
40812         ret_val = xmlUCSIsHiragana(code);
40813         desret_int(ret_val);
40814         call_tests++;
40815         des_int(n_code, code, 0);
40816         xmlResetLastError();
40817         if (mem_base != xmlMemBlocks()) {
40818             printf("Leak of %d blocks found in xmlUCSIsHiragana",
40819 	           xmlMemBlocks() - mem_base);
40820 	    test_ret++;
40821             printf(" %d", n_code);
40822             printf("\n");
40823         }
40824     }
40825     function_tests++;
40826 #endif
40827 
40828     return(test_ret);
40829 }
40830 
40831 
40832 static int
test_xmlUCSIsIPAExtensions(void)40833 test_xmlUCSIsIPAExtensions(void) {
40834     int test_ret = 0;
40835 
40836 #if defined(LIBXML_UNICODE_ENABLED)
40837     int mem_base;
40838     int ret_val;
40839     int code; /* UCS code point */
40840     int n_code;
40841 
40842     for (n_code = 0;n_code < gen_nb_int;n_code++) {
40843         mem_base = xmlMemBlocks();
40844         code = gen_int(n_code, 0);
40845 
40846         ret_val = xmlUCSIsIPAExtensions(code);
40847         desret_int(ret_val);
40848         call_tests++;
40849         des_int(n_code, code, 0);
40850         xmlResetLastError();
40851         if (mem_base != xmlMemBlocks()) {
40852             printf("Leak of %d blocks found in xmlUCSIsIPAExtensions",
40853 	           xmlMemBlocks() - mem_base);
40854 	    test_ret++;
40855             printf(" %d", n_code);
40856             printf("\n");
40857         }
40858     }
40859     function_tests++;
40860 #endif
40861 
40862     return(test_ret);
40863 }
40864 
40865 
40866 static int
test_xmlUCSIsIdeographicDescriptionCharacters(void)40867 test_xmlUCSIsIdeographicDescriptionCharacters(void) {
40868     int test_ret = 0;
40869 
40870 #if defined(LIBXML_UNICODE_ENABLED)
40871     int mem_base;
40872     int ret_val;
40873     int code; /* UCS code point */
40874     int n_code;
40875 
40876     for (n_code = 0;n_code < gen_nb_int;n_code++) {
40877         mem_base = xmlMemBlocks();
40878         code = gen_int(n_code, 0);
40879 
40880         ret_val = xmlUCSIsIdeographicDescriptionCharacters(code);
40881         desret_int(ret_val);
40882         call_tests++;
40883         des_int(n_code, code, 0);
40884         xmlResetLastError();
40885         if (mem_base != xmlMemBlocks()) {
40886             printf("Leak of %d blocks found in xmlUCSIsIdeographicDescriptionCharacters",
40887 	           xmlMemBlocks() - mem_base);
40888 	    test_ret++;
40889             printf(" %d", n_code);
40890             printf("\n");
40891         }
40892     }
40893     function_tests++;
40894 #endif
40895 
40896     return(test_ret);
40897 }
40898 
40899 
40900 static int
test_xmlUCSIsKanbun(void)40901 test_xmlUCSIsKanbun(void) {
40902     int test_ret = 0;
40903 
40904 #if defined(LIBXML_UNICODE_ENABLED)
40905     int mem_base;
40906     int ret_val;
40907     int code; /* UCS code point */
40908     int n_code;
40909 
40910     for (n_code = 0;n_code < gen_nb_int;n_code++) {
40911         mem_base = xmlMemBlocks();
40912         code = gen_int(n_code, 0);
40913 
40914         ret_val = xmlUCSIsKanbun(code);
40915         desret_int(ret_val);
40916         call_tests++;
40917         des_int(n_code, code, 0);
40918         xmlResetLastError();
40919         if (mem_base != xmlMemBlocks()) {
40920             printf("Leak of %d blocks found in xmlUCSIsKanbun",
40921 	           xmlMemBlocks() - mem_base);
40922 	    test_ret++;
40923             printf(" %d", n_code);
40924             printf("\n");
40925         }
40926     }
40927     function_tests++;
40928 #endif
40929 
40930     return(test_ret);
40931 }
40932 
40933 
40934 static int
test_xmlUCSIsKangxiRadicals(void)40935 test_xmlUCSIsKangxiRadicals(void) {
40936     int test_ret = 0;
40937 
40938 #if defined(LIBXML_UNICODE_ENABLED)
40939     int mem_base;
40940     int ret_val;
40941     int code; /* UCS code point */
40942     int n_code;
40943 
40944     for (n_code = 0;n_code < gen_nb_int;n_code++) {
40945         mem_base = xmlMemBlocks();
40946         code = gen_int(n_code, 0);
40947 
40948         ret_val = xmlUCSIsKangxiRadicals(code);
40949         desret_int(ret_val);
40950         call_tests++;
40951         des_int(n_code, code, 0);
40952         xmlResetLastError();
40953         if (mem_base != xmlMemBlocks()) {
40954             printf("Leak of %d blocks found in xmlUCSIsKangxiRadicals",
40955 	           xmlMemBlocks() - mem_base);
40956 	    test_ret++;
40957             printf(" %d", n_code);
40958             printf("\n");
40959         }
40960     }
40961     function_tests++;
40962 #endif
40963 
40964     return(test_ret);
40965 }
40966 
40967 
40968 static int
test_xmlUCSIsKannada(void)40969 test_xmlUCSIsKannada(void) {
40970     int test_ret = 0;
40971 
40972 #if defined(LIBXML_UNICODE_ENABLED)
40973     int mem_base;
40974     int ret_val;
40975     int code; /* UCS code point */
40976     int n_code;
40977 
40978     for (n_code = 0;n_code < gen_nb_int;n_code++) {
40979         mem_base = xmlMemBlocks();
40980         code = gen_int(n_code, 0);
40981 
40982         ret_val = xmlUCSIsKannada(code);
40983         desret_int(ret_val);
40984         call_tests++;
40985         des_int(n_code, code, 0);
40986         xmlResetLastError();
40987         if (mem_base != xmlMemBlocks()) {
40988             printf("Leak of %d blocks found in xmlUCSIsKannada",
40989 	           xmlMemBlocks() - mem_base);
40990 	    test_ret++;
40991             printf(" %d", n_code);
40992             printf("\n");
40993         }
40994     }
40995     function_tests++;
40996 #endif
40997 
40998     return(test_ret);
40999 }
41000 
41001 
41002 static int
test_xmlUCSIsKatakana(void)41003 test_xmlUCSIsKatakana(void) {
41004     int test_ret = 0;
41005 
41006 #if defined(LIBXML_UNICODE_ENABLED)
41007     int mem_base;
41008     int ret_val;
41009     int code; /* UCS code point */
41010     int n_code;
41011 
41012     for (n_code = 0;n_code < gen_nb_int;n_code++) {
41013         mem_base = xmlMemBlocks();
41014         code = gen_int(n_code, 0);
41015 
41016         ret_val = xmlUCSIsKatakana(code);
41017         desret_int(ret_val);
41018         call_tests++;
41019         des_int(n_code, code, 0);
41020         xmlResetLastError();
41021         if (mem_base != xmlMemBlocks()) {
41022             printf("Leak of %d blocks found in xmlUCSIsKatakana",
41023 	           xmlMemBlocks() - mem_base);
41024 	    test_ret++;
41025             printf(" %d", n_code);
41026             printf("\n");
41027         }
41028     }
41029     function_tests++;
41030 #endif
41031 
41032     return(test_ret);
41033 }
41034 
41035 
41036 static int
test_xmlUCSIsKatakanaPhoneticExtensions(void)41037 test_xmlUCSIsKatakanaPhoneticExtensions(void) {
41038     int test_ret = 0;
41039 
41040 #if defined(LIBXML_UNICODE_ENABLED)
41041     int mem_base;
41042     int ret_val;
41043     int code; /* UCS code point */
41044     int n_code;
41045 
41046     for (n_code = 0;n_code < gen_nb_int;n_code++) {
41047         mem_base = xmlMemBlocks();
41048         code = gen_int(n_code, 0);
41049 
41050         ret_val = xmlUCSIsKatakanaPhoneticExtensions(code);
41051         desret_int(ret_val);
41052         call_tests++;
41053         des_int(n_code, code, 0);
41054         xmlResetLastError();
41055         if (mem_base != xmlMemBlocks()) {
41056             printf("Leak of %d blocks found in xmlUCSIsKatakanaPhoneticExtensions",
41057 	           xmlMemBlocks() - mem_base);
41058 	    test_ret++;
41059             printf(" %d", n_code);
41060             printf("\n");
41061         }
41062     }
41063     function_tests++;
41064 #endif
41065 
41066     return(test_ret);
41067 }
41068 
41069 
41070 static int
test_xmlUCSIsKhmer(void)41071 test_xmlUCSIsKhmer(void) {
41072     int test_ret = 0;
41073 
41074 #if defined(LIBXML_UNICODE_ENABLED)
41075     int mem_base;
41076     int ret_val;
41077     int code; /* UCS code point */
41078     int n_code;
41079 
41080     for (n_code = 0;n_code < gen_nb_int;n_code++) {
41081         mem_base = xmlMemBlocks();
41082         code = gen_int(n_code, 0);
41083 
41084         ret_val = xmlUCSIsKhmer(code);
41085         desret_int(ret_val);
41086         call_tests++;
41087         des_int(n_code, code, 0);
41088         xmlResetLastError();
41089         if (mem_base != xmlMemBlocks()) {
41090             printf("Leak of %d blocks found in xmlUCSIsKhmer",
41091 	           xmlMemBlocks() - mem_base);
41092 	    test_ret++;
41093             printf(" %d", n_code);
41094             printf("\n");
41095         }
41096     }
41097     function_tests++;
41098 #endif
41099 
41100     return(test_ret);
41101 }
41102 
41103 
41104 static int
test_xmlUCSIsKhmerSymbols(void)41105 test_xmlUCSIsKhmerSymbols(void) {
41106     int test_ret = 0;
41107 
41108 #if defined(LIBXML_UNICODE_ENABLED)
41109     int mem_base;
41110     int ret_val;
41111     int code; /* UCS code point */
41112     int n_code;
41113 
41114     for (n_code = 0;n_code < gen_nb_int;n_code++) {
41115         mem_base = xmlMemBlocks();
41116         code = gen_int(n_code, 0);
41117 
41118         ret_val = xmlUCSIsKhmerSymbols(code);
41119         desret_int(ret_val);
41120         call_tests++;
41121         des_int(n_code, code, 0);
41122         xmlResetLastError();
41123         if (mem_base != xmlMemBlocks()) {
41124             printf("Leak of %d blocks found in xmlUCSIsKhmerSymbols",
41125 	           xmlMemBlocks() - mem_base);
41126 	    test_ret++;
41127             printf(" %d", n_code);
41128             printf("\n");
41129         }
41130     }
41131     function_tests++;
41132 #endif
41133 
41134     return(test_ret);
41135 }
41136 
41137 
41138 static int
test_xmlUCSIsLao(void)41139 test_xmlUCSIsLao(void) {
41140     int test_ret = 0;
41141 
41142 #if defined(LIBXML_UNICODE_ENABLED)
41143     int mem_base;
41144     int ret_val;
41145     int code; /* UCS code point */
41146     int n_code;
41147 
41148     for (n_code = 0;n_code < gen_nb_int;n_code++) {
41149         mem_base = xmlMemBlocks();
41150         code = gen_int(n_code, 0);
41151 
41152         ret_val = xmlUCSIsLao(code);
41153         desret_int(ret_val);
41154         call_tests++;
41155         des_int(n_code, code, 0);
41156         xmlResetLastError();
41157         if (mem_base != xmlMemBlocks()) {
41158             printf("Leak of %d blocks found in xmlUCSIsLao",
41159 	           xmlMemBlocks() - mem_base);
41160 	    test_ret++;
41161             printf(" %d", n_code);
41162             printf("\n");
41163         }
41164     }
41165     function_tests++;
41166 #endif
41167 
41168     return(test_ret);
41169 }
41170 
41171 
41172 static int
test_xmlUCSIsLatin1Supplement(void)41173 test_xmlUCSIsLatin1Supplement(void) {
41174     int test_ret = 0;
41175 
41176 #if defined(LIBXML_UNICODE_ENABLED)
41177     int mem_base;
41178     int ret_val;
41179     int code; /* UCS code point */
41180     int n_code;
41181 
41182     for (n_code = 0;n_code < gen_nb_int;n_code++) {
41183         mem_base = xmlMemBlocks();
41184         code = gen_int(n_code, 0);
41185 
41186         ret_val = xmlUCSIsLatin1Supplement(code);
41187         desret_int(ret_val);
41188         call_tests++;
41189         des_int(n_code, code, 0);
41190         xmlResetLastError();
41191         if (mem_base != xmlMemBlocks()) {
41192             printf("Leak of %d blocks found in xmlUCSIsLatin1Supplement",
41193 	           xmlMemBlocks() - mem_base);
41194 	    test_ret++;
41195             printf(" %d", n_code);
41196             printf("\n");
41197         }
41198     }
41199     function_tests++;
41200 #endif
41201 
41202     return(test_ret);
41203 }
41204 
41205 
41206 static int
test_xmlUCSIsLatinExtendedA(void)41207 test_xmlUCSIsLatinExtendedA(void) {
41208     int test_ret = 0;
41209 
41210 #if defined(LIBXML_UNICODE_ENABLED)
41211     int mem_base;
41212     int ret_val;
41213     int code; /* UCS code point */
41214     int n_code;
41215 
41216     for (n_code = 0;n_code < gen_nb_int;n_code++) {
41217         mem_base = xmlMemBlocks();
41218         code = gen_int(n_code, 0);
41219 
41220         ret_val = xmlUCSIsLatinExtendedA(code);
41221         desret_int(ret_val);
41222         call_tests++;
41223         des_int(n_code, code, 0);
41224         xmlResetLastError();
41225         if (mem_base != xmlMemBlocks()) {
41226             printf("Leak of %d blocks found in xmlUCSIsLatinExtendedA",
41227 	           xmlMemBlocks() - mem_base);
41228 	    test_ret++;
41229             printf(" %d", n_code);
41230             printf("\n");
41231         }
41232     }
41233     function_tests++;
41234 #endif
41235 
41236     return(test_ret);
41237 }
41238 
41239 
41240 static int
test_xmlUCSIsLatinExtendedAdditional(void)41241 test_xmlUCSIsLatinExtendedAdditional(void) {
41242     int test_ret = 0;
41243 
41244 #if defined(LIBXML_UNICODE_ENABLED)
41245     int mem_base;
41246     int ret_val;
41247     int code; /* UCS code point */
41248     int n_code;
41249 
41250     for (n_code = 0;n_code < gen_nb_int;n_code++) {
41251         mem_base = xmlMemBlocks();
41252         code = gen_int(n_code, 0);
41253 
41254         ret_val = xmlUCSIsLatinExtendedAdditional(code);
41255         desret_int(ret_val);
41256         call_tests++;
41257         des_int(n_code, code, 0);
41258         xmlResetLastError();
41259         if (mem_base != xmlMemBlocks()) {
41260             printf("Leak of %d blocks found in xmlUCSIsLatinExtendedAdditional",
41261 	           xmlMemBlocks() - mem_base);
41262 	    test_ret++;
41263             printf(" %d", n_code);
41264             printf("\n");
41265         }
41266     }
41267     function_tests++;
41268 #endif
41269 
41270     return(test_ret);
41271 }
41272 
41273 
41274 static int
test_xmlUCSIsLatinExtendedB(void)41275 test_xmlUCSIsLatinExtendedB(void) {
41276     int test_ret = 0;
41277 
41278 #if defined(LIBXML_UNICODE_ENABLED)
41279     int mem_base;
41280     int ret_val;
41281     int code; /* UCS code point */
41282     int n_code;
41283 
41284     for (n_code = 0;n_code < gen_nb_int;n_code++) {
41285         mem_base = xmlMemBlocks();
41286         code = gen_int(n_code, 0);
41287 
41288         ret_val = xmlUCSIsLatinExtendedB(code);
41289         desret_int(ret_val);
41290         call_tests++;
41291         des_int(n_code, code, 0);
41292         xmlResetLastError();
41293         if (mem_base != xmlMemBlocks()) {
41294             printf("Leak of %d blocks found in xmlUCSIsLatinExtendedB",
41295 	           xmlMemBlocks() - mem_base);
41296 	    test_ret++;
41297             printf(" %d", n_code);
41298             printf("\n");
41299         }
41300     }
41301     function_tests++;
41302 #endif
41303 
41304     return(test_ret);
41305 }
41306 
41307 
41308 static int
test_xmlUCSIsLetterlikeSymbols(void)41309 test_xmlUCSIsLetterlikeSymbols(void) {
41310     int test_ret = 0;
41311 
41312 #if defined(LIBXML_UNICODE_ENABLED)
41313     int mem_base;
41314     int ret_val;
41315     int code; /* UCS code point */
41316     int n_code;
41317 
41318     for (n_code = 0;n_code < gen_nb_int;n_code++) {
41319         mem_base = xmlMemBlocks();
41320         code = gen_int(n_code, 0);
41321 
41322         ret_val = xmlUCSIsLetterlikeSymbols(code);
41323         desret_int(ret_val);
41324         call_tests++;
41325         des_int(n_code, code, 0);
41326         xmlResetLastError();
41327         if (mem_base != xmlMemBlocks()) {
41328             printf("Leak of %d blocks found in xmlUCSIsLetterlikeSymbols",
41329 	           xmlMemBlocks() - mem_base);
41330 	    test_ret++;
41331             printf(" %d", n_code);
41332             printf("\n");
41333         }
41334     }
41335     function_tests++;
41336 #endif
41337 
41338     return(test_ret);
41339 }
41340 
41341 
41342 static int
test_xmlUCSIsLimbu(void)41343 test_xmlUCSIsLimbu(void) {
41344     int test_ret = 0;
41345 
41346 #if defined(LIBXML_UNICODE_ENABLED)
41347     int mem_base;
41348     int ret_val;
41349     int code; /* UCS code point */
41350     int n_code;
41351 
41352     for (n_code = 0;n_code < gen_nb_int;n_code++) {
41353         mem_base = xmlMemBlocks();
41354         code = gen_int(n_code, 0);
41355 
41356         ret_val = xmlUCSIsLimbu(code);
41357         desret_int(ret_val);
41358         call_tests++;
41359         des_int(n_code, code, 0);
41360         xmlResetLastError();
41361         if (mem_base != xmlMemBlocks()) {
41362             printf("Leak of %d blocks found in xmlUCSIsLimbu",
41363 	           xmlMemBlocks() - mem_base);
41364 	    test_ret++;
41365             printf(" %d", n_code);
41366             printf("\n");
41367         }
41368     }
41369     function_tests++;
41370 #endif
41371 
41372     return(test_ret);
41373 }
41374 
41375 
41376 static int
test_xmlUCSIsLinearBIdeograms(void)41377 test_xmlUCSIsLinearBIdeograms(void) {
41378     int test_ret = 0;
41379 
41380 #if defined(LIBXML_UNICODE_ENABLED)
41381     int mem_base;
41382     int ret_val;
41383     int code; /* UCS code point */
41384     int n_code;
41385 
41386     for (n_code = 0;n_code < gen_nb_int;n_code++) {
41387         mem_base = xmlMemBlocks();
41388         code = gen_int(n_code, 0);
41389 
41390         ret_val = xmlUCSIsLinearBIdeograms(code);
41391         desret_int(ret_val);
41392         call_tests++;
41393         des_int(n_code, code, 0);
41394         xmlResetLastError();
41395         if (mem_base != xmlMemBlocks()) {
41396             printf("Leak of %d blocks found in xmlUCSIsLinearBIdeograms",
41397 	           xmlMemBlocks() - mem_base);
41398 	    test_ret++;
41399             printf(" %d", n_code);
41400             printf("\n");
41401         }
41402     }
41403     function_tests++;
41404 #endif
41405 
41406     return(test_ret);
41407 }
41408 
41409 
41410 static int
test_xmlUCSIsLinearBSyllabary(void)41411 test_xmlUCSIsLinearBSyllabary(void) {
41412     int test_ret = 0;
41413 
41414 #if defined(LIBXML_UNICODE_ENABLED)
41415     int mem_base;
41416     int ret_val;
41417     int code; /* UCS code point */
41418     int n_code;
41419 
41420     for (n_code = 0;n_code < gen_nb_int;n_code++) {
41421         mem_base = xmlMemBlocks();
41422         code = gen_int(n_code, 0);
41423 
41424         ret_val = xmlUCSIsLinearBSyllabary(code);
41425         desret_int(ret_val);
41426         call_tests++;
41427         des_int(n_code, code, 0);
41428         xmlResetLastError();
41429         if (mem_base != xmlMemBlocks()) {
41430             printf("Leak of %d blocks found in xmlUCSIsLinearBSyllabary",
41431 	           xmlMemBlocks() - mem_base);
41432 	    test_ret++;
41433             printf(" %d", n_code);
41434             printf("\n");
41435         }
41436     }
41437     function_tests++;
41438 #endif
41439 
41440     return(test_ret);
41441 }
41442 
41443 
41444 static int
test_xmlUCSIsLowSurrogates(void)41445 test_xmlUCSIsLowSurrogates(void) {
41446     int test_ret = 0;
41447 
41448 #if defined(LIBXML_UNICODE_ENABLED)
41449     int mem_base;
41450     int ret_val;
41451     int code; /* UCS code point */
41452     int n_code;
41453 
41454     for (n_code = 0;n_code < gen_nb_int;n_code++) {
41455         mem_base = xmlMemBlocks();
41456         code = gen_int(n_code, 0);
41457 
41458         ret_val = xmlUCSIsLowSurrogates(code);
41459         desret_int(ret_val);
41460         call_tests++;
41461         des_int(n_code, code, 0);
41462         xmlResetLastError();
41463         if (mem_base != xmlMemBlocks()) {
41464             printf("Leak of %d blocks found in xmlUCSIsLowSurrogates",
41465 	           xmlMemBlocks() - mem_base);
41466 	    test_ret++;
41467             printf(" %d", n_code);
41468             printf("\n");
41469         }
41470     }
41471     function_tests++;
41472 #endif
41473 
41474     return(test_ret);
41475 }
41476 
41477 
41478 static int
test_xmlUCSIsMalayalam(void)41479 test_xmlUCSIsMalayalam(void) {
41480     int test_ret = 0;
41481 
41482 #if defined(LIBXML_UNICODE_ENABLED)
41483     int mem_base;
41484     int ret_val;
41485     int code; /* UCS code point */
41486     int n_code;
41487 
41488     for (n_code = 0;n_code < gen_nb_int;n_code++) {
41489         mem_base = xmlMemBlocks();
41490         code = gen_int(n_code, 0);
41491 
41492         ret_val = xmlUCSIsMalayalam(code);
41493         desret_int(ret_val);
41494         call_tests++;
41495         des_int(n_code, code, 0);
41496         xmlResetLastError();
41497         if (mem_base != xmlMemBlocks()) {
41498             printf("Leak of %d blocks found in xmlUCSIsMalayalam",
41499 	           xmlMemBlocks() - mem_base);
41500 	    test_ret++;
41501             printf(" %d", n_code);
41502             printf("\n");
41503         }
41504     }
41505     function_tests++;
41506 #endif
41507 
41508     return(test_ret);
41509 }
41510 
41511 
41512 static int
test_xmlUCSIsMathematicalAlphanumericSymbols(void)41513 test_xmlUCSIsMathematicalAlphanumericSymbols(void) {
41514     int test_ret = 0;
41515 
41516 #if defined(LIBXML_UNICODE_ENABLED)
41517     int mem_base;
41518     int ret_val;
41519     int code; /* UCS code point */
41520     int n_code;
41521 
41522     for (n_code = 0;n_code < gen_nb_int;n_code++) {
41523         mem_base = xmlMemBlocks();
41524         code = gen_int(n_code, 0);
41525 
41526         ret_val = xmlUCSIsMathematicalAlphanumericSymbols(code);
41527         desret_int(ret_val);
41528         call_tests++;
41529         des_int(n_code, code, 0);
41530         xmlResetLastError();
41531         if (mem_base != xmlMemBlocks()) {
41532             printf("Leak of %d blocks found in xmlUCSIsMathematicalAlphanumericSymbols",
41533 	           xmlMemBlocks() - mem_base);
41534 	    test_ret++;
41535             printf(" %d", n_code);
41536             printf("\n");
41537         }
41538     }
41539     function_tests++;
41540 #endif
41541 
41542     return(test_ret);
41543 }
41544 
41545 
41546 static int
test_xmlUCSIsMathematicalOperators(void)41547 test_xmlUCSIsMathematicalOperators(void) {
41548     int test_ret = 0;
41549 
41550 #if defined(LIBXML_UNICODE_ENABLED)
41551     int mem_base;
41552     int ret_val;
41553     int code; /* UCS code point */
41554     int n_code;
41555 
41556     for (n_code = 0;n_code < gen_nb_int;n_code++) {
41557         mem_base = xmlMemBlocks();
41558         code = gen_int(n_code, 0);
41559 
41560         ret_val = xmlUCSIsMathematicalOperators(code);
41561         desret_int(ret_val);
41562         call_tests++;
41563         des_int(n_code, code, 0);
41564         xmlResetLastError();
41565         if (mem_base != xmlMemBlocks()) {
41566             printf("Leak of %d blocks found in xmlUCSIsMathematicalOperators",
41567 	           xmlMemBlocks() - mem_base);
41568 	    test_ret++;
41569             printf(" %d", n_code);
41570             printf("\n");
41571         }
41572     }
41573     function_tests++;
41574 #endif
41575 
41576     return(test_ret);
41577 }
41578 
41579 
41580 static int
test_xmlUCSIsMiscellaneousMathematicalSymbolsA(void)41581 test_xmlUCSIsMiscellaneousMathematicalSymbolsA(void) {
41582     int test_ret = 0;
41583 
41584 #if defined(LIBXML_UNICODE_ENABLED)
41585     int mem_base;
41586     int ret_val;
41587     int code; /* UCS code point */
41588     int n_code;
41589 
41590     for (n_code = 0;n_code < gen_nb_int;n_code++) {
41591         mem_base = xmlMemBlocks();
41592         code = gen_int(n_code, 0);
41593 
41594         ret_val = xmlUCSIsMiscellaneousMathematicalSymbolsA(code);
41595         desret_int(ret_val);
41596         call_tests++;
41597         des_int(n_code, code, 0);
41598         xmlResetLastError();
41599         if (mem_base != xmlMemBlocks()) {
41600             printf("Leak of %d blocks found in xmlUCSIsMiscellaneousMathematicalSymbolsA",
41601 	           xmlMemBlocks() - mem_base);
41602 	    test_ret++;
41603             printf(" %d", n_code);
41604             printf("\n");
41605         }
41606     }
41607     function_tests++;
41608 #endif
41609 
41610     return(test_ret);
41611 }
41612 
41613 
41614 static int
test_xmlUCSIsMiscellaneousMathematicalSymbolsB(void)41615 test_xmlUCSIsMiscellaneousMathematicalSymbolsB(void) {
41616     int test_ret = 0;
41617 
41618 #if defined(LIBXML_UNICODE_ENABLED)
41619     int mem_base;
41620     int ret_val;
41621     int code; /* UCS code point */
41622     int n_code;
41623 
41624     for (n_code = 0;n_code < gen_nb_int;n_code++) {
41625         mem_base = xmlMemBlocks();
41626         code = gen_int(n_code, 0);
41627 
41628         ret_val = xmlUCSIsMiscellaneousMathematicalSymbolsB(code);
41629         desret_int(ret_val);
41630         call_tests++;
41631         des_int(n_code, code, 0);
41632         xmlResetLastError();
41633         if (mem_base != xmlMemBlocks()) {
41634             printf("Leak of %d blocks found in xmlUCSIsMiscellaneousMathematicalSymbolsB",
41635 	           xmlMemBlocks() - mem_base);
41636 	    test_ret++;
41637             printf(" %d", n_code);
41638             printf("\n");
41639         }
41640     }
41641     function_tests++;
41642 #endif
41643 
41644     return(test_ret);
41645 }
41646 
41647 
41648 static int
test_xmlUCSIsMiscellaneousSymbols(void)41649 test_xmlUCSIsMiscellaneousSymbols(void) {
41650     int test_ret = 0;
41651 
41652 #if defined(LIBXML_UNICODE_ENABLED)
41653     int mem_base;
41654     int ret_val;
41655     int code; /* UCS code point */
41656     int n_code;
41657 
41658     for (n_code = 0;n_code < gen_nb_int;n_code++) {
41659         mem_base = xmlMemBlocks();
41660         code = gen_int(n_code, 0);
41661 
41662         ret_val = xmlUCSIsMiscellaneousSymbols(code);
41663         desret_int(ret_val);
41664         call_tests++;
41665         des_int(n_code, code, 0);
41666         xmlResetLastError();
41667         if (mem_base != xmlMemBlocks()) {
41668             printf("Leak of %d blocks found in xmlUCSIsMiscellaneousSymbols",
41669 	           xmlMemBlocks() - mem_base);
41670 	    test_ret++;
41671             printf(" %d", n_code);
41672             printf("\n");
41673         }
41674     }
41675     function_tests++;
41676 #endif
41677 
41678     return(test_ret);
41679 }
41680 
41681 
41682 static int
test_xmlUCSIsMiscellaneousSymbolsandArrows(void)41683 test_xmlUCSIsMiscellaneousSymbolsandArrows(void) {
41684     int test_ret = 0;
41685 
41686 #if defined(LIBXML_UNICODE_ENABLED)
41687     int mem_base;
41688     int ret_val;
41689     int code; /* UCS code point */
41690     int n_code;
41691 
41692     for (n_code = 0;n_code < gen_nb_int;n_code++) {
41693         mem_base = xmlMemBlocks();
41694         code = gen_int(n_code, 0);
41695 
41696         ret_val = xmlUCSIsMiscellaneousSymbolsandArrows(code);
41697         desret_int(ret_val);
41698         call_tests++;
41699         des_int(n_code, code, 0);
41700         xmlResetLastError();
41701         if (mem_base != xmlMemBlocks()) {
41702             printf("Leak of %d blocks found in xmlUCSIsMiscellaneousSymbolsandArrows",
41703 	           xmlMemBlocks() - mem_base);
41704 	    test_ret++;
41705             printf(" %d", n_code);
41706             printf("\n");
41707         }
41708     }
41709     function_tests++;
41710 #endif
41711 
41712     return(test_ret);
41713 }
41714 
41715 
41716 static int
test_xmlUCSIsMiscellaneousTechnical(void)41717 test_xmlUCSIsMiscellaneousTechnical(void) {
41718     int test_ret = 0;
41719 
41720 #if defined(LIBXML_UNICODE_ENABLED)
41721     int mem_base;
41722     int ret_val;
41723     int code; /* UCS code point */
41724     int n_code;
41725 
41726     for (n_code = 0;n_code < gen_nb_int;n_code++) {
41727         mem_base = xmlMemBlocks();
41728         code = gen_int(n_code, 0);
41729 
41730         ret_val = xmlUCSIsMiscellaneousTechnical(code);
41731         desret_int(ret_val);
41732         call_tests++;
41733         des_int(n_code, code, 0);
41734         xmlResetLastError();
41735         if (mem_base != xmlMemBlocks()) {
41736             printf("Leak of %d blocks found in xmlUCSIsMiscellaneousTechnical",
41737 	           xmlMemBlocks() - mem_base);
41738 	    test_ret++;
41739             printf(" %d", n_code);
41740             printf("\n");
41741         }
41742     }
41743     function_tests++;
41744 #endif
41745 
41746     return(test_ret);
41747 }
41748 
41749 
41750 static int
test_xmlUCSIsMongolian(void)41751 test_xmlUCSIsMongolian(void) {
41752     int test_ret = 0;
41753 
41754 #if defined(LIBXML_UNICODE_ENABLED)
41755     int mem_base;
41756     int ret_val;
41757     int code; /* UCS code point */
41758     int n_code;
41759 
41760     for (n_code = 0;n_code < gen_nb_int;n_code++) {
41761         mem_base = xmlMemBlocks();
41762         code = gen_int(n_code, 0);
41763 
41764         ret_val = xmlUCSIsMongolian(code);
41765         desret_int(ret_val);
41766         call_tests++;
41767         des_int(n_code, code, 0);
41768         xmlResetLastError();
41769         if (mem_base != xmlMemBlocks()) {
41770             printf("Leak of %d blocks found in xmlUCSIsMongolian",
41771 	           xmlMemBlocks() - mem_base);
41772 	    test_ret++;
41773             printf(" %d", n_code);
41774             printf("\n");
41775         }
41776     }
41777     function_tests++;
41778 #endif
41779 
41780     return(test_ret);
41781 }
41782 
41783 
41784 static int
test_xmlUCSIsMusicalSymbols(void)41785 test_xmlUCSIsMusicalSymbols(void) {
41786     int test_ret = 0;
41787 
41788 #if defined(LIBXML_UNICODE_ENABLED)
41789     int mem_base;
41790     int ret_val;
41791     int code; /* UCS code point */
41792     int n_code;
41793 
41794     for (n_code = 0;n_code < gen_nb_int;n_code++) {
41795         mem_base = xmlMemBlocks();
41796         code = gen_int(n_code, 0);
41797 
41798         ret_val = xmlUCSIsMusicalSymbols(code);
41799         desret_int(ret_val);
41800         call_tests++;
41801         des_int(n_code, code, 0);
41802         xmlResetLastError();
41803         if (mem_base != xmlMemBlocks()) {
41804             printf("Leak of %d blocks found in xmlUCSIsMusicalSymbols",
41805 	           xmlMemBlocks() - mem_base);
41806 	    test_ret++;
41807             printf(" %d", n_code);
41808             printf("\n");
41809         }
41810     }
41811     function_tests++;
41812 #endif
41813 
41814     return(test_ret);
41815 }
41816 
41817 
41818 static int
test_xmlUCSIsMyanmar(void)41819 test_xmlUCSIsMyanmar(void) {
41820     int test_ret = 0;
41821 
41822 #if defined(LIBXML_UNICODE_ENABLED)
41823     int mem_base;
41824     int ret_val;
41825     int code; /* UCS code point */
41826     int n_code;
41827 
41828     for (n_code = 0;n_code < gen_nb_int;n_code++) {
41829         mem_base = xmlMemBlocks();
41830         code = gen_int(n_code, 0);
41831 
41832         ret_val = xmlUCSIsMyanmar(code);
41833         desret_int(ret_val);
41834         call_tests++;
41835         des_int(n_code, code, 0);
41836         xmlResetLastError();
41837         if (mem_base != xmlMemBlocks()) {
41838             printf("Leak of %d blocks found in xmlUCSIsMyanmar",
41839 	           xmlMemBlocks() - mem_base);
41840 	    test_ret++;
41841             printf(" %d", n_code);
41842             printf("\n");
41843         }
41844     }
41845     function_tests++;
41846 #endif
41847 
41848     return(test_ret);
41849 }
41850 
41851 
41852 static int
test_xmlUCSIsNumberForms(void)41853 test_xmlUCSIsNumberForms(void) {
41854     int test_ret = 0;
41855 
41856 #if defined(LIBXML_UNICODE_ENABLED)
41857     int mem_base;
41858     int ret_val;
41859     int code; /* UCS code point */
41860     int n_code;
41861 
41862     for (n_code = 0;n_code < gen_nb_int;n_code++) {
41863         mem_base = xmlMemBlocks();
41864         code = gen_int(n_code, 0);
41865 
41866         ret_val = xmlUCSIsNumberForms(code);
41867         desret_int(ret_val);
41868         call_tests++;
41869         des_int(n_code, code, 0);
41870         xmlResetLastError();
41871         if (mem_base != xmlMemBlocks()) {
41872             printf("Leak of %d blocks found in xmlUCSIsNumberForms",
41873 	           xmlMemBlocks() - mem_base);
41874 	    test_ret++;
41875             printf(" %d", n_code);
41876             printf("\n");
41877         }
41878     }
41879     function_tests++;
41880 #endif
41881 
41882     return(test_ret);
41883 }
41884 
41885 
41886 static int
test_xmlUCSIsOgham(void)41887 test_xmlUCSIsOgham(void) {
41888     int test_ret = 0;
41889 
41890 #if defined(LIBXML_UNICODE_ENABLED)
41891     int mem_base;
41892     int ret_val;
41893     int code; /* UCS code point */
41894     int n_code;
41895 
41896     for (n_code = 0;n_code < gen_nb_int;n_code++) {
41897         mem_base = xmlMemBlocks();
41898         code = gen_int(n_code, 0);
41899 
41900         ret_val = xmlUCSIsOgham(code);
41901         desret_int(ret_val);
41902         call_tests++;
41903         des_int(n_code, code, 0);
41904         xmlResetLastError();
41905         if (mem_base != xmlMemBlocks()) {
41906             printf("Leak of %d blocks found in xmlUCSIsOgham",
41907 	           xmlMemBlocks() - mem_base);
41908 	    test_ret++;
41909             printf(" %d", n_code);
41910             printf("\n");
41911         }
41912     }
41913     function_tests++;
41914 #endif
41915 
41916     return(test_ret);
41917 }
41918 
41919 
41920 static int
test_xmlUCSIsOldItalic(void)41921 test_xmlUCSIsOldItalic(void) {
41922     int test_ret = 0;
41923 
41924 #if defined(LIBXML_UNICODE_ENABLED)
41925     int mem_base;
41926     int ret_val;
41927     int code; /* UCS code point */
41928     int n_code;
41929 
41930     for (n_code = 0;n_code < gen_nb_int;n_code++) {
41931         mem_base = xmlMemBlocks();
41932         code = gen_int(n_code, 0);
41933 
41934         ret_val = xmlUCSIsOldItalic(code);
41935         desret_int(ret_val);
41936         call_tests++;
41937         des_int(n_code, code, 0);
41938         xmlResetLastError();
41939         if (mem_base != xmlMemBlocks()) {
41940             printf("Leak of %d blocks found in xmlUCSIsOldItalic",
41941 	           xmlMemBlocks() - mem_base);
41942 	    test_ret++;
41943             printf(" %d", n_code);
41944             printf("\n");
41945         }
41946     }
41947     function_tests++;
41948 #endif
41949 
41950     return(test_ret);
41951 }
41952 
41953 
41954 static int
test_xmlUCSIsOpticalCharacterRecognition(void)41955 test_xmlUCSIsOpticalCharacterRecognition(void) {
41956     int test_ret = 0;
41957 
41958 #if defined(LIBXML_UNICODE_ENABLED)
41959     int mem_base;
41960     int ret_val;
41961     int code; /* UCS code point */
41962     int n_code;
41963 
41964     for (n_code = 0;n_code < gen_nb_int;n_code++) {
41965         mem_base = xmlMemBlocks();
41966         code = gen_int(n_code, 0);
41967 
41968         ret_val = xmlUCSIsOpticalCharacterRecognition(code);
41969         desret_int(ret_val);
41970         call_tests++;
41971         des_int(n_code, code, 0);
41972         xmlResetLastError();
41973         if (mem_base != xmlMemBlocks()) {
41974             printf("Leak of %d blocks found in xmlUCSIsOpticalCharacterRecognition",
41975 	           xmlMemBlocks() - mem_base);
41976 	    test_ret++;
41977             printf(" %d", n_code);
41978             printf("\n");
41979         }
41980     }
41981     function_tests++;
41982 #endif
41983 
41984     return(test_ret);
41985 }
41986 
41987 
41988 static int
test_xmlUCSIsOriya(void)41989 test_xmlUCSIsOriya(void) {
41990     int test_ret = 0;
41991 
41992 #if defined(LIBXML_UNICODE_ENABLED)
41993     int mem_base;
41994     int ret_val;
41995     int code; /* UCS code point */
41996     int n_code;
41997 
41998     for (n_code = 0;n_code < gen_nb_int;n_code++) {
41999         mem_base = xmlMemBlocks();
42000         code = gen_int(n_code, 0);
42001 
42002         ret_val = xmlUCSIsOriya(code);
42003         desret_int(ret_val);
42004         call_tests++;
42005         des_int(n_code, code, 0);
42006         xmlResetLastError();
42007         if (mem_base != xmlMemBlocks()) {
42008             printf("Leak of %d blocks found in xmlUCSIsOriya",
42009 	           xmlMemBlocks() - mem_base);
42010 	    test_ret++;
42011             printf(" %d", n_code);
42012             printf("\n");
42013         }
42014     }
42015     function_tests++;
42016 #endif
42017 
42018     return(test_ret);
42019 }
42020 
42021 
42022 static int
test_xmlUCSIsOsmanya(void)42023 test_xmlUCSIsOsmanya(void) {
42024     int test_ret = 0;
42025 
42026 #if defined(LIBXML_UNICODE_ENABLED)
42027     int mem_base;
42028     int ret_val;
42029     int code; /* UCS code point */
42030     int n_code;
42031 
42032     for (n_code = 0;n_code < gen_nb_int;n_code++) {
42033         mem_base = xmlMemBlocks();
42034         code = gen_int(n_code, 0);
42035 
42036         ret_val = xmlUCSIsOsmanya(code);
42037         desret_int(ret_val);
42038         call_tests++;
42039         des_int(n_code, code, 0);
42040         xmlResetLastError();
42041         if (mem_base != xmlMemBlocks()) {
42042             printf("Leak of %d blocks found in xmlUCSIsOsmanya",
42043 	           xmlMemBlocks() - mem_base);
42044 	    test_ret++;
42045             printf(" %d", n_code);
42046             printf("\n");
42047         }
42048     }
42049     function_tests++;
42050 #endif
42051 
42052     return(test_ret);
42053 }
42054 
42055 
42056 static int
test_xmlUCSIsPhoneticExtensions(void)42057 test_xmlUCSIsPhoneticExtensions(void) {
42058     int test_ret = 0;
42059 
42060 #if defined(LIBXML_UNICODE_ENABLED)
42061     int mem_base;
42062     int ret_val;
42063     int code; /* UCS code point */
42064     int n_code;
42065 
42066     for (n_code = 0;n_code < gen_nb_int;n_code++) {
42067         mem_base = xmlMemBlocks();
42068         code = gen_int(n_code, 0);
42069 
42070         ret_val = xmlUCSIsPhoneticExtensions(code);
42071         desret_int(ret_val);
42072         call_tests++;
42073         des_int(n_code, code, 0);
42074         xmlResetLastError();
42075         if (mem_base != xmlMemBlocks()) {
42076             printf("Leak of %d blocks found in xmlUCSIsPhoneticExtensions",
42077 	           xmlMemBlocks() - mem_base);
42078 	    test_ret++;
42079             printf(" %d", n_code);
42080             printf("\n");
42081         }
42082     }
42083     function_tests++;
42084 #endif
42085 
42086     return(test_ret);
42087 }
42088 
42089 
42090 static int
test_xmlUCSIsPrivateUse(void)42091 test_xmlUCSIsPrivateUse(void) {
42092     int test_ret = 0;
42093 
42094 #if defined(LIBXML_UNICODE_ENABLED)
42095     int mem_base;
42096     int ret_val;
42097     int code; /* UCS code point */
42098     int n_code;
42099 
42100     for (n_code = 0;n_code < gen_nb_int;n_code++) {
42101         mem_base = xmlMemBlocks();
42102         code = gen_int(n_code, 0);
42103 
42104         ret_val = xmlUCSIsPrivateUse(code);
42105         desret_int(ret_val);
42106         call_tests++;
42107         des_int(n_code, code, 0);
42108         xmlResetLastError();
42109         if (mem_base != xmlMemBlocks()) {
42110             printf("Leak of %d blocks found in xmlUCSIsPrivateUse",
42111 	           xmlMemBlocks() - mem_base);
42112 	    test_ret++;
42113             printf(" %d", n_code);
42114             printf("\n");
42115         }
42116     }
42117     function_tests++;
42118 #endif
42119 
42120     return(test_ret);
42121 }
42122 
42123 
42124 static int
test_xmlUCSIsPrivateUseArea(void)42125 test_xmlUCSIsPrivateUseArea(void) {
42126     int test_ret = 0;
42127 
42128 #if defined(LIBXML_UNICODE_ENABLED)
42129     int mem_base;
42130     int ret_val;
42131     int code; /* UCS code point */
42132     int n_code;
42133 
42134     for (n_code = 0;n_code < gen_nb_int;n_code++) {
42135         mem_base = xmlMemBlocks();
42136         code = gen_int(n_code, 0);
42137 
42138         ret_val = xmlUCSIsPrivateUseArea(code);
42139         desret_int(ret_val);
42140         call_tests++;
42141         des_int(n_code, code, 0);
42142         xmlResetLastError();
42143         if (mem_base != xmlMemBlocks()) {
42144             printf("Leak of %d blocks found in xmlUCSIsPrivateUseArea",
42145 	           xmlMemBlocks() - mem_base);
42146 	    test_ret++;
42147             printf(" %d", n_code);
42148             printf("\n");
42149         }
42150     }
42151     function_tests++;
42152 #endif
42153 
42154     return(test_ret);
42155 }
42156 
42157 
42158 static int
test_xmlUCSIsRunic(void)42159 test_xmlUCSIsRunic(void) {
42160     int test_ret = 0;
42161 
42162 #if defined(LIBXML_UNICODE_ENABLED)
42163     int mem_base;
42164     int ret_val;
42165     int code; /* UCS code point */
42166     int n_code;
42167 
42168     for (n_code = 0;n_code < gen_nb_int;n_code++) {
42169         mem_base = xmlMemBlocks();
42170         code = gen_int(n_code, 0);
42171 
42172         ret_val = xmlUCSIsRunic(code);
42173         desret_int(ret_val);
42174         call_tests++;
42175         des_int(n_code, code, 0);
42176         xmlResetLastError();
42177         if (mem_base != xmlMemBlocks()) {
42178             printf("Leak of %d blocks found in xmlUCSIsRunic",
42179 	           xmlMemBlocks() - mem_base);
42180 	    test_ret++;
42181             printf(" %d", n_code);
42182             printf("\n");
42183         }
42184     }
42185     function_tests++;
42186 #endif
42187 
42188     return(test_ret);
42189 }
42190 
42191 
42192 static int
test_xmlUCSIsShavian(void)42193 test_xmlUCSIsShavian(void) {
42194     int test_ret = 0;
42195 
42196 #if defined(LIBXML_UNICODE_ENABLED)
42197     int mem_base;
42198     int ret_val;
42199     int code; /* UCS code point */
42200     int n_code;
42201 
42202     for (n_code = 0;n_code < gen_nb_int;n_code++) {
42203         mem_base = xmlMemBlocks();
42204         code = gen_int(n_code, 0);
42205 
42206         ret_val = xmlUCSIsShavian(code);
42207         desret_int(ret_val);
42208         call_tests++;
42209         des_int(n_code, code, 0);
42210         xmlResetLastError();
42211         if (mem_base != xmlMemBlocks()) {
42212             printf("Leak of %d blocks found in xmlUCSIsShavian",
42213 	           xmlMemBlocks() - mem_base);
42214 	    test_ret++;
42215             printf(" %d", n_code);
42216             printf("\n");
42217         }
42218     }
42219     function_tests++;
42220 #endif
42221 
42222     return(test_ret);
42223 }
42224 
42225 
42226 static int
test_xmlUCSIsSinhala(void)42227 test_xmlUCSIsSinhala(void) {
42228     int test_ret = 0;
42229 
42230 #if defined(LIBXML_UNICODE_ENABLED)
42231     int mem_base;
42232     int ret_val;
42233     int code; /* UCS code point */
42234     int n_code;
42235 
42236     for (n_code = 0;n_code < gen_nb_int;n_code++) {
42237         mem_base = xmlMemBlocks();
42238         code = gen_int(n_code, 0);
42239 
42240         ret_val = xmlUCSIsSinhala(code);
42241         desret_int(ret_val);
42242         call_tests++;
42243         des_int(n_code, code, 0);
42244         xmlResetLastError();
42245         if (mem_base != xmlMemBlocks()) {
42246             printf("Leak of %d blocks found in xmlUCSIsSinhala",
42247 	           xmlMemBlocks() - mem_base);
42248 	    test_ret++;
42249             printf(" %d", n_code);
42250             printf("\n");
42251         }
42252     }
42253     function_tests++;
42254 #endif
42255 
42256     return(test_ret);
42257 }
42258 
42259 
42260 static int
test_xmlUCSIsSmallFormVariants(void)42261 test_xmlUCSIsSmallFormVariants(void) {
42262     int test_ret = 0;
42263 
42264 #if defined(LIBXML_UNICODE_ENABLED)
42265     int mem_base;
42266     int ret_val;
42267     int code; /* UCS code point */
42268     int n_code;
42269 
42270     for (n_code = 0;n_code < gen_nb_int;n_code++) {
42271         mem_base = xmlMemBlocks();
42272         code = gen_int(n_code, 0);
42273 
42274         ret_val = xmlUCSIsSmallFormVariants(code);
42275         desret_int(ret_val);
42276         call_tests++;
42277         des_int(n_code, code, 0);
42278         xmlResetLastError();
42279         if (mem_base != xmlMemBlocks()) {
42280             printf("Leak of %d blocks found in xmlUCSIsSmallFormVariants",
42281 	           xmlMemBlocks() - mem_base);
42282 	    test_ret++;
42283             printf(" %d", n_code);
42284             printf("\n");
42285         }
42286     }
42287     function_tests++;
42288 #endif
42289 
42290     return(test_ret);
42291 }
42292 
42293 
42294 static int
test_xmlUCSIsSpacingModifierLetters(void)42295 test_xmlUCSIsSpacingModifierLetters(void) {
42296     int test_ret = 0;
42297 
42298 #if defined(LIBXML_UNICODE_ENABLED)
42299     int mem_base;
42300     int ret_val;
42301     int code; /* UCS code point */
42302     int n_code;
42303 
42304     for (n_code = 0;n_code < gen_nb_int;n_code++) {
42305         mem_base = xmlMemBlocks();
42306         code = gen_int(n_code, 0);
42307 
42308         ret_val = xmlUCSIsSpacingModifierLetters(code);
42309         desret_int(ret_val);
42310         call_tests++;
42311         des_int(n_code, code, 0);
42312         xmlResetLastError();
42313         if (mem_base != xmlMemBlocks()) {
42314             printf("Leak of %d blocks found in xmlUCSIsSpacingModifierLetters",
42315 	           xmlMemBlocks() - mem_base);
42316 	    test_ret++;
42317             printf(" %d", n_code);
42318             printf("\n");
42319         }
42320     }
42321     function_tests++;
42322 #endif
42323 
42324     return(test_ret);
42325 }
42326 
42327 
42328 static int
test_xmlUCSIsSpecials(void)42329 test_xmlUCSIsSpecials(void) {
42330     int test_ret = 0;
42331 
42332 #if defined(LIBXML_UNICODE_ENABLED)
42333     int mem_base;
42334     int ret_val;
42335     int code; /* UCS code point */
42336     int n_code;
42337 
42338     for (n_code = 0;n_code < gen_nb_int;n_code++) {
42339         mem_base = xmlMemBlocks();
42340         code = gen_int(n_code, 0);
42341 
42342         ret_val = xmlUCSIsSpecials(code);
42343         desret_int(ret_val);
42344         call_tests++;
42345         des_int(n_code, code, 0);
42346         xmlResetLastError();
42347         if (mem_base != xmlMemBlocks()) {
42348             printf("Leak of %d blocks found in xmlUCSIsSpecials",
42349 	           xmlMemBlocks() - mem_base);
42350 	    test_ret++;
42351             printf(" %d", n_code);
42352             printf("\n");
42353         }
42354     }
42355     function_tests++;
42356 #endif
42357 
42358     return(test_ret);
42359 }
42360 
42361 
42362 static int
test_xmlUCSIsSuperscriptsandSubscripts(void)42363 test_xmlUCSIsSuperscriptsandSubscripts(void) {
42364     int test_ret = 0;
42365 
42366 #if defined(LIBXML_UNICODE_ENABLED)
42367     int mem_base;
42368     int ret_val;
42369     int code; /* UCS code point */
42370     int n_code;
42371 
42372     for (n_code = 0;n_code < gen_nb_int;n_code++) {
42373         mem_base = xmlMemBlocks();
42374         code = gen_int(n_code, 0);
42375 
42376         ret_val = xmlUCSIsSuperscriptsandSubscripts(code);
42377         desret_int(ret_val);
42378         call_tests++;
42379         des_int(n_code, code, 0);
42380         xmlResetLastError();
42381         if (mem_base != xmlMemBlocks()) {
42382             printf("Leak of %d blocks found in xmlUCSIsSuperscriptsandSubscripts",
42383 	           xmlMemBlocks() - mem_base);
42384 	    test_ret++;
42385             printf(" %d", n_code);
42386             printf("\n");
42387         }
42388     }
42389     function_tests++;
42390 #endif
42391 
42392     return(test_ret);
42393 }
42394 
42395 
42396 static int
test_xmlUCSIsSupplementalArrowsA(void)42397 test_xmlUCSIsSupplementalArrowsA(void) {
42398     int test_ret = 0;
42399 
42400 #if defined(LIBXML_UNICODE_ENABLED)
42401     int mem_base;
42402     int ret_val;
42403     int code; /* UCS code point */
42404     int n_code;
42405 
42406     for (n_code = 0;n_code < gen_nb_int;n_code++) {
42407         mem_base = xmlMemBlocks();
42408         code = gen_int(n_code, 0);
42409 
42410         ret_val = xmlUCSIsSupplementalArrowsA(code);
42411         desret_int(ret_val);
42412         call_tests++;
42413         des_int(n_code, code, 0);
42414         xmlResetLastError();
42415         if (mem_base != xmlMemBlocks()) {
42416             printf("Leak of %d blocks found in xmlUCSIsSupplementalArrowsA",
42417 	           xmlMemBlocks() - mem_base);
42418 	    test_ret++;
42419             printf(" %d", n_code);
42420             printf("\n");
42421         }
42422     }
42423     function_tests++;
42424 #endif
42425 
42426     return(test_ret);
42427 }
42428 
42429 
42430 static int
test_xmlUCSIsSupplementalArrowsB(void)42431 test_xmlUCSIsSupplementalArrowsB(void) {
42432     int test_ret = 0;
42433 
42434 #if defined(LIBXML_UNICODE_ENABLED)
42435     int mem_base;
42436     int ret_val;
42437     int code; /* UCS code point */
42438     int n_code;
42439 
42440     for (n_code = 0;n_code < gen_nb_int;n_code++) {
42441         mem_base = xmlMemBlocks();
42442         code = gen_int(n_code, 0);
42443 
42444         ret_val = xmlUCSIsSupplementalArrowsB(code);
42445         desret_int(ret_val);
42446         call_tests++;
42447         des_int(n_code, code, 0);
42448         xmlResetLastError();
42449         if (mem_base != xmlMemBlocks()) {
42450             printf("Leak of %d blocks found in xmlUCSIsSupplementalArrowsB",
42451 	           xmlMemBlocks() - mem_base);
42452 	    test_ret++;
42453             printf(" %d", n_code);
42454             printf("\n");
42455         }
42456     }
42457     function_tests++;
42458 #endif
42459 
42460     return(test_ret);
42461 }
42462 
42463 
42464 static int
test_xmlUCSIsSupplementalMathematicalOperators(void)42465 test_xmlUCSIsSupplementalMathematicalOperators(void) {
42466     int test_ret = 0;
42467 
42468 #if defined(LIBXML_UNICODE_ENABLED)
42469     int mem_base;
42470     int ret_val;
42471     int code; /* UCS code point */
42472     int n_code;
42473 
42474     for (n_code = 0;n_code < gen_nb_int;n_code++) {
42475         mem_base = xmlMemBlocks();
42476         code = gen_int(n_code, 0);
42477 
42478         ret_val = xmlUCSIsSupplementalMathematicalOperators(code);
42479         desret_int(ret_val);
42480         call_tests++;
42481         des_int(n_code, code, 0);
42482         xmlResetLastError();
42483         if (mem_base != xmlMemBlocks()) {
42484             printf("Leak of %d blocks found in xmlUCSIsSupplementalMathematicalOperators",
42485 	           xmlMemBlocks() - mem_base);
42486 	    test_ret++;
42487             printf(" %d", n_code);
42488             printf("\n");
42489         }
42490     }
42491     function_tests++;
42492 #endif
42493 
42494     return(test_ret);
42495 }
42496 
42497 
42498 static int
test_xmlUCSIsSupplementaryPrivateUseAreaA(void)42499 test_xmlUCSIsSupplementaryPrivateUseAreaA(void) {
42500     int test_ret = 0;
42501 
42502 #if defined(LIBXML_UNICODE_ENABLED)
42503     int mem_base;
42504     int ret_val;
42505     int code; /* UCS code point */
42506     int n_code;
42507 
42508     for (n_code = 0;n_code < gen_nb_int;n_code++) {
42509         mem_base = xmlMemBlocks();
42510         code = gen_int(n_code, 0);
42511 
42512         ret_val = xmlUCSIsSupplementaryPrivateUseAreaA(code);
42513         desret_int(ret_val);
42514         call_tests++;
42515         des_int(n_code, code, 0);
42516         xmlResetLastError();
42517         if (mem_base != xmlMemBlocks()) {
42518             printf("Leak of %d blocks found in xmlUCSIsSupplementaryPrivateUseAreaA",
42519 	           xmlMemBlocks() - mem_base);
42520 	    test_ret++;
42521             printf(" %d", n_code);
42522             printf("\n");
42523         }
42524     }
42525     function_tests++;
42526 #endif
42527 
42528     return(test_ret);
42529 }
42530 
42531 
42532 static int
test_xmlUCSIsSupplementaryPrivateUseAreaB(void)42533 test_xmlUCSIsSupplementaryPrivateUseAreaB(void) {
42534     int test_ret = 0;
42535 
42536 #if defined(LIBXML_UNICODE_ENABLED)
42537     int mem_base;
42538     int ret_val;
42539     int code; /* UCS code point */
42540     int n_code;
42541 
42542     for (n_code = 0;n_code < gen_nb_int;n_code++) {
42543         mem_base = xmlMemBlocks();
42544         code = gen_int(n_code, 0);
42545 
42546         ret_val = xmlUCSIsSupplementaryPrivateUseAreaB(code);
42547         desret_int(ret_val);
42548         call_tests++;
42549         des_int(n_code, code, 0);
42550         xmlResetLastError();
42551         if (mem_base != xmlMemBlocks()) {
42552             printf("Leak of %d blocks found in xmlUCSIsSupplementaryPrivateUseAreaB",
42553 	           xmlMemBlocks() - mem_base);
42554 	    test_ret++;
42555             printf(" %d", n_code);
42556             printf("\n");
42557         }
42558     }
42559     function_tests++;
42560 #endif
42561 
42562     return(test_ret);
42563 }
42564 
42565 
42566 static int
test_xmlUCSIsSyriac(void)42567 test_xmlUCSIsSyriac(void) {
42568     int test_ret = 0;
42569 
42570 #if defined(LIBXML_UNICODE_ENABLED)
42571     int mem_base;
42572     int ret_val;
42573     int code; /* UCS code point */
42574     int n_code;
42575 
42576     for (n_code = 0;n_code < gen_nb_int;n_code++) {
42577         mem_base = xmlMemBlocks();
42578         code = gen_int(n_code, 0);
42579 
42580         ret_val = xmlUCSIsSyriac(code);
42581         desret_int(ret_val);
42582         call_tests++;
42583         des_int(n_code, code, 0);
42584         xmlResetLastError();
42585         if (mem_base != xmlMemBlocks()) {
42586             printf("Leak of %d blocks found in xmlUCSIsSyriac",
42587 	           xmlMemBlocks() - mem_base);
42588 	    test_ret++;
42589             printf(" %d", n_code);
42590             printf("\n");
42591         }
42592     }
42593     function_tests++;
42594 #endif
42595 
42596     return(test_ret);
42597 }
42598 
42599 
42600 static int
test_xmlUCSIsTagalog(void)42601 test_xmlUCSIsTagalog(void) {
42602     int test_ret = 0;
42603 
42604 #if defined(LIBXML_UNICODE_ENABLED)
42605     int mem_base;
42606     int ret_val;
42607     int code; /* UCS code point */
42608     int n_code;
42609 
42610     for (n_code = 0;n_code < gen_nb_int;n_code++) {
42611         mem_base = xmlMemBlocks();
42612         code = gen_int(n_code, 0);
42613 
42614         ret_val = xmlUCSIsTagalog(code);
42615         desret_int(ret_val);
42616         call_tests++;
42617         des_int(n_code, code, 0);
42618         xmlResetLastError();
42619         if (mem_base != xmlMemBlocks()) {
42620             printf("Leak of %d blocks found in xmlUCSIsTagalog",
42621 	           xmlMemBlocks() - mem_base);
42622 	    test_ret++;
42623             printf(" %d", n_code);
42624             printf("\n");
42625         }
42626     }
42627     function_tests++;
42628 #endif
42629 
42630     return(test_ret);
42631 }
42632 
42633 
42634 static int
test_xmlUCSIsTagbanwa(void)42635 test_xmlUCSIsTagbanwa(void) {
42636     int test_ret = 0;
42637 
42638 #if defined(LIBXML_UNICODE_ENABLED)
42639     int mem_base;
42640     int ret_val;
42641     int code; /* UCS code point */
42642     int n_code;
42643 
42644     for (n_code = 0;n_code < gen_nb_int;n_code++) {
42645         mem_base = xmlMemBlocks();
42646         code = gen_int(n_code, 0);
42647 
42648         ret_val = xmlUCSIsTagbanwa(code);
42649         desret_int(ret_val);
42650         call_tests++;
42651         des_int(n_code, code, 0);
42652         xmlResetLastError();
42653         if (mem_base != xmlMemBlocks()) {
42654             printf("Leak of %d blocks found in xmlUCSIsTagbanwa",
42655 	           xmlMemBlocks() - mem_base);
42656 	    test_ret++;
42657             printf(" %d", n_code);
42658             printf("\n");
42659         }
42660     }
42661     function_tests++;
42662 #endif
42663 
42664     return(test_ret);
42665 }
42666 
42667 
42668 static int
test_xmlUCSIsTags(void)42669 test_xmlUCSIsTags(void) {
42670     int test_ret = 0;
42671 
42672 #if defined(LIBXML_UNICODE_ENABLED)
42673     int mem_base;
42674     int ret_val;
42675     int code; /* UCS code point */
42676     int n_code;
42677 
42678     for (n_code = 0;n_code < gen_nb_int;n_code++) {
42679         mem_base = xmlMemBlocks();
42680         code = gen_int(n_code, 0);
42681 
42682         ret_val = xmlUCSIsTags(code);
42683         desret_int(ret_val);
42684         call_tests++;
42685         des_int(n_code, code, 0);
42686         xmlResetLastError();
42687         if (mem_base != xmlMemBlocks()) {
42688             printf("Leak of %d blocks found in xmlUCSIsTags",
42689 	           xmlMemBlocks() - mem_base);
42690 	    test_ret++;
42691             printf(" %d", n_code);
42692             printf("\n");
42693         }
42694     }
42695     function_tests++;
42696 #endif
42697 
42698     return(test_ret);
42699 }
42700 
42701 
42702 static int
test_xmlUCSIsTaiLe(void)42703 test_xmlUCSIsTaiLe(void) {
42704     int test_ret = 0;
42705 
42706 #if defined(LIBXML_UNICODE_ENABLED)
42707     int mem_base;
42708     int ret_val;
42709     int code; /* UCS code point */
42710     int n_code;
42711 
42712     for (n_code = 0;n_code < gen_nb_int;n_code++) {
42713         mem_base = xmlMemBlocks();
42714         code = gen_int(n_code, 0);
42715 
42716         ret_val = xmlUCSIsTaiLe(code);
42717         desret_int(ret_val);
42718         call_tests++;
42719         des_int(n_code, code, 0);
42720         xmlResetLastError();
42721         if (mem_base != xmlMemBlocks()) {
42722             printf("Leak of %d blocks found in xmlUCSIsTaiLe",
42723 	           xmlMemBlocks() - mem_base);
42724 	    test_ret++;
42725             printf(" %d", n_code);
42726             printf("\n");
42727         }
42728     }
42729     function_tests++;
42730 #endif
42731 
42732     return(test_ret);
42733 }
42734 
42735 
42736 static int
test_xmlUCSIsTaiXuanJingSymbols(void)42737 test_xmlUCSIsTaiXuanJingSymbols(void) {
42738     int test_ret = 0;
42739 
42740 #if defined(LIBXML_UNICODE_ENABLED)
42741     int mem_base;
42742     int ret_val;
42743     int code; /* UCS code point */
42744     int n_code;
42745 
42746     for (n_code = 0;n_code < gen_nb_int;n_code++) {
42747         mem_base = xmlMemBlocks();
42748         code = gen_int(n_code, 0);
42749 
42750         ret_val = xmlUCSIsTaiXuanJingSymbols(code);
42751         desret_int(ret_val);
42752         call_tests++;
42753         des_int(n_code, code, 0);
42754         xmlResetLastError();
42755         if (mem_base != xmlMemBlocks()) {
42756             printf("Leak of %d blocks found in xmlUCSIsTaiXuanJingSymbols",
42757 	           xmlMemBlocks() - mem_base);
42758 	    test_ret++;
42759             printf(" %d", n_code);
42760             printf("\n");
42761         }
42762     }
42763     function_tests++;
42764 #endif
42765 
42766     return(test_ret);
42767 }
42768 
42769 
42770 static int
test_xmlUCSIsTamil(void)42771 test_xmlUCSIsTamil(void) {
42772     int test_ret = 0;
42773 
42774 #if defined(LIBXML_UNICODE_ENABLED)
42775     int mem_base;
42776     int ret_val;
42777     int code; /* UCS code point */
42778     int n_code;
42779 
42780     for (n_code = 0;n_code < gen_nb_int;n_code++) {
42781         mem_base = xmlMemBlocks();
42782         code = gen_int(n_code, 0);
42783 
42784         ret_val = xmlUCSIsTamil(code);
42785         desret_int(ret_val);
42786         call_tests++;
42787         des_int(n_code, code, 0);
42788         xmlResetLastError();
42789         if (mem_base != xmlMemBlocks()) {
42790             printf("Leak of %d blocks found in xmlUCSIsTamil",
42791 	           xmlMemBlocks() - mem_base);
42792 	    test_ret++;
42793             printf(" %d", n_code);
42794             printf("\n");
42795         }
42796     }
42797     function_tests++;
42798 #endif
42799 
42800     return(test_ret);
42801 }
42802 
42803 
42804 static int
test_xmlUCSIsTelugu(void)42805 test_xmlUCSIsTelugu(void) {
42806     int test_ret = 0;
42807 
42808 #if defined(LIBXML_UNICODE_ENABLED)
42809     int mem_base;
42810     int ret_val;
42811     int code; /* UCS code point */
42812     int n_code;
42813 
42814     for (n_code = 0;n_code < gen_nb_int;n_code++) {
42815         mem_base = xmlMemBlocks();
42816         code = gen_int(n_code, 0);
42817 
42818         ret_val = xmlUCSIsTelugu(code);
42819         desret_int(ret_val);
42820         call_tests++;
42821         des_int(n_code, code, 0);
42822         xmlResetLastError();
42823         if (mem_base != xmlMemBlocks()) {
42824             printf("Leak of %d blocks found in xmlUCSIsTelugu",
42825 	           xmlMemBlocks() - mem_base);
42826 	    test_ret++;
42827             printf(" %d", n_code);
42828             printf("\n");
42829         }
42830     }
42831     function_tests++;
42832 #endif
42833 
42834     return(test_ret);
42835 }
42836 
42837 
42838 static int
test_xmlUCSIsThaana(void)42839 test_xmlUCSIsThaana(void) {
42840     int test_ret = 0;
42841 
42842 #if defined(LIBXML_UNICODE_ENABLED)
42843     int mem_base;
42844     int ret_val;
42845     int code; /* UCS code point */
42846     int n_code;
42847 
42848     for (n_code = 0;n_code < gen_nb_int;n_code++) {
42849         mem_base = xmlMemBlocks();
42850         code = gen_int(n_code, 0);
42851 
42852         ret_val = xmlUCSIsThaana(code);
42853         desret_int(ret_val);
42854         call_tests++;
42855         des_int(n_code, code, 0);
42856         xmlResetLastError();
42857         if (mem_base != xmlMemBlocks()) {
42858             printf("Leak of %d blocks found in xmlUCSIsThaana",
42859 	           xmlMemBlocks() - mem_base);
42860 	    test_ret++;
42861             printf(" %d", n_code);
42862             printf("\n");
42863         }
42864     }
42865     function_tests++;
42866 #endif
42867 
42868     return(test_ret);
42869 }
42870 
42871 
42872 static int
test_xmlUCSIsThai(void)42873 test_xmlUCSIsThai(void) {
42874     int test_ret = 0;
42875 
42876 #if defined(LIBXML_UNICODE_ENABLED)
42877     int mem_base;
42878     int ret_val;
42879     int code; /* UCS code point */
42880     int n_code;
42881 
42882     for (n_code = 0;n_code < gen_nb_int;n_code++) {
42883         mem_base = xmlMemBlocks();
42884         code = gen_int(n_code, 0);
42885 
42886         ret_val = xmlUCSIsThai(code);
42887         desret_int(ret_val);
42888         call_tests++;
42889         des_int(n_code, code, 0);
42890         xmlResetLastError();
42891         if (mem_base != xmlMemBlocks()) {
42892             printf("Leak of %d blocks found in xmlUCSIsThai",
42893 	           xmlMemBlocks() - mem_base);
42894 	    test_ret++;
42895             printf(" %d", n_code);
42896             printf("\n");
42897         }
42898     }
42899     function_tests++;
42900 #endif
42901 
42902     return(test_ret);
42903 }
42904 
42905 
42906 static int
test_xmlUCSIsTibetan(void)42907 test_xmlUCSIsTibetan(void) {
42908     int test_ret = 0;
42909 
42910 #if defined(LIBXML_UNICODE_ENABLED)
42911     int mem_base;
42912     int ret_val;
42913     int code; /* UCS code point */
42914     int n_code;
42915 
42916     for (n_code = 0;n_code < gen_nb_int;n_code++) {
42917         mem_base = xmlMemBlocks();
42918         code = gen_int(n_code, 0);
42919 
42920         ret_val = xmlUCSIsTibetan(code);
42921         desret_int(ret_val);
42922         call_tests++;
42923         des_int(n_code, code, 0);
42924         xmlResetLastError();
42925         if (mem_base != xmlMemBlocks()) {
42926             printf("Leak of %d blocks found in xmlUCSIsTibetan",
42927 	           xmlMemBlocks() - mem_base);
42928 	    test_ret++;
42929             printf(" %d", n_code);
42930             printf("\n");
42931         }
42932     }
42933     function_tests++;
42934 #endif
42935 
42936     return(test_ret);
42937 }
42938 
42939 
42940 static int
test_xmlUCSIsUgaritic(void)42941 test_xmlUCSIsUgaritic(void) {
42942     int test_ret = 0;
42943 
42944 #if defined(LIBXML_UNICODE_ENABLED)
42945     int mem_base;
42946     int ret_val;
42947     int code; /* UCS code point */
42948     int n_code;
42949 
42950     for (n_code = 0;n_code < gen_nb_int;n_code++) {
42951         mem_base = xmlMemBlocks();
42952         code = gen_int(n_code, 0);
42953 
42954         ret_val = xmlUCSIsUgaritic(code);
42955         desret_int(ret_val);
42956         call_tests++;
42957         des_int(n_code, code, 0);
42958         xmlResetLastError();
42959         if (mem_base != xmlMemBlocks()) {
42960             printf("Leak of %d blocks found in xmlUCSIsUgaritic",
42961 	           xmlMemBlocks() - mem_base);
42962 	    test_ret++;
42963             printf(" %d", n_code);
42964             printf("\n");
42965         }
42966     }
42967     function_tests++;
42968 #endif
42969 
42970     return(test_ret);
42971 }
42972 
42973 
42974 static int
test_xmlUCSIsUnifiedCanadianAboriginalSyllabics(void)42975 test_xmlUCSIsUnifiedCanadianAboriginalSyllabics(void) {
42976     int test_ret = 0;
42977 
42978 #if defined(LIBXML_UNICODE_ENABLED)
42979     int mem_base;
42980     int ret_val;
42981     int code; /* UCS code point */
42982     int n_code;
42983 
42984     for (n_code = 0;n_code < gen_nb_int;n_code++) {
42985         mem_base = xmlMemBlocks();
42986         code = gen_int(n_code, 0);
42987 
42988         ret_val = xmlUCSIsUnifiedCanadianAboriginalSyllabics(code);
42989         desret_int(ret_val);
42990         call_tests++;
42991         des_int(n_code, code, 0);
42992         xmlResetLastError();
42993         if (mem_base != xmlMemBlocks()) {
42994             printf("Leak of %d blocks found in xmlUCSIsUnifiedCanadianAboriginalSyllabics",
42995 	           xmlMemBlocks() - mem_base);
42996 	    test_ret++;
42997             printf(" %d", n_code);
42998             printf("\n");
42999         }
43000     }
43001     function_tests++;
43002 #endif
43003 
43004     return(test_ret);
43005 }
43006 
43007 
43008 static int
test_xmlUCSIsVariationSelectors(void)43009 test_xmlUCSIsVariationSelectors(void) {
43010     int test_ret = 0;
43011 
43012 #if defined(LIBXML_UNICODE_ENABLED)
43013     int mem_base;
43014     int ret_val;
43015     int code; /* UCS code point */
43016     int n_code;
43017 
43018     for (n_code = 0;n_code < gen_nb_int;n_code++) {
43019         mem_base = xmlMemBlocks();
43020         code = gen_int(n_code, 0);
43021 
43022         ret_val = xmlUCSIsVariationSelectors(code);
43023         desret_int(ret_val);
43024         call_tests++;
43025         des_int(n_code, code, 0);
43026         xmlResetLastError();
43027         if (mem_base != xmlMemBlocks()) {
43028             printf("Leak of %d blocks found in xmlUCSIsVariationSelectors",
43029 	           xmlMemBlocks() - mem_base);
43030 	    test_ret++;
43031             printf(" %d", n_code);
43032             printf("\n");
43033         }
43034     }
43035     function_tests++;
43036 #endif
43037 
43038     return(test_ret);
43039 }
43040 
43041 
43042 static int
test_xmlUCSIsVariationSelectorsSupplement(void)43043 test_xmlUCSIsVariationSelectorsSupplement(void) {
43044     int test_ret = 0;
43045 
43046 #if defined(LIBXML_UNICODE_ENABLED)
43047     int mem_base;
43048     int ret_val;
43049     int code; /* UCS code point */
43050     int n_code;
43051 
43052     for (n_code = 0;n_code < gen_nb_int;n_code++) {
43053         mem_base = xmlMemBlocks();
43054         code = gen_int(n_code, 0);
43055 
43056         ret_val = xmlUCSIsVariationSelectorsSupplement(code);
43057         desret_int(ret_val);
43058         call_tests++;
43059         des_int(n_code, code, 0);
43060         xmlResetLastError();
43061         if (mem_base != xmlMemBlocks()) {
43062             printf("Leak of %d blocks found in xmlUCSIsVariationSelectorsSupplement",
43063 	           xmlMemBlocks() - mem_base);
43064 	    test_ret++;
43065             printf(" %d", n_code);
43066             printf("\n");
43067         }
43068     }
43069     function_tests++;
43070 #endif
43071 
43072     return(test_ret);
43073 }
43074 
43075 
43076 static int
test_xmlUCSIsYiRadicals(void)43077 test_xmlUCSIsYiRadicals(void) {
43078     int test_ret = 0;
43079 
43080 #if defined(LIBXML_UNICODE_ENABLED)
43081     int mem_base;
43082     int ret_val;
43083     int code; /* UCS code point */
43084     int n_code;
43085 
43086     for (n_code = 0;n_code < gen_nb_int;n_code++) {
43087         mem_base = xmlMemBlocks();
43088         code = gen_int(n_code, 0);
43089 
43090         ret_val = xmlUCSIsYiRadicals(code);
43091         desret_int(ret_val);
43092         call_tests++;
43093         des_int(n_code, code, 0);
43094         xmlResetLastError();
43095         if (mem_base != xmlMemBlocks()) {
43096             printf("Leak of %d blocks found in xmlUCSIsYiRadicals",
43097 	           xmlMemBlocks() - mem_base);
43098 	    test_ret++;
43099             printf(" %d", n_code);
43100             printf("\n");
43101         }
43102     }
43103     function_tests++;
43104 #endif
43105 
43106     return(test_ret);
43107 }
43108 
43109 
43110 static int
test_xmlUCSIsYiSyllables(void)43111 test_xmlUCSIsYiSyllables(void) {
43112     int test_ret = 0;
43113 
43114 #if defined(LIBXML_UNICODE_ENABLED)
43115     int mem_base;
43116     int ret_val;
43117     int code; /* UCS code point */
43118     int n_code;
43119 
43120     for (n_code = 0;n_code < gen_nb_int;n_code++) {
43121         mem_base = xmlMemBlocks();
43122         code = gen_int(n_code, 0);
43123 
43124         ret_val = xmlUCSIsYiSyllables(code);
43125         desret_int(ret_val);
43126         call_tests++;
43127         des_int(n_code, code, 0);
43128         xmlResetLastError();
43129         if (mem_base != xmlMemBlocks()) {
43130             printf("Leak of %d blocks found in xmlUCSIsYiSyllables",
43131 	           xmlMemBlocks() - mem_base);
43132 	    test_ret++;
43133             printf(" %d", n_code);
43134             printf("\n");
43135         }
43136     }
43137     function_tests++;
43138 #endif
43139 
43140     return(test_ret);
43141 }
43142 
43143 
43144 static int
test_xmlUCSIsYijingHexagramSymbols(void)43145 test_xmlUCSIsYijingHexagramSymbols(void) {
43146     int test_ret = 0;
43147 
43148 #if defined(LIBXML_UNICODE_ENABLED)
43149     int mem_base;
43150     int ret_val;
43151     int code; /* UCS code point */
43152     int n_code;
43153 
43154     for (n_code = 0;n_code < gen_nb_int;n_code++) {
43155         mem_base = xmlMemBlocks();
43156         code = gen_int(n_code, 0);
43157 
43158         ret_val = xmlUCSIsYijingHexagramSymbols(code);
43159         desret_int(ret_val);
43160         call_tests++;
43161         des_int(n_code, code, 0);
43162         xmlResetLastError();
43163         if (mem_base != xmlMemBlocks()) {
43164             printf("Leak of %d blocks found in xmlUCSIsYijingHexagramSymbols",
43165 	           xmlMemBlocks() - mem_base);
43166 	    test_ret++;
43167             printf(" %d", n_code);
43168             printf("\n");
43169         }
43170     }
43171     function_tests++;
43172 #endif
43173 
43174     return(test_ret);
43175 }
43176 
43177 static int
test_xmlunicode(void)43178 test_xmlunicode(void) {
43179     int test_ret = 0;
43180 
43181     if (quiet == 0) printf("Testing xmlunicode : 166 of 166 functions ...\n");
43182     test_ret += test_xmlUCSIsAegeanNumbers();
43183     test_ret += test_xmlUCSIsAlphabeticPresentationForms();
43184     test_ret += test_xmlUCSIsArabic();
43185     test_ret += test_xmlUCSIsArabicPresentationFormsA();
43186     test_ret += test_xmlUCSIsArabicPresentationFormsB();
43187     test_ret += test_xmlUCSIsArmenian();
43188     test_ret += test_xmlUCSIsArrows();
43189     test_ret += test_xmlUCSIsBasicLatin();
43190     test_ret += test_xmlUCSIsBengali();
43191     test_ret += test_xmlUCSIsBlock();
43192     test_ret += test_xmlUCSIsBlockElements();
43193     test_ret += test_xmlUCSIsBopomofo();
43194     test_ret += test_xmlUCSIsBopomofoExtended();
43195     test_ret += test_xmlUCSIsBoxDrawing();
43196     test_ret += test_xmlUCSIsBraillePatterns();
43197     test_ret += test_xmlUCSIsBuhid();
43198     test_ret += test_xmlUCSIsByzantineMusicalSymbols();
43199     test_ret += test_xmlUCSIsCJKCompatibility();
43200     test_ret += test_xmlUCSIsCJKCompatibilityForms();
43201     test_ret += test_xmlUCSIsCJKCompatibilityIdeographs();
43202     test_ret += test_xmlUCSIsCJKCompatibilityIdeographsSupplement();
43203     test_ret += test_xmlUCSIsCJKRadicalsSupplement();
43204     test_ret += test_xmlUCSIsCJKSymbolsandPunctuation();
43205     test_ret += test_xmlUCSIsCJKUnifiedIdeographs();
43206     test_ret += test_xmlUCSIsCJKUnifiedIdeographsExtensionA();
43207     test_ret += test_xmlUCSIsCJKUnifiedIdeographsExtensionB();
43208     test_ret += test_xmlUCSIsCat();
43209     test_ret += test_xmlUCSIsCatC();
43210     test_ret += test_xmlUCSIsCatCc();
43211     test_ret += test_xmlUCSIsCatCf();
43212     test_ret += test_xmlUCSIsCatCo();
43213     test_ret += test_xmlUCSIsCatCs();
43214     test_ret += test_xmlUCSIsCatL();
43215     test_ret += test_xmlUCSIsCatLl();
43216     test_ret += test_xmlUCSIsCatLm();
43217     test_ret += test_xmlUCSIsCatLo();
43218     test_ret += test_xmlUCSIsCatLt();
43219     test_ret += test_xmlUCSIsCatLu();
43220     test_ret += test_xmlUCSIsCatM();
43221     test_ret += test_xmlUCSIsCatMc();
43222     test_ret += test_xmlUCSIsCatMe();
43223     test_ret += test_xmlUCSIsCatMn();
43224     test_ret += test_xmlUCSIsCatN();
43225     test_ret += test_xmlUCSIsCatNd();
43226     test_ret += test_xmlUCSIsCatNl();
43227     test_ret += test_xmlUCSIsCatNo();
43228     test_ret += test_xmlUCSIsCatP();
43229     test_ret += test_xmlUCSIsCatPc();
43230     test_ret += test_xmlUCSIsCatPd();
43231     test_ret += test_xmlUCSIsCatPe();
43232     test_ret += test_xmlUCSIsCatPf();
43233     test_ret += test_xmlUCSIsCatPi();
43234     test_ret += test_xmlUCSIsCatPo();
43235     test_ret += test_xmlUCSIsCatPs();
43236     test_ret += test_xmlUCSIsCatS();
43237     test_ret += test_xmlUCSIsCatSc();
43238     test_ret += test_xmlUCSIsCatSk();
43239     test_ret += test_xmlUCSIsCatSm();
43240     test_ret += test_xmlUCSIsCatSo();
43241     test_ret += test_xmlUCSIsCatZ();
43242     test_ret += test_xmlUCSIsCatZl();
43243     test_ret += test_xmlUCSIsCatZp();
43244     test_ret += test_xmlUCSIsCatZs();
43245     test_ret += test_xmlUCSIsCherokee();
43246     test_ret += test_xmlUCSIsCombiningDiacriticalMarks();
43247     test_ret += test_xmlUCSIsCombiningDiacriticalMarksforSymbols();
43248     test_ret += test_xmlUCSIsCombiningHalfMarks();
43249     test_ret += test_xmlUCSIsCombiningMarksforSymbols();
43250     test_ret += test_xmlUCSIsControlPictures();
43251     test_ret += test_xmlUCSIsCurrencySymbols();
43252     test_ret += test_xmlUCSIsCypriotSyllabary();
43253     test_ret += test_xmlUCSIsCyrillic();
43254     test_ret += test_xmlUCSIsCyrillicSupplement();
43255     test_ret += test_xmlUCSIsDeseret();
43256     test_ret += test_xmlUCSIsDevanagari();
43257     test_ret += test_xmlUCSIsDingbats();
43258     test_ret += test_xmlUCSIsEnclosedAlphanumerics();
43259     test_ret += test_xmlUCSIsEnclosedCJKLettersandMonths();
43260     test_ret += test_xmlUCSIsEthiopic();
43261     test_ret += test_xmlUCSIsGeneralPunctuation();
43262     test_ret += test_xmlUCSIsGeometricShapes();
43263     test_ret += test_xmlUCSIsGeorgian();
43264     test_ret += test_xmlUCSIsGothic();
43265     test_ret += test_xmlUCSIsGreek();
43266     test_ret += test_xmlUCSIsGreekExtended();
43267     test_ret += test_xmlUCSIsGreekandCoptic();
43268     test_ret += test_xmlUCSIsGujarati();
43269     test_ret += test_xmlUCSIsGurmukhi();
43270     test_ret += test_xmlUCSIsHalfwidthandFullwidthForms();
43271     test_ret += test_xmlUCSIsHangulCompatibilityJamo();
43272     test_ret += test_xmlUCSIsHangulJamo();
43273     test_ret += test_xmlUCSIsHangulSyllables();
43274     test_ret += test_xmlUCSIsHanunoo();
43275     test_ret += test_xmlUCSIsHebrew();
43276     test_ret += test_xmlUCSIsHighPrivateUseSurrogates();
43277     test_ret += test_xmlUCSIsHighSurrogates();
43278     test_ret += test_xmlUCSIsHiragana();
43279     test_ret += test_xmlUCSIsIPAExtensions();
43280     test_ret += test_xmlUCSIsIdeographicDescriptionCharacters();
43281     test_ret += test_xmlUCSIsKanbun();
43282     test_ret += test_xmlUCSIsKangxiRadicals();
43283     test_ret += test_xmlUCSIsKannada();
43284     test_ret += test_xmlUCSIsKatakana();
43285     test_ret += test_xmlUCSIsKatakanaPhoneticExtensions();
43286     test_ret += test_xmlUCSIsKhmer();
43287     test_ret += test_xmlUCSIsKhmerSymbols();
43288     test_ret += test_xmlUCSIsLao();
43289     test_ret += test_xmlUCSIsLatin1Supplement();
43290     test_ret += test_xmlUCSIsLatinExtendedA();
43291     test_ret += test_xmlUCSIsLatinExtendedAdditional();
43292     test_ret += test_xmlUCSIsLatinExtendedB();
43293     test_ret += test_xmlUCSIsLetterlikeSymbols();
43294     test_ret += test_xmlUCSIsLimbu();
43295     test_ret += test_xmlUCSIsLinearBIdeograms();
43296     test_ret += test_xmlUCSIsLinearBSyllabary();
43297     test_ret += test_xmlUCSIsLowSurrogates();
43298     test_ret += test_xmlUCSIsMalayalam();
43299     test_ret += test_xmlUCSIsMathematicalAlphanumericSymbols();
43300     test_ret += test_xmlUCSIsMathematicalOperators();
43301     test_ret += test_xmlUCSIsMiscellaneousMathematicalSymbolsA();
43302     test_ret += test_xmlUCSIsMiscellaneousMathematicalSymbolsB();
43303     test_ret += test_xmlUCSIsMiscellaneousSymbols();
43304     test_ret += test_xmlUCSIsMiscellaneousSymbolsandArrows();
43305     test_ret += test_xmlUCSIsMiscellaneousTechnical();
43306     test_ret += test_xmlUCSIsMongolian();
43307     test_ret += test_xmlUCSIsMusicalSymbols();
43308     test_ret += test_xmlUCSIsMyanmar();
43309     test_ret += test_xmlUCSIsNumberForms();
43310     test_ret += test_xmlUCSIsOgham();
43311     test_ret += test_xmlUCSIsOldItalic();
43312     test_ret += test_xmlUCSIsOpticalCharacterRecognition();
43313     test_ret += test_xmlUCSIsOriya();
43314     test_ret += test_xmlUCSIsOsmanya();
43315     test_ret += test_xmlUCSIsPhoneticExtensions();
43316     test_ret += test_xmlUCSIsPrivateUse();
43317     test_ret += test_xmlUCSIsPrivateUseArea();
43318     test_ret += test_xmlUCSIsRunic();
43319     test_ret += test_xmlUCSIsShavian();
43320     test_ret += test_xmlUCSIsSinhala();
43321     test_ret += test_xmlUCSIsSmallFormVariants();
43322     test_ret += test_xmlUCSIsSpacingModifierLetters();
43323     test_ret += test_xmlUCSIsSpecials();
43324     test_ret += test_xmlUCSIsSuperscriptsandSubscripts();
43325     test_ret += test_xmlUCSIsSupplementalArrowsA();
43326     test_ret += test_xmlUCSIsSupplementalArrowsB();
43327     test_ret += test_xmlUCSIsSupplementalMathematicalOperators();
43328     test_ret += test_xmlUCSIsSupplementaryPrivateUseAreaA();
43329     test_ret += test_xmlUCSIsSupplementaryPrivateUseAreaB();
43330     test_ret += test_xmlUCSIsSyriac();
43331     test_ret += test_xmlUCSIsTagalog();
43332     test_ret += test_xmlUCSIsTagbanwa();
43333     test_ret += test_xmlUCSIsTags();
43334     test_ret += test_xmlUCSIsTaiLe();
43335     test_ret += test_xmlUCSIsTaiXuanJingSymbols();
43336     test_ret += test_xmlUCSIsTamil();
43337     test_ret += test_xmlUCSIsTelugu();
43338     test_ret += test_xmlUCSIsThaana();
43339     test_ret += test_xmlUCSIsThai();
43340     test_ret += test_xmlUCSIsTibetan();
43341     test_ret += test_xmlUCSIsUgaritic();
43342     test_ret += test_xmlUCSIsUnifiedCanadianAboriginalSyllabics();
43343     test_ret += test_xmlUCSIsVariationSelectors();
43344     test_ret += test_xmlUCSIsVariationSelectorsSupplement();
43345     test_ret += test_xmlUCSIsYiRadicals();
43346     test_ret += test_xmlUCSIsYiSyllables();
43347     test_ret += test_xmlUCSIsYijingHexagramSymbols();
43348 
43349     if (test_ret != 0)
43350 	printf("Module xmlunicode: %d errors\n", test_ret);
43351     return(test_ret);
43352 }
43353 
43354 static int
test_xmlNewTextWriter(void)43355 test_xmlNewTextWriter(void) {
43356     int test_ret = 0;
43357 
43358 #if defined(LIBXML_WRITER_ENABLED)
43359     int mem_base;
43360     xmlTextWriterPtr ret_val;
43361     xmlOutputBufferPtr out; /* an xmlOutputBufferPtr */
43362     int n_out;
43363 
43364     for (n_out = 0;n_out < gen_nb_xmlOutputBufferPtr;n_out++) {
43365         mem_base = xmlMemBlocks();
43366         out = gen_xmlOutputBufferPtr(n_out, 0);
43367 
43368         ret_val = xmlNewTextWriter(out);
43369         if (ret_val != NULL) out = NULL;
43370         desret_xmlTextWriterPtr(ret_val);
43371         call_tests++;
43372         des_xmlOutputBufferPtr(n_out, out, 0);
43373         xmlResetLastError();
43374         if (mem_base != xmlMemBlocks()) {
43375             printf("Leak of %d blocks found in xmlNewTextWriter",
43376 	           xmlMemBlocks() - mem_base);
43377 	    test_ret++;
43378             printf(" %d", n_out);
43379             printf("\n");
43380         }
43381     }
43382     function_tests++;
43383 #endif
43384 
43385     return(test_ret);
43386 }
43387 
43388 
43389 static int
test_xmlNewTextWriterFilename(void)43390 test_xmlNewTextWriterFilename(void) {
43391     int test_ret = 0;
43392 
43393 #if defined(LIBXML_WRITER_ENABLED)
43394     int mem_base;
43395     xmlTextWriterPtr ret_val;
43396     const char * uri; /* the URI of the resource for the output */
43397     int n_uri;
43398     int compression; /* compress the output? */
43399     int n_compression;
43400 
43401     for (n_uri = 0;n_uri < gen_nb_fileoutput;n_uri++) {
43402     for (n_compression = 0;n_compression < gen_nb_int;n_compression++) {
43403         mem_base = xmlMemBlocks();
43404         uri = gen_fileoutput(n_uri, 0);
43405         compression = gen_int(n_compression, 1);
43406 
43407         ret_val = xmlNewTextWriterFilename(uri, compression);
43408         desret_xmlTextWriterPtr(ret_val);
43409         call_tests++;
43410         des_fileoutput(n_uri, uri, 0);
43411         des_int(n_compression, compression, 1);
43412         xmlResetLastError();
43413         if (mem_base != xmlMemBlocks()) {
43414             printf("Leak of %d blocks found in xmlNewTextWriterFilename",
43415 	           xmlMemBlocks() - mem_base);
43416 	    test_ret++;
43417             printf(" %d", n_uri);
43418             printf(" %d", n_compression);
43419             printf("\n");
43420         }
43421     }
43422     }
43423     function_tests++;
43424 #endif
43425 
43426     return(test_ret);
43427 }
43428 
43429 
43430 static int
test_xmlNewTextWriterMemory(void)43431 test_xmlNewTextWriterMemory(void) {
43432     int test_ret = 0;
43433 
43434 #if defined(LIBXML_WRITER_ENABLED)
43435     int mem_base;
43436     xmlTextWriterPtr ret_val;
43437     xmlBufferPtr buf; /* xmlBufferPtr */
43438     int n_buf;
43439     int compression; /* compress the output? */
43440     int n_compression;
43441 
43442     for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
43443     for (n_compression = 0;n_compression < gen_nb_int;n_compression++) {
43444         mem_base = xmlMemBlocks();
43445         buf = gen_xmlBufferPtr(n_buf, 0);
43446         compression = gen_int(n_compression, 1);
43447 
43448         ret_val = xmlNewTextWriterMemory(buf, compression);
43449         desret_xmlTextWriterPtr(ret_val);
43450         call_tests++;
43451         des_xmlBufferPtr(n_buf, buf, 0);
43452         des_int(n_compression, compression, 1);
43453         xmlResetLastError();
43454         if (mem_base != xmlMemBlocks()) {
43455             printf("Leak of %d blocks found in xmlNewTextWriterMemory",
43456 	           xmlMemBlocks() - mem_base);
43457 	    test_ret++;
43458             printf(" %d", n_buf);
43459             printf(" %d", n_compression);
43460             printf("\n");
43461         }
43462     }
43463     }
43464     function_tests++;
43465 #endif
43466 
43467     return(test_ret);
43468 }
43469 
43470 
43471 static int
test_xmlNewTextWriterPushParser(void)43472 test_xmlNewTextWriterPushParser(void) {
43473     int test_ret = 0;
43474 
43475 #if defined(LIBXML_WRITER_ENABLED)
43476     int mem_base;
43477     xmlTextWriterPtr ret_val;
43478     xmlParserCtxtPtr ctxt; /* xmlParserCtxtPtr to hold the new XML document tree */
43479     int n_ctxt;
43480     int compression; /* compress the output? */
43481     int n_compression;
43482 
43483     for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
43484     for (n_compression = 0;n_compression < gen_nb_int;n_compression++) {
43485         mem_base = xmlMemBlocks();
43486         ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
43487         compression = gen_int(n_compression, 1);
43488 
43489         ret_val = xmlNewTextWriterPushParser(ctxt, compression);
43490         if (ctxt != NULL) {xmlFreeDoc(ctxt->myDoc); ctxt->myDoc = NULL;} if (ret_val != NULL) ctxt = NULL;
43491         desret_xmlTextWriterPtr(ret_val);
43492         call_tests++;
43493         des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
43494         des_int(n_compression, compression, 1);
43495         xmlResetLastError();
43496         if (mem_base != xmlMemBlocks()) {
43497             printf("Leak of %d blocks found in xmlNewTextWriterPushParser",
43498 	           xmlMemBlocks() - mem_base);
43499 	    test_ret++;
43500             printf(" %d", n_ctxt);
43501             printf(" %d", n_compression);
43502             printf("\n");
43503         }
43504     }
43505     }
43506     function_tests++;
43507 #endif
43508 
43509     return(test_ret);
43510 }
43511 
43512 
43513 static int
test_xmlNewTextWriterTree(void)43514 test_xmlNewTextWriterTree(void) {
43515     int test_ret = 0;
43516 
43517 #if defined(LIBXML_WRITER_ENABLED)
43518     int mem_base;
43519     xmlTextWriterPtr ret_val;
43520     xmlDocPtr doc; /* xmlDocPtr */
43521     int n_doc;
43522     xmlNodePtr node; /* xmlNodePtr or NULL for doc->children */
43523     int n_node;
43524     int compression; /* compress the output? */
43525     int n_compression;
43526 
43527     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
43528     for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
43529     for (n_compression = 0;n_compression < gen_nb_int;n_compression++) {
43530         mem_base = xmlMemBlocks();
43531         doc = gen_xmlDocPtr(n_doc, 0);
43532         node = gen_xmlNodePtr(n_node, 1);
43533         compression = gen_int(n_compression, 2);
43534 
43535         ret_val = xmlNewTextWriterTree(doc, node, compression);
43536         desret_xmlTextWriterPtr(ret_val);
43537         call_tests++;
43538         des_xmlDocPtr(n_doc, doc, 0);
43539         des_xmlNodePtr(n_node, node, 1);
43540         des_int(n_compression, compression, 2);
43541         xmlResetLastError();
43542         if (mem_base != xmlMemBlocks()) {
43543             printf("Leak of %d blocks found in xmlNewTextWriterTree",
43544 	           xmlMemBlocks() - mem_base);
43545 	    test_ret++;
43546             printf(" %d", n_doc);
43547             printf(" %d", n_node);
43548             printf(" %d", n_compression);
43549             printf("\n");
43550         }
43551     }
43552     }
43553     }
43554     function_tests++;
43555 #endif
43556 
43557     return(test_ret);
43558 }
43559 
43560 
43561 static int
test_xmlTextWriterEndAttribute(void)43562 test_xmlTextWriterEndAttribute(void) {
43563     int test_ret = 0;
43564 
43565 #if defined(LIBXML_WRITER_ENABLED)
43566     int mem_base;
43567     int ret_val;
43568     xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
43569     int n_writer;
43570 
43571     for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
43572         mem_base = xmlMemBlocks();
43573         writer = gen_xmlTextWriterPtr(n_writer, 0);
43574 
43575         ret_val = xmlTextWriterEndAttribute(writer);
43576         desret_int(ret_val);
43577         call_tests++;
43578         des_xmlTextWriterPtr(n_writer, writer, 0);
43579         xmlResetLastError();
43580         if (mem_base != xmlMemBlocks()) {
43581             printf("Leak of %d blocks found in xmlTextWriterEndAttribute",
43582 	           xmlMemBlocks() - mem_base);
43583 	    test_ret++;
43584             printf(" %d", n_writer);
43585             printf("\n");
43586         }
43587     }
43588     function_tests++;
43589 #endif
43590 
43591     return(test_ret);
43592 }
43593 
43594 
43595 static int
test_xmlTextWriterEndCDATA(void)43596 test_xmlTextWriterEndCDATA(void) {
43597     int test_ret = 0;
43598 
43599 #if defined(LIBXML_WRITER_ENABLED)
43600     int mem_base;
43601     int ret_val;
43602     xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
43603     int n_writer;
43604 
43605     for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
43606         mem_base = xmlMemBlocks();
43607         writer = gen_xmlTextWriterPtr(n_writer, 0);
43608 
43609         ret_val = xmlTextWriterEndCDATA(writer);
43610         desret_int(ret_val);
43611         call_tests++;
43612         des_xmlTextWriterPtr(n_writer, writer, 0);
43613         xmlResetLastError();
43614         if (mem_base != xmlMemBlocks()) {
43615             printf("Leak of %d blocks found in xmlTextWriterEndCDATA",
43616 	           xmlMemBlocks() - mem_base);
43617 	    test_ret++;
43618             printf(" %d", n_writer);
43619             printf("\n");
43620         }
43621     }
43622     function_tests++;
43623 #endif
43624 
43625     return(test_ret);
43626 }
43627 
43628 
43629 static int
test_xmlTextWriterEndComment(void)43630 test_xmlTextWriterEndComment(void) {
43631     int test_ret = 0;
43632 
43633 #if defined(LIBXML_WRITER_ENABLED)
43634     int mem_base;
43635     int ret_val;
43636     xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
43637     int n_writer;
43638 
43639     for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
43640         mem_base = xmlMemBlocks();
43641         writer = gen_xmlTextWriterPtr(n_writer, 0);
43642 
43643         ret_val = xmlTextWriterEndComment(writer);
43644         desret_int(ret_val);
43645         call_tests++;
43646         des_xmlTextWriterPtr(n_writer, writer, 0);
43647         xmlResetLastError();
43648         if (mem_base != xmlMemBlocks()) {
43649             printf("Leak of %d blocks found in xmlTextWriterEndComment",
43650 	           xmlMemBlocks() - mem_base);
43651 	    test_ret++;
43652             printf(" %d", n_writer);
43653             printf("\n");
43654         }
43655     }
43656     function_tests++;
43657 #endif
43658 
43659     return(test_ret);
43660 }
43661 
43662 
43663 static int
test_xmlTextWriterEndDTD(void)43664 test_xmlTextWriterEndDTD(void) {
43665     int test_ret = 0;
43666 
43667 #if defined(LIBXML_WRITER_ENABLED)
43668     int mem_base;
43669     int ret_val;
43670     xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
43671     int n_writer;
43672 
43673     for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
43674         mem_base = xmlMemBlocks();
43675         writer = gen_xmlTextWriterPtr(n_writer, 0);
43676 
43677         ret_val = xmlTextWriterEndDTD(writer);
43678         desret_int(ret_val);
43679         call_tests++;
43680         des_xmlTextWriterPtr(n_writer, writer, 0);
43681         xmlResetLastError();
43682         if (mem_base != xmlMemBlocks()) {
43683             printf("Leak of %d blocks found in xmlTextWriterEndDTD",
43684 	           xmlMemBlocks() - mem_base);
43685 	    test_ret++;
43686             printf(" %d", n_writer);
43687             printf("\n");
43688         }
43689     }
43690     function_tests++;
43691 #endif
43692 
43693     return(test_ret);
43694 }
43695 
43696 
43697 static int
test_xmlTextWriterEndDTDAttlist(void)43698 test_xmlTextWriterEndDTDAttlist(void) {
43699     int test_ret = 0;
43700 
43701 #if defined(LIBXML_WRITER_ENABLED)
43702     int mem_base;
43703     int ret_val;
43704     xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
43705     int n_writer;
43706 
43707     for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
43708         mem_base = xmlMemBlocks();
43709         writer = gen_xmlTextWriterPtr(n_writer, 0);
43710 
43711         ret_val = xmlTextWriterEndDTDAttlist(writer);
43712         desret_int(ret_val);
43713         call_tests++;
43714         des_xmlTextWriterPtr(n_writer, writer, 0);
43715         xmlResetLastError();
43716         if (mem_base != xmlMemBlocks()) {
43717             printf("Leak of %d blocks found in xmlTextWriterEndDTDAttlist",
43718 	           xmlMemBlocks() - mem_base);
43719 	    test_ret++;
43720             printf(" %d", n_writer);
43721             printf("\n");
43722         }
43723     }
43724     function_tests++;
43725 #endif
43726 
43727     return(test_ret);
43728 }
43729 
43730 
43731 static int
test_xmlTextWriterEndDTDElement(void)43732 test_xmlTextWriterEndDTDElement(void) {
43733     int test_ret = 0;
43734 
43735 #if defined(LIBXML_WRITER_ENABLED)
43736     int mem_base;
43737     int ret_val;
43738     xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
43739     int n_writer;
43740 
43741     for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
43742         mem_base = xmlMemBlocks();
43743         writer = gen_xmlTextWriterPtr(n_writer, 0);
43744 
43745         ret_val = xmlTextWriterEndDTDElement(writer);
43746         desret_int(ret_val);
43747         call_tests++;
43748         des_xmlTextWriterPtr(n_writer, writer, 0);
43749         xmlResetLastError();
43750         if (mem_base != xmlMemBlocks()) {
43751             printf("Leak of %d blocks found in xmlTextWriterEndDTDElement",
43752 	           xmlMemBlocks() - mem_base);
43753 	    test_ret++;
43754             printf(" %d", n_writer);
43755             printf("\n");
43756         }
43757     }
43758     function_tests++;
43759 #endif
43760 
43761     return(test_ret);
43762 }
43763 
43764 
43765 static int
test_xmlTextWriterEndDTDEntity(void)43766 test_xmlTextWriterEndDTDEntity(void) {
43767     int test_ret = 0;
43768 
43769 #if defined(LIBXML_WRITER_ENABLED)
43770     int mem_base;
43771     int ret_val;
43772     xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
43773     int n_writer;
43774 
43775     for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
43776         mem_base = xmlMemBlocks();
43777         writer = gen_xmlTextWriterPtr(n_writer, 0);
43778 
43779         ret_val = xmlTextWriterEndDTDEntity(writer);
43780         desret_int(ret_val);
43781         call_tests++;
43782         des_xmlTextWriterPtr(n_writer, writer, 0);
43783         xmlResetLastError();
43784         if (mem_base != xmlMemBlocks()) {
43785             printf("Leak of %d blocks found in xmlTextWriterEndDTDEntity",
43786 	           xmlMemBlocks() - mem_base);
43787 	    test_ret++;
43788             printf(" %d", n_writer);
43789             printf("\n");
43790         }
43791     }
43792     function_tests++;
43793 #endif
43794 
43795     return(test_ret);
43796 }
43797 
43798 
43799 static int
test_xmlTextWriterEndDocument(void)43800 test_xmlTextWriterEndDocument(void) {
43801     int test_ret = 0;
43802 
43803 #if defined(LIBXML_WRITER_ENABLED)
43804     int mem_base;
43805     int ret_val;
43806     xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
43807     int n_writer;
43808 
43809     for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
43810         mem_base = xmlMemBlocks();
43811         writer = gen_xmlTextWriterPtr(n_writer, 0);
43812 
43813         ret_val = xmlTextWriterEndDocument(writer);
43814         desret_int(ret_val);
43815         call_tests++;
43816         des_xmlTextWriterPtr(n_writer, writer, 0);
43817         xmlResetLastError();
43818         if (mem_base != xmlMemBlocks()) {
43819             printf("Leak of %d blocks found in xmlTextWriterEndDocument",
43820 	           xmlMemBlocks() - mem_base);
43821 	    test_ret++;
43822             printf(" %d", n_writer);
43823             printf("\n");
43824         }
43825     }
43826     function_tests++;
43827 #endif
43828 
43829     return(test_ret);
43830 }
43831 
43832 
43833 static int
test_xmlTextWriterEndElement(void)43834 test_xmlTextWriterEndElement(void) {
43835     int test_ret = 0;
43836 
43837 #if defined(LIBXML_WRITER_ENABLED)
43838     int mem_base;
43839     int ret_val;
43840     xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
43841     int n_writer;
43842 
43843     for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
43844         mem_base = xmlMemBlocks();
43845         writer = gen_xmlTextWriterPtr(n_writer, 0);
43846 
43847         ret_val = xmlTextWriterEndElement(writer);
43848         desret_int(ret_val);
43849         call_tests++;
43850         des_xmlTextWriterPtr(n_writer, writer, 0);
43851         xmlResetLastError();
43852         if (mem_base != xmlMemBlocks()) {
43853             printf("Leak of %d blocks found in xmlTextWriterEndElement",
43854 	           xmlMemBlocks() - mem_base);
43855 	    test_ret++;
43856             printf(" %d", n_writer);
43857             printf("\n");
43858         }
43859     }
43860     function_tests++;
43861 #endif
43862 
43863     return(test_ret);
43864 }
43865 
43866 
43867 static int
test_xmlTextWriterEndPI(void)43868 test_xmlTextWriterEndPI(void) {
43869     int test_ret = 0;
43870 
43871 #if defined(LIBXML_WRITER_ENABLED)
43872     int mem_base;
43873     int ret_val;
43874     xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
43875     int n_writer;
43876 
43877     for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
43878         mem_base = xmlMemBlocks();
43879         writer = gen_xmlTextWriterPtr(n_writer, 0);
43880 
43881         ret_val = xmlTextWriterEndPI(writer);
43882         desret_int(ret_val);
43883         call_tests++;
43884         des_xmlTextWriterPtr(n_writer, writer, 0);
43885         xmlResetLastError();
43886         if (mem_base != xmlMemBlocks()) {
43887             printf("Leak of %d blocks found in xmlTextWriterEndPI",
43888 	           xmlMemBlocks() - mem_base);
43889 	    test_ret++;
43890             printf(" %d", n_writer);
43891             printf("\n");
43892         }
43893     }
43894     function_tests++;
43895 #endif
43896 
43897     return(test_ret);
43898 }
43899 
43900 
43901 static int
test_xmlTextWriterFlush(void)43902 test_xmlTextWriterFlush(void) {
43903     int test_ret = 0;
43904 
43905 #if defined(LIBXML_WRITER_ENABLED)
43906     int mem_base;
43907     int ret_val;
43908     xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
43909     int n_writer;
43910 
43911     for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
43912         mem_base = xmlMemBlocks();
43913         writer = gen_xmlTextWriterPtr(n_writer, 0);
43914 
43915         ret_val = xmlTextWriterFlush(writer);
43916         desret_int(ret_val);
43917         call_tests++;
43918         des_xmlTextWriterPtr(n_writer, writer, 0);
43919         xmlResetLastError();
43920         if (mem_base != xmlMemBlocks()) {
43921             printf("Leak of %d blocks found in xmlTextWriterFlush",
43922 	           xmlMemBlocks() - mem_base);
43923 	    test_ret++;
43924             printf(" %d", n_writer);
43925             printf("\n");
43926         }
43927     }
43928     function_tests++;
43929 #endif
43930 
43931     return(test_ret);
43932 }
43933 
43934 
43935 static int
test_xmlTextWriterFullEndElement(void)43936 test_xmlTextWriterFullEndElement(void) {
43937     int test_ret = 0;
43938 
43939 #if defined(LIBXML_WRITER_ENABLED)
43940     int mem_base;
43941     int ret_val;
43942     xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
43943     int n_writer;
43944 
43945     for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
43946         mem_base = xmlMemBlocks();
43947         writer = gen_xmlTextWriterPtr(n_writer, 0);
43948 
43949         ret_val = xmlTextWriterFullEndElement(writer);
43950         desret_int(ret_val);
43951         call_tests++;
43952         des_xmlTextWriterPtr(n_writer, writer, 0);
43953         xmlResetLastError();
43954         if (mem_base != xmlMemBlocks()) {
43955             printf("Leak of %d blocks found in xmlTextWriterFullEndElement",
43956 	           xmlMemBlocks() - mem_base);
43957 	    test_ret++;
43958             printf(" %d", n_writer);
43959             printf("\n");
43960         }
43961     }
43962     function_tests++;
43963 #endif
43964 
43965     return(test_ret);
43966 }
43967 
43968 
43969 static int
test_xmlTextWriterSetIndent(void)43970 test_xmlTextWriterSetIndent(void) {
43971     int test_ret = 0;
43972 
43973 #if defined(LIBXML_WRITER_ENABLED)
43974     int mem_base;
43975     int ret_val;
43976     xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
43977     int n_writer;
43978     int indent; /* do indentation? */
43979     int n_indent;
43980 
43981     for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
43982     for (n_indent = 0;n_indent < gen_nb_int;n_indent++) {
43983         mem_base = xmlMemBlocks();
43984         writer = gen_xmlTextWriterPtr(n_writer, 0);
43985         indent = gen_int(n_indent, 1);
43986 
43987         ret_val = xmlTextWriterSetIndent(writer, indent);
43988         desret_int(ret_val);
43989         call_tests++;
43990         des_xmlTextWriterPtr(n_writer, writer, 0);
43991         des_int(n_indent, indent, 1);
43992         xmlResetLastError();
43993         if (mem_base != xmlMemBlocks()) {
43994             printf("Leak of %d blocks found in xmlTextWriterSetIndent",
43995 	           xmlMemBlocks() - mem_base);
43996 	    test_ret++;
43997             printf(" %d", n_writer);
43998             printf(" %d", n_indent);
43999             printf("\n");
44000         }
44001     }
44002     }
44003     function_tests++;
44004 #endif
44005 
44006     return(test_ret);
44007 }
44008 
44009 
44010 static int
test_xmlTextWriterSetIndentString(void)44011 test_xmlTextWriterSetIndentString(void) {
44012     int test_ret = 0;
44013 
44014 #if defined(LIBXML_WRITER_ENABLED)
44015     int mem_base;
44016     int ret_val;
44017     xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
44018     int n_writer;
44019     xmlChar * str; /* the xmlChar string */
44020     int n_str;
44021 
44022     for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
44023     for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) {
44024         mem_base = xmlMemBlocks();
44025         writer = gen_xmlTextWriterPtr(n_writer, 0);
44026         str = gen_const_xmlChar_ptr(n_str, 1);
44027 
44028         ret_val = xmlTextWriterSetIndentString(writer, (const xmlChar *)str);
44029         desret_int(ret_val);
44030         call_tests++;
44031         des_xmlTextWriterPtr(n_writer, writer, 0);
44032         des_const_xmlChar_ptr(n_str, (const xmlChar *)str, 1);
44033         xmlResetLastError();
44034         if (mem_base != xmlMemBlocks()) {
44035             printf("Leak of %d blocks found in xmlTextWriterSetIndentString",
44036 	           xmlMemBlocks() - mem_base);
44037 	    test_ret++;
44038             printf(" %d", n_writer);
44039             printf(" %d", n_str);
44040             printf("\n");
44041         }
44042     }
44043     }
44044     function_tests++;
44045 #endif
44046 
44047     return(test_ret);
44048 }
44049 
44050 
44051 static int
test_xmlTextWriterSetQuoteChar(void)44052 test_xmlTextWriterSetQuoteChar(void) {
44053     int test_ret = 0;
44054 
44055 #if defined(LIBXML_WRITER_ENABLED)
44056     int mem_base;
44057     int ret_val;
44058     xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
44059     int n_writer;
44060     xmlChar quotechar; /* the quote character */
44061     int n_quotechar;
44062 
44063     for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
44064     for (n_quotechar = 0;n_quotechar < gen_nb_xmlChar;n_quotechar++) {
44065         mem_base = xmlMemBlocks();
44066         writer = gen_xmlTextWriterPtr(n_writer, 0);
44067         quotechar = gen_xmlChar(n_quotechar, 1);
44068 
44069         ret_val = xmlTextWriterSetQuoteChar(writer, quotechar);
44070         desret_int(ret_val);
44071         call_tests++;
44072         des_xmlTextWriterPtr(n_writer, writer, 0);
44073         des_xmlChar(n_quotechar, quotechar, 1);
44074         xmlResetLastError();
44075         if (mem_base != xmlMemBlocks()) {
44076             printf("Leak of %d blocks found in xmlTextWriterSetQuoteChar",
44077 	           xmlMemBlocks() - mem_base);
44078 	    test_ret++;
44079             printf(" %d", n_writer);
44080             printf(" %d", n_quotechar);
44081             printf("\n");
44082         }
44083     }
44084     }
44085     function_tests++;
44086 #endif
44087 
44088     return(test_ret);
44089 }
44090 
44091 
44092 static int
test_xmlTextWriterStartAttribute(void)44093 test_xmlTextWriterStartAttribute(void) {
44094     int test_ret = 0;
44095 
44096 #if defined(LIBXML_WRITER_ENABLED)
44097     int mem_base;
44098     int ret_val;
44099     xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
44100     int n_writer;
44101     xmlChar * name; /* element name */
44102     int n_name;
44103 
44104     for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
44105     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
44106         mem_base = xmlMemBlocks();
44107         writer = gen_xmlTextWriterPtr(n_writer, 0);
44108         name = gen_const_xmlChar_ptr(n_name, 1);
44109 
44110         ret_val = xmlTextWriterStartAttribute(writer, (const xmlChar *)name);
44111         desret_int(ret_val);
44112         call_tests++;
44113         des_xmlTextWriterPtr(n_writer, writer, 0);
44114         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
44115         xmlResetLastError();
44116         if (mem_base != xmlMemBlocks()) {
44117             printf("Leak of %d blocks found in xmlTextWriterStartAttribute",
44118 	           xmlMemBlocks() - mem_base);
44119 	    test_ret++;
44120             printf(" %d", n_writer);
44121             printf(" %d", n_name);
44122             printf("\n");
44123         }
44124     }
44125     }
44126     function_tests++;
44127 #endif
44128 
44129     return(test_ret);
44130 }
44131 
44132 
44133 static int
test_xmlTextWriterStartAttributeNS(void)44134 test_xmlTextWriterStartAttributeNS(void) {
44135     int test_ret = 0;
44136 
44137 #if defined(LIBXML_WRITER_ENABLED)
44138     int mem_base;
44139     int ret_val;
44140     xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
44141     int n_writer;
44142     xmlChar * prefix; /* namespace prefix or NULL */
44143     int n_prefix;
44144     xmlChar * name; /* element local name */
44145     int n_name;
44146     xmlChar * namespaceURI; /* namespace URI or NULL */
44147     int n_namespaceURI;
44148 
44149     for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
44150     for (n_prefix = 0;n_prefix < gen_nb_const_xmlChar_ptr;n_prefix++) {
44151     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
44152     for (n_namespaceURI = 0;n_namespaceURI < gen_nb_const_xmlChar_ptr;n_namespaceURI++) {
44153         mem_base = xmlMemBlocks();
44154         writer = gen_xmlTextWriterPtr(n_writer, 0);
44155         prefix = gen_const_xmlChar_ptr(n_prefix, 1);
44156         name = gen_const_xmlChar_ptr(n_name, 2);
44157         namespaceURI = gen_const_xmlChar_ptr(n_namespaceURI, 3);
44158 
44159         ret_val = xmlTextWriterStartAttributeNS(writer, (const xmlChar *)prefix, (const xmlChar *)name, (const xmlChar *)namespaceURI);
44160         desret_int(ret_val);
44161         call_tests++;
44162         des_xmlTextWriterPtr(n_writer, writer, 0);
44163         des_const_xmlChar_ptr(n_prefix, (const xmlChar *)prefix, 1);
44164         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 2);
44165         des_const_xmlChar_ptr(n_namespaceURI, (const xmlChar *)namespaceURI, 3);
44166         xmlResetLastError();
44167         if (mem_base != xmlMemBlocks()) {
44168             printf("Leak of %d blocks found in xmlTextWriterStartAttributeNS",
44169 	           xmlMemBlocks() - mem_base);
44170 	    test_ret++;
44171             printf(" %d", n_writer);
44172             printf(" %d", n_prefix);
44173             printf(" %d", n_name);
44174             printf(" %d", n_namespaceURI);
44175             printf("\n");
44176         }
44177     }
44178     }
44179     }
44180     }
44181     function_tests++;
44182 #endif
44183 
44184     return(test_ret);
44185 }
44186 
44187 
44188 static int
test_xmlTextWriterStartCDATA(void)44189 test_xmlTextWriterStartCDATA(void) {
44190     int test_ret = 0;
44191 
44192 #if defined(LIBXML_WRITER_ENABLED)
44193     int mem_base;
44194     int ret_val;
44195     xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
44196     int n_writer;
44197 
44198     for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
44199         mem_base = xmlMemBlocks();
44200         writer = gen_xmlTextWriterPtr(n_writer, 0);
44201 
44202         ret_val = xmlTextWriterStartCDATA(writer);
44203         desret_int(ret_val);
44204         call_tests++;
44205         des_xmlTextWriterPtr(n_writer, writer, 0);
44206         xmlResetLastError();
44207         if (mem_base != xmlMemBlocks()) {
44208             printf("Leak of %d blocks found in xmlTextWriterStartCDATA",
44209 	           xmlMemBlocks() - mem_base);
44210 	    test_ret++;
44211             printf(" %d", n_writer);
44212             printf("\n");
44213         }
44214     }
44215     function_tests++;
44216 #endif
44217 
44218     return(test_ret);
44219 }
44220 
44221 
44222 static int
test_xmlTextWriterStartComment(void)44223 test_xmlTextWriterStartComment(void) {
44224     int test_ret = 0;
44225 
44226 #if defined(LIBXML_WRITER_ENABLED)
44227     int mem_base;
44228     int ret_val;
44229     xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
44230     int n_writer;
44231 
44232     for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
44233         mem_base = xmlMemBlocks();
44234         writer = gen_xmlTextWriterPtr(n_writer, 0);
44235 
44236         ret_val = xmlTextWriterStartComment(writer);
44237         desret_int(ret_val);
44238         call_tests++;
44239         des_xmlTextWriterPtr(n_writer, writer, 0);
44240         xmlResetLastError();
44241         if (mem_base != xmlMemBlocks()) {
44242             printf("Leak of %d blocks found in xmlTextWriterStartComment",
44243 	           xmlMemBlocks() - mem_base);
44244 	    test_ret++;
44245             printf(" %d", n_writer);
44246             printf("\n");
44247         }
44248     }
44249     function_tests++;
44250 #endif
44251 
44252     return(test_ret);
44253 }
44254 
44255 
44256 static int
test_xmlTextWriterStartDTD(void)44257 test_xmlTextWriterStartDTD(void) {
44258     int test_ret = 0;
44259 
44260 #if defined(LIBXML_WRITER_ENABLED)
44261     int mem_base;
44262     int ret_val;
44263     xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
44264     int n_writer;
44265     xmlChar * name; /* the name of the DTD */
44266     int n_name;
44267     xmlChar * pubid; /* the public identifier, which is an alternative to the system identifier */
44268     int n_pubid;
44269     xmlChar * sysid; /* the system identifier, which is the URI of the DTD */
44270     int n_sysid;
44271 
44272     for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
44273     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
44274     for (n_pubid = 0;n_pubid < gen_nb_const_xmlChar_ptr;n_pubid++) {
44275     for (n_sysid = 0;n_sysid < gen_nb_const_xmlChar_ptr;n_sysid++) {
44276         mem_base = xmlMemBlocks();
44277         writer = gen_xmlTextWriterPtr(n_writer, 0);
44278         name = gen_const_xmlChar_ptr(n_name, 1);
44279         pubid = gen_const_xmlChar_ptr(n_pubid, 2);
44280         sysid = gen_const_xmlChar_ptr(n_sysid, 3);
44281 
44282         ret_val = xmlTextWriterStartDTD(writer, (const xmlChar *)name, (const xmlChar *)pubid, (const xmlChar *)sysid);
44283         desret_int(ret_val);
44284         call_tests++;
44285         des_xmlTextWriterPtr(n_writer, writer, 0);
44286         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
44287         des_const_xmlChar_ptr(n_pubid, (const xmlChar *)pubid, 2);
44288         des_const_xmlChar_ptr(n_sysid, (const xmlChar *)sysid, 3);
44289         xmlResetLastError();
44290         if (mem_base != xmlMemBlocks()) {
44291             printf("Leak of %d blocks found in xmlTextWriterStartDTD",
44292 	           xmlMemBlocks() - mem_base);
44293 	    test_ret++;
44294             printf(" %d", n_writer);
44295             printf(" %d", n_name);
44296             printf(" %d", n_pubid);
44297             printf(" %d", n_sysid);
44298             printf("\n");
44299         }
44300     }
44301     }
44302     }
44303     }
44304     function_tests++;
44305 #endif
44306 
44307     return(test_ret);
44308 }
44309 
44310 
44311 static int
test_xmlTextWriterStartDTDAttlist(void)44312 test_xmlTextWriterStartDTDAttlist(void) {
44313     int test_ret = 0;
44314 
44315 #if defined(LIBXML_WRITER_ENABLED)
44316     int mem_base;
44317     int ret_val;
44318     xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
44319     int n_writer;
44320     xmlChar * name; /* the name of the DTD ATTLIST */
44321     int n_name;
44322 
44323     for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
44324     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
44325         mem_base = xmlMemBlocks();
44326         writer = gen_xmlTextWriterPtr(n_writer, 0);
44327         name = gen_const_xmlChar_ptr(n_name, 1);
44328 
44329         ret_val = xmlTextWriterStartDTDAttlist(writer, (const xmlChar *)name);
44330         desret_int(ret_val);
44331         call_tests++;
44332         des_xmlTextWriterPtr(n_writer, writer, 0);
44333         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
44334         xmlResetLastError();
44335         if (mem_base != xmlMemBlocks()) {
44336             printf("Leak of %d blocks found in xmlTextWriterStartDTDAttlist",
44337 	           xmlMemBlocks() - mem_base);
44338 	    test_ret++;
44339             printf(" %d", n_writer);
44340             printf(" %d", n_name);
44341             printf("\n");
44342         }
44343     }
44344     }
44345     function_tests++;
44346 #endif
44347 
44348     return(test_ret);
44349 }
44350 
44351 
44352 static int
test_xmlTextWriterStartDTDElement(void)44353 test_xmlTextWriterStartDTDElement(void) {
44354     int test_ret = 0;
44355 
44356 #if defined(LIBXML_WRITER_ENABLED)
44357     int mem_base;
44358     int ret_val;
44359     xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
44360     int n_writer;
44361     xmlChar * name; /* the name of the DTD element */
44362     int n_name;
44363 
44364     for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
44365     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
44366         mem_base = xmlMemBlocks();
44367         writer = gen_xmlTextWriterPtr(n_writer, 0);
44368         name = gen_const_xmlChar_ptr(n_name, 1);
44369 
44370         ret_val = xmlTextWriterStartDTDElement(writer, (const xmlChar *)name);
44371         desret_int(ret_val);
44372         call_tests++;
44373         des_xmlTextWriterPtr(n_writer, writer, 0);
44374         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
44375         xmlResetLastError();
44376         if (mem_base != xmlMemBlocks()) {
44377             printf("Leak of %d blocks found in xmlTextWriterStartDTDElement",
44378 	           xmlMemBlocks() - mem_base);
44379 	    test_ret++;
44380             printf(" %d", n_writer);
44381             printf(" %d", n_name);
44382             printf("\n");
44383         }
44384     }
44385     }
44386     function_tests++;
44387 #endif
44388 
44389     return(test_ret);
44390 }
44391 
44392 
44393 static int
test_xmlTextWriterStartDTDEntity(void)44394 test_xmlTextWriterStartDTDEntity(void) {
44395     int test_ret = 0;
44396 
44397 #if defined(LIBXML_WRITER_ENABLED)
44398     int mem_base;
44399     int ret_val;
44400     xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
44401     int n_writer;
44402     int pe; /* TRUE if this is a parameter entity, FALSE if not */
44403     int n_pe;
44404     xmlChar * name; /* the name of the DTD ATTLIST */
44405     int n_name;
44406 
44407     for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
44408     for (n_pe = 0;n_pe < gen_nb_int;n_pe++) {
44409     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
44410         mem_base = xmlMemBlocks();
44411         writer = gen_xmlTextWriterPtr(n_writer, 0);
44412         pe = gen_int(n_pe, 1);
44413         name = gen_const_xmlChar_ptr(n_name, 2);
44414 
44415         ret_val = xmlTextWriterStartDTDEntity(writer, pe, (const xmlChar *)name);
44416         desret_int(ret_val);
44417         call_tests++;
44418         des_xmlTextWriterPtr(n_writer, writer, 0);
44419         des_int(n_pe, pe, 1);
44420         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 2);
44421         xmlResetLastError();
44422         if (mem_base != xmlMemBlocks()) {
44423             printf("Leak of %d blocks found in xmlTextWriterStartDTDEntity",
44424 	           xmlMemBlocks() - mem_base);
44425 	    test_ret++;
44426             printf(" %d", n_writer);
44427             printf(" %d", n_pe);
44428             printf(" %d", n_name);
44429             printf("\n");
44430         }
44431     }
44432     }
44433     }
44434     function_tests++;
44435 #endif
44436 
44437     return(test_ret);
44438 }
44439 
44440 
44441 static int
test_xmlTextWriterStartDocument(void)44442 test_xmlTextWriterStartDocument(void) {
44443     int test_ret = 0;
44444 
44445 #if defined(LIBXML_WRITER_ENABLED)
44446     int mem_base;
44447     int ret_val;
44448     xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
44449     int n_writer;
44450     char * version; /* the xml version ("1.0") or NULL for default ("1.0") */
44451     int n_version;
44452     char * encoding; /* the encoding or NULL for default */
44453     int n_encoding;
44454     char * standalone; /* "yes" or "no" or NULL for default */
44455     int n_standalone;
44456 
44457     for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
44458     for (n_version = 0;n_version < gen_nb_const_char_ptr;n_version++) {
44459     for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
44460     for (n_standalone = 0;n_standalone < gen_nb_const_char_ptr;n_standalone++) {
44461         mem_base = xmlMemBlocks();
44462         writer = gen_xmlTextWriterPtr(n_writer, 0);
44463         version = gen_const_char_ptr(n_version, 1);
44464         encoding = gen_const_char_ptr(n_encoding, 2);
44465         standalone = gen_const_char_ptr(n_standalone, 3);
44466 
44467         ret_val = xmlTextWriterStartDocument(writer, (const char *)version, (const char *)encoding, (const char *)standalone);
44468         desret_int(ret_val);
44469         call_tests++;
44470         des_xmlTextWriterPtr(n_writer, writer, 0);
44471         des_const_char_ptr(n_version, (const char *)version, 1);
44472         des_const_char_ptr(n_encoding, (const char *)encoding, 2);
44473         des_const_char_ptr(n_standalone, (const char *)standalone, 3);
44474         xmlResetLastError();
44475         if (mem_base != xmlMemBlocks()) {
44476             printf("Leak of %d blocks found in xmlTextWriterStartDocument",
44477 	           xmlMemBlocks() - mem_base);
44478 	    test_ret++;
44479             printf(" %d", n_writer);
44480             printf(" %d", n_version);
44481             printf(" %d", n_encoding);
44482             printf(" %d", n_standalone);
44483             printf("\n");
44484         }
44485     }
44486     }
44487     }
44488     }
44489     function_tests++;
44490 #endif
44491 
44492     return(test_ret);
44493 }
44494 
44495 
44496 static int
test_xmlTextWriterStartElement(void)44497 test_xmlTextWriterStartElement(void) {
44498     int test_ret = 0;
44499 
44500 #if defined(LIBXML_WRITER_ENABLED)
44501     int mem_base;
44502     int ret_val;
44503     xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
44504     int n_writer;
44505     xmlChar * name; /* element name */
44506     int n_name;
44507 
44508     for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
44509     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
44510         mem_base = xmlMemBlocks();
44511         writer = gen_xmlTextWriterPtr(n_writer, 0);
44512         name = gen_const_xmlChar_ptr(n_name, 1);
44513 
44514         ret_val = xmlTextWriterStartElement(writer, (const xmlChar *)name);
44515         desret_int(ret_val);
44516         call_tests++;
44517         des_xmlTextWriterPtr(n_writer, writer, 0);
44518         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
44519         xmlResetLastError();
44520         if (mem_base != xmlMemBlocks()) {
44521             printf("Leak of %d blocks found in xmlTextWriterStartElement",
44522 	           xmlMemBlocks() - mem_base);
44523 	    test_ret++;
44524             printf(" %d", n_writer);
44525             printf(" %d", n_name);
44526             printf("\n");
44527         }
44528     }
44529     }
44530     function_tests++;
44531 #endif
44532 
44533     return(test_ret);
44534 }
44535 
44536 
44537 static int
test_xmlTextWriterStartElementNS(void)44538 test_xmlTextWriterStartElementNS(void) {
44539     int test_ret = 0;
44540 
44541 #if defined(LIBXML_WRITER_ENABLED)
44542     int mem_base;
44543     int ret_val;
44544     xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
44545     int n_writer;
44546     xmlChar * prefix; /* namespace prefix or NULL */
44547     int n_prefix;
44548     xmlChar * name; /* element local name */
44549     int n_name;
44550     xmlChar * namespaceURI; /* namespace URI or NULL */
44551     int n_namespaceURI;
44552 
44553     for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
44554     for (n_prefix = 0;n_prefix < gen_nb_const_xmlChar_ptr;n_prefix++) {
44555     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
44556     for (n_namespaceURI = 0;n_namespaceURI < gen_nb_const_xmlChar_ptr;n_namespaceURI++) {
44557         mem_base = xmlMemBlocks();
44558         writer = gen_xmlTextWriterPtr(n_writer, 0);
44559         prefix = gen_const_xmlChar_ptr(n_prefix, 1);
44560         name = gen_const_xmlChar_ptr(n_name, 2);
44561         namespaceURI = gen_const_xmlChar_ptr(n_namespaceURI, 3);
44562 
44563         ret_val = xmlTextWriterStartElementNS(writer, (const xmlChar *)prefix, (const xmlChar *)name, (const xmlChar *)namespaceURI);
44564         desret_int(ret_val);
44565         call_tests++;
44566         des_xmlTextWriterPtr(n_writer, writer, 0);
44567         des_const_xmlChar_ptr(n_prefix, (const xmlChar *)prefix, 1);
44568         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 2);
44569         des_const_xmlChar_ptr(n_namespaceURI, (const xmlChar *)namespaceURI, 3);
44570         xmlResetLastError();
44571         if (mem_base != xmlMemBlocks()) {
44572             printf("Leak of %d blocks found in xmlTextWriterStartElementNS",
44573 	           xmlMemBlocks() - mem_base);
44574 	    test_ret++;
44575             printf(" %d", n_writer);
44576             printf(" %d", n_prefix);
44577             printf(" %d", n_name);
44578             printf(" %d", n_namespaceURI);
44579             printf("\n");
44580         }
44581     }
44582     }
44583     }
44584     }
44585     function_tests++;
44586 #endif
44587 
44588     return(test_ret);
44589 }
44590 
44591 
44592 static int
test_xmlTextWriterStartPI(void)44593 test_xmlTextWriterStartPI(void) {
44594     int test_ret = 0;
44595 
44596 #if defined(LIBXML_WRITER_ENABLED)
44597     int mem_base;
44598     int ret_val;
44599     xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
44600     int n_writer;
44601     xmlChar * target; /* PI target */
44602     int n_target;
44603 
44604     for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
44605     for (n_target = 0;n_target < gen_nb_const_xmlChar_ptr;n_target++) {
44606         mem_base = xmlMemBlocks();
44607         writer = gen_xmlTextWriterPtr(n_writer, 0);
44608         target = gen_const_xmlChar_ptr(n_target, 1);
44609 
44610         ret_val = xmlTextWriterStartPI(writer, (const xmlChar *)target);
44611         desret_int(ret_val);
44612         call_tests++;
44613         des_xmlTextWriterPtr(n_writer, writer, 0);
44614         des_const_xmlChar_ptr(n_target, (const xmlChar *)target, 1);
44615         xmlResetLastError();
44616         if (mem_base != xmlMemBlocks()) {
44617             printf("Leak of %d blocks found in xmlTextWriterStartPI",
44618 	           xmlMemBlocks() - mem_base);
44619 	    test_ret++;
44620             printf(" %d", n_writer);
44621             printf(" %d", n_target);
44622             printf("\n");
44623         }
44624     }
44625     }
44626     function_tests++;
44627 #endif
44628 
44629     return(test_ret);
44630 }
44631 
44632 
44633 static int
test_xmlTextWriterWriteAttribute(void)44634 test_xmlTextWriterWriteAttribute(void) {
44635     int test_ret = 0;
44636 
44637 #if defined(LIBXML_WRITER_ENABLED)
44638     int mem_base;
44639     int ret_val;
44640     xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
44641     int n_writer;
44642     xmlChar * name; /* attribute name */
44643     int n_name;
44644     xmlChar * content; /* attribute content */
44645     int n_content;
44646 
44647     for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
44648     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
44649     for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
44650         mem_base = xmlMemBlocks();
44651         writer = gen_xmlTextWriterPtr(n_writer, 0);
44652         name = gen_const_xmlChar_ptr(n_name, 1);
44653         content = gen_const_xmlChar_ptr(n_content, 2);
44654 
44655         ret_val = xmlTextWriterWriteAttribute(writer, (const xmlChar *)name, (const xmlChar *)content);
44656         desret_int(ret_val);
44657         call_tests++;
44658         des_xmlTextWriterPtr(n_writer, writer, 0);
44659         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
44660         des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 2);
44661         xmlResetLastError();
44662         if (mem_base != xmlMemBlocks()) {
44663             printf("Leak of %d blocks found in xmlTextWriterWriteAttribute",
44664 	           xmlMemBlocks() - mem_base);
44665 	    test_ret++;
44666             printf(" %d", n_writer);
44667             printf(" %d", n_name);
44668             printf(" %d", n_content);
44669             printf("\n");
44670         }
44671     }
44672     }
44673     }
44674     function_tests++;
44675 #endif
44676 
44677     return(test_ret);
44678 }
44679 
44680 
44681 static int
test_xmlTextWriterWriteAttributeNS(void)44682 test_xmlTextWriterWriteAttributeNS(void) {
44683     int test_ret = 0;
44684 
44685 #if defined(LIBXML_WRITER_ENABLED)
44686     int mem_base;
44687     int ret_val;
44688     xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
44689     int n_writer;
44690     xmlChar * prefix; /* namespace prefix */
44691     int n_prefix;
44692     xmlChar * name; /* attribute local name */
44693     int n_name;
44694     xmlChar * namespaceURI; /* namespace URI */
44695     int n_namespaceURI;
44696     xmlChar * content; /* attribute content */
44697     int n_content;
44698 
44699     for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
44700     for (n_prefix = 0;n_prefix < gen_nb_const_xmlChar_ptr;n_prefix++) {
44701     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
44702     for (n_namespaceURI = 0;n_namespaceURI < gen_nb_const_xmlChar_ptr;n_namespaceURI++) {
44703     for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
44704         mem_base = xmlMemBlocks();
44705         writer = gen_xmlTextWriterPtr(n_writer, 0);
44706         prefix = gen_const_xmlChar_ptr(n_prefix, 1);
44707         name = gen_const_xmlChar_ptr(n_name, 2);
44708         namespaceURI = gen_const_xmlChar_ptr(n_namespaceURI, 3);
44709         content = gen_const_xmlChar_ptr(n_content, 4);
44710 
44711         ret_val = xmlTextWriterWriteAttributeNS(writer, (const xmlChar *)prefix, (const xmlChar *)name, (const xmlChar *)namespaceURI, (const xmlChar *)content);
44712         desret_int(ret_val);
44713         call_tests++;
44714         des_xmlTextWriterPtr(n_writer, writer, 0);
44715         des_const_xmlChar_ptr(n_prefix, (const xmlChar *)prefix, 1);
44716         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 2);
44717         des_const_xmlChar_ptr(n_namespaceURI, (const xmlChar *)namespaceURI, 3);
44718         des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 4);
44719         xmlResetLastError();
44720         if (mem_base != xmlMemBlocks()) {
44721             printf("Leak of %d blocks found in xmlTextWriterWriteAttributeNS",
44722 	           xmlMemBlocks() - mem_base);
44723 	    test_ret++;
44724             printf(" %d", n_writer);
44725             printf(" %d", n_prefix);
44726             printf(" %d", n_name);
44727             printf(" %d", n_namespaceURI);
44728             printf(" %d", n_content);
44729             printf("\n");
44730         }
44731     }
44732     }
44733     }
44734     }
44735     }
44736     function_tests++;
44737 #endif
44738 
44739     return(test_ret);
44740 }
44741 
44742 
44743 static int
test_xmlTextWriterWriteBase64(void)44744 test_xmlTextWriterWriteBase64(void) {
44745     int test_ret = 0;
44746 
44747 #if defined(LIBXML_WRITER_ENABLED)
44748     int mem_base;
44749     int ret_val;
44750     xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
44751     int n_writer;
44752     char * data; /* binary data */
44753     int n_data;
44754     int start; /* the position within the data of the first byte to encode */
44755     int n_start;
44756     int len; /* the number of bytes to encode */
44757     int n_len;
44758 
44759     for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
44760     for (n_data = 0;n_data < gen_nb_const_char_ptr;n_data++) {
44761     for (n_start = 0;n_start < gen_nb_int;n_start++) {
44762     for (n_len = 0;n_len < gen_nb_int;n_len++) {
44763         mem_base = xmlMemBlocks();
44764         writer = gen_xmlTextWriterPtr(n_writer, 0);
44765         data = gen_const_char_ptr(n_data, 1);
44766         start = gen_int(n_start, 2);
44767         len = gen_int(n_len, 3);
44768         if ((data != NULL) &&
44769             (start > (int) strlen((const char *) data) + 1))
44770             continue;
44771         if ((data != NULL) &&
44772             (len > (int) strlen((const char *) data) + 1))
44773             continue;
44774 
44775         ret_val = xmlTextWriterWriteBase64(writer, (const char *)data, start, len);
44776         desret_int(ret_val);
44777         call_tests++;
44778         des_xmlTextWriterPtr(n_writer, writer, 0);
44779         des_const_char_ptr(n_data, (const char *)data, 1);
44780         des_int(n_start, start, 2);
44781         des_int(n_len, len, 3);
44782         xmlResetLastError();
44783         if (mem_base != xmlMemBlocks()) {
44784             printf("Leak of %d blocks found in xmlTextWriterWriteBase64",
44785 	           xmlMemBlocks() - mem_base);
44786 	    test_ret++;
44787             printf(" %d", n_writer);
44788             printf(" %d", n_data);
44789             printf(" %d", n_start);
44790             printf(" %d", n_len);
44791             printf("\n");
44792         }
44793     }
44794     }
44795     }
44796     }
44797     function_tests++;
44798 #endif
44799 
44800     return(test_ret);
44801 }
44802 
44803 
44804 static int
test_xmlTextWriterWriteBinHex(void)44805 test_xmlTextWriterWriteBinHex(void) {
44806     int test_ret = 0;
44807 
44808 #if defined(LIBXML_WRITER_ENABLED)
44809     int mem_base;
44810     int ret_val;
44811     xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
44812     int n_writer;
44813     char * data; /* binary data */
44814     int n_data;
44815     int start; /* the position within the data of the first byte to encode */
44816     int n_start;
44817     int len; /* the number of bytes to encode */
44818     int n_len;
44819 
44820     for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
44821     for (n_data = 0;n_data < gen_nb_const_char_ptr;n_data++) {
44822     for (n_start = 0;n_start < gen_nb_int;n_start++) {
44823     for (n_len = 0;n_len < gen_nb_int;n_len++) {
44824         mem_base = xmlMemBlocks();
44825         writer = gen_xmlTextWriterPtr(n_writer, 0);
44826         data = gen_const_char_ptr(n_data, 1);
44827         start = gen_int(n_start, 2);
44828         len = gen_int(n_len, 3);
44829         if ((data != NULL) &&
44830             (start > (int) strlen((const char *) data) + 1))
44831             continue;
44832         if ((data != NULL) &&
44833             (len > (int) strlen((const char *) data) + 1))
44834             continue;
44835 
44836         ret_val = xmlTextWriterWriteBinHex(writer, (const char *)data, start, len);
44837         desret_int(ret_val);
44838         call_tests++;
44839         des_xmlTextWriterPtr(n_writer, writer, 0);
44840         des_const_char_ptr(n_data, (const char *)data, 1);
44841         des_int(n_start, start, 2);
44842         des_int(n_len, len, 3);
44843         xmlResetLastError();
44844         if (mem_base != xmlMemBlocks()) {
44845             printf("Leak of %d blocks found in xmlTextWriterWriteBinHex",
44846 	           xmlMemBlocks() - mem_base);
44847 	    test_ret++;
44848             printf(" %d", n_writer);
44849             printf(" %d", n_data);
44850             printf(" %d", n_start);
44851             printf(" %d", n_len);
44852             printf("\n");
44853         }
44854     }
44855     }
44856     }
44857     }
44858     function_tests++;
44859 #endif
44860 
44861     return(test_ret);
44862 }
44863 
44864 
44865 static int
test_xmlTextWriterWriteCDATA(void)44866 test_xmlTextWriterWriteCDATA(void) {
44867     int test_ret = 0;
44868 
44869 #if defined(LIBXML_WRITER_ENABLED)
44870     int mem_base;
44871     int ret_val;
44872     xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
44873     int n_writer;
44874     xmlChar * content; /* CDATA content */
44875     int n_content;
44876 
44877     for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
44878     for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
44879         mem_base = xmlMemBlocks();
44880         writer = gen_xmlTextWriterPtr(n_writer, 0);
44881         content = gen_const_xmlChar_ptr(n_content, 1);
44882 
44883         ret_val = xmlTextWriterWriteCDATA(writer, (const xmlChar *)content);
44884         desret_int(ret_val);
44885         call_tests++;
44886         des_xmlTextWriterPtr(n_writer, writer, 0);
44887         des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 1);
44888         xmlResetLastError();
44889         if (mem_base != xmlMemBlocks()) {
44890             printf("Leak of %d blocks found in xmlTextWriterWriteCDATA",
44891 	           xmlMemBlocks() - mem_base);
44892 	    test_ret++;
44893             printf(" %d", n_writer);
44894             printf(" %d", n_content);
44895             printf("\n");
44896         }
44897     }
44898     }
44899     function_tests++;
44900 #endif
44901 
44902     return(test_ret);
44903 }
44904 
44905 
44906 static int
test_xmlTextWriterWriteComment(void)44907 test_xmlTextWriterWriteComment(void) {
44908     int test_ret = 0;
44909 
44910 #if defined(LIBXML_WRITER_ENABLED)
44911     int mem_base;
44912     int ret_val;
44913     xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
44914     int n_writer;
44915     xmlChar * content; /* comment string */
44916     int n_content;
44917 
44918     for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
44919     for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
44920         mem_base = xmlMemBlocks();
44921         writer = gen_xmlTextWriterPtr(n_writer, 0);
44922         content = gen_const_xmlChar_ptr(n_content, 1);
44923 
44924         ret_val = xmlTextWriterWriteComment(writer, (const xmlChar *)content);
44925         desret_int(ret_val);
44926         call_tests++;
44927         des_xmlTextWriterPtr(n_writer, writer, 0);
44928         des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 1);
44929         xmlResetLastError();
44930         if (mem_base != xmlMemBlocks()) {
44931             printf("Leak of %d blocks found in xmlTextWriterWriteComment",
44932 	           xmlMemBlocks() - mem_base);
44933 	    test_ret++;
44934             printf(" %d", n_writer);
44935             printf(" %d", n_content);
44936             printf("\n");
44937         }
44938     }
44939     }
44940     function_tests++;
44941 #endif
44942 
44943     return(test_ret);
44944 }
44945 
44946 
44947 static int
test_xmlTextWriterWriteDTD(void)44948 test_xmlTextWriterWriteDTD(void) {
44949     int test_ret = 0;
44950 
44951 #if defined(LIBXML_WRITER_ENABLED)
44952     int mem_base;
44953     int ret_val;
44954     xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
44955     int n_writer;
44956     xmlChar * name; /* the name of the DTD */
44957     int n_name;
44958     xmlChar * pubid; /* the public identifier, which is an alternative to the system identifier */
44959     int n_pubid;
44960     xmlChar * sysid; /* the system identifier, which is the URI of the DTD */
44961     int n_sysid;
44962     xmlChar * subset; /* string content of the DTD */
44963     int n_subset;
44964 
44965     for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
44966     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
44967     for (n_pubid = 0;n_pubid < gen_nb_const_xmlChar_ptr;n_pubid++) {
44968     for (n_sysid = 0;n_sysid < gen_nb_const_xmlChar_ptr;n_sysid++) {
44969     for (n_subset = 0;n_subset < gen_nb_const_xmlChar_ptr;n_subset++) {
44970         mem_base = xmlMemBlocks();
44971         writer = gen_xmlTextWriterPtr(n_writer, 0);
44972         name = gen_const_xmlChar_ptr(n_name, 1);
44973         pubid = gen_const_xmlChar_ptr(n_pubid, 2);
44974         sysid = gen_const_xmlChar_ptr(n_sysid, 3);
44975         subset = gen_const_xmlChar_ptr(n_subset, 4);
44976 
44977         ret_val = xmlTextWriterWriteDTD(writer, (const xmlChar *)name, (const xmlChar *)pubid, (const xmlChar *)sysid, (const xmlChar *)subset);
44978         desret_int(ret_val);
44979         call_tests++;
44980         des_xmlTextWriterPtr(n_writer, writer, 0);
44981         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
44982         des_const_xmlChar_ptr(n_pubid, (const xmlChar *)pubid, 2);
44983         des_const_xmlChar_ptr(n_sysid, (const xmlChar *)sysid, 3);
44984         des_const_xmlChar_ptr(n_subset, (const xmlChar *)subset, 4);
44985         xmlResetLastError();
44986         if (mem_base != xmlMemBlocks()) {
44987             printf("Leak of %d blocks found in xmlTextWriterWriteDTD",
44988 	           xmlMemBlocks() - mem_base);
44989 	    test_ret++;
44990             printf(" %d", n_writer);
44991             printf(" %d", n_name);
44992             printf(" %d", n_pubid);
44993             printf(" %d", n_sysid);
44994             printf(" %d", n_subset);
44995             printf("\n");
44996         }
44997     }
44998     }
44999     }
45000     }
45001     }
45002     function_tests++;
45003 #endif
45004 
45005     return(test_ret);
45006 }
45007 
45008 
45009 static int
test_xmlTextWriterWriteDTDAttlist(void)45010 test_xmlTextWriterWriteDTDAttlist(void) {
45011     int test_ret = 0;
45012 
45013 #if defined(LIBXML_WRITER_ENABLED)
45014     int mem_base;
45015     int ret_val;
45016     xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
45017     int n_writer;
45018     xmlChar * name; /* the name of the DTD ATTLIST */
45019     int n_name;
45020     xmlChar * content; /* content of the ATTLIST */
45021     int n_content;
45022 
45023     for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
45024     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
45025     for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
45026         mem_base = xmlMemBlocks();
45027         writer = gen_xmlTextWriterPtr(n_writer, 0);
45028         name = gen_const_xmlChar_ptr(n_name, 1);
45029         content = gen_const_xmlChar_ptr(n_content, 2);
45030 
45031         ret_val = xmlTextWriterWriteDTDAttlist(writer, (const xmlChar *)name, (const xmlChar *)content);
45032         desret_int(ret_val);
45033         call_tests++;
45034         des_xmlTextWriterPtr(n_writer, writer, 0);
45035         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
45036         des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 2);
45037         xmlResetLastError();
45038         if (mem_base != xmlMemBlocks()) {
45039             printf("Leak of %d blocks found in xmlTextWriterWriteDTDAttlist",
45040 	           xmlMemBlocks() - mem_base);
45041 	    test_ret++;
45042             printf(" %d", n_writer);
45043             printf(" %d", n_name);
45044             printf(" %d", n_content);
45045             printf("\n");
45046         }
45047     }
45048     }
45049     }
45050     function_tests++;
45051 #endif
45052 
45053     return(test_ret);
45054 }
45055 
45056 
45057 static int
test_xmlTextWriterWriteDTDElement(void)45058 test_xmlTextWriterWriteDTDElement(void) {
45059     int test_ret = 0;
45060 
45061 #if defined(LIBXML_WRITER_ENABLED)
45062     int mem_base;
45063     int ret_val;
45064     xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
45065     int n_writer;
45066     xmlChar * name; /* the name of the DTD element */
45067     int n_name;
45068     xmlChar * content; /* content of the element */
45069     int n_content;
45070 
45071     for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
45072     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
45073     for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
45074         mem_base = xmlMemBlocks();
45075         writer = gen_xmlTextWriterPtr(n_writer, 0);
45076         name = gen_const_xmlChar_ptr(n_name, 1);
45077         content = gen_const_xmlChar_ptr(n_content, 2);
45078 
45079         ret_val = xmlTextWriterWriteDTDElement(writer, (const xmlChar *)name, (const xmlChar *)content);
45080         desret_int(ret_val);
45081         call_tests++;
45082         des_xmlTextWriterPtr(n_writer, writer, 0);
45083         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
45084         des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 2);
45085         xmlResetLastError();
45086         if (mem_base != xmlMemBlocks()) {
45087             printf("Leak of %d blocks found in xmlTextWriterWriteDTDElement",
45088 	           xmlMemBlocks() - mem_base);
45089 	    test_ret++;
45090             printf(" %d", n_writer);
45091             printf(" %d", n_name);
45092             printf(" %d", n_content);
45093             printf("\n");
45094         }
45095     }
45096     }
45097     }
45098     function_tests++;
45099 #endif
45100 
45101     return(test_ret);
45102 }
45103 
45104 
45105 static int
test_xmlTextWriterWriteDTDEntity(void)45106 test_xmlTextWriterWriteDTDEntity(void) {
45107     int test_ret = 0;
45108 
45109 #if defined(LIBXML_WRITER_ENABLED)
45110     int mem_base;
45111     int ret_val;
45112     xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
45113     int n_writer;
45114     int pe; /* TRUE if this is a parameter entity, FALSE if not */
45115     int n_pe;
45116     xmlChar * name; /* the name of the DTD entity */
45117     int n_name;
45118     xmlChar * pubid; /* the public identifier, which is an alternative to the system identifier */
45119     int n_pubid;
45120     xmlChar * sysid; /* the system identifier, which is the URI of the DTD */
45121     int n_sysid;
45122     xmlChar * ndataid; /* the xml notation name. */
45123     int n_ndataid;
45124     xmlChar * content; /* content of the entity */
45125     int n_content;
45126 
45127     for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
45128     for (n_pe = 0;n_pe < gen_nb_int;n_pe++) {
45129     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
45130     for (n_pubid = 0;n_pubid < gen_nb_const_xmlChar_ptr;n_pubid++) {
45131     for (n_sysid = 0;n_sysid < gen_nb_const_xmlChar_ptr;n_sysid++) {
45132     for (n_ndataid = 0;n_ndataid < gen_nb_const_xmlChar_ptr;n_ndataid++) {
45133     for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
45134         mem_base = xmlMemBlocks();
45135         writer = gen_xmlTextWriterPtr(n_writer, 0);
45136         pe = gen_int(n_pe, 1);
45137         name = gen_const_xmlChar_ptr(n_name, 2);
45138         pubid = gen_const_xmlChar_ptr(n_pubid, 3);
45139         sysid = gen_const_xmlChar_ptr(n_sysid, 4);
45140         ndataid = gen_const_xmlChar_ptr(n_ndataid, 5);
45141         content = gen_const_xmlChar_ptr(n_content, 6);
45142 
45143         ret_val = xmlTextWriterWriteDTDEntity(writer, pe, (const xmlChar *)name, (const xmlChar *)pubid, (const xmlChar *)sysid, (const xmlChar *)ndataid, (const xmlChar *)content);
45144         desret_int(ret_val);
45145         call_tests++;
45146         des_xmlTextWriterPtr(n_writer, writer, 0);
45147         des_int(n_pe, pe, 1);
45148         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 2);
45149         des_const_xmlChar_ptr(n_pubid, (const xmlChar *)pubid, 3);
45150         des_const_xmlChar_ptr(n_sysid, (const xmlChar *)sysid, 4);
45151         des_const_xmlChar_ptr(n_ndataid, (const xmlChar *)ndataid, 5);
45152         des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 6);
45153         xmlResetLastError();
45154         if (mem_base != xmlMemBlocks()) {
45155             printf("Leak of %d blocks found in xmlTextWriterWriteDTDEntity",
45156 	           xmlMemBlocks() - mem_base);
45157 	    test_ret++;
45158             printf(" %d", n_writer);
45159             printf(" %d", n_pe);
45160             printf(" %d", n_name);
45161             printf(" %d", n_pubid);
45162             printf(" %d", n_sysid);
45163             printf(" %d", n_ndataid);
45164             printf(" %d", n_content);
45165             printf("\n");
45166         }
45167     }
45168     }
45169     }
45170     }
45171     }
45172     }
45173     }
45174     function_tests++;
45175 #endif
45176 
45177     return(test_ret);
45178 }
45179 
45180 
45181 static int
test_xmlTextWriterWriteDTDExternalEntity(void)45182 test_xmlTextWriterWriteDTDExternalEntity(void) {
45183     int test_ret = 0;
45184 
45185 #if defined(LIBXML_WRITER_ENABLED)
45186     int mem_base;
45187     int ret_val;
45188     xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
45189     int n_writer;
45190     int pe; /* TRUE if this is a parameter entity, FALSE if not */
45191     int n_pe;
45192     xmlChar * name; /* the name of the DTD entity */
45193     int n_name;
45194     xmlChar * pubid; /* the public identifier, which is an alternative to the system identifier */
45195     int n_pubid;
45196     xmlChar * sysid; /* the system identifier, which is the URI of the DTD */
45197     int n_sysid;
45198     xmlChar * ndataid; /* the xml notation name. */
45199     int n_ndataid;
45200 
45201     for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
45202     for (n_pe = 0;n_pe < gen_nb_int;n_pe++) {
45203     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
45204     for (n_pubid = 0;n_pubid < gen_nb_const_xmlChar_ptr;n_pubid++) {
45205     for (n_sysid = 0;n_sysid < gen_nb_const_xmlChar_ptr;n_sysid++) {
45206     for (n_ndataid = 0;n_ndataid < gen_nb_const_xmlChar_ptr;n_ndataid++) {
45207         mem_base = xmlMemBlocks();
45208         writer = gen_xmlTextWriterPtr(n_writer, 0);
45209         pe = gen_int(n_pe, 1);
45210         name = gen_const_xmlChar_ptr(n_name, 2);
45211         pubid = gen_const_xmlChar_ptr(n_pubid, 3);
45212         sysid = gen_const_xmlChar_ptr(n_sysid, 4);
45213         ndataid = gen_const_xmlChar_ptr(n_ndataid, 5);
45214 
45215         ret_val = xmlTextWriterWriteDTDExternalEntity(writer, pe, (const xmlChar *)name, (const xmlChar *)pubid, (const xmlChar *)sysid, (const xmlChar *)ndataid);
45216         desret_int(ret_val);
45217         call_tests++;
45218         des_xmlTextWriterPtr(n_writer, writer, 0);
45219         des_int(n_pe, pe, 1);
45220         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 2);
45221         des_const_xmlChar_ptr(n_pubid, (const xmlChar *)pubid, 3);
45222         des_const_xmlChar_ptr(n_sysid, (const xmlChar *)sysid, 4);
45223         des_const_xmlChar_ptr(n_ndataid, (const xmlChar *)ndataid, 5);
45224         xmlResetLastError();
45225         if (mem_base != xmlMemBlocks()) {
45226             printf("Leak of %d blocks found in xmlTextWriterWriteDTDExternalEntity",
45227 	           xmlMemBlocks() - mem_base);
45228 	    test_ret++;
45229             printf(" %d", n_writer);
45230             printf(" %d", n_pe);
45231             printf(" %d", n_name);
45232             printf(" %d", n_pubid);
45233             printf(" %d", n_sysid);
45234             printf(" %d", n_ndataid);
45235             printf("\n");
45236         }
45237     }
45238     }
45239     }
45240     }
45241     }
45242     }
45243     function_tests++;
45244 #endif
45245 
45246     return(test_ret);
45247 }
45248 
45249 
45250 static int
test_xmlTextWriterWriteDTDExternalEntityContents(void)45251 test_xmlTextWriterWriteDTDExternalEntityContents(void) {
45252     int test_ret = 0;
45253 
45254 #if defined(LIBXML_WRITER_ENABLED)
45255     int mem_base;
45256     int ret_val;
45257     xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
45258     int n_writer;
45259     xmlChar * pubid; /* the public identifier, which is an alternative to the system identifier */
45260     int n_pubid;
45261     xmlChar * sysid; /* the system identifier, which is the URI of the DTD */
45262     int n_sysid;
45263     xmlChar * ndataid; /* the xml notation name. */
45264     int n_ndataid;
45265 
45266     for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
45267     for (n_pubid = 0;n_pubid < gen_nb_const_xmlChar_ptr;n_pubid++) {
45268     for (n_sysid = 0;n_sysid < gen_nb_const_xmlChar_ptr;n_sysid++) {
45269     for (n_ndataid = 0;n_ndataid < gen_nb_const_xmlChar_ptr;n_ndataid++) {
45270         mem_base = xmlMemBlocks();
45271         writer = gen_xmlTextWriterPtr(n_writer, 0);
45272         pubid = gen_const_xmlChar_ptr(n_pubid, 1);
45273         sysid = gen_const_xmlChar_ptr(n_sysid, 2);
45274         ndataid = gen_const_xmlChar_ptr(n_ndataid, 3);
45275 
45276         ret_val = xmlTextWriterWriteDTDExternalEntityContents(writer, (const xmlChar *)pubid, (const xmlChar *)sysid, (const xmlChar *)ndataid);
45277         desret_int(ret_val);
45278         call_tests++;
45279         des_xmlTextWriterPtr(n_writer, writer, 0);
45280         des_const_xmlChar_ptr(n_pubid, (const xmlChar *)pubid, 1);
45281         des_const_xmlChar_ptr(n_sysid, (const xmlChar *)sysid, 2);
45282         des_const_xmlChar_ptr(n_ndataid, (const xmlChar *)ndataid, 3);
45283         xmlResetLastError();
45284         if (mem_base != xmlMemBlocks()) {
45285             printf("Leak of %d blocks found in xmlTextWriterWriteDTDExternalEntityContents",
45286 	           xmlMemBlocks() - mem_base);
45287 	    test_ret++;
45288             printf(" %d", n_writer);
45289             printf(" %d", n_pubid);
45290             printf(" %d", n_sysid);
45291             printf(" %d", n_ndataid);
45292             printf("\n");
45293         }
45294     }
45295     }
45296     }
45297     }
45298     function_tests++;
45299 #endif
45300 
45301     return(test_ret);
45302 }
45303 
45304 
45305 static int
test_xmlTextWriterWriteDTDInternalEntity(void)45306 test_xmlTextWriterWriteDTDInternalEntity(void) {
45307     int test_ret = 0;
45308 
45309 #if defined(LIBXML_WRITER_ENABLED)
45310     int mem_base;
45311     int ret_val;
45312     xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
45313     int n_writer;
45314     int pe; /* TRUE if this is a parameter entity, FALSE if not */
45315     int n_pe;
45316     xmlChar * name; /* the name of the DTD entity */
45317     int n_name;
45318     xmlChar * content; /* content of the entity */
45319     int n_content;
45320 
45321     for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
45322     for (n_pe = 0;n_pe < gen_nb_int;n_pe++) {
45323     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
45324     for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
45325         mem_base = xmlMemBlocks();
45326         writer = gen_xmlTextWriterPtr(n_writer, 0);
45327         pe = gen_int(n_pe, 1);
45328         name = gen_const_xmlChar_ptr(n_name, 2);
45329         content = gen_const_xmlChar_ptr(n_content, 3);
45330 
45331         ret_val = xmlTextWriterWriteDTDInternalEntity(writer, pe, (const xmlChar *)name, (const xmlChar *)content);
45332         desret_int(ret_val);
45333         call_tests++;
45334         des_xmlTextWriterPtr(n_writer, writer, 0);
45335         des_int(n_pe, pe, 1);
45336         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 2);
45337         des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 3);
45338         xmlResetLastError();
45339         if (mem_base != xmlMemBlocks()) {
45340             printf("Leak of %d blocks found in xmlTextWriterWriteDTDInternalEntity",
45341 	           xmlMemBlocks() - mem_base);
45342 	    test_ret++;
45343             printf(" %d", n_writer);
45344             printf(" %d", n_pe);
45345             printf(" %d", n_name);
45346             printf(" %d", n_content);
45347             printf("\n");
45348         }
45349     }
45350     }
45351     }
45352     }
45353     function_tests++;
45354 #endif
45355 
45356     return(test_ret);
45357 }
45358 
45359 
45360 static int
test_xmlTextWriterWriteDTDNotation(void)45361 test_xmlTextWriterWriteDTDNotation(void) {
45362     int test_ret = 0;
45363 
45364 #if defined(LIBXML_WRITER_ENABLED)
45365     int mem_base;
45366     int ret_val;
45367     xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
45368     int n_writer;
45369     xmlChar * name; /* the name of the xml notation */
45370     int n_name;
45371     xmlChar * pubid; /* the public identifier, which is an alternative to the system identifier */
45372     int n_pubid;
45373     xmlChar * sysid; /* the system identifier, which is the URI of the DTD */
45374     int n_sysid;
45375 
45376     for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
45377     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
45378     for (n_pubid = 0;n_pubid < gen_nb_const_xmlChar_ptr;n_pubid++) {
45379     for (n_sysid = 0;n_sysid < gen_nb_const_xmlChar_ptr;n_sysid++) {
45380         mem_base = xmlMemBlocks();
45381         writer = gen_xmlTextWriterPtr(n_writer, 0);
45382         name = gen_const_xmlChar_ptr(n_name, 1);
45383         pubid = gen_const_xmlChar_ptr(n_pubid, 2);
45384         sysid = gen_const_xmlChar_ptr(n_sysid, 3);
45385 
45386         ret_val = xmlTextWriterWriteDTDNotation(writer, (const xmlChar *)name, (const xmlChar *)pubid, (const xmlChar *)sysid);
45387         desret_int(ret_val);
45388         call_tests++;
45389         des_xmlTextWriterPtr(n_writer, writer, 0);
45390         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
45391         des_const_xmlChar_ptr(n_pubid, (const xmlChar *)pubid, 2);
45392         des_const_xmlChar_ptr(n_sysid, (const xmlChar *)sysid, 3);
45393         xmlResetLastError();
45394         if (mem_base != xmlMemBlocks()) {
45395             printf("Leak of %d blocks found in xmlTextWriterWriteDTDNotation",
45396 	           xmlMemBlocks() - mem_base);
45397 	    test_ret++;
45398             printf(" %d", n_writer);
45399             printf(" %d", n_name);
45400             printf(" %d", n_pubid);
45401             printf(" %d", n_sysid);
45402             printf("\n");
45403         }
45404     }
45405     }
45406     }
45407     }
45408     function_tests++;
45409 #endif
45410 
45411     return(test_ret);
45412 }
45413 
45414 
45415 static int
test_xmlTextWriterWriteElement(void)45416 test_xmlTextWriterWriteElement(void) {
45417     int test_ret = 0;
45418 
45419 #if defined(LIBXML_WRITER_ENABLED)
45420     int mem_base;
45421     int ret_val;
45422     xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
45423     int n_writer;
45424     xmlChar * name; /* element name */
45425     int n_name;
45426     xmlChar * content; /* element content */
45427     int n_content;
45428 
45429     for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
45430     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
45431     for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
45432         mem_base = xmlMemBlocks();
45433         writer = gen_xmlTextWriterPtr(n_writer, 0);
45434         name = gen_const_xmlChar_ptr(n_name, 1);
45435         content = gen_const_xmlChar_ptr(n_content, 2);
45436 
45437         ret_val = xmlTextWriterWriteElement(writer, (const xmlChar *)name, (const xmlChar *)content);
45438         desret_int(ret_val);
45439         call_tests++;
45440         des_xmlTextWriterPtr(n_writer, writer, 0);
45441         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
45442         des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 2);
45443         xmlResetLastError();
45444         if (mem_base != xmlMemBlocks()) {
45445             printf("Leak of %d blocks found in xmlTextWriterWriteElement",
45446 	           xmlMemBlocks() - mem_base);
45447 	    test_ret++;
45448             printf(" %d", n_writer);
45449             printf(" %d", n_name);
45450             printf(" %d", n_content);
45451             printf("\n");
45452         }
45453     }
45454     }
45455     }
45456     function_tests++;
45457 #endif
45458 
45459     return(test_ret);
45460 }
45461 
45462 
45463 static int
test_xmlTextWriterWriteElementNS(void)45464 test_xmlTextWriterWriteElementNS(void) {
45465     int test_ret = 0;
45466 
45467 #if defined(LIBXML_WRITER_ENABLED)
45468     int mem_base;
45469     int ret_val;
45470     xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
45471     int n_writer;
45472     xmlChar * prefix; /* namespace prefix */
45473     int n_prefix;
45474     xmlChar * name; /* element local name */
45475     int n_name;
45476     xmlChar * namespaceURI; /* namespace URI */
45477     int n_namespaceURI;
45478     xmlChar * content; /* element content */
45479     int n_content;
45480 
45481     for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
45482     for (n_prefix = 0;n_prefix < gen_nb_const_xmlChar_ptr;n_prefix++) {
45483     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
45484     for (n_namespaceURI = 0;n_namespaceURI < gen_nb_const_xmlChar_ptr;n_namespaceURI++) {
45485     for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
45486         mem_base = xmlMemBlocks();
45487         writer = gen_xmlTextWriterPtr(n_writer, 0);
45488         prefix = gen_const_xmlChar_ptr(n_prefix, 1);
45489         name = gen_const_xmlChar_ptr(n_name, 2);
45490         namespaceURI = gen_const_xmlChar_ptr(n_namespaceURI, 3);
45491         content = gen_const_xmlChar_ptr(n_content, 4);
45492 
45493         ret_val = xmlTextWriterWriteElementNS(writer, (const xmlChar *)prefix, (const xmlChar *)name, (const xmlChar *)namespaceURI, (const xmlChar *)content);
45494         desret_int(ret_val);
45495         call_tests++;
45496         des_xmlTextWriterPtr(n_writer, writer, 0);
45497         des_const_xmlChar_ptr(n_prefix, (const xmlChar *)prefix, 1);
45498         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 2);
45499         des_const_xmlChar_ptr(n_namespaceURI, (const xmlChar *)namespaceURI, 3);
45500         des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 4);
45501         xmlResetLastError();
45502         if (mem_base != xmlMemBlocks()) {
45503             printf("Leak of %d blocks found in xmlTextWriterWriteElementNS",
45504 	           xmlMemBlocks() - mem_base);
45505 	    test_ret++;
45506             printf(" %d", n_writer);
45507             printf(" %d", n_prefix);
45508             printf(" %d", n_name);
45509             printf(" %d", n_namespaceURI);
45510             printf(" %d", n_content);
45511             printf("\n");
45512         }
45513     }
45514     }
45515     }
45516     }
45517     }
45518     function_tests++;
45519 #endif
45520 
45521     return(test_ret);
45522 }
45523 
45524 
45525 static int
test_xmlTextWriterWriteFormatAttribute(void)45526 test_xmlTextWriterWriteFormatAttribute(void) {
45527     int test_ret = 0;
45528 
45529 
45530     /* missing type support */
45531     return(test_ret);
45532 }
45533 
45534 
45535 static int
test_xmlTextWriterWriteFormatAttributeNS(void)45536 test_xmlTextWriterWriteFormatAttributeNS(void) {
45537     int test_ret = 0;
45538 
45539 
45540     /* missing type support */
45541     return(test_ret);
45542 }
45543 
45544 
45545 static int
test_xmlTextWriterWriteFormatCDATA(void)45546 test_xmlTextWriterWriteFormatCDATA(void) {
45547     int test_ret = 0;
45548 
45549 
45550     /* missing type support */
45551     return(test_ret);
45552 }
45553 
45554 
45555 static int
test_xmlTextWriterWriteFormatComment(void)45556 test_xmlTextWriterWriteFormatComment(void) {
45557     int test_ret = 0;
45558 
45559 
45560     /* missing type support */
45561     return(test_ret);
45562 }
45563 
45564 
45565 static int
test_xmlTextWriterWriteFormatDTD(void)45566 test_xmlTextWriterWriteFormatDTD(void) {
45567     int test_ret = 0;
45568 
45569 
45570     /* missing type support */
45571     return(test_ret);
45572 }
45573 
45574 
45575 static int
test_xmlTextWriterWriteFormatDTDAttlist(void)45576 test_xmlTextWriterWriteFormatDTDAttlist(void) {
45577     int test_ret = 0;
45578 
45579 
45580     /* missing type support */
45581     return(test_ret);
45582 }
45583 
45584 
45585 static int
test_xmlTextWriterWriteFormatDTDElement(void)45586 test_xmlTextWriterWriteFormatDTDElement(void) {
45587     int test_ret = 0;
45588 
45589 
45590     /* missing type support */
45591     return(test_ret);
45592 }
45593 
45594 
45595 static int
test_xmlTextWriterWriteFormatDTDInternalEntity(void)45596 test_xmlTextWriterWriteFormatDTDInternalEntity(void) {
45597     int test_ret = 0;
45598 
45599 
45600     /* missing type support */
45601     return(test_ret);
45602 }
45603 
45604 
45605 static int
test_xmlTextWriterWriteFormatElement(void)45606 test_xmlTextWriterWriteFormatElement(void) {
45607     int test_ret = 0;
45608 
45609 
45610     /* missing type support */
45611     return(test_ret);
45612 }
45613 
45614 
45615 static int
test_xmlTextWriterWriteFormatElementNS(void)45616 test_xmlTextWriterWriteFormatElementNS(void) {
45617     int test_ret = 0;
45618 
45619 
45620     /* missing type support */
45621     return(test_ret);
45622 }
45623 
45624 
45625 static int
test_xmlTextWriterWriteFormatPI(void)45626 test_xmlTextWriterWriteFormatPI(void) {
45627     int test_ret = 0;
45628 
45629 
45630     /* missing type support */
45631     return(test_ret);
45632 }
45633 
45634 
45635 static int
test_xmlTextWriterWriteFormatRaw(void)45636 test_xmlTextWriterWriteFormatRaw(void) {
45637     int test_ret = 0;
45638 
45639 
45640     /* missing type support */
45641     return(test_ret);
45642 }
45643 
45644 
45645 static int
test_xmlTextWriterWriteFormatString(void)45646 test_xmlTextWriterWriteFormatString(void) {
45647     int test_ret = 0;
45648 
45649 
45650     /* missing type support */
45651     return(test_ret);
45652 }
45653 
45654 
45655 static int
test_xmlTextWriterWritePI(void)45656 test_xmlTextWriterWritePI(void) {
45657     int test_ret = 0;
45658 
45659 #if defined(LIBXML_WRITER_ENABLED)
45660     int mem_base;
45661     int ret_val;
45662     xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
45663     int n_writer;
45664     xmlChar * target; /* PI target */
45665     int n_target;
45666     xmlChar * content; /* PI content */
45667     int n_content;
45668 
45669     for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
45670     for (n_target = 0;n_target < gen_nb_const_xmlChar_ptr;n_target++) {
45671     for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
45672         mem_base = xmlMemBlocks();
45673         writer = gen_xmlTextWriterPtr(n_writer, 0);
45674         target = gen_const_xmlChar_ptr(n_target, 1);
45675         content = gen_const_xmlChar_ptr(n_content, 2);
45676 
45677         ret_val = xmlTextWriterWritePI(writer, (const xmlChar *)target, (const xmlChar *)content);
45678         desret_int(ret_val);
45679         call_tests++;
45680         des_xmlTextWriterPtr(n_writer, writer, 0);
45681         des_const_xmlChar_ptr(n_target, (const xmlChar *)target, 1);
45682         des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 2);
45683         xmlResetLastError();
45684         if (mem_base != xmlMemBlocks()) {
45685             printf("Leak of %d blocks found in xmlTextWriterWritePI",
45686 	           xmlMemBlocks() - mem_base);
45687 	    test_ret++;
45688             printf(" %d", n_writer);
45689             printf(" %d", n_target);
45690             printf(" %d", n_content);
45691             printf("\n");
45692         }
45693     }
45694     }
45695     }
45696     function_tests++;
45697 #endif
45698 
45699     return(test_ret);
45700 }
45701 
45702 
45703 static int
test_xmlTextWriterWriteRaw(void)45704 test_xmlTextWriterWriteRaw(void) {
45705     int test_ret = 0;
45706 
45707 #if defined(LIBXML_WRITER_ENABLED)
45708     int mem_base;
45709     int ret_val;
45710     xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
45711     int n_writer;
45712     xmlChar * content; /* text string */
45713     int n_content;
45714 
45715     for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
45716     for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
45717         mem_base = xmlMemBlocks();
45718         writer = gen_xmlTextWriterPtr(n_writer, 0);
45719         content = gen_const_xmlChar_ptr(n_content, 1);
45720 
45721         ret_val = xmlTextWriterWriteRaw(writer, (const xmlChar *)content);
45722         desret_int(ret_val);
45723         call_tests++;
45724         des_xmlTextWriterPtr(n_writer, writer, 0);
45725         des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 1);
45726         xmlResetLastError();
45727         if (mem_base != xmlMemBlocks()) {
45728             printf("Leak of %d blocks found in xmlTextWriterWriteRaw",
45729 	           xmlMemBlocks() - mem_base);
45730 	    test_ret++;
45731             printf(" %d", n_writer);
45732             printf(" %d", n_content);
45733             printf("\n");
45734         }
45735     }
45736     }
45737     function_tests++;
45738 #endif
45739 
45740     return(test_ret);
45741 }
45742 
45743 
45744 static int
test_xmlTextWriterWriteRawLen(void)45745 test_xmlTextWriterWriteRawLen(void) {
45746     int test_ret = 0;
45747 
45748 #if defined(LIBXML_WRITER_ENABLED)
45749     int mem_base;
45750     int ret_val;
45751     xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
45752     int n_writer;
45753     xmlChar * content; /* text string */
45754     int n_content;
45755     int len; /* length of the text string */
45756     int n_len;
45757 
45758     for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
45759     for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
45760     for (n_len = 0;n_len < gen_nb_int;n_len++) {
45761         mem_base = xmlMemBlocks();
45762         writer = gen_xmlTextWriterPtr(n_writer, 0);
45763         content = gen_const_xmlChar_ptr(n_content, 1);
45764         len = gen_int(n_len, 2);
45765         if ((content != NULL) &&
45766             (len > (int) strlen((const char *) content) + 1))
45767             continue;
45768 
45769         ret_val = xmlTextWriterWriteRawLen(writer, (const xmlChar *)content, len);
45770         desret_int(ret_val);
45771         call_tests++;
45772         des_xmlTextWriterPtr(n_writer, writer, 0);
45773         des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 1);
45774         des_int(n_len, len, 2);
45775         xmlResetLastError();
45776         if (mem_base != xmlMemBlocks()) {
45777             printf("Leak of %d blocks found in xmlTextWriterWriteRawLen",
45778 	           xmlMemBlocks() - mem_base);
45779 	    test_ret++;
45780             printf(" %d", n_writer);
45781             printf(" %d", n_content);
45782             printf(" %d", n_len);
45783             printf("\n");
45784         }
45785     }
45786     }
45787     }
45788     function_tests++;
45789 #endif
45790 
45791     return(test_ret);
45792 }
45793 
45794 
45795 static int
test_xmlTextWriterWriteString(void)45796 test_xmlTextWriterWriteString(void) {
45797     int test_ret = 0;
45798 
45799 #if defined(LIBXML_WRITER_ENABLED)
45800     int mem_base;
45801     int ret_val;
45802     xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
45803     int n_writer;
45804     xmlChar * content; /* text string */
45805     int n_content;
45806 
45807     for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
45808     for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
45809         mem_base = xmlMemBlocks();
45810         writer = gen_xmlTextWriterPtr(n_writer, 0);
45811         content = gen_const_xmlChar_ptr(n_content, 1);
45812 
45813         ret_val = xmlTextWriterWriteString(writer, (const xmlChar *)content);
45814         desret_int(ret_val);
45815         call_tests++;
45816         des_xmlTextWriterPtr(n_writer, writer, 0);
45817         des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 1);
45818         xmlResetLastError();
45819         if (mem_base != xmlMemBlocks()) {
45820             printf("Leak of %d blocks found in xmlTextWriterWriteString",
45821 	           xmlMemBlocks() - mem_base);
45822 	    test_ret++;
45823             printf(" %d", n_writer);
45824             printf(" %d", n_content);
45825             printf("\n");
45826         }
45827     }
45828     }
45829     function_tests++;
45830 #endif
45831 
45832     return(test_ret);
45833 }
45834 
45835 
45836 static int
test_xmlTextWriterWriteVFormatAttribute(void)45837 test_xmlTextWriterWriteVFormatAttribute(void) {
45838     int test_ret = 0;
45839 
45840 
45841     /* missing type support */
45842     return(test_ret);
45843 }
45844 
45845 
45846 static int
test_xmlTextWriterWriteVFormatAttributeNS(void)45847 test_xmlTextWriterWriteVFormatAttributeNS(void) {
45848     int test_ret = 0;
45849 
45850 
45851     /* missing type support */
45852     return(test_ret);
45853 }
45854 
45855 
45856 static int
test_xmlTextWriterWriteVFormatCDATA(void)45857 test_xmlTextWriterWriteVFormatCDATA(void) {
45858     int test_ret = 0;
45859 
45860 
45861     /* missing type support */
45862     return(test_ret);
45863 }
45864 
45865 
45866 static int
test_xmlTextWriterWriteVFormatComment(void)45867 test_xmlTextWriterWriteVFormatComment(void) {
45868     int test_ret = 0;
45869 
45870 
45871     /* missing type support */
45872     return(test_ret);
45873 }
45874 
45875 
45876 static int
test_xmlTextWriterWriteVFormatDTD(void)45877 test_xmlTextWriterWriteVFormatDTD(void) {
45878     int test_ret = 0;
45879 
45880 
45881     /* missing type support */
45882     return(test_ret);
45883 }
45884 
45885 
45886 static int
test_xmlTextWriterWriteVFormatDTDAttlist(void)45887 test_xmlTextWriterWriteVFormatDTDAttlist(void) {
45888     int test_ret = 0;
45889 
45890 
45891     /* missing type support */
45892     return(test_ret);
45893 }
45894 
45895 
45896 static int
test_xmlTextWriterWriteVFormatDTDElement(void)45897 test_xmlTextWriterWriteVFormatDTDElement(void) {
45898     int test_ret = 0;
45899 
45900 
45901     /* missing type support */
45902     return(test_ret);
45903 }
45904 
45905 
45906 static int
test_xmlTextWriterWriteVFormatDTDInternalEntity(void)45907 test_xmlTextWriterWriteVFormatDTDInternalEntity(void) {
45908     int test_ret = 0;
45909 
45910 
45911     /* missing type support */
45912     return(test_ret);
45913 }
45914 
45915 
45916 static int
test_xmlTextWriterWriteVFormatElement(void)45917 test_xmlTextWriterWriteVFormatElement(void) {
45918     int test_ret = 0;
45919 
45920 
45921     /* missing type support */
45922     return(test_ret);
45923 }
45924 
45925 
45926 static int
test_xmlTextWriterWriteVFormatElementNS(void)45927 test_xmlTextWriterWriteVFormatElementNS(void) {
45928     int test_ret = 0;
45929 
45930 
45931     /* missing type support */
45932     return(test_ret);
45933 }
45934 
45935 
45936 static int
test_xmlTextWriterWriteVFormatPI(void)45937 test_xmlTextWriterWriteVFormatPI(void) {
45938     int test_ret = 0;
45939 
45940 
45941     /* missing type support */
45942     return(test_ret);
45943 }
45944 
45945 
45946 static int
test_xmlTextWriterWriteVFormatRaw(void)45947 test_xmlTextWriterWriteVFormatRaw(void) {
45948     int test_ret = 0;
45949 
45950 
45951     /* missing type support */
45952     return(test_ret);
45953 }
45954 
45955 
45956 static int
test_xmlTextWriterWriteVFormatString(void)45957 test_xmlTextWriterWriteVFormatString(void) {
45958     int test_ret = 0;
45959 
45960 
45961     /* missing type support */
45962     return(test_ret);
45963 }
45964 
45965 static int
test_xmlwriter(void)45966 test_xmlwriter(void) {
45967     int test_ret = 0;
45968 
45969     if (quiet == 0) printf("Testing xmlwriter : 52 of 80 functions ...\n");
45970     test_ret += test_xmlNewTextWriter();
45971     test_ret += test_xmlNewTextWriterFilename();
45972     test_ret += test_xmlNewTextWriterMemory();
45973     test_ret += test_xmlNewTextWriterPushParser();
45974     test_ret += test_xmlNewTextWriterTree();
45975     test_ret += test_xmlTextWriterEndAttribute();
45976     test_ret += test_xmlTextWriterEndCDATA();
45977     test_ret += test_xmlTextWriterEndComment();
45978     test_ret += test_xmlTextWriterEndDTD();
45979     test_ret += test_xmlTextWriterEndDTDAttlist();
45980     test_ret += test_xmlTextWriterEndDTDElement();
45981     test_ret += test_xmlTextWriterEndDTDEntity();
45982     test_ret += test_xmlTextWriterEndDocument();
45983     test_ret += test_xmlTextWriterEndElement();
45984     test_ret += test_xmlTextWriterEndPI();
45985     test_ret += test_xmlTextWriterFlush();
45986     test_ret += test_xmlTextWriterFullEndElement();
45987     test_ret += test_xmlTextWriterSetIndent();
45988     test_ret += test_xmlTextWriterSetIndentString();
45989     test_ret += test_xmlTextWriterSetQuoteChar();
45990     test_ret += test_xmlTextWriterStartAttribute();
45991     test_ret += test_xmlTextWriterStartAttributeNS();
45992     test_ret += test_xmlTextWriterStartCDATA();
45993     test_ret += test_xmlTextWriterStartComment();
45994     test_ret += test_xmlTextWriterStartDTD();
45995     test_ret += test_xmlTextWriterStartDTDAttlist();
45996     test_ret += test_xmlTextWriterStartDTDElement();
45997     test_ret += test_xmlTextWriterStartDTDEntity();
45998     test_ret += test_xmlTextWriterStartDocument();
45999     test_ret += test_xmlTextWriterStartElement();
46000     test_ret += test_xmlTextWriterStartElementNS();
46001     test_ret += test_xmlTextWriterStartPI();
46002     test_ret += test_xmlTextWriterWriteAttribute();
46003     test_ret += test_xmlTextWriterWriteAttributeNS();
46004     test_ret += test_xmlTextWriterWriteBase64();
46005     test_ret += test_xmlTextWriterWriteBinHex();
46006     test_ret += test_xmlTextWriterWriteCDATA();
46007     test_ret += test_xmlTextWriterWriteComment();
46008     test_ret += test_xmlTextWriterWriteDTD();
46009     test_ret += test_xmlTextWriterWriteDTDAttlist();
46010     test_ret += test_xmlTextWriterWriteDTDElement();
46011     test_ret += test_xmlTextWriterWriteDTDEntity();
46012     test_ret += test_xmlTextWriterWriteDTDExternalEntity();
46013     test_ret += test_xmlTextWriterWriteDTDExternalEntityContents();
46014     test_ret += test_xmlTextWriterWriteDTDInternalEntity();
46015     test_ret += test_xmlTextWriterWriteDTDNotation();
46016     test_ret += test_xmlTextWriterWriteElement();
46017     test_ret += test_xmlTextWriterWriteElementNS();
46018     test_ret += test_xmlTextWriterWriteFormatAttribute();
46019     test_ret += test_xmlTextWriterWriteFormatAttributeNS();
46020     test_ret += test_xmlTextWriterWriteFormatCDATA();
46021     test_ret += test_xmlTextWriterWriteFormatComment();
46022     test_ret += test_xmlTextWriterWriteFormatDTD();
46023     test_ret += test_xmlTextWriterWriteFormatDTDAttlist();
46024     test_ret += test_xmlTextWriterWriteFormatDTDElement();
46025     test_ret += test_xmlTextWriterWriteFormatDTDInternalEntity();
46026     test_ret += test_xmlTextWriterWriteFormatElement();
46027     test_ret += test_xmlTextWriterWriteFormatElementNS();
46028     test_ret += test_xmlTextWriterWriteFormatPI();
46029     test_ret += test_xmlTextWriterWriteFormatRaw();
46030     test_ret += test_xmlTextWriterWriteFormatString();
46031     test_ret += test_xmlTextWriterWritePI();
46032     test_ret += test_xmlTextWriterWriteRaw();
46033     test_ret += test_xmlTextWriterWriteRawLen();
46034     test_ret += test_xmlTextWriterWriteString();
46035     test_ret += test_xmlTextWriterWriteVFormatAttribute();
46036     test_ret += test_xmlTextWriterWriteVFormatAttributeNS();
46037     test_ret += test_xmlTextWriterWriteVFormatCDATA();
46038     test_ret += test_xmlTextWriterWriteVFormatComment();
46039     test_ret += test_xmlTextWriterWriteVFormatDTD();
46040     test_ret += test_xmlTextWriterWriteVFormatDTDAttlist();
46041     test_ret += test_xmlTextWriterWriteVFormatDTDElement();
46042     test_ret += test_xmlTextWriterWriteVFormatDTDInternalEntity();
46043     test_ret += test_xmlTextWriterWriteVFormatElement();
46044     test_ret += test_xmlTextWriterWriteVFormatElementNS();
46045     test_ret += test_xmlTextWriterWriteVFormatPI();
46046     test_ret += test_xmlTextWriterWriteVFormatRaw();
46047     test_ret += test_xmlTextWriterWriteVFormatString();
46048 
46049     if (test_ret != 0)
46050 	printf("Module xmlwriter: %d errors\n", test_ret);
46051     return(test_ret);
46052 }
46053 
46054 static int
test_xmlXPathCastBooleanToNumber(void)46055 test_xmlXPathCastBooleanToNumber(void) {
46056     int test_ret = 0;
46057 
46058 #if defined(LIBXML_XPATH_ENABLED)
46059     int mem_base;
46060     double ret_val;
46061     int val; /* a boolean */
46062     int n_val;
46063 
46064     for (n_val = 0;n_val < gen_nb_int;n_val++) {
46065         mem_base = xmlMemBlocks();
46066         val = gen_int(n_val, 0);
46067 
46068         ret_val = xmlXPathCastBooleanToNumber(val);
46069         desret_double(ret_val);
46070         call_tests++;
46071         des_int(n_val, val, 0);
46072         xmlResetLastError();
46073         if (mem_base != xmlMemBlocks()) {
46074             printf("Leak of %d blocks found in xmlXPathCastBooleanToNumber",
46075 	           xmlMemBlocks() - mem_base);
46076 	    test_ret++;
46077             printf(" %d", n_val);
46078             printf("\n");
46079         }
46080     }
46081     function_tests++;
46082 #endif
46083 
46084     return(test_ret);
46085 }
46086 
46087 
46088 static int
test_xmlXPathCastBooleanToString(void)46089 test_xmlXPathCastBooleanToString(void) {
46090     int test_ret = 0;
46091 
46092 #if defined(LIBXML_XPATH_ENABLED)
46093     int mem_base;
46094     xmlChar * ret_val;
46095     int val; /* a boolean */
46096     int n_val;
46097 
46098     for (n_val = 0;n_val < gen_nb_int;n_val++) {
46099         mem_base = xmlMemBlocks();
46100         val = gen_int(n_val, 0);
46101 
46102         ret_val = xmlXPathCastBooleanToString(val);
46103         desret_xmlChar_ptr(ret_val);
46104         call_tests++;
46105         des_int(n_val, val, 0);
46106         xmlResetLastError();
46107         if (mem_base != xmlMemBlocks()) {
46108             printf("Leak of %d blocks found in xmlXPathCastBooleanToString",
46109 	           xmlMemBlocks() - mem_base);
46110 	    test_ret++;
46111             printf(" %d", n_val);
46112             printf("\n");
46113         }
46114     }
46115     function_tests++;
46116 #endif
46117 
46118     return(test_ret);
46119 }
46120 
46121 
46122 static int
test_xmlXPathCastNodeSetToBoolean(void)46123 test_xmlXPathCastNodeSetToBoolean(void) {
46124     int test_ret = 0;
46125 
46126 #if defined(LIBXML_XPATH_ENABLED)
46127     int mem_base;
46128     int ret_val;
46129     xmlNodeSetPtr ns; /* a node-set */
46130     int n_ns;
46131 
46132     for (n_ns = 0;n_ns < gen_nb_xmlNodeSetPtr;n_ns++) {
46133         mem_base = xmlMemBlocks();
46134         ns = gen_xmlNodeSetPtr(n_ns, 0);
46135 
46136         ret_val = xmlXPathCastNodeSetToBoolean(ns);
46137         desret_int(ret_val);
46138         call_tests++;
46139         des_xmlNodeSetPtr(n_ns, ns, 0);
46140         xmlResetLastError();
46141         if (mem_base != xmlMemBlocks()) {
46142             printf("Leak of %d blocks found in xmlXPathCastNodeSetToBoolean",
46143 	           xmlMemBlocks() - mem_base);
46144 	    test_ret++;
46145             printf(" %d", n_ns);
46146             printf("\n");
46147         }
46148     }
46149     function_tests++;
46150 #endif
46151 
46152     return(test_ret);
46153 }
46154 
46155 
46156 static int
test_xmlXPathCastNodeSetToNumber(void)46157 test_xmlXPathCastNodeSetToNumber(void) {
46158     int test_ret = 0;
46159 
46160 #if defined(LIBXML_XPATH_ENABLED)
46161     int mem_base;
46162     double ret_val;
46163     xmlNodeSetPtr ns; /* a node-set */
46164     int n_ns;
46165 
46166     for (n_ns = 0;n_ns < gen_nb_xmlNodeSetPtr;n_ns++) {
46167         mem_base = xmlMemBlocks();
46168         ns = gen_xmlNodeSetPtr(n_ns, 0);
46169 
46170         ret_val = xmlXPathCastNodeSetToNumber(ns);
46171         desret_double(ret_val);
46172         call_tests++;
46173         des_xmlNodeSetPtr(n_ns, ns, 0);
46174         xmlResetLastError();
46175         if (mem_base != xmlMemBlocks()) {
46176             printf("Leak of %d blocks found in xmlXPathCastNodeSetToNumber",
46177 	           xmlMemBlocks() - mem_base);
46178 	    test_ret++;
46179             printf(" %d", n_ns);
46180             printf("\n");
46181         }
46182     }
46183     function_tests++;
46184 #endif
46185 
46186     return(test_ret);
46187 }
46188 
46189 
46190 static int
test_xmlXPathCastNodeSetToString(void)46191 test_xmlXPathCastNodeSetToString(void) {
46192     int test_ret = 0;
46193 
46194 #if defined(LIBXML_XPATH_ENABLED)
46195     int mem_base;
46196     xmlChar * ret_val;
46197     xmlNodeSetPtr ns; /* a node-set */
46198     int n_ns;
46199 
46200     for (n_ns = 0;n_ns < gen_nb_xmlNodeSetPtr;n_ns++) {
46201         mem_base = xmlMemBlocks();
46202         ns = gen_xmlNodeSetPtr(n_ns, 0);
46203 
46204         ret_val = xmlXPathCastNodeSetToString(ns);
46205         desret_xmlChar_ptr(ret_val);
46206         call_tests++;
46207         des_xmlNodeSetPtr(n_ns, ns, 0);
46208         xmlResetLastError();
46209         if (mem_base != xmlMemBlocks()) {
46210             printf("Leak of %d blocks found in xmlXPathCastNodeSetToString",
46211 	           xmlMemBlocks() - mem_base);
46212 	    test_ret++;
46213             printf(" %d", n_ns);
46214             printf("\n");
46215         }
46216     }
46217     function_tests++;
46218 #endif
46219 
46220     return(test_ret);
46221 }
46222 
46223 
46224 static int
test_xmlXPathCastNodeToNumber(void)46225 test_xmlXPathCastNodeToNumber(void) {
46226     int test_ret = 0;
46227 
46228 #if defined(LIBXML_XPATH_ENABLED)
46229     int mem_base;
46230     double ret_val;
46231     xmlNodePtr node; /* a node */
46232     int n_node;
46233 
46234     for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
46235         mem_base = xmlMemBlocks();
46236         node = gen_xmlNodePtr(n_node, 0);
46237 
46238         ret_val = xmlXPathCastNodeToNumber(node);
46239         desret_double(ret_val);
46240         call_tests++;
46241         des_xmlNodePtr(n_node, node, 0);
46242         xmlResetLastError();
46243         if (mem_base != xmlMemBlocks()) {
46244             printf("Leak of %d blocks found in xmlXPathCastNodeToNumber",
46245 	           xmlMemBlocks() - mem_base);
46246 	    test_ret++;
46247             printf(" %d", n_node);
46248             printf("\n");
46249         }
46250     }
46251     function_tests++;
46252 #endif
46253 
46254     return(test_ret);
46255 }
46256 
46257 
46258 static int
test_xmlXPathCastNodeToString(void)46259 test_xmlXPathCastNodeToString(void) {
46260     int test_ret = 0;
46261 
46262 #if defined(LIBXML_XPATH_ENABLED)
46263     int mem_base;
46264     xmlChar * ret_val;
46265     xmlNodePtr node; /* a node */
46266     int n_node;
46267 
46268     for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
46269         mem_base = xmlMemBlocks();
46270         node = gen_xmlNodePtr(n_node, 0);
46271 
46272         ret_val = xmlXPathCastNodeToString(node);
46273         desret_xmlChar_ptr(ret_val);
46274         call_tests++;
46275         des_xmlNodePtr(n_node, node, 0);
46276         xmlResetLastError();
46277         if (mem_base != xmlMemBlocks()) {
46278             printf("Leak of %d blocks found in xmlXPathCastNodeToString",
46279 	           xmlMemBlocks() - mem_base);
46280 	    test_ret++;
46281             printf(" %d", n_node);
46282             printf("\n");
46283         }
46284     }
46285     function_tests++;
46286 #endif
46287 
46288     return(test_ret);
46289 }
46290 
46291 
46292 static int
test_xmlXPathCastNumberToBoolean(void)46293 test_xmlXPathCastNumberToBoolean(void) {
46294     int test_ret = 0;
46295 
46296 #if defined(LIBXML_XPATH_ENABLED)
46297     int mem_base;
46298     int ret_val;
46299     double val; /* a number */
46300     int n_val;
46301 
46302     for (n_val = 0;n_val < gen_nb_double;n_val++) {
46303         mem_base = xmlMemBlocks();
46304         val = gen_double(n_val, 0);
46305 
46306         ret_val = xmlXPathCastNumberToBoolean(val);
46307         desret_int(ret_val);
46308         call_tests++;
46309         des_double(n_val, val, 0);
46310         xmlResetLastError();
46311         if (mem_base != xmlMemBlocks()) {
46312             printf("Leak of %d blocks found in xmlXPathCastNumberToBoolean",
46313 	           xmlMemBlocks() - mem_base);
46314 	    test_ret++;
46315             printf(" %d", n_val);
46316             printf("\n");
46317         }
46318     }
46319     function_tests++;
46320 #endif
46321 
46322     return(test_ret);
46323 }
46324 
46325 
46326 static int
test_xmlXPathCastNumberToString(void)46327 test_xmlXPathCastNumberToString(void) {
46328     int test_ret = 0;
46329 
46330 #if defined(LIBXML_XPATH_ENABLED)
46331     int mem_base;
46332     xmlChar * ret_val;
46333     double val; /* a number */
46334     int n_val;
46335 
46336     for (n_val = 0;n_val < gen_nb_double;n_val++) {
46337         mem_base = xmlMemBlocks();
46338         val = gen_double(n_val, 0);
46339 
46340         ret_val = xmlXPathCastNumberToString(val);
46341         desret_xmlChar_ptr(ret_val);
46342         call_tests++;
46343         des_double(n_val, val, 0);
46344         xmlResetLastError();
46345         if (mem_base != xmlMemBlocks()) {
46346             printf("Leak of %d blocks found in xmlXPathCastNumberToString",
46347 	           xmlMemBlocks() - mem_base);
46348 	    test_ret++;
46349             printf(" %d", n_val);
46350             printf("\n");
46351         }
46352     }
46353     function_tests++;
46354 #endif
46355 
46356     return(test_ret);
46357 }
46358 
46359 
46360 static int
test_xmlXPathCastStringToBoolean(void)46361 test_xmlXPathCastStringToBoolean(void) {
46362     int test_ret = 0;
46363 
46364 #if defined(LIBXML_XPATH_ENABLED)
46365     int mem_base;
46366     int ret_val;
46367     xmlChar * val; /* a string */
46368     int n_val;
46369 
46370     for (n_val = 0;n_val < gen_nb_const_xmlChar_ptr;n_val++) {
46371         mem_base = xmlMemBlocks();
46372         val = gen_const_xmlChar_ptr(n_val, 0);
46373 
46374         ret_val = xmlXPathCastStringToBoolean((const xmlChar *)val);
46375         desret_int(ret_val);
46376         call_tests++;
46377         des_const_xmlChar_ptr(n_val, (const xmlChar *)val, 0);
46378         xmlResetLastError();
46379         if (mem_base != xmlMemBlocks()) {
46380             printf("Leak of %d blocks found in xmlXPathCastStringToBoolean",
46381 	           xmlMemBlocks() - mem_base);
46382 	    test_ret++;
46383             printf(" %d", n_val);
46384             printf("\n");
46385         }
46386     }
46387     function_tests++;
46388 #endif
46389 
46390     return(test_ret);
46391 }
46392 
46393 
46394 static int
test_xmlXPathCastStringToNumber(void)46395 test_xmlXPathCastStringToNumber(void) {
46396     int test_ret = 0;
46397 
46398 #if defined(LIBXML_XPATH_ENABLED)
46399     int mem_base;
46400     double ret_val;
46401     xmlChar * val; /* a string */
46402     int n_val;
46403 
46404     for (n_val = 0;n_val < gen_nb_const_xmlChar_ptr;n_val++) {
46405         mem_base = xmlMemBlocks();
46406         val = gen_const_xmlChar_ptr(n_val, 0);
46407 
46408         ret_val = xmlXPathCastStringToNumber((const xmlChar *)val);
46409         desret_double(ret_val);
46410         call_tests++;
46411         des_const_xmlChar_ptr(n_val, (const xmlChar *)val, 0);
46412         xmlResetLastError();
46413         if (mem_base != xmlMemBlocks()) {
46414             printf("Leak of %d blocks found in xmlXPathCastStringToNumber",
46415 	           xmlMemBlocks() - mem_base);
46416 	    test_ret++;
46417             printf(" %d", n_val);
46418             printf("\n");
46419         }
46420     }
46421     function_tests++;
46422 #endif
46423 
46424     return(test_ret);
46425 }
46426 
46427 
46428 static int
test_xmlXPathCastToBoolean(void)46429 test_xmlXPathCastToBoolean(void) {
46430     int test_ret = 0;
46431 
46432 #if defined(LIBXML_XPATH_ENABLED)
46433     int mem_base;
46434     int ret_val;
46435     xmlXPathObjectPtr val; /* an XPath object */
46436     int n_val;
46437 
46438     for (n_val = 0;n_val < gen_nb_xmlXPathObjectPtr;n_val++) {
46439         mem_base = xmlMemBlocks();
46440         val = gen_xmlXPathObjectPtr(n_val, 0);
46441 
46442         ret_val = xmlXPathCastToBoolean(val);
46443         desret_int(ret_val);
46444         call_tests++;
46445         des_xmlXPathObjectPtr(n_val, val, 0);
46446         xmlResetLastError();
46447         if (mem_base != xmlMemBlocks()) {
46448             printf("Leak of %d blocks found in xmlXPathCastToBoolean",
46449 	           xmlMemBlocks() - mem_base);
46450 	    test_ret++;
46451             printf(" %d", n_val);
46452             printf("\n");
46453         }
46454     }
46455     function_tests++;
46456 #endif
46457 
46458     return(test_ret);
46459 }
46460 
46461 
46462 static int
test_xmlXPathCastToNumber(void)46463 test_xmlXPathCastToNumber(void) {
46464     int test_ret = 0;
46465 
46466 #if defined(LIBXML_XPATH_ENABLED)
46467     int mem_base;
46468     double ret_val;
46469     xmlXPathObjectPtr val; /* an XPath object */
46470     int n_val;
46471 
46472     for (n_val = 0;n_val < gen_nb_xmlXPathObjectPtr;n_val++) {
46473         mem_base = xmlMemBlocks();
46474         val = gen_xmlXPathObjectPtr(n_val, 0);
46475 
46476         ret_val = xmlXPathCastToNumber(val);
46477         desret_double(ret_val);
46478         call_tests++;
46479         des_xmlXPathObjectPtr(n_val, val, 0);
46480         xmlResetLastError();
46481         if (mem_base != xmlMemBlocks()) {
46482             printf("Leak of %d blocks found in xmlXPathCastToNumber",
46483 	           xmlMemBlocks() - mem_base);
46484 	    test_ret++;
46485             printf(" %d", n_val);
46486             printf("\n");
46487         }
46488     }
46489     function_tests++;
46490 #endif
46491 
46492     return(test_ret);
46493 }
46494 
46495 
46496 static int
test_xmlXPathCastToString(void)46497 test_xmlXPathCastToString(void) {
46498     int test_ret = 0;
46499 
46500 #if defined(LIBXML_XPATH_ENABLED)
46501     int mem_base;
46502     xmlChar * ret_val;
46503     xmlXPathObjectPtr val; /* an XPath object */
46504     int n_val;
46505 
46506     for (n_val = 0;n_val < gen_nb_xmlXPathObjectPtr;n_val++) {
46507         mem_base = xmlMemBlocks();
46508         val = gen_xmlXPathObjectPtr(n_val, 0);
46509 
46510         ret_val = xmlXPathCastToString(val);
46511         desret_xmlChar_ptr(ret_val);
46512         call_tests++;
46513         des_xmlXPathObjectPtr(n_val, val, 0);
46514         xmlResetLastError();
46515         if (mem_base != xmlMemBlocks()) {
46516             printf("Leak of %d blocks found in xmlXPathCastToString",
46517 	           xmlMemBlocks() - mem_base);
46518 	    test_ret++;
46519             printf(" %d", n_val);
46520             printf("\n");
46521         }
46522     }
46523     function_tests++;
46524 #endif
46525 
46526     return(test_ret);
46527 }
46528 
46529 
46530 static int
test_xmlXPathCmpNodes(void)46531 test_xmlXPathCmpNodes(void) {
46532     int test_ret = 0;
46533 
46534 #if defined(LIBXML_XPATH_ENABLED)
46535     int mem_base;
46536     int ret_val;
46537     xmlNodePtr node1; /* the first node */
46538     int n_node1;
46539     xmlNodePtr node2; /* the second node */
46540     int n_node2;
46541 
46542     for (n_node1 = 0;n_node1 < gen_nb_xmlNodePtr;n_node1++) {
46543     for (n_node2 = 0;n_node2 < gen_nb_xmlNodePtr;n_node2++) {
46544         mem_base = xmlMemBlocks();
46545         node1 = gen_xmlNodePtr(n_node1, 0);
46546         node2 = gen_xmlNodePtr(n_node2, 1);
46547 
46548         ret_val = xmlXPathCmpNodes(node1, node2);
46549         desret_int(ret_val);
46550         call_tests++;
46551         des_xmlNodePtr(n_node1, node1, 0);
46552         des_xmlNodePtr(n_node2, node2, 1);
46553         xmlResetLastError();
46554         if (mem_base != xmlMemBlocks()) {
46555             printf("Leak of %d blocks found in xmlXPathCmpNodes",
46556 	           xmlMemBlocks() - mem_base);
46557 	    test_ret++;
46558             printf(" %d", n_node1);
46559             printf(" %d", n_node2);
46560             printf("\n");
46561         }
46562     }
46563     }
46564     function_tests++;
46565 #endif
46566 
46567     return(test_ret);
46568 }
46569 
46570 
46571 static int
test_xmlXPathCompile(void)46572 test_xmlXPathCompile(void) {
46573     int test_ret = 0;
46574 
46575 
46576     /* missing type support */
46577     return(test_ret);
46578 }
46579 
46580 #ifdef LIBXML_XPATH_ENABLED
46581 
46582 #define gen_nb_xmlXPathCompExprPtr 1
gen_xmlXPathCompExprPtr(int no ATTRIBUTE_UNUSED,int nr ATTRIBUTE_UNUSED)46583 static xmlXPathCompExprPtr gen_xmlXPathCompExprPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
46584     return(NULL);
46585 }
des_xmlXPathCompExprPtr(int no ATTRIBUTE_UNUSED,xmlXPathCompExprPtr val ATTRIBUTE_UNUSED,int nr ATTRIBUTE_UNUSED)46586 static void des_xmlXPathCompExprPtr(int no ATTRIBUTE_UNUSED, xmlXPathCompExprPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
46587 }
46588 #endif
46589 
46590 #ifdef LIBXML_XPATH_ENABLED
46591 
46592 #define gen_nb_xmlXPathContextPtr 1
gen_xmlXPathContextPtr(int no ATTRIBUTE_UNUSED,int nr ATTRIBUTE_UNUSED)46593 static xmlXPathContextPtr gen_xmlXPathContextPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
46594     return(NULL);
46595 }
des_xmlXPathContextPtr(int no ATTRIBUTE_UNUSED,xmlXPathContextPtr val ATTRIBUTE_UNUSED,int nr ATTRIBUTE_UNUSED)46596 static void des_xmlXPathContextPtr(int no ATTRIBUTE_UNUSED, xmlXPathContextPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
46597 }
46598 #endif
46599 
46600 
46601 static int
test_xmlXPathCompiledEval(void)46602 test_xmlXPathCompiledEval(void) {
46603     int test_ret = 0;
46604 
46605 #if defined(LIBXML_XPATH_ENABLED)
46606     int mem_base;
46607     xmlXPathObjectPtr ret_val;
46608     xmlXPathCompExprPtr comp; /* the compiled XPath expression */
46609     int n_comp;
46610     xmlXPathContextPtr ctx; /* the XPath context */
46611     int n_ctx;
46612 
46613     for (n_comp = 0;n_comp < gen_nb_xmlXPathCompExprPtr;n_comp++) {
46614     for (n_ctx = 0;n_ctx < gen_nb_xmlXPathContextPtr;n_ctx++) {
46615         mem_base = xmlMemBlocks();
46616         comp = gen_xmlXPathCompExprPtr(n_comp, 0);
46617         ctx = gen_xmlXPathContextPtr(n_ctx, 1);
46618 
46619         ret_val = xmlXPathCompiledEval(comp, ctx);
46620         desret_xmlXPathObjectPtr(ret_val);
46621         call_tests++;
46622         des_xmlXPathCompExprPtr(n_comp, comp, 0);
46623         des_xmlXPathContextPtr(n_ctx, ctx, 1);
46624         xmlResetLastError();
46625         if (mem_base != xmlMemBlocks()) {
46626             printf("Leak of %d blocks found in xmlXPathCompiledEval",
46627 	           xmlMemBlocks() - mem_base);
46628 	    test_ret++;
46629             printf(" %d", n_comp);
46630             printf(" %d", n_ctx);
46631             printf("\n");
46632         }
46633     }
46634     }
46635     function_tests++;
46636 #endif
46637 
46638     return(test_ret);
46639 }
46640 
46641 
46642 static int
test_xmlXPathCompiledEvalToBoolean(void)46643 test_xmlXPathCompiledEvalToBoolean(void) {
46644     int test_ret = 0;
46645 
46646 #if defined(LIBXML_XPATH_ENABLED)
46647     int mem_base;
46648     int ret_val;
46649     xmlXPathCompExprPtr comp; /* the compiled XPath expression */
46650     int n_comp;
46651     xmlXPathContextPtr ctxt; /* the XPath context */
46652     int n_ctxt;
46653 
46654     for (n_comp = 0;n_comp < gen_nb_xmlXPathCompExprPtr;n_comp++) {
46655     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathContextPtr;n_ctxt++) {
46656         mem_base = xmlMemBlocks();
46657         comp = gen_xmlXPathCompExprPtr(n_comp, 0);
46658         ctxt = gen_xmlXPathContextPtr(n_ctxt, 1);
46659 
46660         ret_val = xmlXPathCompiledEvalToBoolean(comp, ctxt);
46661         desret_int(ret_val);
46662         call_tests++;
46663         des_xmlXPathCompExprPtr(n_comp, comp, 0);
46664         des_xmlXPathContextPtr(n_ctxt, ctxt, 1);
46665         xmlResetLastError();
46666         if (mem_base != xmlMemBlocks()) {
46667             printf("Leak of %d blocks found in xmlXPathCompiledEvalToBoolean",
46668 	           xmlMemBlocks() - mem_base);
46669 	    test_ret++;
46670             printf(" %d", n_comp);
46671             printf(" %d", n_ctxt);
46672             printf("\n");
46673         }
46674     }
46675     }
46676     function_tests++;
46677 #endif
46678 
46679     return(test_ret);
46680 }
46681 
46682 
46683 static int
test_xmlXPathContextSetCache(void)46684 test_xmlXPathContextSetCache(void) {
46685     int test_ret = 0;
46686 
46687 #if defined(LIBXML_XPATH_ENABLED)
46688     int mem_base;
46689     int ret_val;
46690     xmlXPathContextPtr ctxt; /* the XPath context */
46691     int n_ctxt;
46692     int active; /* enables/disables (creates/frees) the cache */
46693     int n_active;
46694     int value; /* a value with semantics dependent on @options */
46695     int n_value;
46696     int options; /* options (currently only the value 0 is used) */
46697     int n_options;
46698 
46699     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathContextPtr;n_ctxt++) {
46700     for (n_active = 0;n_active < gen_nb_int;n_active++) {
46701     for (n_value = 0;n_value < gen_nb_int;n_value++) {
46702     for (n_options = 0;n_options < gen_nb_int;n_options++) {
46703         mem_base = xmlMemBlocks();
46704         ctxt = gen_xmlXPathContextPtr(n_ctxt, 0);
46705         active = gen_int(n_active, 1);
46706         value = gen_int(n_value, 2);
46707         options = gen_int(n_options, 3);
46708 
46709         ret_val = xmlXPathContextSetCache(ctxt, active, value, options);
46710         desret_int(ret_val);
46711         call_tests++;
46712         des_xmlXPathContextPtr(n_ctxt, ctxt, 0);
46713         des_int(n_active, active, 1);
46714         des_int(n_value, value, 2);
46715         des_int(n_options, options, 3);
46716         xmlResetLastError();
46717         if (mem_base != xmlMemBlocks()) {
46718             printf("Leak of %d blocks found in xmlXPathContextSetCache",
46719 	           xmlMemBlocks() - mem_base);
46720 	    test_ret++;
46721             printf(" %d", n_ctxt);
46722             printf(" %d", n_active);
46723             printf(" %d", n_value);
46724             printf(" %d", n_options);
46725             printf("\n");
46726         }
46727     }
46728     }
46729     }
46730     }
46731     function_tests++;
46732 #endif
46733 
46734     return(test_ret);
46735 }
46736 
46737 
46738 static int
test_xmlXPathConvertBoolean(void)46739 test_xmlXPathConvertBoolean(void) {
46740     int test_ret = 0;
46741 
46742 #if defined(LIBXML_XPATH_ENABLED)
46743     int mem_base;
46744     xmlXPathObjectPtr ret_val;
46745     xmlXPathObjectPtr val; /* an XPath object */
46746     int n_val;
46747 
46748     for (n_val = 0;n_val < gen_nb_xmlXPathObjectPtr;n_val++) {
46749         mem_base = xmlMemBlocks();
46750         val = gen_xmlXPathObjectPtr(n_val, 0);
46751 
46752         ret_val = xmlXPathConvertBoolean(val);
46753         val = NULL;
46754         desret_xmlXPathObjectPtr(ret_val);
46755         call_tests++;
46756         des_xmlXPathObjectPtr(n_val, val, 0);
46757         xmlResetLastError();
46758         if (mem_base != xmlMemBlocks()) {
46759             printf("Leak of %d blocks found in xmlXPathConvertBoolean",
46760 	           xmlMemBlocks() - mem_base);
46761 	    test_ret++;
46762             printf(" %d", n_val);
46763             printf("\n");
46764         }
46765     }
46766     function_tests++;
46767 #endif
46768 
46769     return(test_ret);
46770 }
46771 
46772 
46773 static int
test_xmlXPathConvertNumber(void)46774 test_xmlXPathConvertNumber(void) {
46775     int test_ret = 0;
46776 
46777 #if defined(LIBXML_XPATH_ENABLED)
46778     int mem_base;
46779     xmlXPathObjectPtr ret_val;
46780     xmlXPathObjectPtr val; /* an XPath object */
46781     int n_val;
46782 
46783     for (n_val = 0;n_val < gen_nb_xmlXPathObjectPtr;n_val++) {
46784         mem_base = xmlMemBlocks();
46785         val = gen_xmlXPathObjectPtr(n_val, 0);
46786 
46787         ret_val = xmlXPathConvertNumber(val);
46788         val = NULL;
46789         desret_xmlXPathObjectPtr(ret_val);
46790         call_tests++;
46791         des_xmlXPathObjectPtr(n_val, val, 0);
46792         xmlResetLastError();
46793         if (mem_base != xmlMemBlocks()) {
46794             printf("Leak of %d blocks found in xmlXPathConvertNumber",
46795 	           xmlMemBlocks() - mem_base);
46796 	    test_ret++;
46797             printf(" %d", n_val);
46798             printf("\n");
46799         }
46800     }
46801     function_tests++;
46802 #endif
46803 
46804     return(test_ret);
46805 }
46806 
46807 
46808 static int
test_xmlXPathConvertString(void)46809 test_xmlXPathConvertString(void) {
46810     int test_ret = 0;
46811 
46812 #if defined(LIBXML_XPATH_ENABLED)
46813     int mem_base;
46814     xmlXPathObjectPtr ret_val;
46815     xmlXPathObjectPtr val; /* an XPath object */
46816     int n_val;
46817 
46818     for (n_val = 0;n_val < gen_nb_xmlXPathObjectPtr;n_val++) {
46819         mem_base = xmlMemBlocks();
46820         val = gen_xmlXPathObjectPtr(n_val, 0);
46821 
46822         ret_val = xmlXPathConvertString(val);
46823         val = NULL;
46824         desret_xmlXPathObjectPtr(ret_val);
46825         call_tests++;
46826         des_xmlXPathObjectPtr(n_val, val, 0);
46827         xmlResetLastError();
46828         if (mem_base != xmlMemBlocks()) {
46829             printf("Leak of %d blocks found in xmlXPathConvertString",
46830 	           xmlMemBlocks() - mem_base);
46831 	    test_ret++;
46832             printf(" %d", n_val);
46833             printf("\n");
46834         }
46835     }
46836     function_tests++;
46837 #endif
46838 
46839     return(test_ret);
46840 }
46841 
46842 
46843 static int
test_xmlXPathCtxtCompile(void)46844 test_xmlXPathCtxtCompile(void) {
46845     int test_ret = 0;
46846 
46847 
46848     /* missing type support */
46849     return(test_ret);
46850 }
46851 
46852 
46853 static int
test_xmlXPathEval(void)46854 test_xmlXPathEval(void) {
46855     int test_ret = 0;
46856 
46857 #if defined(LIBXML_XPATH_ENABLED)
46858     int mem_base;
46859     xmlXPathObjectPtr ret_val;
46860     xmlChar * str; /* the XPath expression */
46861     int n_str;
46862     xmlXPathContextPtr ctx; /* the XPath context */
46863     int n_ctx;
46864 
46865     for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) {
46866     for (n_ctx = 0;n_ctx < gen_nb_xmlXPathContextPtr;n_ctx++) {
46867         mem_base = xmlMemBlocks();
46868         str = gen_const_xmlChar_ptr(n_str, 0);
46869         ctx = gen_xmlXPathContextPtr(n_ctx, 1);
46870 
46871         ret_val = xmlXPathEval((const xmlChar *)str, ctx);
46872         desret_xmlXPathObjectPtr(ret_val);
46873         call_tests++;
46874         des_const_xmlChar_ptr(n_str, (const xmlChar *)str, 0);
46875         des_xmlXPathContextPtr(n_ctx, ctx, 1);
46876         xmlResetLastError();
46877         if (mem_base != xmlMemBlocks()) {
46878             printf("Leak of %d blocks found in xmlXPathEval",
46879 	           xmlMemBlocks() - mem_base);
46880 	    test_ret++;
46881             printf(" %d", n_str);
46882             printf(" %d", n_ctx);
46883             printf("\n");
46884         }
46885     }
46886     }
46887     function_tests++;
46888 #endif
46889 
46890     return(test_ret);
46891 }
46892 
46893 
46894 static int
test_xmlXPathEvalExpression(void)46895 test_xmlXPathEvalExpression(void) {
46896     int test_ret = 0;
46897 
46898 #if defined(LIBXML_XPATH_ENABLED)
46899     int mem_base;
46900     xmlXPathObjectPtr ret_val;
46901     xmlChar * str; /* the XPath expression */
46902     int n_str;
46903     xmlXPathContextPtr ctxt; /* the XPath context */
46904     int n_ctxt;
46905 
46906     for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) {
46907     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathContextPtr;n_ctxt++) {
46908         mem_base = xmlMemBlocks();
46909         str = gen_const_xmlChar_ptr(n_str, 0);
46910         ctxt = gen_xmlXPathContextPtr(n_ctxt, 1);
46911 
46912         ret_val = xmlXPathEvalExpression((const xmlChar *)str, ctxt);
46913         desret_xmlXPathObjectPtr(ret_val);
46914         call_tests++;
46915         des_const_xmlChar_ptr(n_str, (const xmlChar *)str, 0);
46916         des_xmlXPathContextPtr(n_ctxt, ctxt, 1);
46917         xmlResetLastError();
46918         if (mem_base != xmlMemBlocks()) {
46919             printf("Leak of %d blocks found in xmlXPathEvalExpression",
46920 	           xmlMemBlocks() - mem_base);
46921 	    test_ret++;
46922             printf(" %d", n_str);
46923             printf(" %d", n_ctxt);
46924             printf("\n");
46925         }
46926     }
46927     }
46928     function_tests++;
46929 #endif
46930 
46931     return(test_ret);
46932 }
46933 
46934 
46935 static int
test_xmlXPathEvalPredicate(void)46936 test_xmlXPathEvalPredicate(void) {
46937     int test_ret = 0;
46938 
46939 #if defined(LIBXML_XPATH_ENABLED)
46940     int mem_base;
46941     int ret_val;
46942     xmlXPathContextPtr ctxt; /* the XPath context */
46943     int n_ctxt;
46944     xmlXPathObjectPtr res; /* the Predicate Expression evaluation result */
46945     int n_res;
46946 
46947     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathContextPtr;n_ctxt++) {
46948     for (n_res = 0;n_res < gen_nb_xmlXPathObjectPtr;n_res++) {
46949         mem_base = xmlMemBlocks();
46950         ctxt = gen_xmlXPathContextPtr(n_ctxt, 0);
46951         res = gen_xmlXPathObjectPtr(n_res, 1);
46952 
46953         ret_val = xmlXPathEvalPredicate(ctxt, res);
46954         desret_int(ret_val);
46955         call_tests++;
46956         des_xmlXPathContextPtr(n_ctxt, ctxt, 0);
46957         des_xmlXPathObjectPtr(n_res, res, 1);
46958         xmlResetLastError();
46959         if (mem_base != xmlMemBlocks()) {
46960             printf("Leak of %d blocks found in xmlXPathEvalPredicate",
46961 	           xmlMemBlocks() - mem_base);
46962 	    test_ret++;
46963             printf(" %d", n_ctxt);
46964             printf(" %d", n_res);
46965             printf("\n");
46966         }
46967     }
46968     }
46969     function_tests++;
46970 #endif
46971 
46972     return(test_ret);
46973 }
46974 
46975 
46976 static int
test_xmlXPathInit(void)46977 test_xmlXPathInit(void) {
46978     int test_ret = 0;
46979 
46980 #if defined(LIBXML_XPATH_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED)
46981     int mem_base;
46982 
46983         mem_base = xmlMemBlocks();
46984 
46985         xmlXPathInit();
46986         call_tests++;
46987         xmlResetLastError();
46988         if (mem_base != xmlMemBlocks()) {
46989             printf("Leak of %d blocks found in xmlXPathInit",
46990 	           xmlMemBlocks() - mem_base);
46991 	    test_ret++;
46992             printf("\n");
46993         }
46994     function_tests++;
46995 #endif
46996 
46997     return(test_ret);
46998 }
46999 
47000 
47001 static int
test_xmlXPathIsInf(void)47002 test_xmlXPathIsInf(void) {
47003     int test_ret = 0;
47004 
47005 #if defined(LIBXML_XPATH_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED)
47006     int mem_base;
47007     int ret_val;
47008     double val; /* a double value */
47009     int n_val;
47010 
47011     for (n_val = 0;n_val < gen_nb_double;n_val++) {
47012         mem_base = xmlMemBlocks();
47013         val = gen_double(n_val, 0);
47014 
47015         ret_val = xmlXPathIsInf(val);
47016         desret_int(ret_val);
47017         call_tests++;
47018         des_double(n_val, val, 0);
47019         xmlResetLastError();
47020         if (mem_base != xmlMemBlocks()) {
47021             printf("Leak of %d blocks found in xmlXPathIsInf",
47022 	           xmlMemBlocks() - mem_base);
47023 	    test_ret++;
47024             printf(" %d", n_val);
47025             printf("\n");
47026         }
47027     }
47028     function_tests++;
47029 #endif
47030 
47031     return(test_ret);
47032 }
47033 
47034 
47035 static int
test_xmlXPathIsNaN(void)47036 test_xmlXPathIsNaN(void) {
47037     int test_ret = 0;
47038 
47039 #if defined(LIBXML_XPATH_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED)
47040     int mem_base;
47041     int ret_val;
47042     double val; /* a double value */
47043     int n_val;
47044 
47045     for (n_val = 0;n_val < gen_nb_double;n_val++) {
47046         mem_base = xmlMemBlocks();
47047         val = gen_double(n_val, 0);
47048 
47049         ret_val = xmlXPathIsNaN(val);
47050         desret_int(ret_val);
47051         call_tests++;
47052         des_double(n_val, val, 0);
47053         xmlResetLastError();
47054         if (mem_base != xmlMemBlocks()) {
47055             printf("Leak of %d blocks found in xmlXPathIsNaN",
47056 	           xmlMemBlocks() - mem_base);
47057 	    test_ret++;
47058             printf(" %d", n_val);
47059             printf("\n");
47060         }
47061     }
47062     function_tests++;
47063 #endif
47064 
47065     return(test_ret);
47066 }
47067 
47068 
47069 static int
test_xmlXPathNewContext(void)47070 test_xmlXPathNewContext(void) {
47071     int test_ret = 0;
47072 
47073 
47074     /* missing type support */
47075     return(test_ret);
47076 }
47077 
47078 
47079 static int
test_xmlXPathNodeEval(void)47080 test_xmlXPathNodeEval(void) {
47081     int test_ret = 0;
47082 
47083 #if defined(LIBXML_XPATH_ENABLED)
47084     int mem_base;
47085     xmlXPathObjectPtr ret_val;
47086     xmlNodePtr node; /* the node to to use as the context node */
47087     int n_node;
47088     xmlChar * str; /* the XPath expression */
47089     int n_str;
47090     xmlXPathContextPtr ctx; /* the XPath context */
47091     int n_ctx;
47092 
47093     for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
47094     for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) {
47095     for (n_ctx = 0;n_ctx < gen_nb_xmlXPathContextPtr;n_ctx++) {
47096         mem_base = xmlMemBlocks();
47097         node = gen_xmlNodePtr(n_node, 0);
47098         str = gen_const_xmlChar_ptr(n_str, 1);
47099         ctx = gen_xmlXPathContextPtr(n_ctx, 2);
47100 
47101         ret_val = xmlXPathNodeEval(node, (const xmlChar *)str, ctx);
47102         desret_xmlXPathObjectPtr(ret_val);
47103         call_tests++;
47104         des_xmlNodePtr(n_node, node, 0);
47105         des_const_xmlChar_ptr(n_str, (const xmlChar *)str, 1);
47106         des_xmlXPathContextPtr(n_ctx, ctx, 2);
47107         xmlResetLastError();
47108         if (mem_base != xmlMemBlocks()) {
47109             printf("Leak of %d blocks found in xmlXPathNodeEval",
47110 	           xmlMemBlocks() - mem_base);
47111 	    test_ret++;
47112             printf(" %d", n_node);
47113             printf(" %d", n_str);
47114             printf(" %d", n_ctx);
47115             printf("\n");
47116         }
47117     }
47118     }
47119     }
47120     function_tests++;
47121 #endif
47122 
47123     return(test_ret);
47124 }
47125 
47126 
47127 static int
test_xmlXPathNodeSetCreate(void)47128 test_xmlXPathNodeSetCreate(void) {
47129     int test_ret = 0;
47130 
47131 #if defined(LIBXML_XPATH_ENABLED)
47132     int mem_base;
47133     xmlNodeSetPtr ret_val;
47134     xmlNodePtr val; /* an initial xmlNodePtr, or NULL */
47135     int n_val;
47136 
47137     for (n_val = 0;n_val < gen_nb_xmlNodePtr;n_val++) {
47138         mem_base = xmlMemBlocks();
47139         val = gen_xmlNodePtr(n_val, 0);
47140 
47141         ret_val = xmlXPathNodeSetCreate(val);
47142         desret_xmlNodeSetPtr(ret_val);
47143         call_tests++;
47144         des_xmlNodePtr(n_val, val, 0);
47145         xmlResetLastError();
47146         if (mem_base != xmlMemBlocks()) {
47147             printf("Leak of %d blocks found in xmlXPathNodeSetCreate",
47148 	           xmlMemBlocks() - mem_base);
47149 	    test_ret++;
47150             printf(" %d", n_val);
47151             printf("\n");
47152         }
47153     }
47154     function_tests++;
47155 #endif
47156 
47157     return(test_ret);
47158 }
47159 
47160 
47161 static int
test_xmlXPathObjectCopy(void)47162 test_xmlXPathObjectCopy(void) {
47163     int test_ret = 0;
47164 
47165 #if defined(LIBXML_XPATH_ENABLED)
47166     int mem_base;
47167     xmlXPathObjectPtr ret_val;
47168     xmlXPathObjectPtr val; /* the original object */
47169     int n_val;
47170 
47171     for (n_val = 0;n_val < gen_nb_xmlXPathObjectPtr;n_val++) {
47172         mem_base = xmlMemBlocks();
47173         val = gen_xmlXPathObjectPtr(n_val, 0);
47174 
47175         ret_val = xmlXPathObjectCopy(val);
47176         desret_xmlXPathObjectPtr(ret_val);
47177         call_tests++;
47178         des_xmlXPathObjectPtr(n_val, val, 0);
47179         xmlResetLastError();
47180         if (mem_base != xmlMemBlocks()) {
47181             printf("Leak of %d blocks found in xmlXPathObjectCopy",
47182 	           xmlMemBlocks() - mem_base);
47183 	    test_ret++;
47184             printf(" %d", n_val);
47185             printf("\n");
47186         }
47187     }
47188     function_tests++;
47189 #endif
47190 
47191     return(test_ret);
47192 }
47193 
47194 
47195 static int
test_xmlXPathOrderDocElems(void)47196 test_xmlXPathOrderDocElems(void) {
47197     int test_ret = 0;
47198 
47199 #if defined(LIBXML_XPATH_ENABLED)
47200     int mem_base;
47201     long ret_val;
47202     xmlDocPtr doc; /* an input document */
47203     int n_doc;
47204 
47205     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
47206         mem_base = xmlMemBlocks();
47207         doc = gen_xmlDocPtr(n_doc, 0);
47208 
47209         ret_val = xmlXPathOrderDocElems(doc);
47210         desret_long(ret_val);
47211         call_tests++;
47212         des_xmlDocPtr(n_doc, doc, 0);
47213         xmlResetLastError();
47214         if (mem_base != xmlMemBlocks()) {
47215             printf("Leak of %d blocks found in xmlXPathOrderDocElems",
47216 	           xmlMemBlocks() - mem_base);
47217 	    test_ret++;
47218             printf(" %d", n_doc);
47219             printf("\n");
47220         }
47221     }
47222     function_tests++;
47223 #endif
47224 
47225     return(test_ret);
47226 }
47227 
47228 
47229 static int
test_xmlXPathSetContextNode(void)47230 test_xmlXPathSetContextNode(void) {
47231     int test_ret = 0;
47232 
47233 #if defined(LIBXML_XPATH_ENABLED)
47234     int mem_base;
47235     int ret_val;
47236     xmlNodePtr node; /* the node to to use as the context node */
47237     int n_node;
47238     xmlXPathContextPtr ctx; /* the XPath context */
47239     int n_ctx;
47240 
47241     for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
47242     for (n_ctx = 0;n_ctx < gen_nb_xmlXPathContextPtr;n_ctx++) {
47243         mem_base = xmlMemBlocks();
47244         node = gen_xmlNodePtr(n_node, 0);
47245         ctx = gen_xmlXPathContextPtr(n_ctx, 1);
47246 
47247         ret_val = xmlXPathSetContextNode(node, ctx);
47248         desret_int(ret_val);
47249         call_tests++;
47250         des_xmlNodePtr(n_node, node, 0);
47251         des_xmlXPathContextPtr(n_ctx, ctx, 1);
47252         xmlResetLastError();
47253         if (mem_base != xmlMemBlocks()) {
47254             printf("Leak of %d blocks found in xmlXPathSetContextNode",
47255 	           xmlMemBlocks() - mem_base);
47256 	    test_ret++;
47257             printf(" %d", n_node);
47258             printf(" %d", n_ctx);
47259             printf("\n");
47260         }
47261     }
47262     }
47263     function_tests++;
47264 #endif
47265 
47266     return(test_ret);
47267 }
47268 
47269 static int
test_xpath(void)47270 test_xpath(void) {
47271     int test_ret = 0;
47272 
47273     if (quiet == 0) printf("Testing xpath : 32 of 40 functions ...\n");
47274     test_ret += test_xmlXPathCastBooleanToNumber();
47275     test_ret += test_xmlXPathCastBooleanToString();
47276     test_ret += test_xmlXPathCastNodeSetToBoolean();
47277     test_ret += test_xmlXPathCastNodeSetToNumber();
47278     test_ret += test_xmlXPathCastNodeSetToString();
47279     test_ret += test_xmlXPathCastNodeToNumber();
47280     test_ret += test_xmlXPathCastNodeToString();
47281     test_ret += test_xmlXPathCastNumberToBoolean();
47282     test_ret += test_xmlXPathCastNumberToString();
47283     test_ret += test_xmlXPathCastStringToBoolean();
47284     test_ret += test_xmlXPathCastStringToNumber();
47285     test_ret += test_xmlXPathCastToBoolean();
47286     test_ret += test_xmlXPathCastToNumber();
47287     test_ret += test_xmlXPathCastToString();
47288     test_ret += test_xmlXPathCmpNodes();
47289     test_ret += test_xmlXPathCompile();
47290     test_ret += test_xmlXPathCompiledEval();
47291     test_ret += test_xmlXPathCompiledEvalToBoolean();
47292     test_ret += test_xmlXPathContextSetCache();
47293     test_ret += test_xmlXPathConvertBoolean();
47294     test_ret += test_xmlXPathConvertNumber();
47295     test_ret += test_xmlXPathConvertString();
47296     test_ret += test_xmlXPathCtxtCompile();
47297     test_ret += test_xmlXPathEval();
47298     test_ret += test_xmlXPathEvalExpression();
47299     test_ret += test_xmlXPathEvalPredicate();
47300     test_ret += test_xmlXPathInit();
47301     test_ret += test_xmlXPathIsInf();
47302     test_ret += test_xmlXPathIsNaN();
47303     test_ret += test_xmlXPathNewContext();
47304     test_ret += test_xmlXPathNodeEval();
47305     test_ret += test_xmlXPathNodeSetCreate();
47306     test_ret += test_xmlXPathObjectCopy();
47307     test_ret += test_xmlXPathOrderDocElems();
47308     test_ret += test_xmlXPathSetContextNode();
47309 
47310     if (test_ret != 0)
47311 	printf("Module xpath: %d errors\n", test_ret);
47312     return(test_ret);
47313 }
47314 #ifdef LIBXML_XPATH_ENABLED
47315 
47316 #define gen_nb_xmlXPathParserContextPtr 1
gen_xmlXPathParserContextPtr(int no ATTRIBUTE_UNUSED,int nr ATTRIBUTE_UNUSED)47317 static xmlXPathParserContextPtr gen_xmlXPathParserContextPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
47318     return(NULL);
47319 }
des_xmlXPathParserContextPtr(int no ATTRIBUTE_UNUSED,xmlXPathParserContextPtr val ATTRIBUTE_UNUSED,int nr ATTRIBUTE_UNUSED)47320 static void des_xmlXPathParserContextPtr(int no ATTRIBUTE_UNUSED, xmlXPathParserContextPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
47321 }
47322 #endif
47323 
47324 
47325 static int
test_valuePop(void)47326 test_valuePop(void) {
47327     int test_ret = 0;
47328 
47329 #if defined(LIBXML_XPATH_ENABLED)
47330     int mem_base;
47331     xmlXPathObjectPtr ret_val;
47332     xmlXPathParserContextPtr ctxt; /* an XPath evaluation context */
47333     int n_ctxt;
47334 
47335     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
47336         mem_base = xmlMemBlocks();
47337         ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
47338 
47339         ret_val = valuePop(ctxt);
47340         desret_xmlXPathObjectPtr(ret_val);
47341         call_tests++;
47342         des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
47343         xmlResetLastError();
47344         if (mem_base != xmlMemBlocks()) {
47345             printf("Leak of %d blocks found in valuePop",
47346 	           xmlMemBlocks() - mem_base);
47347 	    test_ret++;
47348             printf(" %d", n_ctxt);
47349             printf("\n");
47350         }
47351     }
47352     function_tests++;
47353 #endif
47354 
47355     return(test_ret);
47356 }
47357 
47358 
47359 static int
test_valuePush(void)47360 test_valuePush(void) {
47361     int test_ret = 0;
47362 
47363 #if defined(LIBXML_XPATH_ENABLED)
47364     int mem_base;
47365     int ret_val;
47366     xmlXPathParserContextPtr ctxt; /* an XPath evaluation context */
47367     int n_ctxt;
47368     xmlXPathObjectPtr value; /* the XPath object */
47369     int n_value;
47370 
47371     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
47372     for (n_value = 0;n_value < gen_nb_xmlXPathObjectPtr;n_value++) {
47373         mem_base = xmlMemBlocks();
47374         ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
47375         value = gen_xmlXPathObjectPtr(n_value, 1);
47376 
47377         ret_val = valuePush(ctxt, value);
47378         desret_int(ret_val);
47379         call_tests++;
47380         des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
47381         des_xmlXPathObjectPtr(n_value, value, 1);
47382         xmlResetLastError();
47383         if (mem_base != xmlMemBlocks()) {
47384             printf("Leak of %d blocks found in valuePush",
47385 	           xmlMemBlocks() - mem_base);
47386 	    test_ret++;
47387             printf(" %d", n_ctxt);
47388             printf(" %d", n_value);
47389             printf("\n");
47390         }
47391     }
47392     }
47393     function_tests++;
47394 #endif
47395 
47396     return(test_ret);
47397 }
47398 
47399 
47400 static int
test_xmlXPathAddValues(void)47401 test_xmlXPathAddValues(void) {
47402     int test_ret = 0;
47403 
47404 #if defined(LIBXML_XPATH_ENABLED)
47405     int mem_base;
47406     xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
47407     int n_ctxt;
47408 
47409     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
47410         mem_base = xmlMemBlocks();
47411         ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
47412 
47413         xmlXPathAddValues(ctxt);
47414         call_tests++;
47415         des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
47416         xmlResetLastError();
47417         if (mem_base != xmlMemBlocks()) {
47418             printf("Leak of %d blocks found in xmlXPathAddValues",
47419 	           xmlMemBlocks() - mem_base);
47420 	    test_ret++;
47421             printf(" %d", n_ctxt);
47422             printf("\n");
47423         }
47424     }
47425     function_tests++;
47426 #endif
47427 
47428     return(test_ret);
47429 }
47430 
47431 
47432 static int
test_xmlXPathBooleanFunction(void)47433 test_xmlXPathBooleanFunction(void) {
47434     int test_ret = 0;
47435 
47436 #if defined(LIBXML_XPATH_ENABLED)
47437     int mem_base;
47438     xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
47439     int n_ctxt;
47440     int nargs; /* the number of arguments */
47441     int n_nargs;
47442 
47443     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
47444     for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
47445         mem_base = xmlMemBlocks();
47446         ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
47447         nargs = gen_int(n_nargs, 1);
47448 
47449         xmlXPathBooleanFunction(ctxt, nargs);
47450         call_tests++;
47451         des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
47452         des_int(n_nargs, nargs, 1);
47453         xmlResetLastError();
47454         if (mem_base != xmlMemBlocks()) {
47455             printf("Leak of %d blocks found in xmlXPathBooleanFunction",
47456 	           xmlMemBlocks() - mem_base);
47457 	    test_ret++;
47458             printf(" %d", n_ctxt);
47459             printf(" %d", n_nargs);
47460             printf("\n");
47461         }
47462     }
47463     }
47464     function_tests++;
47465 #endif
47466 
47467     return(test_ret);
47468 }
47469 
47470 
47471 static int
test_xmlXPathCeilingFunction(void)47472 test_xmlXPathCeilingFunction(void) {
47473     int test_ret = 0;
47474 
47475 #if defined(LIBXML_XPATH_ENABLED)
47476     int mem_base;
47477     xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
47478     int n_ctxt;
47479     int nargs; /* the number of arguments */
47480     int n_nargs;
47481 
47482     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
47483     for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
47484         mem_base = xmlMemBlocks();
47485         ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
47486         nargs = gen_int(n_nargs, 1);
47487 
47488         xmlXPathCeilingFunction(ctxt, nargs);
47489         call_tests++;
47490         des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
47491         des_int(n_nargs, nargs, 1);
47492         xmlResetLastError();
47493         if (mem_base != xmlMemBlocks()) {
47494             printf("Leak of %d blocks found in xmlXPathCeilingFunction",
47495 	           xmlMemBlocks() - mem_base);
47496 	    test_ret++;
47497             printf(" %d", n_ctxt);
47498             printf(" %d", n_nargs);
47499             printf("\n");
47500         }
47501     }
47502     }
47503     function_tests++;
47504 #endif
47505 
47506     return(test_ret);
47507 }
47508 
47509 
47510 static int
test_xmlXPathCompareValues(void)47511 test_xmlXPathCompareValues(void) {
47512     int test_ret = 0;
47513 
47514 #if defined(LIBXML_XPATH_ENABLED)
47515     int mem_base;
47516     int ret_val;
47517     xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
47518     int n_ctxt;
47519     int inf; /* less than (1) or greater than (0) */
47520     int n_inf;
47521     int strict; /* is the comparison strict */
47522     int n_strict;
47523 
47524     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
47525     for (n_inf = 0;n_inf < gen_nb_int;n_inf++) {
47526     for (n_strict = 0;n_strict < gen_nb_int;n_strict++) {
47527         mem_base = xmlMemBlocks();
47528         ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
47529         inf = gen_int(n_inf, 1);
47530         strict = gen_int(n_strict, 2);
47531 
47532         ret_val = xmlXPathCompareValues(ctxt, inf, strict);
47533         desret_int(ret_val);
47534         call_tests++;
47535         des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
47536         des_int(n_inf, inf, 1);
47537         des_int(n_strict, strict, 2);
47538         xmlResetLastError();
47539         if (mem_base != xmlMemBlocks()) {
47540             printf("Leak of %d blocks found in xmlXPathCompareValues",
47541 	           xmlMemBlocks() - mem_base);
47542 	    test_ret++;
47543             printf(" %d", n_ctxt);
47544             printf(" %d", n_inf);
47545             printf(" %d", n_strict);
47546             printf("\n");
47547         }
47548     }
47549     }
47550     }
47551     function_tests++;
47552 #endif
47553 
47554     return(test_ret);
47555 }
47556 
47557 
47558 static int
test_xmlXPathConcatFunction(void)47559 test_xmlXPathConcatFunction(void) {
47560     int test_ret = 0;
47561 
47562 #if defined(LIBXML_XPATH_ENABLED)
47563     int mem_base;
47564     xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
47565     int n_ctxt;
47566     int nargs; /* the number of arguments */
47567     int n_nargs;
47568 
47569     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
47570     for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
47571         mem_base = xmlMemBlocks();
47572         ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
47573         nargs = gen_int(n_nargs, 1);
47574 
47575         xmlXPathConcatFunction(ctxt, nargs);
47576         call_tests++;
47577         des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
47578         des_int(n_nargs, nargs, 1);
47579         xmlResetLastError();
47580         if (mem_base != xmlMemBlocks()) {
47581             printf("Leak of %d blocks found in xmlXPathConcatFunction",
47582 	           xmlMemBlocks() - mem_base);
47583 	    test_ret++;
47584             printf(" %d", n_ctxt);
47585             printf(" %d", n_nargs);
47586             printf("\n");
47587         }
47588     }
47589     }
47590     function_tests++;
47591 #endif
47592 
47593     return(test_ret);
47594 }
47595 
47596 
47597 static int
test_xmlXPathContainsFunction(void)47598 test_xmlXPathContainsFunction(void) {
47599     int test_ret = 0;
47600 
47601 #if defined(LIBXML_XPATH_ENABLED)
47602     int mem_base;
47603     xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
47604     int n_ctxt;
47605     int nargs; /* the number of arguments */
47606     int n_nargs;
47607 
47608     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
47609     for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
47610         mem_base = xmlMemBlocks();
47611         ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
47612         nargs = gen_int(n_nargs, 1);
47613 
47614         xmlXPathContainsFunction(ctxt, nargs);
47615         call_tests++;
47616         des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
47617         des_int(n_nargs, nargs, 1);
47618         xmlResetLastError();
47619         if (mem_base != xmlMemBlocks()) {
47620             printf("Leak of %d blocks found in xmlXPathContainsFunction",
47621 	           xmlMemBlocks() - mem_base);
47622 	    test_ret++;
47623             printf(" %d", n_ctxt);
47624             printf(" %d", n_nargs);
47625             printf("\n");
47626         }
47627     }
47628     }
47629     function_tests++;
47630 #endif
47631 
47632     return(test_ret);
47633 }
47634 
47635 
47636 static int
test_xmlXPathCountFunction(void)47637 test_xmlXPathCountFunction(void) {
47638     int test_ret = 0;
47639 
47640 #if defined(LIBXML_XPATH_ENABLED)
47641     int mem_base;
47642     xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
47643     int n_ctxt;
47644     int nargs; /* the number of arguments */
47645     int n_nargs;
47646 
47647     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
47648     for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
47649         mem_base = xmlMemBlocks();
47650         ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
47651         nargs = gen_int(n_nargs, 1);
47652 
47653         xmlXPathCountFunction(ctxt, nargs);
47654         call_tests++;
47655         des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
47656         des_int(n_nargs, nargs, 1);
47657         xmlResetLastError();
47658         if (mem_base != xmlMemBlocks()) {
47659             printf("Leak of %d blocks found in xmlXPathCountFunction",
47660 	           xmlMemBlocks() - mem_base);
47661 	    test_ret++;
47662             printf(" %d", n_ctxt);
47663             printf(" %d", n_nargs);
47664             printf("\n");
47665         }
47666     }
47667     }
47668     function_tests++;
47669 #endif
47670 
47671     return(test_ret);
47672 }
47673 
47674 
47675 static int
test_xmlXPathDebugDumpCompExpr(void)47676 test_xmlXPathDebugDumpCompExpr(void) {
47677     int test_ret = 0;
47678 
47679 #if defined(LIBXML_XPATH_ENABLED) && defined(LIBXML_DEBUG_ENABLED)
47680     int mem_base;
47681     FILE * output; /* the FILE * for the output */
47682     int n_output;
47683     xmlXPathCompExprPtr comp; /* the precompiled XPath expression */
47684     int n_comp;
47685     int depth; /* the indentation level. */
47686     int n_depth;
47687 
47688     for (n_output = 0;n_output < gen_nb_FILE_ptr;n_output++) {
47689     for (n_comp = 0;n_comp < gen_nb_xmlXPathCompExprPtr;n_comp++) {
47690     for (n_depth = 0;n_depth < gen_nb_int;n_depth++) {
47691         mem_base = xmlMemBlocks();
47692         output = gen_FILE_ptr(n_output, 0);
47693         comp = gen_xmlXPathCompExprPtr(n_comp, 1);
47694         depth = gen_int(n_depth, 2);
47695 
47696         xmlXPathDebugDumpCompExpr(output, comp, depth);
47697         call_tests++;
47698         des_FILE_ptr(n_output, output, 0);
47699         des_xmlXPathCompExprPtr(n_comp, comp, 1);
47700         des_int(n_depth, depth, 2);
47701         xmlResetLastError();
47702         if (mem_base != xmlMemBlocks()) {
47703             printf("Leak of %d blocks found in xmlXPathDebugDumpCompExpr",
47704 	           xmlMemBlocks() - mem_base);
47705 	    test_ret++;
47706             printf(" %d", n_output);
47707             printf(" %d", n_comp);
47708             printf(" %d", n_depth);
47709             printf("\n");
47710         }
47711     }
47712     }
47713     }
47714     function_tests++;
47715 #endif
47716 
47717     return(test_ret);
47718 }
47719 
47720 
47721 static int
test_xmlXPathDebugDumpObject(void)47722 test_xmlXPathDebugDumpObject(void) {
47723     int test_ret = 0;
47724 
47725 #if defined(LIBXML_XPATH_ENABLED) && defined(LIBXML_DEBUG_ENABLED)
47726     int mem_base;
47727     FILE * output; /* the FILE * to dump the output */
47728     int n_output;
47729     xmlXPathObjectPtr cur; /* the object to inspect */
47730     int n_cur;
47731     int depth; /* indentation level */
47732     int n_depth;
47733 
47734     for (n_output = 0;n_output < gen_nb_FILE_ptr;n_output++) {
47735     for (n_cur = 0;n_cur < gen_nb_xmlXPathObjectPtr;n_cur++) {
47736     for (n_depth = 0;n_depth < gen_nb_int;n_depth++) {
47737         mem_base = xmlMemBlocks();
47738         output = gen_FILE_ptr(n_output, 0);
47739         cur = gen_xmlXPathObjectPtr(n_cur, 1);
47740         depth = gen_int(n_depth, 2);
47741 
47742         xmlXPathDebugDumpObject(output, cur, depth);
47743         call_tests++;
47744         des_FILE_ptr(n_output, output, 0);
47745         des_xmlXPathObjectPtr(n_cur, cur, 1);
47746         des_int(n_depth, depth, 2);
47747         xmlResetLastError();
47748         if (mem_base != xmlMemBlocks()) {
47749             printf("Leak of %d blocks found in xmlXPathDebugDumpObject",
47750 	           xmlMemBlocks() - mem_base);
47751 	    test_ret++;
47752             printf(" %d", n_output);
47753             printf(" %d", n_cur);
47754             printf(" %d", n_depth);
47755             printf("\n");
47756         }
47757     }
47758     }
47759     }
47760     function_tests++;
47761 #endif
47762 
47763     return(test_ret);
47764 }
47765 
47766 
47767 static int
test_xmlXPathDifference(void)47768 test_xmlXPathDifference(void) {
47769     int test_ret = 0;
47770 
47771 #if defined(LIBXML_XPATH_ENABLED)
47772     int mem_base;
47773     xmlNodeSetPtr ret_val;
47774     xmlNodeSetPtr nodes1; /* a node-set */
47775     int n_nodes1;
47776     xmlNodeSetPtr nodes2; /* a node-set */
47777     int n_nodes2;
47778 
47779     for (n_nodes1 = 0;n_nodes1 < gen_nb_xmlNodeSetPtr;n_nodes1++) {
47780     for (n_nodes2 = 0;n_nodes2 < gen_nb_xmlNodeSetPtr;n_nodes2++) {
47781         mem_base = xmlMemBlocks();
47782         nodes1 = gen_xmlNodeSetPtr(n_nodes1, 0);
47783         nodes2 = gen_xmlNodeSetPtr(n_nodes2, 1);
47784 
47785         ret_val = xmlXPathDifference(nodes1, nodes2);
47786         desret_xmlNodeSetPtr(ret_val);
47787         call_tests++;
47788         des_xmlNodeSetPtr(n_nodes1, nodes1, 0);
47789         des_xmlNodeSetPtr(n_nodes2, nodes2, 1);
47790         xmlResetLastError();
47791         if (mem_base != xmlMemBlocks()) {
47792             printf("Leak of %d blocks found in xmlXPathDifference",
47793 	           xmlMemBlocks() - mem_base);
47794 	    test_ret++;
47795             printf(" %d", n_nodes1);
47796             printf(" %d", n_nodes2);
47797             printf("\n");
47798         }
47799     }
47800     }
47801     function_tests++;
47802 #endif
47803 
47804     return(test_ret);
47805 }
47806 
47807 
47808 static int
test_xmlXPathDistinct(void)47809 test_xmlXPathDistinct(void) {
47810     int test_ret = 0;
47811 
47812 #if defined(LIBXML_XPATH_ENABLED)
47813     int mem_base;
47814     xmlNodeSetPtr ret_val;
47815     xmlNodeSetPtr nodes; /* a node-set */
47816     int n_nodes;
47817 
47818     for (n_nodes = 0;n_nodes < gen_nb_xmlNodeSetPtr;n_nodes++) {
47819         mem_base = xmlMemBlocks();
47820         nodes = gen_xmlNodeSetPtr(n_nodes, 0);
47821 
47822         ret_val = xmlXPathDistinct(nodes);
47823         desret_xmlNodeSetPtr(ret_val);
47824         call_tests++;
47825         des_xmlNodeSetPtr(n_nodes, nodes, 0);
47826         xmlResetLastError();
47827         if (mem_base != xmlMemBlocks()) {
47828             printf("Leak of %d blocks found in xmlXPathDistinct",
47829 	           xmlMemBlocks() - mem_base);
47830 	    test_ret++;
47831             printf(" %d", n_nodes);
47832             printf("\n");
47833         }
47834     }
47835     function_tests++;
47836 #endif
47837 
47838     return(test_ret);
47839 }
47840 
47841 
47842 static int
test_xmlXPathDistinctSorted(void)47843 test_xmlXPathDistinctSorted(void) {
47844     int test_ret = 0;
47845 
47846 #if defined(LIBXML_XPATH_ENABLED)
47847     int mem_base;
47848     xmlNodeSetPtr ret_val;
47849     xmlNodeSetPtr nodes; /* a node-set, sorted by document order */
47850     int n_nodes;
47851 
47852     for (n_nodes = 0;n_nodes < gen_nb_xmlNodeSetPtr;n_nodes++) {
47853         mem_base = xmlMemBlocks();
47854         nodes = gen_xmlNodeSetPtr(n_nodes, 0);
47855 
47856         ret_val = xmlXPathDistinctSorted(nodes);
47857         desret_xmlNodeSetPtr(ret_val);
47858         call_tests++;
47859         des_xmlNodeSetPtr(n_nodes, nodes, 0);
47860         xmlResetLastError();
47861         if (mem_base != xmlMemBlocks()) {
47862             printf("Leak of %d blocks found in xmlXPathDistinctSorted",
47863 	           xmlMemBlocks() - mem_base);
47864 	    test_ret++;
47865             printf(" %d", n_nodes);
47866             printf("\n");
47867         }
47868     }
47869     function_tests++;
47870 #endif
47871 
47872     return(test_ret);
47873 }
47874 
47875 
47876 static int
test_xmlXPathDivValues(void)47877 test_xmlXPathDivValues(void) {
47878     int test_ret = 0;
47879 
47880 #if defined(LIBXML_XPATH_ENABLED)
47881     int mem_base;
47882     xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
47883     int n_ctxt;
47884 
47885     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
47886         mem_base = xmlMemBlocks();
47887         ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
47888 
47889         xmlXPathDivValues(ctxt);
47890         call_tests++;
47891         des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
47892         xmlResetLastError();
47893         if (mem_base != xmlMemBlocks()) {
47894             printf("Leak of %d blocks found in xmlXPathDivValues",
47895 	           xmlMemBlocks() - mem_base);
47896 	    test_ret++;
47897             printf(" %d", n_ctxt);
47898             printf("\n");
47899         }
47900     }
47901     function_tests++;
47902 #endif
47903 
47904     return(test_ret);
47905 }
47906 
47907 
47908 static int
test_xmlXPathEqualValues(void)47909 test_xmlXPathEqualValues(void) {
47910     int test_ret = 0;
47911 
47912 #if defined(LIBXML_XPATH_ENABLED)
47913     int mem_base;
47914     int ret_val;
47915     xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
47916     int n_ctxt;
47917 
47918     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
47919         mem_base = xmlMemBlocks();
47920         ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
47921 
47922         ret_val = xmlXPathEqualValues(ctxt);
47923         desret_int(ret_val);
47924         call_tests++;
47925         des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
47926         xmlResetLastError();
47927         if (mem_base != xmlMemBlocks()) {
47928             printf("Leak of %d blocks found in xmlXPathEqualValues",
47929 	           xmlMemBlocks() - mem_base);
47930 	    test_ret++;
47931             printf(" %d", n_ctxt);
47932             printf("\n");
47933         }
47934     }
47935     function_tests++;
47936 #endif
47937 
47938     return(test_ret);
47939 }
47940 
47941 
47942 static int
test_xmlXPathErr(void)47943 test_xmlXPathErr(void) {
47944     int test_ret = 0;
47945 
47946 #if defined(LIBXML_XPATH_ENABLED)
47947     int mem_base;
47948     xmlXPathParserContextPtr ctxt; /* a XPath parser context */
47949     int n_ctxt;
47950     int error; /* the error code */
47951     int n_error;
47952 
47953     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
47954     for (n_error = 0;n_error < gen_nb_int;n_error++) {
47955         mem_base = xmlMemBlocks();
47956         ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
47957         error = gen_int(n_error, 1);
47958 
47959         xmlXPathErr(ctxt, error);
47960         call_tests++;
47961         des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
47962         des_int(n_error, error, 1);
47963         xmlResetLastError();
47964         if (mem_base != xmlMemBlocks()) {
47965             printf("Leak of %d blocks found in xmlXPathErr",
47966 	           xmlMemBlocks() - mem_base);
47967 	    test_ret++;
47968             printf(" %d", n_ctxt);
47969             printf(" %d", n_error);
47970             printf("\n");
47971         }
47972     }
47973     }
47974     function_tests++;
47975 #endif
47976 
47977     return(test_ret);
47978 }
47979 
47980 
47981 static int
test_xmlXPathEvalExpr(void)47982 test_xmlXPathEvalExpr(void) {
47983     int test_ret = 0;
47984 
47985 #if defined(LIBXML_XPATH_ENABLED)
47986     int mem_base;
47987     xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
47988     int n_ctxt;
47989 
47990     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
47991         mem_base = xmlMemBlocks();
47992         ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
47993 
47994         xmlXPathEvalExpr(ctxt);
47995         call_tests++;
47996         des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
47997         xmlResetLastError();
47998         if (mem_base != xmlMemBlocks()) {
47999             printf("Leak of %d blocks found in xmlXPathEvalExpr",
48000 	           xmlMemBlocks() - mem_base);
48001 	    test_ret++;
48002             printf(" %d", n_ctxt);
48003             printf("\n");
48004         }
48005     }
48006     function_tests++;
48007 #endif
48008 
48009     return(test_ret);
48010 }
48011 
48012 
48013 static int
test_xmlXPathEvaluatePredicateResult(void)48014 test_xmlXPathEvaluatePredicateResult(void) {
48015     int test_ret = 0;
48016 
48017 #if defined(LIBXML_XPATH_ENABLED)
48018     int mem_base;
48019     int ret_val;
48020     xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
48021     int n_ctxt;
48022     xmlXPathObjectPtr res; /* the Predicate Expression evaluation result */
48023     int n_res;
48024 
48025     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
48026     for (n_res = 0;n_res < gen_nb_xmlXPathObjectPtr;n_res++) {
48027         mem_base = xmlMemBlocks();
48028         ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
48029         res = gen_xmlXPathObjectPtr(n_res, 1);
48030 
48031         ret_val = xmlXPathEvaluatePredicateResult(ctxt, res);
48032         desret_int(ret_val);
48033         call_tests++;
48034         des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
48035         des_xmlXPathObjectPtr(n_res, res, 1);
48036         xmlResetLastError();
48037         if (mem_base != xmlMemBlocks()) {
48038             printf("Leak of %d blocks found in xmlXPathEvaluatePredicateResult",
48039 	           xmlMemBlocks() - mem_base);
48040 	    test_ret++;
48041             printf(" %d", n_ctxt);
48042             printf(" %d", n_res);
48043             printf("\n");
48044         }
48045     }
48046     }
48047     function_tests++;
48048 #endif
48049 
48050     return(test_ret);
48051 }
48052 
48053 
48054 static int
test_xmlXPathFalseFunction(void)48055 test_xmlXPathFalseFunction(void) {
48056     int test_ret = 0;
48057 
48058 #if defined(LIBXML_XPATH_ENABLED)
48059     int mem_base;
48060     xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
48061     int n_ctxt;
48062     int nargs; /* the number of arguments */
48063     int n_nargs;
48064 
48065     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
48066     for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
48067         mem_base = xmlMemBlocks();
48068         ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
48069         nargs = gen_int(n_nargs, 1);
48070 
48071         xmlXPathFalseFunction(ctxt, nargs);
48072         call_tests++;
48073         des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
48074         des_int(n_nargs, nargs, 1);
48075         xmlResetLastError();
48076         if (mem_base != xmlMemBlocks()) {
48077             printf("Leak of %d blocks found in xmlXPathFalseFunction",
48078 	           xmlMemBlocks() - mem_base);
48079 	    test_ret++;
48080             printf(" %d", n_ctxt);
48081             printf(" %d", n_nargs);
48082             printf("\n");
48083         }
48084     }
48085     }
48086     function_tests++;
48087 #endif
48088 
48089     return(test_ret);
48090 }
48091 
48092 
48093 static int
test_xmlXPathFloorFunction(void)48094 test_xmlXPathFloorFunction(void) {
48095     int test_ret = 0;
48096 
48097 #if defined(LIBXML_XPATH_ENABLED)
48098     int mem_base;
48099     xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
48100     int n_ctxt;
48101     int nargs; /* the number of arguments */
48102     int n_nargs;
48103 
48104     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
48105     for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
48106         mem_base = xmlMemBlocks();
48107         ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
48108         nargs = gen_int(n_nargs, 1);
48109 
48110         xmlXPathFloorFunction(ctxt, nargs);
48111         call_tests++;
48112         des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
48113         des_int(n_nargs, nargs, 1);
48114         xmlResetLastError();
48115         if (mem_base != xmlMemBlocks()) {
48116             printf("Leak of %d blocks found in xmlXPathFloorFunction",
48117 	           xmlMemBlocks() - mem_base);
48118 	    test_ret++;
48119             printf(" %d", n_ctxt);
48120             printf(" %d", n_nargs);
48121             printf("\n");
48122         }
48123     }
48124     }
48125     function_tests++;
48126 #endif
48127 
48128     return(test_ret);
48129 }
48130 
48131 
48132 static int
test_xmlXPathFunctionLookup(void)48133 test_xmlXPathFunctionLookup(void) {
48134     int test_ret = 0;
48135 
48136 
48137     /* missing type support */
48138     return(test_ret);
48139 }
48140 
48141 
48142 static int
test_xmlXPathFunctionLookupNS(void)48143 test_xmlXPathFunctionLookupNS(void) {
48144     int test_ret = 0;
48145 
48146 
48147     /* missing type support */
48148     return(test_ret);
48149 }
48150 
48151 
48152 static int
test_xmlXPathHasSameNodes(void)48153 test_xmlXPathHasSameNodes(void) {
48154     int test_ret = 0;
48155 
48156 #if defined(LIBXML_XPATH_ENABLED)
48157     int mem_base;
48158     int ret_val;
48159     xmlNodeSetPtr nodes1; /* a node-set */
48160     int n_nodes1;
48161     xmlNodeSetPtr nodes2; /* a node-set */
48162     int n_nodes2;
48163 
48164     for (n_nodes1 = 0;n_nodes1 < gen_nb_xmlNodeSetPtr;n_nodes1++) {
48165     for (n_nodes2 = 0;n_nodes2 < gen_nb_xmlNodeSetPtr;n_nodes2++) {
48166         mem_base = xmlMemBlocks();
48167         nodes1 = gen_xmlNodeSetPtr(n_nodes1, 0);
48168         nodes2 = gen_xmlNodeSetPtr(n_nodes2, 1);
48169 
48170         ret_val = xmlXPathHasSameNodes(nodes1, nodes2);
48171         desret_int(ret_val);
48172         call_tests++;
48173         des_xmlNodeSetPtr(n_nodes1, nodes1, 0);
48174         des_xmlNodeSetPtr(n_nodes2, nodes2, 1);
48175         xmlResetLastError();
48176         if (mem_base != xmlMemBlocks()) {
48177             printf("Leak of %d blocks found in xmlXPathHasSameNodes",
48178 	           xmlMemBlocks() - mem_base);
48179 	    test_ret++;
48180             printf(" %d", n_nodes1);
48181             printf(" %d", n_nodes2);
48182             printf("\n");
48183         }
48184     }
48185     }
48186     function_tests++;
48187 #endif
48188 
48189     return(test_ret);
48190 }
48191 
48192 
48193 static int
test_xmlXPathIdFunction(void)48194 test_xmlXPathIdFunction(void) {
48195     int test_ret = 0;
48196 
48197 #if defined(LIBXML_XPATH_ENABLED)
48198     int mem_base;
48199     xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
48200     int n_ctxt;
48201     int nargs; /* the number of arguments */
48202     int n_nargs;
48203 
48204     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
48205     for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
48206         mem_base = xmlMemBlocks();
48207         ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
48208         nargs = gen_int(n_nargs, 1);
48209 
48210         xmlXPathIdFunction(ctxt, nargs);
48211         call_tests++;
48212         des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
48213         des_int(n_nargs, nargs, 1);
48214         xmlResetLastError();
48215         if (mem_base != xmlMemBlocks()) {
48216             printf("Leak of %d blocks found in xmlXPathIdFunction",
48217 	           xmlMemBlocks() - mem_base);
48218 	    test_ret++;
48219             printf(" %d", n_ctxt);
48220             printf(" %d", n_nargs);
48221             printf("\n");
48222         }
48223     }
48224     }
48225     function_tests++;
48226 #endif
48227 
48228     return(test_ret);
48229 }
48230 
48231 
48232 static int
test_xmlXPathIntersection(void)48233 test_xmlXPathIntersection(void) {
48234     int test_ret = 0;
48235 
48236 #if defined(LIBXML_XPATH_ENABLED)
48237     int mem_base;
48238     xmlNodeSetPtr ret_val;
48239     xmlNodeSetPtr nodes1; /* a node-set */
48240     int n_nodes1;
48241     xmlNodeSetPtr nodes2; /* a node-set */
48242     int n_nodes2;
48243 
48244     for (n_nodes1 = 0;n_nodes1 < gen_nb_xmlNodeSetPtr;n_nodes1++) {
48245     for (n_nodes2 = 0;n_nodes2 < gen_nb_xmlNodeSetPtr;n_nodes2++) {
48246         mem_base = xmlMemBlocks();
48247         nodes1 = gen_xmlNodeSetPtr(n_nodes1, 0);
48248         nodes2 = gen_xmlNodeSetPtr(n_nodes2, 1);
48249 
48250         ret_val = xmlXPathIntersection(nodes1, nodes2);
48251         desret_xmlNodeSetPtr(ret_val);
48252         call_tests++;
48253         des_xmlNodeSetPtr(n_nodes1, nodes1, 0);
48254         des_xmlNodeSetPtr(n_nodes2, nodes2, 1);
48255         xmlResetLastError();
48256         if (mem_base != xmlMemBlocks()) {
48257             printf("Leak of %d blocks found in xmlXPathIntersection",
48258 	           xmlMemBlocks() - mem_base);
48259 	    test_ret++;
48260             printf(" %d", n_nodes1);
48261             printf(" %d", n_nodes2);
48262             printf("\n");
48263         }
48264     }
48265     }
48266     function_tests++;
48267 #endif
48268 
48269     return(test_ret);
48270 }
48271 
48272 
48273 static int
test_xmlXPathIsNodeType(void)48274 test_xmlXPathIsNodeType(void) {
48275     int test_ret = 0;
48276 
48277 #if defined(LIBXML_XPATH_ENABLED)
48278     int mem_base;
48279     int ret_val;
48280     xmlChar * name; /* a name string */
48281     int n_name;
48282 
48283     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
48284         mem_base = xmlMemBlocks();
48285         name = gen_const_xmlChar_ptr(n_name, 0);
48286 
48287         ret_val = xmlXPathIsNodeType((const xmlChar *)name);
48288         desret_int(ret_val);
48289         call_tests++;
48290         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 0);
48291         xmlResetLastError();
48292         if (mem_base != xmlMemBlocks()) {
48293             printf("Leak of %d blocks found in xmlXPathIsNodeType",
48294 	           xmlMemBlocks() - mem_base);
48295 	    test_ret++;
48296             printf(" %d", n_name);
48297             printf("\n");
48298         }
48299     }
48300     function_tests++;
48301 #endif
48302 
48303     return(test_ret);
48304 }
48305 
48306 
48307 static int
test_xmlXPathLangFunction(void)48308 test_xmlXPathLangFunction(void) {
48309     int test_ret = 0;
48310 
48311 #if defined(LIBXML_XPATH_ENABLED)
48312     int mem_base;
48313     xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
48314     int n_ctxt;
48315     int nargs; /* the number of arguments */
48316     int n_nargs;
48317 
48318     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
48319     for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
48320         mem_base = xmlMemBlocks();
48321         ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
48322         nargs = gen_int(n_nargs, 1);
48323 
48324         xmlXPathLangFunction(ctxt, nargs);
48325         call_tests++;
48326         des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
48327         des_int(n_nargs, nargs, 1);
48328         xmlResetLastError();
48329         if (mem_base != xmlMemBlocks()) {
48330             printf("Leak of %d blocks found in xmlXPathLangFunction",
48331 	           xmlMemBlocks() - mem_base);
48332 	    test_ret++;
48333             printf(" %d", n_ctxt);
48334             printf(" %d", n_nargs);
48335             printf("\n");
48336         }
48337     }
48338     }
48339     function_tests++;
48340 #endif
48341 
48342     return(test_ret);
48343 }
48344 
48345 
48346 static int
test_xmlXPathLastFunction(void)48347 test_xmlXPathLastFunction(void) {
48348     int test_ret = 0;
48349 
48350 #if defined(LIBXML_XPATH_ENABLED)
48351     int mem_base;
48352     xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
48353     int n_ctxt;
48354     int nargs; /* the number of arguments */
48355     int n_nargs;
48356 
48357     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
48358     for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
48359         mem_base = xmlMemBlocks();
48360         ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
48361         nargs = gen_int(n_nargs, 1);
48362 
48363         xmlXPathLastFunction(ctxt, nargs);
48364         call_tests++;
48365         des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
48366         des_int(n_nargs, nargs, 1);
48367         xmlResetLastError();
48368         if (mem_base != xmlMemBlocks()) {
48369             printf("Leak of %d blocks found in xmlXPathLastFunction",
48370 	           xmlMemBlocks() - mem_base);
48371 	    test_ret++;
48372             printf(" %d", n_ctxt);
48373             printf(" %d", n_nargs);
48374             printf("\n");
48375         }
48376     }
48377     }
48378     function_tests++;
48379 #endif
48380 
48381     return(test_ret);
48382 }
48383 
48384 
48385 static int
test_xmlXPathLeading(void)48386 test_xmlXPathLeading(void) {
48387     int test_ret = 0;
48388 
48389 #if defined(LIBXML_XPATH_ENABLED)
48390     int mem_base;
48391     xmlNodeSetPtr ret_val;
48392     xmlNodeSetPtr nodes1; /* a node-set */
48393     int n_nodes1;
48394     xmlNodeSetPtr nodes2; /* a node-set */
48395     int n_nodes2;
48396 
48397     for (n_nodes1 = 0;n_nodes1 < gen_nb_xmlNodeSetPtr;n_nodes1++) {
48398     for (n_nodes2 = 0;n_nodes2 < gen_nb_xmlNodeSetPtr;n_nodes2++) {
48399         mem_base = xmlMemBlocks();
48400         nodes1 = gen_xmlNodeSetPtr(n_nodes1, 0);
48401         nodes2 = gen_xmlNodeSetPtr(n_nodes2, 1);
48402 
48403         ret_val = xmlXPathLeading(nodes1, nodes2);
48404         desret_xmlNodeSetPtr(ret_val);
48405         call_tests++;
48406         des_xmlNodeSetPtr(n_nodes1, nodes1, 0);
48407         des_xmlNodeSetPtr(n_nodes2, nodes2, 1);
48408         xmlResetLastError();
48409         if (mem_base != xmlMemBlocks()) {
48410             printf("Leak of %d blocks found in xmlXPathLeading",
48411 	           xmlMemBlocks() - mem_base);
48412 	    test_ret++;
48413             printf(" %d", n_nodes1);
48414             printf(" %d", n_nodes2);
48415             printf("\n");
48416         }
48417     }
48418     }
48419     function_tests++;
48420 #endif
48421 
48422     return(test_ret);
48423 }
48424 
48425 
48426 static int
test_xmlXPathLeadingSorted(void)48427 test_xmlXPathLeadingSorted(void) {
48428     int test_ret = 0;
48429 
48430 #if defined(LIBXML_XPATH_ENABLED)
48431     int mem_base;
48432     xmlNodeSetPtr ret_val;
48433     xmlNodeSetPtr nodes1; /* a node-set, sorted by document order */
48434     int n_nodes1;
48435     xmlNodeSetPtr nodes2; /* a node-set, sorted by document order */
48436     int n_nodes2;
48437 
48438     for (n_nodes1 = 0;n_nodes1 < gen_nb_xmlNodeSetPtr;n_nodes1++) {
48439     for (n_nodes2 = 0;n_nodes2 < gen_nb_xmlNodeSetPtr;n_nodes2++) {
48440         mem_base = xmlMemBlocks();
48441         nodes1 = gen_xmlNodeSetPtr(n_nodes1, 0);
48442         nodes2 = gen_xmlNodeSetPtr(n_nodes2, 1);
48443 
48444         ret_val = xmlXPathLeadingSorted(nodes1, nodes2);
48445         desret_xmlNodeSetPtr(ret_val);
48446         call_tests++;
48447         des_xmlNodeSetPtr(n_nodes1, nodes1, 0);
48448         des_xmlNodeSetPtr(n_nodes2, nodes2, 1);
48449         xmlResetLastError();
48450         if (mem_base != xmlMemBlocks()) {
48451             printf("Leak of %d blocks found in xmlXPathLeadingSorted",
48452 	           xmlMemBlocks() - mem_base);
48453 	    test_ret++;
48454             printf(" %d", n_nodes1);
48455             printf(" %d", n_nodes2);
48456             printf("\n");
48457         }
48458     }
48459     }
48460     function_tests++;
48461 #endif
48462 
48463     return(test_ret);
48464 }
48465 
48466 
48467 static int
test_xmlXPathLocalNameFunction(void)48468 test_xmlXPathLocalNameFunction(void) {
48469     int test_ret = 0;
48470 
48471 #if defined(LIBXML_XPATH_ENABLED)
48472     int mem_base;
48473     xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
48474     int n_ctxt;
48475     int nargs; /* the number of arguments */
48476     int n_nargs;
48477 
48478     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
48479     for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
48480         mem_base = xmlMemBlocks();
48481         ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
48482         nargs = gen_int(n_nargs, 1);
48483 
48484         xmlXPathLocalNameFunction(ctxt, nargs);
48485         call_tests++;
48486         des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
48487         des_int(n_nargs, nargs, 1);
48488         xmlResetLastError();
48489         if (mem_base != xmlMemBlocks()) {
48490             printf("Leak of %d blocks found in xmlXPathLocalNameFunction",
48491 	           xmlMemBlocks() - mem_base);
48492 	    test_ret++;
48493             printf(" %d", n_ctxt);
48494             printf(" %d", n_nargs);
48495             printf("\n");
48496         }
48497     }
48498     }
48499     function_tests++;
48500 #endif
48501 
48502     return(test_ret);
48503 }
48504 
48505 
48506 static int
test_xmlXPathModValues(void)48507 test_xmlXPathModValues(void) {
48508     int test_ret = 0;
48509 
48510 #if defined(LIBXML_XPATH_ENABLED)
48511     int mem_base;
48512     xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
48513     int n_ctxt;
48514 
48515     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
48516         mem_base = xmlMemBlocks();
48517         ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
48518 
48519         xmlXPathModValues(ctxt);
48520         call_tests++;
48521         des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
48522         xmlResetLastError();
48523         if (mem_base != xmlMemBlocks()) {
48524             printf("Leak of %d blocks found in xmlXPathModValues",
48525 	           xmlMemBlocks() - mem_base);
48526 	    test_ret++;
48527             printf(" %d", n_ctxt);
48528             printf("\n");
48529         }
48530     }
48531     function_tests++;
48532 #endif
48533 
48534     return(test_ret);
48535 }
48536 
48537 
48538 static int
test_xmlXPathMultValues(void)48539 test_xmlXPathMultValues(void) {
48540     int test_ret = 0;
48541 
48542 #if defined(LIBXML_XPATH_ENABLED)
48543     int mem_base;
48544     xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
48545     int n_ctxt;
48546 
48547     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
48548         mem_base = xmlMemBlocks();
48549         ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
48550 
48551         xmlXPathMultValues(ctxt);
48552         call_tests++;
48553         des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
48554         xmlResetLastError();
48555         if (mem_base != xmlMemBlocks()) {
48556             printf("Leak of %d blocks found in xmlXPathMultValues",
48557 	           xmlMemBlocks() - mem_base);
48558 	    test_ret++;
48559             printf(" %d", n_ctxt);
48560             printf("\n");
48561         }
48562     }
48563     function_tests++;
48564 #endif
48565 
48566     return(test_ret);
48567 }
48568 
48569 
48570 static int
test_xmlXPathNamespaceURIFunction(void)48571 test_xmlXPathNamespaceURIFunction(void) {
48572     int test_ret = 0;
48573 
48574 #if defined(LIBXML_XPATH_ENABLED)
48575     int mem_base;
48576     xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
48577     int n_ctxt;
48578     int nargs; /* the number of arguments */
48579     int n_nargs;
48580 
48581     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
48582     for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
48583         mem_base = xmlMemBlocks();
48584         ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
48585         nargs = gen_int(n_nargs, 1);
48586 
48587         xmlXPathNamespaceURIFunction(ctxt, nargs);
48588         call_tests++;
48589         des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
48590         des_int(n_nargs, nargs, 1);
48591         xmlResetLastError();
48592         if (mem_base != xmlMemBlocks()) {
48593             printf("Leak of %d blocks found in xmlXPathNamespaceURIFunction",
48594 	           xmlMemBlocks() - mem_base);
48595 	    test_ret++;
48596             printf(" %d", n_ctxt);
48597             printf(" %d", n_nargs);
48598             printf("\n");
48599         }
48600     }
48601     }
48602     function_tests++;
48603 #endif
48604 
48605     return(test_ret);
48606 }
48607 
48608 
48609 static int
test_xmlXPathNewBoolean(void)48610 test_xmlXPathNewBoolean(void) {
48611     int test_ret = 0;
48612 
48613 #if defined(LIBXML_XPATH_ENABLED)
48614     int mem_base;
48615     xmlXPathObjectPtr ret_val;
48616     int val; /* the boolean value */
48617     int n_val;
48618 
48619     for (n_val = 0;n_val < gen_nb_int;n_val++) {
48620         mem_base = xmlMemBlocks();
48621         val = gen_int(n_val, 0);
48622 
48623         ret_val = xmlXPathNewBoolean(val);
48624         desret_xmlXPathObjectPtr(ret_val);
48625         call_tests++;
48626         des_int(n_val, val, 0);
48627         xmlResetLastError();
48628         if (mem_base != xmlMemBlocks()) {
48629             printf("Leak of %d blocks found in xmlXPathNewBoolean",
48630 	           xmlMemBlocks() - mem_base);
48631 	    test_ret++;
48632             printf(" %d", n_val);
48633             printf("\n");
48634         }
48635     }
48636     function_tests++;
48637 #endif
48638 
48639     return(test_ret);
48640 }
48641 
48642 
48643 static int
test_xmlXPathNewCString(void)48644 test_xmlXPathNewCString(void) {
48645     int test_ret = 0;
48646 
48647 #if defined(LIBXML_XPATH_ENABLED)
48648     int mem_base;
48649     xmlXPathObjectPtr ret_val;
48650     char * val; /* the char * value */
48651     int n_val;
48652 
48653     for (n_val = 0;n_val < gen_nb_const_char_ptr;n_val++) {
48654         mem_base = xmlMemBlocks();
48655         val = gen_const_char_ptr(n_val, 0);
48656 
48657         ret_val = xmlXPathNewCString((const char *)val);
48658         desret_xmlXPathObjectPtr(ret_val);
48659         call_tests++;
48660         des_const_char_ptr(n_val, (const char *)val, 0);
48661         xmlResetLastError();
48662         if (mem_base != xmlMemBlocks()) {
48663             printf("Leak of %d blocks found in xmlXPathNewCString",
48664 	           xmlMemBlocks() - mem_base);
48665 	    test_ret++;
48666             printf(" %d", n_val);
48667             printf("\n");
48668         }
48669     }
48670     function_tests++;
48671 #endif
48672 
48673     return(test_ret);
48674 }
48675 
48676 
48677 static int
test_xmlXPathNewFloat(void)48678 test_xmlXPathNewFloat(void) {
48679     int test_ret = 0;
48680 
48681 #if defined(LIBXML_XPATH_ENABLED)
48682     int mem_base;
48683     xmlXPathObjectPtr ret_val;
48684     double val; /* the double value */
48685     int n_val;
48686 
48687     for (n_val = 0;n_val < gen_nb_double;n_val++) {
48688         mem_base = xmlMemBlocks();
48689         val = gen_double(n_val, 0);
48690 
48691         ret_val = xmlXPathNewFloat(val);
48692         desret_xmlXPathObjectPtr(ret_val);
48693         call_tests++;
48694         des_double(n_val, val, 0);
48695         xmlResetLastError();
48696         if (mem_base != xmlMemBlocks()) {
48697             printf("Leak of %d blocks found in xmlXPathNewFloat",
48698 	           xmlMemBlocks() - mem_base);
48699 	    test_ret++;
48700             printf(" %d", n_val);
48701             printf("\n");
48702         }
48703     }
48704     function_tests++;
48705 #endif
48706 
48707     return(test_ret);
48708 }
48709 
48710 
48711 static int
test_xmlXPathNewNodeSet(void)48712 test_xmlXPathNewNodeSet(void) {
48713     int test_ret = 0;
48714 
48715 #if defined(LIBXML_XPATH_ENABLED)
48716     int mem_base;
48717     xmlXPathObjectPtr ret_val;
48718     xmlNodePtr val; /* the NodePtr value */
48719     int n_val;
48720 
48721     for (n_val = 0;n_val < gen_nb_xmlNodePtr;n_val++) {
48722         mem_base = xmlMemBlocks();
48723         val = gen_xmlNodePtr(n_val, 0);
48724 
48725         ret_val = xmlXPathNewNodeSet(val);
48726         desret_xmlXPathObjectPtr(ret_val);
48727         call_tests++;
48728         des_xmlNodePtr(n_val, val, 0);
48729         xmlResetLastError();
48730         if (mem_base != xmlMemBlocks()) {
48731             printf("Leak of %d blocks found in xmlXPathNewNodeSet",
48732 	           xmlMemBlocks() - mem_base);
48733 	    test_ret++;
48734             printf(" %d", n_val);
48735             printf("\n");
48736         }
48737     }
48738     function_tests++;
48739 #endif
48740 
48741     return(test_ret);
48742 }
48743 
48744 
48745 static int
test_xmlXPathNewNodeSetList(void)48746 test_xmlXPathNewNodeSetList(void) {
48747     int test_ret = 0;
48748 
48749 #if defined(LIBXML_XPATH_ENABLED)
48750     int mem_base;
48751     xmlXPathObjectPtr ret_val;
48752     xmlNodeSetPtr val; /* an existing NodeSet */
48753     int n_val;
48754 
48755     for (n_val = 0;n_val < gen_nb_xmlNodeSetPtr;n_val++) {
48756         mem_base = xmlMemBlocks();
48757         val = gen_xmlNodeSetPtr(n_val, 0);
48758 
48759         ret_val = xmlXPathNewNodeSetList(val);
48760         desret_xmlXPathObjectPtr(ret_val);
48761         call_tests++;
48762         des_xmlNodeSetPtr(n_val, val, 0);
48763         xmlResetLastError();
48764         if (mem_base != xmlMemBlocks()) {
48765             printf("Leak of %d blocks found in xmlXPathNewNodeSetList",
48766 	           xmlMemBlocks() - mem_base);
48767 	    test_ret++;
48768             printf(" %d", n_val);
48769             printf("\n");
48770         }
48771     }
48772     function_tests++;
48773 #endif
48774 
48775     return(test_ret);
48776 }
48777 
48778 
48779 static int
test_xmlXPathNewParserContext(void)48780 test_xmlXPathNewParserContext(void) {
48781     int test_ret = 0;
48782 
48783 
48784     /* missing type support */
48785     return(test_ret);
48786 }
48787 
48788 
48789 static int
test_xmlXPathNewString(void)48790 test_xmlXPathNewString(void) {
48791     int test_ret = 0;
48792 
48793 #if defined(LIBXML_XPATH_ENABLED)
48794     int mem_base;
48795     xmlXPathObjectPtr ret_val;
48796     xmlChar * val; /* the xmlChar * value */
48797     int n_val;
48798 
48799     for (n_val = 0;n_val < gen_nb_const_xmlChar_ptr;n_val++) {
48800         mem_base = xmlMemBlocks();
48801         val = gen_const_xmlChar_ptr(n_val, 0);
48802 
48803         ret_val = xmlXPathNewString((const xmlChar *)val);
48804         desret_xmlXPathObjectPtr(ret_val);
48805         call_tests++;
48806         des_const_xmlChar_ptr(n_val, (const xmlChar *)val, 0);
48807         xmlResetLastError();
48808         if (mem_base != xmlMemBlocks()) {
48809             printf("Leak of %d blocks found in xmlXPathNewString",
48810 	           xmlMemBlocks() - mem_base);
48811 	    test_ret++;
48812             printf(" %d", n_val);
48813             printf("\n");
48814         }
48815     }
48816     function_tests++;
48817 #endif
48818 
48819     return(test_ret);
48820 }
48821 
48822 
48823 static int
test_xmlXPathNextAncestor(void)48824 test_xmlXPathNextAncestor(void) {
48825     int test_ret = 0;
48826 
48827 #if defined(LIBXML_XPATH_ENABLED)
48828     int mem_base;
48829     xmlNodePtr ret_val;
48830     xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
48831     int n_ctxt;
48832     xmlNodePtr cur; /* the current node in the traversal */
48833     int n_cur;
48834 
48835     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
48836     for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
48837         mem_base = xmlMemBlocks();
48838         ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
48839         cur = gen_xmlNodePtr(n_cur, 1);
48840 
48841         ret_val = xmlXPathNextAncestor(ctxt, cur);
48842         desret_xmlNodePtr(ret_val);
48843         call_tests++;
48844         des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
48845         des_xmlNodePtr(n_cur, cur, 1);
48846         xmlResetLastError();
48847         if (mem_base != xmlMemBlocks()) {
48848             printf("Leak of %d blocks found in xmlXPathNextAncestor",
48849 	           xmlMemBlocks() - mem_base);
48850 	    test_ret++;
48851             printf(" %d", n_ctxt);
48852             printf(" %d", n_cur);
48853             printf("\n");
48854         }
48855     }
48856     }
48857     function_tests++;
48858 #endif
48859 
48860     return(test_ret);
48861 }
48862 
48863 
48864 static int
test_xmlXPathNextAncestorOrSelf(void)48865 test_xmlXPathNextAncestorOrSelf(void) {
48866     int test_ret = 0;
48867 
48868 #if defined(LIBXML_XPATH_ENABLED)
48869     int mem_base;
48870     xmlNodePtr ret_val;
48871     xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
48872     int n_ctxt;
48873     xmlNodePtr cur; /* the current node in the traversal */
48874     int n_cur;
48875 
48876     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
48877     for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
48878         mem_base = xmlMemBlocks();
48879         ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
48880         cur = gen_xmlNodePtr(n_cur, 1);
48881 
48882         ret_val = xmlXPathNextAncestorOrSelf(ctxt, cur);
48883         desret_xmlNodePtr(ret_val);
48884         call_tests++;
48885         des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
48886         des_xmlNodePtr(n_cur, cur, 1);
48887         xmlResetLastError();
48888         if (mem_base != xmlMemBlocks()) {
48889             printf("Leak of %d blocks found in xmlXPathNextAncestorOrSelf",
48890 	           xmlMemBlocks() - mem_base);
48891 	    test_ret++;
48892             printf(" %d", n_ctxt);
48893             printf(" %d", n_cur);
48894             printf("\n");
48895         }
48896     }
48897     }
48898     function_tests++;
48899 #endif
48900 
48901     return(test_ret);
48902 }
48903 
48904 
48905 static int
test_xmlXPathNextAttribute(void)48906 test_xmlXPathNextAttribute(void) {
48907     int test_ret = 0;
48908 
48909 #if defined(LIBXML_XPATH_ENABLED)
48910     int mem_base;
48911     xmlNodePtr ret_val;
48912     xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
48913     int n_ctxt;
48914     xmlNodePtr cur; /* the current attribute in the traversal */
48915     int n_cur;
48916 
48917     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
48918     for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
48919         mem_base = xmlMemBlocks();
48920         ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
48921         cur = gen_xmlNodePtr(n_cur, 1);
48922 
48923         ret_val = xmlXPathNextAttribute(ctxt, cur);
48924         desret_xmlNodePtr(ret_val);
48925         call_tests++;
48926         des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
48927         des_xmlNodePtr(n_cur, cur, 1);
48928         xmlResetLastError();
48929         if (mem_base != xmlMemBlocks()) {
48930             printf("Leak of %d blocks found in xmlXPathNextAttribute",
48931 	           xmlMemBlocks() - mem_base);
48932 	    test_ret++;
48933             printf(" %d", n_ctxt);
48934             printf(" %d", n_cur);
48935             printf("\n");
48936         }
48937     }
48938     }
48939     function_tests++;
48940 #endif
48941 
48942     return(test_ret);
48943 }
48944 
48945 
48946 static int
test_xmlXPathNextChild(void)48947 test_xmlXPathNextChild(void) {
48948     int test_ret = 0;
48949 
48950 #if defined(LIBXML_XPATH_ENABLED)
48951     int mem_base;
48952     xmlNodePtr ret_val;
48953     xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
48954     int n_ctxt;
48955     xmlNodePtr cur; /* the current node in the traversal */
48956     int n_cur;
48957 
48958     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
48959     for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
48960         mem_base = xmlMemBlocks();
48961         ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
48962         cur = gen_xmlNodePtr(n_cur, 1);
48963 
48964         ret_val = xmlXPathNextChild(ctxt, cur);
48965         desret_xmlNodePtr(ret_val);
48966         call_tests++;
48967         des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
48968         des_xmlNodePtr(n_cur, cur, 1);
48969         xmlResetLastError();
48970         if (mem_base != xmlMemBlocks()) {
48971             printf("Leak of %d blocks found in xmlXPathNextChild",
48972 	           xmlMemBlocks() - mem_base);
48973 	    test_ret++;
48974             printf(" %d", n_ctxt);
48975             printf(" %d", n_cur);
48976             printf("\n");
48977         }
48978     }
48979     }
48980     function_tests++;
48981 #endif
48982 
48983     return(test_ret);
48984 }
48985 
48986 
48987 static int
test_xmlXPathNextDescendant(void)48988 test_xmlXPathNextDescendant(void) {
48989     int test_ret = 0;
48990 
48991 #if defined(LIBXML_XPATH_ENABLED)
48992     int mem_base;
48993     xmlNodePtr ret_val;
48994     xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
48995     int n_ctxt;
48996     xmlNodePtr cur; /* the current node in the traversal */
48997     int n_cur;
48998 
48999     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
49000     for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
49001         mem_base = xmlMemBlocks();
49002         ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
49003         cur = gen_xmlNodePtr(n_cur, 1);
49004 
49005         ret_val = xmlXPathNextDescendant(ctxt, cur);
49006         desret_xmlNodePtr(ret_val);
49007         call_tests++;
49008         des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
49009         des_xmlNodePtr(n_cur, cur, 1);
49010         xmlResetLastError();
49011         if (mem_base != xmlMemBlocks()) {
49012             printf("Leak of %d blocks found in xmlXPathNextDescendant",
49013 	           xmlMemBlocks() - mem_base);
49014 	    test_ret++;
49015             printf(" %d", n_ctxt);
49016             printf(" %d", n_cur);
49017             printf("\n");
49018         }
49019     }
49020     }
49021     function_tests++;
49022 #endif
49023 
49024     return(test_ret);
49025 }
49026 
49027 
49028 static int
test_xmlXPathNextDescendantOrSelf(void)49029 test_xmlXPathNextDescendantOrSelf(void) {
49030     int test_ret = 0;
49031 
49032 #if defined(LIBXML_XPATH_ENABLED)
49033     int mem_base;
49034     xmlNodePtr ret_val;
49035     xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
49036     int n_ctxt;
49037     xmlNodePtr cur; /* the current node in the traversal */
49038     int n_cur;
49039 
49040     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
49041     for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
49042         mem_base = xmlMemBlocks();
49043         ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
49044         cur = gen_xmlNodePtr(n_cur, 1);
49045 
49046         ret_val = xmlXPathNextDescendantOrSelf(ctxt, cur);
49047         desret_xmlNodePtr(ret_val);
49048         call_tests++;
49049         des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
49050         des_xmlNodePtr(n_cur, cur, 1);
49051         xmlResetLastError();
49052         if (mem_base != xmlMemBlocks()) {
49053             printf("Leak of %d blocks found in xmlXPathNextDescendantOrSelf",
49054 	           xmlMemBlocks() - mem_base);
49055 	    test_ret++;
49056             printf(" %d", n_ctxt);
49057             printf(" %d", n_cur);
49058             printf("\n");
49059         }
49060     }
49061     }
49062     function_tests++;
49063 #endif
49064 
49065     return(test_ret);
49066 }
49067 
49068 
49069 static int
test_xmlXPathNextFollowing(void)49070 test_xmlXPathNextFollowing(void) {
49071     int test_ret = 0;
49072 
49073 #if defined(LIBXML_XPATH_ENABLED)
49074     int mem_base;
49075     xmlNodePtr ret_val;
49076     xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
49077     int n_ctxt;
49078     xmlNodePtr cur; /* the current node in the traversal */
49079     int n_cur;
49080 
49081     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
49082     for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
49083         mem_base = xmlMemBlocks();
49084         ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
49085         cur = gen_xmlNodePtr(n_cur, 1);
49086 
49087         ret_val = xmlXPathNextFollowing(ctxt, cur);
49088         desret_xmlNodePtr(ret_val);
49089         call_tests++;
49090         des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
49091         des_xmlNodePtr(n_cur, cur, 1);
49092         xmlResetLastError();
49093         if (mem_base != xmlMemBlocks()) {
49094             printf("Leak of %d blocks found in xmlXPathNextFollowing",
49095 	           xmlMemBlocks() - mem_base);
49096 	    test_ret++;
49097             printf(" %d", n_ctxt);
49098             printf(" %d", n_cur);
49099             printf("\n");
49100         }
49101     }
49102     }
49103     function_tests++;
49104 #endif
49105 
49106     return(test_ret);
49107 }
49108 
49109 
49110 static int
test_xmlXPathNextFollowingSibling(void)49111 test_xmlXPathNextFollowingSibling(void) {
49112     int test_ret = 0;
49113 
49114 #if defined(LIBXML_XPATH_ENABLED)
49115     int mem_base;
49116     xmlNodePtr ret_val;
49117     xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
49118     int n_ctxt;
49119     xmlNodePtr cur; /* the current node in the traversal */
49120     int n_cur;
49121 
49122     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
49123     for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
49124         mem_base = xmlMemBlocks();
49125         ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
49126         cur = gen_xmlNodePtr(n_cur, 1);
49127 
49128         ret_val = xmlXPathNextFollowingSibling(ctxt, cur);
49129         desret_xmlNodePtr(ret_val);
49130         call_tests++;
49131         des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
49132         des_xmlNodePtr(n_cur, cur, 1);
49133         xmlResetLastError();
49134         if (mem_base != xmlMemBlocks()) {
49135             printf("Leak of %d blocks found in xmlXPathNextFollowingSibling",
49136 	           xmlMemBlocks() - mem_base);
49137 	    test_ret++;
49138             printf(" %d", n_ctxt);
49139             printf(" %d", n_cur);
49140             printf("\n");
49141         }
49142     }
49143     }
49144     function_tests++;
49145 #endif
49146 
49147     return(test_ret);
49148 }
49149 
49150 
49151 static int
test_xmlXPathNextNamespace(void)49152 test_xmlXPathNextNamespace(void) {
49153     int test_ret = 0;
49154 
49155 #if defined(LIBXML_XPATH_ENABLED)
49156     int mem_base;
49157     xmlNodePtr ret_val;
49158     xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
49159     int n_ctxt;
49160     xmlNodePtr cur; /* the current attribute in the traversal */
49161     int n_cur;
49162 
49163     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
49164     for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
49165         mem_base = xmlMemBlocks();
49166         ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
49167         cur = gen_xmlNodePtr(n_cur, 1);
49168 
49169         ret_val = xmlXPathNextNamespace(ctxt, cur);
49170         desret_xmlNodePtr(ret_val);
49171         call_tests++;
49172         des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
49173         des_xmlNodePtr(n_cur, cur, 1);
49174         xmlResetLastError();
49175         if (mem_base != xmlMemBlocks()) {
49176             printf("Leak of %d blocks found in xmlXPathNextNamespace",
49177 	           xmlMemBlocks() - mem_base);
49178 	    test_ret++;
49179             printf(" %d", n_ctxt);
49180             printf(" %d", n_cur);
49181             printf("\n");
49182         }
49183     }
49184     }
49185     function_tests++;
49186 #endif
49187 
49188     return(test_ret);
49189 }
49190 
49191 
49192 static int
test_xmlXPathNextParent(void)49193 test_xmlXPathNextParent(void) {
49194     int test_ret = 0;
49195 
49196 #if defined(LIBXML_XPATH_ENABLED)
49197     int mem_base;
49198     xmlNodePtr ret_val;
49199     xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
49200     int n_ctxt;
49201     xmlNodePtr cur; /* the current node in the traversal */
49202     int n_cur;
49203 
49204     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
49205     for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
49206         mem_base = xmlMemBlocks();
49207         ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
49208         cur = gen_xmlNodePtr(n_cur, 1);
49209 
49210         ret_val = xmlXPathNextParent(ctxt, cur);
49211         desret_xmlNodePtr(ret_val);
49212         call_tests++;
49213         des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
49214         des_xmlNodePtr(n_cur, cur, 1);
49215         xmlResetLastError();
49216         if (mem_base != xmlMemBlocks()) {
49217             printf("Leak of %d blocks found in xmlXPathNextParent",
49218 	           xmlMemBlocks() - mem_base);
49219 	    test_ret++;
49220             printf(" %d", n_ctxt);
49221             printf(" %d", n_cur);
49222             printf("\n");
49223         }
49224     }
49225     }
49226     function_tests++;
49227 #endif
49228 
49229     return(test_ret);
49230 }
49231 
49232 
49233 static int
test_xmlXPathNextPreceding(void)49234 test_xmlXPathNextPreceding(void) {
49235     int test_ret = 0;
49236 
49237 #if defined(LIBXML_XPATH_ENABLED)
49238     int mem_base;
49239     xmlNodePtr ret_val;
49240     xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
49241     int n_ctxt;
49242     xmlNodePtr cur; /* the current node in the traversal */
49243     int n_cur;
49244 
49245     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
49246     for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
49247         mem_base = xmlMemBlocks();
49248         ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
49249         cur = gen_xmlNodePtr(n_cur, 1);
49250 
49251         ret_val = xmlXPathNextPreceding(ctxt, cur);
49252         desret_xmlNodePtr(ret_val);
49253         call_tests++;
49254         des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
49255         des_xmlNodePtr(n_cur, cur, 1);
49256         xmlResetLastError();
49257         if (mem_base != xmlMemBlocks()) {
49258             printf("Leak of %d blocks found in xmlXPathNextPreceding",
49259 	           xmlMemBlocks() - mem_base);
49260 	    test_ret++;
49261             printf(" %d", n_ctxt);
49262             printf(" %d", n_cur);
49263             printf("\n");
49264         }
49265     }
49266     }
49267     function_tests++;
49268 #endif
49269 
49270     return(test_ret);
49271 }
49272 
49273 
49274 static int
test_xmlXPathNextPrecedingSibling(void)49275 test_xmlXPathNextPrecedingSibling(void) {
49276     int test_ret = 0;
49277 
49278 #if defined(LIBXML_XPATH_ENABLED)
49279     int mem_base;
49280     xmlNodePtr ret_val;
49281     xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
49282     int n_ctxt;
49283     xmlNodePtr cur; /* the current node in the traversal */
49284     int n_cur;
49285 
49286     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
49287     for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
49288         mem_base = xmlMemBlocks();
49289         ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
49290         cur = gen_xmlNodePtr(n_cur, 1);
49291 
49292         ret_val = xmlXPathNextPrecedingSibling(ctxt, cur);
49293         desret_xmlNodePtr(ret_val);
49294         call_tests++;
49295         des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
49296         des_xmlNodePtr(n_cur, cur, 1);
49297         xmlResetLastError();
49298         if (mem_base != xmlMemBlocks()) {
49299             printf("Leak of %d blocks found in xmlXPathNextPrecedingSibling",
49300 	           xmlMemBlocks() - mem_base);
49301 	    test_ret++;
49302             printf(" %d", n_ctxt);
49303             printf(" %d", n_cur);
49304             printf("\n");
49305         }
49306     }
49307     }
49308     function_tests++;
49309 #endif
49310 
49311     return(test_ret);
49312 }
49313 
49314 
49315 static int
test_xmlXPathNextSelf(void)49316 test_xmlXPathNextSelf(void) {
49317     int test_ret = 0;
49318 
49319 #if defined(LIBXML_XPATH_ENABLED)
49320     int mem_base;
49321     xmlNodePtr ret_val;
49322     xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
49323     int n_ctxt;
49324     xmlNodePtr cur; /* the current node in the traversal */
49325     int n_cur;
49326 
49327     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
49328     for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
49329         mem_base = xmlMemBlocks();
49330         ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
49331         cur = gen_xmlNodePtr(n_cur, 1);
49332 
49333         ret_val = xmlXPathNextSelf(ctxt, cur);
49334         desret_xmlNodePtr(ret_val);
49335         call_tests++;
49336         des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
49337         des_xmlNodePtr(n_cur, cur, 1);
49338         xmlResetLastError();
49339         if (mem_base != xmlMemBlocks()) {
49340             printf("Leak of %d blocks found in xmlXPathNextSelf",
49341 	           xmlMemBlocks() - mem_base);
49342 	    test_ret++;
49343             printf(" %d", n_ctxt);
49344             printf(" %d", n_cur);
49345             printf("\n");
49346         }
49347     }
49348     }
49349     function_tests++;
49350 #endif
49351 
49352     return(test_ret);
49353 }
49354 
49355 
49356 static int
test_xmlXPathNodeLeading(void)49357 test_xmlXPathNodeLeading(void) {
49358     int test_ret = 0;
49359 
49360 #if defined(LIBXML_XPATH_ENABLED)
49361     int mem_base;
49362     xmlNodeSetPtr ret_val;
49363     xmlNodeSetPtr nodes; /* a node-set */
49364     int n_nodes;
49365     xmlNodePtr node; /* a node */
49366     int n_node;
49367 
49368     for (n_nodes = 0;n_nodes < gen_nb_xmlNodeSetPtr;n_nodes++) {
49369     for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
49370         mem_base = xmlMemBlocks();
49371         nodes = gen_xmlNodeSetPtr(n_nodes, 0);
49372         node = gen_xmlNodePtr(n_node, 1);
49373 
49374         ret_val = xmlXPathNodeLeading(nodes, node);
49375         desret_xmlNodeSetPtr(ret_val);
49376         call_tests++;
49377         des_xmlNodeSetPtr(n_nodes, nodes, 0);
49378         des_xmlNodePtr(n_node, node, 1);
49379         xmlResetLastError();
49380         if (mem_base != xmlMemBlocks()) {
49381             printf("Leak of %d blocks found in xmlXPathNodeLeading",
49382 	           xmlMemBlocks() - mem_base);
49383 	    test_ret++;
49384             printf(" %d", n_nodes);
49385             printf(" %d", n_node);
49386             printf("\n");
49387         }
49388     }
49389     }
49390     function_tests++;
49391 #endif
49392 
49393     return(test_ret);
49394 }
49395 
49396 
49397 static int
test_xmlXPathNodeLeadingSorted(void)49398 test_xmlXPathNodeLeadingSorted(void) {
49399     int test_ret = 0;
49400 
49401 #if defined(LIBXML_XPATH_ENABLED)
49402     int mem_base;
49403     xmlNodeSetPtr ret_val;
49404     xmlNodeSetPtr nodes; /* a node-set, sorted by document order */
49405     int n_nodes;
49406     xmlNodePtr node; /* a node */
49407     int n_node;
49408 
49409     for (n_nodes = 0;n_nodes < gen_nb_xmlNodeSetPtr;n_nodes++) {
49410     for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
49411         mem_base = xmlMemBlocks();
49412         nodes = gen_xmlNodeSetPtr(n_nodes, 0);
49413         node = gen_xmlNodePtr(n_node, 1);
49414 
49415         ret_val = xmlXPathNodeLeadingSorted(nodes, node);
49416         desret_xmlNodeSetPtr(ret_val);
49417         call_tests++;
49418         des_xmlNodeSetPtr(n_nodes, nodes, 0);
49419         des_xmlNodePtr(n_node, node, 1);
49420         xmlResetLastError();
49421         if (mem_base != xmlMemBlocks()) {
49422             printf("Leak of %d blocks found in xmlXPathNodeLeadingSorted",
49423 	           xmlMemBlocks() - mem_base);
49424 	    test_ret++;
49425             printf(" %d", n_nodes);
49426             printf(" %d", n_node);
49427             printf("\n");
49428         }
49429     }
49430     }
49431     function_tests++;
49432 #endif
49433 
49434     return(test_ret);
49435 }
49436 
49437 
49438 static int
test_xmlXPathNodeSetAdd(void)49439 test_xmlXPathNodeSetAdd(void) {
49440     int test_ret = 0;
49441 
49442 #if defined(LIBXML_XPATH_ENABLED)
49443     int mem_base;
49444     int ret_val;
49445     xmlNodeSetPtr cur; /* the initial node set */
49446     int n_cur;
49447     xmlNodePtr val; /* a new xmlNodePtr */
49448     int n_val;
49449 
49450     for (n_cur = 0;n_cur < gen_nb_xmlNodeSetPtr;n_cur++) {
49451     for (n_val = 0;n_val < gen_nb_xmlNodePtr;n_val++) {
49452         mem_base = xmlMemBlocks();
49453         cur = gen_xmlNodeSetPtr(n_cur, 0);
49454         val = gen_xmlNodePtr(n_val, 1);
49455 
49456         ret_val = xmlXPathNodeSetAdd(cur, val);
49457         desret_int(ret_val);
49458         call_tests++;
49459         des_xmlNodeSetPtr(n_cur, cur, 0);
49460         des_xmlNodePtr(n_val, val, 1);
49461         xmlResetLastError();
49462         if (mem_base != xmlMemBlocks()) {
49463             printf("Leak of %d blocks found in xmlXPathNodeSetAdd",
49464 	           xmlMemBlocks() - mem_base);
49465 	    test_ret++;
49466             printf(" %d", n_cur);
49467             printf(" %d", n_val);
49468             printf("\n");
49469         }
49470     }
49471     }
49472     function_tests++;
49473 #endif
49474 
49475     return(test_ret);
49476 }
49477 
49478 
49479 static int
test_xmlXPathNodeSetAddNs(void)49480 test_xmlXPathNodeSetAddNs(void) {
49481     int test_ret = 0;
49482 
49483 #if defined(LIBXML_XPATH_ENABLED)
49484     int mem_base;
49485     int ret_val;
49486     xmlNodeSetPtr cur; /* the initial node set */
49487     int n_cur;
49488     xmlNodePtr node; /* the hosting node */
49489     int n_node;
49490     xmlNsPtr ns; /* a the namespace node */
49491     int n_ns;
49492 
49493     for (n_cur = 0;n_cur < gen_nb_xmlNodeSetPtr;n_cur++) {
49494     for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
49495     for (n_ns = 0;n_ns < gen_nb_xmlNsPtr;n_ns++) {
49496         mem_base = xmlMemBlocks();
49497         cur = gen_xmlNodeSetPtr(n_cur, 0);
49498         node = gen_xmlNodePtr(n_node, 1);
49499         ns = gen_xmlNsPtr(n_ns, 2);
49500 
49501         ret_val = xmlXPathNodeSetAddNs(cur, node, ns);
49502         desret_int(ret_val);
49503         call_tests++;
49504         des_xmlNodeSetPtr(n_cur, cur, 0);
49505         des_xmlNodePtr(n_node, node, 1);
49506         des_xmlNsPtr(n_ns, ns, 2);
49507         xmlResetLastError();
49508         if (mem_base != xmlMemBlocks()) {
49509             printf("Leak of %d blocks found in xmlXPathNodeSetAddNs",
49510 	           xmlMemBlocks() - mem_base);
49511 	    test_ret++;
49512             printf(" %d", n_cur);
49513             printf(" %d", n_node);
49514             printf(" %d", n_ns);
49515             printf("\n");
49516         }
49517     }
49518     }
49519     }
49520     function_tests++;
49521 #endif
49522 
49523     return(test_ret);
49524 }
49525 
49526 
49527 static int
test_xmlXPathNodeSetAddUnique(void)49528 test_xmlXPathNodeSetAddUnique(void) {
49529     int test_ret = 0;
49530 
49531 #if defined(LIBXML_XPATH_ENABLED)
49532     int mem_base;
49533     int ret_val;
49534     xmlNodeSetPtr cur; /* the initial node set */
49535     int n_cur;
49536     xmlNodePtr val; /* a new xmlNodePtr */
49537     int n_val;
49538 
49539     for (n_cur = 0;n_cur < gen_nb_xmlNodeSetPtr;n_cur++) {
49540     for (n_val = 0;n_val < gen_nb_xmlNodePtr;n_val++) {
49541         mem_base = xmlMemBlocks();
49542         cur = gen_xmlNodeSetPtr(n_cur, 0);
49543         val = gen_xmlNodePtr(n_val, 1);
49544 
49545         ret_val = xmlXPathNodeSetAddUnique(cur, val);
49546         desret_int(ret_val);
49547         call_tests++;
49548         des_xmlNodeSetPtr(n_cur, cur, 0);
49549         des_xmlNodePtr(n_val, val, 1);
49550         xmlResetLastError();
49551         if (mem_base != xmlMemBlocks()) {
49552             printf("Leak of %d blocks found in xmlXPathNodeSetAddUnique",
49553 	           xmlMemBlocks() - mem_base);
49554 	    test_ret++;
49555             printf(" %d", n_cur);
49556             printf(" %d", n_val);
49557             printf("\n");
49558         }
49559     }
49560     }
49561     function_tests++;
49562 #endif
49563 
49564     return(test_ret);
49565 }
49566 
49567 
49568 static int
test_xmlXPathNodeSetContains(void)49569 test_xmlXPathNodeSetContains(void) {
49570     int test_ret = 0;
49571 
49572 #if defined(LIBXML_XPATH_ENABLED)
49573     int mem_base;
49574     int ret_val;
49575     xmlNodeSetPtr cur; /* the node-set */
49576     int n_cur;
49577     xmlNodePtr val; /* the node */
49578     int n_val;
49579 
49580     for (n_cur = 0;n_cur < gen_nb_xmlNodeSetPtr;n_cur++) {
49581     for (n_val = 0;n_val < gen_nb_xmlNodePtr;n_val++) {
49582         mem_base = xmlMemBlocks();
49583         cur = gen_xmlNodeSetPtr(n_cur, 0);
49584         val = gen_xmlNodePtr(n_val, 1);
49585 
49586         ret_val = xmlXPathNodeSetContains(cur, val);
49587         desret_int(ret_val);
49588         call_tests++;
49589         des_xmlNodeSetPtr(n_cur, cur, 0);
49590         des_xmlNodePtr(n_val, val, 1);
49591         xmlResetLastError();
49592         if (mem_base != xmlMemBlocks()) {
49593             printf("Leak of %d blocks found in xmlXPathNodeSetContains",
49594 	           xmlMemBlocks() - mem_base);
49595 	    test_ret++;
49596             printf(" %d", n_cur);
49597             printf(" %d", n_val);
49598             printf("\n");
49599         }
49600     }
49601     }
49602     function_tests++;
49603 #endif
49604 
49605     return(test_ret);
49606 }
49607 
49608 
49609 static int
test_xmlXPathNodeSetDel(void)49610 test_xmlXPathNodeSetDel(void) {
49611     int test_ret = 0;
49612 
49613 #if defined(LIBXML_XPATH_ENABLED)
49614     int mem_base;
49615     xmlNodeSetPtr cur; /* the initial node set */
49616     int n_cur;
49617     xmlNodePtr val; /* an xmlNodePtr */
49618     int n_val;
49619 
49620     for (n_cur = 0;n_cur < gen_nb_xmlNodeSetPtr;n_cur++) {
49621     for (n_val = 0;n_val < gen_nb_xmlNodePtr;n_val++) {
49622         mem_base = xmlMemBlocks();
49623         cur = gen_xmlNodeSetPtr(n_cur, 0);
49624         val = gen_xmlNodePtr(n_val, 1);
49625 
49626         xmlXPathNodeSetDel(cur, val);
49627         call_tests++;
49628         des_xmlNodeSetPtr(n_cur, cur, 0);
49629         des_xmlNodePtr(n_val, val, 1);
49630         xmlResetLastError();
49631         if (mem_base != xmlMemBlocks()) {
49632             printf("Leak of %d blocks found in xmlXPathNodeSetDel",
49633 	           xmlMemBlocks() - mem_base);
49634 	    test_ret++;
49635             printf(" %d", n_cur);
49636             printf(" %d", n_val);
49637             printf("\n");
49638         }
49639     }
49640     }
49641     function_tests++;
49642 #endif
49643 
49644     return(test_ret);
49645 }
49646 
49647 
49648 static int
test_xmlXPathNodeSetMerge(void)49649 test_xmlXPathNodeSetMerge(void) {
49650     int test_ret = 0;
49651 
49652 #if defined(LIBXML_XPATH_ENABLED)
49653     int mem_base;
49654     xmlNodeSetPtr ret_val;
49655     xmlNodeSetPtr val1; /* the first NodeSet or NULL */
49656     int n_val1;
49657     xmlNodeSetPtr val2; /* the second NodeSet */
49658     int n_val2;
49659 
49660     for (n_val1 = 0;n_val1 < gen_nb_xmlNodeSetPtr;n_val1++) {
49661     for (n_val2 = 0;n_val2 < gen_nb_xmlNodeSetPtr;n_val2++) {
49662         mem_base = xmlMemBlocks();
49663         val1 = gen_xmlNodeSetPtr(n_val1, 0);
49664         val2 = gen_xmlNodeSetPtr(n_val2, 1);
49665 
49666         ret_val = xmlXPathNodeSetMerge(val1, val2);
49667         desret_xmlNodeSetPtr(ret_val);
49668         call_tests++;
49669         des_xmlNodeSetPtr(n_val1, val1, 0);
49670         des_xmlNodeSetPtr(n_val2, val2, 1);
49671         xmlResetLastError();
49672         if (mem_base != xmlMemBlocks()) {
49673             printf("Leak of %d blocks found in xmlXPathNodeSetMerge",
49674 	           xmlMemBlocks() - mem_base);
49675 	    test_ret++;
49676             printf(" %d", n_val1);
49677             printf(" %d", n_val2);
49678             printf("\n");
49679         }
49680     }
49681     }
49682     function_tests++;
49683 #endif
49684 
49685     return(test_ret);
49686 }
49687 
49688 
49689 static int
test_xmlXPathNodeSetRemove(void)49690 test_xmlXPathNodeSetRemove(void) {
49691     int test_ret = 0;
49692 
49693 #if defined(LIBXML_XPATH_ENABLED)
49694     int mem_base;
49695     xmlNodeSetPtr cur; /* the initial node set */
49696     int n_cur;
49697     int val; /* the index to remove */
49698     int n_val;
49699 
49700     for (n_cur = 0;n_cur < gen_nb_xmlNodeSetPtr;n_cur++) {
49701     for (n_val = 0;n_val < gen_nb_int;n_val++) {
49702         mem_base = xmlMemBlocks();
49703         cur = gen_xmlNodeSetPtr(n_cur, 0);
49704         val = gen_int(n_val, 1);
49705 
49706         xmlXPathNodeSetRemove(cur, val);
49707         call_tests++;
49708         des_xmlNodeSetPtr(n_cur, cur, 0);
49709         des_int(n_val, val, 1);
49710         xmlResetLastError();
49711         if (mem_base != xmlMemBlocks()) {
49712             printf("Leak of %d blocks found in xmlXPathNodeSetRemove",
49713 	           xmlMemBlocks() - mem_base);
49714 	    test_ret++;
49715             printf(" %d", n_cur);
49716             printf(" %d", n_val);
49717             printf("\n");
49718         }
49719     }
49720     }
49721     function_tests++;
49722 #endif
49723 
49724     return(test_ret);
49725 }
49726 
49727 
49728 static int
test_xmlXPathNodeSetSort(void)49729 test_xmlXPathNodeSetSort(void) {
49730     int test_ret = 0;
49731 
49732 #if defined(LIBXML_XPATH_ENABLED)
49733     int mem_base;
49734     xmlNodeSetPtr set; /* the node set */
49735     int n_set;
49736 
49737     for (n_set = 0;n_set < gen_nb_xmlNodeSetPtr;n_set++) {
49738         mem_base = xmlMemBlocks();
49739         set = gen_xmlNodeSetPtr(n_set, 0);
49740 
49741         xmlXPathNodeSetSort(set);
49742         call_tests++;
49743         des_xmlNodeSetPtr(n_set, set, 0);
49744         xmlResetLastError();
49745         if (mem_base != xmlMemBlocks()) {
49746             printf("Leak of %d blocks found in xmlXPathNodeSetSort",
49747 	           xmlMemBlocks() - mem_base);
49748 	    test_ret++;
49749             printf(" %d", n_set);
49750             printf("\n");
49751         }
49752     }
49753     function_tests++;
49754 #endif
49755 
49756     return(test_ret);
49757 }
49758 
49759 
49760 static int
test_xmlXPathNodeTrailing(void)49761 test_xmlXPathNodeTrailing(void) {
49762     int test_ret = 0;
49763 
49764 #if defined(LIBXML_XPATH_ENABLED)
49765     int mem_base;
49766     xmlNodeSetPtr ret_val;
49767     xmlNodeSetPtr nodes; /* a node-set */
49768     int n_nodes;
49769     xmlNodePtr node; /* a node */
49770     int n_node;
49771 
49772     for (n_nodes = 0;n_nodes < gen_nb_xmlNodeSetPtr;n_nodes++) {
49773     for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
49774         mem_base = xmlMemBlocks();
49775         nodes = gen_xmlNodeSetPtr(n_nodes, 0);
49776         node = gen_xmlNodePtr(n_node, 1);
49777 
49778         ret_val = xmlXPathNodeTrailing(nodes, node);
49779         desret_xmlNodeSetPtr(ret_val);
49780         call_tests++;
49781         des_xmlNodeSetPtr(n_nodes, nodes, 0);
49782         des_xmlNodePtr(n_node, node, 1);
49783         xmlResetLastError();
49784         if (mem_base != xmlMemBlocks()) {
49785             printf("Leak of %d blocks found in xmlXPathNodeTrailing",
49786 	           xmlMemBlocks() - mem_base);
49787 	    test_ret++;
49788             printf(" %d", n_nodes);
49789             printf(" %d", n_node);
49790             printf("\n");
49791         }
49792     }
49793     }
49794     function_tests++;
49795 #endif
49796 
49797     return(test_ret);
49798 }
49799 
49800 
49801 static int
test_xmlXPathNodeTrailingSorted(void)49802 test_xmlXPathNodeTrailingSorted(void) {
49803     int test_ret = 0;
49804 
49805 #if defined(LIBXML_XPATH_ENABLED)
49806     int mem_base;
49807     xmlNodeSetPtr ret_val;
49808     xmlNodeSetPtr nodes; /* a node-set, sorted by document order */
49809     int n_nodes;
49810     xmlNodePtr node; /* a node */
49811     int n_node;
49812 
49813     for (n_nodes = 0;n_nodes < gen_nb_xmlNodeSetPtr;n_nodes++) {
49814     for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
49815         mem_base = xmlMemBlocks();
49816         nodes = gen_xmlNodeSetPtr(n_nodes, 0);
49817         node = gen_xmlNodePtr(n_node, 1);
49818 
49819         ret_val = xmlXPathNodeTrailingSorted(nodes, node);
49820         desret_xmlNodeSetPtr(ret_val);
49821         call_tests++;
49822         des_xmlNodeSetPtr(n_nodes, nodes, 0);
49823         des_xmlNodePtr(n_node, node, 1);
49824         xmlResetLastError();
49825         if (mem_base != xmlMemBlocks()) {
49826             printf("Leak of %d blocks found in xmlXPathNodeTrailingSorted",
49827 	           xmlMemBlocks() - mem_base);
49828 	    test_ret++;
49829             printf(" %d", n_nodes);
49830             printf(" %d", n_node);
49831             printf("\n");
49832         }
49833     }
49834     }
49835     function_tests++;
49836 #endif
49837 
49838     return(test_ret);
49839 }
49840 
49841 
49842 static int
test_xmlXPathNormalizeFunction(void)49843 test_xmlXPathNormalizeFunction(void) {
49844     int test_ret = 0;
49845 
49846 #if defined(LIBXML_XPATH_ENABLED)
49847     int mem_base;
49848     xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
49849     int n_ctxt;
49850     int nargs; /* the number of arguments */
49851     int n_nargs;
49852 
49853     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
49854     for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
49855         mem_base = xmlMemBlocks();
49856         ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
49857         nargs = gen_int(n_nargs, 1);
49858 
49859         xmlXPathNormalizeFunction(ctxt, nargs);
49860         call_tests++;
49861         des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
49862         des_int(n_nargs, nargs, 1);
49863         xmlResetLastError();
49864         if (mem_base != xmlMemBlocks()) {
49865             printf("Leak of %d blocks found in xmlXPathNormalizeFunction",
49866 	           xmlMemBlocks() - mem_base);
49867 	    test_ret++;
49868             printf(" %d", n_ctxt);
49869             printf(" %d", n_nargs);
49870             printf("\n");
49871         }
49872     }
49873     }
49874     function_tests++;
49875 #endif
49876 
49877     return(test_ret);
49878 }
49879 
49880 
49881 static int
test_xmlXPathNotEqualValues(void)49882 test_xmlXPathNotEqualValues(void) {
49883     int test_ret = 0;
49884 
49885 #if defined(LIBXML_XPATH_ENABLED)
49886     int mem_base;
49887     int ret_val;
49888     xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
49889     int n_ctxt;
49890 
49891     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
49892         mem_base = xmlMemBlocks();
49893         ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
49894 
49895         ret_val = xmlXPathNotEqualValues(ctxt);
49896         desret_int(ret_val);
49897         call_tests++;
49898         des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
49899         xmlResetLastError();
49900         if (mem_base != xmlMemBlocks()) {
49901             printf("Leak of %d blocks found in xmlXPathNotEqualValues",
49902 	           xmlMemBlocks() - mem_base);
49903 	    test_ret++;
49904             printf(" %d", n_ctxt);
49905             printf("\n");
49906         }
49907     }
49908     function_tests++;
49909 #endif
49910 
49911     return(test_ret);
49912 }
49913 
49914 
49915 static int
test_xmlXPathNotFunction(void)49916 test_xmlXPathNotFunction(void) {
49917     int test_ret = 0;
49918 
49919 #if defined(LIBXML_XPATH_ENABLED)
49920     int mem_base;
49921     xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
49922     int n_ctxt;
49923     int nargs; /* the number of arguments */
49924     int n_nargs;
49925 
49926     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
49927     for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
49928         mem_base = xmlMemBlocks();
49929         ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
49930         nargs = gen_int(n_nargs, 1);
49931 
49932         xmlXPathNotFunction(ctxt, nargs);
49933         call_tests++;
49934         des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
49935         des_int(n_nargs, nargs, 1);
49936         xmlResetLastError();
49937         if (mem_base != xmlMemBlocks()) {
49938             printf("Leak of %d blocks found in xmlXPathNotFunction",
49939 	           xmlMemBlocks() - mem_base);
49940 	    test_ret++;
49941             printf(" %d", n_ctxt);
49942             printf(" %d", n_nargs);
49943             printf("\n");
49944         }
49945     }
49946     }
49947     function_tests++;
49948 #endif
49949 
49950     return(test_ret);
49951 }
49952 
49953 
49954 static int
test_xmlXPathNsLookup(void)49955 test_xmlXPathNsLookup(void) {
49956     int test_ret = 0;
49957 
49958 #if defined(LIBXML_XPATH_ENABLED)
49959     int mem_base;
49960     const xmlChar * ret_val;
49961     xmlXPathContextPtr ctxt; /* the XPath context */
49962     int n_ctxt;
49963     xmlChar * prefix; /* the namespace prefix value */
49964     int n_prefix;
49965 
49966     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathContextPtr;n_ctxt++) {
49967     for (n_prefix = 0;n_prefix < gen_nb_const_xmlChar_ptr;n_prefix++) {
49968         mem_base = xmlMemBlocks();
49969         ctxt = gen_xmlXPathContextPtr(n_ctxt, 0);
49970         prefix = gen_const_xmlChar_ptr(n_prefix, 1);
49971 
49972         ret_val = xmlXPathNsLookup(ctxt, (const xmlChar *)prefix);
49973         desret_const_xmlChar_ptr(ret_val);
49974         call_tests++;
49975         des_xmlXPathContextPtr(n_ctxt, ctxt, 0);
49976         des_const_xmlChar_ptr(n_prefix, (const xmlChar *)prefix, 1);
49977         xmlResetLastError();
49978         if (mem_base != xmlMemBlocks()) {
49979             printf("Leak of %d blocks found in xmlXPathNsLookup",
49980 	           xmlMemBlocks() - mem_base);
49981 	    test_ret++;
49982             printf(" %d", n_ctxt);
49983             printf(" %d", n_prefix);
49984             printf("\n");
49985         }
49986     }
49987     }
49988     function_tests++;
49989 #endif
49990 
49991     return(test_ret);
49992 }
49993 
49994 
49995 static int
test_xmlXPathNumberFunction(void)49996 test_xmlXPathNumberFunction(void) {
49997     int test_ret = 0;
49998 
49999 #if defined(LIBXML_XPATH_ENABLED)
50000     int mem_base;
50001     xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
50002     int n_ctxt;
50003     int nargs; /* the number of arguments */
50004     int n_nargs;
50005 
50006     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
50007     for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
50008         mem_base = xmlMemBlocks();
50009         ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
50010         nargs = gen_int(n_nargs, 1);
50011 
50012         xmlXPathNumberFunction(ctxt, nargs);
50013         call_tests++;
50014         des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
50015         des_int(n_nargs, nargs, 1);
50016         xmlResetLastError();
50017         if (mem_base != xmlMemBlocks()) {
50018             printf("Leak of %d blocks found in xmlXPathNumberFunction",
50019 	           xmlMemBlocks() - mem_base);
50020 	    test_ret++;
50021             printf(" %d", n_ctxt);
50022             printf(" %d", n_nargs);
50023             printf("\n");
50024         }
50025     }
50026     }
50027     function_tests++;
50028 #endif
50029 
50030     return(test_ret);
50031 }
50032 
50033 
50034 static int
test_xmlXPathParseNCName(void)50035 test_xmlXPathParseNCName(void) {
50036     int test_ret = 0;
50037 
50038 #if defined(LIBXML_XPATH_ENABLED)
50039     int mem_base;
50040     xmlChar * ret_val;
50041     xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
50042     int n_ctxt;
50043 
50044     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
50045         mem_base = xmlMemBlocks();
50046         ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
50047 
50048         ret_val = xmlXPathParseNCName(ctxt);
50049         desret_xmlChar_ptr(ret_val);
50050         call_tests++;
50051         des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
50052         xmlResetLastError();
50053         if (mem_base != xmlMemBlocks()) {
50054             printf("Leak of %d blocks found in xmlXPathParseNCName",
50055 	           xmlMemBlocks() - mem_base);
50056 	    test_ret++;
50057             printf(" %d", n_ctxt);
50058             printf("\n");
50059         }
50060     }
50061     function_tests++;
50062 #endif
50063 
50064     return(test_ret);
50065 }
50066 
50067 
50068 static int
test_xmlXPathParseName(void)50069 test_xmlXPathParseName(void) {
50070     int test_ret = 0;
50071 
50072 #if defined(LIBXML_XPATH_ENABLED)
50073     int mem_base;
50074     xmlChar * ret_val;
50075     xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
50076     int n_ctxt;
50077 
50078     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
50079         mem_base = xmlMemBlocks();
50080         ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
50081 
50082         ret_val = xmlXPathParseName(ctxt);
50083         desret_xmlChar_ptr(ret_val);
50084         call_tests++;
50085         des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
50086         xmlResetLastError();
50087         if (mem_base != xmlMemBlocks()) {
50088             printf("Leak of %d blocks found in xmlXPathParseName",
50089 	           xmlMemBlocks() - mem_base);
50090 	    test_ret++;
50091             printf(" %d", n_ctxt);
50092             printf("\n");
50093         }
50094     }
50095     function_tests++;
50096 #endif
50097 
50098     return(test_ret);
50099 }
50100 
50101 
50102 static int
test_xmlXPathPopBoolean(void)50103 test_xmlXPathPopBoolean(void) {
50104     int test_ret = 0;
50105 
50106 #if defined(LIBXML_XPATH_ENABLED)
50107     int mem_base;
50108     int ret_val;
50109     xmlXPathParserContextPtr ctxt; /* an XPath parser context */
50110     int n_ctxt;
50111 
50112     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
50113         mem_base = xmlMemBlocks();
50114         ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
50115 
50116         ret_val = xmlXPathPopBoolean(ctxt);
50117         desret_int(ret_val);
50118         call_tests++;
50119         des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
50120         xmlResetLastError();
50121         if (mem_base != xmlMemBlocks()) {
50122             printf("Leak of %d blocks found in xmlXPathPopBoolean",
50123 	           xmlMemBlocks() - mem_base);
50124 	    test_ret++;
50125             printf(" %d", n_ctxt);
50126             printf("\n");
50127         }
50128     }
50129     function_tests++;
50130 #endif
50131 
50132     return(test_ret);
50133 }
50134 
50135 
50136 static int
test_xmlXPathPopExternal(void)50137 test_xmlXPathPopExternal(void) {
50138     int test_ret = 0;
50139 
50140 #if defined(LIBXML_XPATH_ENABLED)
50141     int mem_base;
50142     void * ret_val;
50143     xmlXPathParserContextPtr ctxt; /* an XPath parser context */
50144     int n_ctxt;
50145 
50146     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
50147         mem_base = xmlMemBlocks();
50148         ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
50149 
50150         ret_val = xmlXPathPopExternal(ctxt);
50151         desret_void_ptr(ret_val);
50152         call_tests++;
50153         des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
50154         xmlResetLastError();
50155         if (mem_base != xmlMemBlocks()) {
50156             printf("Leak of %d blocks found in xmlXPathPopExternal",
50157 	           xmlMemBlocks() - mem_base);
50158 	    test_ret++;
50159             printf(" %d", n_ctxt);
50160             printf("\n");
50161         }
50162     }
50163     function_tests++;
50164 #endif
50165 
50166     return(test_ret);
50167 }
50168 
50169 
50170 static int
test_xmlXPathPopNodeSet(void)50171 test_xmlXPathPopNodeSet(void) {
50172     int test_ret = 0;
50173 
50174 #if defined(LIBXML_XPATH_ENABLED)
50175     int mem_base;
50176     xmlNodeSetPtr ret_val;
50177     xmlXPathParserContextPtr ctxt; /* an XPath parser context */
50178     int n_ctxt;
50179 
50180     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
50181         mem_base = xmlMemBlocks();
50182         ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
50183 
50184         ret_val = xmlXPathPopNodeSet(ctxt);
50185         desret_xmlNodeSetPtr(ret_val);
50186         call_tests++;
50187         des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
50188         xmlResetLastError();
50189         if (mem_base != xmlMemBlocks()) {
50190             printf("Leak of %d blocks found in xmlXPathPopNodeSet",
50191 	           xmlMemBlocks() - mem_base);
50192 	    test_ret++;
50193             printf(" %d", n_ctxt);
50194             printf("\n");
50195         }
50196     }
50197     function_tests++;
50198 #endif
50199 
50200     return(test_ret);
50201 }
50202 
50203 
50204 static int
test_xmlXPathPopNumber(void)50205 test_xmlXPathPopNumber(void) {
50206     int test_ret = 0;
50207 
50208 #if defined(LIBXML_XPATH_ENABLED)
50209     int mem_base;
50210     double ret_val;
50211     xmlXPathParserContextPtr ctxt; /* an XPath parser context */
50212     int n_ctxt;
50213 
50214     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
50215         mem_base = xmlMemBlocks();
50216         ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
50217 
50218         ret_val = xmlXPathPopNumber(ctxt);
50219         desret_double(ret_val);
50220         call_tests++;
50221         des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
50222         xmlResetLastError();
50223         if (mem_base != xmlMemBlocks()) {
50224             printf("Leak of %d blocks found in xmlXPathPopNumber",
50225 	           xmlMemBlocks() - mem_base);
50226 	    test_ret++;
50227             printf(" %d", n_ctxt);
50228             printf("\n");
50229         }
50230     }
50231     function_tests++;
50232 #endif
50233 
50234     return(test_ret);
50235 }
50236 
50237 
50238 static int
test_xmlXPathPopString(void)50239 test_xmlXPathPopString(void) {
50240     int test_ret = 0;
50241 
50242 #if defined(LIBXML_XPATH_ENABLED)
50243     int mem_base;
50244     xmlChar * ret_val;
50245     xmlXPathParserContextPtr ctxt; /* an XPath parser context */
50246     int n_ctxt;
50247 
50248     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
50249         mem_base = xmlMemBlocks();
50250         ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
50251 
50252         ret_val = xmlXPathPopString(ctxt);
50253         desret_xmlChar_ptr(ret_val);
50254         call_tests++;
50255         des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
50256         xmlResetLastError();
50257         if (mem_base != xmlMemBlocks()) {
50258             printf("Leak of %d blocks found in xmlXPathPopString",
50259 	           xmlMemBlocks() - mem_base);
50260 	    test_ret++;
50261             printf(" %d", n_ctxt);
50262             printf("\n");
50263         }
50264     }
50265     function_tests++;
50266 #endif
50267 
50268     return(test_ret);
50269 }
50270 
50271 
50272 static int
test_xmlXPathPositionFunction(void)50273 test_xmlXPathPositionFunction(void) {
50274     int test_ret = 0;
50275 
50276 #if defined(LIBXML_XPATH_ENABLED)
50277     int mem_base;
50278     xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
50279     int n_ctxt;
50280     int nargs; /* the number of arguments */
50281     int n_nargs;
50282 
50283     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
50284     for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
50285         mem_base = xmlMemBlocks();
50286         ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
50287         nargs = gen_int(n_nargs, 1);
50288 
50289         xmlXPathPositionFunction(ctxt, nargs);
50290         call_tests++;
50291         des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
50292         des_int(n_nargs, nargs, 1);
50293         xmlResetLastError();
50294         if (mem_base != xmlMemBlocks()) {
50295             printf("Leak of %d blocks found in xmlXPathPositionFunction",
50296 	           xmlMemBlocks() - mem_base);
50297 	    test_ret++;
50298             printf(" %d", n_ctxt);
50299             printf(" %d", n_nargs);
50300             printf("\n");
50301         }
50302     }
50303     }
50304     function_tests++;
50305 #endif
50306 
50307     return(test_ret);
50308 }
50309 
50310 
50311 static int
test_xmlXPathRegisterAllFunctions(void)50312 test_xmlXPathRegisterAllFunctions(void) {
50313     int test_ret = 0;
50314 
50315 #if defined(LIBXML_XPATH_ENABLED)
50316     int mem_base;
50317     xmlXPathContextPtr ctxt; /* the XPath context */
50318     int n_ctxt;
50319 
50320     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathContextPtr;n_ctxt++) {
50321         mem_base = xmlMemBlocks();
50322         ctxt = gen_xmlXPathContextPtr(n_ctxt, 0);
50323 
50324         xmlXPathRegisterAllFunctions(ctxt);
50325         call_tests++;
50326         des_xmlXPathContextPtr(n_ctxt, ctxt, 0);
50327         xmlResetLastError();
50328         if (mem_base != xmlMemBlocks()) {
50329             printf("Leak of %d blocks found in xmlXPathRegisterAllFunctions",
50330 	           xmlMemBlocks() - mem_base);
50331 	    test_ret++;
50332             printf(" %d", n_ctxt);
50333             printf("\n");
50334         }
50335     }
50336     function_tests++;
50337 #endif
50338 
50339     return(test_ret);
50340 }
50341 
50342 
50343 static int
test_xmlXPathRegisterFunc(void)50344 test_xmlXPathRegisterFunc(void) {
50345     int test_ret = 0;
50346 
50347 
50348     /* missing type support */
50349     return(test_ret);
50350 }
50351 
50352 
50353 static int
test_xmlXPathRegisterFuncLookup(void)50354 test_xmlXPathRegisterFuncLookup(void) {
50355     int test_ret = 0;
50356 
50357 
50358     /* missing type support */
50359     return(test_ret);
50360 }
50361 
50362 
50363 static int
test_xmlXPathRegisterFuncNS(void)50364 test_xmlXPathRegisterFuncNS(void) {
50365     int test_ret = 0;
50366 
50367 
50368     /* missing type support */
50369     return(test_ret);
50370 }
50371 
50372 
50373 static int
test_xmlXPathRegisterNs(void)50374 test_xmlXPathRegisterNs(void) {
50375     int test_ret = 0;
50376 
50377 #if defined(LIBXML_XPATH_ENABLED)
50378     int mem_base;
50379     int ret_val;
50380     xmlXPathContextPtr ctxt; /* the XPath context */
50381     int n_ctxt;
50382     xmlChar * prefix; /* the namespace prefix cannot be NULL or empty string */
50383     int n_prefix;
50384     xmlChar * ns_uri; /* the namespace name */
50385     int n_ns_uri;
50386 
50387     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathContextPtr;n_ctxt++) {
50388     for (n_prefix = 0;n_prefix < gen_nb_const_xmlChar_ptr;n_prefix++) {
50389     for (n_ns_uri = 0;n_ns_uri < gen_nb_const_xmlChar_ptr;n_ns_uri++) {
50390         mem_base = xmlMemBlocks();
50391         ctxt = gen_xmlXPathContextPtr(n_ctxt, 0);
50392         prefix = gen_const_xmlChar_ptr(n_prefix, 1);
50393         ns_uri = gen_const_xmlChar_ptr(n_ns_uri, 2);
50394 
50395         ret_val = xmlXPathRegisterNs(ctxt, (const xmlChar *)prefix, (const xmlChar *)ns_uri);
50396         desret_int(ret_val);
50397         call_tests++;
50398         des_xmlXPathContextPtr(n_ctxt, ctxt, 0);
50399         des_const_xmlChar_ptr(n_prefix, (const xmlChar *)prefix, 1);
50400         des_const_xmlChar_ptr(n_ns_uri, (const xmlChar *)ns_uri, 2);
50401         xmlResetLastError();
50402         if (mem_base != xmlMemBlocks()) {
50403             printf("Leak of %d blocks found in xmlXPathRegisterNs",
50404 	           xmlMemBlocks() - mem_base);
50405 	    test_ret++;
50406             printf(" %d", n_ctxt);
50407             printf(" %d", n_prefix);
50408             printf(" %d", n_ns_uri);
50409             printf("\n");
50410         }
50411     }
50412     }
50413     }
50414     function_tests++;
50415 #endif
50416 
50417     return(test_ret);
50418 }
50419 
50420 
50421 static int
test_xmlXPathRegisterVariable(void)50422 test_xmlXPathRegisterVariable(void) {
50423     int test_ret = 0;
50424 
50425 #if defined(LIBXML_XPATH_ENABLED)
50426     int mem_base;
50427     int ret_val;
50428     xmlXPathContextPtr ctxt; /* the XPath context */
50429     int n_ctxt;
50430     xmlChar * name; /* the variable name */
50431     int n_name;
50432     xmlXPathObjectPtr value; /* the variable value or NULL */
50433     int n_value;
50434 
50435     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathContextPtr;n_ctxt++) {
50436     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
50437     for (n_value = 0;n_value < gen_nb_xmlXPathObjectPtr;n_value++) {
50438         mem_base = xmlMemBlocks();
50439         ctxt = gen_xmlXPathContextPtr(n_ctxt, 0);
50440         name = gen_const_xmlChar_ptr(n_name, 1);
50441         value = gen_xmlXPathObjectPtr(n_value, 2);
50442 
50443         ret_val = xmlXPathRegisterVariable(ctxt, (const xmlChar *)name, value);
50444         desret_int(ret_val);
50445         call_tests++;
50446         des_xmlXPathContextPtr(n_ctxt, ctxt, 0);
50447         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
50448         des_xmlXPathObjectPtr(n_value, value, 2);
50449         xmlResetLastError();
50450         if (mem_base != xmlMemBlocks()) {
50451             printf("Leak of %d blocks found in xmlXPathRegisterVariable",
50452 	           xmlMemBlocks() - mem_base);
50453 	    test_ret++;
50454             printf(" %d", n_ctxt);
50455             printf(" %d", n_name);
50456             printf(" %d", n_value);
50457             printf("\n");
50458         }
50459     }
50460     }
50461     }
50462     function_tests++;
50463 #endif
50464 
50465     return(test_ret);
50466 }
50467 
50468 
50469 static int
test_xmlXPathRegisterVariableLookup(void)50470 test_xmlXPathRegisterVariableLookup(void) {
50471     int test_ret = 0;
50472 
50473 
50474     /* missing type support */
50475     return(test_ret);
50476 }
50477 
50478 
50479 static int
test_xmlXPathRegisterVariableNS(void)50480 test_xmlXPathRegisterVariableNS(void) {
50481     int test_ret = 0;
50482 
50483 #if defined(LIBXML_XPATH_ENABLED)
50484     int mem_base;
50485     int ret_val;
50486     xmlXPathContextPtr ctxt; /* the XPath context */
50487     int n_ctxt;
50488     xmlChar * name; /* the variable name */
50489     int n_name;
50490     xmlChar * ns_uri; /* the variable namespace URI */
50491     int n_ns_uri;
50492     xmlXPathObjectPtr value; /* the variable value or NULL */
50493     int n_value;
50494 
50495     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathContextPtr;n_ctxt++) {
50496     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
50497     for (n_ns_uri = 0;n_ns_uri < gen_nb_const_xmlChar_ptr;n_ns_uri++) {
50498     for (n_value = 0;n_value < gen_nb_xmlXPathObjectPtr;n_value++) {
50499         mem_base = xmlMemBlocks();
50500         ctxt = gen_xmlXPathContextPtr(n_ctxt, 0);
50501         name = gen_const_xmlChar_ptr(n_name, 1);
50502         ns_uri = gen_const_xmlChar_ptr(n_ns_uri, 2);
50503         value = gen_xmlXPathObjectPtr(n_value, 3);
50504 
50505         ret_val = xmlXPathRegisterVariableNS(ctxt, (const xmlChar *)name, (const xmlChar *)ns_uri, value);
50506         desret_int(ret_val);
50507         call_tests++;
50508         des_xmlXPathContextPtr(n_ctxt, ctxt, 0);
50509         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
50510         des_const_xmlChar_ptr(n_ns_uri, (const xmlChar *)ns_uri, 2);
50511         des_xmlXPathObjectPtr(n_value, value, 3);
50512         xmlResetLastError();
50513         if (mem_base != xmlMemBlocks()) {
50514             printf("Leak of %d blocks found in xmlXPathRegisterVariableNS",
50515 	           xmlMemBlocks() - mem_base);
50516 	    test_ret++;
50517             printf(" %d", n_ctxt);
50518             printf(" %d", n_name);
50519             printf(" %d", n_ns_uri);
50520             printf(" %d", n_value);
50521             printf("\n");
50522         }
50523     }
50524     }
50525     }
50526     }
50527     function_tests++;
50528 #endif
50529 
50530     return(test_ret);
50531 }
50532 
50533 
50534 static int
test_xmlXPathRegisteredFuncsCleanup(void)50535 test_xmlXPathRegisteredFuncsCleanup(void) {
50536     int test_ret = 0;
50537 
50538 #if defined(LIBXML_XPATH_ENABLED)
50539     int mem_base;
50540     xmlXPathContextPtr ctxt; /* the XPath context */
50541     int n_ctxt;
50542 
50543     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathContextPtr;n_ctxt++) {
50544         mem_base = xmlMemBlocks();
50545         ctxt = gen_xmlXPathContextPtr(n_ctxt, 0);
50546 
50547         xmlXPathRegisteredFuncsCleanup(ctxt);
50548         call_tests++;
50549         des_xmlXPathContextPtr(n_ctxt, ctxt, 0);
50550         xmlResetLastError();
50551         if (mem_base != xmlMemBlocks()) {
50552             printf("Leak of %d blocks found in xmlXPathRegisteredFuncsCleanup",
50553 	           xmlMemBlocks() - mem_base);
50554 	    test_ret++;
50555             printf(" %d", n_ctxt);
50556             printf("\n");
50557         }
50558     }
50559     function_tests++;
50560 #endif
50561 
50562     return(test_ret);
50563 }
50564 
50565 
50566 static int
test_xmlXPathRegisteredNsCleanup(void)50567 test_xmlXPathRegisteredNsCleanup(void) {
50568     int test_ret = 0;
50569 
50570 #if defined(LIBXML_XPATH_ENABLED)
50571     int mem_base;
50572     xmlXPathContextPtr ctxt; /* the XPath context */
50573     int n_ctxt;
50574 
50575     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathContextPtr;n_ctxt++) {
50576         mem_base = xmlMemBlocks();
50577         ctxt = gen_xmlXPathContextPtr(n_ctxt, 0);
50578 
50579         xmlXPathRegisteredNsCleanup(ctxt);
50580         call_tests++;
50581         des_xmlXPathContextPtr(n_ctxt, ctxt, 0);
50582         xmlResetLastError();
50583         if (mem_base != xmlMemBlocks()) {
50584             printf("Leak of %d blocks found in xmlXPathRegisteredNsCleanup",
50585 	           xmlMemBlocks() - mem_base);
50586 	    test_ret++;
50587             printf(" %d", n_ctxt);
50588             printf("\n");
50589         }
50590     }
50591     function_tests++;
50592 #endif
50593 
50594     return(test_ret);
50595 }
50596 
50597 
50598 static int
test_xmlXPathRegisteredVariablesCleanup(void)50599 test_xmlXPathRegisteredVariablesCleanup(void) {
50600     int test_ret = 0;
50601 
50602 #if defined(LIBXML_XPATH_ENABLED)
50603     int mem_base;
50604     xmlXPathContextPtr ctxt; /* the XPath context */
50605     int n_ctxt;
50606 
50607     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathContextPtr;n_ctxt++) {
50608         mem_base = xmlMemBlocks();
50609         ctxt = gen_xmlXPathContextPtr(n_ctxt, 0);
50610 
50611         xmlXPathRegisteredVariablesCleanup(ctxt);
50612         call_tests++;
50613         des_xmlXPathContextPtr(n_ctxt, ctxt, 0);
50614         xmlResetLastError();
50615         if (mem_base != xmlMemBlocks()) {
50616             printf("Leak of %d blocks found in xmlXPathRegisteredVariablesCleanup",
50617 	           xmlMemBlocks() - mem_base);
50618 	    test_ret++;
50619             printf(" %d", n_ctxt);
50620             printf("\n");
50621         }
50622     }
50623     function_tests++;
50624 #endif
50625 
50626     return(test_ret);
50627 }
50628 
50629 
50630 static int
test_xmlXPathRoot(void)50631 test_xmlXPathRoot(void) {
50632     int test_ret = 0;
50633 
50634 #if defined(LIBXML_XPATH_ENABLED)
50635     int mem_base;
50636     xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
50637     int n_ctxt;
50638 
50639     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
50640         mem_base = xmlMemBlocks();
50641         ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
50642 
50643         xmlXPathRoot(ctxt);
50644         call_tests++;
50645         des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
50646         xmlResetLastError();
50647         if (mem_base != xmlMemBlocks()) {
50648             printf("Leak of %d blocks found in xmlXPathRoot",
50649 	           xmlMemBlocks() - mem_base);
50650 	    test_ret++;
50651             printf(" %d", n_ctxt);
50652             printf("\n");
50653         }
50654     }
50655     function_tests++;
50656 #endif
50657 
50658     return(test_ret);
50659 }
50660 
50661 
50662 static int
test_xmlXPathRoundFunction(void)50663 test_xmlXPathRoundFunction(void) {
50664     int test_ret = 0;
50665 
50666 #if defined(LIBXML_XPATH_ENABLED)
50667     int mem_base;
50668     xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
50669     int n_ctxt;
50670     int nargs; /* the number of arguments */
50671     int n_nargs;
50672 
50673     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
50674     for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
50675         mem_base = xmlMemBlocks();
50676         ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
50677         nargs = gen_int(n_nargs, 1);
50678 
50679         xmlXPathRoundFunction(ctxt, nargs);
50680         call_tests++;
50681         des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
50682         des_int(n_nargs, nargs, 1);
50683         xmlResetLastError();
50684         if (mem_base != xmlMemBlocks()) {
50685             printf("Leak of %d blocks found in xmlXPathRoundFunction",
50686 	           xmlMemBlocks() - mem_base);
50687 	    test_ret++;
50688             printf(" %d", n_ctxt);
50689             printf(" %d", n_nargs);
50690             printf("\n");
50691         }
50692     }
50693     }
50694     function_tests++;
50695 #endif
50696 
50697     return(test_ret);
50698 }
50699 
50700 
50701 static int
test_xmlXPathStartsWithFunction(void)50702 test_xmlXPathStartsWithFunction(void) {
50703     int test_ret = 0;
50704 
50705 #if defined(LIBXML_XPATH_ENABLED)
50706     int mem_base;
50707     xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
50708     int n_ctxt;
50709     int nargs; /* the number of arguments */
50710     int n_nargs;
50711 
50712     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
50713     for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
50714         mem_base = xmlMemBlocks();
50715         ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
50716         nargs = gen_int(n_nargs, 1);
50717 
50718         xmlXPathStartsWithFunction(ctxt, nargs);
50719         call_tests++;
50720         des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
50721         des_int(n_nargs, nargs, 1);
50722         xmlResetLastError();
50723         if (mem_base != xmlMemBlocks()) {
50724             printf("Leak of %d blocks found in xmlXPathStartsWithFunction",
50725 	           xmlMemBlocks() - mem_base);
50726 	    test_ret++;
50727             printf(" %d", n_ctxt);
50728             printf(" %d", n_nargs);
50729             printf("\n");
50730         }
50731     }
50732     }
50733     function_tests++;
50734 #endif
50735 
50736     return(test_ret);
50737 }
50738 
50739 
50740 static int
test_xmlXPathStringEvalNumber(void)50741 test_xmlXPathStringEvalNumber(void) {
50742     int test_ret = 0;
50743 
50744 #if defined(LIBXML_XPATH_ENABLED)
50745     int mem_base;
50746     double ret_val;
50747     xmlChar * str; /* A string to scan */
50748     int n_str;
50749 
50750     for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) {
50751         mem_base = xmlMemBlocks();
50752         str = gen_const_xmlChar_ptr(n_str, 0);
50753 
50754         ret_val = xmlXPathStringEvalNumber((const xmlChar *)str);
50755         desret_double(ret_val);
50756         call_tests++;
50757         des_const_xmlChar_ptr(n_str, (const xmlChar *)str, 0);
50758         xmlResetLastError();
50759         if (mem_base != xmlMemBlocks()) {
50760             printf("Leak of %d blocks found in xmlXPathStringEvalNumber",
50761 	           xmlMemBlocks() - mem_base);
50762 	    test_ret++;
50763             printf(" %d", n_str);
50764             printf("\n");
50765         }
50766     }
50767     function_tests++;
50768 #endif
50769 
50770     return(test_ret);
50771 }
50772 
50773 
50774 static int
test_xmlXPathStringFunction(void)50775 test_xmlXPathStringFunction(void) {
50776     int test_ret = 0;
50777 
50778 #if defined(LIBXML_XPATH_ENABLED)
50779     int mem_base;
50780     xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
50781     int n_ctxt;
50782     int nargs; /* the number of arguments */
50783     int n_nargs;
50784 
50785     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
50786     for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
50787         mem_base = xmlMemBlocks();
50788         ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
50789         nargs = gen_int(n_nargs, 1);
50790 
50791         xmlXPathStringFunction(ctxt, nargs);
50792         call_tests++;
50793         des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
50794         des_int(n_nargs, nargs, 1);
50795         xmlResetLastError();
50796         if (mem_base != xmlMemBlocks()) {
50797             printf("Leak of %d blocks found in xmlXPathStringFunction",
50798 	           xmlMemBlocks() - mem_base);
50799 	    test_ret++;
50800             printf(" %d", n_ctxt);
50801             printf(" %d", n_nargs);
50802             printf("\n");
50803         }
50804     }
50805     }
50806     function_tests++;
50807 #endif
50808 
50809     return(test_ret);
50810 }
50811 
50812 
50813 static int
test_xmlXPathStringLengthFunction(void)50814 test_xmlXPathStringLengthFunction(void) {
50815     int test_ret = 0;
50816 
50817 #if defined(LIBXML_XPATH_ENABLED)
50818     int mem_base;
50819     xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
50820     int n_ctxt;
50821     int nargs; /* the number of arguments */
50822     int n_nargs;
50823 
50824     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
50825     for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
50826         mem_base = xmlMemBlocks();
50827         ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
50828         nargs = gen_int(n_nargs, 1);
50829 
50830         xmlXPathStringLengthFunction(ctxt, nargs);
50831         call_tests++;
50832         des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
50833         des_int(n_nargs, nargs, 1);
50834         xmlResetLastError();
50835         if (mem_base != xmlMemBlocks()) {
50836             printf("Leak of %d blocks found in xmlXPathStringLengthFunction",
50837 	           xmlMemBlocks() - mem_base);
50838 	    test_ret++;
50839             printf(" %d", n_ctxt);
50840             printf(" %d", n_nargs);
50841             printf("\n");
50842         }
50843     }
50844     }
50845     function_tests++;
50846 #endif
50847 
50848     return(test_ret);
50849 }
50850 
50851 
50852 static int
test_xmlXPathSubValues(void)50853 test_xmlXPathSubValues(void) {
50854     int test_ret = 0;
50855 
50856 #if defined(LIBXML_XPATH_ENABLED)
50857     int mem_base;
50858     xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
50859     int n_ctxt;
50860 
50861     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
50862         mem_base = xmlMemBlocks();
50863         ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
50864 
50865         xmlXPathSubValues(ctxt);
50866         call_tests++;
50867         des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
50868         xmlResetLastError();
50869         if (mem_base != xmlMemBlocks()) {
50870             printf("Leak of %d blocks found in xmlXPathSubValues",
50871 	           xmlMemBlocks() - mem_base);
50872 	    test_ret++;
50873             printf(" %d", n_ctxt);
50874             printf("\n");
50875         }
50876     }
50877     function_tests++;
50878 #endif
50879 
50880     return(test_ret);
50881 }
50882 
50883 
50884 static int
test_xmlXPathSubstringAfterFunction(void)50885 test_xmlXPathSubstringAfterFunction(void) {
50886     int test_ret = 0;
50887 
50888 #if defined(LIBXML_XPATH_ENABLED)
50889     int mem_base;
50890     xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
50891     int n_ctxt;
50892     int nargs; /* the number of arguments */
50893     int n_nargs;
50894 
50895     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
50896     for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
50897         mem_base = xmlMemBlocks();
50898         ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
50899         nargs = gen_int(n_nargs, 1);
50900 
50901         xmlXPathSubstringAfterFunction(ctxt, nargs);
50902         call_tests++;
50903         des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
50904         des_int(n_nargs, nargs, 1);
50905         xmlResetLastError();
50906         if (mem_base != xmlMemBlocks()) {
50907             printf("Leak of %d blocks found in xmlXPathSubstringAfterFunction",
50908 	           xmlMemBlocks() - mem_base);
50909 	    test_ret++;
50910             printf(" %d", n_ctxt);
50911             printf(" %d", n_nargs);
50912             printf("\n");
50913         }
50914     }
50915     }
50916     function_tests++;
50917 #endif
50918 
50919     return(test_ret);
50920 }
50921 
50922 
50923 static int
test_xmlXPathSubstringBeforeFunction(void)50924 test_xmlXPathSubstringBeforeFunction(void) {
50925     int test_ret = 0;
50926 
50927 #if defined(LIBXML_XPATH_ENABLED)
50928     int mem_base;
50929     xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
50930     int n_ctxt;
50931     int nargs; /* the number of arguments */
50932     int n_nargs;
50933 
50934     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
50935     for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
50936         mem_base = xmlMemBlocks();
50937         ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
50938         nargs = gen_int(n_nargs, 1);
50939 
50940         xmlXPathSubstringBeforeFunction(ctxt, nargs);
50941         call_tests++;
50942         des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
50943         des_int(n_nargs, nargs, 1);
50944         xmlResetLastError();
50945         if (mem_base != xmlMemBlocks()) {
50946             printf("Leak of %d blocks found in xmlXPathSubstringBeforeFunction",
50947 	           xmlMemBlocks() - mem_base);
50948 	    test_ret++;
50949             printf(" %d", n_ctxt);
50950             printf(" %d", n_nargs);
50951             printf("\n");
50952         }
50953     }
50954     }
50955     function_tests++;
50956 #endif
50957 
50958     return(test_ret);
50959 }
50960 
50961 
50962 static int
test_xmlXPathSubstringFunction(void)50963 test_xmlXPathSubstringFunction(void) {
50964     int test_ret = 0;
50965 
50966 #if defined(LIBXML_XPATH_ENABLED)
50967     int mem_base;
50968     xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
50969     int n_ctxt;
50970     int nargs; /* the number of arguments */
50971     int n_nargs;
50972 
50973     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
50974     for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
50975         mem_base = xmlMemBlocks();
50976         ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
50977         nargs = gen_int(n_nargs, 1);
50978 
50979         xmlXPathSubstringFunction(ctxt, nargs);
50980         call_tests++;
50981         des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
50982         des_int(n_nargs, nargs, 1);
50983         xmlResetLastError();
50984         if (mem_base != xmlMemBlocks()) {
50985             printf("Leak of %d blocks found in xmlXPathSubstringFunction",
50986 	           xmlMemBlocks() - mem_base);
50987 	    test_ret++;
50988             printf(" %d", n_ctxt);
50989             printf(" %d", n_nargs);
50990             printf("\n");
50991         }
50992     }
50993     }
50994     function_tests++;
50995 #endif
50996 
50997     return(test_ret);
50998 }
50999 
51000 
51001 static int
test_xmlXPathSumFunction(void)51002 test_xmlXPathSumFunction(void) {
51003     int test_ret = 0;
51004 
51005 #if defined(LIBXML_XPATH_ENABLED)
51006     int mem_base;
51007     xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
51008     int n_ctxt;
51009     int nargs; /* the number of arguments */
51010     int n_nargs;
51011 
51012     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
51013     for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
51014         mem_base = xmlMemBlocks();
51015         ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
51016         nargs = gen_int(n_nargs, 1);
51017 
51018         xmlXPathSumFunction(ctxt, nargs);
51019         call_tests++;
51020         des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
51021         des_int(n_nargs, nargs, 1);
51022         xmlResetLastError();
51023         if (mem_base != xmlMemBlocks()) {
51024             printf("Leak of %d blocks found in xmlXPathSumFunction",
51025 	           xmlMemBlocks() - mem_base);
51026 	    test_ret++;
51027             printf(" %d", n_ctxt);
51028             printf(" %d", n_nargs);
51029             printf("\n");
51030         }
51031     }
51032     }
51033     function_tests++;
51034 #endif
51035 
51036     return(test_ret);
51037 }
51038 
51039 
51040 static int
test_xmlXPathTrailing(void)51041 test_xmlXPathTrailing(void) {
51042     int test_ret = 0;
51043 
51044 #if defined(LIBXML_XPATH_ENABLED)
51045     int mem_base;
51046     xmlNodeSetPtr ret_val;
51047     xmlNodeSetPtr nodes1; /* a node-set */
51048     int n_nodes1;
51049     xmlNodeSetPtr nodes2; /* a node-set */
51050     int n_nodes2;
51051 
51052     for (n_nodes1 = 0;n_nodes1 < gen_nb_xmlNodeSetPtr;n_nodes1++) {
51053     for (n_nodes2 = 0;n_nodes2 < gen_nb_xmlNodeSetPtr;n_nodes2++) {
51054         mem_base = xmlMemBlocks();
51055         nodes1 = gen_xmlNodeSetPtr(n_nodes1, 0);
51056         nodes2 = gen_xmlNodeSetPtr(n_nodes2, 1);
51057 
51058         ret_val = xmlXPathTrailing(nodes1, nodes2);
51059         desret_xmlNodeSetPtr(ret_val);
51060         call_tests++;
51061         des_xmlNodeSetPtr(n_nodes1, nodes1, 0);
51062         des_xmlNodeSetPtr(n_nodes2, nodes2, 1);
51063         xmlResetLastError();
51064         if (mem_base != xmlMemBlocks()) {
51065             printf("Leak of %d blocks found in xmlXPathTrailing",
51066 	           xmlMemBlocks() - mem_base);
51067 	    test_ret++;
51068             printf(" %d", n_nodes1);
51069             printf(" %d", n_nodes2);
51070             printf("\n");
51071         }
51072     }
51073     }
51074     function_tests++;
51075 #endif
51076 
51077     return(test_ret);
51078 }
51079 
51080 
51081 static int
test_xmlXPathTrailingSorted(void)51082 test_xmlXPathTrailingSorted(void) {
51083     int test_ret = 0;
51084 
51085 #if defined(LIBXML_XPATH_ENABLED)
51086     int mem_base;
51087     xmlNodeSetPtr ret_val;
51088     xmlNodeSetPtr nodes1; /* a node-set, sorted by document order */
51089     int n_nodes1;
51090     xmlNodeSetPtr nodes2; /* a node-set, sorted by document order */
51091     int n_nodes2;
51092 
51093     for (n_nodes1 = 0;n_nodes1 < gen_nb_xmlNodeSetPtr;n_nodes1++) {
51094     for (n_nodes2 = 0;n_nodes2 < gen_nb_xmlNodeSetPtr;n_nodes2++) {
51095         mem_base = xmlMemBlocks();
51096         nodes1 = gen_xmlNodeSetPtr(n_nodes1, 0);
51097         nodes2 = gen_xmlNodeSetPtr(n_nodes2, 1);
51098 
51099         ret_val = xmlXPathTrailingSorted(nodes1, nodes2);
51100         desret_xmlNodeSetPtr(ret_val);
51101         call_tests++;
51102         des_xmlNodeSetPtr(n_nodes1, nodes1, 0);
51103         des_xmlNodeSetPtr(n_nodes2, nodes2, 1);
51104         xmlResetLastError();
51105         if (mem_base != xmlMemBlocks()) {
51106             printf("Leak of %d blocks found in xmlXPathTrailingSorted",
51107 	           xmlMemBlocks() - mem_base);
51108 	    test_ret++;
51109             printf(" %d", n_nodes1);
51110             printf(" %d", n_nodes2);
51111             printf("\n");
51112         }
51113     }
51114     }
51115     function_tests++;
51116 #endif
51117 
51118     return(test_ret);
51119 }
51120 
51121 
51122 static int
test_xmlXPathTranslateFunction(void)51123 test_xmlXPathTranslateFunction(void) {
51124     int test_ret = 0;
51125 
51126 #if defined(LIBXML_XPATH_ENABLED)
51127     int mem_base;
51128     xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
51129     int n_ctxt;
51130     int nargs; /* the number of arguments */
51131     int n_nargs;
51132 
51133     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
51134     for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
51135         mem_base = xmlMemBlocks();
51136         ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
51137         nargs = gen_int(n_nargs, 1);
51138 
51139         xmlXPathTranslateFunction(ctxt, nargs);
51140         call_tests++;
51141         des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
51142         des_int(n_nargs, nargs, 1);
51143         xmlResetLastError();
51144         if (mem_base != xmlMemBlocks()) {
51145             printf("Leak of %d blocks found in xmlXPathTranslateFunction",
51146 	           xmlMemBlocks() - mem_base);
51147 	    test_ret++;
51148             printf(" %d", n_ctxt);
51149             printf(" %d", n_nargs);
51150             printf("\n");
51151         }
51152     }
51153     }
51154     function_tests++;
51155 #endif
51156 
51157     return(test_ret);
51158 }
51159 
51160 
51161 static int
test_xmlXPathTrueFunction(void)51162 test_xmlXPathTrueFunction(void) {
51163     int test_ret = 0;
51164 
51165 #if defined(LIBXML_XPATH_ENABLED)
51166     int mem_base;
51167     xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
51168     int n_ctxt;
51169     int nargs; /* the number of arguments */
51170     int n_nargs;
51171 
51172     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
51173     for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
51174         mem_base = xmlMemBlocks();
51175         ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
51176         nargs = gen_int(n_nargs, 1);
51177 
51178         xmlXPathTrueFunction(ctxt, nargs);
51179         call_tests++;
51180         des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
51181         des_int(n_nargs, nargs, 1);
51182         xmlResetLastError();
51183         if (mem_base != xmlMemBlocks()) {
51184             printf("Leak of %d blocks found in xmlXPathTrueFunction",
51185 	           xmlMemBlocks() - mem_base);
51186 	    test_ret++;
51187             printf(" %d", n_ctxt);
51188             printf(" %d", n_nargs);
51189             printf("\n");
51190         }
51191     }
51192     }
51193     function_tests++;
51194 #endif
51195 
51196     return(test_ret);
51197 }
51198 
51199 
51200 static int
test_xmlXPathValueFlipSign(void)51201 test_xmlXPathValueFlipSign(void) {
51202     int test_ret = 0;
51203 
51204 #if defined(LIBXML_XPATH_ENABLED)
51205     int mem_base;
51206     xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
51207     int n_ctxt;
51208 
51209     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
51210         mem_base = xmlMemBlocks();
51211         ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
51212 
51213         xmlXPathValueFlipSign(ctxt);
51214         call_tests++;
51215         des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
51216         xmlResetLastError();
51217         if (mem_base != xmlMemBlocks()) {
51218             printf("Leak of %d blocks found in xmlXPathValueFlipSign",
51219 	           xmlMemBlocks() - mem_base);
51220 	    test_ret++;
51221             printf(" %d", n_ctxt);
51222             printf("\n");
51223         }
51224     }
51225     function_tests++;
51226 #endif
51227 
51228     return(test_ret);
51229 }
51230 
51231 
51232 static int
test_xmlXPathVariableLookup(void)51233 test_xmlXPathVariableLookup(void) {
51234     int test_ret = 0;
51235 
51236 #if defined(LIBXML_XPATH_ENABLED)
51237     int mem_base;
51238     xmlXPathObjectPtr ret_val;
51239     xmlXPathContextPtr ctxt; /* the XPath context */
51240     int n_ctxt;
51241     xmlChar * name; /* the variable name */
51242     int n_name;
51243 
51244     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathContextPtr;n_ctxt++) {
51245     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
51246         mem_base = xmlMemBlocks();
51247         ctxt = gen_xmlXPathContextPtr(n_ctxt, 0);
51248         name = gen_const_xmlChar_ptr(n_name, 1);
51249 
51250         ret_val = xmlXPathVariableLookup(ctxt, (const xmlChar *)name);
51251         desret_xmlXPathObjectPtr(ret_val);
51252         call_tests++;
51253         des_xmlXPathContextPtr(n_ctxt, ctxt, 0);
51254         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
51255         xmlResetLastError();
51256         if (mem_base != xmlMemBlocks()) {
51257             printf("Leak of %d blocks found in xmlXPathVariableLookup",
51258 	           xmlMemBlocks() - mem_base);
51259 	    test_ret++;
51260             printf(" %d", n_ctxt);
51261             printf(" %d", n_name);
51262             printf("\n");
51263         }
51264     }
51265     }
51266     function_tests++;
51267 #endif
51268 
51269     return(test_ret);
51270 }
51271 
51272 
51273 static int
test_xmlXPathVariableLookupNS(void)51274 test_xmlXPathVariableLookupNS(void) {
51275     int test_ret = 0;
51276 
51277 #if defined(LIBXML_XPATH_ENABLED)
51278     int mem_base;
51279     xmlXPathObjectPtr ret_val;
51280     xmlXPathContextPtr ctxt; /* the XPath context */
51281     int n_ctxt;
51282     xmlChar * name; /* the variable name */
51283     int n_name;
51284     xmlChar * ns_uri; /* the variable namespace URI */
51285     int n_ns_uri;
51286 
51287     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathContextPtr;n_ctxt++) {
51288     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
51289     for (n_ns_uri = 0;n_ns_uri < gen_nb_const_xmlChar_ptr;n_ns_uri++) {
51290         mem_base = xmlMemBlocks();
51291         ctxt = gen_xmlXPathContextPtr(n_ctxt, 0);
51292         name = gen_const_xmlChar_ptr(n_name, 1);
51293         ns_uri = gen_const_xmlChar_ptr(n_ns_uri, 2);
51294 
51295         ret_val = xmlXPathVariableLookupNS(ctxt, (const xmlChar *)name, (const xmlChar *)ns_uri);
51296         desret_xmlXPathObjectPtr(ret_val);
51297         call_tests++;
51298         des_xmlXPathContextPtr(n_ctxt, ctxt, 0);
51299         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
51300         des_const_xmlChar_ptr(n_ns_uri, (const xmlChar *)ns_uri, 2);
51301         xmlResetLastError();
51302         if (mem_base != xmlMemBlocks()) {
51303             printf("Leak of %d blocks found in xmlXPathVariableLookupNS",
51304 	           xmlMemBlocks() - mem_base);
51305 	    test_ret++;
51306             printf(" %d", n_ctxt);
51307             printf(" %d", n_name);
51308             printf(" %d", n_ns_uri);
51309             printf("\n");
51310         }
51311     }
51312     }
51313     }
51314     function_tests++;
51315 #endif
51316 
51317     return(test_ret);
51318 }
51319 
51320 
51321 static int
test_xmlXPathWrapCString(void)51322 test_xmlXPathWrapCString(void) {
51323     int test_ret = 0;
51324 
51325 #if defined(LIBXML_XPATH_ENABLED)
51326     int mem_base;
51327     xmlXPathObjectPtr ret_val;
51328     char * val; /* the char * value */
51329     int n_val;
51330 
51331     for (n_val = 0;n_val < gen_nb_char_ptr;n_val++) {
51332         mem_base = xmlMemBlocks();
51333         val = gen_char_ptr(n_val, 0);
51334 
51335         ret_val = xmlXPathWrapCString(val);
51336         desret_xmlXPathObjectPtr(ret_val);
51337         call_tests++;
51338         des_char_ptr(n_val, val, 0);
51339         xmlResetLastError();
51340         if (mem_base != xmlMemBlocks()) {
51341             printf("Leak of %d blocks found in xmlXPathWrapCString",
51342 	           xmlMemBlocks() - mem_base);
51343 	    test_ret++;
51344             printf(" %d", n_val);
51345             printf("\n");
51346         }
51347     }
51348     function_tests++;
51349 #endif
51350 
51351     return(test_ret);
51352 }
51353 
51354 
51355 static int
test_xmlXPathWrapExternal(void)51356 test_xmlXPathWrapExternal(void) {
51357     int test_ret = 0;
51358 
51359 #if defined(LIBXML_XPATH_ENABLED)
51360     int mem_base;
51361     xmlXPathObjectPtr ret_val;
51362     void * val; /* the user data */
51363     int n_val;
51364 
51365     for (n_val = 0;n_val < gen_nb_void_ptr;n_val++) {
51366         mem_base = xmlMemBlocks();
51367         val = gen_void_ptr(n_val, 0);
51368 
51369         ret_val = xmlXPathWrapExternal(val);
51370         desret_xmlXPathObjectPtr(ret_val);
51371         call_tests++;
51372         des_void_ptr(n_val, val, 0);
51373         xmlResetLastError();
51374         if (mem_base != xmlMemBlocks()) {
51375             printf("Leak of %d blocks found in xmlXPathWrapExternal",
51376 	           xmlMemBlocks() - mem_base);
51377 	    test_ret++;
51378             printf(" %d", n_val);
51379             printf("\n");
51380         }
51381     }
51382     function_tests++;
51383 #endif
51384 
51385     return(test_ret);
51386 }
51387 
51388 
51389 static int
test_xmlXPathWrapNodeSet(void)51390 test_xmlXPathWrapNodeSet(void) {
51391     int test_ret = 0;
51392 
51393 #if defined(LIBXML_XPATH_ENABLED)
51394     int mem_base;
51395     xmlXPathObjectPtr ret_val;
51396     xmlNodeSetPtr val; /* the NodePtr value */
51397     int n_val;
51398 
51399     for (n_val = 0;n_val < gen_nb_xmlNodeSetPtr;n_val++) {
51400         mem_base = xmlMemBlocks();
51401         val = gen_xmlNodeSetPtr(n_val, 0);
51402 
51403         ret_val = xmlXPathWrapNodeSet(val);
51404         desret_xmlXPathObjectPtr(ret_val);
51405         call_tests++;
51406         des_xmlNodeSetPtr(n_val, val, 0);
51407         xmlResetLastError();
51408         if (mem_base != xmlMemBlocks()) {
51409             printf("Leak of %d blocks found in xmlXPathWrapNodeSet",
51410 	           xmlMemBlocks() - mem_base);
51411 	    test_ret++;
51412             printf(" %d", n_val);
51413             printf("\n");
51414         }
51415     }
51416     function_tests++;
51417 #endif
51418 
51419     return(test_ret);
51420 }
51421 
51422 
51423 static int
test_xmlXPatherror(void)51424 test_xmlXPatherror(void) {
51425     int test_ret = 0;
51426 
51427 #if defined(LIBXML_XPATH_ENABLED)
51428     int mem_base;
51429     xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
51430     int n_ctxt;
51431     const char * file; /* the file name */
51432     int n_file;
51433     int line; /* the line number */
51434     int n_line;
51435     int no; /* the error number */
51436     int n_no;
51437 
51438     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
51439     for (n_file = 0;n_file < gen_nb_filepath;n_file++) {
51440     for (n_line = 0;n_line < gen_nb_int;n_line++) {
51441     for (n_no = 0;n_no < gen_nb_int;n_no++) {
51442         mem_base = xmlMemBlocks();
51443         ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
51444         file = gen_filepath(n_file, 1);
51445         line = gen_int(n_line, 2);
51446         no = gen_int(n_no, 3);
51447 
51448         xmlXPatherror(ctxt, file, line, no);
51449         call_tests++;
51450         des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
51451         des_filepath(n_file, file, 1);
51452         des_int(n_line, line, 2);
51453         des_int(n_no, no, 3);
51454         xmlResetLastError();
51455         if (mem_base != xmlMemBlocks()) {
51456             printf("Leak of %d blocks found in xmlXPatherror",
51457 	           xmlMemBlocks() - mem_base);
51458 	    test_ret++;
51459             printf(" %d", n_ctxt);
51460             printf(" %d", n_file);
51461             printf(" %d", n_line);
51462             printf(" %d", n_no);
51463             printf("\n");
51464         }
51465     }
51466     }
51467     }
51468     }
51469     function_tests++;
51470 #endif
51471 
51472     return(test_ret);
51473 }
51474 
51475 static int
test_xpathInternals(void)51476 test_xpathInternals(void) {
51477     int test_ret = 0;
51478 
51479     if (quiet == 0) printf("Testing xpathInternals : 106 of 117 functions ...\n");
51480     test_ret += test_valuePop();
51481     test_ret += test_valuePush();
51482     test_ret += test_xmlXPathAddValues();
51483     test_ret += test_xmlXPathBooleanFunction();
51484     test_ret += test_xmlXPathCeilingFunction();
51485     test_ret += test_xmlXPathCompareValues();
51486     test_ret += test_xmlXPathConcatFunction();
51487     test_ret += test_xmlXPathContainsFunction();
51488     test_ret += test_xmlXPathCountFunction();
51489     test_ret += test_xmlXPathDebugDumpCompExpr();
51490     test_ret += test_xmlXPathDebugDumpObject();
51491     test_ret += test_xmlXPathDifference();
51492     test_ret += test_xmlXPathDistinct();
51493     test_ret += test_xmlXPathDistinctSorted();
51494     test_ret += test_xmlXPathDivValues();
51495     test_ret += test_xmlXPathEqualValues();
51496     test_ret += test_xmlXPathErr();
51497     test_ret += test_xmlXPathEvalExpr();
51498     test_ret += test_xmlXPathEvaluatePredicateResult();
51499     test_ret += test_xmlXPathFalseFunction();
51500     test_ret += test_xmlXPathFloorFunction();
51501     test_ret += test_xmlXPathFunctionLookup();
51502     test_ret += test_xmlXPathFunctionLookupNS();
51503     test_ret += test_xmlXPathHasSameNodes();
51504     test_ret += test_xmlXPathIdFunction();
51505     test_ret += test_xmlXPathIntersection();
51506     test_ret += test_xmlXPathIsNodeType();
51507     test_ret += test_xmlXPathLangFunction();
51508     test_ret += test_xmlXPathLastFunction();
51509     test_ret += test_xmlXPathLeading();
51510     test_ret += test_xmlXPathLeadingSorted();
51511     test_ret += test_xmlXPathLocalNameFunction();
51512     test_ret += test_xmlXPathModValues();
51513     test_ret += test_xmlXPathMultValues();
51514     test_ret += test_xmlXPathNamespaceURIFunction();
51515     test_ret += test_xmlXPathNewBoolean();
51516     test_ret += test_xmlXPathNewCString();
51517     test_ret += test_xmlXPathNewFloat();
51518     test_ret += test_xmlXPathNewNodeSet();
51519     test_ret += test_xmlXPathNewNodeSetList();
51520     test_ret += test_xmlXPathNewParserContext();
51521     test_ret += test_xmlXPathNewString();
51522     test_ret += test_xmlXPathNextAncestor();
51523     test_ret += test_xmlXPathNextAncestorOrSelf();
51524     test_ret += test_xmlXPathNextAttribute();
51525     test_ret += test_xmlXPathNextChild();
51526     test_ret += test_xmlXPathNextDescendant();
51527     test_ret += test_xmlXPathNextDescendantOrSelf();
51528     test_ret += test_xmlXPathNextFollowing();
51529     test_ret += test_xmlXPathNextFollowingSibling();
51530     test_ret += test_xmlXPathNextNamespace();
51531     test_ret += test_xmlXPathNextParent();
51532     test_ret += test_xmlXPathNextPreceding();
51533     test_ret += test_xmlXPathNextPrecedingSibling();
51534     test_ret += test_xmlXPathNextSelf();
51535     test_ret += test_xmlXPathNodeLeading();
51536     test_ret += test_xmlXPathNodeLeadingSorted();
51537     test_ret += test_xmlXPathNodeSetAdd();
51538     test_ret += test_xmlXPathNodeSetAddNs();
51539     test_ret += test_xmlXPathNodeSetAddUnique();
51540     test_ret += test_xmlXPathNodeSetContains();
51541     test_ret += test_xmlXPathNodeSetDel();
51542     test_ret += test_xmlXPathNodeSetMerge();
51543     test_ret += test_xmlXPathNodeSetRemove();
51544     test_ret += test_xmlXPathNodeSetSort();
51545     test_ret += test_xmlXPathNodeTrailing();
51546     test_ret += test_xmlXPathNodeTrailingSorted();
51547     test_ret += test_xmlXPathNormalizeFunction();
51548     test_ret += test_xmlXPathNotEqualValues();
51549     test_ret += test_xmlXPathNotFunction();
51550     test_ret += test_xmlXPathNsLookup();
51551     test_ret += test_xmlXPathNumberFunction();
51552     test_ret += test_xmlXPathParseNCName();
51553     test_ret += test_xmlXPathParseName();
51554     test_ret += test_xmlXPathPopBoolean();
51555     test_ret += test_xmlXPathPopExternal();
51556     test_ret += test_xmlXPathPopNodeSet();
51557     test_ret += test_xmlXPathPopNumber();
51558     test_ret += test_xmlXPathPopString();
51559     test_ret += test_xmlXPathPositionFunction();
51560     test_ret += test_xmlXPathRegisterAllFunctions();
51561     test_ret += test_xmlXPathRegisterFunc();
51562     test_ret += test_xmlXPathRegisterFuncLookup();
51563     test_ret += test_xmlXPathRegisterFuncNS();
51564     test_ret += test_xmlXPathRegisterNs();
51565     test_ret += test_xmlXPathRegisterVariable();
51566     test_ret += test_xmlXPathRegisterVariableLookup();
51567     test_ret += test_xmlXPathRegisterVariableNS();
51568     test_ret += test_xmlXPathRegisteredFuncsCleanup();
51569     test_ret += test_xmlXPathRegisteredNsCleanup();
51570     test_ret += test_xmlXPathRegisteredVariablesCleanup();
51571     test_ret += test_xmlXPathRoot();
51572     test_ret += test_xmlXPathRoundFunction();
51573     test_ret += test_xmlXPathStartsWithFunction();
51574     test_ret += test_xmlXPathStringEvalNumber();
51575     test_ret += test_xmlXPathStringFunction();
51576     test_ret += test_xmlXPathStringLengthFunction();
51577     test_ret += test_xmlXPathSubValues();
51578     test_ret += test_xmlXPathSubstringAfterFunction();
51579     test_ret += test_xmlXPathSubstringBeforeFunction();
51580     test_ret += test_xmlXPathSubstringFunction();
51581     test_ret += test_xmlXPathSumFunction();
51582     test_ret += test_xmlXPathTrailing();
51583     test_ret += test_xmlXPathTrailingSorted();
51584     test_ret += test_xmlXPathTranslateFunction();
51585     test_ret += test_xmlXPathTrueFunction();
51586     test_ret += test_xmlXPathValueFlipSign();
51587     test_ret += test_xmlXPathVariableLookup();
51588     test_ret += test_xmlXPathVariableLookupNS();
51589     test_ret += test_xmlXPathWrapCString();
51590     test_ret += test_xmlXPathWrapExternal();
51591     test_ret += test_xmlXPathWrapNodeSet();
51592     test_ret += test_xmlXPatherror();
51593 
51594     if (test_ret != 0)
51595 	printf("Module xpathInternals: %d errors\n", test_ret);
51596     return(test_ret);
51597 }
51598 
51599 static int
test_xmlXPtrBuildNodeList(void)51600 test_xmlXPtrBuildNodeList(void) {
51601     int test_ret = 0;
51602 
51603 #if defined(LIBXML_XPTR_ENABLED)
51604     int mem_base;
51605     xmlNodePtr ret_val;
51606     xmlXPathObjectPtr obj; /* the XPointer result from the evaluation. */
51607     int n_obj;
51608 
51609     for (n_obj = 0;n_obj < gen_nb_xmlXPathObjectPtr;n_obj++) {
51610         mem_base = xmlMemBlocks();
51611         obj = gen_xmlXPathObjectPtr(n_obj, 0);
51612 
51613         ret_val = xmlXPtrBuildNodeList(obj);
51614         desret_xmlNodePtr(ret_val);
51615         call_tests++;
51616         des_xmlXPathObjectPtr(n_obj, obj, 0);
51617         xmlResetLastError();
51618         if (mem_base != xmlMemBlocks()) {
51619             printf("Leak of %d blocks found in xmlXPtrBuildNodeList",
51620 	           xmlMemBlocks() - mem_base);
51621 	    test_ret++;
51622             printf(" %d", n_obj);
51623             printf("\n");
51624         }
51625     }
51626     function_tests++;
51627 #endif
51628 
51629     return(test_ret);
51630 }
51631 
51632 
51633 static int
test_xmlXPtrEval(void)51634 test_xmlXPtrEval(void) {
51635     int test_ret = 0;
51636 
51637 #if defined(LIBXML_XPTR_ENABLED)
51638     int mem_base;
51639     xmlXPathObjectPtr ret_val;
51640     xmlChar * str; /* the XPointer expression */
51641     int n_str;
51642     xmlXPathContextPtr ctx; /* the XPointer context */
51643     int n_ctx;
51644 
51645     for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) {
51646     for (n_ctx = 0;n_ctx < gen_nb_xmlXPathContextPtr;n_ctx++) {
51647         mem_base = xmlMemBlocks();
51648         str = gen_const_xmlChar_ptr(n_str, 0);
51649         ctx = gen_xmlXPathContextPtr(n_ctx, 1);
51650 
51651         ret_val = xmlXPtrEval((const xmlChar *)str, ctx);
51652         desret_xmlXPathObjectPtr(ret_val);
51653         call_tests++;
51654         des_const_xmlChar_ptr(n_str, (const xmlChar *)str, 0);
51655         des_xmlXPathContextPtr(n_ctx, ctx, 1);
51656         xmlResetLastError();
51657         if (mem_base != xmlMemBlocks()) {
51658             printf("Leak of %d blocks found in xmlXPtrEval",
51659 	           xmlMemBlocks() - mem_base);
51660 	    test_ret++;
51661             printf(" %d", n_str);
51662             printf(" %d", n_ctx);
51663             printf("\n");
51664         }
51665     }
51666     }
51667     function_tests++;
51668 #endif
51669 
51670     return(test_ret);
51671 }
51672 
51673 
51674 static int
test_xmlXPtrEvalRangePredicate(void)51675 test_xmlXPtrEvalRangePredicate(void) {
51676     int test_ret = 0;
51677 
51678 #if defined(LIBXML_XPTR_ENABLED)
51679     int mem_base;
51680     xmlXPathParserContextPtr ctxt; /* the XPointer Parser context */
51681     int n_ctxt;
51682 
51683     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
51684         mem_base = xmlMemBlocks();
51685         ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
51686 
51687         xmlXPtrEvalRangePredicate(ctxt);
51688         call_tests++;
51689         des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
51690         xmlResetLastError();
51691         if (mem_base != xmlMemBlocks()) {
51692             printf("Leak of %d blocks found in xmlXPtrEvalRangePredicate",
51693 	           xmlMemBlocks() - mem_base);
51694 	    test_ret++;
51695             printf(" %d", n_ctxt);
51696             printf("\n");
51697         }
51698     }
51699     function_tests++;
51700 #endif
51701 
51702     return(test_ret);
51703 }
51704 
51705 #ifdef LIBXML_XPTR_ENABLED
51706 
51707 #define gen_nb_xmlLocationSetPtr 1
gen_xmlLocationSetPtr(int no ATTRIBUTE_UNUSED,int nr ATTRIBUTE_UNUSED)51708 static xmlLocationSetPtr gen_xmlLocationSetPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
51709     return(NULL);
51710 }
des_xmlLocationSetPtr(int no ATTRIBUTE_UNUSED,xmlLocationSetPtr val ATTRIBUTE_UNUSED,int nr ATTRIBUTE_UNUSED)51711 static void des_xmlLocationSetPtr(int no ATTRIBUTE_UNUSED, xmlLocationSetPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
51712 }
51713 #endif
51714 
51715 
51716 static int
test_xmlXPtrLocationSetAdd(void)51717 test_xmlXPtrLocationSetAdd(void) {
51718     int test_ret = 0;
51719 
51720 #if defined(LIBXML_XPTR_ENABLED)
51721     int mem_base;
51722     xmlLocationSetPtr cur; /* the initial range set */
51723     int n_cur;
51724     xmlXPathObjectPtr val; /* a new xmlXPathObjectPtr */
51725     int n_val;
51726 
51727     for (n_cur = 0;n_cur < gen_nb_xmlLocationSetPtr;n_cur++) {
51728     for (n_val = 0;n_val < gen_nb_xmlXPathObjectPtr;n_val++) {
51729         mem_base = xmlMemBlocks();
51730         cur = gen_xmlLocationSetPtr(n_cur, 0);
51731         val = gen_xmlXPathObjectPtr(n_val, 1);
51732 
51733         xmlXPtrLocationSetAdd(cur, val);
51734         call_tests++;
51735         des_xmlLocationSetPtr(n_cur, cur, 0);
51736         des_xmlXPathObjectPtr(n_val, val, 1);
51737         xmlResetLastError();
51738         if (mem_base != xmlMemBlocks()) {
51739             printf("Leak of %d blocks found in xmlXPtrLocationSetAdd",
51740 	           xmlMemBlocks() - mem_base);
51741 	    test_ret++;
51742             printf(" %d", n_cur);
51743             printf(" %d", n_val);
51744             printf("\n");
51745         }
51746     }
51747     }
51748     function_tests++;
51749 #endif
51750 
51751     return(test_ret);
51752 }
51753 
51754 
51755 static int
test_xmlXPtrLocationSetCreate(void)51756 test_xmlXPtrLocationSetCreate(void) {
51757     int test_ret = 0;
51758 
51759 
51760     /* missing type support */
51761     return(test_ret);
51762 }
51763 
51764 
51765 static int
test_xmlXPtrLocationSetDel(void)51766 test_xmlXPtrLocationSetDel(void) {
51767     int test_ret = 0;
51768 
51769 #if defined(LIBXML_XPTR_ENABLED)
51770     int mem_base;
51771     xmlLocationSetPtr cur; /* the initial range set */
51772     int n_cur;
51773     xmlXPathObjectPtr val; /* an xmlXPathObjectPtr */
51774     int n_val;
51775 
51776     for (n_cur = 0;n_cur < gen_nb_xmlLocationSetPtr;n_cur++) {
51777     for (n_val = 0;n_val < gen_nb_xmlXPathObjectPtr;n_val++) {
51778         mem_base = xmlMemBlocks();
51779         cur = gen_xmlLocationSetPtr(n_cur, 0);
51780         val = gen_xmlXPathObjectPtr(n_val, 1);
51781 
51782         xmlXPtrLocationSetDel(cur, val);
51783         call_tests++;
51784         des_xmlLocationSetPtr(n_cur, cur, 0);
51785         des_xmlXPathObjectPtr(n_val, val, 1);
51786         xmlResetLastError();
51787         if (mem_base != xmlMemBlocks()) {
51788             printf("Leak of %d blocks found in xmlXPtrLocationSetDel",
51789 	           xmlMemBlocks() - mem_base);
51790 	    test_ret++;
51791             printf(" %d", n_cur);
51792             printf(" %d", n_val);
51793             printf("\n");
51794         }
51795     }
51796     }
51797     function_tests++;
51798 #endif
51799 
51800     return(test_ret);
51801 }
51802 
51803 
51804 static int
test_xmlXPtrLocationSetMerge(void)51805 test_xmlXPtrLocationSetMerge(void) {
51806     int test_ret = 0;
51807 
51808 
51809     /* missing type support */
51810     return(test_ret);
51811 }
51812 
51813 
51814 static int
test_xmlXPtrLocationSetRemove(void)51815 test_xmlXPtrLocationSetRemove(void) {
51816     int test_ret = 0;
51817 
51818 #if defined(LIBXML_XPTR_ENABLED)
51819     int mem_base;
51820     xmlLocationSetPtr cur; /* the initial range set */
51821     int n_cur;
51822     int val; /* the index to remove */
51823     int n_val;
51824 
51825     for (n_cur = 0;n_cur < gen_nb_xmlLocationSetPtr;n_cur++) {
51826     for (n_val = 0;n_val < gen_nb_int;n_val++) {
51827         mem_base = xmlMemBlocks();
51828         cur = gen_xmlLocationSetPtr(n_cur, 0);
51829         val = gen_int(n_val, 1);
51830 
51831         xmlXPtrLocationSetRemove(cur, val);
51832         call_tests++;
51833         des_xmlLocationSetPtr(n_cur, cur, 0);
51834         des_int(n_val, val, 1);
51835         xmlResetLastError();
51836         if (mem_base != xmlMemBlocks()) {
51837             printf("Leak of %d blocks found in xmlXPtrLocationSetRemove",
51838 	           xmlMemBlocks() - mem_base);
51839 	    test_ret++;
51840             printf(" %d", n_cur);
51841             printf(" %d", n_val);
51842             printf("\n");
51843         }
51844     }
51845     }
51846     function_tests++;
51847 #endif
51848 
51849     return(test_ret);
51850 }
51851 
51852 
51853 static int
test_xmlXPtrNewCollapsedRange(void)51854 test_xmlXPtrNewCollapsedRange(void) {
51855     int test_ret = 0;
51856 
51857 #if defined(LIBXML_XPTR_ENABLED)
51858     int mem_base;
51859     xmlXPathObjectPtr ret_val;
51860     xmlNodePtr start; /* the starting and ending node */
51861     int n_start;
51862 
51863     for (n_start = 0;n_start < gen_nb_xmlNodePtr;n_start++) {
51864         mem_base = xmlMemBlocks();
51865         start = gen_xmlNodePtr(n_start, 0);
51866 
51867         ret_val = xmlXPtrNewCollapsedRange(start);
51868         desret_xmlXPathObjectPtr(ret_val);
51869         call_tests++;
51870         des_xmlNodePtr(n_start, start, 0);
51871         xmlResetLastError();
51872         if (mem_base != xmlMemBlocks()) {
51873             printf("Leak of %d blocks found in xmlXPtrNewCollapsedRange",
51874 	           xmlMemBlocks() - mem_base);
51875 	    test_ret++;
51876             printf(" %d", n_start);
51877             printf("\n");
51878         }
51879     }
51880     function_tests++;
51881 #endif
51882 
51883     return(test_ret);
51884 }
51885 
51886 
51887 static int
test_xmlXPtrNewContext(void)51888 test_xmlXPtrNewContext(void) {
51889     int test_ret = 0;
51890 
51891 
51892     /* missing type support */
51893     return(test_ret);
51894 }
51895 
51896 
51897 static int
test_xmlXPtrNewLocationSetNodeSet(void)51898 test_xmlXPtrNewLocationSetNodeSet(void) {
51899     int test_ret = 0;
51900 
51901 #if defined(LIBXML_XPTR_ENABLED)
51902     int mem_base;
51903     xmlXPathObjectPtr ret_val;
51904     xmlNodeSetPtr set; /* a node set */
51905     int n_set;
51906 
51907     for (n_set = 0;n_set < gen_nb_xmlNodeSetPtr;n_set++) {
51908         mem_base = xmlMemBlocks();
51909         set = gen_xmlNodeSetPtr(n_set, 0);
51910 
51911         ret_val = xmlXPtrNewLocationSetNodeSet(set);
51912         desret_xmlXPathObjectPtr(ret_val);
51913         call_tests++;
51914         des_xmlNodeSetPtr(n_set, set, 0);
51915         xmlResetLastError();
51916         if (mem_base != xmlMemBlocks()) {
51917             printf("Leak of %d blocks found in xmlXPtrNewLocationSetNodeSet",
51918 	           xmlMemBlocks() - mem_base);
51919 	    test_ret++;
51920             printf(" %d", n_set);
51921             printf("\n");
51922         }
51923     }
51924     function_tests++;
51925 #endif
51926 
51927     return(test_ret);
51928 }
51929 
51930 
51931 static int
test_xmlXPtrNewLocationSetNodes(void)51932 test_xmlXPtrNewLocationSetNodes(void) {
51933     int test_ret = 0;
51934 
51935 #if defined(LIBXML_XPTR_ENABLED)
51936     int mem_base;
51937     xmlXPathObjectPtr ret_val;
51938     xmlNodePtr start; /* the start NodePtr value */
51939     int n_start;
51940     xmlNodePtr end; /* the end NodePtr value or NULL */
51941     int n_end;
51942 
51943     for (n_start = 0;n_start < gen_nb_xmlNodePtr;n_start++) {
51944     for (n_end = 0;n_end < gen_nb_xmlNodePtr;n_end++) {
51945         mem_base = xmlMemBlocks();
51946         start = gen_xmlNodePtr(n_start, 0);
51947         end = gen_xmlNodePtr(n_end, 1);
51948 
51949         ret_val = xmlXPtrNewLocationSetNodes(start, end);
51950         desret_xmlXPathObjectPtr(ret_val);
51951         call_tests++;
51952         des_xmlNodePtr(n_start, start, 0);
51953         des_xmlNodePtr(n_end, end, 1);
51954         xmlResetLastError();
51955         if (mem_base != xmlMemBlocks()) {
51956             printf("Leak of %d blocks found in xmlXPtrNewLocationSetNodes",
51957 	           xmlMemBlocks() - mem_base);
51958 	    test_ret++;
51959             printf(" %d", n_start);
51960             printf(" %d", n_end);
51961             printf("\n");
51962         }
51963     }
51964     }
51965     function_tests++;
51966 #endif
51967 
51968     return(test_ret);
51969 }
51970 
51971 
51972 static int
test_xmlXPtrNewRange(void)51973 test_xmlXPtrNewRange(void) {
51974     int test_ret = 0;
51975 
51976 #if defined(LIBXML_XPTR_ENABLED)
51977     int mem_base;
51978     xmlXPathObjectPtr ret_val;
51979     xmlNodePtr start; /* the starting node */
51980     int n_start;
51981     int startindex; /* the start index */
51982     int n_startindex;
51983     xmlNodePtr end; /* the ending point */
51984     int n_end;
51985     int endindex; /* the ending index */
51986     int n_endindex;
51987 
51988     for (n_start = 0;n_start < gen_nb_xmlNodePtr;n_start++) {
51989     for (n_startindex = 0;n_startindex < gen_nb_int;n_startindex++) {
51990     for (n_end = 0;n_end < gen_nb_xmlNodePtr;n_end++) {
51991     for (n_endindex = 0;n_endindex < gen_nb_int;n_endindex++) {
51992         mem_base = xmlMemBlocks();
51993         start = gen_xmlNodePtr(n_start, 0);
51994         startindex = gen_int(n_startindex, 1);
51995         end = gen_xmlNodePtr(n_end, 2);
51996         endindex = gen_int(n_endindex, 3);
51997 
51998         ret_val = xmlXPtrNewRange(start, startindex, end, endindex);
51999         desret_xmlXPathObjectPtr(ret_val);
52000         call_tests++;
52001         des_xmlNodePtr(n_start, start, 0);
52002         des_int(n_startindex, startindex, 1);
52003         des_xmlNodePtr(n_end, end, 2);
52004         des_int(n_endindex, endindex, 3);
52005         xmlResetLastError();
52006         if (mem_base != xmlMemBlocks()) {
52007             printf("Leak of %d blocks found in xmlXPtrNewRange",
52008 	           xmlMemBlocks() - mem_base);
52009 	    test_ret++;
52010             printf(" %d", n_start);
52011             printf(" %d", n_startindex);
52012             printf(" %d", n_end);
52013             printf(" %d", n_endindex);
52014             printf("\n");
52015         }
52016     }
52017     }
52018     }
52019     }
52020     function_tests++;
52021 #endif
52022 
52023     return(test_ret);
52024 }
52025 
52026 
52027 static int
test_xmlXPtrNewRangeNodeObject(void)52028 test_xmlXPtrNewRangeNodeObject(void) {
52029     int test_ret = 0;
52030 
52031 #if defined(LIBXML_XPTR_ENABLED)
52032     int mem_base;
52033     xmlXPathObjectPtr ret_val;
52034     xmlNodePtr start; /* the starting node */
52035     int n_start;
52036     xmlXPathObjectPtr end; /* the ending object */
52037     int n_end;
52038 
52039     for (n_start = 0;n_start < gen_nb_xmlNodePtr;n_start++) {
52040     for (n_end = 0;n_end < gen_nb_xmlXPathObjectPtr;n_end++) {
52041         mem_base = xmlMemBlocks();
52042         start = gen_xmlNodePtr(n_start, 0);
52043         end = gen_xmlXPathObjectPtr(n_end, 1);
52044 
52045         ret_val = xmlXPtrNewRangeNodeObject(start, end);
52046         desret_xmlXPathObjectPtr(ret_val);
52047         call_tests++;
52048         des_xmlNodePtr(n_start, start, 0);
52049         des_xmlXPathObjectPtr(n_end, end, 1);
52050         xmlResetLastError();
52051         if (mem_base != xmlMemBlocks()) {
52052             printf("Leak of %d blocks found in xmlXPtrNewRangeNodeObject",
52053 	           xmlMemBlocks() - mem_base);
52054 	    test_ret++;
52055             printf(" %d", n_start);
52056             printf(" %d", n_end);
52057             printf("\n");
52058         }
52059     }
52060     }
52061     function_tests++;
52062 #endif
52063 
52064     return(test_ret);
52065 }
52066 
52067 
52068 static int
test_xmlXPtrNewRangeNodePoint(void)52069 test_xmlXPtrNewRangeNodePoint(void) {
52070     int test_ret = 0;
52071 
52072 #if defined(LIBXML_XPTR_ENABLED)
52073     int mem_base;
52074     xmlXPathObjectPtr ret_val;
52075     xmlNodePtr start; /* the starting node */
52076     int n_start;
52077     xmlXPathObjectPtr end; /* the ending point */
52078     int n_end;
52079 
52080     for (n_start = 0;n_start < gen_nb_xmlNodePtr;n_start++) {
52081     for (n_end = 0;n_end < gen_nb_xmlXPathObjectPtr;n_end++) {
52082         mem_base = xmlMemBlocks();
52083         start = gen_xmlNodePtr(n_start, 0);
52084         end = gen_xmlXPathObjectPtr(n_end, 1);
52085 
52086         ret_val = xmlXPtrNewRangeNodePoint(start, end);
52087         desret_xmlXPathObjectPtr(ret_val);
52088         call_tests++;
52089         des_xmlNodePtr(n_start, start, 0);
52090         des_xmlXPathObjectPtr(n_end, end, 1);
52091         xmlResetLastError();
52092         if (mem_base != xmlMemBlocks()) {
52093             printf("Leak of %d blocks found in xmlXPtrNewRangeNodePoint",
52094 	           xmlMemBlocks() - mem_base);
52095 	    test_ret++;
52096             printf(" %d", n_start);
52097             printf(" %d", n_end);
52098             printf("\n");
52099         }
52100     }
52101     }
52102     function_tests++;
52103 #endif
52104 
52105     return(test_ret);
52106 }
52107 
52108 
52109 static int
test_xmlXPtrNewRangeNodes(void)52110 test_xmlXPtrNewRangeNodes(void) {
52111     int test_ret = 0;
52112 
52113 #if defined(LIBXML_XPTR_ENABLED)
52114     int mem_base;
52115     xmlXPathObjectPtr ret_val;
52116     xmlNodePtr start; /* the starting node */
52117     int n_start;
52118     xmlNodePtr end; /* the ending node */
52119     int n_end;
52120 
52121     for (n_start = 0;n_start < gen_nb_xmlNodePtr;n_start++) {
52122     for (n_end = 0;n_end < gen_nb_xmlNodePtr;n_end++) {
52123         mem_base = xmlMemBlocks();
52124         start = gen_xmlNodePtr(n_start, 0);
52125         end = gen_xmlNodePtr(n_end, 1);
52126 
52127         ret_val = xmlXPtrNewRangeNodes(start, end);
52128         desret_xmlXPathObjectPtr(ret_val);
52129         call_tests++;
52130         des_xmlNodePtr(n_start, start, 0);
52131         des_xmlNodePtr(n_end, end, 1);
52132         xmlResetLastError();
52133         if (mem_base != xmlMemBlocks()) {
52134             printf("Leak of %d blocks found in xmlXPtrNewRangeNodes",
52135 	           xmlMemBlocks() - mem_base);
52136 	    test_ret++;
52137             printf(" %d", n_start);
52138             printf(" %d", n_end);
52139             printf("\n");
52140         }
52141     }
52142     }
52143     function_tests++;
52144 #endif
52145 
52146     return(test_ret);
52147 }
52148 
52149 
52150 static int
test_xmlXPtrNewRangePointNode(void)52151 test_xmlXPtrNewRangePointNode(void) {
52152     int test_ret = 0;
52153 
52154 #if defined(LIBXML_XPTR_ENABLED)
52155     int mem_base;
52156     xmlXPathObjectPtr ret_val;
52157     xmlXPathObjectPtr start; /* the starting point */
52158     int n_start;
52159     xmlNodePtr end; /* the ending node */
52160     int n_end;
52161 
52162     for (n_start = 0;n_start < gen_nb_xmlXPathObjectPtr;n_start++) {
52163     for (n_end = 0;n_end < gen_nb_xmlNodePtr;n_end++) {
52164         mem_base = xmlMemBlocks();
52165         start = gen_xmlXPathObjectPtr(n_start, 0);
52166         end = gen_xmlNodePtr(n_end, 1);
52167 
52168         ret_val = xmlXPtrNewRangePointNode(start, end);
52169         desret_xmlXPathObjectPtr(ret_val);
52170         call_tests++;
52171         des_xmlXPathObjectPtr(n_start, start, 0);
52172         des_xmlNodePtr(n_end, end, 1);
52173         xmlResetLastError();
52174         if (mem_base != xmlMemBlocks()) {
52175             printf("Leak of %d blocks found in xmlXPtrNewRangePointNode",
52176 	           xmlMemBlocks() - mem_base);
52177 	    test_ret++;
52178             printf(" %d", n_start);
52179             printf(" %d", n_end);
52180             printf("\n");
52181         }
52182     }
52183     }
52184     function_tests++;
52185 #endif
52186 
52187     return(test_ret);
52188 }
52189 
52190 
52191 static int
test_xmlXPtrNewRangePoints(void)52192 test_xmlXPtrNewRangePoints(void) {
52193     int test_ret = 0;
52194 
52195 #if defined(LIBXML_XPTR_ENABLED)
52196     int mem_base;
52197     xmlXPathObjectPtr ret_val;
52198     xmlXPathObjectPtr start; /* the starting point */
52199     int n_start;
52200     xmlXPathObjectPtr end; /* the ending point */
52201     int n_end;
52202 
52203     for (n_start = 0;n_start < gen_nb_xmlXPathObjectPtr;n_start++) {
52204     for (n_end = 0;n_end < gen_nb_xmlXPathObjectPtr;n_end++) {
52205         mem_base = xmlMemBlocks();
52206         start = gen_xmlXPathObjectPtr(n_start, 0);
52207         end = gen_xmlXPathObjectPtr(n_end, 1);
52208 
52209         ret_val = xmlXPtrNewRangePoints(start, end);
52210         desret_xmlXPathObjectPtr(ret_val);
52211         call_tests++;
52212         des_xmlXPathObjectPtr(n_start, start, 0);
52213         des_xmlXPathObjectPtr(n_end, end, 1);
52214         xmlResetLastError();
52215         if (mem_base != xmlMemBlocks()) {
52216             printf("Leak of %d blocks found in xmlXPtrNewRangePoints",
52217 	           xmlMemBlocks() - mem_base);
52218 	    test_ret++;
52219             printf(" %d", n_start);
52220             printf(" %d", n_end);
52221             printf("\n");
52222         }
52223     }
52224     }
52225     function_tests++;
52226 #endif
52227 
52228     return(test_ret);
52229 }
52230 
52231 
52232 static int
test_xmlXPtrRangeToFunction(void)52233 test_xmlXPtrRangeToFunction(void) {
52234     int test_ret = 0;
52235 
52236 #if defined(LIBXML_XPTR_ENABLED)
52237     int mem_base;
52238     xmlXPathParserContextPtr ctxt; /* the XPointer Parser context */
52239     int n_ctxt;
52240     int nargs; /* the number of args */
52241     int n_nargs;
52242 
52243     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
52244     for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
52245         mem_base = xmlMemBlocks();
52246         ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
52247         nargs = gen_int(n_nargs, 1);
52248 
52249         xmlXPtrRangeToFunction(ctxt, nargs);
52250         call_tests++;
52251         des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
52252         des_int(n_nargs, nargs, 1);
52253         xmlResetLastError();
52254         if (mem_base != xmlMemBlocks()) {
52255             printf("Leak of %d blocks found in xmlXPtrRangeToFunction",
52256 	           xmlMemBlocks() - mem_base);
52257 	    test_ret++;
52258             printf(" %d", n_ctxt);
52259             printf(" %d", n_nargs);
52260             printf("\n");
52261         }
52262     }
52263     }
52264     function_tests++;
52265 #endif
52266 
52267     return(test_ret);
52268 }
52269 
52270 
52271 static int
test_xmlXPtrWrapLocationSet(void)52272 test_xmlXPtrWrapLocationSet(void) {
52273     int test_ret = 0;
52274 
52275 #if defined(LIBXML_XPTR_ENABLED)
52276     int mem_base;
52277     xmlXPathObjectPtr ret_val;
52278     xmlLocationSetPtr val; /* the LocationSet value */
52279     int n_val;
52280 
52281     for (n_val = 0;n_val < gen_nb_xmlLocationSetPtr;n_val++) {
52282         mem_base = xmlMemBlocks();
52283         val = gen_xmlLocationSetPtr(n_val, 0);
52284 
52285         ret_val = xmlXPtrWrapLocationSet(val);
52286         desret_xmlXPathObjectPtr(ret_val);
52287         call_tests++;
52288         des_xmlLocationSetPtr(n_val, val, 0);
52289         xmlResetLastError();
52290         if (mem_base != xmlMemBlocks()) {
52291             printf("Leak of %d blocks found in xmlXPtrWrapLocationSet",
52292 	           xmlMemBlocks() - mem_base);
52293 	    test_ret++;
52294             printf(" %d", n_val);
52295             printf("\n");
52296         }
52297     }
52298     function_tests++;
52299 #endif
52300 
52301     return(test_ret);
52302 }
52303 
52304 static int
test_xpointer(void)52305 test_xpointer(void) {
52306     int test_ret = 0;
52307 
52308     if (quiet == 0) printf("Testing xpointer : 17 of 21 functions ...\n");
52309     test_ret += test_xmlXPtrBuildNodeList();
52310     test_ret += test_xmlXPtrEval();
52311     test_ret += test_xmlXPtrEvalRangePredicate();
52312     test_ret += test_xmlXPtrLocationSetAdd();
52313     test_ret += test_xmlXPtrLocationSetCreate();
52314     test_ret += test_xmlXPtrLocationSetDel();
52315     test_ret += test_xmlXPtrLocationSetMerge();
52316     test_ret += test_xmlXPtrLocationSetRemove();
52317     test_ret += test_xmlXPtrNewCollapsedRange();
52318     test_ret += test_xmlXPtrNewContext();
52319     test_ret += test_xmlXPtrNewLocationSetNodeSet();
52320     test_ret += test_xmlXPtrNewLocationSetNodes();
52321     test_ret += test_xmlXPtrNewRange();
52322     test_ret += test_xmlXPtrNewRangeNodeObject();
52323     test_ret += test_xmlXPtrNewRangeNodePoint();
52324     test_ret += test_xmlXPtrNewRangeNodes();
52325     test_ret += test_xmlXPtrNewRangePointNode();
52326     test_ret += test_xmlXPtrNewRangePoints();
52327     test_ret += test_xmlXPtrRangeToFunction();
52328     test_ret += test_xmlXPtrWrapLocationSet();
52329 
52330     if (test_ret != 0)
52331 	printf("Module xpointer: %d errors\n", test_ret);
52332     return(test_ret);
52333 }
52334 static int
test_module(const char * module)52335 test_module(const char *module) {
52336     if (!strcmp(module, "HTMLparser")) return(test_HTMLparser());
52337     if (!strcmp(module, "HTMLtree")) return(test_HTMLtree());
52338     if (!strcmp(module, "SAX2")) return(test_SAX2());
52339     if (!strcmp(module, "c14n")) return(test_c14n());
52340     if (!strcmp(module, "catalog")) return(test_catalog());
52341     if (!strcmp(module, "chvalid")) return(test_chvalid());
52342     if (!strcmp(module, "debugXML")) return(test_debugXML());
52343     if (!strcmp(module, "dict")) return(test_dict());
52344     if (!strcmp(module, "encoding")) return(test_encoding());
52345     if (!strcmp(module, "entities")) return(test_entities());
52346     if (!strcmp(module, "hash")) return(test_hash());
52347     if (!strcmp(module, "list")) return(test_list());
52348     if (!strcmp(module, "nanoftp")) return(test_nanoftp());
52349     if (!strcmp(module, "nanohttp")) return(test_nanohttp());
52350     if (!strcmp(module, "parser")) return(test_parser());
52351     if (!strcmp(module, "parserInternals")) return(test_parserInternals());
52352     if (!strcmp(module, "pattern")) return(test_pattern());
52353     if (!strcmp(module, "relaxng")) return(test_relaxng());
52354     if (!strcmp(module, "schemasInternals")) return(test_schemasInternals());
52355     if (!strcmp(module, "schematron")) return(test_schematron());
52356     if (!strcmp(module, "tree")) return(test_tree());
52357     if (!strcmp(module, "uri")) return(test_uri());
52358     if (!strcmp(module, "valid")) return(test_valid());
52359     if (!strcmp(module, "xinclude")) return(test_xinclude());
52360     if (!strcmp(module, "xmlIO")) return(test_xmlIO());
52361     if (!strcmp(module, "xmlautomata")) return(test_xmlautomata());
52362     if (!strcmp(module, "xmlerror")) return(test_xmlerror());
52363     if (!strcmp(module, "xmlmodule")) return(test_xmlmodule());
52364     if (!strcmp(module, "xmlreader")) return(test_xmlreader());
52365     if (!strcmp(module, "xmlregexp")) return(test_xmlregexp());
52366     if (!strcmp(module, "xmlsave")) return(test_xmlsave());
52367     if (!strcmp(module, "xmlschemas")) return(test_xmlschemas());
52368     if (!strcmp(module, "xmlschemastypes")) return(test_xmlschemastypes());
52369     if (!strcmp(module, "xmlstring")) return(test_xmlstring());
52370     if (!strcmp(module, "xmlunicode")) return(test_xmlunicode());
52371     if (!strcmp(module, "xmlwriter")) return(test_xmlwriter());
52372     if (!strcmp(module, "xpath")) return(test_xpath());
52373     if (!strcmp(module, "xpathInternals")) return(test_xpathInternals());
52374     if (!strcmp(module, "xpointer")) return(test_xpointer());
52375     return(0);
52376 }
52377