Home | History | Annotate | Download | only in libxml2
      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 (at) 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
     38 structured_errors(void *userData ATTRIBUTE_UNUSED,
     39                   xmlErrorPtr error ATTRIBUTE_UNUSED) {
     40     generic_errors++;
     41 }
     42 
     43 static 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
     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
     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
     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
     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
     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 
    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 
    216 static void *gen_void_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
    217     return(NULL);
    218 }
    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 
    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 }
    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 
    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 
    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 
    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 
    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 
    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 
    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 
    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 
    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 
    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 
    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 
    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 
    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 
    337 static unsigned long *gen_unsigned_long_ptr(int no, int nr) {
    338     if (no == 0) return(&longtab[nr]);
    339     return(NULL);
    340 }
    341 
    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 
    347 static int *gen_int_ptr(int no, int nr) {
    348     if (no == 0) return(&inttab[nr]);
    349     return(NULL);
    350 }
    351 
    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 
    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 }
    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 
    368 static xmlChar *gen_xmlChar_ptr(int no, int nr ATTRIBUTE_UNUSED) {
    369     if (no == 0) return(&chartab[0]);
    370     return(NULL);
    371 }
    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 
    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 }
    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
    386 static FILE *gen_debug_FILE_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
    387     return(fopen("test.out", "a+"));
    388 }
    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 
    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 }
    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 
    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 }
    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 
    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 }
    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 
    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 }
    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
    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 }
    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
    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 }
    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
    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 }
    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 
    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 }
    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
    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 }
    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
    506 static xmlAttrPtr gen_xmlAttrPtr(int no, int nr ATTRIBUTE_UNUSED) {
    507     if (no == 0) return(get_api_attr());
    508     return(NULL);
    509 }
    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
    515 static xmlDictPtr gen_xmlDictPtr(int no, int nr ATTRIBUTE_UNUSED) {
    516     if (no == 0) return(xmlDictCreate());
    517     return(NULL);
    518 }
    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
    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 }
    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
    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 }
    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
    556 static xmlNsPtr gen_xmlNsPtr(int no, int nr ATTRIBUTE_UNUSED) {
    557     if (no == 0) return(get_api_ns());
    558     return(NULL);
    559 }
    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
    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 }
    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
    575 static xmlTextWriterPtr gen_xmlTextWriterPtr(int no, int nr ATTRIBUTE_UNUSED) {
    576     if (no == 0) return(xmlNewTextWriterFilename("test.out", 0));
    577     return(NULL);
    578 }
    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
    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 }
    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";
    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 }
    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
    611 static xmlListPtr gen_xmlListPtr(int no, int nr ATTRIBUTE_UNUSED) {
    612     if (no == 0) return(xmlListCreate(NULL, NULL));
    613     return(NULL);
    614 }
    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
    622 static xmlHashTablePtr gen_xmlHashTablePtr(int no, int nr ATTRIBUTE_UNUSED) {
    623     if (no == 0) return(xmlHashCreate(10));
    624     return(NULL);
    625 }
    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
    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 }
    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
    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 }
    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
    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 }
    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
    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 }
    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
    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 }
    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
    706 static xmlExpCtxtPtr gen_xmlExpCtxtPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
    707     return(NULL);
    708 }
    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
    713 static xmlExpNodePtr gen_xmlExpNodePtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
    714     return(NULL);
    715 }
    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
    723 static xmlSchemaPtr gen_xmlSchemaPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
    724     return(NULL);
    725 }
    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
    730 static xmlSchemaValidCtxtPtr gen_xmlSchemaValidCtxtPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
    731     return(NULL);
    732 }
    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
    740 test_xmlHashDeallocator(void *payload ATTRIBUTE_UNUSED,
    741                         const xmlChar *name ATTRIBUTE_UNUSED) {
    742 }
    743 
    744 static xmlHashDeallocator gen_xmlHashDeallocator(int no, int nr ATTRIBUTE_UNUSED) {
    745     if (no == 0) return(test_xmlHashDeallocator);
    746     return(NULL);
    747 }
    748 static void des_xmlHashDeallocator(int no ATTRIBUTE_UNUSED, xmlHashDeallocator val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
    749 }
    750 
    751 
    752 static void desret_int(int val ATTRIBUTE_UNUSED) {
    753 }
    754 static void desret_xmlChar(xmlChar val ATTRIBUTE_UNUSED) {
    755 }
    756 static void desret_long(long val ATTRIBUTE_UNUSED) {
    757 }
    758 static void desret_unsigned_long(unsigned long val ATTRIBUTE_UNUSED) {
    759 }
    760 static void desret_double(double val ATTRIBUTE_UNUSED) {
    761 }
    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
    768 static void desret_void_ptr(void *val ATTRIBUTE_UNUSED) {
    769 }
    770 static void desret_const_char_ptr(const char *val ATTRIBUTE_UNUSED) {
    771 }
    772 static void desret_const_xmlChar_ptr(const xmlChar *val ATTRIBUTE_UNUSED) {
    773 }
    774 static void desret_xmlChar_ptr(xmlChar *val) {
    775     if (val != NULL)
    776 	xmlFree(val);
    777 }
    778 static void desret_xmlDocPtr(xmlDocPtr val) {
    779     if (val != api_doc)
    780 	xmlFreeDoc(val);
    781 }
    782 static void desret_xmlDictPtr(xmlDictPtr val) {
    783     xmlDictFree(val);
    784 }
    785 #ifdef LIBXML_OUTPUT_ENABLED
    786 static void desret_xmlOutputBufferPtr(xmlOutputBufferPtr val) {
    787     xmlOutputBufferClose(val);
    788 }
    789 #endif
    790 #ifdef LIBXML_READER_ENABLED
    791 static void desret_xmlTextReaderPtr(xmlTextReaderPtr val) {
    792     xmlFreeTextReader(val);
    793 }
    794 #endif
    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 }
    801 static void desret_xmlAttrPtr(xmlAttrPtr val) {
    802     if (val != NULL) {
    803 	xmlUnlinkNode((xmlNodePtr) val);
    804 	xmlFreeNode((xmlNodePtr) val);
    805     }
    806 }
    807 static void desret_xmlEntityPtr(xmlEntityPtr val) {
    808     if (val != NULL) {
    809 	xmlUnlinkNode((xmlNodePtr) val);
    810 	xmlFreeNode((xmlNodePtr) val);
    811     }
    812 }
    813 static void desret_xmlElementPtr(xmlElementPtr val) {
    814     if (val != NULL) {
    815 	xmlUnlinkNode((xmlNodePtr) val);
    816     }
    817 }
    818 static void desret_xmlAttributePtr(xmlAttributePtr val) {
    819     if (val != NULL) {
    820 	xmlUnlinkNode((xmlNodePtr) val);
    821     }
    822 }
    823 static void desret_xmlNsPtr(xmlNsPtr val ATTRIBUTE_UNUSED) {
    824 }
    825 static void desret_xmlDtdPtr(xmlDtdPtr val) {
    826     desret_xmlNodePtr((xmlNodePtr)val);
    827 }
    828 #ifdef LIBXML_XPATH_ENABLED
    829 static void desret_xmlXPathObjectPtr(xmlXPathObjectPtr val) {
    830     xmlXPathFreeObject(val);
    831 }
    832 static void desret_xmlNodeSetPtr(xmlNodeSetPtr val) {
    833     xmlXPathFreeNodeSet(val);
    834 }
    835 #endif
    836 static void desret_xmlParserCtxtPtr(xmlParserCtxtPtr val) {
    837     xmlFreeParserCtxt(val);
    838 }
    839 static void desret_xmlParserInputBufferPtr(xmlParserInputBufferPtr val) {
    840     xmlFreeParserInputBuffer(val);
    841 }
    842 static void desret_xmlParserInputPtr(xmlParserInputPtr val) {
    843     xmlFreeInputStream(val);
    844 }
    845 #ifdef LIBXML_WRITER_ENABLED
    846 static void desret_xmlTextWriterPtr(xmlTextWriterPtr val) {
    847     xmlFreeTextWriter(val);
    848 }
    849 #endif
    850 static void desret_xmlBufferPtr(xmlBufferPtr val) {
    851     xmlBufferFree(val);
    852 }
    853 #ifdef LIBXML_SCHEMAS_ENABLED
    854 static void desret_xmlSchemaParserCtxtPtr(xmlSchemaParserCtxtPtr val) {
    855     xmlSchemaFreeParserCtxt(val);
    856 }
    857 static void desret_xmlSchemaTypePtr(xmlSchemaTypePtr val ATTRIBUTE_UNUSED) {
    858 }
    859 static void desret_xmlRelaxNGParserCtxtPtr(xmlRelaxNGParserCtxtPtr val) {
    860     xmlRelaxNGFreeParserCtxt(val);
    861 }
    862 #endif
    863 #ifdef LIBXML_HTML_ENABLED
    864 static void desret_const_htmlEntityDesc_ptr(const htmlEntityDesc * val ATTRIBUTE_UNUSED) {
    865 }
    866 #endif
    867 #ifdef LIBXML_HTTP_ENABLED
    868 static void desret_xmlNanoHTTPCtxtPtr(void *val) {
    869     xmlNanoHTTPClose(val);
    870 }
    871 #endif
    872 #ifdef LIBXML_FTP_ENABLED
    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
    879 static xmlChar ** gen_const_xmlChar_ptr_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
    880     return(NULL);
    881 }
    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
    886 static unsigned char * gen_unsigned_char_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
    887     return(NULL);
    888 }
    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
    893 static unsigned char * gen_const_unsigned_char_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
    894     return(NULL);
    895 }
    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
    901 static htmlNodePtr gen_const_htmlNodePtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
    902     return(NULL);
    903 }
    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
    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 }
    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 }
    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
    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 }
    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 }
    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
    941 static xmlNodeSetPtr gen_xmlNodeSetPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
    942     return(NULL);
    943 }
    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
    951 static xmlShellCtxtPtr gen_xmlShellCtxtPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
    952     return(NULL);
    953 }
    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
    961 static xmlPatternPtr gen_xmlPatternPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
    962     return(NULL);
    963 }
    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
    969 static xmlElementContentPtr gen_xmlElementContentPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
    970     return(NULL);
    971 }
    972 static void des_xmlElementContentPtr(int no ATTRIBUTE_UNUSED, xmlElementContentPtr val, int nr ATTRIBUTE_UNUSED) {
    973     if (val != NULL)
    974         xmlFreeElementContent(val);
    975 }
    976 static void desret_xmlElementContentPtr(xmlElementContentPtr val) {
    977     if (val != NULL)
    978         xmlFreeElementContent(val);
    979 }
    980 
    981 #define gen_nb_xmlParserNodeInfoSeqPtr 1
    982 static xmlParserNodeInfoSeqPtr gen_xmlParserNodeInfoSeqPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
    983     return(NULL);
    984 }
    985 static void des_xmlParserNodeInfoSeqPtr(int no ATTRIBUTE_UNUSED, xmlParserNodeInfoSeqPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
    986 }
    987 
    988 static void desret_const_xmlParserNodeInfo_ptr(const xmlParserNodeInfo *val ATTRIBUTE_UNUSED) {
    989 }
    990 
    991 #define gen_nb_void_ptr_ptr 1
    992 static void ** gen_void_ptr_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
    993     return(NULL);
    994 }
    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
   1007 static void desret_htmlStatus(htmlStatus val ATTRIBUTE_UNUSED) {
   1008 }
   1009 
   1010 #endif
   1011 
   1012 #define gen_nb_xmlAttributeDefault 4
   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 
   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
   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 
   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
   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 
   1045 static void des_xmlBufferAllocationScheme(int no ATTRIBUTE_UNUSED, xmlBufferAllocationScheme val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
   1046 }
   1047 
   1048 static void desret_xmlBufferAllocationScheme(xmlBufferAllocationScheme val ATTRIBUTE_UNUSED) {
   1049 }
   1050 
   1051 #ifdef LIBXML_CATALOG_ENABLED
   1052 #define gen_nb_xmlCatalogAllow 4
   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 
   1061 static void des_xmlCatalogAllow(int no ATTRIBUTE_UNUSED, xmlCatalogAllow val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
   1062 }
   1063 
   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
   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 
   1078 static void des_xmlCatalogPrefer(int no ATTRIBUTE_UNUSED, xmlCatalogPrefer val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
   1079 }
   1080 
   1081 static void desret_xmlCatalogPrefer(xmlCatalogPrefer val ATTRIBUTE_UNUSED) {
   1082 }
   1083 
   1084 #endif
   1085 
   1086 #define gen_nb_xmlElementContentType 4
   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 
   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
   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 
   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
   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 
   1119 static void des_xmlFeature(int no ATTRIBUTE_UNUSED, xmlFeature val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
   1120 }
   1121 
   1122 static void desret_xmlParserErrors(xmlParserErrors val ATTRIBUTE_UNUSED) {
   1123 }
   1124 
   1125 #ifdef LIBXML_SCHEMAS_ENABLED
   1126 #define gen_nb_xmlSchemaValType 4
   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 
   1135 static void des_xmlSchemaValType(int no ATTRIBUTE_UNUSED, xmlSchemaValType val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
   1136 }
   1137 
   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
   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 
   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
   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
   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
   1353 static htmlElemDesc * gen_const_htmlElemDesc_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
   1354     return(NULL);
   1355 }
   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
   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
   1411 static htmlNodePtr gen_htmlNodePtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
   1412     return(NULL);
   1413 }
   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
   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
   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
   1513 static htmlSAXHandlerPtr gen_htmlSAXHandlerPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
   1514     return(NULL);
   1515 }
   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
   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
   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
   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
   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
   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
   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
   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
   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
   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
   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
   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
   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
   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
   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
   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
   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
   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
   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
   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
   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
   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
   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
   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
   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
   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
   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
   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
   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
   2784 test_htmlTagLookup(void) {
   2785     int test_ret = 0;
   2786 
   2787 
   2788     /* missing type support */
   2789     return(test_ret);
   2790 }
   2791 
   2792 static int
   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
   2837 test_htmlDocContentDumpFormatOutput(void) {
   2838     int test_ret = 0;
   2839 
   2840 #if defined(LIBXML_HTML_ENABLED) && defined(LIBXML_OUTPUT_ENABLED)
   2841     int mem_base;
   2842     xmlOutputBufferPtr buf; /* the HTML buffer output */
   2843     int n_buf;
   2844     xmlDocPtr cur; /* the document */
   2845     int n_cur;
   2846     char * encoding; /* the encoding string */
   2847     int n_encoding;
   2848     int format; /* should formatting spaces been added */
   2849     int n_format;
   2850 
   2851     for (n_buf = 0;n_buf < gen_nb_xmlOutputBufferPtr;n_buf++) {
   2852     for (n_cur = 0;n_cur < gen_nb_xmlDocPtr;n_cur++) {
   2853     for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
   2854     for (n_format = 0;n_format < gen_nb_int;n_format++) {
   2855         mem_base = xmlMemBlocks();
   2856         buf = gen_xmlOutputBufferPtr(n_buf, 0);
   2857         cur = gen_xmlDocPtr(n_cur, 1);
   2858         encoding = gen_const_char_ptr(n_encoding, 2);
   2859         format = gen_int(n_format, 3);
   2860 
   2861         htmlDocContentDumpFormatOutput(buf, cur, (const char *)encoding, format);
   2862         call_tests++;
   2863         des_xmlOutputBufferPtr(n_buf, buf, 0);
   2864         des_xmlDocPtr(n_cur, cur, 1);
   2865         des_const_char_ptr(n_encoding, (const char *)encoding, 2);
   2866         des_int(n_format, format, 3);
   2867         xmlResetLastError();
   2868         if (mem_base != xmlMemBlocks()) {
   2869             printf("Leak of %d blocks found in htmlDocContentDumpFormatOutput",
   2870 	           xmlMemBlocks() - mem_base);
   2871 	    test_ret++;
   2872             printf(" %d", n_buf);
   2873             printf(" %d", n_cur);
   2874             printf(" %d", n_encoding);
   2875             printf(" %d", n_format);
   2876             printf("\n");
   2877         }
   2878     }
   2879     }
   2880     }
   2881     }
   2882     function_tests++;
   2883 #endif
   2884 
   2885     return(test_ret);
   2886 }
   2887 
   2888 
   2889 static int
   2890 test_htmlDocContentDumpOutput(void) {
   2891     int test_ret = 0;
   2892 
   2893 #if defined(LIBXML_HTML_ENABLED) && defined(LIBXML_OUTPUT_ENABLED)
   2894     int mem_base;
   2895     xmlOutputBufferPtr buf; /* the HTML buffer output */
   2896     int n_buf;
   2897     xmlDocPtr cur; /* the document */
   2898     int n_cur;
   2899     char * encoding; /* the encoding string */
   2900     int n_encoding;
   2901 
   2902     for (n_buf = 0;n_buf < gen_nb_xmlOutputBufferPtr;n_buf++) {
   2903     for (n_cur = 0;n_cur < gen_nb_xmlDocPtr;n_cur++) {
   2904     for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
   2905         mem_base = xmlMemBlocks();
   2906         buf = gen_xmlOutputBufferPtr(n_buf, 0);
   2907         cur = gen_xmlDocPtr(n_cur, 1);
   2908         encoding = gen_const_char_ptr(n_encoding, 2);
   2909 
   2910         htmlDocContentDumpOutput(buf, cur, (const char *)encoding);
   2911         call_tests++;
   2912         des_xmlOutputBufferPtr(n_buf, buf, 0);
   2913         des_xmlDocPtr(n_cur, cur, 1);
   2914         des_const_char_ptr(n_encoding, (const char *)encoding, 2);
   2915         xmlResetLastError();
   2916         if (mem_base != xmlMemBlocks()) {
   2917             printf("Leak of %d blocks found in htmlDocContentDumpOutput",
   2918 	           xmlMemBlocks() - mem_base);
   2919 	    test_ret++;
   2920             printf(" %d", n_buf);
   2921             printf(" %d", n_cur);
   2922             printf(" %d", n_encoding);
   2923             printf("\n");
   2924         }
   2925     }
   2926     }
   2927     }
   2928     function_tests++;
   2929 #endif
   2930 
   2931     return(test_ret);
   2932 }
   2933 
   2934 
   2935 static int
   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
   2977 static xmlChar ** gen_xmlChar_ptr_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
   2978     return(NULL);
   2979 }
   2980 static void des_xmlChar_ptr_ptr(int no ATTRIBUTE_UNUSED, xmlChar ** val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
   2981 }
   2982 
   2983 static int
   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
   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
   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
   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
   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
   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
   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
   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
   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
   3389 test_htmlNodeDumpFormatOutput(void) {
   3390     int test_ret = 0;
   3391 
   3392 #if defined(LIBXML_HTML_ENABLED) && defined(LIBXML_OUTPUT_ENABLED)
   3393     int mem_base;
   3394     xmlOutputBufferPtr buf; /* the HTML buffer output */
   3395     int n_buf;
   3396     xmlDocPtr doc; /* the document */
   3397     int n_doc;
   3398     xmlNodePtr cur; /* the current node */
   3399     int n_cur;
   3400     char * encoding; /* the encoding string */
   3401     int n_encoding;
   3402     int format; /* should formatting spaces been added */
   3403     int n_format;
   3404 
   3405     for (n_buf = 0;n_buf < gen_nb_xmlOutputBufferPtr;n_buf++) {
   3406     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
   3407     for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
   3408     for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
   3409     for (n_format = 0;n_format < gen_nb_int;n_format++) {
   3410         mem_base = xmlMemBlocks();
   3411         buf = gen_xmlOutputBufferPtr(n_buf, 0);
   3412         doc = gen_xmlDocPtr(n_doc, 1);
   3413         cur = gen_xmlNodePtr(n_cur, 2);
   3414         encoding = gen_const_char_ptr(n_encoding, 3);
   3415         format = gen_int(n_format, 4);
   3416 
   3417         htmlNodeDumpFormatOutput(buf, doc, cur, (const char *)encoding, format);
   3418         call_tests++;
   3419         des_xmlOutputBufferPtr(n_buf, buf, 0);
   3420         des_xmlDocPtr(n_doc, doc, 1);
   3421         des_xmlNodePtr(n_cur, cur, 2);
   3422         des_const_char_ptr(n_encoding, (const char *)encoding, 3);
   3423         des_int(n_format, format, 4);
   3424         xmlResetLastError();
   3425         if (mem_base != xmlMemBlocks()) {
   3426             printf("Leak of %d blocks found in htmlNodeDumpFormatOutput",
   3427 	           xmlMemBlocks() - mem_base);
   3428 	    test_ret++;
   3429             printf(" %d", n_buf);
   3430             printf(" %d", n_doc);
   3431             printf(" %d", n_cur);
   3432             printf(" %d", n_encoding);
   3433             printf(" %d", n_format);
   3434             printf("\n");
   3435         }
   3436     }
   3437     }
   3438     }
   3439     }
   3440     }
   3441     function_tests++;
   3442 #endif
   3443 
   3444     return(test_ret);
   3445 }
   3446 
   3447 
   3448 static int
   3449 test_htmlNodeDumpOutput(void) {
   3450     int test_ret = 0;
   3451 
   3452 #if defined(LIBXML_HTML_ENABLED) && defined(LIBXML_OUTPUT_ENABLED)
   3453     int mem_base;
   3454     xmlOutputBufferPtr buf; /* the HTML buffer output */
   3455     int n_buf;
   3456     xmlDocPtr doc; /* the document */
   3457     int n_doc;
   3458     xmlNodePtr cur; /* the current node */
   3459     int n_cur;
   3460     char * encoding; /* the encoding string */
   3461     int n_encoding;
   3462 
   3463     for (n_buf = 0;n_buf < gen_nb_xmlOutputBufferPtr;n_buf++) {
   3464     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
   3465     for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
   3466     for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
   3467         mem_base = xmlMemBlocks();
   3468         buf = gen_xmlOutputBufferPtr(n_buf, 0);
   3469         doc = gen_xmlDocPtr(n_doc, 1);
   3470         cur = gen_xmlNodePtr(n_cur, 2);
   3471         encoding = gen_const_char_ptr(n_encoding, 3);
   3472 
   3473         htmlNodeDumpOutput(buf, doc, cur, (const char *)encoding);
   3474         call_tests++;
   3475         des_xmlOutputBufferPtr(n_buf, buf, 0);
   3476         des_xmlDocPtr(n_doc, doc, 1);
   3477         des_xmlNodePtr(n_cur, cur, 2);
   3478         des_const_char_ptr(n_encoding, (const char *)encoding, 3);
   3479         xmlResetLastError();
   3480         if (mem_base != xmlMemBlocks()) {
   3481             printf("Leak of %d blocks found in htmlNodeDumpOutput",
   3482 	           xmlMemBlocks() - mem_base);
   3483 	    test_ret++;
   3484             printf(" %d", n_buf);
   3485             printf(" %d", n_doc);
   3486             printf(" %d", n_cur);
   3487             printf(" %d", n_encoding);
   3488             printf("\n");
   3489         }
   3490     }
   3491     }
   3492     }
   3493     }
   3494     function_tests++;
   3495 #endif
   3496 
   3497     return(test_ret);
   3498 }
   3499 
   3500 
   3501 static int
   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
   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
   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
   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
   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
   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
   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
   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
   3792 static xmlEnumerationPtr gen_xmlEnumerationPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
   3793     return(NULL);
   3794 }
   3795 static void des_xmlEnumerationPtr(int no ATTRIBUTE_UNUSED, xmlEnumerationPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
   3796 }
   3797 
   3798 static int
   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
   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
   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
   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
   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
   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
   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
   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
   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
   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
   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
   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
   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
   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
   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
   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
   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
   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
   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
   4608 static xmlSAXHandler * gen_xmlSAXHandler_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
   4609     return(NULL);
   4610 }
   4611 static void des_xmlSAXHandler_ptr(int no ATTRIBUTE_UNUSED, xmlSAXHandler * val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
   4612 }
   4613 
   4614 static int
   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
   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
   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
   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
   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
   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
   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
   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
   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
   4977 static xmlSAXLocatorPtr gen_xmlSAXLocatorPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
   4978     return(NULL);
   4979 }
   4980 static void des_xmlSAXLocatorPtr(int no ATTRIBUTE_UNUSED, xmlSAXLocatorPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
   4981 }
   4982 
   4983 static int
   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
   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
   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
   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
   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
   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
   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
   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
   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
   5435 test_xmlC14NDocSave(void) {
   5436     int test_ret = 0;
   5437 
   5438 #if defined(LIBXML_C14N_ENABLED) && defined(LIBXML_OUTPUT_ENABLED)
   5439     int mem_base;
   5440     int ret_val;
   5441     xmlDocPtr doc; /* the XML document for canonization */
   5442     int n_doc;
   5443     xmlNodeSetPtr nodes; /* the nodes set to be included in the canonized image or NULL if all document nodes should be included */
   5444     int n_nodes;
   5445     int mode; /* the c14n mode (see @xmlC14NMode) */
   5446     int n_mode;
   5447     xmlChar ** inclusive_ns_prefixes; /* the list of inclusive namespace prefixes ended with a NULL or NULL if there is no inclusive namespaces (only for exclusive canonicalization, ignored otherwise) */
   5448     int n_inclusive_ns_prefixes;
   5449     int with_comments; /* include comments in the result (!=0) or not (==0) */
   5450     int n_with_comments;
   5451     const char * filename; /* the filename to store canonical XML image */
   5452     int n_filename;
   5453     int compression; /* the compression level (zlib requred): -1 - libxml default, 0 - uncompressed, >0 - compression level */
   5454     int n_compression;
   5455 
   5456     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
   5457     for (n_nodes = 0;n_nodes < gen_nb_xmlNodeSetPtr;n_nodes++) {
   5458     for (n_mode = 0;n_mode < gen_nb_int;n_mode++) {
   5459     for (n_inclusive_ns_prefixes = 0;n_inclusive_ns_prefixes < gen_nb_xmlChar_ptr_ptr;n_inclusive_ns_prefixes++) {
   5460     for (n_with_comments = 0;n_with_comments < gen_nb_int;n_with_comments++) {
   5461     for (n_filename = 0;n_filename < gen_nb_fileoutput;n_filename++) {
   5462     for (n_compression = 0;n_compression < gen_nb_int;n_compression++) {
   5463         mem_base = xmlMemBlocks();
   5464         doc = gen_xmlDocPtr(n_doc, 0);
   5465         nodes = gen_xmlNodeSetPtr(n_nodes, 1);
   5466         mode = gen_int(n_mode, 2);
   5467         inclusive_ns_prefixes = gen_xmlChar_ptr_ptr(n_inclusive_ns_prefixes, 3);
   5468         with_comments = gen_int(n_with_comments, 4);
   5469         filename = gen_fileoutput(n_filename, 5);
   5470         compression = gen_int(n_compression, 6);
   5471 
   5472         ret_val = xmlC14NDocSave(doc, nodes, mode, inclusive_ns_prefixes, with_comments, filename, compression);
   5473         desret_int(ret_val);
   5474         call_tests++;
   5475         des_xmlDocPtr(n_doc, doc, 0);
   5476         des_xmlNodeSetPtr(n_nodes, nodes, 1);
   5477         des_int(n_mode, mode, 2);
   5478         des_xmlChar_ptr_ptr(n_inclusive_ns_prefixes, inclusive_ns_prefixes, 3);
   5479         des_int(n_with_comments, with_comments, 4);
   5480         des_fileoutput(n_filename, filename, 5);
   5481         des_int(n_compression, compression, 6);
   5482         xmlResetLastError();
   5483         if (mem_base != xmlMemBlocks()) {
   5484             printf("Leak of %d blocks found in xmlC14NDocSave",
   5485 	           xmlMemBlocks() - mem_base);
   5486 	    test_ret++;
   5487             printf(" %d", n_doc);
   5488             printf(" %d", n_nodes);
   5489             printf(" %d", n_mode);
   5490             printf(" %d", n_inclusive_ns_prefixes);
   5491             printf(" %d", n_with_comments);
   5492             printf(" %d", n_filename);
   5493             printf(" %d", n_compression);
   5494             printf("\n");
   5495         }
   5496     }
   5497     }
   5498     }
   5499     }
   5500     }
   5501     }
   5502     }
   5503     function_tests++;
   5504 #endif
   5505 
   5506     return(test_ret);
   5507 }
   5508 
   5509 
   5510 static int
   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
   5580 test_xmlC14NExecute(void) {
   5581     int test_ret = 0;
   5582 
   5583 
   5584     /* missing type support */
   5585     return(test_ret);
   5586 }
   5587 
   5588 static int
   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
   5605 static xmlCatalogPtr gen_xmlCatalogPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
   5606     return(NULL);
   5607 }
   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
   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
   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
   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
   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
   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
   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
   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
   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
   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
   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
   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
   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
   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
   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
   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
   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
   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
   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
   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
   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
   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
   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
   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
   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
   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
   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
   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
   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
   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
   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
   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
   6621 static xmlChRangeGroup * gen_const_xmlChRangeGroup_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
   6622     return(NULL);
   6623 }
   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
   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
   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
   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
   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
   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
   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
   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
   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
   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
   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
   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
   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
   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
   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
   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
   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
   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
   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
   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
   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
   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
   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
   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
   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 #define gen_nb_char_ptr 1
   7515 static char * gen_char_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
   7516     return(NULL);
   7517 }
   7518 static void des_char_ptr(int no ATTRIBUTE_UNUSED, char * val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
   7519 }
   7520 
   7521 static int
   7522 test_xmlShell(void) {
   7523     int test_ret = 0;
   7524 
   7525 
   7526     /* missing type support */
   7527     return(test_ret);
   7528 }
   7529 
   7530 
   7531 static int
   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
   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
   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
   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
   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
   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
   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
   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
   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
   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
   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
   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
   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
   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
   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
   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
   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
   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
   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
   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
   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
   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
   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
   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
   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
   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
   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
   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
   8684 static xmlCharEncodingHandler * gen_xmlCharEncodingHandler_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
   8685     return(NULL);
   8686 }
   8687 static void des_xmlCharEncodingHandler_ptr(int no ATTRIBUTE_UNUSED, xmlCharEncodingHandler * val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
   8688 }
   8689 
   8690 static int
   8691 test_xmlCharEncCloseFunc(void) {
   8692     int test_ret = 0;
   8693 
   8694     int mem_base;
   8695     int ret_val;
   8696     xmlCharEncodingHandler * handler; /* char enconding transformation data structure */
   8697     int n_handler;
   8698 
   8699     for (n_handler = 0;n_handler < gen_nb_xmlCharEncodingHandler_ptr;n_handler++) {
   8700         mem_base = xmlMemBlocks();
   8701         handler = gen_xmlCharEncodingHandler_ptr(n_handler, 0);
   8702 
   8703         ret_val = xmlCharEncCloseFunc(handler);
   8704         desret_int(ret_val);
   8705         call_tests++;
   8706         des_xmlCharEncodingHandler_ptr(n_handler, handler, 0);
   8707         xmlResetLastError();
   8708         if (mem_base != xmlMemBlocks()) {
   8709             printf("Leak of %d blocks found in xmlCharEncCloseFunc",
   8710 	           xmlMemBlocks() - mem_base);
   8711 	    test_ret++;
   8712             printf(" %d", n_handler);
   8713             printf("\n");
   8714         }
   8715     }
   8716     function_tests++;
   8717 
   8718     return(test_ret);
   8719 }
   8720 
   8721 
   8722 static int
   8723 test_xmlCharEncFirstLine(void) {
   8724     int test_ret = 0;
   8725 
   8726     int mem_base;
   8727     int ret_val;
   8728     xmlCharEncodingHandler * handler; /* char enconding transformation data structure */
   8729     int n_handler;
   8730     xmlBufferPtr out; /* an xmlBuffer for the output. */
   8731     int n_out;
   8732     xmlBufferPtr in; /* an xmlBuffer for the input */
   8733     int n_in;
   8734 
   8735     for (n_handler = 0;n_handler < gen_nb_xmlCharEncodingHandler_ptr;n_handler++) {
   8736     for (n_out = 0;n_out < gen_nb_xmlBufferPtr;n_out++) {
   8737     for (n_in = 0;n_in < gen_nb_xmlBufferPtr;n_in++) {
   8738         mem_base = xmlMemBlocks();
   8739         handler = gen_xmlCharEncodingHandler_ptr(n_handler, 0);
   8740         out = gen_xmlBufferPtr(n_out, 1);
   8741         in = gen_xmlBufferPtr(n_in, 2);
   8742 
   8743         ret_val = xmlCharEncFirstLine(handler, out, in);
   8744         desret_int(ret_val);
   8745         call_tests++;
   8746         des_xmlCharEncodingHandler_ptr(n_handler, handler, 0);
   8747         des_xmlBufferPtr(n_out, out, 1);
   8748         des_xmlBufferPtr(n_in, in, 2);
   8749         xmlResetLastError();
   8750         if (mem_base != xmlMemBlocks()) {
   8751             printf("Leak of %d blocks found in xmlCharEncFirstLine",
   8752 	           xmlMemBlocks() - mem_base);
   8753 	    test_ret++;
   8754             printf(" %d", n_handler);
   8755             printf(" %d", n_out);
   8756             printf(" %d", n_in);
   8757             printf("\n");
   8758         }
   8759     }
   8760     }
   8761     }
   8762     function_tests++;
   8763 
   8764     return(test_ret);
   8765 }
   8766 
   8767 
   8768 static int
   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
   8815 test_xmlCharEncOutFunc(void) {
   8816     int test_ret = 0;
   8817 
   8818     int mem_base;
   8819     int ret_val;
   8820     xmlCharEncodingHandler * handler; /* char enconding transformation data structure */
   8821     int n_handler;
   8822     xmlBufferPtr out; /* an xmlBuffer for the output. */
   8823     int n_out;
   8824     xmlBufferPtr in; /* an xmlBuffer for the input */
   8825     int n_in;
   8826 
   8827     for (n_handler = 0;n_handler < gen_nb_xmlCharEncodingHandler_ptr;n_handler++) {
   8828     for (n_out = 0;n_out < gen_nb_xmlBufferPtr;n_out++) {
   8829     for (n_in = 0;n_in < gen_nb_xmlBufferPtr;n_in++) {
   8830         mem_base = xmlMemBlocks();
   8831         handler = gen_xmlCharEncodingHandler_ptr(n_handler, 0);
   8832         out = gen_xmlBufferPtr(n_out, 1);
   8833         in = gen_xmlBufferPtr(n_in, 2);
   8834 
   8835         ret_val = xmlCharEncOutFunc(handler, out, in);
   8836         desret_int(ret_val);
   8837         call_tests++;
   8838         des_xmlCharEncodingHandler_ptr(n_handler, handler, 0);
   8839         des_xmlBufferPtr(n_out, out, 1);
   8840         des_xmlBufferPtr(n_in, in, 2);
   8841         xmlResetLastError();
   8842         if (mem_base != xmlMemBlocks()) {
   8843             printf("Leak of %d blocks found in xmlCharEncOutFunc",
   8844 	           xmlMemBlocks() - mem_base);
   8845 	    test_ret++;
   8846             printf(" %d", n_handler);
   8847             printf(" %d", n_out);
   8848             printf(" %d", n_in);
   8849             printf("\n");
   8850         }
   8851     }
   8852     }
   8853     }
   8854     function_tests++;
   8855 
   8856     return(test_ret);
   8857 }
   8858 
   8859 
   8860 static int
   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
   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
   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
   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
   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
   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
   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
   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
   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
   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
   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
   9111 static xmlCharEncodingHandlerPtr gen_xmlCharEncodingHandlerPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
   9112     return(NULL);
   9113 }
   9114 static void des_xmlCharEncodingHandlerPtr(int no ATTRIBUTE_UNUSED, xmlCharEncodingHandlerPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
   9115 }
   9116 
   9117 static int
   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
   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
   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
   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
   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 #define gen_nb_xmlEntitiesTablePtr 1
   9338 static xmlEntitiesTablePtr gen_xmlEntitiesTablePtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
   9339     return(NULL);
   9340 }
   9341 static void des_xmlEntitiesTablePtr(int no ATTRIBUTE_UNUSED, xmlEntitiesTablePtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
   9342 }
   9343 
   9344 static int
   9345 test_xmlCopyEntitiesTable(void) {
   9346     int test_ret = 0;
   9347 
   9348 
   9349     /* missing type support */
   9350     return(test_ret);
   9351 }
   9352 
   9353 
   9354 static int
   9355 test_xmlCreateEntitiesTable(void) {
   9356     int test_ret = 0;
   9357 
   9358 
   9359     /* missing type support */
   9360     return(test_ret);
   9361 }
   9362 
   9363 
   9364 static int
   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
   9404 static xmlEntityPtr gen_xmlEntityPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
   9405     return(NULL);
   9406 }
   9407 static void des_xmlEntityPtr(int no ATTRIBUTE_UNUSED, xmlEntityPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
   9408 }
   9409 
   9410 static int
   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
   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
   9489 static xmlDoc * gen_const_xmlDoc_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
   9490     return(NULL);
   9491 }
   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
   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
   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
   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
   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
   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
   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
   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
   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
   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
   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
   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
   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
   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
   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
   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
   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
   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
   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
   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
   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
   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
   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
   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
   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
   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
   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
   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
   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
   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
   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
   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
   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
   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
   10792 static xmlLinkPtr gen_xmlLinkPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
   10793     return(NULL);
   10794 }
   10795 static void des_xmlLinkPtr(int no ATTRIBUTE_UNUSED, xmlLinkPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
   10796 }
   10797 
   10798 static int
   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
   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
   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
   10900 static xmlListPtr gen_const_xmlListPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
   10901     return(NULL);
   10902 }
   10903 static void des_const_xmlListPtr(int no ATTRIBUTE_UNUSED, const xmlListPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
   10904 }
   10905 
   10906 static int
   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
   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
   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
   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
   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
   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
   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
   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
   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
   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
   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
   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
   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
   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
   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
   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
   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
   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
   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
   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
   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
   11529 test_xmlListWalk(void) {
   11530     int test_ret = 0;
   11531 
   11532 
   11533     /* missing type support */
   11534     return(test_ret);
   11535 }
   11536 
   11537 static int
   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
   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
   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
   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
   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
   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
   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
   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
   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
   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
   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
   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
   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
   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
   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
   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
   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
   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
   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
   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
   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
   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
   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
   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
   12264 static char ** gen_char_ptr_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
   12265     return(NULL);
   12266 }
   12267 static void des_char_ptr_ptr(int no ATTRIBUTE_UNUSED, char ** val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
   12268 }
   12269 
   12270 static int
   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
   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
   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
   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
   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
   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
   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
   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
   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
   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
   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
   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
   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
   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
   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
   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
   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
   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
   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
   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
   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
   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
   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
   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
   13211 static char ** gen_const_char_ptr_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
   13212     return(NULL);
   13213 }
   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
   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
   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
   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
   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
   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
   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
   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
   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
   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
   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
   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
   13600 static xmlNodePtr * gen_xmlNodePtr_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
   13601     return(NULL);
   13602 }
   13603 static void des_xmlNodePtr_ptr(int no ATTRIBUTE_UNUSED, xmlNodePtr * val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
   13604 }
   13605 
   13606 static int
   13607 test_xmlParseBalancedChunkMemory(void) {
   13608     int test_ret = 0;
   13609 
   13610 #if defined(LIBXML_SAX1_ENABLED)
   13611 #ifdef LIBXML_SAX1_ENABLED
   13612     int mem_base;
   13613     int ret_val;
   13614     xmlDocPtr doc; /* the document the chunk pertains to */
   13615     int n_doc;
   13616     xmlSAXHandlerPtr sax; /* the SAX handler bloc (possibly NULL) */
   13617     int n_sax;
   13618     void * user_data; /* The user data returned on SAX callbacks (possibly NULL) */
   13619     int n_user_data;
   13620     int depth; /* Used for loop detection, use 0 */
   13621     int n_depth;
   13622     xmlChar * string; /* the input string in UTF8 or ISO-Latin (zero terminated) */
   13623     int n_string;
   13624     xmlNodePtr * lst; /* the return value for the set of parsed nodes */
   13625     int n_lst;
   13626 
   13627     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
   13628     for (n_sax = 0;n_sax < gen_nb_xmlSAXHandlerPtr;n_sax++) {
   13629     for (n_user_data = 0;n_user_data < gen_nb_userdata;n_user_data++) {
   13630     for (n_depth = 0;n_depth < gen_nb_int;n_depth++) {
   13631     for (n_string = 0;n_string < gen_nb_const_xmlChar_ptr;n_string++) {
   13632     for (n_lst = 0;n_lst < gen_nb_xmlNodePtr_ptr;n_lst++) {
   13633         mem_base = xmlMemBlocks();
   13634         doc = gen_xmlDocPtr(n_doc, 0);
   13635         sax = gen_xmlSAXHandlerPtr(n_sax, 1);
   13636         user_data = gen_userdata(n_user_data, 2);
   13637         depth = gen_int(n_depth, 3);
   13638         string = gen_const_xmlChar_ptr(n_string, 4);
   13639         lst = gen_xmlNodePtr_ptr(n_lst, 5);
   13640 
   13641 #ifdef LIBXML_SAX1_ENABLED
   13642         if (sax == (xmlSAXHandlerPtr)&xmlDefaultSAXHandler) user_data = NULL;
   13643 #endif
   13644 
   13645 
   13646         ret_val = xmlParseBalancedChunkMemory(doc, sax, user_data, depth, (const xmlChar *)string, lst);
   13647         desret_int(ret_val);
   13648         call_tests++;
   13649         des_xmlDocPtr(n_doc, doc, 0);
   13650         des_xmlSAXHandlerPtr(n_sax, sax, 1);
   13651         des_userdata(n_user_data, user_data, 2);
   13652         des_int(n_depth, depth, 3);
   13653         des_const_xmlChar_ptr(n_string, (const xmlChar *)string, 4);
   13654         des_xmlNodePtr_ptr(n_lst, lst, 5);
   13655         xmlResetLastError();
   13656         if (mem_base != xmlMemBlocks()) {
   13657             printf("Leak of %d blocks found in xmlParseBalancedChunkMemory",
   13658 	           xmlMemBlocks() - mem_base);
   13659 	    test_ret++;
   13660             printf(" %d", n_doc);
   13661             printf(" %d", n_sax);
   13662             printf(" %d", n_user_data);
   13663             printf(" %d", n_depth);
   13664             printf(" %d", n_string);
   13665             printf(" %d", n_lst);
   13666             printf("\n");
   13667         }
   13668     }
   13669     }
   13670     }
   13671     }
   13672     }
   13673     }
   13674     function_tests++;
   13675 #endif
   13676 #endif
   13677 
   13678     return(test_ret);
   13679 }
   13680 
   13681 
   13682 static int
   13683 test_xmlParseBalancedChunkMemoryRecover(void) {
   13684     int test_ret = 0;
   13685 
   13686 #if defined(LIBXML_SAX1_ENABLED)
   13687 #ifdef LIBXML_SAX1_ENABLED
   13688     int mem_base;
   13689     int ret_val;
   13690     xmlDocPtr doc; /* the document the chunk pertains to */
   13691     int n_doc;
   13692     xmlSAXHandlerPtr sax; /* the SAX handler bloc (possibly NULL) */
   13693     int n_sax;
   13694     void * user_data; /* The user data returned on SAX callbacks (possibly NULL) */
   13695     int n_user_data;
   13696     int depth; /* Used for loop detection, use 0 */
   13697     int n_depth;
   13698     xmlChar * string; /* the input string in UTF8 or ISO-Latin (zero terminated) */
   13699     int n_string;
   13700     xmlNodePtr * lst; /* the return value for the set of parsed nodes */
   13701     int n_lst;
   13702     int recover; /* return nodes even if the data is broken (use 0) */
   13703     int n_recover;
   13704 
   13705     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
   13706     for (n_sax = 0;n_sax < gen_nb_xmlSAXHandlerPtr;n_sax++) {
   13707     for (n_user_data = 0;n_user_data < gen_nb_userdata;n_user_data++) {
   13708     for (n_depth = 0;n_depth < gen_nb_int;n_depth++) {
   13709     for (n_string = 0;n_string < gen_nb_const_xmlChar_ptr;n_string++) {
   13710     for (n_lst = 0;n_lst < gen_nb_xmlNodePtr_ptr;n_lst++) {
   13711     for (n_recover = 0;n_recover < gen_nb_int;n_recover++) {
   13712         mem_base = xmlMemBlocks();
   13713         doc = gen_xmlDocPtr(n_doc, 0);
   13714         sax = gen_xmlSAXHandlerPtr(n_sax, 1);
   13715         user_data = gen_userdata(n_user_data, 2);
   13716         depth = gen_int(n_depth, 3);
   13717         string = gen_const_xmlChar_ptr(n_string, 4);
   13718         lst = gen_xmlNodePtr_ptr(n_lst, 5);
   13719         recover = gen_int(n_recover, 6);
   13720 
   13721 #ifdef LIBXML_SAX1_ENABLED
   13722         if (sax == (xmlSAXHandlerPtr)&xmlDefaultSAXHandler) user_data = NULL;
   13723 #endif
   13724 
   13725 
   13726         ret_val = xmlParseBalancedChunkMemoryRecover(doc, sax, user_data, depth, (const xmlChar *)string, lst, recover);
   13727         desret_int(ret_val);
   13728         call_tests++;
   13729         des_xmlDocPtr(n_doc, doc, 0);
   13730         des_xmlSAXHandlerPtr(n_sax, sax, 1);
   13731         des_userdata(n_user_data, user_data, 2);
   13732         des_int(n_depth, depth, 3);
   13733         des_const_xmlChar_ptr(n_string, (const xmlChar *)string, 4);
   13734         des_xmlNodePtr_ptr(n_lst, lst, 5);
   13735         des_int(n_recover, recover, 6);
   13736         xmlResetLastError();
   13737         if (mem_base != xmlMemBlocks()) {
   13738             printf("Leak of %d blocks found in xmlParseBalancedChunkMemoryRecover",
   13739 	           xmlMemBlocks() - mem_base);
   13740 	    test_ret++;
   13741             printf(" %d", n_doc);
   13742             printf(" %d", n_sax);
   13743             printf(" %d", n_user_data);
   13744             printf(" %d", n_depth);
   13745             printf(" %d", n_string);
   13746             printf(" %d", n_lst);
   13747             printf(" %d", n_recover);
   13748             printf("\n");
   13749         }
   13750     }
   13751     }
   13752     }
   13753     }
   13754     }
   13755     }
   13756     }
   13757     function_tests++;
   13758 #endif
   13759 #endif
   13760 
   13761     return(test_ret);
   13762 }
   13763 
   13764 
   13765 static int
   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
   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
   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
   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
   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
   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
   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
   14059 test_xmlParseExternalEntity(void) {
   14060     int test_ret = 0;
   14061 
   14062 #if defined(LIBXML_SAX1_ENABLED)
   14063 #ifdef LIBXML_SAX1_ENABLED
   14064     int mem_base;
   14065     int ret_val;
   14066     xmlDocPtr doc; /* the document the chunk pertains to */
   14067     int n_doc;
   14068     xmlSAXHandlerPtr sax; /* the SAX handler bloc (possibly NULL) */
   14069     int n_sax;
   14070     void * user_data; /* The user data returned on SAX callbacks (possibly NULL) */
   14071     int n_user_data;
   14072     int depth; /* Used for loop detection, use 0 */
   14073     int n_depth;
   14074     xmlChar * URL; /* the URL for the entity to load */
   14075     int n_URL;
   14076     xmlChar * ID; /* the System ID for the entity to load */
   14077     int n_ID;
   14078     xmlNodePtr * lst; /* the return value for the set of parsed nodes */
   14079     int n_lst;
   14080 
   14081     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
   14082     for (n_sax = 0;n_sax < gen_nb_xmlSAXHandlerPtr;n_sax++) {
   14083     for (n_user_data = 0;n_user_data < gen_nb_userdata;n_user_data++) {
   14084     for (n_depth = 0;n_depth < gen_nb_int;n_depth++) {
   14085     for (n_URL = 0;n_URL < gen_nb_const_xmlChar_ptr;n_URL++) {
   14086     for (n_ID = 0;n_ID < gen_nb_const_xmlChar_ptr;n_ID++) {
   14087     for (n_lst = 0;n_lst < gen_nb_xmlNodePtr_ptr;n_lst++) {
   14088         mem_base = xmlMemBlocks();
   14089         doc = gen_xmlDocPtr(n_doc, 0);
   14090         sax = gen_xmlSAXHandlerPtr(n_sax, 1);
   14091         user_data = gen_userdata(n_user_data, 2);
   14092         depth = gen_int(n_depth, 3);
   14093         URL = gen_const_xmlChar_ptr(n_URL, 4);
   14094         ID = gen_const_xmlChar_ptr(n_ID, 5);
   14095         lst = gen_xmlNodePtr_ptr(n_lst, 6);
   14096 
   14097         ret_val = xmlParseExternalEntity(doc, sax, user_data, depth, (const xmlChar *)URL, (const xmlChar *)ID, lst);
   14098         desret_int(ret_val);
   14099         call_tests++;
   14100         des_xmlDocPtr(n_doc, doc, 0);
   14101         des_xmlSAXHandlerPtr(n_sax, sax, 1);
   14102         des_userdata(n_user_data, user_data, 2);
   14103         des_int(n_depth, depth, 3);
   14104         des_const_xmlChar_ptr(n_URL, (const xmlChar *)URL, 4);
   14105         des_const_xmlChar_ptr(n_ID, (const xmlChar *)ID, 5);
   14106         des_xmlNodePtr_ptr(n_lst, lst, 6);
   14107         xmlResetLastError();
   14108         if (mem_base != xmlMemBlocks()) {
   14109             printf("Leak of %d blocks found in xmlParseExternalEntity",
   14110 	           xmlMemBlocks() - mem_base);
   14111 	    test_ret++;
   14112             printf(" %d", n_doc);
   14113             printf(" %d", n_sax);
   14114             printf(" %d", n_user_data);
   14115             printf(" %d", n_depth);
   14116             printf(" %d", n_URL);
   14117             printf(" %d", n_ID);
   14118             printf(" %d", n_lst);
   14119             printf("\n");
   14120         }
   14121     }
   14122     }
   14123     }
   14124     }
   14125     }
   14126     }
   14127     }
   14128     function_tests++;
   14129 #endif
   14130 #endif
   14131 
   14132     return(test_ret);
   14133 }
   14134 
   14135 
   14136 static int
   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
   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
   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
   14279 static xmlParserNodeInfoPtr gen_const_xmlParserNodeInfoPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
   14280     return(NULL);
   14281 }
   14282 static void des_const_xmlParserNodeInfoPtr(int no ATTRIBUTE_UNUSED, const xmlParserNodeInfoPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
   14283 }
   14284 
   14285 static int
   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
   14323 static xmlParserCtxtPtr gen_const_xmlParserCtxtPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
   14324     return(NULL);
   14325 }
   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
   14330 static xmlNodePtr gen_const_xmlNodePtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
   14331     return(NULL);
   14332 }
   14333 static void des_const_xmlNodePtr(int no ATTRIBUTE_UNUSED, const xmlNodePtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
   14334 }
   14335 
   14336 static int
   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
   14376 static xmlParserNodeInfoSeqPtr gen_const_xmlParserNodeInfoSeqPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
   14377     return(NULL);
   14378 }
   14379 static void des_const_xmlParserNodeInfoSeqPtr(int no ATTRIBUTE_UNUSED, const xmlParserNodeInfoSeqPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
   14380 }
   14381 
   14382 static int
   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
   14422 static xmlParserInputPtr gen_xmlParserInputPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
   14423     return(NULL);
   14424 }
   14425 static void des_xmlParserInputPtr(int no ATTRIBUTE_UNUSED, xmlParserInputPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
   14426 }
   14427 
   14428 static int
   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
   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
   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
   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
   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
   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
   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
   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
   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
   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
   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
   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
   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
   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
   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
   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
   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
   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
   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
   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
   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
   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
   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
   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
   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
   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
   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
   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
   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
   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
   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
   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
   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
   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
   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
   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
   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
   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
   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
   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
   16155 test_xmlErrMemory(void) {
   16156     int test_ret = 0;
   16157 
   16158     int mem_base;
   16159     xmlParserCtxtPtr ctxt; /* an XML parser context */
   16160     int n_ctxt;
   16161     char * extra; /* extra informations */
   16162     int n_extra;
   16163 
   16164     for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
   16165     for (n_extra = 0;n_extra < gen_nb_const_char_ptr;n_extra++) {
   16166         mem_base = xmlMemBlocks();
   16167         ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
   16168         extra = gen_const_char_ptr(n_extra, 1);
   16169 
   16170         xmlErrMemory(ctxt, (const char *)extra);
   16171         call_tests++;
   16172         des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
   16173         des_const_char_ptr(n_extra, (const char *)extra, 1);
   16174         xmlResetLastError();
   16175         if (mem_base != xmlMemBlocks()) {
   16176             printf("Leak of %d blocks found in xmlErrMemory",
   16177 	           xmlMemBlocks() - mem_base);
   16178 	    test_ret++;
   16179             printf(" %d", n_ctxt);
   16180             printf(" %d", n_extra);
   16181             printf("\n");
   16182         }
   16183     }
   16184     }
   16185     function_tests++;
   16186 
   16187     return(test_ret);
   16188 }
   16189 
   16190 
   16191 static int
   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
   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
   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
   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
   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
   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
   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
   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
   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
   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
   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
   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
   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
   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
   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
   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
   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
   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
   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
   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
   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
   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
   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
   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
   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
   17116 static xmlStreamCtxtPtr gen_xmlStreamCtxtPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
   17117     return(NULL);
   17118 }
   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
   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
   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
   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
   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
   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
   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
   17367 static xmlRelaxNGPtr gen_xmlRelaxNGPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
   17368     return(NULL);
   17369 }
   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
   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
   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
   17455 static xmlRelaxNGParserCtxtPtr gen_xmlRelaxNGParserCtxtPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
   17456     return(NULL);
   17457 }
   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
   17465 static xmlRelaxNGValidityErrorFunc * gen_xmlRelaxNGValidityErrorFunc_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
   17466     return(NULL);
   17467 }
   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
   17475 static xmlRelaxNGValidityWarningFunc * gen_xmlRelaxNGValidityWarningFunc_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
   17476     return(NULL);
   17477 }
   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
   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
   17540 static xmlRelaxNGValidCtxtPtr gen_xmlRelaxNGValidCtxtPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
   17541     return(NULL);
   17542 }
   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
   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
   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
   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
   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
   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
   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
   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
   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
   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
   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
   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
   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
   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
   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
   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
   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
   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
   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
   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
   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
   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
   18140 test_xmlSchematronNewParserCtxt(void) {
   18141     int test_ret = 0;
   18142 
   18143 
   18144     /* missing type support */
   18145     return(test_ret);
   18146 }
   18147 
   18148 #ifdef LIBXML_SCHEMATRON_ENABLED
   18149 
   18150 #define gen_nb_xmlSchematronPtr 1
   18151 static xmlSchematronPtr gen_xmlSchematronPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
   18152     return(NULL);
   18153 }
   18154 static void des_xmlSchematronPtr(int no ATTRIBUTE_UNUSED, xmlSchematronPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
   18155 }
   18156 #endif
   18157 
   18158 
   18159 static int
   18160 test_xmlSchematronNewValidCtxt(void) {
   18161     int test_ret = 0;
   18162 
   18163 
   18164     /* missing type support */
   18165     return(test_ret);
   18166 }
   18167 
   18168 #ifdef LIBXML_SCHEMATRON_ENABLED
   18169 
   18170 #define gen_nb_xmlSchematronParserCtxtPtr 1
   18171 static xmlSchematronParserCtxtPtr gen_xmlSchematronParserCtxtPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
   18172     return(NULL);
   18173 }
   18174 static void des_xmlSchematronParserCtxtPtr(int no ATTRIBUTE_UNUSED, xmlSchematronParserCtxtPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
   18175 }
   18176 #endif
   18177 
   18178 
   18179 static int
   18180 test_xmlSchematronParse(void) {
   18181     int test_ret = 0;
   18182 
   18183 
   18184     /* missing type support */
   18185     return(test_ret);
   18186 }
   18187 
   18188 #ifdef LIBXML_SCHEMATRON_ENABLED
   18189 
   18190 #define gen_nb_xmlSchematronValidCtxtPtr 1
   18191 static xmlSchematronValidCtxtPtr gen_xmlSchematronValidCtxtPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
   18192     return(NULL);
   18193 }
   18194 static void des_xmlSchematronValidCtxtPtr(int no ATTRIBUTE_UNUSED, xmlSchematronValidCtxtPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
   18195 }
   18196 #endif
   18197 
   18198 
   18199 static int
   18200 test_xmlSchematronSetValidStructuredErrors(void) {
   18201     int test_ret = 0;
   18202 
   18203 
   18204     /* missing type support */
   18205     return(test_ret);
   18206 }
   18207 
   18208 
   18209 static int
   18210 test_xmlSchematronValidateDoc(void) {
   18211     int test_ret = 0;
   18212 
   18213 #if defined(LIBXML_SCHEMATRON_ENABLED)
   18214     int mem_base;
   18215     int ret_val;
   18216     xmlSchematronValidCtxtPtr ctxt; /* the schema validation context */
   18217     int n_ctxt;
   18218     xmlDocPtr instance; /* the document instace tree */
   18219     int n_instance;
   18220 
   18221     for (n_ctxt = 0;n_ctxt < gen_nb_xmlSchematronValidCtxtPtr;n_ctxt++) {
   18222     for (n_instance = 0;n_instance < gen_nb_xmlDocPtr;n_instance++) {
   18223         mem_base = xmlMemBlocks();
   18224         ctxt = gen_xmlSchematronValidCtxtPtr(n_ctxt, 0);
   18225         instance = gen_xmlDocPtr(n_instance, 1);
   18226 
   18227         ret_val = xmlSchematronValidateDoc(ctxt, instance);
   18228         desret_int(ret_val);
   18229         call_tests++;
   18230         des_xmlSchematronValidCtxtPtr(n_ctxt, ctxt, 0);
   18231         des_xmlDocPtr(n_instance, instance, 1);
   18232         xmlResetLastError();
   18233         if (mem_base != xmlMemBlocks()) {
   18234             printf("Leak of %d blocks found in xmlSchematronValidateDoc",
   18235 	           xmlMemBlocks() - mem_base);
   18236 	    test_ret++;
   18237             printf(" %d", n_ctxt);
   18238             printf(" %d", n_instance);
   18239             printf("\n");
   18240         }
   18241     }
   18242     }
   18243     function_tests++;
   18244 #endif
   18245 
   18246     return(test_ret);
   18247 }
   18248 
   18249 static int
   18250 test_schematron(void) {
   18251     int test_ret = 0;
   18252 
   18253     if (quiet == 0) printf("Testing schematron : 1 of 10 functions ...\n");
   18254     test_ret += test_xmlSchematronNewDocParserCtxt();
   18255     test_ret += test_xmlSchematronNewMemParserCtxt();
   18256     test_ret += test_xmlSchematronNewParserCtxt();
   18257     test_ret += test_xmlSchematronNewValidCtxt();
   18258     test_ret += test_xmlSchematronParse();
   18259     test_ret += test_xmlSchematronSetValidStructuredErrors();
   18260     test_ret += test_xmlSchematronValidateDoc();
   18261 
   18262     if (test_ret != 0)
   18263 	printf("Module schematron: %d errors\n", test_ret);
   18264     return(test_ret);
   18265 }
   18266 
   18267 static int
   18268 test_xmlAddChild(void) {
   18269     int test_ret = 0;
   18270 
   18271     int mem_base;
   18272     xmlNodePtr ret_val;
   18273     xmlNodePtr parent; /* the parent node */
   18274     int n_parent;
   18275     xmlNodePtr cur; /* the child node */
   18276     int n_cur;
   18277 
   18278     for (n_parent = 0;n_parent < gen_nb_xmlNodePtr;n_parent++) {
   18279     for (n_cur = 0;n_cur < gen_nb_xmlNodePtr_in;n_cur++) {
   18280         mem_base = xmlMemBlocks();
   18281         parent = gen_xmlNodePtr(n_parent, 0);
   18282         cur = gen_xmlNodePtr_in(n_cur, 1);
   18283 
   18284         ret_val = xmlAddChild(parent, cur);
   18285         if (ret_val == NULL) { xmlFreeNode(cur) ; cur = NULL ; }
   18286         desret_xmlNodePtr(ret_val);
   18287         call_tests++;
   18288         des_xmlNodePtr(n_parent, parent, 0);
   18289         des_xmlNodePtr_in(n_cur, cur, 1);
   18290         xmlResetLastError();
   18291         if (mem_base != xmlMemBlocks()) {
   18292             printf("Leak of %d blocks found in xmlAddChild",
   18293 	           xmlMemBlocks() - mem_base);
   18294 	    test_ret++;
   18295             printf(" %d", n_parent);
   18296             printf(" %d", n_cur);
   18297             printf("\n");
   18298         }
   18299     }
   18300     }
   18301     function_tests++;
   18302 
   18303     return(test_ret);
   18304 }
   18305 
   18306 
   18307 static int
   18308 test_xmlAddChildList(void) {
   18309     int test_ret = 0;
   18310 
   18311     int mem_base;
   18312     xmlNodePtr ret_val;
   18313     xmlNodePtr parent; /* the parent node */
   18314     int n_parent;
   18315     xmlNodePtr cur; /* the first node in the list */
   18316     int n_cur;
   18317 
   18318     for (n_parent = 0;n_parent < gen_nb_xmlNodePtr;n_parent++) {
   18319     for (n_cur = 0;n_cur < gen_nb_xmlNodePtr_in;n_cur++) {
   18320         mem_base = xmlMemBlocks();
   18321         parent = gen_xmlNodePtr(n_parent, 0);
   18322         cur = gen_xmlNodePtr_in(n_cur, 1);
   18323 
   18324         ret_val = xmlAddChildList(parent, cur);
   18325         if (ret_val == NULL) { xmlFreeNodeList(cur) ; cur = NULL ; }
   18326         desret_xmlNodePtr(ret_val);
   18327         call_tests++;
   18328         des_xmlNodePtr(n_parent, parent, 0);
   18329         des_xmlNodePtr_in(n_cur, cur, 1);
   18330         xmlResetLastError();
   18331         if (mem_base != xmlMemBlocks()) {
   18332             printf("Leak of %d blocks found in xmlAddChildList",
   18333 	           xmlMemBlocks() - mem_base);
   18334 	    test_ret++;
   18335             printf(" %d", n_parent);
   18336             printf(" %d", n_cur);
   18337             printf("\n");
   18338         }
   18339     }
   18340     }
   18341     function_tests++;
   18342 
   18343     return(test_ret);
   18344 }
   18345 
   18346 
   18347 static int
   18348 test_xmlAddNextSibling(void) {
   18349     int test_ret = 0;
   18350 
   18351     int mem_base;
   18352     xmlNodePtr ret_val;
   18353     xmlNodePtr cur; /* the child node */
   18354     int n_cur;
   18355     xmlNodePtr elem; /* the new node */
   18356     int n_elem;
   18357 
   18358     for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
   18359     for (n_elem = 0;n_elem < gen_nb_xmlNodePtr_in;n_elem++) {
   18360         mem_base = xmlMemBlocks();
   18361         cur = gen_xmlNodePtr(n_cur, 0);
   18362         elem = gen_xmlNodePtr_in(n_elem, 1);
   18363 
   18364         ret_val = xmlAddNextSibling(cur, elem);
   18365         if (ret_val == NULL) { xmlFreeNode(elem) ; elem = NULL ; }
   18366         desret_xmlNodePtr(ret_val);
   18367         call_tests++;
   18368         des_xmlNodePtr(n_cur, cur, 0);
   18369         des_xmlNodePtr_in(n_elem, elem, 1);
   18370         xmlResetLastError();
   18371         if (mem_base != xmlMemBlocks()) {
   18372             printf("Leak of %d blocks found in xmlAddNextSibling",
   18373 	           xmlMemBlocks() - mem_base);
   18374 	    test_ret++;
   18375             printf(" %d", n_cur);
   18376             printf(" %d", n_elem);
   18377             printf("\n");
   18378         }
   18379     }
   18380     }
   18381     function_tests++;
   18382 
   18383     return(test_ret);
   18384 }
   18385 
   18386 
   18387 static int
   18388 test_xmlAddPrevSibling(void) {
   18389     int test_ret = 0;
   18390 
   18391 #if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_HTML_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED) || defined(LIBXML_XINCLUDE_ENABLED)
   18392     int mem_base;
   18393     xmlNodePtr ret_val;
   18394     xmlNodePtr cur; /* the child node */
   18395     int n_cur;
   18396     xmlNodePtr elem; /* the new node */
   18397     int n_elem;
   18398 
   18399     for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
   18400     for (n_elem = 0;n_elem < gen_nb_xmlNodePtr_in;n_elem++) {
   18401         mem_base = xmlMemBlocks();
   18402         cur = gen_xmlNodePtr(n_cur, 0);
   18403         elem = gen_xmlNodePtr_in(n_elem, 1);
   18404 
   18405         ret_val = xmlAddPrevSibling(cur, elem);
   18406         if (ret_val == NULL) { xmlFreeNode(elem) ; elem = NULL ; }
   18407         desret_xmlNodePtr(ret_val);
   18408         call_tests++;
   18409         des_xmlNodePtr(n_cur, cur, 0);
   18410         des_xmlNodePtr_in(n_elem, elem, 1);
   18411         xmlResetLastError();
   18412         if (mem_base != xmlMemBlocks()) {
   18413             printf("Leak of %d blocks found in xmlAddPrevSibling",
   18414 	           xmlMemBlocks() - mem_base);
   18415 	    test_ret++;
   18416             printf(" %d", n_cur);
   18417             printf(" %d", n_elem);
   18418             printf("\n");
   18419         }
   18420     }
   18421     }
   18422     function_tests++;
   18423 #endif
   18424 
   18425     return(test_ret);
   18426 }
   18427 
   18428 
   18429 static int
   18430 test_xmlAddSibling(void) {
   18431     int test_ret = 0;
   18432 
   18433     int mem_base;
   18434     xmlNodePtr ret_val;
   18435     xmlNodePtr cur; /* the child node */
   18436     int n_cur;
   18437     xmlNodePtr elem; /* the new node */
   18438     int n_elem;
   18439 
   18440     for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
   18441     for (n_elem = 0;n_elem < gen_nb_xmlNodePtr_in;n_elem++) {
   18442         mem_base = xmlMemBlocks();
   18443         cur = gen_xmlNodePtr(n_cur, 0);
   18444         elem = gen_xmlNodePtr_in(n_elem, 1);
   18445 
   18446         ret_val = xmlAddSibling(cur, elem);
   18447         if (ret_val == NULL) { xmlFreeNode(elem) ; elem = NULL ; }
   18448         desret_xmlNodePtr(ret_val);
   18449         call_tests++;
   18450         des_xmlNodePtr(n_cur, cur, 0);
   18451         des_xmlNodePtr_in(n_elem, elem, 1);
   18452         xmlResetLastError();
   18453         if (mem_base != xmlMemBlocks()) {
   18454             printf("Leak of %d blocks found in xmlAddSibling",
   18455 	           xmlMemBlocks() - mem_base);
   18456 	    test_ret++;
   18457             printf(" %d", n_cur);
   18458             printf(" %d", n_elem);
   18459             printf("\n");
   18460         }
   18461     }
   18462     }
   18463     function_tests++;
   18464 
   18465     return(test_ret);
   18466 }
   18467 
   18468 
   18469 static int
   18470 test_xmlAttrSerializeTxtContent(void) {
   18471     int test_ret = 0;
   18472 
   18473 #if defined(LIBXML_OUTPUT_ENABLED)
   18474 #ifdef LIBXML_OUTPUT_ENABLED
   18475     int mem_base;
   18476     xmlBufferPtr buf; /* the XML buffer output */
   18477     int n_buf;
   18478     xmlDocPtr doc; /* the document */
   18479     int n_doc;
   18480     xmlAttrPtr attr; /* the attribute node */
   18481     int n_attr;
   18482     xmlChar * string; /* the text content */
   18483     int n_string;
   18484 
   18485     for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
   18486     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
   18487     for (n_attr = 0;n_attr < gen_nb_xmlAttrPtr;n_attr++) {
   18488     for (n_string = 0;n_string < gen_nb_const_xmlChar_ptr;n_string++) {
   18489         mem_base = xmlMemBlocks();
   18490         buf = gen_xmlBufferPtr(n_buf, 0);
   18491         doc = gen_xmlDocPtr(n_doc, 1);
   18492         attr = gen_xmlAttrPtr(n_attr, 2);
   18493         string = gen_const_xmlChar_ptr(n_string, 3);
   18494 
   18495         xmlAttrSerializeTxtContent(buf, doc, attr, (const xmlChar *)string);
   18496         call_tests++;
   18497         des_xmlBufferPtr(n_buf, buf, 0);
   18498         des_xmlDocPtr(n_doc, doc, 1);
   18499         des_xmlAttrPtr(n_attr, attr, 2);
   18500         des_const_xmlChar_ptr(n_string, (const xmlChar *)string, 3);
   18501         xmlResetLastError();
   18502         if (mem_base != xmlMemBlocks()) {
   18503             printf("Leak of %d blocks found in xmlAttrSerializeTxtContent",
   18504 	           xmlMemBlocks() - mem_base);
   18505 	    test_ret++;
   18506             printf(" %d", n_buf);
   18507             printf(" %d", n_doc);
   18508             printf(" %d", n_attr);
   18509             printf(" %d", n_string);
   18510             printf("\n");
   18511         }
   18512     }
   18513     }
   18514     }
   18515     }
   18516     function_tests++;
   18517 #endif
   18518 #endif
   18519 
   18520     return(test_ret);
   18521 }
   18522 
   18523 
   18524 #define gen_nb_const_xmlBuf_ptr 1
   18525 static xmlBuf * gen_const_xmlBuf_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
   18526     return(NULL);
   18527 }
   18528 static void des_const_xmlBuf_ptr(int no ATTRIBUTE_UNUSED, const xmlBuf * val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
   18529 }
   18530 
   18531 static int
   18532 test_xmlBufContent(void) {
   18533     int test_ret = 0;
   18534 
   18535     int mem_base;
   18536     xmlChar * ret_val;
   18537     xmlBuf * buf; /* the buffer */
   18538     int n_buf;
   18539 
   18540     for (n_buf = 0;n_buf < gen_nb_const_xmlBuf_ptr;n_buf++) {
   18541         mem_base = xmlMemBlocks();
   18542         buf = gen_const_xmlBuf_ptr(n_buf, 0);
   18543 
   18544         ret_val = xmlBufContent((const xmlBuf *)buf);
   18545         desret_xmlChar_ptr(ret_val);
   18546         call_tests++;
   18547         des_const_xmlBuf_ptr(n_buf, (const xmlBuf *)buf, 0);
   18548         xmlResetLastError();
   18549         if (mem_base != xmlMemBlocks()) {
   18550             printf("Leak of %d blocks found in xmlBufContent",
   18551 	           xmlMemBlocks() - mem_base);
   18552 	    test_ret++;
   18553             printf(" %d", n_buf);
   18554             printf("\n");
   18555         }
   18556     }
   18557     function_tests++;
   18558 
   18559     return(test_ret);
   18560 }
   18561 
   18562 
   18563 #define gen_nb_xmlBufPtr 1
   18564 static xmlBufPtr gen_xmlBufPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
   18565     return(NULL);
   18566 }
   18567 static void des_xmlBufPtr(int no ATTRIBUTE_UNUSED, xmlBufPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
   18568 }
   18569 
   18570 static int
   18571 test_xmlBufEnd(void) {
   18572     int test_ret = 0;
   18573 
   18574     int mem_base;
   18575     xmlChar * ret_val;
   18576     xmlBufPtr buf; /* the buffer */
   18577     int n_buf;
   18578 
   18579     for (n_buf = 0;n_buf < gen_nb_xmlBufPtr;n_buf++) {
   18580         mem_base = xmlMemBlocks();
   18581         buf = gen_xmlBufPtr(n_buf, 0);
   18582 
   18583         ret_val = xmlBufEnd(buf);
   18584         desret_xmlChar_ptr(ret_val);
   18585         call_tests++;
   18586         des_xmlBufPtr(n_buf, buf, 0);
   18587         xmlResetLastError();
   18588         if (mem_base != xmlMemBlocks()) {
   18589             printf("Leak of %d blocks found in xmlBufEnd",
   18590 	           xmlMemBlocks() - mem_base);
   18591 	    test_ret++;
   18592             printf(" %d", n_buf);
   18593             printf("\n");
   18594         }
   18595     }
   18596     function_tests++;
   18597 
   18598     return(test_ret);
   18599 }
   18600 
   18601 
   18602 #define gen_nb_const_xmlNode_ptr 1
   18603 static xmlNode * gen_const_xmlNode_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
   18604     return(NULL);
   18605 }
   18606 static void des_const_xmlNode_ptr(int no ATTRIBUTE_UNUSED, const xmlNode * val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
   18607 }
   18608 
   18609 static int
   18610 test_xmlBufGetNodeContent(void) {
   18611     int test_ret = 0;
   18612 
   18613     int mem_base;
   18614     int ret_val;
   18615     xmlBufPtr buf; /* a buffer xmlBufPtr */
   18616     int n_buf;
   18617     xmlNode * cur; /* the node being read */
   18618     int n_cur;
   18619 
   18620     for (n_buf = 0;n_buf < gen_nb_xmlBufPtr;n_buf++) {
   18621     for (n_cur = 0;n_cur < gen_nb_const_xmlNode_ptr;n_cur++) {
   18622         mem_base = xmlMemBlocks();
   18623         buf = gen_xmlBufPtr(n_buf, 0);
   18624         cur = gen_const_xmlNode_ptr(n_cur, 1);
   18625 
   18626         ret_val = xmlBufGetNodeContent(buf, (const xmlNode *)cur);
   18627         desret_int(ret_val);
   18628         call_tests++;
   18629         des_xmlBufPtr(n_buf, buf, 0);
   18630         des_const_xmlNode_ptr(n_cur, (const xmlNode *)cur, 1);
   18631         xmlResetLastError();
   18632         if (mem_base != xmlMemBlocks()) {
   18633             printf("Leak of %d blocks found in xmlBufGetNodeContent",
   18634 	           xmlMemBlocks() - mem_base);
   18635 	    test_ret++;
   18636             printf(" %d", n_buf);
   18637             printf(" %d", n_cur);
   18638             printf("\n");
   18639         }
   18640     }
   18641     }
   18642     function_tests++;
   18643 
   18644     return(test_ret);
   18645 }
   18646 
   18647 
   18648 static int
   18649 test_xmlBufNodeDump(void) {
   18650     int test_ret = 0;
   18651 
   18652 
   18653     /* missing type support */
   18654     return(test_ret);
   18655 }
   18656 
   18657 
   18658 static int
   18659 test_xmlBufShrink(void) {
   18660     int test_ret = 0;
   18661 
   18662 
   18663     /* missing type support */
   18664     return(test_ret);
   18665 }
   18666 
   18667 
   18668 #define gen_nb_const_xmlBufPtr 1
   18669 static xmlBufPtr gen_const_xmlBufPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
   18670     return(NULL);
   18671 }
   18672 static void des_const_xmlBufPtr(int no ATTRIBUTE_UNUSED, const xmlBufPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
   18673 }
   18674 
   18675 static int
   18676 test_xmlBufUse(void) {
   18677     int test_ret = 0;
   18678 
   18679 
   18680     /* missing type support */
   18681     return(test_ret);
   18682 }
   18683 
   18684 
   18685 static int
   18686 test_xmlBufferAdd(void) {
   18687     int test_ret = 0;
   18688 
   18689     int mem_base;
   18690     int ret_val;
   18691     xmlBufferPtr buf; /* the buffer to dump */
   18692     int n_buf;
   18693     xmlChar * str; /* the #xmlChar string */
   18694     int n_str;
   18695     int len; /* the number of #xmlChar to add */
   18696     int n_len;
   18697 
   18698     for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
   18699     for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) {
   18700     for (n_len = 0;n_len < gen_nb_int;n_len++) {
   18701         mem_base = xmlMemBlocks();
   18702         buf = gen_xmlBufferPtr(n_buf, 0);
   18703         str = gen_const_xmlChar_ptr(n_str, 1);
   18704         len = gen_int(n_len, 2);
   18705         if ((str != NULL) &&
   18706             (len > (int) strlen((const char *) str) + 1))
   18707             continue;
   18708 
   18709         ret_val = xmlBufferAdd(buf, (const xmlChar *)str, len);
   18710         desret_int(ret_val);
   18711         call_tests++;
   18712         des_xmlBufferPtr(n_buf, buf, 0);
   18713         des_const_xmlChar_ptr(n_str, (const xmlChar *)str, 1);
   18714         des_int(n_len, len, 2);
   18715         xmlResetLastError();
   18716         if (mem_base != xmlMemBlocks()) {
   18717             printf("Leak of %d blocks found in xmlBufferAdd",
   18718 	           xmlMemBlocks() - mem_base);
   18719 	    test_ret++;
   18720             printf(" %d", n_buf);
   18721             printf(" %d", n_str);
   18722             printf(" %d", n_len);
   18723             printf("\n");
   18724         }
   18725     }
   18726     }
   18727     }
   18728     function_tests++;
   18729 
   18730     return(test_ret);
   18731 }
   18732 
   18733 
   18734 static int
   18735 test_xmlBufferAddHead(void) {
   18736     int test_ret = 0;
   18737 
   18738     int mem_base;
   18739     int ret_val;
   18740     xmlBufferPtr buf; /* the buffer */
   18741     int n_buf;
   18742     xmlChar * str; /* the #xmlChar string */
   18743     int n_str;
   18744     int len; /* the number of #xmlChar to add */
   18745     int n_len;
   18746 
   18747     for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
   18748     for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) {
   18749     for (n_len = 0;n_len < gen_nb_int;n_len++) {
   18750         mem_base = xmlMemBlocks();
   18751         buf = gen_xmlBufferPtr(n_buf, 0);
   18752         str = gen_const_xmlChar_ptr(n_str, 1);
   18753         len = gen_int(n_len, 2);
   18754         if ((str != NULL) &&
   18755             (len > (int) strlen((const char *) str) + 1))
   18756             continue;
   18757 
   18758         ret_val = xmlBufferAddHead(buf, (const xmlChar *)str, len);
   18759         desret_int(ret_val);
   18760         call_tests++;
   18761         des_xmlBufferPtr(n_buf, buf, 0);
   18762         des_const_xmlChar_ptr(n_str, (const xmlChar *)str, 1);
   18763         des_int(n_len, len, 2);
   18764         xmlResetLastError();
   18765         if (mem_base != xmlMemBlocks()) {
   18766             printf("Leak of %d blocks found in xmlBufferAddHead",
   18767 	           xmlMemBlocks() - mem_base);
   18768 	    test_ret++;
   18769             printf(" %d", n_buf);
   18770             printf(" %d", n_str);
   18771             printf(" %d", n_len);
   18772             printf("\n");
   18773         }
   18774     }
   18775     }
   18776     }
   18777     function_tests++;
   18778 
   18779     return(test_ret);
   18780 }
   18781 
   18782 
   18783 static int
   18784 test_xmlBufferCCat(void) {
   18785     int test_ret = 0;
   18786 
   18787     int mem_base;
   18788     int ret_val;
   18789     xmlBufferPtr buf; /* the buffer to dump */
   18790     int n_buf;
   18791     char * str; /* the C char string */
   18792     int n_str;
   18793 
   18794     for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
   18795     for (n_str = 0;n_str < gen_nb_const_char_ptr;n_str++) {
   18796         mem_base = xmlMemBlocks();
   18797         buf = gen_xmlBufferPtr(n_buf, 0);
   18798         str = gen_const_char_ptr(n_str, 1);
   18799 
   18800         ret_val = xmlBufferCCat(buf, (const char *)str);
   18801         desret_int(ret_val);
   18802         call_tests++;
   18803         des_xmlBufferPtr(n_buf, buf, 0);
   18804         des_const_char_ptr(n_str, (const char *)str, 1);
   18805         xmlResetLastError();
   18806         if (mem_base != xmlMemBlocks()) {
   18807             printf("Leak of %d blocks found in xmlBufferCCat",
   18808 	           xmlMemBlocks() - mem_base);
   18809 	    test_ret++;
   18810             printf(" %d", n_buf);
   18811             printf(" %d", n_str);
   18812             printf("\n");
   18813         }
   18814     }
   18815     }
   18816     function_tests++;
   18817 
   18818     return(test_ret);
   18819 }
   18820 
   18821 
   18822 static int
   18823 test_xmlBufferCat(void) {
   18824     int test_ret = 0;
   18825 
   18826     int mem_base;
   18827     int ret_val;
   18828     xmlBufferPtr buf; /* the buffer to add to */
   18829     int n_buf;
   18830     xmlChar * str; /* the #xmlChar string */
   18831     int n_str;
   18832 
   18833     for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
   18834     for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) {
   18835         mem_base = xmlMemBlocks();
   18836         buf = gen_xmlBufferPtr(n_buf, 0);
   18837         str = gen_const_xmlChar_ptr(n_str, 1);
   18838 
   18839         ret_val = xmlBufferCat(buf, (const xmlChar *)str);
   18840         desret_int(ret_val);
   18841         call_tests++;
   18842         des_xmlBufferPtr(n_buf, buf, 0);
   18843         des_const_xmlChar_ptr(n_str, (const xmlChar *)str, 1);
   18844         xmlResetLastError();
   18845         if (mem_base != xmlMemBlocks()) {
   18846             printf("Leak of %d blocks found in xmlBufferCat",
   18847 	           xmlMemBlocks() - mem_base);
   18848 	    test_ret++;
   18849             printf(" %d", n_buf);
   18850             printf(" %d", n_str);
   18851             printf("\n");
   18852         }
   18853     }
   18854     }
   18855     function_tests++;
   18856 
   18857     return(test_ret);
   18858 }
   18859 
   18860 
   18861 #define gen_nb_const_xmlBuffer_ptr 1
   18862 static xmlBuffer * gen_const_xmlBuffer_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
   18863     return(NULL);
   18864 }
   18865 static void des_const_xmlBuffer_ptr(int no ATTRIBUTE_UNUSED, const xmlBuffer * val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
   18866 }
   18867 
   18868 static int
   18869 test_xmlBufferContent(void) {
   18870     int test_ret = 0;
   18871 
   18872     int mem_base;
   18873     const xmlChar * ret_val;
   18874     xmlBuffer * buf; /* the buffer */
   18875     int n_buf;
   18876 
   18877     for (n_buf = 0;n_buf < gen_nb_const_xmlBuffer_ptr;n_buf++) {
   18878         mem_base = xmlMemBlocks();
   18879         buf = gen_const_xmlBuffer_ptr(n_buf, 0);
   18880 
   18881         ret_val = xmlBufferContent((const xmlBuffer *)buf);
   18882         desret_const_xmlChar_ptr(ret_val);
   18883         call_tests++;
   18884         des_const_xmlBuffer_ptr(n_buf, (const xmlBuffer *)buf, 0);
   18885         xmlResetLastError();
   18886         if (mem_base != xmlMemBlocks()) {
   18887             printf("Leak of %d blocks found in xmlBufferContent",
   18888 	           xmlMemBlocks() - mem_base);
   18889 	    test_ret++;
   18890             printf(" %d", n_buf);
   18891             printf("\n");
   18892         }
   18893     }
   18894     function_tests++;
   18895 
   18896     return(test_ret);
   18897 }
   18898 
   18899 
   18900 static int
   18901 test_xmlBufferCreate(void) {
   18902     int test_ret = 0;
   18903 
   18904     int mem_base;
   18905     xmlBufferPtr ret_val;
   18906 
   18907         mem_base = xmlMemBlocks();
   18908 
   18909         ret_val = xmlBufferCreate();
   18910         desret_xmlBufferPtr(ret_val);
   18911         call_tests++;
   18912         xmlResetLastError();
   18913         if (mem_base != xmlMemBlocks()) {
   18914             printf("Leak of %d blocks found in xmlBufferCreate",
   18915 	           xmlMemBlocks() - mem_base);
   18916 	    test_ret++;
   18917             printf("\n");
   18918         }
   18919     function_tests++;
   18920 
   18921     return(test_ret);
   18922 }
   18923 
   18924 
   18925 static int
   18926 test_xmlBufferCreateSize(void) {
   18927     int test_ret = 0;
   18928 
   18929 
   18930     /* missing type support */
   18931     return(test_ret);
   18932 }
   18933 
   18934 
   18935 static int
   18936 test_xmlBufferCreateStatic(void) {
   18937     int test_ret = 0;
   18938 
   18939 
   18940     /* missing type support */
   18941     return(test_ret);
   18942 }
   18943 
   18944 
   18945 static int
   18946 test_xmlBufferDetach(void) {
   18947     int test_ret = 0;
   18948 
   18949     int mem_base;
   18950     xmlChar * ret_val;
   18951     xmlBufferPtr buf; /* the buffer */
   18952     int n_buf;
   18953 
   18954     for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
   18955         mem_base = xmlMemBlocks();
   18956         buf = gen_xmlBufferPtr(n_buf, 0);
   18957 
   18958         ret_val = xmlBufferDetach(buf);
   18959         desret_xmlChar_ptr(ret_val);
   18960         call_tests++;
   18961         des_xmlBufferPtr(n_buf, buf, 0);
   18962         xmlResetLastError();
   18963         if (mem_base != xmlMemBlocks()) {
   18964             printf("Leak of %d blocks found in xmlBufferDetach",
   18965 	           xmlMemBlocks() - mem_base);
   18966 	    test_ret++;
   18967             printf(" %d", n_buf);
   18968             printf("\n");
   18969         }
   18970     }
   18971     function_tests++;
   18972 
   18973     return(test_ret);
   18974 }
   18975 
   18976 
   18977 static int
   18978 test_xmlBufferEmpty(void) {
   18979     int test_ret = 0;
   18980 
   18981     int mem_base;
   18982     xmlBufferPtr buf; /* the buffer */
   18983     int n_buf;
   18984 
   18985     for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
   18986         mem_base = xmlMemBlocks();
   18987         buf = gen_xmlBufferPtr(n_buf, 0);
   18988 
   18989         xmlBufferEmpty(buf);
   18990         call_tests++;
   18991         des_xmlBufferPtr(n_buf, buf, 0);
   18992         xmlResetLastError();
   18993         if (mem_base != xmlMemBlocks()) {
   18994             printf("Leak of %d blocks found in xmlBufferEmpty",
   18995 	           xmlMemBlocks() - mem_base);
   18996 	    test_ret++;
   18997             printf(" %d", n_buf);
   18998             printf("\n");
   18999         }
   19000     }
   19001     function_tests++;
   19002 
   19003     return(test_ret);
   19004 }
   19005 
   19006 
   19007 static int
   19008 test_xmlBufferGrow(void) {
   19009     int test_ret = 0;
   19010 
   19011     int mem_base;
   19012     int ret_val;
   19013     xmlBufferPtr buf; /* the buffer */
   19014     int n_buf;
   19015     unsigned int len; /* the minimum free size to allocate */
   19016     int n_len;
   19017 
   19018     for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
   19019     for (n_len = 0;n_len < gen_nb_unsigned_int;n_len++) {
   19020         mem_base = xmlMemBlocks();
   19021         buf = gen_xmlBufferPtr(n_buf, 0);
   19022         len = gen_unsigned_int(n_len, 1);
   19023 
   19024         ret_val = xmlBufferGrow(buf, len);
   19025         desret_int(ret_val);
   19026         call_tests++;
   19027         des_xmlBufferPtr(n_buf, buf, 0);
   19028         des_unsigned_int(n_len, len, 1);
   19029         xmlResetLastError();
   19030         if (mem_base != xmlMemBlocks()) {
   19031             printf("Leak of %d blocks found in xmlBufferGrow",
   19032 	           xmlMemBlocks() - mem_base);
   19033 	    test_ret++;
   19034             printf(" %d", n_buf);
   19035             printf(" %d", n_len);
   19036             printf("\n");
   19037         }
   19038     }
   19039     }
   19040     function_tests++;
   19041 
   19042     return(test_ret);
   19043 }
   19044 
   19045 
   19046 static int
   19047 test_xmlBufferLength(void) {
   19048     int test_ret = 0;
   19049 
   19050     int mem_base;
   19051     int ret_val;
   19052     xmlBuffer * buf; /* the buffer */
   19053     int n_buf;
   19054 
   19055     for (n_buf = 0;n_buf < gen_nb_const_xmlBuffer_ptr;n_buf++) {
   19056         mem_base = xmlMemBlocks();
   19057         buf = gen_const_xmlBuffer_ptr(n_buf, 0);
   19058 
   19059         ret_val = xmlBufferLength((const xmlBuffer *)buf);
   19060         desret_int(ret_val);
   19061         call_tests++;
   19062         des_const_xmlBuffer_ptr(n_buf, (const xmlBuffer *)buf, 0);
   19063         xmlResetLastError();
   19064         if (mem_base != xmlMemBlocks()) {
   19065             printf("Leak of %d blocks found in xmlBufferLength",
   19066 	           xmlMemBlocks() - mem_base);
   19067 	    test_ret++;
   19068             printf(" %d", n_buf);
   19069             printf("\n");
   19070         }
   19071     }
   19072     function_tests++;
   19073 
   19074     return(test_ret);
   19075 }
   19076 
   19077 
   19078 static int
   19079 test_xmlBufferResize(void) {
   19080     int test_ret = 0;
   19081 
   19082     int mem_base;
   19083     int ret_val;
   19084     xmlBufferPtr buf; /* the buffer to resize */
   19085     int n_buf;
   19086     unsigned int size; /* the desired size */
   19087     int n_size;
   19088 
   19089     for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
   19090     for (n_size = 0;n_size < gen_nb_unsigned_int;n_size++) {
   19091         mem_base = xmlMemBlocks();
   19092         buf = gen_xmlBufferPtr(n_buf, 0);
   19093         size = gen_unsigned_int(n_size, 1);
   19094 
   19095         ret_val = xmlBufferResize(buf, size);
   19096         desret_int(ret_val);
   19097         call_tests++;
   19098         des_xmlBufferPtr(n_buf, buf, 0);
   19099         des_unsigned_int(n_size, size, 1);
   19100         xmlResetLastError();
   19101         if (mem_base != xmlMemBlocks()) {
   19102             printf("Leak of %d blocks found in xmlBufferResize",
   19103 	           xmlMemBlocks() - mem_base);
   19104 	    test_ret++;
   19105             printf(" %d", n_buf);
   19106             printf(" %d", n_size);
   19107             printf("\n");
   19108         }
   19109     }
   19110     }
   19111     function_tests++;
   19112 
   19113     return(test_ret);
   19114 }
   19115 
   19116 
   19117 static int
   19118 test_xmlBufferSetAllocationScheme(void) {
   19119     int test_ret = 0;
   19120 
   19121     int mem_base;
   19122     xmlBufferPtr buf; /* the buffer to tune */
   19123     int n_buf;
   19124     xmlBufferAllocationScheme scheme; /* allocation scheme to use */
   19125     int n_scheme;
   19126 
   19127     for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
   19128     for (n_scheme = 0;n_scheme < gen_nb_xmlBufferAllocationScheme;n_scheme++) {
   19129         mem_base = xmlMemBlocks();
   19130         buf = gen_xmlBufferPtr(n_buf, 0);
   19131         scheme = gen_xmlBufferAllocationScheme(n_scheme, 1);
   19132 
   19133         xmlBufferSetAllocationScheme(buf, scheme);
   19134         if ((buf != NULL) && (scheme == XML_BUFFER_ALLOC_IMMUTABLE) && (buf->content != NULL) && (buf->content != static_buf_content)) { xmlFree(buf->content); buf->content = NULL;}
   19135         call_tests++;
   19136         des_xmlBufferPtr(n_buf, buf, 0);
   19137         des_xmlBufferAllocationScheme(n_scheme, scheme, 1);
   19138         xmlResetLastError();
   19139         if (mem_base != xmlMemBlocks()) {
   19140             printf("Leak of %d blocks found in xmlBufferSetAllocationScheme",
   19141 	           xmlMemBlocks() - mem_base);
   19142 	    test_ret++;
   19143             printf(" %d", n_buf);
   19144             printf(" %d", n_scheme);
   19145             printf("\n");
   19146         }
   19147     }
   19148     }
   19149     function_tests++;
   19150 
   19151     return(test_ret);
   19152 }
   19153 
   19154 
   19155 static int
   19156 test_xmlBufferShrink(void) {
   19157     int test_ret = 0;
   19158 
   19159     int mem_base;
   19160     int ret_val;
   19161     xmlBufferPtr buf; /* the buffer to dump */
   19162     int n_buf;
   19163     unsigned int len; /* the number of xmlChar to remove */
   19164     int n_len;
   19165 
   19166     for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
   19167     for (n_len = 0;n_len < gen_nb_unsigned_int;n_len++) {
   19168         mem_base = xmlMemBlocks();
   19169         buf = gen_xmlBufferPtr(n_buf, 0);
   19170         len = gen_unsigned_int(n_len, 1);
   19171 
   19172         ret_val = xmlBufferShrink(buf, len);
   19173         desret_int(ret_val);
   19174         call_tests++;
   19175         des_xmlBufferPtr(n_buf, buf, 0);
   19176         des_unsigned_int(n_len, len, 1);
   19177         xmlResetLastError();
   19178         if (mem_base != xmlMemBlocks()) {
   19179             printf("Leak of %d blocks found in xmlBufferShrink",
   19180 	           xmlMemBlocks() - mem_base);
   19181 	    test_ret++;
   19182             printf(" %d", n_buf);
   19183             printf(" %d", n_len);
   19184             printf("\n");
   19185         }
   19186     }
   19187     }
   19188     function_tests++;
   19189 
   19190     return(test_ret);
   19191 }
   19192 
   19193 
   19194 static int
   19195 test_xmlBufferWriteCHAR(void) {
   19196     int test_ret = 0;
   19197 
   19198     int mem_base;
   19199     xmlBufferPtr buf; /* the XML buffer */
   19200     int n_buf;
   19201     xmlChar * string; /* the string to add */
   19202     int n_string;
   19203 
   19204     for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
   19205     for (n_string = 0;n_string < gen_nb_const_xmlChar_ptr;n_string++) {
   19206         mem_base = xmlMemBlocks();
   19207         buf = gen_xmlBufferPtr(n_buf, 0);
   19208         string = gen_const_xmlChar_ptr(n_string, 1);
   19209 
   19210         xmlBufferWriteCHAR(buf, (const xmlChar *)string);
   19211         call_tests++;
   19212         des_xmlBufferPtr(n_buf, buf, 0);
   19213         des_const_xmlChar_ptr(n_string, (const xmlChar *)string, 1);
   19214         xmlResetLastError();
   19215         if (mem_base != xmlMemBlocks()) {
   19216             printf("Leak of %d blocks found in xmlBufferWriteCHAR",
   19217 	           xmlMemBlocks() - mem_base);
   19218 	    test_ret++;
   19219             printf(" %d", n_buf);
   19220             printf(" %d", n_string);
   19221             printf("\n");
   19222         }
   19223     }
   19224     }
   19225     function_tests++;
   19226 
   19227     return(test_ret);
   19228 }
   19229 
   19230 
   19231 static int
   19232 test_xmlBufferWriteChar(void) {
   19233     int test_ret = 0;
   19234 
   19235     int mem_base;
   19236     xmlBufferPtr buf; /* the XML buffer output */
   19237     int n_buf;
   19238     char * string; /* the string to add */
   19239     int n_string;
   19240 
   19241     for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
   19242     for (n_string = 0;n_string < gen_nb_const_char_ptr;n_string++) {
   19243         mem_base = xmlMemBlocks();
   19244         buf = gen_xmlBufferPtr(n_buf, 0);
   19245         string = gen_const_char_ptr(n_string, 1);
   19246 
   19247         xmlBufferWriteChar(buf, (const char *)string);
   19248         call_tests++;
   19249         des_xmlBufferPtr(n_buf, buf, 0);
   19250         des_const_char_ptr(n_string, (const char *)string, 1);
   19251         xmlResetLastError();
   19252         if (mem_base != xmlMemBlocks()) {
   19253             printf("Leak of %d blocks found in xmlBufferWriteChar",
   19254 	           xmlMemBlocks() - mem_base);
   19255 	    test_ret++;
   19256             printf(" %d", n_buf);
   19257             printf(" %d", n_string);
   19258             printf("\n");
   19259         }
   19260     }
   19261     }
   19262     function_tests++;
   19263 
   19264     return(test_ret);
   19265 }
   19266 
   19267 
   19268 static int
   19269 test_xmlBufferWriteQuotedString(void) {
   19270     int test_ret = 0;
   19271 
   19272     int mem_base;
   19273     xmlBufferPtr buf; /* the XML buffer output */
   19274     int n_buf;
   19275     xmlChar * string; /* the string to add */
   19276     int n_string;
   19277 
   19278     for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
   19279     for (n_string = 0;n_string < gen_nb_const_xmlChar_ptr;n_string++) {
   19280         mem_base = xmlMemBlocks();
   19281         buf = gen_xmlBufferPtr(n_buf, 0);
   19282         string = gen_const_xmlChar_ptr(n_string, 1);
   19283 
   19284         xmlBufferWriteQuotedString(buf, (const xmlChar *)string);
   19285         call_tests++;
   19286         des_xmlBufferPtr(n_buf, buf, 0);
   19287         des_const_xmlChar_ptr(n_string, (const xmlChar *)string, 1);
   19288         xmlResetLastError();
   19289         if (mem_base != xmlMemBlocks()) {
   19290             printf("Leak of %d blocks found in xmlBufferWriteQuotedString",
   19291 	           xmlMemBlocks() - mem_base);
   19292 	    test_ret++;
   19293             printf(" %d", n_buf);
   19294             printf(" %d", n_string);
   19295             printf("\n");
   19296         }
   19297     }
   19298     }
   19299     function_tests++;
   19300 
   19301     return(test_ret);
   19302 }
   19303 
   19304 
   19305 static int
   19306 test_xmlBuildQName(void) {
   19307     int test_ret = 0;
   19308 
   19309     int mem_base;
   19310     xmlChar * ret_val;
   19311     xmlChar * ncname; /* the Name */
   19312     int n_ncname;
   19313     xmlChar * prefix; /* the prefix */
   19314     int n_prefix;
   19315     xmlChar * memory; /* preallocated memory */
   19316     int n_memory;
   19317     int len; /* preallocated memory length */
   19318     int n_len;
   19319 
   19320     for (n_ncname = 0;n_ncname < gen_nb_const_xmlChar_ptr;n_ncname++) {
   19321     for (n_prefix = 0;n_prefix < gen_nb_const_xmlChar_ptr;n_prefix++) {
   19322     for (n_memory = 0;n_memory < gen_nb_xmlChar_ptr;n_memory++) {
   19323     for (n_len = 0;n_len < gen_nb_int;n_len++) {
   19324         mem_base = xmlMemBlocks();
   19325         ncname = gen_const_xmlChar_ptr(n_ncname, 0);
   19326         prefix = gen_const_xmlChar_ptr(n_prefix, 1);
   19327         memory = gen_xmlChar_ptr(n_memory, 2);
   19328         len = gen_int(n_len, 3);
   19329         if ((prefix != NULL) &&
   19330             (len > (int) strlen((const char *) prefix) + 1))
   19331             continue;
   19332 
   19333         ret_val = xmlBuildQName((const xmlChar *)ncname, (const xmlChar *)prefix, memory, len);
   19334         if ((ret_val != NULL) && (ret_val != ncname) &&
   19335               (ret_val != prefix) && (ret_val != memory))
   19336               xmlFree(ret_val);
   19337 	  ret_val = NULL;
   19338         desret_xmlChar_ptr(ret_val);
   19339         call_tests++;
   19340         des_const_xmlChar_ptr(n_ncname, (const xmlChar *)ncname, 0);
   19341         des_const_xmlChar_ptr(n_prefix, (const xmlChar *)prefix, 1);
   19342         des_xmlChar_ptr(n_memory, memory, 2);
   19343         des_int(n_len, len, 3);
   19344         xmlResetLastError();
   19345         if (mem_base != xmlMemBlocks()) {
   19346             printf("Leak of %d blocks found in xmlBuildQName",
   19347 	           xmlMemBlocks() - mem_base);
   19348 	    test_ret++;
   19349             printf(" %d", n_ncname);
   19350             printf(" %d", n_prefix);
   19351             printf(" %d", n_memory);
   19352             printf(" %d", n_len);
   19353             printf("\n");
   19354         }
   19355     }
   19356     }
   19357     }
   19358     }
   19359     function_tests++;
   19360 
   19361     return(test_ret);
   19362 }
   19363 
   19364 
   19365 static int
   19366 test_xmlChildElementCount(void) {
   19367     int test_ret = 0;
   19368 
   19369 #if defined(LIBXML_TREE_ENABLED)
   19370     int mem_base;
   19371     unsigned long ret_val;
   19372     xmlNodePtr parent; /* the parent node */
   19373     int n_parent;
   19374 
   19375     for (n_parent = 0;n_parent < gen_nb_xmlNodePtr;n_parent++) {
   19376         mem_base = xmlMemBlocks();
   19377         parent = gen_xmlNodePtr(n_parent, 0);
   19378 
   19379         ret_val = xmlChildElementCount(parent);
   19380         desret_unsigned_long(ret_val);
   19381         call_tests++;
   19382         des_xmlNodePtr(n_parent, parent, 0);
   19383         xmlResetLastError();
   19384         if (mem_base != xmlMemBlocks()) {
   19385             printf("Leak of %d blocks found in xmlChildElementCount",
   19386 	           xmlMemBlocks() - mem_base);
   19387 	    test_ret++;
   19388             printf(" %d", n_parent);
   19389             printf("\n");
   19390         }
   19391     }
   19392     function_tests++;
   19393 #endif
   19394 
   19395     return(test_ret);
   19396 }
   19397 
   19398 
   19399 static int
   19400 test_xmlCopyDoc(void) {
   19401     int test_ret = 0;
   19402 
   19403 #if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED)
   19404     int mem_base;
   19405     xmlDocPtr ret_val;
   19406     xmlDocPtr doc; /* the document */
   19407     int n_doc;
   19408     int recursive; /* if not zero do a recursive copy. */
   19409     int n_recursive;
   19410 
   19411     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
   19412     for (n_recursive = 0;n_recursive < gen_nb_int;n_recursive++) {
   19413         mem_base = xmlMemBlocks();
   19414         doc = gen_xmlDocPtr(n_doc, 0);
   19415         recursive = gen_int(n_recursive, 1);
   19416 
   19417         ret_val = xmlCopyDoc(doc, recursive);
   19418         desret_xmlDocPtr(ret_val);
   19419         call_tests++;
   19420         des_xmlDocPtr(n_doc, doc, 0);
   19421         des_int(n_recursive, recursive, 1);
   19422         xmlResetLastError();
   19423         if (mem_base != xmlMemBlocks()) {
   19424             printf("Leak of %d blocks found in xmlCopyDoc",
   19425 	           xmlMemBlocks() - mem_base);
   19426 	    test_ret++;
   19427             printf(" %d", n_doc);
   19428             printf(" %d", n_recursive);
   19429             printf("\n");
   19430         }
   19431     }
   19432     }
   19433     function_tests++;
   19434 #endif
   19435 
   19436     return(test_ret);
   19437 }
   19438 
   19439 
   19440 static int
   19441 test_xmlCopyDtd(void) {
   19442     int test_ret = 0;
   19443 
   19444 #if defined(LIBXML_TREE_ENABLED)
   19445     int mem_base;
   19446     xmlDtdPtr ret_val;
   19447     xmlDtdPtr dtd; /* the dtd */
   19448     int n_dtd;
   19449 
   19450     for (n_dtd = 0;n_dtd < gen_nb_xmlDtdPtr;n_dtd++) {
   19451         mem_base = xmlMemBlocks();
   19452         dtd = gen_xmlDtdPtr(n_dtd, 0);
   19453 
   19454         ret_val = xmlCopyDtd(dtd);
   19455         desret_xmlDtdPtr(ret_val);
   19456         call_tests++;
   19457         des_xmlDtdPtr(n_dtd, dtd, 0);
   19458         xmlResetLastError();
   19459         if (mem_base != xmlMemBlocks()) {
   19460             printf("Leak of %d blocks found in xmlCopyDtd",
   19461 	           xmlMemBlocks() - mem_base);
   19462 	    test_ret++;
   19463             printf(" %d", n_dtd);
   19464             printf("\n");
   19465         }
   19466     }
   19467     function_tests++;
   19468 #endif
   19469 
   19470     return(test_ret);
   19471 }
   19472 
   19473 
   19474 static int
   19475 test_xmlCopyNamespace(void) {
   19476     int test_ret = 0;
   19477 
   19478     int mem_base;
   19479     xmlNsPtr ret_val;
   19480     xmlNsPtr cur; /* the namespace */
   19481     int n_cur;
   19482 
   19483     for (n_cur = 0;n_cur < gen_nb_xmlNsPtr;n_cur++) {
   19484         mem_base = xmlMemBlocks();
   19485         cur = gen_xmlNsPtr(n_cur, 0);
   19486 
   19487         ret_val = xmlCopyNamespace(cur);
   19488         if (ret_val != NULL) xmlFreeNs(ret_val);
   19489         desret_xmlNsPtr(ret_val);
   19490         call_tests++;
   19491         des_xmlNsPtr(n_cur, cur, 0);
   19492         xmlResetLastError();
   19493         if (mem_base != xmlMemBlocks()) {
   19494             printf("Leak of %d blocks found in xmlCopyNamespace",
   19495 	           xmlMemBlocks() - mem_base);
   19496 	    test_ret++;
   19497             printf(" %d", n_cur);
   19498             printf("\n");
   19499         }
   19500     }
   19501     function_tests++;
   19502 
   19503     return(test_ret);
   19504 }
   19505 
   19506 
   19507 static int
   19508 test_xmlCopyNamespaceList(void) {
   19509     int test_ret = 0;
   19510 
   19511     int mem_base;
   19512     xmlNsPtr ret_val;
   19513     xmlNsPtr cur; /* the first namespace */
   19514     int n_cur;
   19515 
   19516     for (n_cur = 0;n_cur < gen_nb_xmlNsPtr;n_cur++) {
   19517         mem_base = xmlMemBlocks();
   19518         cur = gen_xmlNsPtr(n_cur, 0);
   19519 
   19520         ret_val = xmlCopyNamespaceList(cur);
   19521         if (ret_val != NULL) xmlFreeNsList(ret_val);
   19522         desret_xmlNsPtr(ret_val);
   19523         call_tests++;
   19524         des_xmlNsPtr(n_cur, cur, 0);
   19525         xmlResetLastError();
   19526         if (mem_base != xmlMemBlocks()) {
   19527             printf("Leak of %d blocks found in xmlCopyNamespaceList",
   19528 	           xmlMemBlocks() - mem_base);
   19529 	    test_ret++;
   19530             printf(" %d", n_cur);
   19531             printf("\n");
   19532         }
   19533     }
   19534     function_tests++;
   19535 
   19536     return(test_ret);
   19537 }
   19538 
   19539 
   19540 static int
   19541 test_xmlCopyNode(void) {
   19542     int test_ret = 0;
   19543 
   19544     int mem_base;
   19545     xmlNodePtr ret_val;
   19546     xmlNodePtr node; /* the node */
   19547     int n_node;
   19548     int extended; /* if 1 do a recursive copy (properties, namespaces and children when applicable) if 2 copy properties and namespaces (when applicable) */
   19549     int n_extended;
   19550 
   19551     for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
   19552     for (n_extended = 0;n_extended < gen_nb_int;n_extended++) {
   19553         mem_base = xmlMemBlocks();
   19554         node = gen_xmlNodePtr(n_node, 0);
   19555         extended = gen_int(n_extended, 1);
   19556 
   19557         ret_val = xmlCopyNode(node, extended);
   19558         desret_xmlNodePtr(ret_val);
   19559         call_tests++;
   19560         des_xmlNodePtr(n_node, node, 0);
   19561         des_int(n_extended, extended, 1);
   19562         xmlResetLastError();
   19563         if (mem_base != xmlMemBlocks()) {
   19564             printf("Leak of %d blocks found in xmlCopyNode",
   19565 	           xmlMemBlocks() - mem_base);
   19566 	    test_ret++;
   19567             printf(" %d", n_node);
   19568             printf(" %d", n_extended);
   19569             printf("\n");
   19570         }
   19571     }
   19572     }
   19573     function_tests++;
   19574 
   19575     return(test_ret);
   19576 }
   19577 
   19578 
   19579 static int
   19580 test_xmlCopyNodeList(void) {
   19581     int test_ret = 0;
   19582 
   19583     int mem_base;
   19584     xmlNodePtr ret_val;
   19585     xmlNodePtr node; /* the first node in the list. */
   19586     int n_node;
   19587 
   19588     for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
   19589         mem_base = xmlMemBlocks();
   19590         node = gen_xmlNodePtr(n_node, 0);
   19591 
   19592         ret_val = xmlCopyNodeList(node);
   19593         desret_xmlNodePtr(ret_val);
   19594         call_tests++;
   19595         des_xmlNodePtr(n_node, node, 0);
   19596         xmlResetLastError();
   19597         if (mem_base != xmlMemBlocks()) {
   19598             printf("Leak of %d blocks found in xmlCopyNodeList",
   19599 	           xmlMemBlocks() - mem_base);
   19600 	    test_ret++;
   19601             printf(" %d", n_node);
   19602             printf("\n");
   19603         }
   19604     }
   19605     function_tests++;
   19606 
   19607     return(test_ret);
   19608 }
   19609 
   19610 
   19611 static int
   19612 test_xmlCopyProp(void) {
   19613     int test_ret = 0;
   19614 
   19615     int mem_base;
   19616     xmlAttrPtr ret_val;
   19617     xmlNodePtr target; /* the element where the attribute will be grafted */
   19618     int n_target;
   19619     xmlAttrPtr cur; /* the attribute */
   19620     int n_cur;
   19621 
   19622     for (n_target = 0;n_target < gen_nb_xmlNodePtr;n_target++) {
   19623     for (n_cur = 0;n_cur < gen_nb_xmlAttrPtr;n_cur++) {
   19624         mem_base = xmlMemBlocks();
   19625         target = gen_xmlNodePtr(n_target, 0);
   19626         cur = gen_xmlAttrPtr(n_cur, 1);
   19627 
   19628         ret_val = xmlCopyProp(target, cur);
   19629         desret_xmlAttrPtr(ret_val);
   19630         call_tests++;
   19631         des_xmlNodePtr(n_target, target, 0);
   19632         des_xmlAttrPtr(n_cur, cur, 1);
   19633         xmlResetLastError();
   19634         if (mem_base != xmlMemBlocks()) {
   19635             printf("Leak of %d blocks found in xmlCopyProp",
   19636 	           xmlMemBlocks() - mem_base);
   19637 	    test_ret++;
   19638             printf(" %d", n_target);
   19639             printf(" %d", n_cur);
   19640             printf("\n");
   19641         }
   19642     }
   19643     }
   19644     function_tests++;
   19645 
   19646     return(test_ret);
   19647 }
   19648 
   19649 
   19650 static int
   19651 test_xmlCopyPropList(void) {
   19652     int test_ret = 0;
   19653 
   19654     int mem_base;
   19655     xmlAttrPtr ret_val;
   19656     xmlNodePtr target; /* the element where the attributes will be grafted */
   19657     int n_target;
   19658     xmlAttrPtr cur; /* the first attribute */
   19659     int n_cur;
   19660 
   19661     for (n_target = 0;n_target < gen_nb_xmlNodePtr;n_target++) {
   19662     for (n_cur = 0;n_cur < gen_nb_xmlAttrPtr;n_cur++) {
   19663         mem_base = xmlMemBlocks();
   19664         target = gen_xmlNodePtr(n_target, 0);
   19665         cur = gen_xmlAttrPtr(n_cur, 1);
   19666 
   19667         ret_val = xmlCopyPropList(target, cur);
   19668         desret_xmlAttrPtr(ret_val);
   19669         call_tests++;
   19670         des_xmlNodePtr(n_target, target, 0);
   19671         des_xmlAttrPtr(n_cur, cur, 1);
   19672         xmlResetLastError();
   19673         if (mem_base != xmlMemBlocks()) {
   19674             printf("Leak of %d blocks found in xmlCopyPropList",
   19675 	           xmlMemBlocks() - mem_base);
   19676 	    test_ret++;
   19677             printf(" %d", n_target);
   19678             printf(" %d", n_cur);
   19679             printf("\n");
   19680         }
   19681     }
   19682     }
   19683     function_tests++;
   19684 
   19685     return(test_ret);
   19686 }
   19687 
   19688 
   19689 static int
   19690 test_xmlCreateIntSubset(void) {
   19691     int test_ret = 0;
   19692 
   19693     int mem_base;
   19694     xmlDtdPtr ret_val;
   19695     xmlDocPtr doc; /* the document pointer */
   19696     int n_doc;
   19697     xmlChar * name; /* the DTD name */
   19698     int n_name;
   19699     xmlChar * ExternalID; /* the external (PUBLIC) ID */
   19700     int n_ExternalID;
   19701     xmlChar * SystemID; /* the system ID */
   19702     int n_SystemID;
   19703 
   19704     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
   19705     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
   19706     for (n_ExternalID = 0;n_ExternalID < gen_nb_const_xmlChar_ptr;n_ExternalID++) {
   19707     for (n_SystemID = 0;n_SystemID < gen_nb_const_xmlChar_ptr;n_SystemID++) {
   19708         mem_base = xmlMemBlocks();
   19709         doc = gen_xmlDocPtr(n_doc, 0);
   19710         name = gen_const_xmlChar_ptr(n_name, 1);
   19711         ExternalID = gen_const_xmlChar_ptr(n_ExternalID, 2);
   19712         SystemID = gen_const_xmlChar_ptr(n_SystemID, 3);
   19713 
   19714         ret_val = xmlCreateIntSubset(doc, (const xmlChar *)name, (const xmlChar *)ExternalID, (const xmlChar *)SystemID);
   19715         desret_xmlDtdPtr(ret_val);
   19716         call_tests++;
   19717         des_xmlDocPtr(n_doc, doc, 0);
   19718         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
   19719         des_const_xmlChar_ptr(n_ExternalID, (const xmlChar *)ExternalID, 2);
   19720         des_const_xmlChar_ptr(n_SystemID, (const xmlChar *)SystemID, 3);
   19721         xmlResetLastError();
   19722         if (mem_base != xmlMemBlocks()) {
   19723             printf("Leak of %d blocks found in xmlCreateIntSubset",
   19724 	           xmlMemBlocks() - mem_base);
   19725 	    test_ret++;
   19726             printf(" %d", n_doc);
   19727             printf(" %d", n_name);
   19728             printf(" %d", n_ExternalID);
   19729             printf(" %d", n_SystemID);
   19730             printf("\n");
   19731         }
   19732     }
   19733     }
   19734     }
   19735     }
   19736     function_tests++;
   19737 
   19738     return(test_ret);
   19739 }
   19740 
   19741 
   19742 #define gen_nb_xmlDOMWrapCtxtPtr 1
   19743 static xmlDOMWrapCtxtPtr gen_xmlDOMWrapCtxtPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
   19744     return(NULL);
   19745 }
   19746 static void des_xmlDOMWrapCtxtPtr(int no ATTRIBUTE_UNUSED, xmlDOMWrapCtxtPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
   19747 }
   19748 
   19749 static int
   19750 test_xmlDOMWrapAdoptNode(void) {
   19751     int test_ret = 0;
   19752 
   19753     int mem_base;
   19754     int ret_val;
   19755     xmlDOMWrapCtxtPtr ctxt; /* the optional context for custom processing */
   19756     int n_ctxt;
   19757     xmlDocPtr sourceDoc; /* the optional sourceDoc */
   19758     int n_sourceDoc;
   19759     xmlNodePtr node; /* the node to start with */
   19760     int n_node;
   19761     xmlDocPtr destDoc; /* the destination doc */
   19762     int n_destDoc;
   19763     xmlNodePtr destParent; /* the optional new parent of @node in @destDoc */
   19764     int n_destParent;
   19765     int options; /* option flags */
   19766     int n_options;
   19767 
   19768     for (n_ctxt = 0;n_ctxt < gen_nb_xmlDOMWrapCtxtPtr;n_ctxt++) {
   19769     for (n_sourceDoc = 0;n_sourceDoc < gen_nb_xmlDocPtr;n_sourceDoc++) {
   19770     for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
   19771     for (n_destDoc = 0;n_destDoc < gen_nb_xmlDocPtr;n_destDoc++) {
   19772     for (n_destParent = 0;n_destParent < gen_nb_xmlNodePtr;n_destParent++) {
   19773     for (n_options = 0;n_options < gen_nb_int;n_options++) {
   19774         mem_base = xmlMemBlocks();
   19775         ctxt = gen_xmlDOMWrapCtxtPtr(n_ctxt, 0);
   19776         sourceDoc = gen_xmlDocPtr(n_sourceDoc, 1);
   19777         node = gen_xmlNodePtr(n_node, 2);
   19778         destDoc = gen_xmlDocPtr(n_destDoc, 3);
   19779         destParent = gen_xmlNodePtr(n_destParent, 4);
   19780         options = gen_int(n_options, 5);
   19781 
   19782         ret_val = xmlDOMWrapAdoptNode(ctxt, sourceDoc, node, destDoc, destParent, options);
   19783         if ((node != NULL) && (node->parent == NULL)) {xmlUnlinkNode(node);xmlFreeNode(node);node = NULL;}
   19784         desret_int(ret_val);
   19785         call_tests++;
   19786         des_xmlDOMWrapCtxtPtr(n_ctxt, ctxt, 0);
   19787         des_xmlDocPtr(n_sourceDoc, sourceDoc, 1);
   19788         des_xmlNodePtr(n_node, node, 2);
   19789         des_xmlDocPtr(n_destDoc, destDoc, 3);
   19790         des_xmlNodePtr(n_destParent, destParent, 4);
   19791         des_int(n_options, options, 5);
   19792         xmlResetLastError();
   19793         if (mem_base != xmlMemBlocks()) {
   19794             printf("Leak of %d blocks found in xmlDOMWrapAdoptNode",
   19795 	           xmlMemBlocks() - mem_base);
   19796 	    test_ret++;
   19797             printf(" %d", n_ctxt);
   19798             printf(" %d", n_sourceDoc);
   19799             printf(" %d", n_node);
   19800             printf(" %d", n_destDoc);
   19801             printf(" %d", n_destParent);
   19802             printf(" %d", n_options);
   19803             printf("\n");
   19804         }
   19805     }
   19806     }
   19807     }
   19808     }
   19809     }
   19810     }
   19811     function_tests++;
   19812 
   19813     return(test_ret);
   19814 }
   19815 
   19816 
   19817 static int
   19818 test_xmlDOMWrapCloneNode(void) {
   19819     int test_ret = 0;
   19820 
   19821     int mem_base;
   19822     int ret_val;
   19823     xmlDOMWrapCtxtPtr ctxt; /* the optional context for custom processing */
   19824     int n_ctxt;
   19825     xmlDocPtr sourceDoc; /* the optional sourceDoc */
   19826     int n_sourceDoc;
   19827     xmlNodePtr node; /* the node to start with */
   19828     int n_node;
   19829     xmlNodePtr * resNode; /* the clone of the given @node */
   19830     int n_resNode;
   19831     xmlDocPtr destDoc; /* the destination doc */
   19832     int n_destDoc;
   19833     xmlNodePtr destParent; /* the optional new parent of @node in @destDoc */
   19834     int n_destParent;
   19835     int deep; /* descend into child if set */
   19836     int n_deep;
   19837     int options; /* option flags */
   19838     int n_options;
   19839 
   19840     for (n_ctxt = 0;n_ctxt < gen_nb_xmlDOMWrapCtxtPtr;n_ctxt++) {
   19841     for (n_sourceDoc = 0;n_sourceDoc < gen_nb_xmlDocPtr;n_sourceDoc++) {
   19842     for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
   19843     for (n_resNode = 0;n_resNode < gen_nb_xmlNodePtr_ptr;n_resNode++) {
   19844     for (n_destDoc = 0;n_destDoc < gen_nb_xmlDocPtr;n_destDoc++) {
   19845     for (n_destParent = 0;n_destParent < gen_nb_xmlNodePtr;n_destParent++) {
   19846     for (n_deep = 0;n_deep < gen_nb_int;n_deep++) {
   19847     for (n_options = 0;n_options < gen_nb_int;n_options++) {
   19848         mem_base = xmlMemBlocks();
   19849         ctxt = gen_xmlDOMWrapCtxtPtr(n_ctxt, 0);
   19850         sourceDoc = gen_xmlDocPtr(n_sourceDoc, 1);
   19851         node = gen_xmlNodePtr(n_node, 2);
   19852         resNode = gen_xmlNodePtr_ptr(n_resNode, 3);
   19853         destDoc = gen_xmlDocPtr(n_destDoc, 4);
   19854         destParent = gen_xmlNodePtr(n_destParent, 5);
   19855         deep = gen_int(n_deep, 6);
   19856         options = gen_int(n_options, 7);
   19857 
   19858         ret_val = xmlDOMWrapCloneNode(ctxt, sourceDoc, node, resNode, destDoc, destParent, deep, options);
   19859         desret_int(ret_val);
   19860         call_tests++;
   19861         des_xmlDOMWrapCtxtPtr(n_ctxt, ctxt, 0);
   19862         des_xmlDocPtr(n_sourceDoc, sourceDoc, 1);
   19863         des_xmlNodePtr(n_node, node, 2);
   19864         des_xmlNodePtr_ptr(n_resNode, resNode, 3);
   19865         des_xmlDocPtr(n_destDoc, destDoc, 4);
   19866         des_xmlNodePtr(n_destParent, destParent, 5);
   19867         des_int(n_deep, deep, 6);
   19868         des_int(n_options, options, 7);
   19869         xmlResetLastError();
   19870         if (mem_base != xmlMemBlocks()) {
   19871             printf("Leak of %d blocks found in xmlDOMWrapCloneNode",
   19872 	           xmlMemBlocks() - mem_base);
   19873 	    test_ret++;
   19874             printf(" %d", n_ctxt);
   19875             printf(" %d", n_sourceDoc);
   19876             printf(" %d", n_node);
   19877             printf(" %d", n_resNode);
   19878             printf(" %d", n_destDoc);
   19879             printf(" %d", n_destParent);
   19880             printf(" %d", n_deep);
   19881             printf(" %d", n_options);
   19882             printf("\n");
   19883         }
   19884     }
   19885     }
   19886     }
   19887     }
   19888     }
   19889     }
   19890     }
   19891     }
   19892     function_tests++;
   19893 
   19894     return(test_ret);
   19895 }
   19896 
   19897 
   19898 static int
   19899 test_xmlDOMWrapNewCtxt(void) {
   19900     int test_ret = 0;
   19901 
   19902 
   19903     /* missing type support */
   19904     return(test_ret);
   19905 }
   19906 
   19907 
   19908 static int
   19909 test_xmlDOMWrapReconcileNamespaces(void) {
   19910     int test_ret = 0;
   19911 
   19912     int mem_base;
   19913     int ret_val;
   19914     xmlDOMWrapCtxtPtr ctxt; /* DOM wrapper context, unused at the moment */
   19915     int n_ctxt;
   19916     xmlNodePtr elem; /* the element-node */
   19917     int n_elem;
   19918     int options; /* option flags */
   19919     int n_options;
   19920 
   19921     for (n_ctxt = 0;n_ctxt < gen_nb_xmlDOMWrapCtxtPtr;n_ctxt++) {
   19922     for (n_elem = 0;n_elem < gen_nb_xmlNodePtr;n_elem++) {
   19923     for (n_options = 0;n_options < gen_nb_int;n_options++) {
   19924         mem_base = xmlMemBlocks();
   19925         ctxt = gen_xmlDOMWrapCtxtPtr(n_ctxt, 0);
   19926         elem = gen_xmlNodePtr(n_elem, 1);
   19927         options = gen_int(n_options, 2);
   19928 
   19929         ret_val = xmlDOMWrapReconcileNamespaces(ctxt, elem, options);
   19930         desret_int(ret_val);
   19931         call_tests++;
   19932         des_xmlDOMWrapCtxtPtr(n_ctxt, ctxt, 0);
   19933         des_xmlNodePtr(n_elem, elem, 1);
   19934         des_int(n_options, options, 2);
   19935         xmlResetLastError();
   19936         if (mem_base != xmlMemBlocks()) {
   19937             printf("Leak of %d blocks found in xmlDOMWrapReconcileNamespaces",
   19938 	           xmlMemBlocks() - mem_base);
   19939 	    test_ret++;
   19940             printf(" %d", n_ctxt);
   19941             printf(" %d", n_elem);
   19942             printf(" %d", n_options);
   19943             printf("\n");
   19944         }
   19945     }
   19946     }
   19947     }
   19948     function_tests++;
   19949 
   19950     return(test_ret);
   19951 }
   19952 
   19953 
   19954 static int
   19955 test_xmlDOMWrapRemoveNode(void) {
   19956     int test_ret = 0;
   19957 
   19958     int mem_base;
   19959     int ret_val;
   19960     xmlDOMWrapCtxtPtr ctxt; /* a DOM wrapper context */
   19961     int n_ctxt;
   19962     xmlDocPtr doc; /* the doc */
   19963     int n_doc;
   19964     xmlNodePtr node; /* the node to be removed. */
   19965     int n_node;
   19966     int options; /* set of options, unused at the moment */
   19967     int n_options;
   19968 
   19969     for (n_ctxt = 0;n_ctxt < gen_nb_xmlDOMWrapCtxtPtr;n_ctxt++) {
   19970     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
   19971     for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
   19972     for (n_options = 0;n_options < gen_nb_int;n_options++) {
   19973         mem_base = xmlMemBlocks();
   19974         ctxt = gen_xmlDOMWrapCtxtPtr(n_ctxt, 0);
   19975         doc = gen_xmlDocPtr(n_doc, 1);
   19976         node = gen_xmlNodePtr(n_node, 2);
   19977         options = gen_int(n_options, 3);
   19978 
   19979         ret_val = xmlDOMWrapRemoveNode(ctxt, doc, node, options);
   19980         desret_int(ret_val);
   19981         call_tests++;
   19982         des_xmlDOMWrapCtxtPtr(n_ctxt, ctxt, 0);
   19983         des_xmlDocPtr(n_doc, doc, 1);
   19984         des_xmlNodePtr(n_node, node, 2);
   19985         des_int(n_options, options, 3);
   19986         xmlResetLastError();
   19987         if (mem_base != xmlMemBlocks()) {
   19988             printf("Leak of %d blocks found in xmlDOMWrapRemoveNode",
   19989 	           xmlMemBlocks() - mem_base);
   19990 	    test_ret++;
   19991             printf(" %d", n_ctxt);
   19992             printf(" %d", n_doc);
   19993             printf(" %d", n_node);
   19994             printf(" %d", n_options);
   19995             printf("\n");
   19996         }
   19997     }
   19998     }
   19999     }
   20000     }
   20001     function_tests++;
   20002 
   20003     return(test_ret);
   20004 }
   20005 
   20006 
   20007 static int
   20008 test_xmlDocCopyNode(void) {
   20009     int test_ret = 0;
   20010 
   20011     int mem_base;
   20012     xmlNodePtr ret_val;
   20013     xmlNodePtr node; /* the node */
   20014     int n_node;
   20015     xmlDocPtr doc; /* the document */
   20016     int n_doc;
   20017     int extended; /* if 1 do a recursive copy (properties, namespaces and children when applicable) if 2 copy properties and namespaces (when applicable) */
   20018     int n_extended;
   20019 
   20020     for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
   20021     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
   20022     for (n_extended = 0;n_extended < gen_nb_int;n_extended++) {
   20023         mem_base = xmlMemBlocks();
   20024         node = gen_xmlNodePtr(n_node, 0);
   20025         doc = gen_xmlDocPtr(n_doc, 1);
   20026         extended = gen_int(n_extended, 2);
   20027 
   20028         ret_val = xmlDocCopyNode(node, doc, extended);
   20029         desret_xmlNodePtr(ret_val);
   20030         call_tests++;
   20031         des_xmlNodePtr(n_node, node, 0);
   20032         des_xmlDocPtr(n_doc, doc, 1);
   20033         des_int(n_extended, extended, 2);
   20034         xmlResetLastError();
   20035         if (mem_base != xmlMemBlocks()) {
   20036             printf("Leak of %d blocks found in xmlDocCopyNode",
   20037 	           xmlMemBlocks() - mem_base);
   20038 	    test_ret++;
   20039             printf(" %d", n_node);
   20040             printf(" %d", n_doc);
   20041             printf(" %d", n_extended);
   20042             printf("\n");
   20043         }
   20044     }
   20045     }
   20046     }
   20047     function_tests++;
   20048 
   20049     return(test_ret);
   20050 }
   20051 
   20052 
   20053 static int
   20054 test_xmlDocCopyNodeList(void) {
   20055     int test_ret = 0;
   20056 
   20057     int mem_base;
   20058     xmlNodePtr ret_val;
   20059     xmlDocPtr doc; /* the target document */
   20060     int n_doc;
   20061     xmlNodePtr node; /* the first node in the list. */
   20062     int n_node;
   20063 
   20064     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
   20065     for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
   20066         mem_base = xmlMemBlocks();
   20067         doc = gen_xmlDocPtr(n_doc, 0);
   20068         node = gen_xmlNodePtr(n_node, 1);
   20069 
   20070         ret_val = xmlDocCopyNodeList(doc, node);
   20071         desret_xmlNodePtr(ret_val);
   20072         call_tests++;
   20073         des_xmlDocPtr(n_doc, doc, 0);
   20074         des_xmlNodePtr(n_node, node, 1);
   20075         xmlResetLastError();
   20076         if (mem_base != xmlMemBlocks()) {
   20077             printf("Leak of %d blocks found in xmlDocCopyNodeList",
   20078 	           xmlMemBlocks() - mem_base);
   20079 	    test_ret++;
   20080             printf(" %d", n_doc);
   20081             printf(" %d", n_node);
   20082             printf("\n");
   20083         }
   20084     }
   20085     }
   20086     function_tests++;
   20087 
   20088     return(test_ret);
   20089 }
   20090 
   20091 
   20092 static int
   20093 test_xmlDocDump(void) {
   20094     int test_ret = 0;
   20095 
   20096 #if defined(LIBXML_OUTPUT_ENABLED)
   20097     int mem_base;
   20098     int ret_val;
   20099     FILE * f; /* the FILE* */
   20100     int n_f;
   20101     xmlDocPtr cur; /* the document */
   20102     int n_cur;
   20103 
   20104     for (n_f = 0;n_f < gen_nb_FILE_ptr;n_f++) {
   20105     for (n_cur = 0;n_cur < gen_nb_xmlDocPtr;n_cur++) {
   20106         mem_base = xmlMemBlocks();
   20107         f = gen_FILE_ptr(n_f, 0);
   20108         cur = gen_xmlDocPtr(n_cur, 1);
   20109 
   20110         ret_val = xmlDocDump(f, cur);
   20111         desret_int(ret_val);
   20112         call_tests++;
   20113         des_FILE_ptr(n_f, f, 0);
   20114         des_xmlDocPtr(n_cur, cur, 1);
   20115         xmlResetLastError();
   20116         if (mem_base != xmlMemBlocks()) {
   20117             printf("Leak of %d blocks found in xmlDocDump",
   20118 	           xmlMemBlocks() - mem_base);
   20119 	    test_ret++;
   20120             printf(" %d", n_f);
   20121             printf(" %d", n_cur);
   20122             printf("\n");
   20123         }
   20124     }
   20125     }
   20126     function_tests++;
   20127 #endif
   20128 
   20129     return(test_ret);
   20130 }
   20131 
   20132 
   20133 static int
   20134 test_xmlDocDumpFormatMemory(void) {
   20135     int test_ret = 0;
   20136 
   20137 #if defined(LIBXML_OUTPUT_ENABLED)
   20138     int mem_base;
   20139     xmlDocPtr cur; /* the document */
   20140     int n_cur;
   20141     xmlChar ** mem; /* OUT: the memory pointer */
   20142     int n_mem;
   20143     int * size; /* OUT: the memory length */
   20144     int n_size;
   20145     int format; /* should formatting spaces been added */
   20146     int n_format;
   20147 
   20148     for (n_cur = 0;n_cur < gen_nb_xmlDocPtr;n_cur++) {
   20149     for (n_mem = 0;n_mem < gen_nb_xmlChar_ptr_ptr;n_mem++) {
   20150     for (n_size = 0;n_size < gen_nb_int_ptr;n_size++) {
   20151     for (n_format = 0;n_format < gen_nb_int;n_format++) {
   20152         mem_base = xmlMemBlocks();
   20153         cur = gen_xmlDocPtr(n_cur, 0);
   20154         mem = gen_xmlChar_ptr_ptr(n_mem, 1);
   20155         size = gen_int_ptr(n_size, 2);
   20156         format = gen_int(n_format, 3);
   20157 
   20158         xmlDocDumpFormatMemory(cur, mem, size, format);
   20159         call_tests++;
   20160         des_xmlDocPtr(n_cur, cur, 0);
   20161         des_xmlChar_ptr_ptr(n_mem, mem, 1);
   20162         des_int_ptr(n_size, size, 2);
   20163         des_int(n_format, format, 3);
   20164         xmlResetLastError();
   20165         if (mem_base != xmlMemBlocks()) {
   20166             printf("Leak of %d blocks found in xmlDocDumpFormatMemory",
   20167 	           xmlMemBlocks() - mem_base);
   20168 	    test_ret++;
   20169             printf(" %d", n_cur);
   20170             printf(" %d", n_mem);
   20171             printf(" %d", n_size);
   20172             printf(" %d", n_format);
   20173             printf("\n");
   20174         }
   20175     }
   20176     }
   20177     }
   20178     }
   20179     function_tests++;
   20180 #endif
   20181 
   20182     return(test_ret);
   20183 }
   20184 
   20185 
   20186 static int
   20187 test_xmlDocDumpFormatMemoryEnc(void) {
   20188     int test_ret = 0;
   20189 
   20190 #if defined(LIBXML_OUTPUT_ENABLED)
   20191     int mem_base;
   20192     xmlDocPtr out_doc; /* Document to generate XML text from */
   20193     int n_out_doc;
   20194     xmlChar ** doc_txt_ptr; /* Memory pointer for allocated XML text */
   20195     int n_doc_txt_ptr;
   20196     int * doc_txt_len; /* Length of the generated XML text */
   20197     int n_doc_txt_len;
   20198     char * txt_encoding; /* Character encoding to use when generating XML text */
   20199     int n_txt_encoding;
   20200     int format; /* should formatting spaces been added */
   20201     int n_format;
   20202 
   20203     for (n_out_doc = 0;n_out_doc < gen_nb_xmlDocPtr;n_out_doc++) {
   20204     for (n_doc_txt_ptr = 0;n_doc_txt_ptr < gen_nb_xmlChar_ptr_ptr;n_doc_txt_ptr++) {
   20205     for (n_doc_txt_len = 0;n_doc_txt_len < gen_nb_int_ptr;n_doc_txt_len++) {
   20206     for (n_txt_encoding = 0;n_txt_encoding < gen_nb_const_char_ptr;n_txt_encoding++) {
   20207     for (n_format = 0;n_format < gen_nb_int;n_format++) {
   20208         mem_base = xmlMemBlocks();
   20209         out_doc = gen_xmlDocPtr(n_out_doc, 0);
   20210         doc_txt_ptr = gen_xmlChar_ptr_ptr(n_doc_txt_ptr, 1);
   20211         doc_txt_len = gen_int_ptr(n_doc_txt_len, 2);
   20212         txt_encoding = gen_const_char_ptr(n_txt_encoding, 3);
   20213         format = gen_int(n_format, 4);
   20214 
   20215         xmlDocDumpFormatMemoryEnc(out_doc, doc_txt_ptr, doc_txt_len, (const char *)txt_encoding, format);
   20216         call_tests++;
   20217         des_xmlDocPtr(n_out_doc, out_doc, 0);
   20218         des_xmlChar_ptr_ptr(n_doc_txt_ptr, doc_txt_ptr, 1);
   20219         des_int_ptr(n_doc_txt_len, doc_txt_len, 2);
   20220         des_const_char_ptr(n_txt_encoding, (const char *)txt_encoding, 3);
   20221         des_int(n_format, format, 4);
   20222         xmlResetLastError();
   20223         if (mem_base != xmlMemBlocks()) {
   20224             printf("Leak of %d blocks found in xmlDocDumpFormatMemoryEnc",
   20225 	           xmlMemBlocks() - mem_base);
   20226 	    test_ret++;
   20227             printf(" %d", n_out_doc);
   20228             printf(" %d", n_doc_txt_ptr);
   20229             printf(" %d", n_doc_txt_len);
   20230             printf(" %d", n_txt_encoding);
   20231             printf(" %d", n_format);
   20232             printf("\n");
   20233         }
   20234     }
   20235     }
   20236     }
   20237     }
   20238     }
   20239     function_tests++;
   20240 #endif
   20241 
   20242     return(test_ret);
   20243 }
   20244 
   20245 
   20246 static int
   20247 test_xmlDocDumpMemory(void) {
   20248     int test_ret = 0;
   20249 
   20250 #if defined(LIBXML_OUTPUT_ENABLED)
   20251     int mem_base;
   20252     xmlDocPtr cur; /* the document */
   20253     int n_cur;
   20254     xmlChar ** mem; /* OUT: the memory pointer */
   20255     int n_mem;
   20256     int * size; /* OUT: the memory length */
   20257     int n_size;
   20258 
   20259     for (n_cur = 0;n_cur < gen_nb_xmlDocPtr;n_cur++) {
   20260     for (n_mem = 0;n_mem < gen_nb_xmlChar_ptr_ptr;n_mem++) {
   20261     for (n_size = 0;n_size < gen_nb_int_ptr;n_size++) {
   20262         mem_base = xmlMemBlocks();
   20263         cur = gen_xmlDocPtr(n_cur, 0);
   20264         mem = gen_xmlChar_ptr_ptr(n_mem, 1);
   20265         size = gen_int_ptr(n_size, 2);
   20266 
   20267         xmlDocDumpMemory(cur, mem, size);
   20268         call_tests++;
   20269         des_xmlDocPtr(n_cur, cur, 0);
   20270         des_xmlChar_ptr_ptr(n_mem, mem, 1);
   20271         des_int_ptr(n_size, size, 2);
   20272         xmlResetLastError();
   20273         if (mem_base != xmlMemBlocks()) {
   20274             printf("Leak of %d blocks found in xmlDocDumpMemory",
   20275 	           xmlMemBlocks() - mem_base);
   20276 	    test_ret++;
   20277             printf(" %d", n_cur);
   20278             printf(" %d", n_mem);
   20279             printf(" %d", n_size);
   20280             printf("\n");
   20281         }
   20282     }
   20283     }
   20284     }
   20285     function_tests++;
   20286 #endif
   20287 
   20288     return(test_ret);
   20289 }
   20290 
   20291 
   20292 static int
   20293 test_xmlDocDumpMemoryEnc(void) {
   20294     int test_ret = 0;
   20295 
   20296 #if defined(LIBXML_OUTPUT_ENABLED)
   20297     int mem_base;
   20298     xmlDocPtr out_doc; /* Document to generate XML text from */
   20299     int n_out_doc;
   20300     xmlChar ** doc_txt_ptr; /* Memory pointer for allocated XML text */
   20301     int n_doc_txt_ptr;
   20302     int * doc_txt_len; /* Length of the generated XML text */
   20303     int n_doc_txt_len;
   20304     char * txt_encoding; /* Character encoding to use when generating XML text */
   20305     int n_txt_encoding;
   20306 
   20307     for (n_out_doc = 0;n_out_doc < gen_nb_xmlDocPtr;n_out_doc++) {
   20308     for (n_doc_txt_ptr = 0;n_doc_txt_ptr < gen_nb_xmlChar_ptr_ptr;n_doc_txt_ptr++) {
   20309     for (n_doc_txt_len = 0;n_doc_txt_len < gen_nb_int_ptr;n_doc_txt_len++) {
   20310     for (n_txt_encoding = 0;n_txt_encoding < gen_nb_const_char_ptr;n_txt_encoding++) {
   20311         mem_base = xmlMemBlocks();
   20312         out_doc = gen_xmlDocPtr(n_out_doc, 0);
   20313         doc_txt_ptr = gen_xmlChar_ptr_ptr(n_doc_txt_ptr, 1);
   20314         doc_txt_len = gen_int_ptr(n_doc_txt_len, 2);
   20315         txt_encoding = gen_const_char_ptr(n_txt_encoding, 3);
   20316 
   20317         xmlDocDumpMemoryEnc(out_doc, doc_txt_ptr, doc_txt_len, (const char *)txt_encoding);
   20318         call_tests++;
   20319         des_xmlDocPtr(n_out_doc, out_doc, 0);
   20320         des_xmlChar_ptr_ptr(n_doc_txt_ptr, doc_txt_ptr, 1);
   20321         des_int_ptr(n_doc_txt_len, doc_txt_len, 2);
   20322         des_const_char_ptr(n_txt_encoding, (const char *)txt_encoding, 3);
   20323         xmlResetLastError();
   20324         if (mem_base != xmlMemBlocks()) {
   20325             printf("Leak of %d blocks found in xmlDocDumpMemoryEnc",
   20326 	           xmlMemBlocks() - mem_base);
   20327 	    test_ret++;
   20328             printf(" %d", n_out_doc);
   20329             printf(" %d", n_doc_txt_ptr);
   20330             printf(" %d", n_doc_txt_len);
   20331             printf(" %d", n_txt_encoding);
   20332             printf("\n");
   20333         }
   20334     }
   20335     }
   20336     }
   20337     }
   20338     function_tests++;
   20339 #endif
   20340 
   20341     return(test_ret);
   20342 }
   20343 
   20344 
   20345 static int
   20346 test_xmlDocFormatDump(void) {
   20347     int test_ret = 0;
   20348 
   20349 #if defined(LIBXML_OUTPUT_ENABLED)
   20350     int mem_base;
   20351     int ret_val;
   20352     FILE * f; /* the FILE* */
   20353     int n_f;
   20354     xmlDocPtr cur; /* the document */
   20355     int n_cur;
   20356     int format; /* should formatting spaces been added */
   20357     int n_format;
   20358 
   20359     for (n_f = 0;n_f < gen_nb_FILE_ptr;n_f++) {
   20360     for (n_cur = 0;n_cur < gen_nb_xmlDocPtr;n_cur++) {
   20361     for (n_format = 0;n_format < gen_nb_int;n_format++) {
   20362         mem_base = xmlMemBlocks();
   20363         f = gen_FILE_ptr(n_f, 0);
   20364         cur = gen_xmlDocPtr(n_cur, 1);
   20365         format = gen_int(n_format, 2);
   20366 
   20367         ret_val = xmlDocFormatDump(f, cur, format);
   20368         desret_int(ret_val);
   20369         call_tests++;
   20370         des_FILE_ptr(n_f, f, 0);
   20371         des_xmlDocPtr(n_cur, cur, 1);
   20372         des_int(n_format, format, 2);
   20373         xmlResetLastError();
   20374         if (mem_base != xmlMemBlocks()) {
   20375             printf("Leak of %d blocks found in xmlDocFormatDump",
   20376 	           xmlMemBlocks() - mem_base);
   20377 	    test_ret++;
   20378             printf(" %d", n_f);
   20379             printf(" %d", n_cur);
   20380             printf(" %d", n_format);
   20381             printf("\n");
   20382         }
   20383     }
   20384     }
   20385     }
   20386     function_tests++;
   20387 #endif
   20388 
   20389     return(test_ret);
   20390 }
   20391 
   20392 
   20393 static int
   20394 test_xmlDocGetRootElement(void) {
   20395     int test_ret = 0;
   20396 
   20397     int mem_base;
   20398     xmlNodePtr ret_val;
   20399     xmlDoc * doc; /* the document */
   20400     int n_doc;
   20401 
   20402     for (n_doc = 0;n_doc < gen_nb_const_xmlDoc_ptr;n_doc++) {
   20403         mem_base = xmlMemBlocks();
   20404         doc = gen_const_xmlDoc_ptr(n_doc, 0);
   20405 
   20406         ret_val = xmlDocGetRootElement((const xmlDoc *)doc);
   20407         desret_xmlNodePtr(ret_val);
   20408         call_tests++;
   20409         des_const_xmlDoc_ptr(n_doc, (const xmlDoc *)doc, 0);
   20410         xmlResetLastError();
   20411         if (mem_base != xmlMemBlocks()) {
   20412             printf("Leak of %d blocks found in xmlDocGetRootElement",
   20413 	           xmlMemBlocks() - mem_base);
   20414 	    test_ret++;
   20415             printf(" %d", n_doc);
   20416             printf("\n");
   20417         }
   20418     }
   20419     function_tests++;
   20420 
   20421     return(test_ret);
   20422 }
   20423 
   20424 
   20425 static int
   20426 test_xmlDocSetRootElement(void) {
   20427     int test_ret = 0;
   20428 
   20429 #if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_WRITER_ENABLED)
   20430     int mem_base;
   20431     xmlNodePtr ret_val;
   20432     xmlDocPtr doc; /* the document */
   20433     int n_doc;
   20434     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. */
   20435     int n_root;
   20436 
   20437     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
   20438     for (n_root = 0;n_root < gen_nb_xmlNodePtr_in;n_root++) {
   20439         mem_base = xmlMemBlocks();
   20440         doc = gen_xmlDocPtr(n_doc, 0);
   20441         root = gen_xmlNodePtr_in(n_root, 1);
   20442 
   20443         ret_val = xmlDocSetRootElement(doc, root);
   20444         if (doc == NULL) { xmlFreeNode(root) ; root = NULL ; }
   20445         desret_xmlNodePtr(ret_val);
   20446         call_tests++;
   20447         des_xmlDocPtr(n_doc, doc, 0);
   20448         des_xmlNodePtr_in(n_root, root, 1);
   20449         xmlResetLastError();
   20450         if (mem_base != xmlMemBlocks()) {
   20451             printf("Leak of %d blocks found in xmlDocSetRootElement",
   20452 	           xmlMemBlocks() - mem_base);
   20453 	    test_ret++;
   20454             printf(" %d", n_doc);
   20455             printf(" %d", n_root);
   20456             printf("\n");
   20457         }
   20458     }
   20459     }
   20460     function_tests++;
   20461 #endif
   20462 
   20463     return(test_ret);
   20464 }
   20465 
   20466 
   20467 static int
   20468 test_xmlElemDump(void) {
   20469     int test_ret = 0;
   20470 
   20471 #if defined(LIBXML_OUTPUT_ENABLED)
   20472     int mem_base;
   20473     FILE * f; /* the FILE * for the output */
   20474     int n_f;
   20475     xmlDocPtr doc; /* the document */
   20476     int n_doc;
   20477     xmlNodePtr cur; /* the current node */
   20478     int n_cur;
   20479 
   20480     for (n_f = 0;n_f < gen_nb_FILE_ptr;n_f++) {
   20481     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
   20482     for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
   20483         mem_base = xmlMemBlocks();
   20484         f = gen_FILE_ptr(n_f, 0);
   20485         doc = gen_xmlDocPtr(n_doc, 1);
   20486         cur = gen_xmlNodePtr(n_cur, 2);
   20487 
   20488         xmlElemDump(f, doc, cur);
   20489         call_tests++;
   20490         des_FILE_ptr(n_f, f, 0);
   20491         des_xmlDocPtr(n_doc, doc, 1);
   20492         des_xmlNodePtr(n_cur, cur, 2);
   20493         xmlResetLastError();
   20494         if (mem_base != xmlMemBlocks()) {
   20495             printf("Leak of %d blocks found in xmlElemDump",
   20496 	           xmlMemBlocks() - mem_base);
   20497 	    test_ret++;
   20498             printf(" %d", n_f);
   20499             printf(" %d", n_doc);
   20500             printf(" %d", n_cur);
   20501             printf("\n");
   20502         }
   20503     }
   20504     }
   20505     }
   20506     function_tests++;
   20507 #endif
   20508 
   20509     return(test_ret);
   20510 }
   20511 
   20512 
   20513 static int
   20514 test_xmlFirstElementChild(void) {
   20515     int test_ret = 0;
   20516 
   20517 #if defined(LIBXML_TREE_ENABLED)
   20518     int mem_base;
   20519     xmlNodePtr ret_val;
   20520     xmlNodePtr parent; /* the parent node */
   20521     int n_parent;
   20522 
   20523     for (n_parent = 0;n_parent < gen_nb_xmlNodePtr;n_parent++) {
   20524         mem_base = xmlMemBlocks();
   20525         parent = gen_xmlNodePtr(n_parent, 0);
   20526 
   20527         ret_val = xmlFirstElementChild(parent);
   20528         desret_xmlNodePtr(ret_val);
   20529         call_tests++;
   20530         des_xmlNodePtr(n_parent, parent, 0);
   20531         xmlResetLastError();
   20532         if (mem_base != xmlMemBlocks()) {
   20533             printf("Leak of %d blocks found in xmlFirstElementChild",
   20534 	           xmlMemBlocks() - mem_base);
   20535 	    test_ret++;
   20536             printf(" %d", n_parent);
   20537             printf("\n");
   20538         }
   20539     }
   20540     function_tests++;
   20541 #endif
   20542 
   20543     return(test_ret);
   20544 }
   20545 
   20546 
   20547 static int
   20548 test_xmlGetBufferAllocationScheme(void) {
   20549     int test_ret = 0;
   20550 
   20551     int mem_base;
   20552     xmlBufferAllocationScheme ret_val;
   20553 
   20554         mem_base = xmlMemBlocks();
   20555 
   20556         ret_val = xmlGetBufferAllocationScheme();
   20557         desret_xmlBufferAllocationScheme(ret_val);
   20558         call_tests++;
   20559         xmlResetLastError();
   20560         if (mem_base != xmlMemBlocks()) {
   20561             printf("Leak of %d blocks found in xmlGetBufferAllocationScheme",
   20562 	           xmlMemBlocks() - mem_base);
   20563 	    test_ret++;
   20564             printf("\n");
   20565         }
   20566     function_tests++;
   20567 
   20568     return(test_ret);
   20569 }
   20570 
   20571 
   20572 static int
   20573 test_xmlGetCompressMode(void) {
   20574     int test_ret = 0;
   20575 
   20576     int mem_base;
   20577     int ret_val;
   20578 
   20579         mem_base = xmlMemBlocks();
   20580 
   20581         ret_val = xmlGetCompressMode();
   20582         desret_int(ret_val);
   20583         call_tests++;
   20584         xmlResetLastError();
   20585         if (mem_base != xmlMemBlocks()) {
   20586             printf("Leak of %d blocks found in xmlGetCompressMode",
   20587 	           xmlMemBlocks() - mem_base);
   20588 	    test_ret++;
   20589             printf("\n");
   20590         }
   20591     function_tests++;
   20592 
   20593     return(test_ret);
   20594 }
   20595 
   20596 
   20597 static int
   20598 test_xmlGetDocCompressMode(void) {
   20599     int test_ret = 0;
   20600 
   20601     int mem_base;
   20602     int ret_val;
   20603     xmlDoc * doc; /* the document */
   20604     int n_doc;
   20605 
   20606     for (n_doc = 0;n_doc < gen_nb_const_xmlDoc_ptr;n_doc++) {
   20607         mem_base = xmlMemBlocks();
   20608         doc = gen_const_xmlDoc_ptr(n_doc, 0);
   20609 
   20610         ret_val = xmlGetDocCompressMode((const xmlDoc *)doc);
   20611         desret_int(ret_val);
   20612         call_tests++;
   20613         des_const_xmlDoc_ptr(n_doc, (const xmlDoc *)doc, 0);
   20614         xmlResetLastError();
   20615         if (mem_base != xmlMemBlocks()) {
   20616             printf("Leak of %d blocks found in xmlGetDocCompressMode",
   20617 	           xmlMemBlocks() - mem_base);
   20618 	    test_ret++;
   20619             printf(" %d", n_doc);
   20620             printf("\n");
   20621         }
   20622     }
   20623     function_tests++;
   20624 
   20625     return(test_ret);
   20626 }
   20627 
   20628 
   20629 static int
   20630 test_xmlGetIntSubset(void) {
   20631     int test_ret = 0;
   20632 
   20633     int mem_base;
   20634     xmlDtdPtr ret_val;
   20635     xmlDoc * doc; /* the document pointer */
   20636     int n_doc;
   20637 
   20638     for (n_doc = 0;n_doc < gen_nb_const_xmlDoc_ptr;n_doc++) {
   20639         mem_base = xmlMemBlocks();
   20640         doc = gen_const_xmlDoc_ptr(n_doc, 0);
   20641 
   20642         ret_val = xmlGetIntSubset((const xmlDoc *)doc);
   20643         desret_xmlDtdPtr(ret_val);
   20644         call_tests++;
   20645         des_const_xmlDoc_ptr(n_doc, (const xmlDoc *)doc, 0);
   20646         xmlResetLastError();
   20647         if (mem_base != xmlMemBlocks()) {
   20648             printf("Leak of %d blocks found in xmlGetIntSubset",
   20649 	           xmlMemBlocks() - mem_base);
   20650 	    test_ret++;
   20651             printf(" %d", n_doc);
   20652             printf("\n");
   20653         }
   20654     }
   20655     function_tests++;
   20656 
   20657     return(test_ret);
   20658 }
   20659 
   20660 
   20661 static int
   20662 test_xmlGetLastChild(void) {
   20663     int test_ret = 0;
   20664 
   20665     int mem_base;
   20666     xmlNodePtr ret_val;
   20667     xmlNode * parent; /* the parent node */
   20668     int n_parent;
   20669 
   20670     for (n_parent = 0;n_parent < gen_nb_const_xmlNode_ptr;n_parent++) {
   20671         mem_base = xmlMemBlocks();
   20672         parent = gen_const_xmlNode_ptr(n_parent, 0);
   20673 
   20674         ret_val = xmlGetLastChild((const xmlNode *)parent);
   20675         desret_xmlNodePtr(ret_val);
   20676         call_tests++;
   20677         des_const_xmlNode_ptr(n_parent, (const xmlNode *)parent, 0);
   20678         xmlResetLastError();
   20679         if (mem_base != xmlMemBlocks()) {
   20680             printf("Leak of %d blocks found in xmlGetLastChild",
   20681 	           xmlMemBlocks() - mem_base);
   20682 	    test_ret++;
   20683             printf(" %d", n_parent);
   20684             printf("\n");
   20685         }
   20686     }
   20687     function_tests++;
   20688 
   20689     return(test_ret);
   20690 }
   20691 
   20692 
   20693 static int
   20694 test_xmlGetLineNo(void) {
   20695     int test_ret = 0;
   20696 
   20697     int mem_base;
   20698     long ret_val;
   20699     xmlNode * node; /* valid node */
   20700     int n_node;
   20701 
   20702     for (n_node = 0;n_node < gen_nb_const_xmlNode_ptr;n_node++) {
   20703         mem_base = xmlMemBlocks();
   20704         node = gen_const_xmlNode_ptr(n_node, 0);
   20705 
   20706         ret_val = xmlGetLineNo((const xmlNode *)node);
   20707         desret_long(ret_val);
   20708         call_tests++;
   20709         des_const_xmlNode_ptr(n_node, (const xmlNode *)node, 0);
   20710         xmlResetLastError();
   20711         if (mem_base != xmlMemBlocks()) {
   20712             printf("Leak of %d blocks found in xmlGetLineNo",
   20713 	           xmlMemBlocks() - mem_base);
   20714 	    test_ret++;
   20715             printf(" %d", n_node);
   20716             printf("\n");
   20717         }
   20718     }
   20719     function_tests++;
   20720 
   20721     return(test_ret);
   20722 }
   20723 
   20724 
   20725 static int
   20726 test_xmlGetNoNsProp(void) {
   20727     int test_ret = 0;
   20728 
   20729     int mem_base;
   20730     xmlChar * ret_val;
   20731     xmlNode * node; /* the node */
   20732     int n_node;
   20733     xmlChar * name; /* the attribute name */
   20734     int n_name;
   20735 
   20736     for (n_node = 0;n_node < gen_nb_const_xmlNode_ptr;n_node++) {
   20737     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
   20738         mem_base = xmlMemBlocks();
   20739         node = gen_const_xmlNode_ptr(n_node, 0);
   20740         name = gen_const_xmlChar_ptr(n_name, 1);
   20741 
   20742         ret_val = xmlGetNoNsProp((const xmlNode *)node, (const xmlChar *)name);
   20743         desret_xmlChar_ptr(ret_val);
   20744         call_tests++;
   20745         des_const_xmlNode_ptr(n_node, (const xmlNode *)node, 0);
   20746         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
   20747         xmlResetLastError();
   20748         if (mem_base != xmlMemBlocks()) {
   20749             printf("Leak of %d blocks found in xmlGetNoNsProp",
   20750 	           xmlMemBlocks() - mem_base);
   20751 	    test_ret++;
   20752             printf(" %d", n_node);
   20753             printf(" %d", n_name);
   20754             printf("\n");
   20755         }
   20756     }
   20757     }
   20758     function_tests++;
   20759 
   20760     return(test_ret);
   20761 }
   20762 
   20763 
   20764 static int
   20765 test_xmlGetNodePath(void) {
   20766     int test_ret = 0;
   20767 
   20768 #if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_DEBUG_ENABLED)
   20769     int mem_base;
   20770     xmlChar * ret_val;
   20771     xmlNode * node; /* a node */
   20772     int n_node;
   20773 
   20774     for (n_node = 0;n_node < gen_nb_const_xmlNode_ptr;n_node++) {
   20775         mem_base = xmlMemBlocks();
   20776         node = gen_const_xmlNode_ptr(n_node, 0);
   20777 
   20778         ret_val = xmlGetNodePath((const xmlNode *)node);
   20779         desret_xmlChar_ptr(ret_val);
   20780         call_tests++;
   20781         des_const_xmlNode_ptr(n_node, (const xmlNode *)node, 0);
   20782         xmlResetLastError();
   20783         if (mem_base != xmlMemBlocks()) {
   20784             printf("Leak of %d blocks found in xmlGetNodePath",
   20785 	           xmlMemBlocks() - mem_base);
   20786 	    test_ret++;
   20787             printf(" %d", n_node);
   20788             printf("\n");
   20789         }
   20790     }
   20791     function_tests++;
   20792 #endif
   20793 
   20794     return(test_ret);
   20795 }
   20796 
   20797 
   20798 static int
   20799 test_xmlGetNsList(void) {
   20800     int test_ret = 0;
   20801 
   20802 
   20803     /* missing type support */
   20804     return(test_ret);
   20805 }
   20806 
   20807 
   20808 static int
   20809 test_xmlGetNsProp(void) {
   20810     int test_ret = 0;
   20811 
   20812     int mem_base;
   20813     xmlChar * ret_val;
   20814     xmlNode * node; /* the node */
   20815     int n_node;
   20816     xmlChar * name; /* the attribute name */
   20817     int n_name;
   20818     xmlChar * nameSpace; /* the URI of the namespace */
   20819     int n_nameSpace;
   20820 
   20821     for (n_node = 0;n_node < gen_nb_const_xmlNode_ptr;n_node++) {
   20822     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
   20823     for (n_nameSpace = 0;n_nameSpace < gen_nb_const_xmlChar_ptr;n_nameSpace++) {
   20824         mem_base = xmlMemBlocks();
   20825         node = gen_const_xmlNode_ptr(n_node, 0);
   20826         name = gen_const_xmlChar_ptr(n_name, 1);
   20827         nameSpace = gen_const_xmlChar_ptr(n_nameSpace, 2);
   20828 
   20829         ret_val = xmlGetNsProp((const xmlNode *)node, (const xmlChar *)name, (const xmlChar *)nameSpace);
   20830         desret_xmlChar_ptr(ret_val);
   20831         call_tests++;
   20832         des_const_xmlNode_ptr(n_node, (const xmlNode *)node, 0);
   20833         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
   20834         des_const_xmlChar_ptr(n_nameSpace, (const xmlChar *)nameSpace, 2);
   20835         xmlResetLastError();
   20836         if (mem_base != xmlMemBlocks()) {
   20837             printf("Leak of %d blocks found in xmlGetNsProp",
   20838 	           xmlMemBlocks() - mem_base);
   20839 	    test_ret++;
   20840             printf(" %d", n_node);
   20841             printf(" %d", n_name);
   20842             printf(" %d", n_nameSpace);
   20843             printf("\n");
   20844         }
   20845     }
   20846     }
   20847     }
   20848     function_tests++;
   20849 
   20850     return(test_ret);
   20851 }
   20852 
   20853 
   20854 static int
   20855 test_xmlGetProp(void) {
   20856     int test_ret = 0;
   20857 
   20858     int mem_base;
   20859     xmlChar * ret_val;
   20860     xmlNode * node; /* the node */
   20861     int n_node;
   20862     xmlChar * name; /* the attribute name */
   20863     int n_name;
   20864 
   20865     for (n_node = 0;n_node < gen_nb_const_xmlNode_ptr;n_node++) {
   20866     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
   20867         mem_base = xmlMemBlocks();
   20868         node = gen_const_xmlNode_ptr(n_node, 0);
   20869         name = gen_const_xmlChar_ptr(n_name, 1);
   20870 
   20871         ret_val = xmlGetProp((const xmlNode *)node, (const xmlChar *)name);
   20872         desret_xmlChar_ptr(ret_val);
   20873         call_tests++;
   20874         des_const_xmlNode_ptr(n_node, (const xmlNode *)node, 0);
   20875         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
   20876         xmlResetLastError();
   20877         if (mem_base != xmlMemBlocks()) {
   20878             printf("Leak of %d blocks found in xmlGetProp",
   20879 	           xmlMemBlocks() - mem_base);
   20880 	    test_ret++;
   20881             printf(" %d", n_node);
   20882             printf(" %d", n_name);
   20883             printf("\n");
   20884         }
   20885     }
   20886     }
   20887     function_tests++;
   20888 
   20889     return(test_ret);
   20890 }
   20891 
   20892 
   20893 static int
   20894 test_xmlHasNsProp(void) {
   20895     int test_ret = 0;
   20896 
   20897     int mem_base;
   20898     xmlAttrPtr ret_val;
   20899     xmlNode * node; /* the node */
   20900     int n_node;
   20901     xmlChar * name; /* the attribute name */
   20902     int n_name;
   20903     xmlChar * nameSpace; /* the URI of the namespace */
   20904     int n_nameSpace;
   20905 
   20906     for (n_node = 0;n_node < gen_nb_const_xmlNode_ptr;n_node++) {
   20907     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
   20908     for (n_nameSpace = 0;n_nameSpace < gen_nb_const_xmlChar_ptr;n_nameSpace++) {
   20909         mem_base = xmlMemBlocks();
   20910         node = gen_const_xmlNode_ptr(n_node, 0);
   20911         name = gen_const_xmlChar_ptr(n_name, 1);
   20912         nameSpace = gen_const_xmlChar_ptr(n_nameSpace, 2);
   20913 
   20914         ret_val = xmlHasNsProp((const xmlNode *)node, (const xmlChar *)name, (const xmlChar *)nameSpace);
   20915         desret_xmlAttrPtr(ret_val);
   20916         call_tests++;
   20917         des_const_xmlNode_ptr(n_node, (const xmlNode *)node, 0);
   20918         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
   20919         des_const_xmlChar_ptr(n_nameSpace, (const xmlChar *)nameSpace, 2);
   20920         xmlResetLastError();
   20921         if (mem_base != xmlMemBlocks()) {
   20922             printf("Leak of %d blocks found in xmlHasNsProp",
   20923 	           xmlMemBlocks() - mem_base);
   20924 	    test_ret++;
   20925             printf(" %d", n_node);
   20926             printf(" %d", n_name);
   20927             printf(" %d", n_nameSpace);
   20928             printf("\n");
   20929         }
   20930     }
   20931     }
   20932     }
   20933     function_tests++;
   20934 
   20935     return(test_ret);
   20936 }
   20937 
   20938 
   20939 static int
   20940 test_xmlHasProp(void) {
   20941     int test_ret = 0;
   20942 
   20943     int mem_base;
   20944     xmlAttrPtr ret_val;
   20945     xmlNode * node; /* the node */
   20946     int n_node;
   20947     xmlChar * name; /* the attribute name */
   20948     int n_name;
   20949 
   20950     for (n_node = 0;n_node < gen_nb_const_xmlNode_ptr;n_node++) {
   20951     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
   20952         mem_base = xmlMemBlocks();
   20953         node = gen_const_xmlNode_ptr(n_node, 0);
   20954         name = gen_const_xmlChar_ptr(n_name, 1);
   20955 
   20956         ret_val = xmlHasProp((const xmlNode *)node, (const xmlChar *)name);
   20957         desret_xmlAttrPtr(ret_val);
   20958         call_tests++;
   20959         des_const_xmlNode_ptr(n_node, (const xmlNode *)node, 0);
   20960         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
   20961         xmlResetLastError();
   20962         if (mem_base != xmlMemBlocks()) {
   20963             printf("Leak of %d blocks found in xmlHasProp",
   20964 	           xmlMemBlocks() - mem_base);
   20965 	    test_ret++;
   20966             printf(" %d", n_node);
   20967             printf(" %d", n_name);
   20968             printf("\n");
   20969         }
   20970     }
   20971     }
   20972     function_tests++;
   20973 
   20974     return(test_ret);
   20975 }
   20976 
   20977 
   20978 static int
   20979 test_xmlIsBlankNode(void) {
   20980     int test_ret = 0;
   20981 
   20982     int mem_base;
   20983     int ret_val;
   20984     xmlNode * node; /* the node */
   20985     int n_node;
   20986 
   20987     for (n_node = 0;n_node < gen_nb_const_xmlNode_ptr;n_node++) {
   20988         mem_base = xmlMemBlocks();
   20989         node = gen_const_xmlNode_ptr(n_node, 0);
   20990 
   20991         ret_val = xmlIsBlankNode((const xmlNode *)node);
   20992         desret_int(ret_val);
   20993         call_tests++;
   20994         des_const_xmlNode_ptr(n_node, (const xmlNode *)node, 0);
   20995         xmlResetLastError();
   20996         if (mem_base != xmlMemBlocks()) {
   20997             printf("Leak of %d blocks found in xmlIsBlankNode",
   20998 	           xmlMemBlocks() - mem_base);
   20999 	    test_ret++;
   21000             printf(" %d", n_node);
   21001             printf("\n");
   21002         }
   21003     }
   21004     function_tests++;
   21005 
   21006     return(test_ret);
   21007 }
   21008 
   21009 
   21010 static int
   21011 test_xmlIsXHTML(void) {
   21012     int test_ret = 0;
   21013 
   21014     int mem_base;
   21015     int ret_val;
   21016     xmlChar * systemID; /* the system identifier */
   21017     int n_systemID;
   21018     xmlChar * publicID; /* the public identifier */
   21019     int n_publicID;
   21020 
   21021     for (n_systemID = 0;n_systemID < gen_nb_const_xmlChar_ptr;n_systemID++) {
   21022     for (n_publicID = 0;n_publicID < gen_nb_const_xmlChar_ptr;n_publicID++) {
   21023         mem_base = xmlMemBlocks();
   21024         systemID = gen_const_xmlChar_ptr(n_systemID, 0);
   21025         publicID = gen_const_xmlChar_ptr(n_publicID, 1);
   21026 
   21027         ret_val = xmlIsXHTML((const xmlChar *)systemID, (const xmlChar *)publicID);
   21028         desret_int(ret_val);
   21029         call_tests++;
   21030         des_const_xmlChar_ptr(n_systemID, (const xmlChar *)systemID, 0);
   21031         des_const_xmlChar_ptr(n_publicID, (const xmlChar *)publicID, 1);
   21032         xmlResetLastError();
   21033         if (mem_base != xmlMemBlocks()) {
   21034             printf("Leak of %d blocks found in xmlIsXHTML",
   21035 	           xmlMemBlocks() - mem_base);
   21036 	    test_ret++;
   21037             printf(" %d", n_systemID);
   21038             printf(" %d", n_publicID);
   21039             printf("\n");
   21040         }
   21041     }
   21042     }
   21043     function_tests++;
   21044 
   21045     return(test_ret);
   21046 }
   21047 
   21048 
   21049 static int
   21050 test_xmlLastElementChild(void) {
   21051     int test_ret = 0;
   21052 
   21053 #if defined(LIBXML_TREE_ENABLED)
   21054     int mem_base;
   21055     xmlNodePtr ret_val;
   21056     xmlNodePtr parent; /* the parent node */
   21057     int n_parent;
   21058 
   21059     for (n_parent = 0;n_parent < gen_nb_xmlNodePtr;n_parent++) {
   21060         mem_base = xmlMemBlocks();
   21061         parent = gen_xmlNodePtr(n_parent, 0);
   21062 
   21063         ret_val = xmlLastElementChild(parent);
   21064         desret_xmlNodePtr(ret_val);
   21065         call_tests++;
   21066         des_xmlNodePtr(n_parent, parent, 0);
   21067         xmlResetLastError();
   21068         if (mem_base != xmlMemBlocks()) {
   21069             printf("Leak of %d blocks found in xmlLastElementChild",
   21070 	           xmlMemBlocks() - mem_base);
   21071 	    test_ret++;
   21072             printf(" %d", n_parent);
   21073             printf("\n");
   21074         }
   21075     }
   21076     function_tests++;
   21077 #endif
   21078 
   21079     return(test_ret);
   21080 }
   21081 
   21082 
   21083 static int
   21084 test_xmlNewCDataBlock(void) {
   21085     int test_ret = 0;
   21086 
   21087     int mem_base;
   21088     xmlNodePtr ret_val;
   21089     xmlDocPtr doc; /* the document */
   21090     int n_doc;
   21091     xmlChar * content; /* the CDATA block content content */
   21092     int n_content;
   21093     int len; /* the length of the block */
   21094     int n_len;
   21095 
   21096     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
   21097     for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
   21098     for (n_len = 0;n_len < gen_nb_int;n_len++) {
   21099         mem_base = xmlMemBlocks();
   21100         doc = gen_xmlDocPtr(n_doc, 0);
   21101         content = gen_const_xmlChar_ptr(n_content, 1);
   21102         len = gen_int(n_len, 2);
   21103         if ((content != NULL) &&
   21104             (len > (int) strlen((const char *) content) + 1))
   21105             continue;
   21106 
   21107         ret_val = xmlNewCDataBlock(doc, (const xmlChar *)content, len);
   21108         desret_xmlNodePtr(ret_val);
   21109         call_tests++;
   21110         des_xmlDocPtr(n_doc, doc, 0);
   21111         des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 1);
   21112         des_int(n_len, len, 2);
   21113         xmlResetLastError();
   21114         if (mem_base != xmlMemBlocks()) {
   21115             printf("Leak of %d blocks found in xmlNewCDataBlock",
   21116 	           xmlMemBlocks() - mem_base);
   21117 	    test_ret++;
   21118             printf(" %d", n_doc);
   21119             printf(" %d", n_content);
   21120             printf(" %d", n_len);
   21121             printf("\n");
   21122         }
   21123     }
   21124     }
   21125     }
   21126     function_tests++;
   21127 
   21128     return(test_ret);
   21129 }
   21130 
   21131 
   21132 static int
   21133 test_xmlNewCharRef(void) {
   21134     int test_ret = 0;
   21135 
   21136     int mem_base;
   21137     xmlNodePtr ret_val;
   21138     xmlDocPtr doc; /* the document */
   21139     int n_doc;
   21140     xmlChar * name; /* the char ref string, starting with # or "&# ... ;" */
   21141     int n_name;
   21142 
   21143     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
   21144     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
   21145         mem_base = xmlMemBlocks();
   21146         doc = gen_xmlDocPtr(n_doc, 0);
   21147         name = gen_const_xmlChar_ptr(n_name, 1);
   21148 
   21149         ret_val = xmlNewCharRef(doc, (const xmlChar *)name);
   21150         desret_xmlNodePtr(ret_val);
   21151         call_tests++;
   21152         des_xmlDocPtr(n_doc, doc, 0);
   21153         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
   21154         xmlResetLastError();
   21155         if (mem_base != xmlMemBlocks()) {
   21156             printf("Leak of %d blocks found in xmlNewCharRef",
   21157 	           xmlMemBlocks() - mem_base);
   21158 	    test_ret++;
   21159             printf(" %d", n_doc);
   21160             printf(" %d", n_name);
   21161             printf("\n");
   21162         }
   21163     }
   21164     }
   21165     function_tests++;
   21166 
   21167     return(test_ret);
   21168 }
   21169 
   21170 
   21171 static int
   21172 test_xmlNewChild(void) {
   21173     int test_ret = 0;
   21174 
   21175 #if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED)
   21176 #ifdef LIBXML_TREE_ENABLED
   21177     int mem_base;
   21178     xmlNodePtr ret_val;
   21179     xmlNodePtr parent; /* the parent node */
   21180     int n_parent;
   21181     xmlNsPtr ns; /* a namespace if any */
   21182     int n_ns;
   21183     xmlChar * name; /* the name of the child */
   21184     int n_name;
   21185     xmlChar * content; /* the XML content of the child if any. */
   21186     int n_content;
   21187 
   21188     for (n_parent = 0;n_parent < gen_nb_xmlNodePtr;n_parent++) {
   21189     for (n_ns = 0;n_ns < gen_nb_xmlNsPtr;n_ns++) {
   21190     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
   21191     for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
   21192         mem_base = xmlMemBlocks();
   21193         parent = gen_xmlNodePtr(n_parent, 0);
   21194         ns = gen_xmlNsPtr(n_ns, 1);
   21195         name = gen_const_xmlChar_ptr(n_name, 2);
   21196         content = gen_const_xmlChar_ptr(n_content, 3);
   21197 
   21198         ret_val = xmlNewChild(parent, ns, (const xmlChar *)name, (const xmlChar *)content);
   21199         desret_xmlNodePtr(ret_val);
   21200         call_tests++;
   21201         des_xmlNodePtr(n_parent, parent, 0);
   21202         des_xmlNsPtr(n_ns, ns, 1);
   21203         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 2);
   21204         des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 3);
   21205         xmlResetLastError();
   21206         if (mem_base != xmlMemBlocks()) {
   21207             printf("Leak of %d blocks found in xmlNewChild",
   21208 	           xmlMemBlocks() - mem_base);
   21209 	    test_ret++;
   21210             printf(" %d", n_parent);
   21211             printf(" %d", n_ns);
   21212             printf(" %d", n_name);
   21213             printf(" %d", n_content);
   21214             printf("\n");
   21215         }
   21216     }
   21217     }
   21218     }
   21219     }
   21220     function_tests++;
   21221 #endif
   21222 #endif
   21223 
   21224     return(test_ret);
   21225 }
   21226 
   21227 
   21228 static int
   21229 test_xmlNewComment(void) {
   21230     int test_ret = 0;
   21231 
   21232     int mem_base;
   21233     xmlNodePtr ret_val;
   21234     xmlChar * content; /* the comment content */
   21235     int n_content;
   21236 
   21237     for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
   21238         mem_base = xmlMemBlocks();
   21239         content = gen_const_xmlChar_ptr(n_content, 0);
   21240 
   21241         ret_val = xmlNewComment((const xmlChar *)content);
   21242         desret_xmlNodePtr(ret_val);
   21243         call_tests++;
   21244         des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 0);
   21245         xmlResetLastError();
   21246         if (mem_base != xmlMemBlocks()) {
   21247             printf("Leak of %d blocks found in xmlNewComment",
   21248 	           xmlMemBlocks() - mem_base);
   21249 	    test_ret++;
   21250             printf(" %d", n_content);
   21251             printf("\n");
   21252         }
   21253     }
   21254     function_tests++;
   21255 
   21256     return(test_ret);
   21257 }
   21258 
   21259 
   21260 static int
   21261 test_xmlNewDoc(void) {
   21262     int test_ret = 0;
   21263 
   21264     int mem_base;
   21265     xmlDocPtr ret_val;
   21266     xmlChar * version; /* xmlChar string giving the version of XML "1.0" */
   21267     int n_version;
   21268 
   21269     for (n_version = 0;n_version < gen_nb_const_xmlChar_ptr;n_version++) {
   21270         mem_base = xmlMemBlocks();
   21271         version = gen_const_xmlChar_ptr(n_version, 0);
   21272 
   21273         ret_val = xmlNewDoc((const xmlChar *)version);
   21274         desret_xmlDocPtr(ret_val);
   21275         call_tests++;
   21276         des_const_xmlChar_ptr(n_version, (const xmlChar *)version, 0);
   21277         xmlResetLastError();
   21278         if (mem_base != xmlMemBlocks()) {
   21279             printf("Leak of %d blocks found in xmlNewDoc",
   21280 	           xmlMemBlocks() - mem_base);
   21281 	    test_ret++;
   21282             printf(" %d", n_version);
   21283             printf("\n");
   21284         }
   21285     }
   21286     function_tests++;
   21287 
   21288     return(test_ret);
   21289 }
   21290 
   21291 
   21292 static int
   21293 test_xmlNewDocComment(void) {
   21294     int test_ret = 0;
   21295 
   21296     int mem_base;
   21297     xmlNodePtr ret_val;
   21298     xmlDocPtr doc; /* the document */
   21299     int n_doc;
   21300     xmlChar * content; /* the comment content */
   21301     int n_content;
   21302 
   21303     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
   21304     for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
   21305         mem_base = xmlMemBlocks();
   21306         doc = gen_xmlDocPtr(n_doc, 0);
   21307         content = gen_const_xmlChar_ptr(n_content, 1);
   21308 
   21309         ret_val = xmlNewDocComment(doc, (const xmlChar *)content);
   21310         desret_xmlNodePtr(ret_val);
   21311         call_tests++;
   21312         des_xmlDocPtr(n_doc, doc, 0);
   21313         des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 1);
   21314         xmlResetLastError();
   21315         if (mem_base != xmlMemBlocks()) {
   21316             printf("Leak of %d blocks found in xmlNewDocComment",
   21317 	           xmlMemBlocks() - mem_base);
   21318 	    test_ret++;
   21319             printf(" %d", n_doc);
   21320             printf(" %d", n_content);
   21321             printf("\n");
   21322         }
   21323     }
   21324     }
   21325     function_tests++;
   21326 
   21327     return(test_ret);
   21328 }
   21329 
   21330 
   21331 static int
   21332 test_xmlNewDocFragment(void) {
   21333     int test_ret = 0;
   21334 
   21335 #if defined(LIBXML_TREE_ENABLED)
   21336     int mem_base;
   21337     xmlNodePtr ret_val;
   21338     xmlDocPtr doc; /* the document owning the fragment */
   21339     int n_doc;
   21340 
   21341     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
   21342         mem_base = xmlMemBlocks();
   21343         doc = gen_xmlDocPtr(n_doc, 0);
   21344 
   21345         ret_val = xmlNewDocFragment(doc);
   21346         desret_xmlNodePtr(ret_val);
   21347         call_tests++;
   21348         des_xmlDocPtr(n_doc, doc, 0);
   21349         xmlResetLastError();
   21350         if (mem_base != xmlMemBlocks()) {
   21351             printf("Leak of %d blocks found in xmlNewDocFragment",
   21352 	           xmlMemBlocks() - mem_base);
   21353 	    test_ret++;
   21354             printf(" %d", n_doc);
   21355             printf("\n");
   21356         }
   21357     }
   21358     function_tests++;
   21359 #endif
   21360 
   21361     return(test_ret);
   21362 }
   21363 
   21364 
   21365 static int
   21366 test_xmlNewDocNode(void) {
   21367     int test_ret = 0;
   21368 
   21369     int mem_base;
   21370     xmlNodePtr ret_val;
   21371     xmlDocPtr doc; /* the document */
   21372     int n_doc;
   21373     xmlNsPtr ns; /* namespace if any */
   21374     int n_ns;
   21375     xmlChar * name; /* the node name */
   21376     int n_name;
   21377     xmlChar * content; /* the XML text content if any */
   21378     int n_content;
   21379 
   21380     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
   21381     for (n_ns = 0;n_ns < gen_nb_xmlNsPtr;n_ns++) {
   21382     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
   21383     for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
   21384         mem_base = xmlMemBlocks();
   21385         doc = gen_xmlDocPtr(n_doc, 0);
   21386         ns = gen_xmlNsPtr(n_ns, 1);
   21387         name = gen_const_xmlChar_ptr(n_name, 2);
   21388         content = gen_const_xmlChar_ptr(n_content, 3);
   21389 
   21390         ret_val = xmlNewDocNode(doc, ns, (const xmlChar *)name, (const xmlChar *)content);
   21391         desret_xmlNodePtr(ret_val);
   21392         call_tests++;
   21393         des_xmlDocPtr(n_doc, doc, 0);
   21394         des_xmlNsPtr(n_ns, ns, 1);
   21395         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 2);
   21396         des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 3);
   21397         xmlResetLastError();
   21398         if (mem_base != xmlMemBlocks()) {
   21399             printf("Leak of %d blocks found in xmlNewDocNode",
   21400 	           xmlMemBlocks() - mem_base);
   21401 	    test_ret++;
   21402             printf(" %d", n_doc);
   21403             printf(" %d", n_ns);
   21404             printf(" %d", n_name);
   21405             printf(" %d", n_content);
   21406             printf("\n");
   21407         }
   21408     }
   21409     }
   21410     }
   21411     }
   21412     function_tests++;
   21413 
   21414     return(test_ret);
   21415 }
   21416 
   21417 
   21418 static int
   21419 test_xmlNewDocNodeEatName(void) {
   21420     int test_ret = 0;
   21421 
   21422     int mem_base;
   21423     xmlNodePtr ret_val;
   21424     xmlDocPtr doc; /* the document */
   21425     int n_doc;
   21426     xmlNsPtr ns; /* namespace if any */
   21427     int n_ns;
   21428     xmlChar * name; /* the node name */
   21429     int n_name;
   21430     xmlChar * content; /* the XML text content if any */
   21431     int n_content;
   21432 
   21433     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
   21434     for (n_ns = 0;n_ns < gen_nb_xmlNsPtr;n_ns++) {
   21435     for (n_name = 0;n_name < gen_nb_eaten_name;n_name++) {
   21436     for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
   21437         mem_base = xmlMemBlocks();
   21438         doc = gen_xmlDocPtr(n_doc, 0);
   21439         ns = gen_xmlNsPtr(n_ns, 1);
   21440         name = gen_eaten_name(n_name, 2);
   21441         content = gen_const_xmlChar_ptr(n_content, 3);
   21442 
   21443         ret_val = xmlNewDocNodeEatName(doc, ns, name, (const xmlChar *)content);
   21444         desret_xmlNodePtr(ret_val);
   21445         call_tests++;
   21446         des_xmlDocPtr(n_doc, doc, 0);
   21447         des_xmlNsPtr(n_ns, ns, 1);
   21448         des_eaten_name(n_name, name, 2);
   21449         des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 3);
   21450         xmlResetLastError();
   21451         if (mem_base != xmlMemBlocks()) {
   21452             printf("Leak of %d blocks found in xmlNewDocNodeEatName",
   21453 	           xmlMemBlocks() - mem_base);
   21454 	    test_ret++;
   21455             printf(" %d", n_doc);
   21456             printf(" %d", n_ns);
   21457             printf(" %d", n_name);
   21458             printf(" %d", n_content);
   21459             printf("\n");
   21460         }
   21461     }
   21462     }
   21463     }
   21464     }
   21465     function_tests++;
   21466 
   21467     return(test_ret);
   21468 }
   21469 
   21470 
   21471 static int
   21472 test_xmlNewDocPI(void) {
   21473     int test_ret = 0;
   21474 
   21475     int mem_base;
   21476     xmlNodePtr ret_val;
   21477     xmlDocPtr doc; /* the target document */
   21478     int n_doc;
   21479     xmlChar * name; /* the processing instruction name */
   21480     int n_name;
   21481     xmlChar * content; /* the PI content */
   21482     int n_content;
   21483 
   21484     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
   21485     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
   21486     for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
   21487         mem_base = xmlMemBlocks();
   21488         doc = gen_xmlDocPtr(n_doc, 0);
   21489         name = gen_const_xmlChar_ptr(n_name, 1);
   21490         content = gen_const_xmlChar_ptr(n_content, 2);
   21491 
   21492         ret_val = xmlNewDocPI(doc, (const xmlChar *)name, (const xmlChar *)content);
   21493         desret_xmlNodePtr(ret_val);
   21494         call_tests++;
   21495         des_xmlDocPtr(n_doc, doc, 0);
   21496         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
   21497         des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 2);
   21498         xmlResetLastError();
   21499         if (mem_base != xmlMemBlocks()) {
   21500             printf("Leak of %d blocks found in xmlNewDocPI",
   21501 	           xmlMemBlocks() - mem_base);
   21502 	    test_ret++;
   21503             printf(" %d", n_doc);
   21504             printf(" %d", n_name);
   21505             printf(" %d", n_content);
   21506             printf("\n");
   21507         }
   21508     }
   21509     }
   21510     }
   21511     function_tests++;
   21512 
   21513     return(test_ret);
   21514 }
   21515 
   21516 
   21517 static int
   21518 test_xmlNewDocProp(void) {
   21519     int test_ret = 0;
   21520 
   21521     int mem_base;
   21522     xmlAttrPtr ret_val;
   21523     xmlDocPtr doc; /* the document */
   21524     int n_doc;
   21525     xmlChar * name; /* the name of the attribute */
   21526     int n_name;
   21527     xmlChar * value; /* the value of the attribute */
   21528     int n_value;
   21529 
   21530     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
   21531     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
   21532     for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
   21533         mem_base = xmlMemBlocks();
   21534         doc = gen_xmlDocPtr(n_doc, 0);
   21535         name = gen_const_xmlChar_ptr(n_name, 1);
   21536         value = gen_const_xmlChar_ptr(n_value, 2);
   21537 
   21538         ret_val = xmlNewDocProp(doc, (const xmlChar *)name, (const xmlChar *)value);
   21539         desret_xmlAttrPtr(ret_val);
   21540         call_tests++;
   21541         des_xmlDocPtr(n_doc, doc, 0);
   21542         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
   21543         des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 2);
   21544         xmlResetLastError();
   21545         if (mem_base != xmlMemBlocks()) {
   21546             printf("Leak of %d blocks found in xmlNewDocProp",
   21547 	           xmlMemBlocks() - mem_base);
   21548 	    test_ret++;
   21549             printf(" %d", n_doc);
   21550             printf(" %d", n_name);
   21551             printf(" %d", n_value);
   21552             printf("\n");
   21553         }
   21554     }
   21555     }
   21556     }
   21557     function_tests++;
   21558 
   21559     return(test_ret);
   21560 }
   21561 
   21562 
   21563 static int
   21564 test_xmlNewDocRawNode(void) {
   21565     int test_ret = 0;
   21566 
   21567 #if defined(LIBXML_TREE_ENABLED)
   21568 #ifdef LIBXML_TREE_ENABLED
   21569     int mem_base;
   21570     xmlNodePtr ret_val;
   21571     xmlDocPtr doc; /* the document */
   21572     int n_doc;
   21573     xmlNsPtr ns; /* namespace if any */
   21574     int n_ns;
   21575     xmlChar * name; /* the node name */
   21576     int n_name;
   21577     xmlChar * content; /* the text content if any */
   21578     int n_content;
   21579 
   21580     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
   21581     for (n_ns = 0;n_ns < gen_nb_xmlNsPtr;n_ns++) {
   21582     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
   21583     for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
   21584         mem_base = xmlMemBlocks();
   21585         doc = gen_xmlDocPtr(n_doc, 0);
   21586         ns = gen_xmlNsPtr(n_ns, 1);
   21587         name = gen_const_xmlChar_ptr(n_name, 2);
   21588         content = gen_const_xmlChar_ptr(n_content, 3);
   21589 
   21590         ret_val = xmlNewDocRawNode(doc, ns, (const xmlChar *)name, (const xmlChar *)content);
   21591         desret_xmlNodePtr(ret_val);
   21592         call_tests++;
   21593         des_xmlDocPtr(n_doc, doc, 0);
   21594         des_xmlNsPtr(n_ns, ns, 1);
   21595         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 2);
   21596         des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 3);
   21597         xmlResetLastError();
   21598         if (mem_base != xmlMemBlocks()) {
   21599             printf("Leak of %d blocks found in xmlNewDocRawNode",
   21600 	           xmlMemBlocks() - mem_base);
   21601 	    test_ret++;
   21602             printf(" %d", n_doc);
   21603             printf(" %d", n_ns);
   21604             printf(" %d", n_name);
   21605             printf(" %d", n_content);
   21606             printf("\n");
   21607         }
   21608     }
   21609     }
   21610     }
   21611     }
   21612     function_tests++;
   21613 #endif
   21614 #endif
   21615 
   21616     return(test_ret);
   21617 }
   21618 
   21619 
   21620 static int
   21621 test_xmlNewDocText(void) {
   21622     int test_ret = 0;
   21623 
   21624     int mem_base;
   21625     xmlNodePtr ret_val;
   21626     xmlDoc * doc; /* the document */
   21627     int n_doc;
   21628     xmlChar * content; /* the text content */
   21629     int n_content;
   21630 
   21631     for (n_doc = 0;n_doc < gen_nb_const_xmlDoc_ptr;n_doc++) {
   21632     for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
   21633         mem_base = xmlMemBlocks();
   21634         doc = gen_const_xmlDoc_ptr(n_doc, 0);
   21635         content = gen_const_xmlChar_ptr(n_content, 1);
   21636 
   21637         ret_val = xmlNewDocText((const xmlDoc *)doc, (const xmlChar *)content);
   21638         desret_xmlNodePtr(ret_val);
   21639         call_tests++;
   21640         des_const_xmlDoc_ptr(n_doc, (const xmlDoc *)doc, 0);
   21641         des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 1);
   21642         xmlResetLastError();
   21643         if (mem_base != xmlMemBlocks()) {
   21644             printf("Leak of %d blocks found in xmlNewDocText",
   21645 	           xmlMemBlocks() - mem_base);
   21646 	    test_ret++;
   21647             printf(" %d", n_doc);
   21648             printf(" %d", n_content);
   21649             printf("\n");
   21650         }
   21651     }
   21652     }
   21653     function_tests++;
   21654 
   21655     return(test_ret);
   21656 }
   21657 
   21658 
   21659 static int
   21660 test_xmlNewDocTextLen(void) {
   21661     int test_ret = 0;
   21662 
   21663     int mem_base;
   21664     xmlNodePtr ret_val;
   21665     xmlDocPtr doc; /* the document */
   21666     int n_doc;
   21667     xmlChar * content; /* the text content */
   21668     int n_content;
   21669     int len; /* the text len. */
   21670     int n_len;
   21671 
   21672     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
   21673     for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
   21674     for (n_len = 0;n_len < gen_nb_int;n_len++) {
   21675         mem_base = xmlMemBlocks();
   21676         doc = gen_xmlDocPtr(n_doc, 0);
   21677         content = gen_const_xmlChar_ptr(n_content, 1);
   21678         len = gen_int(n_len, 2);
   21679         if ((content != NULL) &&
   21680             (len > (int) strlen((const char *) content) + 1))
   21681             continue;
   21682 
   21683         ret_val = xmlNewDocTextLen(doc, (const xmlChar *)content, len);
   21684         desret_xmlNodePtr(ret_val);
   21685         call_tests++;
   21686         des_xmlDocPtr(n_doc, doc, 0);
   21687         des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 1);
   21688         des_int(n_len, len, 2);
   21689         xmlResetLastError();
   21690         if (mem_base != xmlMemBlocks()) {
   21691             printf("Leak of %d blocks found in xmlNewDocTextLen",
   21692 	           xmlMemBlocks() - mem_base);
   21693 	    test_ret++;
   21694             printf(" %d", n_doc);
   21695             printf(" %d", n_content);
   21696             printf(" %d", n_len);
   21697             printf("\n");
   21698         }
   21699     }
   21700     }
   21701     }
   21702     function_tests++;
   21703 
   21704     return(test_ret);
   21705 }
   21706 
   21707 
   21708 static int
   21709 test_xmlNewDtd(void) {
   21710     int test_ret = 0;
   21711 
   21712     int mem_base;
   21713     xmlDtdPtr ret_val;
   21714     xmlDocPtr doc; /* the document pointer */
   21715     int n_doc;
   21716     xmlChar * name; /* the DTD name */
   21717     int n_name;
   21718     xmlChar * ExternalID; /* the external ID */
   21719     int n_ExternalID;
   21720     xmlChar * SystemID; /* the system ID */
   21721     int n_SystemID;
   21722 
   21723     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
   21724     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
   21725     for (n_ExternalID = 0;n_ExternalID < gen_nb_const_xmlChar_ptr;n_ExternalID++) {
   21726     for (n_SystemID = 0;n_SystemID < gen_nb_const_xmlChar_ptr;n_SystemID++) {
   21727         mem_base = xmlMemBlocks();
   21728         doc = gen_xmlDocPtr(n_doc, 0);
   21729         name = gen_const_xmlChar_ptr(n_name, 1);
   21730         ExternalID = gen_const_xmlChar_ptr(n_ExternalID, 2);
   21731         SystemID = gen_const_xmlChar_ptr(n_SystemID, 3);
   21732 
   21733         ret_val = xmlNewDtd(doc, (const xmlChar *)name, (const xmlChar *)ExternalID, (const xmlChar *)SystemID);
   21734         desret_xmlDtdPtr(ret_val);
   21735         call_tests++;
   21736         des_xmlDocPtr(n_doc, doc, 0);
   21737         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
   21738         des_const_xmlChar_ptr(n_ExternalID, (const xmlChar *)ExternalID, 2);
   21739         des_const_xmlChar_ptr(n_SystemID, (const xmlChar *)SystemID, 3);
   21740         xmlResetLastError();
   21741         if (mem_base != xmlMemBlocks()) {
   21742             printf("Leak of %d blocks found in xmlNewDtd",
   21743 	           xmlMemBlocks() - mem_base);
   21744 	    test_ret++;
   21745             printf(" %d", n_doc);
   21746             printf(" %d", n_name);
   21747             printf(" %d", n_ExternalID);
   21748             printf(" %d", n_SystemID);
   21749             printf("\n");
   21750         }
   21751     }
   21752     }
   21753     }
   21754     }
   21755     function_tests++;
   21756 
   21757     return(test_ret);
   21758 }
   21759 
   21760 
   21761 static int
   21762 test_xmlNewNode(void) {
   21763     int test_ret = 0;
   21764 
   21765     int mem_base;
   21766     xmlNodePtr ret_val;
   21767     xmlNsPtr ns; /* namespace if any */
   21768     int n_ns;
   21769     xmlChar * name; /* the node name */
   21770     int n_name;
   21771 
   21772     for (n_ns = 0;n_ns < gen_nb_xmlNsPtr;n_ns++) {
   21773     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
   21774         mem_base = xmlMemBlocks();
   21775         ns = gen_xmlNsPtr(n_ns, 0);
   21776         name = gen_const_xmlChar_ptr(n_name, 1);
   21777 
   21778         ret_val = xmlNewNode(ns, (const xmlChar *)name);
   21779         desret_xmlNodePtr(ret_val);
   21780         call_tests++;
   21781         des_xmlNsPtr(n_ns, ns, 0);
   21782         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
   21783         xmlResetLastError();
   21784         if (mem_base != xmlMemBlocks()) {
   21785             printf("Leak of %d blocks found in xmlNewNode",
   21786 	           xmlMemBlocks() - mem_base);
   21787 	    test_ret++;
   21788             printf(" %d", n_ns);
   21789             printf(" %d", n_name);
   21790             printf("\n");
   21791         }
   21792     }
   21793     }
   21794     function_tests++;
   21795 
   21796     return(test_ret);
   21797 }
   21798 
   21799 
   21800 static int
   21801 test_xmlNewNodeEatName(void) {
   21802     int test_ret = 0;
   21803 
   21804     int mem_base;
   21805     xmlNodePtr ret_val;
   21806     xmlNsPtr ns; /* namespace if any */
   21807     int n_ns;
   21808     xmlChar * name; /* the node name */
   21809     int n_name;
   21810 
   21811     for (n_ns = 0;n_ns < gen_nb_xmlNsPtr;n_ns++) {
   21812     for (n_name = 0;n_name < gen_nb_eaten_name;n_name++) {
   21813         mem_base = xmlMemBlocks();
   21814         ns = gen_xmlNsPtr(n_ns, 0);
   21815         name = gen_eaten_name(n_name, 1);
   21816 
   21817         ret_val = xmlNewNodeEatName(ns, name);
   21818         desret_xmlNodePtr(ret_val);
   21819         call_tests++;
   21820         des_xmlNsPtr(n_ns, ns, 0);
   21821         des_eaten_name(n_name, name, 1);
   21822         xmlResetLastError();
   21823         if (mem_base != xmlMemBlocks()) {
   21824             printf("Leak of %d blocks found in xmlNewNodeEatName",
   21825 	           xmlMemBlocks() - mem_base);
   21826 	    test_ret++;
   21827             printf(" %d", n_ns);
   21828             printf(" %d", n_name);
   21829             printf("\n");
   21830         }
   21831     }
   21832     }
   21833     function_tests++;
   21834 
   21835     return(test_ret);
   21836 }
   21837 
   21838 
   21839 static int
   21840 test_xmlNewNs(void) {
   21841     int test_ret = 0;
   21842 
   21843     int mem_base;
   21844     xmlNsPtr ret_val;
   21845     xmlNodePtr node; /* the element carrying the namespace */
   21846     int n_node;
   21847     xmlChar * href; /* the URI associated */
   21848     int n_href;
   21849     xmlChar * prefix; /* the prefix for the namespace */
   21850     int n_prefix;
   21851 
   21852     for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
   21853     for (n_href = 0;n_href < gen_nb_const_xmlChar_ptr;n_href++) {
   21854     for (n_prefix = 0;n_prefix < gen_nb_const_xmlChar_ptr;n_prefix++) {
   21855         mem_base = xmlMemBlocks();
   21856         node = gen_xmlNodePtr(n_node, 0);
   21857         href = gen_const_xmlChar_ptr(n_href, 1);
   21858         prefix = gen_const_xmlChar_ptr(n_prefix, 2);
   21859 
   21860         ret_val = xmlNewNs(node, (const xmlChar *)href, (const xmlChar *)prefix);
   21861         if ((node == NULL) && (ret_val != NULL)) xmlFreeNs(ret_val);
   21862         desret_xmlNsPtr(ret_val);
   21863         call_tests++;
   21864         des_xmlNodePtr(n_node, node, 0);
   21865         des_const_xmlChar_ptr(n_href, (const xmlChar *)href, 1);
   21866         des_const_xmlChar_ptr(n_prefix, (const xmlChar *)prefix, 2);
   21867         xmlResetLastError();
   21868         if (mem_base != xmlMemBlocks()) {
   21869             printf("Leak of %d blocks found in xmlNewNs",
   21870 	           xmlMemBlocks() - mem_base);
   21871 	    test_ret++;
   21872             printf(" %d", n_node);
   21873             printf(" %d", n_href);
   21874             printf(" %d", n_prefix);
   21875             printf("\n");
   21876         }
   21877     }
   21878     }
   21879     }
   21880     function_tests++;
   21881 
   21882     return(test_ret);
   21883 }
   21884 
   21885 
   21886 static int
   21887 test_xmlNewNsProp(void) {
   21888     int test_ret = 0;
   21889 
   21890     int mem_base;
   21891     xmlAttrPtr ret_val;
   21892     xmlNodePtr node; /* the holding node */
   21893     int n_node;
   21894     xmlNsPtr ns; /* the namespace */
   21895     int n_ns;
   21896     xmlChar * name; /* the name of the attribute */
   21897     int n_name;
   21898     xmlChar * value; /* the value of the attribute */
   21899     int n_value;
   21900 
   21901     for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
   21902     for (n_ns = 0;n_ns < gen_nb_xmlNsPtr;n_ns++) {
   21903     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
   21904     for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
   21905         mem_base = xmlMemBlocks();
   21906         node = gen_xmlNodePtr(n_node, 0);
   21907         ns = gen_xmlNsPtr(n_ns, 1);
   21908         name = gen_const_xmlChar_ptr(n_name, 2);
   21909         value = gen_const_xmlChar_ptr(n_value, 3);
   21910 
   21911         ret_val = xmlNewNsProp(node, ns, (const xmlChar *)name, (const xmlChar *)value);
   21912         desret_xmlAttrPtr(ret_val);
   21913         call_tests++;
   21914         des_xmlNodePtr(n_node, node, 0);
   21915         des_xmlNsPtr(n_ns, ns, 1);
   21916         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 2);
   21917         des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 3);
   21918         xmlResetLastError();
   21919         if (mem_base != xmlMemBlocks()) {
   21920             printf("Leak of %d blocks found in xmlNewNsProp",
   21921 	           xmlMemBlocks() - mem_base);
   21922 	    test_ret++;
   21923             printf(" %d", n_node);
   21924             printf(" %d", n_ns);
   21925             printf(" %d", n_name);
   21926             printf(" %d", n_value);
   21927             printf("\n");
   21928         }
   21929     }
   21930     }
   21931     }
   21932     }
   21933     function_tests++;
   21934 
   21935     return(test_ret);
   21936 }
   21937 
   21938 
   21939 static int
   21940 test_xmlNewNsPropEatName(void) {
   21941     int test_ret = 0;
   21942 
   21943     int mem_base;
   21944     xmlAttrPtr ret_val;
   21945     xmlNodePtr node; /* the holding node */
   21946     int n_node;
   21947     xmlNsPtr ns; /* the namespace */
   21948     int n_ns;
   21949     xmlChar * name; /* the name of the attribute */
   21950     int n_name;
   21951     xmlChar * value; /* the value of the attribute */
   21952     int n_value;
   21953 
   21954     for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
   21955     for (n_ns = 0;n_ns < gen_nb_xmlNsPtr;n_ns++) {
   21956     for (n_name = 0;n_name < gen_nb_eaten_name;n_name++) {
   21957     for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
   21958         mem_base = xmlMemBlocks();
   21959         node = gen_xmlNodePtr(n_node, 0);
   21960         ns = gen_xmlNsPtr(n_ns, 1);
   21961         name = gen_eaten_name(n_name, 2);
   21962         value = gen_const_xmlChar_ptr(n_value, 3);
   21963 
   21964         ret_val = xmlNewNsPropEatName(node, ns, name, (const xmlChar *)value);
   21965         desret_xmlAttrPtr(ret_val);
   21966         call_tests++;
   21967         des_xmlNodePtr(n_node, node, 0);
   21968         des_xmlNsPtr(n_ns, ns, 1);
   21969         des_eaten_name(n_name, name, 2);
   21970         des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 3);
   21971         xmlResetLastError();
   21972         if (mem_base != xmlMemBlocks()) {
   21973             printf("Leak of %d blocks found in xmlNewNsPropEatName",
   21974 	           xmlMemBlocks() - mem_base);
   21975 	    test_ret++;
   21976             printf(" %d", n_node);
   21977             printf(" %d", n_ns);
   21978             printf(" %d", n_name);
   21979             printf(" %d", n_value);
   21980             printf("\n");
   21981         }
   21982     }
   21983     }
   21984     }
   21985     }
   21986     function_tests++;
   21987 
   21988     return(test_ret);
   21989 }
   21990 
   21991 
   21992 static int
   21993 test_xmlNewPI(void) {
   21994     int test_ret = 0;
   21995 
   21996     int mem_base;
   21997     xmlNodePtr ret_val;
   21998     xmlChar * name; /* the processing instruction name */
   21999     int n_name;
   22000     xmlChar * content; /* the PI content */
   22001     int n_content;
   22002 
   22003     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
   22004     for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
   22005         mem_base = xmlMemBlocks();
   22006         name = gen_const_xmlChar_ptr(n_name, 0);
   22007         content = gen_const_xmlChar_ptr(n_content, 1);
   22008 
   22009         ret_val = xmlNewPI((const xmlChar *)name, (const xmlChar *)content);
   22010         desret_xmlNodePtr(ret_val);
   22011         call_tests++;
   22012         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 0);
   22013         des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 1);
   22014         xmlResetLastError();
   22015         if (mem_base != xmlMemBlocks()) {
   22016             printf("Leak of %d blocks found in xmlNewPI",
   22017 	           xmlMemBlocks() - mem_base);
   22018 	    test_ret++;
   22019             printf(" %d", n_name);
   22020             printf(" %d", n_content);
   22021             printf("\n");
   22022         }
   22023     }
   22024     }
   22025     function_tests++;
   22026 
   22027     return(test_ret);
   22028 }
   22029 
   22030 
   22031 static int
   22032 test_xmlNewProp(void) {
   22033     int test_ret = 0;
   22034 
   22035 #if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_HTML_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED)
   22036 #ifdef LIBXML_TREE_ENABLED
   22037     int mem_base;
   22038     xmlAttrPtr ret_val;
   22039     xmlNodePtr node; /* the holding node */
   22040     int n_node;
   22041     xmlChar * name; /* the name of the attribute */
   22042     int n_name;
   22043     xmlChar * value; /* the value of the attribute */
   22044     int n_value;
   22045 
   22046     for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
   22047     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
   22048     for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
   22049         mem_base = xmlMemBlocks();
   22050         node = gen_xmlNodePtr(n_node, 0);
   22051         name = gen_const_xmlChar_ptr(n_name, 1);
   22052         value = gen_const_xmlChar_ptr(n_value, 2);
   22053 
   22054         ret_val = xmlNewProp(node, (const xmlChar *)name, (const xmlChar *)value);
   22055         desret_xmlAttrPtr(ret_val);
   22056         call_tests++;
   22057         des_xmlNodePtr(n_node, node, 0);
   22058         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
   22059         des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 2);
   22060         xmlResetLastError();
   22061         if (mem_base != xmlMemBlocks()) {
   22062             printf("Leak of %d blocks found in xmlNewProp",
   22063 	           xmlMemBlocks() - mem_base);
   22064 	    test_ret++;
   22065             printf(" %d", n_node);
   22066             printf(" %d", n_name);
   22067             printf(" %d", n_value);
   22068             printf("\n");
   22069         }
   22070     }
   22071     }
   22072     }
   22073     function_tests++;
   22074 #endif
   22075 #endif
   22076 
   22077     return(test_ret);
   22078 }
   22079 
   22080 
   22081 static int
   22082 test_xmlNewReference(void) {
   22083     int test_ret = 0;
   22084 
   22085     int mem_base;
   22086     xmlNodePtr ret_val;
   22087     xmlDoc * doc; /* the document */
   22088     int n_doc;
   22089     xmlChar * name; /* the reference name, or the reference string with & and ; */
   22090     int n_name;
   22091 
   22092     for (n_doc = 0;n_doc < gen_nb_const_xmlDoc_ptr;n_doc++) {
   22093     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
   22094         mem_base = xmlMemBlocks();
   22095         doc = gen_const_xmlDoc_ptr(n_doc, 0);
   22096         name = gen_const_xmlChar_ptr(n_name, 1);
   22097 
   22098         ret_val = xmlNewReference((const xmlDoc *)doc, (const xmlChar *)name);
   22099         desret_xmlNodePtr(ret_val);
   22100         call_tests++;
   22101         des_const_xmlDoc_ptr(n_doc, (const xmlDoc *)doc, 0);
   22102         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
   22103         xmlResetLastError();
   22104         if (mem_base != xmlMemBlocks()) {
   22105             printf("Leak of %d blocks found in xmlNewReference",
   22106 	           xmlMemBlocks() - mem_base);
   22107 	    test_ret++;
   22108             printf(" %d", n_doc);
   22109             printf(" %d", n_name);
   22110             printf("\n");
   22111         }
   22112     }
   22113     }
   22114     function_tests++;
   22115 
   22116     return(test_ret);
   22117 }
   22118 
   22119 
   22120 static int
   22121 test_xmlNewText(void) {
   22122     int test_ret = 0;
   22123 
   22124     int mem_base;
   22125     xmlNodePtr ret_val;
   22126     xmlChar * content; /* the text content */
   22127     int n_content;
   22128 
   22129     for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
   22130         mem_base = xmlMemBlocks();
   22131         content = gen_const_xmlChar_ptr(n_content, 0);
   22132 
   22133         ret_val = xmlNewText((const xmlChar *)content);
   22134         desret_xmlNodePtr(ret_val);
   22135         call_tests++;
   22136         des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 0);
   22137         xmlResetLastError();
   22138         if (mem_base != xmlMemBlocks()) {
   22139             printf("Leak of %d blocks found in xmlNewText",
   22140 	           xmlMemBlocks() - mem_base);
   22141 	    test_ret++;
   22142             printf(" %d", n_content);
   22143             printf("\n");
   22144         }
   22145     }
   22146     function_tests++;
   22147 
   22148     return(test_ret);
   22149 }
   22150 
   22151 
   22152 static int
   22153 test_xmlNewTextChild(void) {
   22154     int test_ret = 0;
   22155 
   22156 #if defined(LIBXML_TREE_ENABLED)
   22157 #ifdef LIBXML_TREE_ENABLED
   22158     int mem_base;
   22159     xmlNodePtr ret_val;
   22160     xmlNodePtr parent; /* the parent node */
   22161     int n_parent;
   22162     xmlNsPtr ns; /* a namespace if any */
   22163     int n_ns;
   22164     xmlChar * name; /* the name of the child */
   22165     int n_name;
   22166     xmlChar * content; /* the text content of the child if any. */
   22167     int n_content;
   22168 
   22169     for (n_parent = 0;n_parent < gen_nb_xmlNodePtr;n_parent++) {
   22170     for (n_ns = 0;n_ns < gen_nb_xmlNsPtr;n_ns++) {
   22171     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
   22172     for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
   22173         mem_base = xmlMemBlocks();
   22174         parent = gen_xmlNodePtr(n_parent, 0);
   22175         ns = gen_xmlNsPtr(n_ns, 1);
   22176         name = gen_const_xmlChar_ptr(n_name, 2);
   22177         content = gen_const_xmlChar_ptr(n_content, 3);
   22178 
   22179         ret_val = xmlNewTextChild(parent, ns, (const xmlChar *)name, (const xmlChar *)content);
   22180         desret_xmlNodePtr(ret_val);
   22181         call_tests++;
   22182         des_xmlNodePtr(n_parent, parent, 0);
   22183         des_xmlNsPtr(n_ns, ns, 1);
   22184         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 2);
   22185         des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 3);
   22186         xmlResetLastError();
   22187         if (mem_base != xmlMemBlocks()) {
   22188             printf("Leak of %d blocks found in xmlNewTextChild",
   22189 	           xmlMemBlocks() - mem_base);
   22190 	    test_ret++;
   22191             printf(" %d", n_parent);
   22192             printf(" %d", n_ns);
   22193             printf(" %d", n_name);
   22194             printf(" %d", n_content);
   22195             printf("\n");
   22196         }
   22197     }
   22198     }
   22199     }
   22200     }
   22201     function_tests++;
   22202 #endif
   22203 #endif
   22204 
   22205     return(test_ret);
   22206 }
   22207 
   22208 
   22209 static int
   22210 test_xmlNewTextLen(void) {
   22211     int test_ret = 0;
   22212 
   22213     int mem_base;
   22214     xmlNodePtr ret_val;
   22215     xmlChar * content; /* the text content */
   22216     int n_content;
   22217     int len; /* the text len. */
   22218     int n_len;
   22219 
   22220     for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
   22221     for (n_len = 0;n_len < gen_nb_int;n_len++) {
   22222         mem_base = xmlMemBlocks();
   22223         content = gen_const_xmlChar_ptr(n_content, 0);
   22224         len = gen_int(n_len, 1);
   22225         if ((content != NULL) &&
   22226             (len > (int) strlen((const char *) content) + 1))
   22227             continue;
   22228 
   22229         ret_val = xmlNewTextLen((const xmlChar *)content, len);
   22230         desret_xmlNodePtr(ret_val);
   22231         call_tests++;
   22232         des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 0);
   22233         des_int(n_len, len, 1);
   22234         xmlResetLastError();
   22235         if (mem_base != xmlMemBlocks()) {
   22236             printf("Leak of %d blocks found in xmlNewTextLen",
   22237 	           xmlMemBlocks() - mem_base);
   22238 	    test_ret++;
   22239             printf(" %d", n_content);
   22240             printf(" %d", n_len);
   22241             printf("\n");
   22242         }
   22243     }
   22244     }
   22245     function_tests++;
   22246 
   22247     return(test_ret);
   22248 }
   22249 
   22250 
   22251 static int
   22252 test_xmlNextElementSibling(void) {
   22253     int test_ret = 0;
   22254 
   22255 #if defined(LIBXML_TREE_ENABLED)
   22256     int mem_base;
   22257     xmlNodePtr ret_val;
   22258     xmlNodePtr node; /* the current node */
   22259     int n_node;
   22260 
   22261     for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
   22262         mem_base = xmlMemBlocks();
   22263         node = gen_xmlNodePtr(n_node, 0);
   22264 
   22265         ret_val = xmlNextElementSibling(node);
   22266         desret_xmlNodePtr(ret_val);
   22267         call_tests++;
   22268         des_xmlNodePtr(n_node, node, 0);
   22269         xmlResetLastError();
   22270         if (mem_base != xmlMemBlocks()) {
   22271             printf("Leak of %d blocks found in xmlNextElementSibling",
   22272 	           xmlMemBlocks() - mem_base);
   22273 	    test_ret++;
   22274             printf(" %d", n_node);
   22275             printf("\n");
   22276         }
   22277     }
   22278     function_tests++;
   22279 #endif
   22280 
   22281     return(test_ret);
   22282 }
   22283 
   22284 
   22285 static int
   22286 test_xmlNodeAddContent(void) {
   22287     int test_ret = 0;
   22288 
   22289     int mem_base;
   22290     xmlNodePtr cur; /* the node being modified */
   22291     int n_cur;
   22292     xmlChar * content; /* extra content */
   22293     int n_content;
   22294 
   22295     for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
   22296     for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
   22297         mem_base = xmlMemBlocks();
   22298         cur = gen_xmlNodePtr(n_cur, 0);
   22299         content = gen_const_xmlChar_ptr(n_content, 1);
   22300 
   22301         xmlNodeAddContent(cur, (const xmlChar *)content);
   22302         call_tests++;
   22303         des_xmlNodePtr(n_cur, cur, 0);
   22304         des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 1);
   22305         xmlResetLastError();
   22306         if (mem_base != xmlMemBlocks()) {
   22307             printf("Leak of %d blocks found in xmlNodeAddContent",
   22308 	           xmlMemBlocks() - mem_base);
   22309 	    test_ret++;
   22310             printf(" %d", n_cur);
   22311             printf(" %d", n_content);
   22312             printf("\n");
   22313         }
   22314     }
   22315     }
   22316     function_tests++;
   22317 
   22318     return(test_ret);
   22319 }
   22320 
   22321 
   22322 static int
   22323 test_xmlNodeAddContentLen(void) {
   22324     int test_ret = 0;
   22325 
   22326     int mem_base;
   22327     xmlNodePtr cur; /* the node being modified */
   22328     int n_cur;
   22329     xmlChar * content; /* extra content */
   22330     int n_content;
   22331     int len; /* the size of @content */
   22332     int n_len;
   22333 
   22334     for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
   22335     for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
   22336     for (n_len = 0;n_len < gen_nb_int;n_len++) {
   22337         mem_base = xmlMemBlocks();
   22338         cur = gen_xmlNodePtr(n_cur, 0);
   22339         content = gen_const_xmlChar_ptr(n_content, 1);
   22340         len = gen_int(n_len, 2);
   22341         if ((content != NULL) &&
   22342             (len > (int) strlen((const char *) content) + 1))
   22343             continue;
   22344 
   22345         xmlNodeAddContentLen(cur, (const xmlChar *)content, len);
   22346         call_tests++;
   22347         des_xmlNodePtr(n_cur, cur, 0);
   22348         des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 1);
   22349         des_int(n_len, len, 2);
   22350         xmlResetLastError();
   22351         if (mem_base != xmlMemBlocks()) {
   22352             printf("Leak of %d blocks found in xmlNodeAddContentLen",
   22353 	           xmlMemBlocks() - mem_base);
   22354 	    test_ret++;
   22355             printf(" %d", n_cur);
   22356             printf(" %d", n_content);
   22357             printf(" %d", n_len);
   22358             printf("\n");
   22359         }
   22360     }
   22361     }
   22362     }
   22363     function_tests++;
   22364 
   22365     return(test_ret);
   22366 }
   22367 
   22368 
   22369 static int
   22370 test_xmlNodeBufGetContent(void) {
   22371     int test_ret = 0;
   22372 
   22373     int mem_base;
   22374     int ret_val;
   22375     xmlBufferPtr buffer; /* a buffer */
   22376     int n_buffer;
   22377     xmlNode * cur; /* the node being read */
   22378     int n_cur;
   22379 
   22380     for (n_buffer = 0;n_buffer < gen_nb_xmlBufferPtr;n_buffer++) {
   22381     for (n_cur = 0;n_cur < gen_nb_const_xmlNode_ptr;n_cur++) {
   22382         mem_base = xmlMemBlocks();
   22383         buffer = gen_xmlBufferPtr(n_buffer, 0);
   22384         cur = gen_const_xmlNode_ptr(n_cur, 1);
   22385 
   22386         ret_val = xmlNodeBufGetContent(buffer, (const xmlNode *)cur);
   22387         desret_int(ret_val);
   22388         call_tests++;
   22389         des_xmlBufferPtr(n_buffer, buffer, 0);
   22390         des_const_xmlNode_ptr(n_cur, (const xmlNode *)cur, 1);
   22391         xmlResetLastError();
   22392         if (mem_base != xmlMemBlocks()) {
   22393             printf("Leak of %d blocks found in xmlNodeBufGetContent",
   22394 	           xmlMemBlocks() - mem_base);
   22395 	    test_ret++;
   22396             printf(" %d", n_buffer);
   22397             printf(" %d", n_cur);
   22398             printf("\n");
   22399         }
   22400     }
   22401     }
   22402     function_tests++;
   22403 
   22404     return(test_ret);
   22405 }
   22406 
   22407 
   22408 static int
   22409 test_xmlNodeDump(void) {
   22410     int test_ret = 0;
   22411 
   22412 #if defined(LIBXML_OUTPUT_ENABLED)
   22413     int mem_base;
   22414     int ret_val;
   22415     xmlBufferPtr buf; /* the XML buffer output */
   22416     int n_buf;
   22417     xmlDocPtr doc; /* the document */
   22418     int n_doc;
   22419     xmlNodePtr cur; /* the current node */
   22420     int n_cur;
   22421     int level; /* the imbrication level for indenting */
   22422     int n_level;
   22423     int format; /* is formatting allowed */
   22424     int n_format;
   22425 
   22426     for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
   22427     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
   22428     for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
   22429     for (n_level = 0;n_level < gen_nb_int;n_level++) {
   22430     for (n_format = 0;n_format < gen_nb_int;n_format++) {
   22431         mem_base = xmlMemBlocks();
   22432         buf = gen_xmlBufferPtr(n_buf, 0);
   22433         doc = gen_xmlDocPtr(n_doc, 1);
   22434         cur = gen_xmlNodePtr(n_cur, 2);
   22435         level = gen_int(n_level, 3);
   22436         format = gen_int(n_format, 4);
   22437 
   22438         ret_val = xmlNodeDump(buf, doc, cur, level, format);
   22439         desret_int(ret_val);
   22440         call_tests++;
   22441         des_xmlBufferPtr(n_buf, buf, 0);
   22442         des_xmlDocPtr(n_doc, doc, 1);
   22443         des_xmlNodePtr(n_cur, cur, 2);
   22444         des_int(n_level, level, 3);
   22445         des_int(n_format, format, 4);
   22446         xmlResetLastError();
   22447         if (mem_base != xmlMemBlocks()) {
   22448             printf("Leak of %d blocks found in xmlNodeDump",
   22449 	           xmlMemBlocks() - mem_base);
   22450 	    test_ret++;
   22451             printf(" %d", n_buf);
   22452             printf(" %d", n_doc);
   22453             printf(" %d", n_cur);
   22454             printf(" %d", n_level);
   22455             printf(" %d", n_format);
   22456             printf("\n");
   22457         }
   22458     }
   22459     }
   22460     }
   22461     }
   22462     }
   22463     function_tests++;
   22464 #endif
   22465 
   22466     return(test_ret);
   22467 }
   22468 
   22469 
   22470 static int
   22471 test_xmlNodeDumpOutput(void) {
   22472     int test_ret = 0;
   22473 
   22474 #if defined(LIBXML_OUTPUT_ENABLED)
   22475     int mem_base;
   22476     xmlOutputBufferPtr buf; /* the XML buffer output */
   22477     int n_buf;
   22478     xmlDocPtr doc; /* the document */
   22479     int n_doc;
   22480     xmlNodePtr cur; /* the current node */
   22481     int n_cur;
   22482     int level; /* the imbrication level for indenting */
   22483     int n_level;
   22484     int format; /* is formatting allowed */
   22485     int n_format;
   22486     char * encoding; /* an optional encoding string */
   22487     int n_encoding;
   22488 
   22489     for (n_buf = 0;n_buf < gen_nb_xmlOutputBufferPtr;n_buf++) {
   22490     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
   22491     for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
   22492     for (n_level = 0;n_level < gen_nb_int;n_level++) {
   22493     for (n_format = 0;n_format < gen_nb_int;n_format++) {
   22494     for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
   22495         mem_base = xmlMemBlocks();
   22496         buf = gen_xmlOutputBufferPtr(n_buf, 0);
   22497         doc = gen_xmlDocPtr(n_doc, 1);
   22498         cur = gen_xmlNodePtr(n_cur, 2);
   22499         level = gen_int(n_level, 3);
   22500         format = gen_int(n_format, 4);
   22501         encoding = gen_const_char_ptr(n_encoding, 5);
   22502 
   22503         xmlNodeDumpOutput(buf, doc, cur, level, format, (const char *)encoding);
   22504         call_tests++;
   22505         des_xmlOutputBufferPtr(n_buf, buf, 0);
   22506         des_xmlDocPtr(n_doc, doc, 1);
   22507         des_xmlNodePtr(n_cur, cur, 2);
   22508         des_int(n_level, level, 3);
   22509         des_int(n_format, format, 4);
   22510         des_const_char_ptr(n_encoding, (const char *)encoding, 5);
   22511         xmlResetLastError();
   22512         if (mem_base != xmlMemBlocks()) {
   22513             printf("Leak of %d blocks found in xmlNodeDumpOutput",
   22514 	           xmlMemBlocks() - mem_base);
   22515 	    test_ret++;
   22516             printf(" %d", n_buf);
   22517             printf(" %d", n_doc);
   22518             printf(" %d", n_cur);
   22519             printf(" %d", n_level);
   22520             printf(" %d", n_format);
   22521             printf(" %d", n_encoding);
   22522             printf("\n");
   22523         }
   22524     }
   22525     }
   22526     }
   22527     }
   22528     }
   22529     }
   22530     function_tests++;
   22531 #endif
   22532 
   22533     return(test_ret);
   22534 }
   22535 
   22536 
   22537 static int
   22538 test_xmlNodeGetBase(void) {
   22539     int test_ret = 0;
   22540 
   22541     int mem_base;
   22542     xmlChar * ret_val;
   22543     xmlDoc * doc; /* the document the node pertains to */
   22544     int n_doc;
   22545     xmlNode * cur; /* the node being checked */
   22546     int n_cur;
   22547 
   22548     for (n_doc = 0;n_doc < gen_nb_const_xmlDoc_ptr;n_doc++) {
   22549     for (n_cur = 0;n_cur < gen_nb_const_xmlNode_ptr;n_cur++) {
   22550         mem_base = xmlMemBlocks();
   22551         doc = gen_const_xmlDoc_ptr(n_doc, 0);
   22552         cur = gen_const_xmlNode_ptr(n_cur, 1);
   22553 
   22554         ret_val = xmlNodeGetBase((const xmlDoc *)doc, (const xmlNode *)cur);
   22555         desret_xmlChar_ptr(ret_val);
   22556         call_tests++;
   22557         des_const_xmlDoc_ptr(n_doc, (const xmlDoc *)doc, 0);
   22558         des_const_xmlNode_ptr(n_cur, (const xmlNode *)cur, 1);
   22559         xmlResetLastError();
   22560         if (mem_base != xmlMemBlocks()) {
   22561             printf("Leak of %d blocks found in xmlNodeGetBase",
   22562 	           xmlMemBlocks() - mem_base);
   22563 	    test_ret++;
   22564             printf(" %d", n_doc);
   22565             printf(" %d", n_cur);
   22566             printf("\n");
   22567         }
   22568     }
   22569     }
   22570     function_tests++;
   22571 
   22572     return(test_ret);
   22573 }
   22574 
   22575 
   22576 static int
   22577 test_xmlNodeGetContent(void) {
   22578     int test_ret = 0;
   22579 
   22580     int mem_base;
   22581     xmlChar * ret_val;
   22582     xmlNode * cur; /* the node being read */
   22583     int n_cur;
   22584 
   22585     for (n_cur = 0;n_cur < gen_nb_const_xmlNode_ptr;n_cur++) {
   22586         mem_base = xmlMemBlocks();
   22587         cur = gen_const_xmlNode_ptr(n_cur, 0);
   22588 
   22589         ret_val = xmlNodeGetContent((const xmlNode *)cur);
   22590         desret_xmlChar_ptr(ret_val);
   22591         call_tests++;
   22592         des_const_xmlNode_ptr(n_cur, (const xmlNode *)cur, 0);
   22593         xmlResetLastError();
   22594         if (mem_base != xmlMemBlocks()) {
   22595             printf("Leak of %d blocks found in xmlNodeGetContent",
   22596 	           xmlMemBlocks() - mem_base);
   22597 	    test_ret++;
   22598             printf(" %d", n_cur);
   22599             printf("\n");
   22600         }
   22601     }
   22602     function_tests++;
   22603 
   22604     return(test_ret);
   22605 }
   22606 
   22607 
   22608 static int
   22609 test_xmlNodeGetLang(void) {
   22610     int test_ret = 0;
   22611 
   22612     int mem_base;
   22613     xmlChar * ret_val;
   22614     xmlNode * cur; /* the node being checked */
   22615     int n_cur;
   22616 
   22617     for (n_cur = 0;n_cur < gen_nb_const_xmlNode_ptr;n_cur++) {
   22618         mem_base = xmlMemBlocks();
   22619         cur = gen_const_xmlNode_ptr(n_cur, 0);
   22620 
   22621         ret_val = xmlNodeGetLang((const xmlNode *)cur);
   22622         desret_xmlChar_ptr(ret_val);
   22623         call_tests++;
   22624         des_const_xmlNode_ptr(n_cur, (const xmlNode *)cur, 0);
   22625         xmlResetLastError();
   22626         if (mem_base != xmlMemBlocks()) {
   22627             printf("Leak of %d blocks found in xmlNodeGetLang",
   22628 	           xmlMemBlocks() - mem_base);
   22629 	    test_ret++;
   22630             printf(" %d", n_cur);
   22631             printf("\n");
   22632         }
   22633     }
   22634     function_tests++;
   22635 
   22636     return(test_ret);
   22637 }
   22638 
   22639 
   22640 static int
   22641 test_xmlNodeGetSpacePreserve(void) {
   22642     int test_ret = 0;
   22643 
   22644     int mem_base;
   22645     int ret_val;
   22646     xmlNode * cur; /* the node being checked */
   22647     int n_cur;
   22648 
   22649     for (n_cur = 0;n_cur < gen_nb_const_xmlNode_ptr;n_cur++) {
   22650         mem_base = xmlMemBlocks();
   22651         cur = gen_const_xmlNode_ptr(n_cur, 0);
   22652 
   22653         ret_val = xmlNodeGetSpacePreserve((const xmlNode *)cur);
   22654         desret_int(ret_val);
   22655         call_tests++;
   22656         des_const_xmlNode_ptr(n_cur, (const xmlNode *)cur, 0);
   22657         xmlResetLastError();
   22658         if (mem_base != xmlMemBlocks()) {
   22659             printf("Leak of %d blocks found in xmlNodeGetSpacePreserve",
   22660 	           xmlMemBlocks() - mem_base);
   22661 	    test_ret++;
   22662             printf(" %d", n_cur);
   22663             printf("\n");
   22664         }
   22665     }
   22666     function_tests++;
   22667 
   22668     return(test_ret);
   22669 }
   22670 
   22671 
   22672 static int
   22673 test_xmlNodeIsText(void) {
   22674     int test_ret = 0;
   22675 
   22676     int mem_base;
   22677     int ret_val;
   22678     xmlNode * node; /* the node */
   22679     int n_node;
   22680 
   22681     for (n_node = 0;n_node < gen_nb_const_xmlNode_ptr;n_node++) {
   22682         mem_base = xmlMemBlocks();
   22683         node = gen_const_xmlNode_ptr(n_node, 0);
   22684 
   22685         ret_val = xmlNodeIsText((const xmlNode *)node);
   22686         desret_int(ret_val);
   22687         call_tests++;
   22688         des_const_xmlNode_ptr(n_node, (const xmlNode *)node, 0);
   22689         xmlResetLastError();
   22690         if (mem_base != xmlMemBlocks()) {
   22691             printf("Leak of %d blocks found in xmlNodeIsText",
   22692 	           xmlMemBlocks() - mem_base);
   22693 	    test_ret++;
   22694             printf(" %d", n_node);
   22695             printf("\n");
   22696         }
   22697     }
   22698     function_tests++;
   22699 
   22700     return(test_ret);
   22701 }
   22702 
   22703 
   22704 static int
   22705 test_xmlNodeListGetRawString(void) {
   22706     int test_ret = 0;
   22707 
   22708 #if defined(LIBXML_TREE_ENABLED)
   22709     int mem_base;
   22710     xmlChar * ret_val;
   22711     xmlDoc * doc; /* the document */
   22712     int n_doc;
   22713     xmlNode * list; /* a Node list */
   22714     int n_list;
   22715     int inLine; /* should we replace entity contents or show their external form */
   22716     int n_inLine;
   22717 
   22718     for (n_doc = 0;n_doc < gen_nb_const_xmlDoc_ptr;n_doc++) {
   22719     for (n_list = 0;n_list < gen_nb_const_xmlNode_ptr;n_list++) {
   22720     for (n_inLine = 0;n_inLine < gen_nb_int;n_inLine++) {
   22721         mem_base = xmlMemBlocks();
   22722         doc = gen_const_xmlDoc_ptr(n_doc, 0);
   22723         list = gen_const_xmlNode_ptr(n_list, 1);
   22724         inLine = gen_int(n_inLine, 2);
   22725 
   22726         ret_val = xmlNodeListGetRawString((const xmlDoc *)doc, (const xmlNode *)list, inLine);
   22727         desret_xmlChar_ptr(ret_val);
   22728         call_tests++;
   22729         des_const_xmlDoc_ptr(n_doc, (const xmlDoc *)doc, 0);
   22730         des_const_xmlNode_ptr(n_list, (const xmlNode *)list, 1);
   22731         des_int(n_inLine, inLine, 2);
   22732         xmlResetLastError();
   22733         if (mem_base != xmlMemBlocks()) {
   22734             printf("Leak of %d blocks found in xmlNodeListGetRawString",
   22735 	           xmlMemBlocks() - mem_base);
   22736 	    test_ret++;
   22737             printf(" %d", n_doc);
   22738             printf(" %d", n_list);
   22739             printf(" %d", n_inLine);
   22740             printf("\n");
   22741         }
   22742     }
   22743     }
   22744     }
   22745     function_tests++;
   22746 #endif
   22747 
   22748     return(test_ret);
   22749 }
   22750 
   22751 
   22752 static int
   22753 test_xmlNodeListGetString(void) {
   22754     int test_ret = 0;
   22755 
   22756     int mem_base;
   22757     xmlChar * ret_val;
   22758     xmlDocPtr doc; /* the document */
   22759     int n_doc;
   22760     xmlNode * list; /* a Node list */
   22761     int n_list;
   22762     int inLine; /* should we replace entity contents or show their external form */
   22763     int n_inLine;
   22764 
   22765     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
   22766     for (n_list = 0;n_list < gen_nb_const_xmlNode_ptr;n_list++) {
   22767     for (n_inLine = 0;n_inLine < gen_nb_int;n_inLine++) {
   22768         mem_base = xmlMemBlocks();
   22769         doc = gen_xmlDocPtr(n_doc, 0);
   22770         list = gen_const_xmlNode_ptr(n_list, 1);
   22771         inLine = gen_int(n_inLine, 2);
   22772 
   22773         ret_val = xmlNodeListGetString(doc, (const xmlNode *)list, inLine);
   22774         desret_xmlChar_ptr(ret_val);
   22775         call_tests++;
   22776         des_xmlDocPtr(n_doc, doc, 0);
   22777         des_const_xmlNode_ptr(n_list, (const xmlNode *)list, 1);
   22778         des_int(n_inLine, inLine, 2);
   22779         xmlResetLastError();
   22780         if (mem_base != xmlMemBlocks()) {
   22781             printf("Leak of %d blocks found in xmlNodeListGetString",
   22782 	           xmlMemBlocks() - mem_base);
   22783 	    test_ret++;
   22784             printf(" %d", n_doc);
   22785             printf(" %d", n_list);
   22786             printf(" %d", n_inLine);
   22787             printf("\n");
   22788         }
   22789     }
   22790     }
   22791     }
   22792     function_tests++;
   22793 
   22794     return(test_ret);
   22795 }
   22796 
   22797 
   22798 static int
   22799 test_xmlNodeSetBase(void) {
   22800     int test_ret = 0;
   22801 
   22802 #if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_XINCLUDE_ENABLED)
   22803     int mem_base;
   22804     xmlNodePtr cur; /* the node being changed */
   22805     int n_cur;
   22806     xmlChar * uri; /* the new base URI */
   22807     int n_uri;
   22808 
   22809     for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
   22810     for (n_uri = 0;n_uri < gen_nb_const_xmlChar_ptr;n_uri++) {
   22811         mem_base = xmlMemBlocks();
   22812         cur = gen_xmlNodePtr(n_cur, 0);
   22813         uri = gen_const_xmlChar_ptr(n_uri, 1);
   22814 
   22815         xmlNodeSetBase(cur, (const xmlChar *)uri);
   22816         call_tests++;
   22817         des_xmlNodePtr(n_cur, cur, 0);
   22818         des_const_xmlChar_ptr(n_uri, (const xmlChar *)uri, 1);
   22819         xmlResetLastError();
   22820         if (mem_base != xmlMemBlocks()) {
   22821             printf("Leak of %d blocks found in xmlNodeSetBase",
   22822 	           xmlMemBlocks() - mem_base);
   22823 	    test_ret++;
   22824             printf(" %d", n_cur);
   22825             printf(" %d", n_uri);
   22826             printf("\n");
   22827         }
   22828     }
   22829     }
   22830     function_tests++;
   22831 #endif
   22832 
   22833     return(test_ret);
   22834 }
   22835 
   22836 
   22837 static int
   22838 test_xmlNodeSetContent(void) {
   22839     int test_ret = 0;
   22840 
   22841     int mem_base;
   22842     xmlNodePtr cur; /* the node being modified */
   22843     int n_cur;
   22844     xmlChar * content; /* the new value of the content */
   22845     int n_content;
   22846 
   22847     for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
   22848     for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
   22849         mem_base = xmlMemBlocks();
   22850         cur = gen_xmlNodePtr(n_cur, 0);
   22851         content = gen_const_xmlChar_ptr(n_content, 1);
   22852 
   22853         xmlNodeSetContent(cur, (const xmlChar *)content);
   22854         call_tests++;
   22855         des_xmlNodePtr(n_cur, cur, 0);
   22856         des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 1);
   22857         xmlResetLastError();
   22858         if (mem_base != xmlMemBlocks()) {
   22859             printf("Leak of %d blocks found in xmlNodeSetContent",
   22860 	           xmlMemBlocks() - mem_base);
   22861 	    test_ret++;
   22862             printf(" %d", n_cur);
   22863             printf(" %d", n_content);
   22864             printf("\n");
   22865         }
   22866     }
   22867     }
   22868     function_tests++;
   22869 
   22870     return(test_ret);
   22871 }
   22872 
   22873 
   22874 static int
   22875 test_xmlNodeSetContentLen(void) {
   22876     int test_ret = 0;
   22877 
   22878 #if defined(LIBXML_TREE_ENABLED)
   22879     int mem_base;
   22880     xmlNodePtr cur; /* the node being modified */
   22881     int n_cur;
   22882     xmlChar * content; /* the new value of the content */
   22883     int n_content;
   22884     int len; /* the size of @content */
   22885     int n_len;
   22886 
   22887     for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
   22888     for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
   22889     for (n_len = 0;n_len < gen_nb_int;n_len++) {
   22890         mem_base = xmlMemBlocks();
   22891         cur = gen_xmlNodePtr(n_cur, 0);
   22892         content = gen_const_xmlChar_ptr(n_content, 1);
   22893         len = gen_int(n_len, 2);
   22894         if ((content != NULL) &&
   22895             (len > (int) strlen((const char *) content) + 1))
   22896             continue;
   22897 
   22898         xmlNodeSetContentLen(cur, (const xmlChar *)content, len);
   22899         call_tests++;
   22900         des_xmlNodePtr(n_cur, cur, 0);
   22901         des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 1);
   22902         des_int(n_len, len, 2);
   22903         xmlResetLastError();
   22904         if (mem_base != xmlMemBlocks()) {
   22905             printf("Leak of %d blocks found in xmlNodeSetContentLen",
   22906 	           xmlMemBlocks() - mem_base);
   22907 	    test_ret++;
   22908             printf(" %d", n_cur);
   22909             printf(" %d", n_content);
   22910             printf(" %d", n_len);
   22911             printf("\n");
   22912         }
   22913     }
   22914     }
   22915     }
   22916     function_tests++;
   22917 #endif
   22918 
   22919     return(test_ret);
   22920 }
   22921 
   22922 
   22923 static int
   22924 test_xmlNodeSetLang(void) {
   22925     int test_ret = 0;
   22926 
   22927 #if defined(LIBXML_TREE_ENABLED)
   22928     int mem_base;
   22929     xmlNodePtr cur; /* the node being changed */
   22930     int n_cur;
   22931     xmlChar * lang; /* the language description */
   22932     int n_lang;
   22933 
   22934     for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
   22935     for (n_lang = 0;n_lang < gen_nb_const_xmlChar_ptr;n_lang++) {
   22936         mem_base = xmlMemBlocks();
   22937         cur = gen_xmlNodePtr(n_cur, 0);
   22938         lang = gen_const_xmlChar_ptr(n_lang, 1);
   22939 
   22940         xmlNodeSetLang(cur, (const xmlChar *)lang);
   22941         call_tests++;
   22942         des_xmlNodePtr(n_cur, cur, 0);
   22943         des_const_xmlChar_ptr(n_lang, (const xmlChar *)lang, 1);
   22944         xmlResetLastError();
   22945         if (mem_base != xmlMemBlocks()) {
   22946             printf("Leak of %d blocks found in xmlNodeSetLang",
   22947 	           xmlMemBlocks() - mem_base);
   22948 	    test_ret++;
   22949             printf(" %d", n_cur);
   22950             printf(" %d", n_lang);
   22951             printf("\n");
   22952         }
   22953     }
   22954     }
   22955     function_tests++;
   22956 #endif
   22957 
   22958     return(test_ret);
   22959 }
   22960 
   22961 
   22962 static int
   22963 test_xmlNodeSetName(void) {
   22964     int test_ret = 0;
   22965 
   22966 #if defined(LIBXML_TREE_ENABLED)
   22967     int mem_base;
   22968     xmlNodePtr cur; /* the node being changed */
   22969     int n_cur;
   22970     xmlChar * name; /* the new tag name */
   22971     int n_name;
   22972 
   22973     for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
   22974     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
   22975         mem_base = xmlMemBlocks();
   22976         cur = gen_xmlNodePtr(n_cur, 0);
   22977         name = gen_const_xmlChar_ptr(n_name, 1);
   22978 
   22979         xmlNodeSetName(cur, (const xmlChar *)name);
   22980         call_tests++;
   22981         des_xmlNodePtr(n_cur, cur, 0);
   22982         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
   22983         xmlResetLastError();
   22984         if (mem_base != xmlMemBlocks()) {
   22985             printf("Leak of %d blocks found in xmlNodeSetName",
   22986 	           xmlMemBlocks() - mem_base);
   22987 	    test_ret++;
   22988             printf(" %d", n_cur);
   22989             printf(" %d", n_name);
   22990             printf("\n");
   22991         }
   22992     }
   22993     }
   22994     function_tests++;
   22995 #endif
   22996 
   22997     return(test_ret);
   22998 }
   22999 
   23000 
   23001 static int
   23002 test_xmlNodeSetSpacePreserve(void) {
   23003     int test_ret = 0;
   23004 
   23005 #if defined(LIBXML_TREE_ENABLED)
   23006     int mem_base;
   23007     xmlNodePtr cur; /* the node being changed */
   23008     int n_cur;
   23009     int val; /* the xml:space value ("0": default, 1: "preserve") */
   23010     int n_val;
   23011 
   23012     for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
   23013     for (n_val = 0;n_val < gen_nb_int;n_val++) {
   23014         mem_base = xmlMemBlocks();
   23015         cur = gen_xmlNodePtr(n_cur, 0);
   23016         val = gen_int(n_val, 1);
   23017 
   23018         xmlNodeSetSpacePreserve(cur, val);
   23019         call_tests++;
   23020         des_xmlNodePtr(n_cur, cur, 0);
   23021         des_int(n_val, val, 1);
   23022         xmlResetLastError();
   23023         if (mem_base != xmlMemBlocks()) {
   23024             printf("Leak of %d blocks found in xmlNodeSetSpacePreserve",
   23025 	           xmlMemBlocks() - mem_base);
   23026 	    test_ret++;
   23027             printf(" %d", n_cur);
   23028             printf(" %d", n_val);
   23029             printf("\n");
   23030         }
   23031     }
   23032     }
   23033     function_tests++;
   23034 #endif
   23035 
   23036     return(test_ret);
   23037 }
   23038 
   23039 
   23040 static int
   23041 test_xmlPreviousElementSibling(void) {
   23042     int test_ret = 0;
   23043 
   23044 #if defined(LIBXML_TREE_ENABLED)
   23045     int mem_base;
   23046     xmlNodePtr ret_val;
   23047     xmlNodePtr node; /* the current node */
   23048     int n_node;
   23049 
   23050     for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
   23051         mem_base = xmlMemBlocks();
   23052         node = gen_xmlNodePtr(n_node, 0);
   23053 
   23054         ret_val = xmlPreviousElementSibling(node);
   23055         desret_xmlNodePtr(ret_val);
   23056         call_tests++;
   23057         des_xmlNodePtr(n_node, node, 0);
   23058         xmlResetLastError();
   23059         if (mem_base != xmlMemBlocks()) {
   23060             printf("Leak of %d blocks found in xmlPreviousElementSibling",
   23061 	           xmlMemBlocks() - mem_base);
   23062 	    test_ret++;
   23063             printf(" %d", n_node);
   23064             printf("\n");
   23065         }
   23066     }
   23067     function_tests++;
   23068 #endif
   23069 
   23070     return(test_ret);
   23071 }
   23072 
   23073 
   23074 static int
   23075 test_xmlReconciliateNs(void) {
   23076     int test_ret = 0;
   23077 
   23078 #if defined(LIBXML_TREE_ENABLED)
   23079 #ifdef LIBXML_TREE_ENABLED
   23080     int mem_base;
   23081     int ret_val;
   23082     xmlDocPtr doc; /* the document */
   23083     int n_doc;
   23084     xmlNodePtr tree; /* a node defining the subtree to reconciliate */
   23085     int n_tree;
   23086 
   23087     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
   23088     for (n_tree = 0;n_tree < gen_nb_xmlNodePtr;n_tree++) {
   23089         mem_base = xmlMemBlocks();
   23090         doc = gen_xmlDocPtr(n_doc, 0);
   23091         tree = gen_xmlNodePtr(n_tree, 1);
   23092 
   23093         ret_val = xmlReconciliateNs(doc, tree);
   23094         desret_int(ret_val);
   23095         call_tests++;
   23096         des_xmlDocPtr(n_doc, doc, 0);
   23097         des_xmlNodePtr(n_tree, tree, 1);
   23098         xmlResetLastError();
   23099         if (mem_base != xmlMemBlocks()) {
   23100             printf("Leak of %d blocks found in xmlReconciliateNs",
   23101 	           xmlMemBlocks() - mem_base);
   23102 	    test_ret++;
   23103             printf(" %d", n_doc);
   23104             printf(" %d", n_tree);
   23105             printf("\n");
   23106         }
   23107     }
   23108     }
   23109     function_tests++;
   23110 #endif
   23111 #endif
   23112 
   23113     return(test_ret);
   23114 }
   23115 
   23116 
   23117 static int
   23118 test_xmlRemoveProp(void) {
   23119     int test_ret = 0;
   23120 
   23121     int mem_base;
   23122     int ret_val;
   23123     xmlAttrPtr cur; /* an attribute */
   23124     int n_cur;
   23125 
   23126     for (n_cur = 0;n_cur < gen_nb_xmlAttrPtr;n_cur++) {
   23127         mem_base = xmlMemBlocks();
   23128         cur = gen_xmlAttrPtr(n_cur, 0);
   23129 
   23130         ret_val = xmlRemoveProp(cur);
   23131         cur = NULL;
   23132         desret_int(ret_val);
   23133         call_tests++;
   23134         des_xmlAttrPtr(n_cur, cur, 0);
   23135         xmlResetLastError();
   23136         if (mem_base != xmlMemBlocks()) {
   23137             printf("Leak of %d blocks found in xmlRemoveProp",
   23138 	           xmlMemBlocks() - mem_base);
   23139 	    test_ret++;
   23140             printf(" %d", n_cur);
   23141             printf("\n");
   23142         }
   23143     }
   23144     function_tests++;
   23145 
   23146     return(test_ret);
   23147 }
   23148 
   23149 
   23150 static int
   23151 test_xmlReplaceNode(void) {
   23152     int test_ret = 0;
   23153 
   23154 #if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_WRITER_ENABLED)
   23155     int mem_base;
   23156     xmlNodePtr ret_val;
   23157     xmlNodePtr old; /* the old node */
   23158     int n_old;
   23159     xmlNodePtr cur; /* the node */
   23160     int n_cur;
   23161 
   23162     for (n_old = 0;n_old < gen_nb_xmlNodePtr;n_old++) {
   23163     for (n_cur = 0;n_cur < gen_nb_xmlNodePtr_in;n_cur++) {
   23164         mem_base = xmlMemBlocks();
   23165         old = gen_xmlNodePtr(n_old, 0);
   23166         cur = gen_xmlNodePtr_in(n_cur, 1);
   23167 
   23168         ret_val = xmlReplaceNode(old, cur);
   23169         if (cur != NULL) {
   23170               xmlUnlinkNode(cur);
   23171               xmlFreeNode(cur) ; cur = NULL ; }
   23172           if (old != NULL) {
   23173               xmlUnlinkNode(old);
   23174               xmlFreeNode(old) ; old = NULL ; }
   23175 	  ret_val = NULL;
   23176         desret_xmlNodePtr(ret_val);
   23177         call_tests++;
   23178         des_xmlNodePtr(n_old, old, 0);
   23179         des_xmlNodePtr_in(n_cur, cur, 1);
   23180         xmlResetLastError();
   23181         if (mem_base != xmlMemBlocks()) {
   23182             printf("Leak of %d blocks found in xmlReplaceNode",
   23183 	           xmlMemBlocks() - mem_base);
   23184 	    test_ret++;
   23185             printf(" %d", n_old);
   23186             printf(" %d", n_cur);
   23187             printf("\n");
   23188         }
   23189     }
   23190     }
   23191     function_tests++;
   23192 #endif
   23193 
   23194     return(test_ret);
   23195 }
   23196 
   23197 
   23198 static int
   23199 test_xmlSaveFile(void) {
   23200     int test_ret = 0;
   23201 
   23202 #if defined(LIBXML_OUTPUT_ENABLED)
   23203     int mem_base;
   23204     int ret_val;
   23205     const char * filename; /* the filename (or URL) */
   23206     int n_filename;
   23207     xmlDocPtr cur; /* the document */
   23208     int n_cur;
   23209 
   23210     for (n_filename = 0;n_filename < gen_nb_fileoutput;n_filename++) {
   23211     for (n_cur = 0;n_cur < gen_nb_xmlDocPtr;n_cur++) {
   23212         mem_base = xmlMemBlocks();
   23213         filename = gen_fileoutput(n_filename, 0);
   23214         cur = gen_xmlDocPtr(n_cur, 1);
   23215 
   23216         ret_val = xmlSaveFile(filename, cur);
   23217         desret_int(ret_val);
   23218         call_tests++;
   23219         des_fileoutput(n_filename, filename, 0);
   23220         des_xmlDocPtr(n_cur, cur, 1);
   23221         xmlResetLastError();
   23222         if (mem_base != xmlMemBlocks()) {
   23223             printf("Leak of %d blocks found in xmlSaveFile",
   23224 	           xmlMemBlocks() - mem_base);
   23225 	    test_ret++;
   23226             printf(" %d", n_filename);
   23227             printf(" %d", n_cur);
   23228             printf("\n");
   23229         }
   23230     }
   23231     }
   23232     function_tests++;
   23233 #endif
   23234 
   23235     return(test_ret);
   23236 }
   23237 
   23238 
   23239 static int
   23240 test_xmlSaveFileEnc(void) {
   23241     int test_ret = 0;
   23242 
   23243 #if defined(LIBXML_OUTPUT_ENABLED)
   23244     int mem_base;
   23245     int ret_val;
   23246     const char * filename; /* the filename (or URL) */
   23247     int n_filename;
   23248     xmlDocPtr cur; /* the document */
   23249     int n_cur;
   23250     char * encoding; /* the name of an encoding (or NULL) */
   23251     int n_encoding;
   23252 
   23253     for (n_filename = 0;n_filename < gen_nb_fileoutput;n_filename++) {
   23254     for (n_cur = 0;n_cur < gen_nb_xmlDocPtr;n_cur++) {
   23255     for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
   23256         mem_base = xmlMemBlocks();
   23257         filename = gen_fileoutput(n_filename, 0);
   23258         cur = gen_xmlDocPtr(n_cur, 1);
   23259         encoding = gen_const_char_ptr(n_encoding, 2);
   23260 
   23261         ret_val = xmlSaveFileEnc(filename, cur, (const char *)encoding);
   23262         desret_int(ret_val);
   23263         call_tests++;
   23264         des_fileoutput(n_filename, filename, 0);
   23265         des_xmlDocPtr(n_cur, cur, 1);
   23266         des_const_char_ptr(n_encoding, (const char *)encoding, 2);
   23267         xmlResetLastError();
   23268         if (mem_base != xmlMemBlocks()) {
   23269             printf("Leak of %d blocks found in xmlSaveFileEnc",
   23270 	           xmlMemBlocks() - mem_base);
   23271 	    test_ret++;
   23272             printf(" %d", n_filename);
   23273             printf(" %d", n_cur);
   23274             printf(" %d", n_encoding);
   23275             printf("\n");
   23276         }
   23277     }
   23278     }
   23279     }
   23280     function_tests++;
   23281 #endif
   23282 
   23283     return(test_ret);
   23284 }
   23285 
   23286 
   23287 static int
   23288 test_xmlSaveFileTo(void) {
   23289     int test_ret = 0;
   23290 
   23291 #if defined(LIBXML_OUTPUT_ENABLED)
   23292     int mem_base;
   23293     int ret_val;
   23294     xmlOutputBufferPtr buf; /* an output I/O buffer */
   23295     int n_buf;
   23296     xmlDocPtr cur; /* the document */
   23297     int n_cur;
   23298     char * encoding; /* the encoding if any assuming the I/O layer handles the trancoding */
   23299     int n_encoding;
   23300 
   23301     for (n_buf = 0;n_buf < gen_nb_xmlOutputBufferPtr;n_buf++) {
   23302     for (n_cur = 0;n_cur < gen_nb_xmlDocPtr;n_cur++) {
   23303     for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
   23304         mem_base = xmlMemBlocks();
   23305         buf = gen_xmlOutputBufferPtr(n_buf, 0);
   23306         cur = gen_xmlDocPtr(n_cur, 1);
   23307         encoding = gen_const_char_ptr(n_encoding, 2);
   23308 
   23309         ret_val = xmlSaveFileTo(buf, cur, (const char *)encoding);
   23310         buf = NULL;
   23311         desret_int(ret_val);
   23312         call_tests++;
   23313         des_xmlOutputBufferPtr(n_buf, buf, 0);
   23314         des_xmlDocPtr(n_cur, cur, 1);
   23315         des_const_char_ptr(n_encoding, (const char *)encoding, 2);
   23316         xmlResetLastError();
   23317         if (mem_base != xmlMemBlocks()) {
   23318             printf("Leak of %d blocks found in xmlSaveFileTo",
   23319 	           xmlMemBlocks() - mem_base);
   23320 	    test_ret++;
   23321             printf(" %d", n_buf);
   23322             printf(" %d", n_cur);
   23323             printf(" %d", n_encoding);
   23324             printf("\n");
   23325         }
   23326     }
   23327     }
   23328     }
   23329     function_tests++;
   23330 #endif
   23331 
   23332     return(test_ret);
   23333 }
   23334 
   23335 
   23336 static int
   23337 test_xmlSaveFormatFile(void) {
   23338     int test_ret = 0;
   23339 
   23340 #if defined(LIBXML_OUTPUT_ENABLED)
   23341     int mem_base;
   23342     int ret_val;
   23343     const char * filename; /* the filename (or URL) */
   23344     int n_filename;
   23345     xmlDocPtr cur; /* the document */
   23346     int n_cur;
   23347     int format; /* should formatting spaces been added */
   23348     int n_format;
   23349 
   23350     for (n_filename = 0;n_filename < gen_nb_fileoutput;n_filename++) {
   23351     for (n_cur = 0;n_cur < gen_nb_xmlDocPtr;n_cur++) {
   23352     for (n_format = 0;n_format < gen_nb_int;n_format++) {
   23353         mem_base = xmlMemBlocks();
   23354         filename = gen_fileoutput(n_filename, 0);
   23355         cur = gen_xmlDocPtr(n_cur, 1);
   23356         format = gen_int(n_format, 2);
   23357 
   23358         ret_val = xmlSaveFormatFile(filename, cur, format);
   23359         desret_int(ret_val);
   23360         call_tests++;
   23361         des_fileoutput(n_filename, filename, 0);
   23362         des_xmlDocPtr(n_cur, cur, 1);
   23363         des_int(n_format, format, 2);
   23364         xmlResetLastError();
   23365         if (mem_base != xmlMemBlocks()) {
   23366             printf("Leak of %d blocks found in xmlSaveFormatFile",
   23367 	           xmlMemBlocks() - mem_base);
   23368 	    test_ret++;
   23369             printf(" %d", n_filename);
   23370             printf(" %d", n_cur);
   23371             printf(" %d", n_format);
   23372             printf("\n");
   23373         }
   23374     }
   23375     }
   23376     }
   23377     function_tests++;
   23378 #endif
   23379 
   23380     return(test_ret);
   23381 }
   23382 
   23383 
   23384 static int
   23385 test_xmlSaveFormatFileEnc(void) {
   23386     int test_ret = 0;
   23387 
   23388 #if defined(LIBXML_OUTPUT_ENABLED)
   23389     int mem_base;
   23390     int ret_val;
   23391     const char * filename; /* the filename or URL to output */
   23392     int n_filename;
   23393     xmlDocPtr cur; /* the document being saved */
   23394     int n_cur;
   23395     char * encoding; /* the name of the encoding to use or NULL. */
   23396     int n_encoding;
   23397     int format; /* should formatting spaces be added. */
   23398     int n_format;
   23399 
   23400     for (n_filename = 0;n_filename < gen_nb_fileoutput;n_filename++) {
   23401     for (n_cur = 0;n_cur < gen_nb_xmlDocPtr;n_cur++) {
   23402     for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
   23403     for (n_format = 0;n_format < gen_nb_int;n_format++) {
   23404         mem_base = xmlMemBlocks();
   23405         filename = gen_fileoutput(n_filename, 0);
   23406         cur = gen_xmlDocPtr(n_cur, 1);
   23407         encoding = gen_const_char_ptr(n_encoding, 2);
   23408         format = gen_int(n_format, 3);
   23409 
   23410         ret_val = xmlSaveFormatFileEnc(filename, cur, (const char *)encoding, format);
   23411         desret_int(ret_val);
   23412         call_tests++;
   23413         des_fileoutput(n_filename, filename, 0);
   23414         des_xmlDocPtr(n_cur, cur, 1);
   23415         des_const_char_ptr(n_encoding, (const char *)encoding, 2);
   23416         des_int(n_format, format, 3);
   23417         xmlResetLastError();
   23418         if (mem_base != xmlMemBlocks()) {
   23419             printf("Leak of %d blocks found in xmlSaveFormatFileEnc",
   23420 	           xmlMemBlocks() - mem_base);
   23421 	    test_ret++;
   23422             printf(" %d", n_filename);
   23423             printf(" %d", n_cur);
   23424             printf(" %d", n_encoding);
   23425             printf(" %d", n_format);
   23426             printf("\n");
   23427         }
   23428     }
   23429     }
   23430     }
   23431     }
   23432     function_tests++;
   23433 #endif
   23434 
   23435     return(test_ret);
   23436 }
   23437 
   23438 
   23439 static int
   23440 test_xmlSaveFormatFileTo(void) {
   23441     int test_ret = 0;
   23442 
   23443 #if defined(LIBXML_OUTPUT_ENABLED)
   23444     int mem_base;
   23445     int ret_val;
   23446     xmlOutputBufferPtr buf; /* an output I/O buffer */
   23447     int n_buf;
   23448     xmlDocPtr cur; /* the document */
   23449     int n_cur;
   23450     char * encoding; /* the encoding if any assuming the I/O layer handles the trancoding */
   23451     int n_encoding;
   23452     int format; /* should formatting spaces been added */
   23453     int n_format;
   23454 
   23455     for (n_buf = 0;n_buf < gen_nb_xmlOutputBufferPtr;n_buf++) {
   23456     for (n_cur = 0;n_cur < gen_nb_xmlDocPtr;n_cur++) {
   23457     for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
   23458     for (n_format = 0;n_format < gen_nb_int;n_format++) {
   23459         mem_base = xmlMemBlocks();
   23460         buf = gen_xmlOutputBufferPtr(n_buf, 0);
   23461         cur = gen_xmlDocPtr(n_cur, 1);
   23462         encoding = gen_const_char_ptr(n_encoding, 2);
   23463         format = gen_int(n_format, 3);
   23464 
   23465         ret_val = xmlSaveFormatFileTo(buf, cur, (const char *)encoding, format);
   23466         buf = NULL;
   23467         desret_int(ret_val);
   23468         call_tests++;
   23469         des_xmlOutputBufferPtr(n_buf, buf, 0);
   23470         des_xmlDocPtr(n_cur, cur, 1);
   23471         des_const_char_ptr(n_encoding, (const char *)encoding, 2);
   23472         des_int(n_format, format, 3);
   23473         xmlResetLastError();
   23474         if (mem_base != xmlMemBlocks()) {
   23475             printf("Leak of %d blocks found in xmlSaveFormatFileTo",
   23476 	           xmlMemBlocks() - mem_base);
   23477 	    test_ret++;
   23478             printf(" %d", n_buf);
   23479             printf(" %d", n_cur);
   23480             printf(" %d", n_encoding);
   23481             printf(" %d", n_format);
   23482             printf("\n");
   23483         }
   23484     }
   23485     }
   23486     }
   23487     }
   23488     function_tests++;
   23489 #endif
   23490 
   23491     return(test_ret);
   23492 }
   23493 
   23494 
   23495 static int
   23496 test_xmlSearchNs(void) {
   23497     int test_ret = 0;
   23498 
   23499     int mem_base;
   23500     xmlNsPtr ret_val;
   23501     xmlDocPtr doc; /* the document */
   23502     int n_doc;
   23503     xmlNodePtr node; /* the current node */
   23504     int n_node;
   23505     xmlChar * nameSpace; /* the namespace prefix */
   23506     int n_nameSpace;
   23507 
   23508     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
   23509     for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
   23510     for (n_nameSpace = 0;n_nameSpace < gen_nb_const_xmlChar_ptr;n_nameSpace++) {
   23511         mem_base = xmlMemBlocks();
   23512         doc = gen_xmlDocPtr(n_doc, 0);
   23513         node = gen_xmlNodePtr(n_node, 1);
   23514         nameSpace = gen_const_xmlChar_ptr(n_nameSpace, 2);
   23515 
   23516         ret_val = xmlSearchNs(doc, node, (const xmlChar *)nameSpace);
   23517         desret_xmlNsPtr(ret_val);
   23518         call_tests++;
   23519         des_xmlDocPtr(n_doc, doc, 0);
   23520         des_xmlNodePtr(n_node, node, 1);
   23521         des_const_xmlChar_ptr(n_nameSpace, (const xmlChar *)nameSpace, 2);
   23522         xmlResetLastError();
   23523         if (mem_base != xmlMemBlocks()) {
   23524             printf("Leak of %d blocks found in xmlSearchNs",
   23525 	           xmlMemBlocks() - mem_base);
   23526 	    test_ret++;
   23527             printf(" %d", n_doc);
   23528             printf(" %d", n_node);
   23529             printf(" %d", n_nameSpace);
   23530             printf("\n");
   23531         }
   23532     }
   23533     }
   23534     }
   23535     function_tests++;
   23536 
   23537     return(test_ret);
   23538 }
   23539 
   23540 
   23541 static int
   23542 test_xmlSearchNsByHref(void) {
   23543     int test_ret = 0;
   23544 
   23545     int mem_base;
   23546     xmlNsPtr ret_val;
   23547     xmlDocPtr doc; /* the document */
   23548     int n_doc;
   23549     xmlNodePtr node; /* the current node */
   23550     int n_node;
   23551     xmlChar * href; /* the namespace value */
   23552     int n_href;
   23553 
   23554     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
   23555     for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
   23556     for (n_href = 0;n_href < gen_nb_const_xmlChar_ptr;n_href++) {
   23557         mem_base = xmlMemBlocks();
   23558         doc = gen_xmlDocPtr(n_doc, 0);
   23559         node = gen_xmlNodePtr(n_node, 1);
   23560         href = gen_const_xmlChar_ptr(n_href, 2);
   23561 
   23562         ret_val = xmlSearchNsByHref(doc, node, (const xmlChar *)href);
   23563         desret_xmlNsPtr(ret_val);
   23564         call_tests++;
   23565         des_xmlDocPtr(n_doc, doc, 0);
   23566         des_xmlNodePtr(n_node, node, 1);
   23567         des_const_xmlChar_ptr(n_href, (const xmlChar *)href, 2);
   23568         xmlResetLastError();
   23569         if (mem_base != xmlMemBlocks()) {
   23570             printf("Leak of %d blocks found in xmlSearchNsByHref",
   23571 	           xmlMemBlocks() - mem_base);
   23572 	    test_ret++;
   23573             printf(" %d", n_doc);
   23574             printf(" %d", n_node);
   23575             printf(" %d", n_href);
   23576             printf("\n");
   23577         }
   23578     }
   23579     }
   23580     }
   23581     function_tests++;
   23582 
   23583     return(test_ret);
   23584 }
   23585 
   23586 
   23587 static int
   23588 test_xmlSetBufferAllocationScheme(void) {
   23589     int test_ret = 0;
   23590 
   23591     int mem_base;
   23592     xmlBufferAllocationScheme scheme; /* allocation method to use */
   23593     int n_scheme;
   23594 
   23595     for (n_scheme = 0;n_scheme < gen_nb_xmlBufferAllocationScheme;n_scheme++) {
   23596         mem_base = xmlMemBlocks();
   23597         scheme = gen_xmlBufferAllocationScheme(n_scheme, 0);
   23598 
   23599         xmlSetBufferAllocationScheme(scheme);
   23600         call_tests++;
   23601         des_xmlBufferAllocationScheme(n_scheme, scheme, 0);
   23602         xmlResetLastError();
   23603         if (mem_base != xmlMemBlocks()) {
   23604             printf("Leak of %d blocks found in xmlSetBufferAllocationScheme",
   23605 	           xmlMemBlocks() - mem_base);
   23606 	    test_ret++;
   23607             printf(" %d", n_scheme);
   23608             printf("\n");
   23609         }
   23610     }
   23611     function_tests++;
   23612 
   23613     return(test_ret);
   23614 }
   23615 
   23616 
   23617 static int
   23618 test_xmlSetCompressMode(void) {
   23619     int test_ret = 0;
   23620 
   23621     int mem_base;
   23622     int mode; /* the compression ratio */
   23623     int n_mode;
   23624 
   23625     for (n_mode = 0;n_mode < gen_nb_int;n_mode++) {
   23626         mem_base = xmlMemBlocks();
   23627         mode = gen_int(n_mode, 0);
   23628 
   23629         xmlSetCompressMode(mode);
   23630         call_tests++;
   23631         des_int(n_mode, mode, 0);
   23632         xmlResetLastError();
   23633         if (mem_base != xmlMemBlocks()) {
   23634             printf("Leak of %d blocks found in xmlSetCompressMode",
   23635 	           xmlMemBlocks() - mem_base);
   23636 	    test_ret++;
   23637             printf(" %d", n_mode);
   23638             printf("\n");
   23639         }
   23640     }
   23641     function_tests++;
   23642 
   23643     return(test_ret);
   23644 }
   23645 
   23646 
   23647 static int
   23648 test_xmlSetDocCompressMode(void) {
   23649     int test_ret = 0;
   23650 
   23651     int mem_base;
   23652     xmlDocPtr doc; /* the document */
   23653     int n_doc;
   23654     int mode; /* the compression ratio */
   23655     int n_mode;
   23656 
   23657     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
   23658     for (n_mode = 0;n_mode < gen_nb_int;n_mode++) {
   23659         mem_base = xmlMemBlocks();
   23660         doc = gen_xmlDocPtr(n_doc, 0);
   23661         mode = gen_int(n_mode, 1);
   23662 
   23663         xmlSetDocCompressMode(doc, mode);
   23664         call_tests++;
   23665         des_xmlDocPtr(n_doc, doc, 0);
   23666         des_int(n_mode, mode, 1);
   23667         xmlResetLastError();
   23668         if (mem_base != xmlMemBlocks()) {
   23669             printf("Leak of %d blocks found in xmlSetDocCompressMode",
   23670 	           xmlMemBlocks() - mem_base);
   23671 	    test_ret++;
   23672             printf(" %d", n_doc);
   23673             printf(" %d", n_mode);
   23674             printf("\n");
   23675         }
   23676     }
   23677     }
   23678     function_tests++;
   23679 
   23680     return(test_ret);
   23681 }
   23682 
   23683 
   23684 static int
   23685 test_xmlSetNs(void) {
   23686     int test_ret = 0;
   23687 
   23688     int mem_base;
   23689     xmlNodePtr node; /* a node in the document */
   23690     int n_node;
   23691     xmlNsPtr ns; /* a namespace pointer */
   23692     int n_ns;
   23693 
   23694     for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
   23695     for (n_ns = 0;n_ns < gen_nb_xmlNsPtr;n_ns++) {
   23696         mem_base = xmlMemBlocks();
   23697         node = gen_xmlNodePtr(n_node, 0);
   23698         ns = gen_xmlNsPtr(n_ns, 1);
   23699 
   23700         xmlSetNs(node, ns);
   23701         call_tests++;
   23702         des_xmlNodePtr(n_node, node, 0);
   23703         des_xmlNsPtr(n_ns, ns, 1);
   23704         xmlResetLastError();
   23705         if (mem_base != xmlMemBlocks()) {
   23706             printf("Leak of %d blocks found in xmlSetNs",
   23707 	           xmlMemBlocks() - mem_base);
   23708 	    test_ret++;
   23709             printf(" %d", n_node);
   23710             printf(" %d", n_ns);
   23711             printf("\n");
   23712         }
   23713     }
   23714     }
   23715     function_tests++;
   23716 
   23717     return(test_ret);
   23718 }
   23719 
   23720 
   23721 static int
   23722 test_xmlSetNsProp(void) {
   23723     int test_ret = 0;
   23724 
   23725 #if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_XINCLUDE_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED) || defined(LIBXML_HTML_ENABLED)
   23726     int mem_base;
   23727     xmlAttrPtr ret_val;
   23728     xmlNodePtr node; /* the node */
   23729     int n_node;
   23730     xmlNsPtr ns; /* the namespace definition */
   23731     int n_ns;
   23732     xmlChar * name; /* the attribute name */
   23733     int n_name;
   23734     xmlChar * value; /* the attribute value */
   23735     int n_value;
   23736 
   23737     for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
   23738     for (n_ns = 0;n_ns < gen_nb_xmlNsPtr;n_ns++) {
   23739     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
   23740     for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
   23741         mem_base = xmlMemBlocks();
   23742         node = gen_xmlNodePtr(n_node, 0);
   23743         ns = gen_xmlNsPtr(n_ns, 1);
   23744         name = gen_const_xmlChar_ptr(n_name, 2);
   23745         value = gen_const_xmlChar_ptr(n_value, 3);
   23746 
   23747         ret_val = xmlSetNsProp(node, ns, (const xmlChar *)name, (const xmlChar *)value);
   23748         desret_xmlAttrPtr(ret_val);
   23749         call_tests++;
   23750         des_xmlNodePtr(n_node, node, 0);
   23751         des_xmlNsPtr(n_ns, ns, 1);
   23752         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 2);
   23753         des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 3);
   23754         xmlResetLastError();
   23755         if (mem_base != xmlMemBlocks()) {
   23756             printf("Leak of %d blocks found in xmlSetNsProp",
   23757 	           xmlMemBlocks() - mem_base);
   23758 	    test_ret++;
   23759             printf(" %d", n_node);
   23760             printf(" %d", n_ns);
   23761             printf(" %d", n_name);
   23762             printf(" %d", n_value);
   23763             printf("\n");
   23764         }
   23765     }
   23766     }
   23767     }
   23768     }
   23769     function_tests++;
   23770 #endif
   23771 
   23772     return(test_ret);
   23773 }
   23774 
   23775 
   23776 static int
   23777 test_xmlSetProp(void) {
   23778     int test_ret = 0;
   23779 
   23780 #if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_XINCLUDE_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED) || defined(LIBXML_HTML_ENABLED)
   23781     int mem_base;
   23782     xmlAttrPtr ret_val;
   23783     xmlNodePtr node; /* the node */
   23784     int n_node;
   23785     xmlChar * name; /* the attribute name (a QName) */
   23786     int n_name;
   23787     xmlChar * value; /* the attribute value */
   23788     int n_value;
   23789 
   23790     for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
   23791     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
   23792     for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
   23793         mem_base = xmlMemBlocks();
   23794         node = gen_xmlNodePtr(n_node, 0);
   23795         name = gen_const_xmlChar_ptr(n_name, 1);
   23796         value = gen_const_xmlChar_ptr(n_value, 2);
   23797 
   23798         ret_val = xmlSetProp(node, (const xmlChar *)name, (const xmlChar *)value);
   23799         desret_xmlAttrPtr(ret_val);
   23800         call_tests++;
   23801         des_xmlNodePtr(n_node, node, 0);
   23802         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
   23803         des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 2);
   23804         xmlResetLastError();
   23805         if (mem_base != xmlMemBlocks()) {
   23806             printf("Leak of %d blocks found in xmlSetProp",
   23807 	           xmlMemBlocks() - mem_base);
   23808 	    test_ret++;
   23809             printf(" %d", n_node);
   23810             printf(" %d", n_name);
   23811             printf(" %d", n_value);
   23812             printf("\n");
   23813         }
   23814     }
   23815     }
   23816     }
   23817     function_tests++;
   23818 #endif
   23819 
   23820     return(test_ret);
   23821 }
   23822 
   23823 
   23824 static int
   23825 test_xmlSplitQName2(void) {
   23826     int test_ret = 0;
   23827 
   23828     int mem_base;
   23829     xmlChar * ret_val;
   23830     xmlChar * name; /* the full QName */
   23831     int n_name;
   23832     xmlChar ** prefix; /* a xmlChar ** */
   23833     int n_prefix;
   23834 
   23835     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
   23836     for (n_prefix = 0;n_prefix < gen_nb_xmlChar_ptr_ptr;n_prefix++) {
   23837         mem_base = xmlMemBlocks();
   23838         name = gen_const_xmlChar_ptr(n_name, 0);
   23839         prefix = gen_xmlChar_ptr_ptr(n_prefix, 1);
   23840 
   23841         ret_val = xmlSplitQName2((const xmlChar *)name, prefix);
   23842         desret_xmlChar_ptr(ret_val);
   23843         call_tests++;
   23844         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 0);
   23845         des_xmlChar_ptr_ptr(n_prefix, prefix, 1);
   23846         xmlResetLastError();
   23847         if (mem_base != xmlMemBlocks()) {
   23848             printf("Leak of %d blocks found in xmlSplitQName2",
   23849 	           xmlMemBlocks() - mem_base);
   23850 	    test_ret++;
   23851             printf(" %d", n_name);
   23852             printf(" %d", n_prefix);
   23853             printf("\n");
   23854         }
   23855     }
   23856     }
   23857     function_tests++;
   23858 
   23859     return(test_ret);
   23860 }
   23861 
   23862 
   23863 static int
   23864 test_xmlSplitQName3(void) {
   23865     int test_ret = 0;
   23866 
   23867     int mem_base;
   23868     const xmlChar * ret_val;
   23869     xmlChar * name; /* the full QName */
   23870     int n_name;
   23871     int * len; /* an int * */
   23872     int n_len;
   23873 
   23874     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
   23875     for (n_len = 0;n_len < gen_nb_int_ptr;n_len++) {
   23876         mem_base = xmlMemBlocks();
   23877         name = gen_const_xmlChar_ptr(n_name, 0);
   23878         len = gen_int_ptr(n_len, 1);
   23879 
   23880         ret_val = xmlSplitQName3((const xmlChar *)name, len);
   23881         desret_const_xmlChar_ptr(ret_val);
   23882         call_tests++;
   23883         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 0);
   23884         des_int_ptr(n_len, len, 1);
   23885         xmlResetLastError();
   23886         if (mem_base != xmlMemBlocks()) {
   23887             printf("Leak of %d blocks found in xmlSplitQName3",
   23888 	           xmlMemBlocks() - mem_base);
   23889 	    test_ret++;
   23890             printf(" %d", n_name);
   23891             printf(" %d", n_len);
   23892             printf("\n");
   23893         }
   23894     }
   23895     }
   23896     function_tests++;
   23897 
   23898     return(test_ret);
   23899 }
   23900 
   23901 
   23902 static int
   23903 test_xmlStringGetNodeList(void) {
   23904     int test_ret = 0;
   23905 
   23906     int mem_base;
   23907     xmlNodePtr ret_val;
   23908     xmlDoc * doc; /* the document */
   23909     int n_doc;
   23910     xmlChar * value; /* the value of the attribute */
   23911     int n_value;
   23912 
   23913     for (n_doc = 0;n_doc < gen_nb_const_xmlDoc_ptr;n_doc++) {
   23914     for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
   23915         mem_base = xmlMemBlocks();
   23916         doc = gen_const_xmlDoc_ptr(n_doc, 0);
   23917         value = gen_const_xmlChar_ptr(n_value, 1);
   23918 
   23919         ret_val = xmlStringGetNodeList((const xmlDoc *)doc, (const xmlChar *)value);
   23920         desret_xmlNodePtr(ret_val);
   23921         call_tests++;
   23922         des_const_xmlDoc_ptr(n_doc, (const xmlDoc *)doc, 0);
   23923         des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 1);
   23924         xmlResetLastError();
   23925         if (mem_base != xmlMemBlocks()) {
   23926             printf("Leak of %d blocks found in xmlStringGetNodeList",
   23927 	           xmlMemBlocks() - mem_base);
   23928 	    test_ret++;
   23929             printf(" %d", n_doc);
   23930             printf(" %d", n_value);
   23931             printf("\n");
   23932         }
   23933     }
   23934     }
   23935     function_tests++;
   23936 
   23937     return(test_ret);
   23938 }
   23939 
   23940 
   23941 static int
   23942 test_xmlStringLenGetNodeList(void) {
   23943     int test_ret = 0;
   23944 
   23945     int mem_base;
   23946     xmlNodePtr ret_val;
   23947     xmlDoc * doc; /* the document */
   23948     int n_doc;
   23949     xmlChar * value; /* the value of the text */
   23950     int n_value;
   23951     int len; /* the length of the string value */
   23952     int n_len;
   23953 
   23954     for (n_doc = 0;n_doc < gen_nb_const_xmlDoc_ptr;n_doc++) {
   23955     for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
   23956     for (n_len = 0;n_len < gen_nb_int;n_len++) {
   23957         mem_base = xmlMemBlocks();
   23958         doc = gen_const_xmlDoc_ptr(n_doc, 0);
   23959         value = gen_const_xmlChar_ptr(n_value, 1);
   23960         len = gen_int(n_len, 2);
   23961         if ((value != NULL) &&
   23962             (len > (int) strlen((const char *) value) + 1))
   23963             continue;
   23964 
   23965         ret_val = xmlStringLenGetNodeList((const xmlDoc *)doc, (const xmlChar *)value, len);
   23966         desret_xmlNodePtr(ret_val);
   23967         call_tests++;
   23968         des_const_xmlDoc_ptr(n_doc, (const xmlDoc *)doc, 0);
   23969         des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 1);
   23970         des_int(n_len, len, 2);
   23971         xmlResetLastError();
   23972         if (mem_base != xmlMemBlocks()) {
   23973             printf("Leak of %d blocks found in xmlStringLenGetNodeList",
   23974 	           xmlMemBlocks() - mem_base);
   23975 	    test_ret++;
   23976             printf(" %d", n_doc);
   23977             printf(" %d", n_value);
   23978             printf(" %d", n_len);
   23979             printf("\n");
   23980         }
   23981     }
   23982     }
   23983     }
   23984     function_tests++;
   23985 
   23986     return(test_ret);
   23987 }
   23988 
   23989 
   23990 static int
   23991 test_xmlTextConcat(void) {
   23992     int test_ret = 0;
   23993 
   23994     int mem_base;
   23995     int ret_val;
   23996     xmlNodePtr node; /* the node */
   23997     int n_node;
   23998     xmlChar * content; /* the content */
   23999     int n_content;
   24000     int len; /* @content length */
   24001     int n_len;
   24002 
   24003     for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
   24004     for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
   24005     for (n_len = 0;n_len < gen_nb_int;n_len++) {
   24006         mem_base = xmlMemBlocks();
   24007         node = gen_xmlNodePtr(n_node, 0);
   24008         content = gen_const_xmlChar_ptr(n_content, 1);
   24009         len = gen_int(n_len, 2);
   24010         if ((content != NULL) &&
   24011             (len > (int) strlen((const char *) content) + 1))
   24012             continue;
   24013 
   24014         ret_val = xmlTextConcat(node, (const xmlChar *)content, len);
   24015         desret_int(ret_val);
   24016         call_tests++;
   24017         des_xmlNodePtr(n_node, node, 0);
   24018         des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 1);
   24019         des_int(n_len, len, 2);
   24020         xmlResetLastError();
   24021         if (mem_base != xmlMemBlocks()) {
   24022             printf("Leak of %d blocks found in xmlTextConcat",
   24023 	           xmlMemBlocks() - mem_base);
   24024 	    test_ret++;
   24025             printf(" %d", n_node);
   24026             printf(" %d", n_content);
   24027             printf(" %d", n_len);
   24028             printf("\n");
   24029         }
   24030     }
   24031     }
   24032     }
   24033     function_tests++;
   24034 
   24035     return(test_ret);
   24036 }
   24037 
   24038 
   24039 static int
   24040 test_xmlTextMerge(void) {
   24041     int test_ret = 0;
   24042 
   24043     int mem_base;
   24044     xmlNodePtr ret_val;
   24045     xmlNodePtr first; /* the first text node */
   24046     int n_first;
   24047     xmlNodePtr second; /* the second text node being merged */
   24048     int n_second;
   24049 
   24050     for (n_first = 0;n_first < gen_nb_xmlNodePtr_in;n_first++) {
   24051     for (n_second = 0;n_second < gen_nb_xmlNodePtr_in;n_second++) {
   24052         mem_base = xmlMemBlocks();
   24053         first = gen_xmlNodePtr_in(n_first, 0);
   24054         second = gen_xmlNodePtr_in(n_second, 1);
   24055 
   24056         ret_val = xmlTextMerge(first, second);
   24057         if ((first != NULL) && (first->type != XML_TEXT_NODE)) {
   24058               xmlUnlinkNode(second);
   24059               xmlFreeNode(second) ; second = NULL ; }
   24060         desret_xmlNodePtr(ret_val);
   24061         call_tests++;
   24062         des_xmlNodePtr_in(n_first, first, 0);
   24063         des_xmlNodePtr_in(n_second, second, 1);
   24064         xmlResetLastError();
   24065         if (mem_base != xmlMemBlocks()) {
   24066             printf("Leak of %d blocks found in xmlTextMerge",
   24067 	           xmlMemBlocks() - mem_base);
   24068 	    test_ret++;
   24069             printf(" %d", n_first);
   24070             printf(" %d", n_second);
   24071             printf("\n");
   24072         }
   24073     }
   24074     }
   24075     function_tests++;
   24076 
   24077     return(test_ret);
   24078 }
   24079 
   24080 
   24081 static int
   24082 test_xmlUnsetNsProp(void) {
   24083     int test_ret = 0;
   24084 
   24085 #if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED)
   24086     int mem_base;
   24087     int ret_val;
   24088     xmlNodePtr node; /* the node */
   24089     int n_node;
   24090     xmlNsPtr ns; /* the namespace definition */
   24091     int n_ns;
   24092     xmlChar * name; /* the attribute name */
   24093     int n_name;
   24094 
   24095     for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
   24096     for (n_ns = 0;n_ns < gen_nb_xmlNsPtr;n_ns++) {
   24097     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
   24098         mem_base = xmlMemBlocks();
   24099         node = gen_xmlNodePtr(n_node, 0);
   24100         ns = gen_xmlNsPtr(n_ns, 1);
   24101         name = gen_const_xmlChar_ptr(n_name, 2);
   24102 
   24103         ret_val = xmlUnsetNsProp(node, ns, (const xmlChar *)name);
   24104         desret_int(ret_val);
   24105         call_tests++;
   24106         des_xmlNodePtr(n_node, node, 0);
   24107         des_xmlNsPtr(n_ns, ns, 1);
   24108         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 2);
   24109         xmlResetLastError();
   24110         if (mem_base != xmlMemBlocks()) {
   24111             printf("Leak of %d blocks found in xmlUnsetNsProp",
   24112 	           xmlMemBlocks() - mem_base);
   24113 	    test_ret++;
   24114             printf(" %d", n_node);
   24115             printf(" %d", n_ns);
   24116             printf(" %d", n_name);
   24117             printf("\n");
   24118         }
   24119     }
   24120     }
   24121     }
   24122     function_tests++;
   24123 #endif
   24124 
   24125     return(test_ret);
   24126 }
   24127 
   24128 
   24129 static int
   24130 test_xmlUnsetProp(void) {
   24131     int test_ret = 0;
   24132 
   24133 #if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED)
   24134     int mem_base;
   24135     int ret_val;
   24136     xmlNodePtr node; /* the node */
   24137     int n_node;
   24138     xmlChar * name; /* the attribute name */
   24139     int n_name;
   24140 
   24141     for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
   24142     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
   24143         mem_base = xmlMemBlocks();
   24144         node = gen_xmlNodePtr(n_node, 0);
   24145         name = gen_const_xmlChar_ptr(n_name, 1);
   24146 
   24147         ret_val = xmlUnsetProp(node, (const xmlChar *)name);
   24148         desret_int(ret_val);
   24149         call_tests++;
   24150         des_xmlNodePtr(n_node, node, 0);
   24151         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
   24152         xmlResetLastError();
   24153         if (mem_base != xmlMemBlocks()) {
   24154             printf("Leak of %d blocks found in xmlUnsetProp",
   24155 	           xmlMemBlocks() - mem_base);
   24156 	    test_ret++;
   24157             printf(" %d", n_node);
   24158             printf(" %d", n_name);
   24159             printf("\n");
   24160         }
   24161     }
   24162     }
   24163     function_tests++;
   24164 #endif
   24165 
   24166     return(test_ret);
   24167 }
   24168 
   24169 
   24170 static int
   24171 test_xmlValidateNCName(void) {
   24172     int test_ret = 0;
   24173 
   24174 #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)
   24175 #ifdef LIBXML_TREE_ENABLED
   24176     int mem_base;
   24177     int ret_val;
   24178     xmlChar * value; /* the value to check */
   24179     int n_value;
   24180     int space; /* allow spaces in front and end of the string */
   24181     int n_space;
   24182 
   24183     for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
   24184     for (n_space = 0;n_space < gen_nb_int;n_space++) {
   24185         mem_base = xmlMemBlocks();
   24186         value = gen_const_xmlChar_ptr(n_value, 0);
   24187         space = gen_int(n_space, 1);
   24188 
   24189         ret_val = xmlValidateNCName((const xmlChar *)value, space);
   24190         desret_int(ret_val);
   24191         call_tests++;
   24192         des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 0);
   24193         des_int(n_space, space, 1);
   24194         xmlResetLastError();
   24195         if (mem_base != xmlMemBlocks()) {
   24196             printf("Leak of %d blocks found in xmlValidateNCName",
   24197 	           xmlMemBlocks() - mem_base);
   24198 	    test_ret++;
   24199             printf(" %d", n_value);
   24200             printf(" %d", n_space);
   24201             printf("\n");
   24202         }
   24203     }
   24204     }
   24205     function_tests++;
   24206 #endif
   24207 #endif
   24208 
   24209     return(test_ret);
   24210 }
   24211 
   24212 
   24213 static int
   24214 test_xmlValidateNMToken(void) {
   24215     int test_ret = 0;
   24216 
   24217 #if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED)
   24218 #ifdef LIBXML_TREE_ENABLED
   24219     int mem_base;
   24220     int ret_val;
   24221     xmlChar * value; /* the value to check */
   24222     int n_value;
   24223     int space; /* allow spaces in front and end of the string */
   24224     int n_space;
   24225 
   24226     for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
   24227     for (n_space = 0;n_space < gen_nb_int;n_space++) {
   24228         mem_base = xmlMemBlocks();
   24229         value = gen_const_xmlChar_ptr(n_value, 0);
   24230         space = gen_int(n_space, 1);
   24231 
   24232         ret_val = xmlValidateNMToken((const xmlChar *)value, space);
   24233         desret_int(ret_val);
   24234         call_tests++;
   24235         des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 0);
   24236         des_int(n_space, space, 1);
   24237         xmlResetLastError();
   24238         if (mem_base != xmlMemBlocks()) {
   24239             printf("Leak of %d blocks found in xmlValidateNMToken",
   24240 	           xmlMemBlocks() - mem_base);
   24241 	    test_ret++;
   24242             printf(" %d", n_value);
   24243             printf(" %d", n_space);
   24244             printf("\n");
   24245         }
   24246     }
   24247     }
   24248     function_tests++;
   24249 #endif
   24250 #endif
   24251 
   24252     return(test_ret);
   24253 }
   24254 
   24255 
   24256 static int
   24257 test_xmlValidateName(void) {
   24258     int test_ret = 0;
   24259 
   24260 #if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED)
   24261 #ifdef LIBXML_TREE_ENABLED
   24262     int mem_base;
   24263     int ret_val;
   24264     xmlChar * value; /* the value to check */
   24265     int n_value;
   24266     int space; /* allow spaces in front and end of the string */
   24267     int n_space;
   24268 
   24269     for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
   24270     for (n_space = 0;n_space < gen_nb_int;n_space++) {
   24271         mem_base = xmlMemBlocks();
   24272         value = gen_const_xmlChar_ptr(n_value, 0);
   24273         space = gen_int(n_space, 1);
   24274 
   24275         ret_val = xmlValidateName((const xmlChar *)value, space);
   24276         desret_int(ret_val);
   24277         call_tests++;
   24278         des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 0);
   24279         des_int(n_space, space, 1);
   24280         xmlResetLastError();
   24281         if (mem_base != xmlMemBlocks()) {
   24282             printf("Leak of %d blocks found in xmlValidateName",
   24283 	           xmlMemBlocks() - mem_base);
   24284 	    test_ret++;
   24285             printf(" %d", n_value);
   24286             printf(" %d", n_space);
   24287             printf("\n");
   24288         }
   24289     }
   24290     }
   24291     function_tests++;
   24292 #endif
   24293 #endif
   24294 
   24295     return(test_ret);
   24296 }
   24297 
   24298 
   24299 static int
   24300 test_xmlValidateQName(void) {
   24301     int test_ret = 0;
   24302 
   24303 #if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED)
   24304 #ifdef LIBXML_TREE_ENABLED
   24305     int mem_base;
   24306     int ret_val;
   24307     xmlChar * value; /* the value to check */
   24308     int n_value;
   24309     int space; /* allow spaces in front and end of the string */
   24310     int n_space;
   24311 
   24312     for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
   24313     for (n_space = 0;n_space < gen_nb_int;n_space++) {
   24314         mem_base = xmlMemBlocks();
   24315         value = gen_const_xmlChar_ptr(n_value, 0);
   24316         space = gen_int(n_space, 1);
   24317 
   24318         ret_val = xmlValidateQName((const xmlChar *)value, space);
   24319         desret_int(ret_val);
   24320         call_tests++;
   24321         des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 0);
   24322         des_int(n_space, space, 1);
   24323         xmlResetLastError();
   24324         if (mem_base != xmlMemBlocks()) {
   24325             printf("Leak of %d blocks found in xmlValidateQName",
   24326 	           xmlMemBlocks() - mem_base);
   24327 	    test_ret++;
   24328             printf(" %d", n_value);
   24329             printf(" %d", n_space);
   24330             printf("\n");
   24331         }
   24332     }
   24333     }
   24334     function_tests++;
   24335 #endif
   24336 #endif
   24337 
   24338     return(test_ret);
   24339 }
   24340 
   24341 static int
   24342 test_tree(void) {
   24343     int test_ret = 0;
   24344 
   24345     if (quiet == 0) printf("Testing tree : 142 of 164 functions ...\n");
   24346     test_ret += test_xmlAddChild();
   24347     test_ret += test_xmlAddChildList();
   24348     test_ret += test_xmlAddNextSibling();
   24349     test_ret += test_xmlAddPrevSibling();
   24350     test_ret += test_xmlAddSibling();
   24351     test_ret += test_xmlAttrSerializeTxtContent();
   24352     test_ret += test_xmlBufContent();
   24353     test_ret += test_xmlBufEnd();
   24354     test_ret += test_xmlBufGetNodeContent();
   24355     test_ret += test_xmlBufNodeDump();
   24356     test_ret += test_xmlBufShrink();
   24357     test_ret += test_xmlBufUse();
   24358     test_ret += test_xmlBufferAdd();
   24359     test_ret += test_xmlBufferAddHead();
   24360     test_ret += test_xmlBufferCCat();
   24361     test_ret += test_xmlBufferCat();
   24362     test_ret += test_xmlBufferContent();
   24363     test_ret += test_xmlBufferCreate();
   24364     test_ret += test_xmlBufferCreateSize();
   24365     test_ret += test_xmlBufferCreateStatic();
   24366     test_ret += test_xmlBufferDetach();
   24367     test_ret += test_xmlBufferEmpty();
   24368     test_ret += test_xmlBufferGrow();
   24369     test_ret += test_xmlBufferLength();
   24370     test_ret += test_xmlBufferResize();
   24371     test_ret += test_xmlBufferSetAllocationScheme();
   24372     test_ret += test_xmlBufferShrink();
   24373     test_ret += test_xmlBufferWriteCHAR();
   24374     test_ret += test_xmlBufferWriteChar();
   24375     test_ret += test_xmlBufferWriteQuotedString();
   24376     test_ret += test_xmlBuildQName();
   24377     test_ret += test_xmlChildElementCount();
   24378     test_ret += test_xmlCopyDoc();
   24379     test_ret += test_xmlCopyDtd();
   24380     test_ret += test_xmlCopyNamespace();
   24381     test_ret += test_xmlCopyNamespaceList();
   24382     test_ret += test_xmlCopyNode();
   24383     test_ret += test_xmlCopyNodeList();
   24384     test_ret += test_xmlCopyProp();
   24385     test_ret += test_xmlCopyPropList();
   24386     test_ret += test_xmlCreateIntSubset();
   24387     test_ret += test_xmlDOMWrapAdoptNode();
   24388     test_ret += test_xmlDOMWrapCloneNode();
   24389     test_ret += test_xmlDOMWrapNewCtxt();
   24390     test_ret += test_xmlDOMWrapReconcileNamespaces();
   24391     test_ret += test_xmlDOMWrapRemoveNode();
   24392     test_ret += test_xmlDocCopyNode();
   24393     test_ret += test_xmlDocCopyNodeList();
   24394     test_ret += test_xmlDocDump();
   24395     test_ret += test_xmlDocDumpFormatMemory();
   24396     test_ret += test_xmlDocDumpFormatMemoryEnc();
   24397     test_ret += test_xmlDocDumpMemory();
   24398     test_ret += test_xmlDocDumpMemoryEnc();
   24399     test_ret += test_xmlDocFormatDump();
   24400     test_ret += test_xmlDocGetRootElement();
   24401     test_ret += test_xmlDocSetRootElement();
   24402     test_ret += test_xmlElemDump();
   24403     test_ret += test_xmlFirstElementChild();
   24404     test_ret += test_xmlGetBufferAllocationScheme();
   24405     test_ret += test_xmlGetCompressMode();
   24406     test_ret += test_xmlGetDocCompressMode();
   24407     test_ret += test_xmlGetIntSubset();
   24408     test_ret += test_xmlGetLastChild();
   24409     test_ret += test_xmlGetLineNo();
   24410     test_ret += test_xmlGetNoNsProp();
   24411     test_ret += test_xmlGetNodePath();
   24412     test_ret += test_xmlGetNsList();
   24413     test_ret += test_xmlGetNsProp();
   24414     test_ret += test_xmlGetProp();
   24415     test_ret += test_xmlHasNsProp();
   24416     test_ret += test_xmlHasProp();
   24417     test_ret += test_xmlIsBlankNode();
   24418     test_ret += test_xmlIsXHTML();
   24419     test_ret += test_xmlLastElementChild();
   24420     test_ret += test_xmlNewCDataBlock();
   24421     test_ret += test_xmlNewCharRef();
   24422     test_ret += test_xmlNewChild();
   24423     test_ret += test_xmlNewComment();
   24424     test_ret += test_xmlNewDoc();
   24425     test_ret += test_xmlNewDocComment();
   24426     test_ret += test_xmlNewDocFragment();
   24427     test_ret += test_xmlNewDocNode();
   24428     test_ret += test_xmlNewDocNodeEatName();
   24429     test_ret += test_xmlNewDocPI();
   24430     test_ret += test_xmlNewDocProp();
   24431     test_ret += test_xmlNewDocRawNode();
   24432     test_ret += test_xmlNewDocText();
   24433     test_ret += test_xmlNewDocTextLen();
   24434     test_ret += test_xmlNewDtd();
   24435     test_ret += test_xmlNewNode();
   24436     test_ret += test_xmlNewNodeEatName();
   24437     test_ret += test_xmlNewNs();
   24438     test_ret += test_xmlNewNsProp();
   24439     test_ret += test_xmlNewNsPropEatName();
   24440     test_ret += test_xmlNewPI();
   24441     test_ret += test_xmlNewProp();
   24442     test_ret += test_xmlNewReference();
   24443     test_ret += test_xmlNewText();
   24444     test_ret += test_xmlNewTextChild();
   24445     test_ret += test_xmlNewTextLen();
   24446     test_ret += test_xmlNextElementSibling();
   24447     test_ret += test_xmlNodeAddContent();
   24448     test_ret += test_xmlNodeAddContentLen();
   24449     test_ret += test_xmlNodeBufGetContent();
   24450     test_ret += test_xmlNodeDump();
   24451     test_ret += test_xmlNodeDumpOutput();
   24452     test_ret += test_xmlNodeGetBase();
   24453     test_ret += test_xmlNodeGetContent();
   24454     test_ret += test_xmlNodeGetLang();
   24455     test_ret += test_xmlNodeGetSpacePreserve();
   24456     test_ret += test_xmlNodeIsText();
   24457     test_ret += test_xmlNodeListGetRawString();
   24458     test_ret += test_xmlNodeListGetString();
   24459     test_ret += test_xmlNodeSetBase();
   24460     test_ret += test_xmlNodeSetContent();
   24461     test_ret += test_xmlNodeSetContentLen();
   24462     test_ret += test_xmlNodeSetLang();
   24463     test_ret += test_xmlNodeSetName();
   24464     test_ret += test_xmlNodeSetSpacePreserve();
   24465     test_ret += test_xmlPreviousElementSibling();
   24466     test_ret += test_xmlReconciliateNs();
   24467     test_ret += test_xmlRemoveProp();
   24468     test_ret += test_xmlReplaceNode();
   24469     test_ret += test_xmlSaveFile();
   24470     test_ret += test_xmlSaveFileEnc();
   24471     test_ret += test_xmlSaveFileTo();
   24472     test_ret += test_xmlSaveFormatFile();
   24473     test_ret += test_xmlSaveFormatFileEnc();
   24474     test_ret += test_xmlSaveFormatFileTo();
   24475     test_ret += test_xmlSearchNs();
   24476     test_ret += test_xmlSearchNsByHref();
   24477     test_ret += test_xmlSetBufferAllocationScheme();
   24478     test_ret += test_xmlSetCompressMode();
   24479     test_ret += test_xmlSetDocCompressMode();
   24480     test_ret += test_xmlSetNs();
   24481     test_ret += test_xmlSetNsProp();
   24482     test_ret += test_xmlSetProp();
   24483     test_ret += test_xmlSplitQName2();
   24484     test_ret += test_xmlSplitQName3();
   24485     test_ret += test_xmlStringGetNodeList();
   24486     test_ret += test_xmlStringLenGetNodeList();
   24487     test_ret += test_xmlTextConcat();
   24488     test_ret += test_xmlTextMerge();
   24489     test_ret += test_xmlUnsetNsProp();
   24490     test_ret += test_xmlUnsetProp();
   24491     test_ret += test_xmlValidateNCName();
   24492     test_ret += test_xmlValidateNMToken();
   24493     test_ret += test_xmlValidateName();
   24494     test_ret += test_xmlValidateQName();
   24495 
   24496     if (test_ret != 0)
   24497 	printf("Module tree: %d errors\n", test_ret);
   24498     return(test_ret);
   24499 }
   24500 
   24501 static int
   24502 test_xmlBuildRelativeURI(void) {
   24503     int test_ret = 0;
   24504 
   24505     int mem_base;
   24506     xmlChar * ret_val;
   24507     xmlChar * URI; /* the URI reference under consideration */
   24508     int n_URI;
   24509     xmlChar * base; /* the base value */
   24510     int n_base;
   24511 
   24512     for (n_URI = 0;n_URI < gen_nb_const_xmlChar_ptr;n_URI++) {
   24513     for (n_base = 0;n_base < gen_nb_const_xmlChar_ptr;n_base++) {
   24514         mem_base = xmlMemBlocks();
   24515         URI = gen_const_xmlChar_ptr(n_URI, 0);
   24516         base = gen_const_xmlChar_ptr(n_base, 1);
   24517 
   24518         ret_val = xmlBuildRelativeURI((const xmlChar *)URI, (const xmlChar *)base);
   24519         desret_xmlChar_ptr(ret_val);
   24520         call_tests++;
   24521         des_const_xmlChar_ptr(n_URI, (const xmlChar *)URI, 0);
   24522         des_const_xmlChar_ptr(n_base, (const xmlChar *)base, 1);
   24523         xmlResetLastError();
   24524         if (mem_base != xmlMemBlocks()) {
   24525             printf("Leak of %d blocks found in xmlBuildRelativeURI",
   24526 	           xmlMemBlocks() - mem_base);
   24527 	    test_ret++;
   24528             printf(" %d", n_URI);
   24529             printf(" %d", n_base);
   24530             printf("\n");
   24531         }
   24532     }
   24533     }
   24534     function_tests++;
   24535 
   24536     return(test_ret);
   24537 }
   24538 
   24539 
   24540 static int
   24541 test_xmlBuildURI(void) {
   24542     int test_ret = 0;
   24543 
   24544     int mem_base;
   24545     xmlChar * ret_val;
   24546     xmlChar * URI; /* the URI instance found in the document */
   24547     int n_URI;
   24548     xmlChar * base; /* the base value */
   24549     int n_base;
   24550 
   24551     for (n_URI = 0;n_URI < gen_nb_const_xmlChar_ptr;n_URI++) {
   24552     for (n_base = 0;n_base < gen_nb_const_xmlChar_ptr;n_base++) {
   24553         mem_base = xmlMemBlocks();
   24554         URI = gen_const_xmlChar_ptr(n_URI, 0);
   24555         base = gen_const_xmlChar_ptr(n_base, 1);
   24556 
   24557         ret_val = xmlBuildURI((const xmlChar *)URI, (const xmlChar *)base);
   24558         desret_xmlChar_ptr(ret_val);
   24559         call_tests++;
   24560         des_const_xmlChar_ptr(n_URI, (const xmlChar *)URI, 0);
   24561         des_const_xmlChar_ptr(n_base, (const xmlChar *)base, 1);
   24562         xmlResetLastError();
   24563         if (mem_base != xmlMemBlocks()) {
   24564             printf("Leak of %d blocks found in xmlBuildURI",
   24565 	           xmlMemBlocks() - mem_base);
   24566 	    test_ret++;
   24567             printf(" %d", n_URI);
   24568             printf(" %d", n_base);
   24569             printf("\n");
   24570         }
   24571     }
   24572     }
   24573     function_tests++;
   24574 
   24575     return(test_ret);
   24576 }
   24577 
   24578 
   24579 static int
   24580 test_xmlCanonicPath(void) {
   24581     int test_ret = 0;
   24582 
   24583     int mem_base;
   24584     xmlChar * ret_val;
   24585     xmlChar * path; /* the resource locator in a filesystem notation */
   24586     int n_path;
   24587 
   24588     for (n_path = 0;n_path < gen_nb_const_xmlChar_ptr;n_path++) {
   24589         mem_base = xmlMemBlocks();
   24590         path = gen_const_xmlChar_ptr(n_path, 0);
   24591 
   24592         ret_val = xmlCanonicPath((const xmlChar *)path);
   24593         desret_xmlChar_ptr(ret_val);
   24594         call_tests++;
   24595         des_const_xmlChar_ptr(n_path, (const xmlChar *)path, 0);
   24596         xmlResetLastError();
   24597         if (mem_base != xmlMemBlocks()) {
   24598             printf("Leak of %d blocks found in xmlCanonicPath",
   24599 	           xmlMemBlocks() - mem_base);
   24600 	    test_ret++;
   24601             printf(" %d", n_path);
   24602             printf("\n");
   24603         }
   24604     }
   24605     function_tests++;
   24606 
   24607     return(test_ret);
   24608 }
   24609 
   24610 
   24611 static int
   24612 test_xmlCreateURI(void) {
   24613     int test_ret = 0;
   24614 
   24615 
   24616     /* missing type support */
   24617     return(test_ret);
   24618 }
   24619 
   24620 
   24621 static int
   24622 test_xmlNormalizeURIPath(void) {
   24623     int test_ret = 0;
   24624 
   24625     int mem_base;
   24626     int ret_val;
   24627     char * path; /* pointer to the path string */
   24628     int n_path;
   24629 
   24630     for (n_path = 0;n_path < gen_nb_char_ptr;n_path++) {
   24631         mem_base = xmlMemBlocks();
   24632         path = gen_char_ptr(n_path, 0);
   24633 
   24634         ret_val = xmlNormalizeURIPath(path);
   24635         desret_int(ret_val);
   24636         call_tests++;
   24637         des_char_ptr(n_path, path, 0);
   24638         xmlResetLastError();
   24639         if (mem_base != xmlMemBlocks()) {
   24640             printf("Leak of %d blocks found in xmlNormalizeURIPath",
   24641 	           xmlMemBlocks() - mem_base);
   24642 	    test_ret++;
   24643             printf(" %d", n_path);
   24644             printf("\n");
   24645         }
   24646     }
   24647     function_tests++;
   24648 
   24649     return(test_ret);
   24650 }
   24651 
   24652 
   24653 static int
   24654 test_xmlParseURI(void) {
   24655     int test_ret = 0;
   24656 
   24657 
   24658     /* missing type support */
   24659     return(test_ret);
   24660 }
   24661 
   24662 
   24663 static int
   24664 test_xmlParseURIRaw(void) {
   24665     int test_ret = 0;
   24666 
   24667 
   24668     /* missing type support */
   24669     return(test_ret);
   24670 }
   24671 
   24672 
   24673 #define gen_nb_xmlURIPtr 1
   24674 static xmlURIPtr gen_xmlURIPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
   24675     return(NULL);
   24676 }
   24677 static void des_xmlURIPtr(int no ATTRIBUTE_UNUSED, xmlURIPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
   24678 }
   24679 
   24680 static int
   24681 test_xmlParseURIReference(void) {
   24682     int test_ret = 0;
   24683 
   24684     int mem_base;
   24685     int ret_val;
   24686     xmlURIPtr uri; /* pointer to an URI structure */
   24687     int n_uri;
   24688     char * str; /* the string to analyze */
   24689     int n_str;
   24690 
   24691     for (n_uri = 0;n_uri < gen_nb_xmlURIPtr;n_uri++) {
   24692     for (n_str = 0;n_str < gen_nb_const_char_ptr;n_str++) {
   24693         mem_base = xmlMemBlocks();
   24694         uri = gen_xmlURIPtr(n_uri, 0);
   24695         str = gen_const_char_ptr(n_str, 1);
   24696 
   24697         ret_val = xmlParseURIReference(uri, (const char *)str);
   24698         desret_int(ret_val);
   24699         call_tests++;
   24700         des_xmlURIPtr(n_uri, uri, 0);
   24701         des_const_char_ptr(n_str, (const char *)str, 1);
   24702         xmlResetLastError();
   24703         if (mem_base != xmlMemBlocks()) {
   24704             printf("Leak of %d blocks found in xmlParseURIReference",
   24705 	           xmlMemBlocks() - mem_base);
   24706 	    test_ret++;
   24707             printf(" %d", n_uri);
   24708             printf(" %d", n_str);
   24709             printf("\n");
   24710         }
   24711     }
   24712     }
   24713     function_tests++;
   24714 
   24715     return(test_ret);
   24716 }
   24717 
   24718 
   24719 static int
   24720 test_xmlPathToURI(void) {
   24721     int test_ret = 0;
   24722 
   24723     int mem_base;
   24724     xmlChar * ret_val;
   24725     xmlChar * path; /* the resource locator in a filesystem notation */
   24726     int n_path;
   24727 
   24728     for (n_path = 0;n_path < gen_nb_const_xmlChar_ptr;n_path++) {
   24729         mem_base = xmlMemBlocks();
   24730         path = gen_const_xmlChar_ptr(n_path, 0);
   24731 
   24732         ret_val = xmlPathToURI((const xmlChar *)path);
   24733         desret_xmlChar_ptr(ret_val);
   24734         call_tests++;
   24735         des_const_xmlChar_ptr(n_path, (const xmlChar *)path, 0);
   24736         xmlResetLastError();
   24737         if (mem_base != xmlMemBlocks()) {
   24738             printf("Leak of %d blocks found in xmlPathToURI",
   24739 	           xmlMemBlocks() - mem_base);
   24740 	    test_ret++;
   24741             printf(" %d", n_path);
   24742             printf("\n");
   24743         }
   24744     }
   24745     function_tests++;
   24746 
   24747     return(test_ret);
   24748 }
   24749 
   24750 
   24751 static int
   24752 test_xmlPrintURI(void) {
   24753     int test_ret = 0;
   24754 
   24755     int mem_base;
   24756     FILE * stream; /* a FILE* for the output */
   24757     int n_stream;
   24758     xmlURIPtr uri; /* pointer to an xmlURI */
   24759     int n_uri;
   24760 
   24761     for (n_stream = 0;n_stream < gen_nb_FILE_ptr;n_stream++) {
   24762     for (n_uri = 0;n_uri < gen_nb_xmlURIPtr;n_uri++) {
   24763         mem_base = xmlMemBlocks();
   24764         stream = gen_FILE_ptr(n_stream, 0);
   24765         uri = gen_xmlURIPtr(n_uri, 1);
   24766 
   24767         xmlPrintURI(stream, uri);
   24768         call_tests++;
   24769         des_FILE_ptr(n_stream, stream, 0);
   24770         des_xmlURIPtr(n_uri, uri, 1);
   24771         xmlResetLastError();
   24772         if (mem_base != xmlMemBlocks()) {
   24773             printf("Leak of %d blocks found in xmlPrintURI",
   24774 	           xmlMemBlocks() - mem_base);
   24775 	    test_ret++;
   24776             printf(" %d", n_stream);
   24777             printf(" %d", n_uri);
   24778             printf("\n");
   24779         }
   24780     }
   24781     }
   24782     function_tests++;
   24783 
   24784     return(test_ret);
   24785 }
   24786 
   24787 
   24788 static int
   24789 test_xmlSaveUri(void) {
   24790     int test_ret = 0;
   24791 
   24792     int mem_base;
   24793     xmlChar * ret_val;
   24794     xmlURIPtr uri; /* pointer to an xmlURI */
   24795     int n_uri;
   24796 
   24797     for (n_uri = 0;n_uri < gen_nb_xmlURIPtr;n_uri++) {
   24798         mem_base = xmlMemBlocks();
   24799         uri = gen_xmlURIPtr(n_uri, 0);
   24800 
   24801         ret_val = xmlSaveUri(uri);
   24802         desret_xmlChar_ptr(ret_val);
   24803         call_tests++;
   24804         des_xmlURIPtr(n_uri, uri, 0);
   24805         xmlResetLastError();
   24806         if (mem_base != xmlMemBlocks()) {
   24807             printf("Leak of %d blocks found in xmlSaveUri",
   24808 	           xmlMemBlocks() - mem_base);
   24809 	    test_ret++;
   24810             printf(" %d", n_uri);
   24811             printf("\n");
   24812         }
   24813     }
   24814     function_tests++;
   24815 
   24816     return(test_ret);
   24817 }
   24818 
   24819 
   24820 static int
   24821 test_xmlURIEscape(void) {
   24822     int test_ret = 0;
   24823 
   24824     int mem_base;
   24825     xmlChar * ret_val;
   24826     xmlChar * str; /* the string of the URI to escape */
   24827     int n_str;
   24828 
   24829     for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) {
   24830         mem_base = xmlMemBlocks();
   24831         str = gen_const_xmlChar_ptr(n_str, 0);
   24832 
   24833         ret_val = xmlURIEscape((const xmlChar *)str);
   24834         desret_xmlChar_ptr(ret_val);
   24835         call_tests++;
   24836         des_const_xmlChar_ptr(n_str, (const xmlChar *)str, 0);
   24837         xmlResetLastError();
   24838         if (mem_base != xmlMemBlocks()) {
   24839             printf("Leak of %d blocks found in xmlURIEscape",
   24840 	           xmlMemBlocks() - mem_base);
   24841 	    test_ret++;
   24842             printf(" %d", n_str);
   24843             printf("\n");
   24844         }
   24845     }
   24846     function_tests++;
   24847 
   24848     return(test_ret);
   24849 }
   24850 
   24851 
   24852 static int
   24853 test_xmlURIEscapeStr(void) {
   24854     int test_ret = 0;
   24855 
   24856     int mem_base;
   24857     xmlChar * ret_val;
   24858     xmlChar * str; /* string to escape */
   24859     int n_str;
   24860     xmlChar * list; /* exception list string of chars not to escape */
   24861     int n_list;
   24862 
   24863     for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) {
   24864     for (n_list = 0;n_list < gen_nb_const_xmlChar_ptr;n_list++) {
   24865         mem_base = xmlMemBlocks();
   24866         str = gen_const_xmlChar_ptr(n_str, 0);
   24867         list = gen_const_xmlChar_ptr(n_list, 1);
   24868 
   24869         ret_val = xmlURIEscapeStr((const xmlChar *)str, (const xmlChar *)list);
   24870         desret_xmlChar_ptr(ret_val);
   24871         call_tests++;
   24872         des_const_xmlChar_ptr(n_str, (const xmlChar *)str, 0);
   24873         des_const_xmlChar_ptr(n_list, (const xmlChar *)list, 1);
   24874         xmlResetLastError();
   24875         if (mem_base != xmlMemBlocks()) {
   24876             printf("Leak of %d blocks found in xmlURIEscapeStr",
   24877 	           xmlMemBlocks() - mem_base);
   24878 	    test_ret++;
   24879             printf(" %d", n_str);
   24880             printf(" %d", n_list);
   24881             printf("\n");
   24882         }
   24883     }
   24884     }
   24885     function_tests++;
   24886 
   24887     return(test_ret);
   24888 }
   24889 
   24890 
   24891 static int
   24892 test_xmlURIUnescapeString(void) {
   24893     int test_ret = 0;
   24894 
   24895 
   24896     /* missing type support */
   24897     return(test_ret);
   24898 }
   24899 
   24900 static int
   24901 test_uri(void) {
   24902     int test_ret = 0;
   24903 
   24904     if (quiet == 0) printf("Testing uri : 10 of 15 functions ...\n");
   24905     test_ret += test_xmlBuildRelativeURI();
   24906     test_ret += test_xmlBuildURI();
   24907     test_ret += test_xmlCanonicPath();
   24908     test_ret += test_xmlCreateURI();
   24909     test_ret += test_xmlNormalizeURIPath();
   24910     test_ret += test_xmlParseURI();
   24911     test_ret += test_xmlParseURIRaw();
   24912     test_ret += test_xmlParseURIReference();
   24913     test_ret += test_xmlPathToURI();
   24914     test_ret += test_xmlPrintURI();
   24915     test_ret += test_xmlSaveUri();
   24916     test_ret += test_xmlURIEscape();
   24917     test_ret += test_xmlURIEscapeStr();
   24918     test_ret += test_xmlURIUnescapeString();
   24919 
   24920     if (test_ret != 0)
   24921 	printf("Module uri: %d errors\n", test_ret);
   24922     return(test_ret);
   24923 }
   24924 
   24925 static int
   24926 test_xmlAddAttributeDecl(void) {
   24927     int test_ret = 0;
   24928 
   24929     int mem_base;
   24930     xmlAttributePtr ret_val;
   24931     xmlValidCtxtPtr ctxt; /* the validation context */
   24932     int n_ctxt;
   24933     xmlDtdPtr dtd; /* pointer to the DTD */
   24934     int n_dtd;
   24935     xmlChar * elem; /* the element name */
   24936     int n_elem;
   24937     xmlChar * name; /* the attribute name */
   24938     int n_name;
   24939     xmlChar * ns; /* the attribute namespace prefix */
   24940     int n_ns;
   24941     xmlAttributeType type; /* the attribute type */
   24942     int n_type;
   24943     xmlAttributeDefault def; /* the attribute default type */
   24944     int n_def;
   24945     xmlChar * defaultValue; /* the attribute default value */
   24946     int n_defaultValue;
   24947     xmlEnumerationPtr tree; /* if it's an enumeration, the associated list */
   24948     int n_tree;
   24949 
   24950     for (n_ctxt = 0;n_ctxt < gen_nb_xmlValidCtxtPtr;n_ctxt++) {
   24951     for (n_dtd = 0;n_dtd < gen_nb_xmlDtdPtr;n_dtd++) {
   24952     for (n_elem = 0;n_elem < gen_nb_const_xmlChar_ptr;n_elem++) {
   24953     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
   24954     for (n_ns = 0;n_ns < gen_nb_const_xmlChar_ptr;n_ns++) {
   24955     for (n_type = 0;n_type < gen_nb_xmlAttributeType;n_type++) {
   24956     for (n_def = 0;n_def < gen_nb_xmlAttributeDefault;n_def++) {
   24957     for (n_defaultValue = 0;n_defaultValue < gen_nb_const_xmlChar_ptr;n_defaultValue++) {
   24958     for (n_tree = 0;n_tree < gen_nb_xmlEnumerationPtr;n_tree++) {
   24959         mem_base = xmlMemBlocks();
   24960         ctxt = gen_xmlValidCtxtPtr(n_ctxt, 0);
   24961         dtd = gen_xmlDtdPtr(n_dtd, 1);
   24962         elem = gen_const_xmlChar_ptr(n_elem, 2);
   24963         name = gen_const_xmlChar_ptr(n_name, 3);
   24964         ns = gen_const_xmlChar_ptr(n_ns, 4);
   24965         type = gen_xmlAttributeType(n_type, 5);
   24966         def = gen_xmlAttributeDefault(n_def, 6);
   24967         defaultValue = gen_const_xmlChar_ptr(n_defaultValue, 7);
   24968         tree = gen_xmlEnumerationPtr(n_tree, 8);
   24969 
   24970         ret_val = xmlAddAttributeDecl(ctxt, dtd, (const xmlChar *)elem, (const xmlChar *)name, (const xmlChar *)ns, type, def, (const xmlChar *)defaultValue, tree);
   24971         desret_xmlAttributePtr(ret_val);
   24972         call_tests++;
   24973         des_xmlValidCtxtPtr(n_ctxt, ctxt, 0);
   24974         des_xmlDtdPtr(n_dtd, dtd, 1);
   24975         des_const_xmlChar_ptr(n_elem, (const xmlChar *)elem, 2);
   24976         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 3);
   24977         des_const_xmlChar_ptr(n_ns, (const xmlChar *)ns, 4);
   24978         des_xmlAttributeType(n_type, type, 5);
   24979         des_xmlAttributeDefault(n_def, def, 6);
   24980         des_const_xmlChar_ptr(n_defaultValue, (const xmlChar *)defaultValue, 7);
   24981         des_xmlEnumerationPtr(n_tree, tree, 8);
   24982         xmlResetLastError();
   24983         if (mem_base != xmlMemBlocks()) {
   24984             printf("Leak of %d blocks found in xmlAddAttributeDecl",
   24985 	           xmlMemBlocks() - mem_base);
   24986 	    test_ret++;
   24987             printf(" %d", n_ctxt);
   24988             printf(" %d", n_dtd);
   24989             printf(" %d", n_elem);
   24990             printf(" %d", n_name);
   24991             printf(" %d", n_ns);
   24992             printf(" %d", n_type);
   24993             printf(" %d", n_def);
   24994             printf(" %d", n_defaultValue);
   24995             printf(" %d", n_tree);
   24996             printf("\n");
   24997         }
   24998     }
   24999     }
   25000     }
   25001     }
   25002     }
   25003     }
   25004     }
   25005     }
   25006     }
   25007     function_tests++;
   25008 
   25009     return(test_ret);
   25010 }
   25011 
   25012 
   25013 static int
   25014 test_xmlAddElementDecl(void) {
   25015     int test_ret = 0;
   25016 
   25017     int mem_base;
   25018     xmlElementPtr ret_val;
   25019     xmlValidCtxtPtr ctxt; /* the validation context */
   25020     int n_ctxt;
   25021     xmlDtdPtr dtd; /* pointer to the DTD */
   25022     int n_dtd;
   25023     xmlChar * name; /* the entity name */
   25024     int n_name;
   25025     xmlElementTypeVal type; /* the element type */
   25026     int n_type;
   25027     xmlElementContentPtr content; /* the element content tree or NULL */
   25028     int n_content;
   25029 
   25030     for (n_ctxt = 0;n_ctxt < gen_nb_xmlValidCtxtPtr;n_ctxt++) {
   25031     for (n_dtd = 0;n_dtd < gen_nb_xmlDtdPtr;n_dtd++) {
   25032     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
   25033     for (n_type = 0;n_type < gen_nb_xmlElementTypeVal;n_type++) {
   25034     for (n_content = 0;n_content < gen_nb_xmlElementContentPtr;n_content++) {
   25035         mem_base = xmlMemBlocks();
   25036         ctxt = gen_xmlValidCtxtPtr(n_ctxt, 0);
   25037         dtd = gen_xmlDtdPtr(n_dtd, 1);
   25038         name = gen_const_xmlChar_ptr(n_name, 2);
   25039         type = gen_xmlElementTypeVal(n_type, 3);
   25040         content = gen_xmlElementContentPtr(n_content, 4);
   25041 
   25042         ret_val = xmlAddElementDecl(ctxt, dtd, (const xmlChar *)name, type, content);
   25043         desret_xmlElementPtr(ret_val);
   25044         call_tests++;
   25045         des_xmlValidCtxtPtr(n_ctxt, ctxt, 0);
   25046         des_xmlDtdPtr(n_dtd, dtd, 1);
   25047         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 2);
   25048         des_xmlElementTypeVal(n_type, type, 3);
   25049         des_xmlElementContentPtr(n_content, content, 4);
   25050         xmlResetLastError();
   25051         if (mem_base != xmlMemBlocks()) {
   25052             printf("Leak of %d blocks found in xmlAddElementDecl",
   25053 	           xmlMemBlocks() - mem_base);
   25054 	    test_ret++;
   25055             printf(" %d", n_ctxt);
   25056             printf(" %d", n_dtd);
   25057             printf(" %d", n_name);
   25058             printf(" %d", n_type);
   25059             printf(" %d", n_content);
   25060             printf("\n");
   25061         }
   25062     }
   25063     }
   25064     }
   25065     }
   25066     }
   25067     function_tests++;
   25068 
   25069     return(test_ret);
   25070 }
   25071 
   25072 
   25073 static int
   25074 test_xmlAddID(void) {
   25075     int test_ret = 0;
   25076 
   25077 
   25078     /* missing type support */
   25079     return(test_ret);
   25080 }
   25081 
   25082 
   25083 static int
   25084 test_xmlAddNotationDecl(void) {
   25085     int test_ret = 0;
   25086 
   25087 
   25088     /* missing type support */
   25089     return(test_ret);
   25090 }
   25091 
   25092 
   25093 static int
   25094 test_xmlAddRef(void) {
   25095     int test_ret = 0;
   25096 
   25097 
   25098     /* missing type support */
   25099     return(test_ret);
   25100 }
   25101 
   25102 
   25103 #define gen_nb_xmlAttributeTablePtr 1
   25104 static xmlAttributeTablePtr gen_xmlAttributeTablePtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
   25105     return(NULL);
   25106 }
   25107 static void des_xmlAttributeTablePtr(int no ATTRIBUTE_UNUSED, xmlAttributeTablePtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
   25108 }
   25109 
   25110 static int
   25111 test_xmlCopyAttributeTable(void) {
   25112     int test_ret = 0;
   25113 
   25114 
   25115     /* missing type support */
   25116     return(test_ret);
   25117 }
   25118 
   25119 
   25120 static int
   25121 test_xmlCopyDocElementContent(void) {
   25122     int test_ret = 0;
   25123 
   25124     int mem_base;
   25125     xmlElementContentPtr ret_val;
   25126     xmlDocPtr doc; /* the document owning the element declaration */
   25127     int n_doc;
   25128     xmlElementContentPtr cur; /* An element content pointer. */
   25129     int n_cur;
   25130 
   25131     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
   25132     for (n_cur = 0;n_cur < gen_nb_xmlElementContentPtr;n_cur++) {
   25133         mem_base = xmlMemBlocks();
   25134         doc = gen_xmlDocPtr(n_doc, 0);
   25135         cur = gen_xmlElementContentPtr(n_cur, 1);
   25136 
   25137         ret_val = xmlCopyDocElementContent(doc, cur);
   25138         desret_xmlElementContentPtr(ret_val);
   25139         call_tests++;
   25140         des_xmlDocPtr(n_doc, doc, 0);
   25141         des_xmlElementContentPtr(n_cur, cur, 1);
   25142         xmlResetLastError();
   25143         if (mem_base != xmlMemBlocks()) {
   25144             printf("Leak of %d blocks found in xmlCopyDocElementContent",
   25145 	           xmlMemBlocks() - mem_base);
   25146 	    test_ret++;
   25147             printf(" %d", n_doc);
   25148             printf(" %d", n_cur);
   25149             printf("\n");
   25150         }
   25151     }
   25152     }
   25153     function_tests++;
   25154 
   25155     return(test_ret);
   25156 }
   25157 
   25158 
   25159 static int
   25160 test_xmlCopyElementContent(void) {
   25161     int test_ret = 0;
   25162 
   25163     int mem_base;
   25164     xmlElementContentPtr ret_val;
   25165     xmlElementContentPtr cur; /* An element content pointer. */
   25166     int n_cur;
   25167 
   25168     for (n_cur = 0;n_cur < gen_nb_xmlElementContentPtr;n_cur++) {
   25169         mem_base = xmlMemBlocks();
   25170         cur = gen_xmlElementContentPtr(n_cur, 0);
   25171 
   25172         ret_val = xmlCopyElementContent(cur);
   25173         desret_xmlElementContentPtr(ret_val);
   25174         call_tests++;
   25175         des_xmlElementContentPtr(n_cur, cur, 0);
   25176         xmlResetLastError();
   25177         if (mem_base != xmlMemBlocks()) {
   25178             printf("Leak of %d blocks found in xmlCopyElementContent",
   25179 	           xmlMemBlocks() - mem_base);
   25180 	    test_ret++;
   25181             printf(" %d", n_cur);
   25182             printf("\n");
   25183         }
   25184     }
   25185     function_tests++;
   25186 
   25187     return(test_ret);
   25188 }
   25189 
   25190 
   25191 #define gen_nb_xmlElementTablePtr 1
   25192 static xmlElementTablePtr gen_xmlElementTablePtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
   25193     return(NULL);
   25194 }
   25195 static void des_xmlElementTablePtr(int no ATTRIBUTE_UNUSED, xmlElementTablePtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
   25196 }
   25197 
   25198 static int
   25199 test_xmlCopyElementTable(void) {
   25200     int test_ret = 0;
   25201 
   25202 
   25203     /* missing type support */
   25204     return(test_ret);
   25205 }
   25206 
   25207 
   25208 static int
   25209 test_xmlCopyEnumeration(void) {
   25210     int test_ret = 0;
   25211 
   25212 
   25213     /* missing type support */
   25214     return(test_ret);
   25215 }
   25216 
   25217 
   25218 #define gen_nb_xmlNotationTablePtr 1
   25219 static xmlNotationTablePtr gen_xmlNotationTablePtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
   25220     return(NULL);
   25221 }
   25222 static void des_xmlNotationTablePtr(int no ATTRIBUTE_UNUSED, xmlNotationTablePtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
   25223 }
   25224 
   25225 static int
   25226 test_xmlCopyNotationTable(void) {
   25227     int test_ret = 0;
   25228 
   25229 
   25230     /* missing type support */
   25231     return(test_ret);
   25232 }
   25233 
   25234 
   25235 static int
   25236 test_xmlCreateEnumeration(void) {
   25237     int test_ret = 0;
   25238 
   25239 
   25240     /* missing type support */
   25241     return(test_ret);
   25242 }
   25243 
   25244 
   25245 #define gen_nb_xmlAttributePtr 1
   25246 static xmlAttributePtr gen_xmlAttributePtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
   25247     return(NULL);
   25248 }
   25249 static void des_xmlAttributePtr(int no ATTRIBUTE_UNUSED, xmlAttributePtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
   25250 }
   25251 
   25252 static int
   25253 test_xmlDumpAttributeDecl(void) {
   25254     int test_ret = 0;
   25255 
   25256 #if defined(LIBXML_OUTPUT_ENABLED)
   25257     int mem_base;
   25258     xmlBufferPtr buf; /* the XML buffer output */
   25259     int n_buf;
   25260     xmlAttributePtr attr; /* An attribute declaration */
   25261     int n_attr;
   25262 
   25263     for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
   25264     for (n_attr = 0;n_attr < gen_nb_xmlAttributePtr;n_attr++) {
   25265         mem_base = xmlMemBlocks();
   25266         buf = gen_xmlBufferPtr(n_buf, 0);
   25267         attr = gen_xmlAttributePtr(n_attr, 1);
   25268 
   25269         xmlDumpAttributeDecl(buf, attr);
   25270         call_tests++;
   25271         des_xmlBufferPtr(n_buf, buf, 0);
   25272         des_xmlAttributePtr(n_attr, attr, 1);
   25273         xmlResetLastError();
   25274         if (mem_base != xmlMemBlocks()) {
   25275             printf("Leak of %d blocks found in xmlDumpAttributeDecl",
   25276 	           xmlMemBlocks() - mem_base);
   25277 	    test_ret++;
   25278             printf(" %d", n_buf);
   25279             printf(" %d", n_attr);
   25280             printf("\n");
   25281         }
   25282     }
   25283     }
   25284     function_tests++;
   25285 #endif
   25286 
   25287     return(test_ret);
   25288 }
   25289 
   25290 
   25291 static int
   25292 test_xmlDumpAttributeTable(void) {
   25293     int test_ret = 0;
   25294 
   25295 #if defined(LIBXML_OUTPUT_ENABLED)
   25296     int mem_base;
   25297     xmlBufferPtr buf; /* the XML buffer output */
   25298     int n_buf;
   25299     xmlAttributeTablePtr table; /* An attribute table */
   25300     int n_table;
   25301 
   25302     for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
   25303     for (n_table = 0;n_table < gen_nb_xmlAttributeTablePtr;n_table++) {
   25304         mem_base = xmlMemBlocks();
   25305         buf = gen_xmlBufferPtr(n_buf, 0);
   25306         table = gen_xmlAttributeTablePtr(n_table, 1);
   25307 
   25308         xmlDumpAttributeTable(buf, table);
   25309         call_tests++;
   25310         des_xmlBufferPtr(n_buf, buf, 0);
   25311         des_xmlAttributeTablePtr(n_table, table, 1);
   25312         xmlResetLastError();
   25313         if (mem_base != xmlMemBlocks()) {
   25314             printf("Leak of %d blocks found in xmlDumpAttributeTable",
   25315 	           xmlMemBlocks() - mem_base);
   25316 	    test_ret++;
   25317             printf(" %d", n_buf);
   25318             printf(" %d", n_table);
   25319             printf("\n");
   25320         }
   25321     }
   25322     }
   25323     function_tests++;
   25324 #endif
   25325 
   25326     return(test_ret);
   25327 }
   25328 
   25329 
   25330 #define gen_nb_xmlElementPtr 1
   25331 static xmlElementPtr gen_xmlElementPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
   25332     return(NULL);
   25333 }
   25334 static void des_xmlElementPtr(int no ATTRIBUTE_UNUSED, xmlElementPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
   25335 }
   25336 
   25337 static int
   25338 test_xmlDumpElementDecl(void) {
   25339     int test_ret = 0;
   25340 
   25341 #if defined(LIBXML_OUTPUT_ENABLED)
   25342     int mem_base;
   25343     xmlBufferPtr buf; /* the XML buffer output */
   25344     int n_buf;
   25345     xmlElementPtr elem; /* An element table */
   25346     int n_elem;
   25347 
   25348     for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
   25349     for (n_elem = 0;n_elem < gen_nb_xmlElementPtr;n_elem++) {
   25350         mem_base = xmlMemBlocks();
   25351         buf = gen_xmlBufferPtr(n_buf, 0);
   25352         elem = gen_xmlElementPtr(n_elem, 1);
   25353 
   25354         xmlDumpElementDecl(buf, elem);
   25355         call_tests++;
   25356         des_xmlBufferPtr(n_buf, buf, 0);
   25357         des_xmlElementPtr(n_elem, elem, 1);
   25358         xmlResetLastError();
   25359         if (mem_base != xmlMemBlocks()) {
   25360             printf("Leak of %d blocks found in xmlDumpElementDecl",
   25361 	           xmlMemBlocks() - mem_base);
   25362 	    test_ret++;
   25363             printf(" %d", n_buf);
   25364             printf(" %d", n_elem);
   25365             printf("\n");
   25366         }
   25367     }
   25368     }
   25369     function_tests++;
   25370 #endif
   25371 
   25372     return(test_ret);
   25373 }
   25374 
   25375 
   25376 static int
   25377 test_xmlDumpElementTable(void) {
   25378     int test_ret = 0;
   25379 
   25380 #if defined(LIBXML_OUTPUT_ENABLED)
   25381     int mem_base;
   25382     xmlBufferPtr buf; /* the XML buffer output */
   25383     int n_buf;
   25384     xmlElementTablePtr table; /* An element table */
   25385     int n_table;
   25386 
   25387     for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
   25388     for (n_table = 0;n_table < gen_nb_xmlElementTablePtr;n_table++) {
   25389         mem_base = xmlMemBlocks();
   25390         buf = gen_xmlBufferPtr(n_buf, 0);
   25391         table = gen_xmlElementTablePtr(n_table, 1);
   25392 
   25393         xmlDumpElementTable(buf, table);
   25394         call_tests++;
   25395         des_xmlBufferPtr(n_buf, buf, 0);
   25396         des_xmlElementTablePtr(n_table, table, 1);
   25397         xmlResetLastError();
   25398         if (mem_base != xmlMemBlocks()) {
   25399             printf("Leak of %d blocks found in xmlDumpElementTable",
   25400 	           xmlMemBlocks() - mem_base);
   25401 	    test_ret++;
   25402             printf(" %d", n_buf);
   25403             printf(" %d", n_table);
   25404             printf("\n");
   25405         }
   25406     }
   25407     }
   25408     function_tests++;
   25409 #endif
   25410 
   25411     return(test_ret);
   25412 }
   25413 
   25414 
   25415 #define gen_nb_xmlNotationPtr 1
   25416 static xmlNotationPtr gen_xmlNotationPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
   25417     return(NULL);
   25418 }
   25419 static void des_xmlNotationPtr(int no ATTRIBUTE_UNUSED, xmlNotationPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
   25420 }
   25421 
   25422 static int
   25423 test_xmlDumpNotationDecl(void) {
   25424     int test_ret = 0;
   25425 
   25426 #if defined(LIBXML_OUTPUT_ENABLED)
   25427     int mem_base;
   25428     xmlBufferPtr buf; /* the XML buffer output */
   25429     int n_buf;
   25430     xmlNotationPtr nota; /* A notation declaration */
   25431     int n_nota;
   25432 
   25433     for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
   25434     for (n_nota = 0;n_nota < gen_nb_xmlNotationPtr;n_nota++) {
   25435         mem_base = xmlMemBlocks();
   25436         buf = gen_xmlBufferPtr(n_buf, 0);
   25437         nota = gen_xmlNotationPtr(n_nota, 1);
   25438 
   25439         xmlDumpNotationDecl(buf, nota);
   25440         call_tests++;
   25441         des_xmlBufferPtr(n_buf, buf, 0);
   25442         des_xmlNotationPtr(n_nota, nota, 1);
   25443         xmlResetLastError();
   25444         if (mem_base != xmlMemBlocks()) {
   25445             printf("Leak of %d blocks found in xmlDumpNotationDecl",
   25446 	           xmlMemBlocks() - mem_base);
   25447 	    test_ret++;
   25448             printf(" %d", n_buf);
   25449             printf(" %d", n_nota);
   25450             printf("\n");
   25451         }
   25452     }
   25453     }
   25454     function_tests++;
   25455 #endif
   25456 
   25457     return(test_ret);
   25458 }
   25459 
   25460 
   25461 static int
   25462 test_xmlDumpNotationTable(void) {
   25463     int test_ret = 0;
   25464 
   25465 #if defined(LIBXML_OUTPUT_ENABLED)
   25466     int mem_base;
   25467     xmlBufferPtr buf; /* the XML buffer output */
   25468     int n_buf;
   25469     xmlNotationTablePtr table; /* A notation table */
   25470     int n_table;
   25471 
   25472     for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
   25473     for (n_table = 0;n_table < gen_nb_xmlNotationTablePtr;n_table++) {
   25474         mem_base = xmlMemBlocks();
   25475         buf = gen_xmlBufferPtr(n_buf, 0);
   25476         table = gen_xmlNotationTablePtr(n_table, 1);
   25477 
   25478         xmlDumpNotationTable(buf, table);
   25479         call_tests++;
   25480         des_xmlBufferPtr(n_buf, buf, 0);
   25481         des_xmlNotationTablePtr(n_table, table, 1);
   25482         xmlResetLastError();
   25483         if (mem_base != xmlMemBlocks()) {
   25484             printf("Leak of %d blocks found in xmlDumpNotationTable",
   25485 	           xmlMemBlocks() - mem_base);
   25486 	    test_ret++;
   25487             printf(" %d", n_buf);
   25488             printf(" %d", n_table);
   25489             printf("\n");
   25490         }
   25491     }
   25492     }
   25493     function_tests++;
   25494 #endif
   25495 
   25496     return(test_ret);
   25497 }
   25498 
   25499 
   25500 static int
   25501 test_xmlGetDtdAttrDesc(void) {
   25502     int test_ret = 0;
   25503 
   25504     int mem_base;
   25505     xmlAttributePtr ret_val;
   25506     xmlDtdPtr dtd; /* a pointer to the DtD to search */
   25507     int n_dtd;
   25508     xmlChar * elem; /* the element name */
   25509     int n_elem;
   25510     xmlChar * name; /* the attribute name */
   25511     int n_name;
   25512 
   25513     for (n_dtd = 0;n_dtd < gen_nb_xmlDtdPtr;n_dtd++) {
   25514     for (n_elem = 0;n_elem < gen_nb_const_xmlChar_ptr;n_elem++) {
   25515     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
   25516         mem_base = xmlMemBlocks();
   25517         dtd = gen_xmlDtdPtr(n_dtd, 0);
   25518         elem = gen_const_xmlChar_ptr(n_elem, 1);
   25519         name = gen_const_xmlChar_ptr(n_name, 2);
   25520 
   25521         ret_val = xmlGetDtdAttrDesc(dtd, (const xmlChar *)elem, (const xmlChar *)name);
   25522         desret_xmlAttributePtr(ret_val);
   25523         call_tests++;
   25524         des_xmlDtdPtr(n_dtd, dtd, 0);
   25525         des_const_xmlChar_ptr(n_elem, (const xmlChar *)elem, 1);
   25526         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 2);
   25527         xmlResetLastError();
   25528         if (mem_base != xmlMemBlocks()) {
   25529             printf("Leak of %d blocks found in xmlGetDtdAttrDesc",
   25530 	           xmlMemBlocks() - mem_base);
   25531 	    test_ret++;
   25532             printf(" %d", n_dtd);
   25533             printf(" %d", n_elem);
   25534             printf(" %d", n_name);
   25535             printf("\n");
   25536         }
   25537     }
   25538     }
   25539     }
   25540     function_tests++;
   25541 
   25542     return(test_ret);
   25543 }
   25544 
   25545 
   25546 static int
   25547 test_xmlGetDtdElementDesc(void) {
   25548     int test_ret = 0;
   25549 
   25550     int mem_base;
   25551     xmlElementPtr ret_val;
   25552     xmlDtdPtr dtd; /* a pointer to the DtD to search */
   25553     int n_dtd;
   25554     xmlChar * name; /* the element name */
   25555     int n_name;
   25556 
   25557     for (n_dtd = 0;n_dtd < gen_nb_xmlDtdPtr;n_dtd++) {
   25558     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
   25559         mem_base = xmlMemBlocks();
   25560         dtd = gen_xmlDtdPtr(n_dtd, 0);
   25561         name = gen_const_xmlChar_ptr(n_name, 1);
   25562 
   25563         ret_val = xmlGetDtdElementDesc(dtd, (const xmlChar *)name);
   25564         desret_xmlElementPtr(ret_val);
   25565         call_tests++;
   25566         des_xmlDtdPtr(n_dtd, dtd, 0);
   25567         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
   25568         xmlResetLastError();
   25569         if (mem_base != xmlMemBlocks()) {
   25570             printf("Leak of %d blocks found in xmlGetDtdElementDesc",
   25571 	           xmlMemBlocks() - mem_base);
   25572 	    test_ret++;
   25573             printf(" %d", n_dtd);
   25574             printf(" %d", n_name);
   25575             printf("\n");
   25576         }
   25577     }
   25578     }
   25579     function_tests++;
   25580 
   25581     return(test_ret);
   25582 }
   25583 
   25584 
   25585 static int
   25586 test_xmlGetDtdNotationDesc(void) {
   25587     int test_ret = 0;
   25588 
   25589 
   25590     /* missing type support */
   25591     return(test_ret);
   25592 }
   25593 
   25594 
   25595 static int
   25596 test_xmlGetDtdQAttrDesc(void) {
   25597     int test_ret = 0;
   25598 
   25599     int mem_base;
   25600     xmlAttributePtr ret_val;
   25601     xmlDtdPtr dtd; /* a pointer to the DtD to search */
   25602     int n_dtd;
   25603     xmlChar * elem; /* the element name */
   25604     int n_elem;
   25605     xmlChar * name; /* the attribute name */
   25606     int n_name;
   25607     xmlChar * prefix; /* the attribute namespace prefix */
   25608     int n_prefix;
   25609 
   25610     for (n_dtd = 0;n_dtd < gen_nb_xmlDtdPtr;n_dtd++) {
   25611     for (n_elem = 0;n_elem < gen_nb_const_xmlChar_ptr;n_elem++) {
   25612     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
   25613     for (n_prefix = 0;n_prefix < gen_nb_const_xmlChar_ptr;n_prefix++) {
   25614         mem_base = xmlMemBlocks();
   25615         dtd = gen_xmlDtdPtr(n_dtd, 0);
   25616         elem = gen_const_xmlChar_ptr(n_elem, 1);
   25617         name = gen_const_xmlChar_ptr(n_name, 2);
   25618         prefix = gen_const_xmlChar_ptr(n_prefix, 3);
   25619 
   25620         ret_val = xmlGetDtdQAttrDesc(dtd, (const xmlChar *)elem, (const xmlChar *)name, (const xmlChar *)prefix);
   25621         desret_xmlAttributePtr(ret_val);
   25622         call_tests++;
   25623         des_xmlDtdPtr(n_dtd, dtd, 0);
   25624         des_const_xmlChar_ptr(n_elem, (const xmlChar *)elem, 1);
   25625         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 2);
   25626         des_const_xmlChar_ptr(n_prefix, (const xmlChar *)prefix, 3);
   25627         xmlResetLastError();
   25628         if (mem_base != xmlMemBlocks()) {
   25629             printf("Leak of %d blocks found in xmlGetDtdQAttrDesc",
   25630 	           xmlMemBlocks() - mem_base);
   25631 	    test_ret++;
   25632             printf(" %d", n_dtd);
   25633             printf(" %d", n_elem);
   25634             printf(" %d", n_name);
   25635             printf(" %d", n_prefix);
   25636             printf("\n");
   25637         }
   25638     }
   25639     }
   25640     }
   25641     }
   25642     function_tests++;
   25643 
   25644     return(test_ret);
   25645 }
   25646 
   25647 
   25648 static int
   25649 test_xmlGetDtdQElementDesc(void) {
   25650     int test_ret = 0;
   25651 
   25652     int mem_base;
   25653     xmlElementPtr ret_val;
   25654     xmlDtdPtr dtd; /* a pointer to the DtD to search */
   25655     int n_dtd;
   25656     xmlChar * name; /* the element name */
   25657     int n_name;
   25658     xmlChar * prefix; /* the element namespace prefix */
   25659     int n_prefix;
   25660 
   25661     for (n_dtd = 0;n_dtd < gen_nb_xmlDtdPtr;n_dtd++) {
   25662     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
   25663     for (n_prefix = 0;n_prefix < gen_nb_const_xmlChar_ptr;n_prefix++) {
   25664         mem_base = xmlMemBlocks();
   25665         dtd = gen_xmlDtdPtr(n_dtd, 0);
   25666         name = gen_const_xmlChar_ptr(n_name, 1);
   25667         prefix = gen_const_xmlChar_ptr(n_prefix, 2);
   25668 
   25669         ret_val = xmlGetDtdQElementDesc(dtd, (const xmlChar *)name, (const xmlChar *)prefix);
   25670         desret_xmlElementPtr(ret_val);
   25671         call_tests++;
   25672         des_xmlDtdPtr(n_dtd, dtd, 0);
   25673         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
   25674         des_const_xmlChar_ptr(n_prefix, (const xmlChar *)prefix, 2);
   25675         xmlResetLastError();
   25676         if (mem_base != xmlMemBlocks()) {
   25677             printf("Leak of %d blocks found in xmlGetDtdQElementDesc",
   25678 	           xmlMemBlocks() - mem_base);
   25679 	    test_ret++;
   25680             printf(" %d", n_dtd);
   25681             printf(" %d", n_name);
   25682             printf(" %d", n_prefix);
   25683             printf("\n");
   25684         }
   25685     }
   25686     }
   25687     }
   25688     function_tests++;
   25689 
   25690     return(test_ret);
   25691 }
   25692 
   25693 
   25694 static int
   25695 test_xmlGetID(void) {
   25696     int test_ret = 0;
   25697 
   25698     int mem_base;
   25699     xmlAttrPtr ret_val;
   25700     xmlDocPtr doc; /* pointer to the document */
   25701     int n_doc;
   25702     xmlChar * ID; /* the ID value */
   25703     int n_ID;
   25704 
   25705     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
   25706     for (n_ID = 0;n_ID < gen_nb_const_xmlChar_ptr;n_ID++) {
   25707         mem_base = xmlMemBlocks();
   25708         doc = gen_xmlDocPtr(n_doc, 0);
   25709         ID = gen_const_xmlChar_ptr(n_ID, 1);
   25710 
   25711         ret_val = xmlGetID(doc, (const xmlChar *)ID);
   25712         desret_xmlAttrPtr(ret_val);
   25713         call_tests++;
   25714         des_xmlDocPtr(n_doc, doc, 0);
   25715         des_const_xmlChar_ptr(n_ID, (const xmlChar *)ID, 1);
   25716         xmlResetLastError();
   25717         if (mem_base != xmlMemBlocks()) {
   25718             printf("Leak of %d blocks found in xmlGetID",
   25719 	           xmlMemBlocks() - mem_base);
   25720 	    test_ret++;
   25721             printf(" %d", n_doc);
   25722             printf(" %d", n_ID);
   25723             printf("\n");
   25724         }
   25725     }
   25726     }
   25727     function_tests++;
   25728 
   25729     return(test_ret);
   25730 }
   25731 
   25732 
   25733 static int
   25734 test_xmlGetRefs(void) {
   25735     int test_ret = 0;
   25736 
   25737 
   25738     /* missing type support */
   25739     return(test_ret);
   25740 }
   25741 
   25742 
   25743 static int
   25744 test_xmlIsID(void) {
   25745     int test_ret = 0;
   25746 
   25747     int mem_base;
   25748     int ret_val;
   25749     xmlDocPtr doc; /* the document */
   25750     int n_doc;
   25751     xmlNodePtr elem; /* the element carrying the attribute */
   25752     int n_elem;
   25753     xmlAttrPtr attr; /* the attribute */
   25754     int n_attr;
   25755 
   25756     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
   25757     for (n_elem = 0;n_elem < gen_nb_xmlNodePtr;n_elem++) {
   25758     for (n_attr = 0;n_attr < gen_nb_xmlAttrPtr;n_attr++) {
   25759         mem_base = xmlMemBlocks();
   25760         doc = gen_xmlDocPtr(n_doc, 0);
   25761         elem = gen_xmlNodePtr(n_elem, 1);
   25762         attr = gen_xmlAttrPtr(n_attr, 2);
   25763 
   25764         ret_val = xmlIsID(doc, elem, attr);
   25765         desret_int(ret_val);
   25766         call_tests++;
   25767         des_xmlDocPtr(n_doc, doc, 0);
   25768         des_xmlNodePtr(n_elem, elem, 1);
   25769         des_xmlAttrPtr(n_attr, attr, 2);
   25770         xmlResetLastError();
   25771         if (mem_base != xmlMemBlocks()) {
   25772             printf("Leak of %d blocks found in xmlIsID",
   25773 	           xmlMemBlocks() - mem_base);
   25774 	    test_ret++;
   25775             printf(" %d", n_doc);
   25776             printf(" %d", n_elem);
   25777             printf(" %d", n_attr);
   25778             printf("\n");
   25779         }
   25780     }
   25781     }
   25782     }
   25783     function_tests++;
   25784 
   25785     return(test_ret);
   25786 }
   25787 
   25788 
   25789 static int
   25790 test_xmlIsMixedElement(void) {
   25791     int test_ret = 0;
   25792 
   25793     int mem_base;
   25794     int ret_val;
   25795     xmlDocPtr doc; /* the document */
   25796     int n_doc;
   25797     xmlChar * name; /* the element name */
   25798     int n_name;
   25799 
   25800     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
   25801     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
   25802         mem_base = xmlMemBlocks();
   25803         doc = gen_xmlDocPtr(n_doc, 0);
   25804         name = gen_const_xmlChar_ptr(n_name, 1);
   25805 
   25806         ret_val = xmlIsMixedElement(doc, (const xmlChar *)name);
   25807         desret_int(ret_val);
   25808         call_tests++;
   25809         des_xmlDocPtr(n_doc, doc, 0);
   25810         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
   25811         xmlResetLastError();
   25812         if (mem_base != xmlMemBlocks()) {
   25813             printf("Leak of %d blocks found in xmlIsMixedElement",
   25814 	           xmlMemBlocks() - mem_base);
   25815 	    test_ret++;
   25816             printf(" %d", n_doc);
   25817             printf(" %d", n_name);
   25818             printf("\n");
   25819         }
   25820     }
   25821     }
   25822     function_tests++;
   25823 
   25824     return(test_ret);
   25825 }
   25826 
   25827 
   25828 static int
   25829 test_xmlIsRef(void) {
   25830     int test_ret = 0;
   25831 
   25832     int mem_base;
   25833     int ret_val;
   25834     xmlDocPtr doc; /* the document */
   25835     int n_doc;
   25836     xmlNodePtr elem; /* the element carrying the attribute */
   25837     int n_elem;
   25838     xmlAttrPtr attr; /* the attribute */
   25839     int n_attr;
   25840 
   25841     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
   25842     for (n_elem = 0;n_elem < gen_nb_xmlNodePtr;n_elem++) {
   25843     for (n_attr = 0;n_attr < gen_nb_xmlAttrPtr;n_attr++) {
   25844         mem_base = xmlMemBlocks();
   25845         doc = gen_xmlDocPtr(n_doc, 0);
   25846         elem = gen_xmlNodePtr(n_elem, 1);
   25847         attr = gen_xmlAttrPtr(n_attr, 2);
   25848 
   25849         ret_val = xmlIsRef(doc, elem, attr);
   25850         desret_int(ret_val);
   25851         call_tests++;
   25852         des_xmlDocPtr(n_doc, doc, 0);
   25853         des_xmlNodePtr(n_elem, elem, 1);
   25854         des_xmlAttrPtr(n_attr, attr, 2);
   25855         xmlResetLastError();
   25856         if (mem_base != xmlMemBlocks()) {
   25857             printf("Leak of %d blocks found in xmlIsRef",
   25858 	           xmlMemBlocks() - mem_base);
   25859 	    test_ret++;
   25860             printf(" %d", n_doc);
   25861             printf(" %d", n_elem);
   25862             printf(" %d", n_attr);
   25863             printf("\n");
   25864         }
   25865     }
   25866     }
   25867     }
   25868     function_tests++;
   25869 
   25870     return(test_ret);
   25871 }
   25872 
   25873 
   25874 static int
   25875 test_xmlNewDocElementContent(void) {
   25876     int test_ret = 0;
   25877 
   25878     int mem_base;
   25879     xmlElementContentPtr ret_val;
   25880     xmlDocPtr doc; /* the document */
   25881     int n_doc;
   25882     xmlChar * name; /* the subelement name or NULL */
   25883     int n_name;
   25884     xmlElementContentType type; /* the type of element content decl */
   25885     int n_type;
   25886 
   25887     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
   25888     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
   25889     for (n_type = 0;n_type < gen_nb_xmlElementContentType;n_type++) {
   25890         mem_base = xmlMemBlocks();
   25891         doc = gen_xmlDocPtr(n_doc, 0);
   25892         name = gen_const_xmlChar_ptr(n_name, 1);
   25893         type = gen_xmlElementContentType(n_type, 2);
   25894 
   25895         ret_val = xmlNewDocElementContent(doc, (const xmlChar *)name, type);
   25896         xmlFreeDocElementContent(doc, ret_val); ret_val = NULL;
   25897         desret_xmlElementContentPtr(ret_val);
   25898         call_tests++;
   25899         des_xmlDocPtr(n_doc, doc, 0);
   25900         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
   25901         des_xmlElementContentType(n_type, type, 2);
   25902         xmlResetLastError();
   25903         if (mem_base != xmlMemBlocks()) {
   25904             printf("Leak of %d blocks found in xmlNewDocElementContent",
   25905 	           xmlMemBlocks() - mem_base);
   25906 	    test_ret++;
   25907             printf(" %d", n_doc);
   25908             printf(" %d", n_name);
   25909             printf(" %d", n_type);
   25910             printf("\n");
   25911         }
   25912     }
   25913     }
   25914     }
   25915     function_tests++;
   25916 
   25917     return(test_ret);
   25918 }
   25919 
   25920 
   25921 static int
   25922 test_xmlNewElementContent(void) {
   25923     int test_ret = 0;
   25924 
   25925     int mem_base;
   25926     xmlElementContentPtr ret_val;
   25927     xmlChar * name; /* the subelement name or NULL */
   25928     int n_name;
   25929     xmlElementContentType type; /* the type of element content decl */
   25930     int n_type;
   25931 
   25932     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
   25933     for (n_type = 0;n_type < gen_nb_xmlElementContentType;n_type++) {
   25934         mem_base = xmlMemBlocks();
   25935         name = gen_const_xmlChar_ptr(n_name, 0);
   25936         type = gen_xmlElementContentType(n_type, 1);
   25937 
   25938         ret_val = xmlNewElementContent((const xmlChar *)name, type);
   25939         desret_xmlElementContentPtr(ret_val);
   25940         call_tests++;
   25941         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 0);
   25942         des_xmlElementContentType(n_type, type, 1);
   25943         xmlResetLastError();
   25944         if (mem_base != xmlMemBlocks()) {
   25945             printf("Leak of %d blocks found in xmlNewElementContent",
   25946 	           xmlMemBlocks() - mem_base);
   25947 	    test_ret++;
   25948             printf(" %d", n_name);
   25949             printf(" %d", n_type);
   25950             printf("\n");
   25951         }
   25952     }
   25953     }
   25954     function_tests++;
   25955 
   25956     return(test_ret);
   25957 }
   25958 
   25959 
   25960 static int
   25961 test_xmlNewValidCtxt(void) {
   25962     int test_ret = 0;
   25963 
   25964 
   25965     /* missing type support */
   25966     return(test_ret);
   25967 }
   25968 
   25969 
   25970 static int
   25971 test_xmlRemoveID(void) {
   25972     int test_ret = 0;
   25973 
   25974     int mem_base;
   25975     int ret_val;
   25976     xmlDocPtr doc; /* the document */
   25977     int n_doc;
   25978     xmlAttrPtr attr; /* the attribute */
   25979     int n_attr;
   25980 
   25981     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
   25982     for (n_attr = 0;n_attr < gen_nb_xmlAttrPtr;n_attr++) {
   25983         mem_base = xmlMemBlocks();
   25984         doc = gen_xmlDocPtr(n_doc, 0);
   25985         attr = gen_xmlAttrPtr(n_attr, 1);
   25986 
   25987         ret_val = xmlRemoveID(doc, attr);
   25988         desret_int(ret_val);
   25989         call_tests++;
   25990         des_xmlDocPtr(n_doc, doc, 0);
   25991         des_xmlAttrPtr(n_attr, attr, 1);
   25992         xmlResetLastError();
   25993         if (mem_base != xmlMemBlocks()) {
   25994             printf("Leak of %d blocks found in xmlRemoveID",
   25995 	           xmlMemBlocks() - mem_base);
   25996 	    test_ret++;
   25997             printf(" %d", n_doc);
   25998             printf(" %d", n_attr);
   25999             printf("\n");
   26000         }
   26001     }
   26002     }
   26003     function_tests++;
   26004 
   26005     return(test_ret);
   26006 }
   26007 
   26008 
   26009 static int
   26010 test_xmlRemoveRef(void) {
   26011     int test_ret = 0;
   26012 
   26013     int mem_base;
   26014     int ret_val;
   26015     xmlDocPtr doc; /* the document */
   26016     int n_doc;
   26017     xmlAttrPtr attr; /* the attribute */
   26018     int n_attr;
   26019 
   26020     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
   26021     for (n_attr = 0;n_attr < gen_nb_xmlAttrPtr;n_attr++) {
   26022         mem_base = xmlMemBlocks();
   26023         doc = gen_xmlDocPtr(n_doc, 0);
   26024         attr = gen_xmlAttrPtr(n_attr, 1);
   26025 
   26026         ret_val = xmlRemoveRef(doc, attr);
   26027         desret_int(ret_val);
   26028         call_tests++;
   26029         des_xmlDocPtr(n_doc, doc, 0);
   26030         des_xmlAttrPtr(n_attr, attr, 1);
   26031         xmlResetLastError();
   26032         if (mem_base != xmlMemBlocks()) {
   26033             printf("Leak of %d blocks found in xmlRemoveRef",
   26034 	           xmlMemBlocks() - mem_base);
   26035 	    test_ret++;
   26036             printf(" %d", n_doc);
   26037             printf(" %d", n_attr);
   26038             printf("\n");
   26039         }
   26040     }
   26041     }
   26042     function_tests++;
   26043 
   26044     return(test_ret);
   26045 }
   26046 
   26047 
   26048 static int
   26049 test_xmlSnprintfElementContent(void) {
   26050     int test_ret = 0;
   26051 
   26052     int mem_base;
   26053     char * buf; /* an output buffer */
   26054     int n_buf;
   26055     int size; /* the buffer size */
   26056     int n_size;
   26057     xmlElementContentPtr content; /* An element table */
   26058     int n_content;
   26059     int englob; /* 1 if one must print the englobing parenthesis, 0 otherwise */
   26060     int n_englob;
   26061 
   26062     for (n_buf = 0;n_buf < gen_nb_char_ptr;n_buf++) {
   26063     for (n_size = 0;n_size < gen_nb_int;n_size++) {
   26064     for (n_content = 0;n_content < gen_nb_xmlElementContentPtr;n_content++) {
   26065     for (n_englob = 0;n_englob < gen_nb_int;n_englob++) {
   26066         mem_base = xmlMemBlocks();
   26067         buf = gen_char_ptr(n_buf, 0);
   26068         size = gen_int(n_size, 1);
   26069         content = gen_xmlElementContentPtr(n_content, 2);
   26070         englob = gen_int(n_englob, 3);
   26071 
   26072         xmlSnprintfElementContent(buf, size, content, englob);
   26073         call_tests++;
   26074         des_char_ptr(n_buf, buf, 0);
   26075         des_int(n_size, size, 1);
   26076         des_xmlElementContentPtr(n_content, content, 2);
   26077         des_int(n_englob, englob, 3);
   26078         xmlResetLastError();
   26079         if (mem_base != xmlMemBlocks()) {
   26080             printf("Leak of %d blocks found in xmlSnprintfElementContent",
   26081 	           xmlMemBlocks() - mem_base);
   26082 	    test_ret++;
   26083             printf(" %d", n_buf);
   26084             printf(" %d", n_size);
   26085             printf(" %d", n_content);
   26086             printf(" %d", n_englob);
   26087             printf("\n");
   26088         }
   26089     }
   26090     }
   26091     }
   26092     }
   26093     function_tests++;
   26094 
   26095     return(test_ret);
   26096 }
   26097 
   26098 
   26099 static int
   26100 test_xmlSprintfElementContent(void) {
   26101     int test_ret = 0;
   26102 
   26103 #if defined(LIBXML_OUTPUT_ENABLED)
   26104 #ifdef LIBXML_OUTPUT_ENABLED
   26105     int mem_base;
   26106     char * buf; /* an output buffer */
   26107     int n_buf;
   26108     xmlElementContentPtr content; /* An element table */
   26109     int n_content;
   26110     int englob; /* 1 if one must print the englobing parenthesis, 0 otherwise */
   26111     int n_englob;
   26112 
   26113     for (n_buf = 0;n_buf < gen_nb_char_ptr;n_buf++) {
   26114     for (n_content = 0;n_content < gen_nb_xmlElementContentPtr;n_content++) {
   26115     for (n_englob = 0;n_englob < gen_nb_int;n_englob++) {
   26116         mem_base = xmlMemBlocks();
   26117         buf = gen_char_ptr(n_buf, 0);
   26118         content = gen_xmlElementContentPtr(n_content, 1);
   26119         englob = gen_int(n_englob, 2);
   26120 
   26121         xmlSprintfElementContent(buf, content, englob);
   26122         call_tests++;
   26123         des_char_ptr(n_buf, buf, 0);
   26124         des_xmlElementContentPtr(n_content, content, 1);
   26125         des_int(n_englob, englob, 2);
   26126         xmlResetLastError();
   26127         if (mem_base != xmlMemBlocks()) {
   26128             printf("Leak of %d blocks found in xmlSprintfElementContent",
   26129 	           xmlMemBlocks() - mem_base);
   26130 	    test_ret++;
   26131             printf(" %d", n_buf);
   26132             printf(" %d", n_content);
   26133             printf(" %d", n_englob);
   26134             printf("\n");
   26135         }
   26136     }
   26137     }
   26138     }
   26139     function_tests++;
   26140 #endif
   26141 #endif
   26142 
   26143     return(test_ret);
   26144 }
   26145 
   26146 
   26147 static int
   26148 test_xmlValidBuildContentModel(void) {
   26149     int test_ret = 0;
   26150 
   26151 #if defined(LIBXML_VALID_ENABLED) && defined(LIBXML_REGEXP_ENABLED)
   26152     int mem_base;
   26153     int ret_val;
   26154     xmlValidCtxtPtr ctxt; /* a validation context */
   26155     int n_ctxt;
   26156     xmlElementPtr elem; /* an element declaration node */
   26157     int n_elem;
   26158 
   26159     for (n_ctxt = 0;n_ctxt < gen_nb_xmlValidCtxtPtr;n_ctxt++) {
   26160     for (n_elem = 0;n_elem < gen_nb_xmlElementPtr;n_elem++) {
   26161         mem_base = xmlMemBlocks();
   26162         ctxt = gen_xmlValidCtxtPtr(n_ctxt, 0);
   26163         elem = gen_xmlElementPtr(n_elem, 1);
   26164 
   26165         ret_val = xmlValidBuildContentModel(ctxt, elem);
   26166         desret_int(ret_val);
   26167         call_tests++;
   26168         des_xmlValidCtxtPtr(n_ctxt, ctxt, 0);
   26169         des_xmlElementPtr(n_elem, elem, 1);
   26170         xmlResetLastError();
   26171         if (mem_base != xmlMemBlocks()) {
   26172             printf("Leak of %d blocks found in xmlValidBuildContentModel",
   26173 	           xmlMemBlocks() - mem_base);
   26174 	    test_ret++;
   26175             printf(" %d", n_ctxt);
   26176             printf(" %d", n_elem);
   26177             printf("\n");
   26178         }
   26179     }
   26180     }
   26181     function_tests++;
   26182 #endif
   26183 
   26184     return(test_ret);
   26185 }
   26186 
   26187 
   26188 static int
   26189 test_xmlValidCtxtNormalizeAttributeValue(void) {
   26190     int test_ret = 0;
   26191 
   26192 #if defined(LIBXML_VALID_ENABLED)
   26193     int mem_base;
   26194     xmlChar * ret_val;
   26195     xmlValidCtxtPtr ctxt; /* the validation context or NULL */
   26196     int n_ctxt;
   26197     xmlDocPtr doc; /* the document */
   26198     int n_doc;
   26199     xmlNodePtr elem; /* the parent */
   26200     int n_elem;
   26201     xmlChar * name; /* the attribute name */
   26202     int n_name;
   26203     xmlChar * value; /* the attribute value */
   26204     int n_value;
   26205 
   26206     for (n_ctxt = 0;n_ctxt < gen_nb_xmlValidCtxtPtr;n_ctxt++) {
   26207     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
   26208     for (n_elem = 0;n_elem < gen_nb_xmlNodePtr;n_elem++) {
   26209     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
   26210     for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
   26211         mem_base = xmlMemBlocks();
   26212         ctxt = gen_xmlValidCtxtPtr(n_ctxt, 0);
   26213         doc = gen_xmlDocPtr(n_doc, 1);
   26214         elem = gen_xmlNodePtr(n_elem, 2);
   26215         name = gen_const_xmlChar_ptr(n_name, 3);
   26216         value = gen_const_xmlChar_ptr(n_value, 4);
   26217 
   26218         ret_val = xmlValidCtxtNormalizeAttributeValue(ctxt, doc, elem, (const xmlChar *)name, (const xmlChar *)value);
   26219         desret_xmlChar_ptr(ret_val);
   26220         call_tests++;
   26221         des_xmlValidCtxtPtr(n_ctxt, ctxt, 0);
   26222         des_xmlDocPtr(n_doc, doc, 1);
   26223         des_xmlNodePtr(n_elem, elem, 2);
   26224         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 3);
   26225         des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 4);
   26226         xmlResetLastError();
   26227         if (mem_base != xmlMemBlocks()) {
   26228             printf("Leak of %d blocks found in xmlValidCtxtNormalizeAttributeValue",
   26229 	           xmlMemBlocks() - mem_base);
   26230 	    test_ret++;
   26231             printf(" %d", n_ctxt);
   26232             printf(" %d", n_doc);
   26233             printf(" %d", n_elem);
   26234             printf(" %d", n_name);
   26235             printf(" %d", n_value);
   26236             printf("\n");
   26237         }
   26238     }
   26239     }
   26240     }
   26241     }
   26242     }
   26243     function_tests++;
   26244 #endif
   26245 
   26246     return(test_ret);
   26247 }
   26248 
   26249 
   26250 #define gen_nb_xmlElementContent_ptr 1
   26251 static xmlElementContent * gen_xmlElementContent_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
   26252     return(NULL);
   26253 }
   26254 static void des_xmlElementContent_ptr(int no ATTRIBUTE_UNUSED, xmlElementContent * val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
   26255 }
   26256 
   26257 static int
   26258 test_xmlValidGetPotentialChildren(void) {
   26259     int test_ret = 0;
   26260 
   26261 #if defined(LIBXML_VALID_ENABLED)
   26262 #ifdef LIBXML_VALID_ENABLED
   26263     int mem_base;
   26264     int ret_val;
   26265     xmlElementContent * ctree; /* an element content tree */
   26266     int n_ctree;
   26267     xmlChar ** names; /* an array to store the list of child names */
   26268     int n_names;
   26269     int * len; /* a pointer to the number of element in the list */
   26270     int n_len;
   26271     int max; /* the size of the array */
   26272     int n_max;
   26273 
   26274     for (n_ctree = 0;n_ctree < gen_nb_xmlElementContent_ptr;n_ctree++) {
   26275     for (n_names = 0;n_names < gen_nb_const_xmlChar_ptr_ptr;n_names++) {
   26276     for (n_len = 0;n_len < gen_nb_int_ptr;n_len++) {
   26277     for (n_max = 0;n_max < gen_nb_int;n_max++) {
   26278         mem_base = xmlMemBlocks();
   26279         ctree = gen_xmlElementContent_ptr(n_ctree, 0);
   26280         names = gen_const_xmlChar_ptr_ptr(n_names, 1);
   26281         len = gen_int_ptr(n_len, 2);
   26282         max = gen_int(n_max, 3);
   26283 
   26284         ret_val = xmlValidGetPotentialChildren(ctree, (const xmlChar **)names, len, max);
   26285         desret_int(ret_val);
   26286         call_tests++;
   26287         des_xmlElementContent_ptr(n_ctree, ctree, 0);
   26288         des_const_xmlChar_ptr_ptr(n_names, (const xmlChar **)names, 1);
   26289         des_int_ptr(n_len, len, 2);
   26290         des_int(n_max, max, 3);
   26291         xmlResetLastError();
   26292         if (mem_base != xmlMemBlocks()) {
   26293             printf("Leak of %d blocks found in xmlValidGetPotentialChildren",
   26294 	           xmlMemBlocks() - mem_base);
   26295 	    test_ret++;
   26296             printf(" %d", n_ctree);
   26297             printf(" %d", n_names);
   26298             printf(" %d", n_len);
   26299             printf(" %d", n_max);
   26300             printf("\n");
   26301         }
   26302     }
   26303     }
   26304     }
   26305     }
   26306     function_tests++;
   26307 #endif
   26308 #endif
   26309 
   26310     return(test_ret);
   26311 }
   26312 
   26313 
   26314 static int
   26315 test_xmlValidGetValidElements(void) {
   26316     int test_ret = 0;
   26317 
   26318 #if defined(LIBXML_VALID_ENABLED)
   26319 #ifdef LIBXML_VALID_ENABLED
   26320     int mem_base;
   26321     int ret_val;
   26322     xmlNode * prev; /* an element to insert after */
   26323     int n_prev;
   26324     xmlNode * next; /* an element to insert next */
   26325     int n_next;
   26326     xmlChar ** names; /* an array to store the list of child names */
   26327     int n_names;
   26328     int max; /* the size of the array */
   26329     int n_max;
   26330 
   26331     for (n_prev = 0;n_prev < gen_nb_xmlNodePtr;n_prev++) {
   26332     for (n_next = 0;n_next < gen_nb_xmlNodePtr;n_next++) {
   26333     for (n_names = 0;n_names < gen_nb_const_xmlChar_ptr_ptr;n_names++) {
   26334     for (n_max = 0;n_max < gen_nb_int;n_max++) {
   26335         mem_base = xmlMemBlocks();
   26336         prev = gen_xmlNodePtr(n_prev, 0);
   26337         next = gen_xmlNodePtr(n_next, 1);
   26338         names = gen_const_xmlChar_ptr_ptr(n_names, 2);
   26339         max = gen_int(n_max, 3);
   26340 
   26341         ret_val = xmlValidGetValidElements(prev, next, (const xmlChar **)names, max);
   26342         desret_int(ret_val);
   26343         call_tests++;
   26344         des_xmlNodePtr(n_prev, prev, 0);
   26345         des_xmlNodePtr(n_next, next, 1);
   26346         des_const_xmlChar_ptr_ptr(n_names, (const xmlChar **)names, 2);
   26347         des_int(n_max, max, 3);
   26348         xmlResetLastError();
   26349         if (mem_base != xmlMemBlocks()) {
   26350             printf("Leak of %d blocks found in xmlValidGetValidElements",
   26351 	           xmlMemBlocks() - mem_base);
   26352 	    test_ret++;
   26353             printf(" %d", n_prev);
   26354             printf(" %d", n_next);
   26355             printf(" %d", n_names);
   26356             printf(" %d", n_max);
   26357             printf("\n");
   26358         }
   26359     }
   26360     }
   26361     }
   26362     }
   26363     function_tests++;
   26364 #endif
   26365 #endif
   26366 
   26367     return(test_ret);
   26368 }
   26369 
   26370 
   26371 static int
   26372 test_xmlValidNormalizeAttributeValue(void) {
   26373     int test_ret = 0;
   26374 
   26375 #if defined(LIBXML_VALID_ENABLED)
   26376     int mem_base;
   26377     xmlChar * ret_val;
   26378     xmlDocPtr doc; /* the document */
   26379     int n_doc;
   26380     xmlNodePtr elem; /* the parent */
   26381     int n_elem;
   26382     xmlChar * name; /* the attribute name */
   26383     int n_name;
   26384     xmlChar * value; /* the attribute value */
   26385     int n_value;
   26386 
   26387     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
   26388     for (n_elem = 0;n_elem < gen_nb_xmlNodePtr;n_elem++) {
   26389     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
   26390     for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
   26391         mem_base = xmlMemBlocks();
   26392         doc = gen_xmlDocPtr(n_doc, 0);
   26393         elem = gen_xmlNodePtr(n_elem, 1);
   26394         name = gen_const_xmlChar_ptr(n_name, 2);
   26395         value = gen_const_xmlChar_ptr(n_value, 3);
   26396 
   26397         ret_val = xmlValidNormalizeAttributeValue(doc, elem, (const xmlChar *)name, (const xmlChar *)value);
   26398         desret_xmlChar_ptr(ret_val);
   26399         call_tests++;
   26400         des_xmlDocPtr(n_doc, doc, 0);
   26401         des_xmlNodePtr(n_elem, elem, 1);
   26402         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 2);
   26403         des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 3);
   26404         xmlResetLastError();
   26405         if (mem_base != xmlMemBlocks()) {
   26406             printf("Leak of %d blocks found in xmlValidNormalizeAttributeValue",
   26407 	           xmlMemBlocks() - mem_base);
   26408 	    test_ret++;
   26409             printf(" %d", n_doc);
   26410             printf(" %d", n_elem);
   26411             printf(" %d", n_name);
   26412             printf(" %d", n_value);
   26413             printf("\n");
   26414         }
   26415     }
   26416     }
   26417     }
   26418     }
   26419     function_tests++;
   26420 #endif
   26421 
   26422     return(test_ret);
   26423 }
   26424 
   26425 
   26426 static int
   26427 test_xmlValidateAttributeDecl(void) {
   26428     int test_ret = 0;
   26429 
   26430 #if defined(LIBXML_VALID_ENABLED)
   26431     int mem_base;
   26432     int ret_val;
   26433     xmlValidCtxtPtr ctxt; /* the validation context */
   26434     int n_ctxt;
   26435     xmlDocPtr doc; /* a document instance */
   26436     int n_doc;
   26437     xmlAttributePtr attr; /* an attribute definition */
   26438     int n_attr;
   26439 
   26440     for (n_ctxt = 0;n_ctxt < gen_nb_xmlValidCtxtPtr;n_ctxt++) {
   26441     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
   26442     for (n_attr = 0;n_attr < gen_nb_xmlAttributePtr;n_attr++) {
   26443         mem_base = xmlMemBlocks();
   26444         ctxt = gen_xmlValidCtxtPtr(n_ctxt, 0);
   26445         doc = gen_xmlDocPtr(n_doc, 1);
   26446         attr = gen_xmlAttributePtr(n_attr, 2);
   26447 
   26448         ret_val = xmlValidateAttributeDecl(ctxt, doc, attr);
   26449         desret_int(ret_val);
   26450         call_tests++;
   26451         des_xmlValidCtxtPtr(n_ctxt, ctxt, 0);
   26452         des_xmlDocPtr(n_doc, doc, 1);
   26453         des_xmlAttributePtr(n_attr, attr, 2);
   26454         xmlResetLastError();
   26455         if (mem_base != xmlMemBlocks()) {
   26456             printf("Leak of %d blocks found in xmlValidateAttributeDecl",
   26457 	           xmlMemBlocks() - mem_base);
   26458 	    test_ret++;
   26459             printf(" %d", n_ctxt);
   26460             printf(" %d", n_doc);
   26461             printf(" %d", n_attr);
   26462             printf("\n");
   26463         }
   26464     }
   26465     }
   26466     }
   26467     function_tests++;
   26468 #endif
   26469 
   26470     return(test_ret);
   26471 }
   26472 
   26473 
   26474 static int
   26475 test_xmlValidateAttributeValue(void) {
   26476     int test_ret = 0;
   26477 
   26478 #if defined(LIBXML_VALID_ENABLED)
   26479     int mem_base;
   26480     int ret_val;
   26481     xmlAttributeType type; /* an attribute type */
   26482     int n_type;
   26483     xmlChar * value; /* an attribute value */
   26484     int n_value;
   26485 
   26486     for (n_type = 0;n_type < gen_nb_xmlAttributeType;n_type++) {
   26487     for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
   26488         mem_base = xmlMemBlocks();
   26489         type = gen_xmlAttributeType(n_type, 0);
   26490         value = gen_const_xmlChar_ptr(n_value, 1);
   26491 
   26492         ret_val = xmlValidateAttributeValue(type, (const xmlChar *)value);
   26493         desret_int(ret_val);
   26494         call_tests++;
   26495         des_xmlAttributeType(n_type, type, 0);
   26496         des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 1);
   26497         xmlResetLastError();
   26498         if (mem_base != xmlMemBlocks()) {
   26499             printf("Leak of %d blocks found in xmlValidateAttributeValue",
   26500 	           xmlMemBlocks() - mem_base);
   26501 	    test_ret++;
   26502             printf(" %d", n_type);
   26503             printf(" %d", n_value);
   26504             printf("\n");
   26505         }
   26506     }
   26507     }
   26508     function_tests++;
   26509 #endif
   26510 
   26511     return(test_ret);
   26512 }
   26513 
   26514 
   26515 static int
   26516 test_xmlValidateDocument(void) {
   26517     int test_ret = 0;
   26518 
   26519 #if defined(LIBXML_VALID_ENABLED)
   26520     int mem_base;
   26521     int ret_val;
   26522     xmlValidCtxtPtr ctxt; /* the validation context */
   26523     int n_ctxt;
   26524     xmlDocPtr doc; /* a document instance */
   26525     int n_doc;
   26526 
   26527     for (n_ctxt = 0;n_ctxt < gen_nb_xmlValidCtxtPtr;n_ctxt++) {
   26528     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
   26529         mem_base = xmlMemBlocks();
   26530         ctxt = gen_xmlValidCtxtPtr(n_ctxt, 0);
   26531         doc = gen_xmlDocPtr(n_doc, 1);
   26532 
   26533         ret_val = xmlValidateDocument(ctxt, doc);
   26534         desret_int(ret_val);
   26535         call_tests++;
   26536         des_xmlValidCtxtPtr(n_ctxt, ctxt, 0);
   26537         des_xmlDocPtr(n_doc, doc, 1);
   26538         xmlResetLastError();
   26539         if (mem_base != xmlMemBlocks()) {
   26540             printf("Leak of %d blocks found in xmlValidateDocument",
   26541 	           xmlMemBlocks() - mem_base);
   26542 	    test_ret++;
   26543             printf(" %d", n_ctxt);
   26544             printf(" %d", n_doc);
   26545             printf("\n");
   26546         }
   26547     }
   26548     }
   26549     function_tests++;
   26550 #endif
   26551 
   26552     return(test_ret);
   26553 }
   26554 
   26555 
   26556 static int
   26557 test_xmlValidateDocumentFinal(void) {
   26558     int test_ret = 0;
   26559 
   26560 #if defined(LIBXML_VALID_ENABLED)
   26561     int mem_base;
   26562     int ret_val;
   26563     xmlValidCtxtPtr ctxt; /* the validation context */
   26564     int n_ctxt;
   26565     xmlDocPtr doc; /* a document instance */
   26566     int n_doc;
   26567 
   26568     for (n_ctxt = 0;n_ctxt < gen_nb_xmlValidCtxtPtr;n_ctxt++) {
   26569     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
   26570         mem_base = xmlMemBlocks();
   26571         ctxt = gen_xmlValidCtxtPtr(n_ctxt, 0);
   26572         doc = gen_xmlDocPtr(n_doc, 1);
   26573 
   26574         ret_val = xmlValidateDocumentFinal(ctxt, doc);
   26575         desret_int(ret_val);
   26576         call_tests++;
   26577         des_xmlValidCtxtPtr(n_ctxt, ctxt, 0);
   26578         des_xmlDocPtr(n_doc, doc, 1);
   26579         xmlResetLastError();
   26580         if (mem_base != xmlMemBlocks()) {
   26581             printf("Leak of %d blocks found in xmlValidateDocumentFinal",
   26582 	           xmlMemBlocks() - mem_base);
   26583 	    test_ret++;
   26584             printf(" %d", n_ctxt);
   26585             printf(" %d", n_doc);
   26586             printf("\n");
   26587         }
   26588     }
   26589     }
   26590     function_tests++;
   26591 #endif
   26592 
   26593     return(test_ret);
   26594 }
   26595 
   26596 
   26597 static int
   26598 test_xmlValidateDtd(void) {
   26599     int test_ret = 0;
   26600 
   26601 #if defined(LIBXML_VALID_ENABLED)
   26602     int mem_base;
   26603     int ret_val;
   26604     xmlValidCtxtPtr ctxt; /* the validation context */
   26605     int n_ctxt;
   26606     xmlDocPtr doc; /* a document instance */
   26607     int n_doc;
   26608     xmlDtdPtr dtd; /* a dtd instance */
   26609     int n_dtd;
   26610 
   26611     for (n_ctxt = 0;n_ctxt < gen_nb_xmlValidCtxtPtr;n_ctxt++) {
   26612     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
   26613     for (n_dtd = 0;n_dtd < gen_nb_xmlDtdPtr;n_dtd++) {
   26614         mem_base = xmlMemBlocks();
   26615         ctxt = gen_xmlValidCtxtPtr(n_ctxt, 0);
   26616         doc = gen_xmlDocPtr(n_doc, 1);
   26617         dtd = gen_xmlDtdPtr(n_dtd, 2);
   26618 
   26619         ret_val = xmlValidateDtd(ctxt, doc, dtd);
   26620         desret_int(ret_val);
   26621         call_tests++;
   26622         des_xmlValidCtxtPtr(n_ctxt, ctxt, 0);
   26623         des_xmlDocPtr(n_doc, doc, 1);
   26624         des_xmlDtdPtr(n_dtd, dtd, 2);
   26625         xmlResetLastError();
   26626         if (mem_base != xmlMemBlocks()) {
   26627             printf("Leak of %d blocks found in xmlValidateDtd",
   26628 	           xmlMemBlocks() - mem_base);
   26629 	    test_ret++;
   26630             printf(" %d", n_ctxt);
   26631             printf(" %d", n_doc);
   26632             printf(" %d", n_dtd);
   26633             printf("\n");
   26634         }
   26635     }
   26636     }
   26637     }
   26638     function_tests++;
   26639 #endif
   26640 
   26641     return(test_ret);
   26642 }
   26643 
   26644 
   26645 static int
   26646 test_xmlValidateDtdFinal(void) {
   26647     int test_ret = 0;
   26648 
   26649 #if defined(LIBXML_VALID_ENABLED)
   26650     int mem_base;
   26651     int ret_val;
   26652     xmlValidCtxtPtr ctxt; /* the validation context */
   26653     int n_ctxt;
   26654     xmlDocPtr doc; /* a document instance */
   26655     int n_doc;
   26656 
   26657     for (n_ctxt = 0;n_ctxt < gen_nb_xmlValidCtxtPtr;n_ctxt++) {
   26658     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
   26659         mem_base = xmlMemBlocks();
   26660         ctxt = gen_xmlValidCtxtPtr(n_ctxt, 0);
   26661         doc = gen_xmlDocPtr(n_doc, 1);
   26662 
   26663         ret_val = xmlValidateDtdFinal(ctxt, doc);
   26664         desret_int(ret_val);
   26665         call_tests++;
   26666         des_xmlValidCtxtPtr(n_ctxt, ctxt, 0);
   26667         des_xmlDocPtr(n_doc, doc, 1);
   26668         xmlResetLastError();
   26669         if (mem_base != xmlMemBlocks()) {
   26670             printf("Leak of %d blocks found in xmlValidateDtdFinal",
   26671 	           xmlMemBlocks() - mem_base);
   26672 	    test_ret++;
   26673             printf(" %d", n_ctxt);
   26674             printf(" %d", n_doc);
   26675             printf("\n");
   26676         }
   26677     }
   26678     }
   26679     function_tests++;
   26680 #endif
   26681 
   26682     return(test_ret);
   26683 }
   26684 
   26685 
   26686 static int
   26687 test_xmlValidateElement(void) {
   26688     int test_ret = 0;
   26689 
   26690 #if defined(LIBXML_VALID_ENABLED)
   26691     int mem_base;
   26692     int ret_val;
   26693     xmlValidCtxtPtr ctxt; /* the validation context */
   26694     int n_ctxt;
   26695     xmlDocPtr doc; /* a document instance */
   26696     int n_doc;
   26697     xmlNodePtr elem; /* an element instance */
   26698     int n_elem;
   26699 
   26700     for (n_ctxt = 0;n_ctxt < gen_nb_xmlValidCtxtPtr;n_ctxt++) {
   26701     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
   26702     for (n_elem = 0;n_elem < gen_nb_xmlNodePtr;n_elem++) {
   26703         mem_base = xmlMemBlocks();
   26704         ctxt = gen_xmlValidCtxtPtr(n_ctxt, 0);
   26705         doc = gen_xmlDocPtr(n_doc, 1);
   26706         elem = gen_xmlNodePtr(n_elem, 2);
   26707 
   26708         ret_val = xmlValidateElement(ctxt, doc, elem);
   26709         desret_int(ret_val);
   26710         call_tests++;
   26711         des_xmlValidCtxtPtr(n_ctxt, ctxt, 0);
   26712         des_xmlDocPtr(n_doc, doc, 1);
   26713         des_xmlNodePtr(n_elem, elem, 2);
   26714         xmlResetLastError();
   26715         if (mem_base != xmlMemBlocks()) {
   26716             printf("Leak of %d blocks found in xmlValidateElement",
   26717 	           xmlMemBlocks() - mem_base);
   26718 	    test_ret++;
   26719             printf(" %d", n_ctxt);
   26720             printf(" %d", n_doc);
   26721             printf(" %d", n_elem);
   26722             printf("\n");
   26723         }
   26724     }
   26725     }
   26726     }
   26727     function_tests++;
   26728 #endif
   26729 
   26730     return(test_ret);
   26731 }
   26732 
   26733 
   26734 static int
   26735 test_xmlValidateElementDecl(void) {
   26736     int test_ret = 0;
   26737 
   26738 #if defined(LIBXML_VALID_ENABLED)
   26739     int mem_base;
   26740     int ret_val;
   26741     xmlValidCtxtPtr ctxt; /* the validation context */
   26742     int n_ctxt;
   26743     xmlDocPtr doc; /* a document instance */
   26744     int n_doc;
   26745     xmlElementPtr elem; /* an element definition */
   26746     int n_elem;
   26747 
   26748     for (n_ctxt = 0;n_ctxt < gen_nb_xmlValidCtxtPtr;n_ctxt++) {
   26749     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
   26750     for (n_elem = 0;n_elem < gen_nb_xmlElementPtr;n_elem++) {
   26751         mem_base = xmlMemBlocks();
   26752         ctxt = gen_xmlValidCtxtPtr(n_ctxt, 0);
   26753         doc = gen_xmlDocPtr(n_doc, 1);
   26754         elem = gen_xmlElementPtr(n_elem, 2);
   26755 
   26756         ret_val = xmlValidateElementDecl(ctxt, doc, elem);
   26757         desret_int(ret_val);
   26758         call_tests++;
   26759         des_xmlValidCtxtPtr(n_ctxt, ctxt, 0);
   26760         des_xmlDocPtr(n_doc, doc, 1);
   26761         des_xmlElementPtr(n_elem, elem, 2);
   26762         xmlResetLastError();
   26763         if (mem_base != xmlMemBlocks()) {
   26764             printf("Leak of %d blocks found in xmlValidateElementDecl",
   26765 	           xmlMemBlocks() - mem_base);
   26766 	    test_ret++;
   26767             printf(" %d", n_ctxt);
   26768             printf(" %d", n_doc);
   26769             printf(" %d", n_elem);
   26770             printf("\n");
   26771         }
   26772     }
   26773     }
   26774     }
   26775     function_tests++;
   26776 #endif
   26777 
   26778     return(test_ret);
   26779 }
   26780 
   26781 
   26782 static int
   26783 test_xmlValidateNameValue(void) {
   26784     int test_ret = 0;
   26785 
   26786 #if defined(LIBXML_VALID_ENABLED)
   26787     int mem_base;
   26788     int ret_val;
   26789     xmlChar * value; /* an Name value */
   26790     int n_value;
   26791 
   26792     for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
   26793         mem_base = xmlMemBlocks();
   26794         value = gen_const_xmlChar_ptr(n_value, 0);
   26795 
   26796         ret_val = xmlValidateNameValue((const xmlChar *)value);
   26797         desret_int(ret_val);
   26798         call_tests++;
   26799         des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 0);
   26800         xmlResetLastError();
   26801         if (mem_base != xmlMemBlocks()) {
   26802             printf("Leak of %d blocks found in xmlValidateNameValue",
   26803 	           xmlMemBlocks() - mem_base);
   26804 	    test_ret++;
   26805             printf(" %d", n_value);
   26806             printf("\n");
   26807         }
   26808     }
   26809     function_tests++;
   26810 #endif
   26811 
   26812     return(test_ret);
   26813 }
   26814 
   26815 
   26816 static int
   26817 test_xmlValidateNamesValue(void) {
   26818     int test_ret = 0;
   26819 
   26820 #if defined(LIBXML_VALID_ENABLED)
   26821     int mem_base;
   26822     int ret_val;
   26823     xmlChar * value; /* an Names value */
   26824     int n_value;
   26825 
   26826     for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
   26827         mem_base = xmlMemBlocks();
   26828         value = gen_const_xmlChar_ptr(n_value, 0);
   26829 
   26830         ret_val = xmlValidateNamesValue((const xmlChar *)value);
   26831         desret_int(ret_val);
   26832         call_tests++;
   26833         des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 0);
   26834         xmlResetLastError();
   26835         if (mem_base != xmlMemBlocks()) {
   26836             printf("Leak of %d blocks found in xmlValidateNamesValue",
   26837 	           xmlMemBlocks() - mem_base);
   26838 	    test_ret++;
   26839             printf(" %d", n_value);
   26840             printf("\n");
   26841         }
   26842     }
   26843     function_tests++;
   26844 #endif
   26845 
   26846     return(test_ret);
   26847 }
   26848 
   26849 
   26850 static int
   26851 test_xmlValidateNmtokenValue(void) {
   26852     int test_ret = 0;
   26853 
   26854 #if defined(LIBXML_VALID_ENABLED)
   26855     int mem_base;
   26856     int ret_val;
   26857     xmlChar * value; /* an Nmtoken value */
   26858     int n_value;
   26859 
   26860     for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
   26861         mem_base = xmlMemBlocks();
   26862         value = gen_const_xmlChar_ptr(n_value, 0);
   26863 
   26864         ret_val = xmlValidateNmtokenValue((const xmlChar *)value);
   26865         desret_int(ret_val);
   26866         call_tests++;
   26867         des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 0);
   26868         xmlResetLastError();
   26869         if (mem_base != xmlMemBlocks()) {
   26870             printf("Leak of %d blocks found in xmlValidateNmtokenValue",
   26871 	           xmlMemBlocks() - mem_base);
   26872 	    test_ret++;
   26873             printf(" %d", n_value);
   26874             printf("\n");
   26875         }
   26876     }
   26877     function_tests++;
   26878 #endif
   26879 
   26880     return(test_ret);
   26881 }
   26882 
   26883 
   26884 static int
   26885 test_xmlValidateNmtokensValue(void) {
   26886     int test_ret = 0;
   26887 
   26888 #if defined(LIBXML_VALID_ENABLED)
   26889     int mem_base;
   26890     int ret_val;
   26891     xmlChar * value; /* an Nmtokens value */
   26892     int n_value;
   26893 
   26894     for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
   26895         mem_base = xmlMemBlocks();
   26896         value = gen_const_xmlChar_ptr(n_value, 0);
   26897 
   26898         ret_val = xmlValidateNmtokensValue((const xmlChar *)value);
   26899         desret_int(ret_val);
   26900         call_tests++;
   26901         des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 0);
   26902         xmlResetLastError();
   26903         if (mem_base != xmlMemBlocks()) {
   26904             printf("Leak of %d blocks found in xmlValidateNmtokensValue",
   26905 	           xmlMemBlocks() - mem_base);
   26906 	    test_ret++;
   26907             printf(" %d", n_value);
   26908             printf("\n");
   26909         }
   26910     }
   26911     function_tests++;
   26912 #endif
   26913 
   26914     return(test_ret);
   26915 }
   26916 
   26917 
   26918 static int
   26919 test_xmlValidateNotationDecl(void) {
   26920     int test_ret = 0;
   26921 
   26922 #if defined(LIBXML_VALID_ENABLED)
   26923     int mem_base;
   26924     int ret_val;
   26925     xmlValidCtxtPtr ctxt; /* the validation context */
   26926     int n_ctxt;
   26927     xmlDocPtr doc; /* a document instance */
   26928     int n_doc;
   26929     xmlNotationPtr nota; /* a notation definition */
   26930     int n_nota;
   26931 
   26932     for (n_ctxt = 0;n_ctxt < gen_nb_xmlValidCtxtPtr;n_ctxt++) {
   26933     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
   26934     for (n_nota = 0;n_nota < gen_nb_xmlNotationPtr;n_nota++) {
   26935         mem_base = xmlMemBlocks();
   26936         ctxt = gen_xmlValidCtxtPtr(n_ctxt, 0);
   26937         doc = gen_xmlDocPtr(n_doc, 1);
   26938         nota = gen_xmlNotationPtr(n_nota, 2);
   26939 
   26940         ret_val = xmlValidateNotationDecl(ctxt, doc, nota);
   26941         desret_int(ret_val);
   26942         call_tests++;
   26943         des_xmlValidCtxtPtr(n_ctxt, ctxt, 0);
   26944         des_xmlDocPtr(n_doc, doc, 1);
   26945         des_xmlNotationPtr(n_nota, nota, 2);
   26946         xmlResetLastError();
   26947         if (mem_base != xmlMemBlocks()) {
   26948             printf("Leak of %d blocks found in xmlValidateNotationDecl",
   26949 	           xmlMemBlocks() - mem_base);
   26950 	    test_ret++;
   26951             printf(" %d", n_ctxt);
   26952             printf(" %d", n_doc);
   26953             printf(" %d", n_nota);
   26954             printf("\n");
   26955         }
   26956     }
   26957     }
   26958     }
   26959     function_tests++;
   26960 #endif
   26961 
   26962     return(test_ret);
   26963 }
   26964 
   26965 
   26966 static int
   26967 test_xmlValidateNotationUse(void) {
   26968     int test_ret = 0;
   26969 
   26970 #if defined(LIBXML_VALID_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED)
   26971     int mem_base;
   26972     int ret_val;
   26973     xmlValidCtxtPtr ctxt; /* the validation context */
   26974     int n_ctxt;
   26975     xmlDocPtr doc; /* the document */
   26976     int n_doc;
   26977     xmlChar * notationName; /* the notation name to check */
   26978     int n_notationName;
   26979 
   26980     for (n_ctxt = 0;n_ctxt < gen_nb_xmlValidCtxtPtr;n_ctxt++) {
   26981     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
   26982     for (n_notationName = 0;n_notationName < gen_nb_const_xmlChar_ptr;n_notationName++) {
   26983         mem_base = xmlMemBlocks();
   26984         ctxt = gen_xmlValidCtxtPtr(n_ctxt, 0);
   26985         doc = gen_xmlDocPtr(n_doc, 1);
   26986         notationName = gen_const_xmlChar_ptr(n_notationName, 2);
   26987 
   26988         ret_val = xmlValidateNotationUse(ctxt, doc, (const xmlChar *)notationName);
   26989         desret_int(ret_val);
   26990         call_tests++;
   26991         des_xmlValidCtxtPtr(n_ctxt, ctxt, 0);
   26992         des_xmlDocPtr(n_doc, doc, 1);
   26993         des_const_xmlChar_ptr(n_notationName, (const xmlChar *)notationName, 2);
   26994         xmlResetLastError();
   26995         if (mem_base != xmlMemBlocks()) {
   26996             printf("Leak of %d blocks found in xmlValidateNotationUse",
   26997 	           xmlMemBlocks() - mem_base);
   26998 	    test_ret++;
   26999             printf(" %d", n_ctxt);
   27000             printf(" %d", n_doc);
   27001             printf(" %d", n_notationName);
   27002             printf("\n");
   27003         }
   27004     }
   27005     }
   27006     }
   27007     function_tests++;
   27008 #endif
   27009 
   27010     return(test_ret);
   27011 }
   27012 
   27013 
   27014 static int
   27015 test_xmlValidateOneAttribute(void) {
   27016     int test_ret = 0;
   27017 
   27018 #if defined(LIBXML_VALID_ENABLED)
   27019     int mem_base;
   27020     int ret_val;
   27021     xmlValidCtxtPtr ctxt; /* the validation context */
   27022     int n_ctxt;
   27023     xmlDocPtr doc; /* a document instance */
   27024     int n_doc;
   27025     xmlNodePtr elem; /* an element instance */
   27026     int n_elem;
   27027     xmlAttrPtr attr; /* an attribute instance */
   27028     int n_attr;
   27029     xmlChar * value; /* the attribute value (without entities processing) */
   27030     int n_value;
   27031 
   27032     for (n_ctxt = 0;n_ctxt < gen_nb_xmlValidCtxtPtr;n_ctxt++) {
   27033     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
   27034     for (n_elem = 0;n_elem < gen_nb_xmlNodePtr;n_elem++) {
   27035     for (n_attr = 0;n_attr < gen_nb_xmlAttrPtr;n_attr++) {
   27036     for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
   27037         mem_base = xmlMemBlocks();
   27038         ctxt = gen_xmlValidCtxtPtr(n_ctxt, 0);
   27039         doc = gen_xmlDocPtr(n_doc, 1);
   27040         elem = gen_xmlNodePtr(n_elem, 2);
   27041         attr = gen_xmlAttrPtr(n_attr, 3);
   27042         value = gen_const_xmlChar_ptr(n_value, 4);
   27043 
   27044         ret_val = xmlValidateOneAttribute(ctxt, doc, elem, attr, (const xmlChar *)value);
   27045         desret_int(ret_val);
   27046         call_tests++;
   27047         des_xmlValidCtxtPtr(n_ctxt, ctxt, 0);
   27048         des_xmlDocPtr(n_doc, doc, 1);
   27049         des_xmlNodePtr(n_elem, elem, 2);
   27050         des_xmlAttrPtr(n_attr, attr, 3);
   27051         des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 4);
   27052         xmlResetLastError();
   27053         if (mem_base != xmlMemBlocks()) {
   27054             printf("Leak of %d blocks found in xmlValidateOneAttribute",
   27055 	           xmlMemBlocks() - mem_base);
   27056 	    test_ret++;
   27057             printf(" %d", n_ctxt);
   27058             printf(" %d", n_doc);
   27059             printf(" %d", n_elem);
   27060             printf(" %d", n_attr);
   27061             printf(" %d", n_value);
   27062             printf("\n");
   27063         }
   27064     }
   27065     }
   27066     }
   27067     }
   27068     }
   27069     function_tests++;
   27070 #endif
   27071 
   27072     return(test_ret);
   27073 }
   27074 
   27075 
   27076 static int
   27077 test_xmlValidateOneElement(void) {
   27078     int test_ret = 0;
   27079 
   27080 #if defined(LIBXML_VALID_ENABLED)
   27081     int mem_base;
   27082     int ret_val;
   27083     xmlValidCtxtPtr ctxt; /* the validation context */
   27084     int n_ctxt;
   27085     xmlDocPtr doc; /* a document instance */
   27086     int n_doc;
   27087     xmlNodePtr elem; /* an element instance */
   27088     int n_elem;
   27089 
   27090     for (n_ctxt = 0;n_ctxt < gen_nb_xmlValidCtxtPtr;n_ctxt++) {
   27091     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
   27092     for (n_elem = 0;n_elem < gen_nb_xmlNodePtr;n_elem++) {
   27093         mem_base = xmlMemBlocks();
   27094         ctxt = gen_xmlValidCtxtPtr(n_ctxt, 0);
   27095         doc = gen_xmlDocPtr(n_doc, 1);
   27096         elem = gen_xmlNodePtr(n_elem, 2);
   27097 
   27098         ret_val = xmlValidateOneElement(ctxt, doc, elem);
   27099         desret_int(ret_val);
   27100         call_tests++;
   27101         des_xmlValidCtxtPtr(n_ctxt, ctxt, 0);
   27102         des_xmlDocPtr(n_doc, doc, 1);
   27103         des_xmlNodePtr(n_elem, elem, 2);
   27104         xmlResetLastError();
   27105         if (mem_base != xmlMemBlocks()) {
   27106             printf("Leak of %d blocks found in xmlValidateOneElement",
   27107 	           xmlMemBlocks() - mem_base);
   27108 	    test_ret++;
   27109             printf(" %d", n_ctxt);
   27110             printf(" %d", n_doc);
   27111             printf(" %d", n_elem);
   27112             printf("\n");
   27113         }
   27114     }
   27115     }
   27116     }
   27117     function_tests++;
   27118 #endif
   27119 
   27120     return(test_ret);
   27121 }
   27122 
   27123 
   27124 static int
   27125 test_xmlValidateOneNamespace(void) {
   27126     int test_ret = 0;
   27127 
   27128 #if defined(LIBXML_VALID_ENABLED)
   27129     int mem_base;
   27130     int ret_val;
   27131     xmlValidCtxtPtr ctxt; /* the validation context */
   27132     int n_ctxt;
   27133     xmlDocPtr doc; /* a document instance */
   27134     int n_doc;
   27135     xmlNodePtr elem; /* an element instance */
   27136     int n_elem;
   27137     xmlChar * prefix; /* the namespace prefix */
   27138     int n_prefix;
   27139     xmlNsPtr ns; /* an namespace declaration instance */
   27140     int n_ns;
   27141     xmlChar * value; /* the attribute value (without entities processing) */
   27142     int n_value;
   27143 
   27144     for (n_ctxt = 0;n_ctxt < gen_nb_xmlValidCtxtPtr;n_ctxt++) {
   27145     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
   27146     for (n_elem = 0;n_elem < gen_nb_xmlNodePtr;n_elem++) {
   27147     for (n_prefix = 0;n_prefix < gen_nb_const_xmlChar_ptr;n_prefix++) {
   27148     for (n_ns = 0;n_ns < gen_nb_xmlNsPtr;n_ns++) {
   27149     for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
   27150         mem_base = xmlMemBlocks();
   27151         ctxt = gen_xmlValidCtxtPtr(n_ctxt, 0);
   27152         doc = gen_xmlDocPtr(n_doc, 1);
   27153         elem = gen_xmlNodePtr(n_elem, 2);
   27154         prefix = gen_const_xmlChar_ptr(n_prefix, 3);
   27155         ns = gen_xmlNsPtr(n_ns, 4);
   27156         value = gen_const_xmlChar_ptr(n_value, 5);
   27157 
   27158         ret_val = xmlValidateOneNamespace(ctxt, doc, elem, (const xmlChar *)prefix, ns, (const xmlChar *)value);
   27159         desret_int(ret_val);
   27160         call_tests++;
   27161         des_xmlValidCtxtPtr(n_ctxt, ctxt, 0);
   27162         des_xmlDocPtr(n_doc, doc, 1);
   27163         des_xmlNodePtr(n_elem, elem, 2);
   27164         des_const_xmlChar_ptr(n_prefix, (const xmlChar *)prefix, 3);
   27165         des_xmlNsPtr(n_ns, ns, 4);
   27166         des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 5);
   27167         xmlResetLastError();
   27168         if (mem_base != xmlMemBlocks()) {
   27169             printf("Leak of %d blocks found in xmlValidateOneNamespace",
   27170 	           xmlMemBlocks() - mem_base);
   27171 	    test_ret++;
   27172             printf(" %d", n_ctxt);
   27173             printf(" %d", n_doc);
   27174             printf(" %d", n_elem);
   27175             printf(" %d", n_prefix);
   27176             printf(" %d", n_ns);
   27177             printf(" %d", n_value);
   27178             printf("\n");
   27179         }
   27180     }
   27181     }
   27182     }
   27183     }
   27184     }
   27185     }
   27186     function_tests++;
   27187 #endif
   27188 
   27189     return(test_ret);
   27190 }
   27191 
   27192 
   27193 static int
   27194 test_xmlValidatePopElement(void) {
   27195     int test_ret = 0;
   27196 
   27197 #if defined(LIBXML_VALID_ENABLED) && defined(LIBXML_REGEXP_ENABLED)
   27198     int mem_base;
   27199     int ret_val;
   27200     xmlValidCtxtPtr ctxt; /* the validation context */
   27201     int n_ctxt;
   27202     xmlDocPtr doc; /* a document instance */
   27203     int n_doc;
   27204     xmlNodePtr elem; /* an element instance */
   27205     int n_elem;
   27206     xmlChar * qname; /* the qualified name as appearing in the serialization */
   27207     int n_qname;
   27208 
   27209     for (n_ctxt = 0;n_ctxt < gen_nb_xmlValidCtxtPtr;n_ctxt++) {
   27210     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
   27211     for (n_elem = 0;n_elem < gen_nb_xmlNodePtr;n_elem++) {
   27212     for (n_qname = 0;n_qname < gen_nb_const_xmlChar_ptr;n_qname++) {
   27213         mem_base = xmlMemBlocks();
   27214         ctxt = gen_xmlValidCtxtPtr(n_ctxt, 0);
   27215         doc = gen_xmlDocPtr(n_doc, 1);
   27216         elem = gen_xmlNodePtr(n_elem, 2);
   27217         qname = gen_const_xmlChar_ptr(n_qname, 3);
   27218 
   27219         ret_val = xmlValidatePopElement(ctxt, doc, elem, (const xmlChar *)qname);
   27220         desret_int(ret_val);
   27221         call_tests++;
   27222         des_xmlValidCtxtPtr(n_ctxt, ctxt, 0);
   27223         des_xmlDocPtr(n_doc, doc, 1);
   27224         des_xmlNodePtr(n_elem, elem, 2);
   27225         des_const_xmlChar_ptr(n_qname, (const xmlChar *)qname, 3);
   27226         xmlResetLastError();
   27227         if (mem_base != xmlMemBlocks()) {
   27228             printf("Leak of %d blocks found in xmlValidatePopElement",
   27229 	           xmlMemBlocks() - mem_base);
   27230 	    test_ret++;
   27231             printf(" %d", n_ctxt);
   27232             printf(" %d", n_doc);
   27233             printf(" %d", n_elem);
   27234             printf(" %d", n_qname);
   27235             printf("\n");
   27236         }
   27237     }
   27238     }
   27239     }
   27240     }
   27241     function_tests++;
   27242 #endif
   27243 
   27244     return(test_ret);
   27245 }
   27246 
   27247 
   27248 static int
   27249 test_xmlValidatePushCData(void) {
   27250     int test_ret = 0;
   27251 
   27252 #if defined(LIBXML_VALID_ENABLED) && defined(LIBXML_REGEXP_ENABLED)
   27253     int mem_base;
   27254     int ret_val;
   27255     xmlValidCtxtPtr ctxt; /* the validation context */
   27256     int n_ctxt;
   27257     xmlChar * data; /* some character data read */
   27258     int n_data;
   27259     int len; /* the length of the data */
   27260     int n_len;
   27261 
   27262     for (n_ctxt = 0;n_ctxt < gen_nb_xmlValidCtxtPtr;n_ctxt++) {
   27263     for (n_data = 0;n_data < gen_nb_const_xmlChar_ptr;n_data++) {
   27264     for (n_len = 0;n_len < gen_nb_int;n_len++) {
   27265         mem_base = xmlMemBlocks();
   27266         ctxt = gen_xmlValidCtxtPtr(n_ctxt, 0);
   27267         data = gen_const_xmlChar_ptr(n_data, 1);
   27268         len = gen_int(n_len, 2);
   27269         if ((data != NULL) &&
   27270             (len > (int) strlen((const char *) data) + 1))
   27271             continue;
   27272 
   27273         ret_val = xmlValidatePushCData(ctxt, (const xmlChar *)data, len);
   27274         desret_int(ret_val);
   27275         call_tests++;
   27276         des_xmlValidCtxtPtr(n_ctxt, ctxt, 0);
   27277         des_const_xmlChar_ptr(n_data, (const xmlChar *)data, 1);
   27278         des_int(n_len, len, 2);
   27279         xmlResetLastError();
   27280         if (mem_base != xmlMemBlocks()) {
   27281             printf("Leak of %d blocks found in xmlValidatePushCData",
   27282 	           xmlMemBlocks() - mem_base);
   27283 	    test_ret++;
   27284             printf(" %d", n_ctxt);
   27285             printf(" %d", n_data);
   27286             printf(" %d", n_len);
   27287             printf("\n");
   27288         }
   27289     }
   27290     }
   27291     }
   27292     function_tests++;
   27293 #endif
   27294 
   27295     return(test_ret);
   27296 }
   27297 
   27298 
   27299 static int
   27300 test_xmlValidatePushElement(void) {
   27301     int test_ret = 0;
   27302 
   27303 #if defined(LIBXML_VALID_ENABLED) && defined(LIBXML_REGEXP_ENABLED)
   27304     int mem_base;
   27305     int ret_val;
   27306     xmlValidCtxtPtr ctxt; /* the validation context */
   27307     int n_ctxt;
   27308     xmlDocPtr doc; /* a document instance */
   27309     int n_doc;
   27310     xmlNodePtr elem; /* an element instance */
   27311     int n_elem;
   27312     xmlChar * qname; /* the qualified name as appearing in the serialization */
   27313     int n_qname;
   27314 
   27315     for (n_ctxt = 0;n_ctxt < gen_nb_xmlValidCtxtPtr;n_ctxt++) {
   27316     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
   27317     for (n_elem = 0;n_elem < gen_nb_xmlNodePtr;n_elem++) {
   27318     for (n_qname = 0;n_qname < gen_nb_const_xmlChar_ptr;n_qname++) {
   27319         mem_base = xmlMemBlocks();
   27320         ctxt = gen_xmlValidCtxtPtr(n_ctxt, 0);
   27321         doc = gen_xmlDocPtr(n_doc, 1);
   27322         elem = gen_xmlNodePtr(n_elem, 2);
   27323         qname = gen_const_xmlChar_ptr(n_qname, 3);
   27324 
   27325         ret_val = xmlValidatePushElement(ctxt, doc, elem, (const xmlChar *)qname);
   27326         desret_int(ret_val);
   27327         call_tests++;
   27328         des_xmlValidCtxtPtr(n_ctxt, ctxt, 0);
   27329         des_xmlDocPtr(n_doc, doc, 1);
   27330         des_xmlNodePtr(n_elem, elem, 2);
   27331         des_const_xmlChar_ptr(n_qname, (const xmlChar *)qname, 3);
   27332         xmlResetLastError();
   27333         if (mem_base != xmlMemBlocks()) {
   27334             printf("Leak of %d blocks found in xmlValidatePushElement",
   27335 	           xmlMemBlocks() - mem_base);
   27336 	    test_ret++;
   27337             printf(" %d", n_ctxt);
   27338             printf(" %d", n_doc);
   27339             printf(" %d", n_elem);
   27340             printf(" %d", n_qname);
   27341             printf("\n");
   27342         }
   27343     }
   27344     }
   27345     }
   27346     }
   27347     function_tests++;
   27348 #endif
   27349 
   27350     return(test_ret);
   27351 }
   27352 
   27353 
   27354 static int
   27355 test_xmlValidateRoot(void) {
   27356     int test_ret = 0;
   27357 
   27358 #if defined(LIBXML_VALID_ENABLED)
   27359     int mem_base;
   27360     int ret_val;
   27361     xmlValidCtxtPtr ctxt; /* the validation context */
   27362     int n_ctxt;
   27363     xmlDocPtr doc; /* a document instance */
   27364     int n_doc;
   27365 
   27366     for (n_ctxt = 0;n_ctxt < gen_nb_xmlValidCtxtPtr;n_ctxt++) {
   27367     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
   27368         mem_base = xmlMemBlocks();
   27369         ctxt = gen_xmlValidCtxtPtr(n_ctxt, 0);
   27370         doc = gen_xmlDocPtr(n_doc, 1);
   27371 
   27372         ret_val = xmlValidateRoot(ctxt, doc);
   27373         desret_int(ret_val);
   27374         call_tests++;
   27375         des_xmlValidCtxtPtr(n_ctxt, ctxt, 0);
   27376         des_xmlDocPtr(n_doc, doc, 1);
   27377         xmlResetLastError();
   27378         if (mem_base != xmlMemBlocks()) {
   27379             printf("Leak of %d blocks found in xmlValidateRoot",
   27380 	           xmlMemBlocks() - mem_base);
   27381 	    test_ret++;
   27382             printf(" %d", n_ctxt);
   27383             printf(" %d", n_doc);
   27384             printf("\n");
   27385         }
   27386     }
   27387     }
   27388     function_tests++;
   27389 #endif
   27390 
   27391     return(test_ret);
   27392 }
   27393 
   27394 static int
   27395 test_valid(void) {
   27396     int test_ret = 0;
   27397 
   27398     if (quiet == 0) printf("Testing valid : 50 of 70 functions ...\n");
   27399     test_ret += test_xmlAddAttributeDecl();
   27400     test_ret += test_xmlAddElementDecl();
   27401     test_ret += test_xmlAddID();
   27402     test_ret += test_xmlAddNotationDecl();
   27403     test_ret += test_xmlAddRef();
   27404     test_ret += test_xmlCopyAttributeTable();
   27405     test_ret += test_xmlCopyDocElementContent();
   27406     test_ret += test_xmlCopyElementContent();
   27407     test_ret += test_xmlCopyElementTable();
   27408     test_ret += test_xmlCopyEnumeration();
   27409     test_ret += test_xmlCopyNotationTable();
   27410     test_ret += test_xmlCreateEnumeration();
   27411     test_ret += test_xmlDumpAttributeDecl();
   27412     test_ret += test_xmlDumpAttributeTable();
   27413     test_ret += test_xmlDumpElementDecl();
   27414     test_ret += test_xmlDumpElementTable();
   27415     test_ret += test_xmlDumpNotationDecl();
   27416     test_ret += test_xmlDumpNotationTable();
   27417     test_ret += test_xmlGetDtdAttrDesc();
   27418     test_ret += test_xmlGetDtdElementDesc();
   27419     test_ret += test_xmlGetDtdNotationDesc();
   27420     test_ret += test_xmlGetDtdQAttrDesc();
   27421     test_ret += test_xmlGetDtdQElementDesc();
   27422     test_ret += test_xmlGetID();
   27423     test_ret += test_xmlGetRefs();
   27424     test_ret += test_xmlIsID();
   27425     test_ret += test_xmlIsMixedElement();
   27426     test_ret += test_xmlIsRef();
   27427     test_ret += test_xmlNewDocElementContent();
   27428     test_ret += test_xmlNewElementContent();
   27429     test_ret += test_xmlNewValidCtxt();
   27430     test_ret += test_xmlRemoveID();
   27431     test_ret += test_xmlRemoveRef();
   27432     test_ret += test_xmlSnprintfElementContent();
   27433     test_ret += test_xmlSprintfElementContent();
   27434     test_ret += test_xmlValidBuildContentModel();
   27435     test_ret += test_xmlValidCtxtNormalizeAttributeValue();
   27436     test_ret += test_xmlValidGetPotentialChildren();
   27437     test_ret += test_xmlValidGetValidElements();
   27438     test_ret += test_xmlValidNormalizeAttributeValue();
   27439     test_ret += test_xmlValidateAttributeDecl();
   27440     test_ret += test_xmlValidateAttributeValue();
   27441     test_ret += test_xmlValidateDocument();
   27442     test_ret += test_xmlValidateDocumentFinal();
   27443     test_ret += test_xmlValidateDtd();
   27444     test_ret += test_xmlValidateDtdFinal();
   27445     test_ret += test_xmlValidateElement();
   27446     test_ret += test_xmlValidateElementDecl();
   27447     test_ret += test_xmlValidateNameValue();
   27448     test_ret += test_xmlValidateNamesValue();
   27449     test_ret += test_xmlValidateNmtokenValue();
   27450     test_ret += test_xmlValidateNmtokensValue();
   27451     test_ret += test_xmlValidateNotationDecl();
   27452     test_ret += test_xmlValidateNotationUse();
   27453     test_ret += test_xmlValidateOneAttribute();
   27454     test_ret += test_xmlValidateOneElement();
   27455     test_ret += test_xmlValidateOneNamespace();
   27456     test_ret += test_xmlValidatePopElement();
   27457     test_ret += test_xmlValidatePushCData();
   27458     test_ret += test_xmlValidatePushElement();
   27459     test_ret += test_xmlValidateRoot();
   27460 
   27461     if (test_ret != 0)
   27462 	printf("Module valid: %d errors\n", test_ret);
   27463     return(test_ret);
   27464 }
   27465 
   27466 static int
   27467 test_xmlXIncludeNewContext(void) {
   27468     int test_ret = 0;
   27469 
   27470 
   27471     /* missing type support */
   27472     return(test_ret);
   27473 }
   27474 
   27475 
   27476 static int
   27477 test_xmlXIncludeProcess(void) {
   27478     int test_ret = 0;
   27479 
   27480 #if defined(LIBXML_XINCLUDE_ENABLED)
   27481     int mem_base;
   27482     int ret_val;
   27483     xmlDocPtr doc; /* an XML document */
   27484     int n_doc;
   27485 
   27486     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
   27487         mem_base = xmlMemBlocks();
   27488         doc = gen_xmlDocPtr(n_doc, 0);
   27489 
   27490         ret_val = xmlXIncludeProcess(doc);
   27491         desret_int(ret_val);
   27492         call_tests++;
   27493         des_xmlDocPtr(n_doc, doc, 0);
   27494         xmlResetLastError();
   27495         if (mem_base != xmlMemBlocks()) {
   27496             printf("Leak of %d blocks found in xmlXIncludeProcess",
   27497 	           xmlMemBlocks() - mem_base);
   27498 	    test_ret++;
   27499             printf(" %d", n_doc);
   27500             printf("\n");
   27501         }
   27502     }
   27503     function_tests++;
   27504 #endif
   27505 
   27506     return(test_ret);
   27507 }
   27508 
   27509 
   27510 static int
   27511 test_xmlXIncludeProcessFlags(void) {
   27512     int test_ret = 0;
   27513 
   27514 #if defined(LIBXML_XINCLUDE_ENABLED)
   27515     int mem_base;
   27516     int ret_val;
   27517     xmlDocPtr doc; /* an XML document */
   27518     int n_doc;
   27519     int flags; /* a set of xmlParserOption used for parsing XML includes */
   27520     int n_flags;
   27521 
   27522     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
   27523     for (n_flags = 0;n_flags < gen_nb_int;n_flags++) {
   27524         mem_base = xmlMemBlocks();
   27525         doc = gen_xmlDocPtr(n_doc, 0);
   27526         flags = gen_int(n_flags, 1);
   27527 
   27528         ret_val = xmlXIncludeProcessFlags(doc, flags);
   27529         desret_int(ret_val);
   27530         call_tests++;
   27531         des_xmlDocPtr(n_doc, doc, 0);
   27532         des_int(n_flags, flags, 1);
   27533         xmlResetLastError();
   27534         if (mem_base != xmlMemBlocks()) {
   27535             printf("Leak of %d blocks found in xmlXIncludeProcessFlags",
   27536 	           xmlMemBlocks() - mem_base);
   27537 	    test_ret++;
   27538             printf(" %d", n_doc);
   27539             printf(" %d", n_flags);
   27540             printf("\n");
   27541         }
   27542     }
   27543     }
   27544     function_tests++;
   27545 #endif
   27546 
   27547     return(test_ret);
   27548 }
   27549 
   27550 
   27551 static int
   27552 test_xmlXIncludeProcessFlagsData(void) {
   27553     int test_ret = 0;
   27554 
   27555 #if defined(LIBXML_XINCLUDE_ENABLED)
   27556     int mem_base;
   27557     int ret_val;
   27558     xmlDocPtr doc; /* an XML document */
   27559     int n_doc;
   27560     int flags; /* a set of xmlParserOption used for parsing XML includes */
   27561     int n_flags;
   27562     void * data; /* application data that will be passed to the parser context in the _private field of the parser context(s) */
   27563     int n_data;
   27564 
   27565     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
   27566     for (n_flags = 0;n_flags < gen_nb_int;n_flags++) {
   27567     for (n_data = 0;n_data < gen_nb_userdata;n_data++) {
   27568         mem_base = xmlMemBlocks();
   27569         doc = gen_xmlDocPtr(n_doc, 0);
   27570         flags = gen_int(n_flags, 1);
   27571         data = gen_userdata(n_data, 2);
   27572 
   27573         ret_val = xmlXIncludeProcessFlagsData(doc, flags, data);
   27574         desret_int(ret_val);
   27575         call_tests++;
   27576         des_xmlDocPtr(n_doc, doc, 0);
   27577         des_int(n_flags, flags, 1);
   27578         des_userdata(n_data, data, 2);
   27579         xmlResetLastError();
   27580         if (mem_base != xmlMemBlocks()) {
   27581             printf("Leak of %d blocks found in xmlXIncludeProcessFlagsData",
   27582 	           xmlMemBlocks() - mem_base);
   27583 	    test_ret++;
   27584             printf(" %d", n_doc);
   27585             printf(" %d", n_flags);
   27586             printf(" %d", n_data);
   27587             printf("\n");
   27588         }
   27589     }
   27590     }
   27591     }
   27592     function_tests++;
   27593 #endif
   27594 
   27595     return(test_ret);
   27596 }
   27597 
   27598 #ifdef LIBXML_XINCLUDE_ENABLED
   27599 
   27600 #define gen_nb_xmlXIncludeCtxtPtr 1
   27601 static xmlXIncludeCtxtPtr gen_xmlXIncludeCtxtPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
   27602     return(NULL);
   27603 }
   27604 static void des_xmlXIncludeCtxtPtr(int no ATTRIBUTE_UNUSED, xmlXIncludeCtxtPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
   27605 }
   27606 #endif
   27607 
   27608 
   27609 static int
   27610 test_xmlXIncludeProcessNode(void) {
   27611     int test_ret = 0;
   27612 
   27613 #if defined(LIBXML_XINCLUDE_ENABLED)
   27614     int mem_base;
   27615     int ret_val;
   27616     xmlXIncludeCtxtPtr ctxt; /* an existing XInclude context */
   27617     int n_ctxt;
   27618     xmlNodePtr node; /* a node in an XML document */
   27619     int n_node;
   27620 
   27621     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXIncludeCtxtPtr;n_ctxt++) {
   27622     for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
   27623         mem_base = xmlMemBlocks();
   27624         ctxt = gen_xmlXIncludeCtxtPtr(n_ctxt, 0);
   27625         node = gen_xmlNodePtr(n_node, 1);
   27626 
   27627         ret_val = xmlXIncludeProcessNode(ctxt, node);
   27628         desret_int(ret_val);
   27629         call_tests++;
   27630         des_xmlXIncludeCtxtPtr(n_ctxt, ctxt, 0);
   27631         des_xmlNodePtr(n_node, node, 1);
   27632         xmlResetLastError();
   27633         if (mem_base != xmlMemBlocks()) {
   27634             printf("Leak of %d blocks found in xmlXIncludeProcessNode",
   27635 	           xmlMemBlocks() - mem_base);
   27636 	    test_ret++;
   27637             printf(" %d", n_ctxt);
   27638             printf(" %d", n_node);
   27639             printf("\n");
   27640         }
   27641     }
   27642     }
   27643     function_tests++;
   27644 #endif
   27645 
   27646     return(test_ret);
   27647 }
   27648 
   27649 
   27650 static int
   27651 test_xmlXIncludeProcessTree(void) {
   27652     int test_ret = 0;
   27653 
   27654 #if defined(LIBXML_XINCLUDE_ENABLED)
   27655     int mem_base;
   27656     int ret_val;
   27657     xmlNodePtr tree; /* a node in an XML document */
   27658     int n_tree;
   27659 
   27660     for (n_tree = 0;n_tree < gen_nb_xmlNodePtr;n_tree++) {
   27661         mem_base = xmlMemBlocks();
   27662         tree = gen_xmlNodePtr(n_tree, 0);
   27663 
   27664         ret_val = xmlXIncludeProcessTree(tree);
   27665         desret_int(ret_val);
   27666         call_tests++;
   27667         des_xmlNodePtr(n_tree, tree, 0);
   27668         xmlResetLastError();
   27669         if (mem_base != xmlMemBlocks()) {
   27670             printf("Leak of %d blocks found in xmlXIncludeProcessTree",
   27671 	           xmlMemBlocks() - mem_base);
   27672 	    test_ret++;
   27673             printf(" %d", n_tree);
   27674             printf("\n");
   27675         }
   27676     }
   27677     function_tests++;
   27678 #endif
   27679 
   27680     return(test_ret);
   27681 }
   27682 
   27683 
   27684 static int
   27685 test_xmlXIncludeProcessTreeFlags(void) {
   27686     int test_ret = 0;
   27687 
   27688 #if defined(LIBXML_XINCLUDE_ENABLED)
   27689     int mem_base;
   27690     int ret_val;
   27691     xmlNodePtr tree; /* a node in an XML document */
   27692     int n_tree;
   27693     int flags; /* a set of xmlParserOption used for parsing XML includes */
   27694     int n_flags;
   27695 
   27696     for (n_tree = 0;n_tree < gen_nb_xmlNodePtr;n_tree++) {
   27697     for (n_flags = 0;n_flags < gen_nb_int;n_flags++) {
   27698         mem_base = xmlMemBlocks();
   27699         tree = gen_xmlNodePtr(n_tree, 0);
   27700         flags = gen_int(n_flags, 1);
   27701 
   27702         ret_val = xmlXIncludeProcessTreeFlags(tree, flags);
   27703         desret_int(ret_val);
   27704         call_tests++;
   27705         des_xmlNodePtr(n_tree, tree, 0);
   27706         des_int(n_flags, flags, 1);
   27707         xmlResetLastError();
   27708         if (mem_base != xmlMemBlocks()) {
   27709             printf("Leak of %d blocks found in xmlXIncludeProcessTreeFlags",
   27710 	           xmlMemBlocks() - mem_base);
   27711 	    test_ret++;
   27712             printf(" %d", n_tree);
   27713             printf(" %d", n_flags);
   27714             printf("\n");
   27715         }
   27716     }
   27717     }
   27718     function_tests++;
   27719 #endif
   27720 
   27721     return(test_ret);
   27722 }
   27723 
   27724 
   27725 static int
   27726 test_xmlXIncludeProcessTreeFlagsData(void) {
   27727     int test_ret = 0;
   27728 
   27729 #if defined(LIBXML_XINCLUDE_ENABLED)
   27730     int mem_base;
   27731     int ret_val;
   27732     xmlNodePtr tree; /* an XML node */
   27733     int n_tree;
   27734     int flags; /* a set of xmlParserOption used for parsing XML includes */
   27735     int n_flags;
   27736     void * data; /* application data that will be passed to the parser context in the _private field of the parser context(s) */
   27737     int n_data;
   27738 
   27739     for (n_tree = 0;n_tree < gen_nb_xmlNodePtr;n_tree++) {
   27740     for (n_flags = 0;n_flags < gen_nb_int;n_flags++) {
   27741     for (n_data = 0;n_data < gen_nb_userdata;n_data++) {
   27742         mem_base = xmlMemBlocks();
   27743         tree = gen_xmlNodePtr(n_tree, 0);
   27744         flags = gen_int(n_flags, 1);
   27745         data = gen_userdata(n_data, 2);
   27746 
   27747         ret_val = xmlXIncludeProcessTreeFlagsData(tree, flags, data);
   27748         desret_int(ret_val);
   27749         call_tests++;
   27750         des_xmlNodePtr(n_tree, tree, 0);
   27751         des_int(n_flags, flags, 1);
   27752         des_userdata(n_data, data, 2);
   27753         xmlResetLastError();
   27754         if (mem_base != xmlMemBlocks()) {
   27755             printf("Leak of %d blocks found in xmlXIncludeProcessTreeFlagsData",
   27756 	           xmlMemBlocks() - mem_base);
   27757 	    test_ret++;
   27758             printf(" %d", n_tree);
   27759             printf(" %d", n_flags);
   27760             printf(" %d", n_data);
   27761             printf("\n");
   27762         }
   27763     }
   27764     }
   27765     }
   27766     function_tests++;
   27767 #endif
   27768 
   27769     return(test_ret);
   27770 }
   27771 
   27772 
   27773 static int
   27774 test_xmlXIncludeSetFlags(void) {
   27775     int test_ret = 0;
   27776 
   27777 #if defined(LIBXML_XINCLUDE_ENABLED)
   27778     int mem_base;
   27779     int ret_val;
   27780     xmlXIncludeCtxtPtr ctxt; /* an XInclude processing context */
   27781     int n_ctxt;
   27782     int flags; /* a set of xmlParserOption used for parsing XML includes */
   27783     int n_flags;
   27784 
   27785     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXIncludeCtxtPtr;n_ctxt++) {
   27786     for (n_flags = 0;n_flags < gen_nb_int;n_flags++) {
   27787         mem_base = xmlMemBlocks();
   27788         ctxt = gen_xmlXIncludeCtxtPtr(n_ctxt, 0);
   27789         flags = gen_int(n_flags, 1);
   27790 
   27791         ret_val = xmlXIncludeSetFlags(ctxt, flags);
   27792         desret_int(ret_val);
   27793         call_tests++;
   27794         des_xmlXIncludeCtxtPtr(n_ctxt, ctxt, 0);
   27795         des_int(n_flags, flags, 1);
   27796         xmlResetLastError();
   27797         if (mem_base != xmlMemBlocks()) {
   27798             printf("Leak of %d blocks found in xmlXIncludeSetFlags",
   27799 	           xmlMemBlocks() - mem_base);
   27800 	    test_ret++;
   27801             printf(" %d", n_ctxt);
   27802             printf(" %d", n_flags);
   27803             printf("\n");
   27804         }
   27805     }
   27806     }
   27807     function_tests++;
   27808 #endif
   27809 
   27810     return(test_ret);
   27811 }
   27812 
   27813 static int
   27814 test_xinclude(void) {
   27815     int test_ret = 0;
   27816 
   27817     if (quiet == 0) printf("Testing xinclude : 8 of 10 functions ...\n");
   27818     test_ret += test_xmlXIncludeNewContext();
   27819     test_ret += test_xmlXIncludeProcess();
   27820     test_ret += test_xmlXIncludeProcessFlags();
   27821     test_ret += test_xmlXIncludeProcessFlagsData();
   27822     test_ret += test_xmlXIncludeProcessNode();
   27823     test_ret += test_xmlXIncludeProcessTree();
   27824     test_ret += test_xmlXIncludeProcessTreeFlags();
   27825     test_ret += test_xmlXIncludeProcessTreeFlagsData();
   27826     test_ret += test_xmlXIncludeSetFlags();
   27827 
   27828     if (test_ret != 0)
   27829 	printf("Module xinclude: %d errors\n", test_ret);
   27830     return(test_ret);
   27831 }
   27832 
   27833 static int
   27834 test_xmlAllocOutputBuffer(void) {
   27835     int test_ret = 0;
   27836 
   27837 #if defined(LIBXML_OUTPUT_ENABLED)
   27838     int mem_base;
   27839     xmlOutputBufferPtr ret_val;
   27840     xmlCharEncodingHandlerPtr encoder; /* the encoding converter or NULL */
   27841     int n_encoder;
   27842 
   27843     for (n_encoder = 0;n_encoder < gen_nb_xmlCharEncodingHandlerPtr;n_encoder++) {
   27844         mem_base = xmlMemBlocks();
   27845         encoder = gen_xmlCharEncodingHandlerPtr(n_encoder, 0);
   27846 
   27847         ret_val = xmlAllocOutputBuffer(encoder);
   27848         desret_xmlOutputBufferPtr(ret_val);
   27849         call_tests++;
   27850         des_xmlCharEncodingHandlerPtr(n_encoder, encoder, 0);
   27851         xmlResetLastError();
   27852         if (mem_base != xmlMemBlocks()) {
   27853             printf("Leak of %d blocks found in xmlAllocOutputBuffer",
   27854 	           xmlMemBlocks() - mem_base);
   27855 	    test_ret++;
   27856             printf(" %d", n_encoder);
   27857             printf("\n");
   27858         }
   27859     }
   27860     function_tests++;
   27861 #endif
   27862 
   27863     return(test_ret);
   27864 }
   27865 
   27866 
   27867 static int
   27868 test_xmlAllocParserInputBuffer(void) {
   27869     int test_ret = 0;
   27870 
   27871     int mem_base;
   27872     xmlParserInputBufferPtr ret_val;
   27873     xmlCharEncoding enc; /* the charset encoding if known */
   27874     int n_enc;
   27875 
   27876     for (n_enc = 0;n_enc < gen_nb_xmlCharEncoding;n_enc++) {
   27877         mem_base = xmlMemBlocks();
   27878         enc = gen_xmlCharEncoding(n_enc, 0);
   27879 
   27880         ret_val = xmlAllocParserInputBuffer(enc);
   27881         desret_xmlParserInputBufferPtr(ret_val);
   27882         call_tests++;
   27883         des_xmlCharEncoding(n_enc, enc, 0);
   27884         xmlResetLastError();
   27885         if (mem_base != xmlMemBlocks()) {
   27886             printf("Leak of %d blocks found in xmlAllocParserInputBuffer",
   27887 	           xmlMemBlocks() - mem_base);
   27888 	    test_ret++;
   27889             printf(" %d", n_enc);
   27890             printf("\n");
   27891         }
   27892     }
   27893     function_tests++;
   27894 
   27895     return(test_ret);
   27896 }
   27897 
   27898 
   27899 static int
   27900 test_xmlCheckFilename(void) {
   27901     int test_ret = 0;
   27902 
   27903     int mem_base;
   27904     int ret_val;
   27905     char * path; /* the path to check */
   27906     int n_path;
   27907 
   27908     for (n_path = 0;n_path < gen_nb_const_char_ptr;n_path++) {
   27909         mem_base = xmlMemBlocks();
   27910         path = gen_const_char_ptr(n_path, 0);
   27911 
   27912         ret_val = xmlCheckFilename((const char *)path);
   27913         desret_int(ret_val);
   27914         call_tests++;
   27915         des_const_char_ptr(n_path, (const char *)path, 0);
   27916         xmlResetLastError();
   27917         if (mem_base != xmlMemBlocks()) {
   27918             printf("Leak of %d blocks found in xmlCheckFilename",
   27919 	           xmlMemBlocks() - mem_base);
   27920 	    test_ret++;
   27921             printf(" %d", n_path);
   27922             printf("\n");
   27923         }
   27924     }
   27925     function_tests++;
   27926 
   27927     return(test_ret);
   27928 }
   27929 
   27930 
   27931 static int
   27932 test_xmlCheckHTTPInput(void) {
   27933     int test_ret = 0;
   27934 
   27935     int mem_base;
   27936     xmlParserInputPtr ret_val;
   27937     xmlParserCtxtPtr ctxt; /* an XML parser context */
   27938     int n_ctxt;
   27939     xmlParserInputPtr ret; /* an XML parser input */
   27940     int n_ret;
   27941 
   27942     for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
   27943     for (n_ret = 0;n_ret < gen_nb_xmlParserInputPtr;n_ret++) {
   27944         mem_base = xmlMemBlocks();
   27945         ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
   27946         ret = gen_xmlParserInputPtr(n_ret, 1);
   27947 
   27948         ret_val = xmlCheckHTTPInput(ctxt, ret);
   27949         desret_xmlParserInputPtr(ret_val);
   27950         call_tests++;
   27951         des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
   27952         des_xmlParserInputPtr(n_ret, ret, 1);
   27953         xmlResetLastError();
   27954         if (mem_base != xmlMemBlocks()) {
   27955             printf("Leak of %d blocks found in xmlCheckHTTPInput",
   27956 	           xmlMemBlocks() - mem_base);
   27957 	    test_ret++;
   27958             printf(" %d", n_ctxt);
   27959             printf(" %d", n_ret);
   27960             printf("\n");
   27961         }
   27962     }
   27963     }
   27964     function_tests++;
   27965 
   27966     return(test_ret);
   27967 }
   27968 
   27969 
   27970 static int
   27971 test_xmlCleanupInputCallbacks(void) {
   27972     int test_ret = 0;
   27973 
   27974     int mem_base;
   27975 
   27976         mem_base = xmlMemBlocks();
   27977 
   27978         xmlCleanupInputCallbacks();
   27979         call_tests++;
   27980         xmlResetLastError();
   27981         if (mem_base != xmlMemBlocks()) {
   27982             printf("Leak of %d blocks found in xmlCleanupInputCallbacks",
   27983 	           xmlMemBlocks() - mem_base);
   27984 	    test_ret++;
   27985             printf("\n");
   27986         }
   27987     function_tests++;
   27988 
   27989     return(test_ret);
   27990 }
   27991 
   27992 
   27993 static int
   27994 test_xmlCleanupOutputCallbacks(void) {
   27995     int test_ret = 0;
   27996 
   27997 #if defined(LIBXML_OUTPUT_ENABLED)
   27998     int mem_base;
   27999 
   28000         mem_base = xmlMemBlocks();
   28001 
   28002         xmlCleanupOutputCallbacks();
   28003         call_tests++;
   28004         xmlResetLastError();
   28005         if (mem_base != xmlMemBlocks()) {
   28006             printf("Leak of %d blocks found in xmlCleanupOutputCallbacks",
   28007 	           xmlMemBlocks() - mem_base);
   28008 	    test_ret++;
   28009             printf("\n");
   28010         }
   28011     function_tests++;
   28012 #endif
   28013 
   28014     return(test_ret);
   28015 }
   28016 
   28017 
   28018 static int
   28019 test_xmlFileClose(void) {
   28020     int test_ret = 0;
   28021 
   28022     int mem_base;
   28023     int ret_val;
   28024     void * context; /* the I/O context */
   28025     int n_context;
   28026 
   28027     for (n_context = 0;n_context < gen_nb_void_ptr;n_context++) {
   28028         mem_base = xmlMemBlocks();
   28029         context = gen_void_ptr(n_context, 0);
   28030 
   28031         ret_val = xmlFileClose(context);
   28032         desret_int(ret_val);
   28033         call_tests++;
   28034         des_void_ptr(n_context, context, 0);
   28035         xmlResetLastError();
   28036         if (mem_base != xmlMemBlocks()) {
   28037             printf("Leak of %d blocks found in xmlFileClose",
   28038 	           xmlMemBlocks() - mem_base);
   28039 	    test_ret++;
   28040             printf(" %d", n_context);
   28041             printf("\n");
   28042         }
   28043     }
   28044     function_tests++;
   28045 
   28046     return(test_ret);
   28047 }
   28048 
   28049 
   28050 static int
   28051 test_xmlFileMatch(void) {
   28052     int test_ret = 0;
   28053 
   28054     int mem_base;
   28055     int ret_val;
   28056     const char * filename; /* the URI for matching */
   28057     int n_filename;
   28058 
   28059     for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
   28060         mem_base = xmlMemBlocks();
   28061         filename = gen_filepath(n_filename, 0);
   28062 
   28063         ret_val = xmlFileMatch(filename);
   28064         desret_int(ret_val);
   28065         call_tests++;
   28066         des_filepath(n_filename, filename, 0);
   28067         xmlResetLastError();
   28068         if (mem_base != xmlMemBlocks()) {
   28069             printf("Leak of %d blocks found in xmlFileMatch",
   28070 	           xmlMemBlocks() - mem_base);
   28071 	    test_ret++;
   28072             printf(" %d", n_filename);
   28073             printf("\n");
   28074         }
   28075     }
   28076     function_tests++;
   28077 
   28078     return(test_ret);
   28079 }
   28080 
   28081 
   28082 static int
   28083 test_xmlFileOpen(void) {
   28084     int test_ret = 0;
   28085 
   28086     int mem_base;
   28087     void * ret_val;
   28088     const char * filename; /* the URI for matching */
   28089     int n_filename;
   28090 
   28091     for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
   28092         mem_base = xmlMemBlocks();
   28093         filename = gen_filepath(n_filename, 0);
   28094 
   28095         ret_val = xmlFileOpen(filename);
   28096         desret_void_ptr(ret_val);
   28097         call_tests++;
   28098         des_filepath(n_filename, filename, 0);
   28099         xmlResetLastError();
   28100         if (mem_base != xmlMemBlocks()) {
   28101             printf("Leak of %d blocks found in xmlFileOpen",
   28102 	           xmlMemBlocks() - mem_base);
   28103 	    test_ret++;
   28104             printf(" %d", n_filename);
   28105             printf("\n");
   28106         }
   28107     }
   28108     function_tests++;
   28109 
   28110     return(test_ret);
   28111 }
   28112 
   28113 
   28114 static int
   28115 test_xmlFileRead(void) {
   28116     int test_ret = 0;
   28117 
   28118     int mem_base;
   28119     int ret_val;
   28120     void * context; /* the I/O context */
   28121     int n_context;
   28122     char * buffer; /* where to drop data */
   28123     int n_buffer;
   28124     int len; /* number of bytes to write */
   28125     int n_len;
   28126 
   28127     for (n_context = 0;n_context < gen_nb_void_ptr;n_context++) {
   28128     for (n_buffer = 0;n_buffer < gen_nb_char_ptr;n_buffer++) {
   28129     for (n_len = 0;n_len < gen_nb_int;n_len++) {
   28130         mem_base = xmlMemBlocks();
   28131         context = gen_void_ptr(n_context, 0);
   28132         buffer = gen_char_ptr(n_buffer, 1);
   28133         len = gen_int(n_len, 2);
   28134 
   28135         ret_val = xmlFileRead(context, buffer, len);
   28136         desret_int(ret_val);
   28137         call_tests++;
   28138         des_void_ptr(n_context, context, 0);
   28139         des_char_ptr(n_buffer, buffer, 1);
   28140         des_int(n_len, len, 2);
   28141         xmlResetLastError();
   28142         if (mem_base != xmlMemBlocks()) {
   28143             printf("Leak of %d blocks found in xmlFileRead",
   28144 	           xmlMemBlocks() - mem_base);
   28145 	    test_ret++;
   28146             printf(" %d", n_context);
   28147             printf(" %d", n_buffer);
   28148             printf(" %d", n_len);
   28149             printf("\n");
   28150         }
   28151     }
   28152     }
   28153     }
   28154     function_tests++;
   28155 
   28156     return(test_ret);
   28157 }
   28158 
   28159 
   28160 static int
   28161 test_xmlIOFTPClose(void) {
   28162     int test_ret = 0;
   28163 
   28164 #if defined(LIBXML_FTP_ENABLED)
   28165     int mem_base;
   28166     int ret_val;
   28167     void * context; /* the I/O context */
   28168     int n_context;
   28169 
   28170     for (n_context = 0;n_context < gen_nb_void_ptr;n_context++) {
   28171         mem_base = xmlMemBlocks();
   28172         context = gen_void_ptr(n_context, 0);
   28173 
   28174         ret_val = xmlIOFTPClose(context);
   28175         desret_int(ret_val);
   28176         call_tests++;
   28177         des_void_ptr(n_context, context, 0);
   28178         xmlResetLastError();
   28179         if (mem_base != xmlMemBlocks()) {
   28180             printf("Leak of %d blocks found in xmlIOFTPClose",
   28181 	           xmlMemBlocks() - mem_base);
   28182 	    test_ret++;
   28183             printf(" %d", n_context);
   28184             printf("\n");
   28185         }
   28186     }
   28187     function_tests++;
   28188 #endif
   28189 
   28190     return(test_ret);
   28191 }
   28192 
   28193 
   28194 static int
   28195 test_xmlIOFTPMatch(void) {
   28196     int test_ret = 0;
   28197 
   28198 #if defined(LIBXML_FTP_ENABLED)
   28199     int mem_base;
   28200     int ret_val;
   28201     const char * filename; /* the URI for matching */
   28202     int n_filename;
   28203 
   28204     for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
   28205         mem_base = xmlMemBlocks();
   28206         filename = gen_filepath(n_filename, 0);
   28207 
   28208         ret_val = xmlIOFTPMatch(filename);
   28209         desret_int(ret_val);
   28210         call_tests++;
   28211         des_filepath(n_filename, filename, 0);
   28212         xmlResetLastError();
   28213         if (mem_base != xmlMemBlocks()) {
   28214             printf("Leak of %d blocks found in xmlIOFTPMatch",
   28215 	           xmlMemBlocks() - mem_base);
   28216 	    test_ret++;
   28217             printf(" %d", n_filename);
   28218             printf("\n");
   28219         }
   28220     }
   28221     function_tests++;
   28222 #endif
   28223 
   28224     return(test_ret);
   28225 }
   28226 
   28227 
   28228 static int
   28229 test_xmlIOFTPOpen(void) {
   28230     int test_ret = 0;
   28231 
   28232 #if defined(LIBXML_FTP_ENABLED)
   28233     int mem_base;
   28234     void * ret_val;
   28235     const char * filename; /* the URI for matching */
   28236     int n_filename;
   28237 
   28238     for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
   28239         mem_base = xmlMemBlocks();
   28240         filename = gen_filepath(n_filename, 0);
   28241 
   28242         ret_val = xmlIOFTPOpen(filename);
   28243         desret_void_ptr(ret_val);
   28244         call_tests++;
   28245         des_filepath(n_filename, filename, 0);
   28246         xmlResetLastError();
   28247         if (mem_base != xmlMemBlocks()) {
   28248             printf("Leak of %d blocks found in xmlIOFTPOpen",
   28249 	           xmlMemBlocks() - mem_base);
   28250 	    test_ret++;
   28251             printf(" %d", n_filename);
   28252             printf("\n");
   28253         }
   28254     }
   28255     function_tests++;
   28256 #endif
   28257 
   28258     return(test_ret);
   28259 }
   28260 
   28261 
   28262 static int
   28263 test_xmlIOFTPRead(void) {
   28264     int test_ret = 0;
   28265 
   28266 #if defined(LIBXML_FTP_ENABLED)
   28267     int mem_base;
   28268     int ret_val;
   28269     void * context; /* the I/O context */
   28270     int n_context;
   28271     char * buffer; /* where to drop data */
   28272     int n_buffer;
   28273     int len; /* number of bytes to write */
   28274     int n_len;
   28275 
   28276     for (n_context = 0;n_context < gen_nb_void_ptr;n_context++) {
   28277     for (n_buffer = 0;n_buffer < gen_nb_char_ptr;n_buffer++) {
   28278     for (n_len = 0;n_len < gen_nb_int;n_len++) {
   28279         mem_base = xmlMemBlocks();
   28280         context = gen_void_ptr(n_context, 0);
   28281         buffer = gen_char_ptr(n_buffer, 1);
   28282         len = gen_int(n_len, 2);
   28283 
   28284         ret_val = xmlIOFTPRead(context, buffer, len);
   28285         desret_int(ret_val);
   28286         call_tests++;
   28287         des_void_ptr(n_context, context, 0);
   28288         des_char_ptr(n_buffer, buffer, 1);
   28289         des_int(n_len, len, 2);
   28290         xmlResetLastError();
   28291         if (mem_base != xmlMemBlocks()) {
   28292             printf("Leak of %d blocks found in xmlIOFTPRead",
   28293 	           xmlMemBlocks() - mem_base);
   28294 	    test_ret++;
   28295             printf(" %d", n_context);
   28296             printf(" %d", n_buffer);
   28297             printf(" %d", n_len);
   28298             printf("\n");
   28299         }
   28300     }
   28301     }
   28302     }
   28303     function_tests++;
   28304 #endif
   28305 
   28306     return(test_ret);
   28307 }
   28308 
   28309 
   28310 static int
   28311 test_xmlIOHTTPClose(void) {
   28312     int test_ret = 0;
   28313 
   28314 #if defined(LIBXML_HTTP_ENABLED)
   28315     int mem_base;
   28316     int ret_val;
   28317     void * context; /* the I/O context */
   28318     int n_context;
   28319 
   28320     for (n_context = 0;n_context < gen_nb_void_ptr;n_context++) {
   28321         mem_base = xmlMemBlocks();
   28322         context = gen_void_ptr(n_context, 0);
   28323 
   28324         ret_val = xmlIOHTTPClose(context);
   28325         desret_int(ret_val);
   28326         call_tests++;
   28327         des_void_ptr(n_context, context, 0);
   28328         xmlResetLastError();
   28329         if (mem_base != xmlMemBlocks()) {
   28330             printf("Leak of %d blocks found in xmlIOHTTPClose",
   28331 	           xmlMemBlocks() - mem_base);
   28332 	    test_ret++;
   28333             printf(" %d", n_context);
   28334             printf("\n");
   28335         }
   28336     }
   28337     function_tests++;
   28338 #endif
   28339 
   28340     return(test_ret);
   28341 }
   28342 
   28343 
   28344 static int
   28345 test_xmlIOHTTPMatch(void) {
   28346     int test_ret = 0;
   28347 
   28348 #if defined(LIBXML_HTTP_ENABLED)
   28349     int mem_base;
   28350     int ret_val;
   28351     const char * filename; /* the URI for matching */
   28352     int n_filename;
   28353 
   28354     for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
   28355         mem_base = xmlMemBlocks();
   28356         filename = gen_filepath(n_filename, 0);
   28357 
   28358         ret_val = xmlIOHTTPMatch(filename);
   28359         desret_int(ret_val);
   28360         call_tests++;
   28361         des_filepath(n_filename, filename, 0);
   28362         xmlResetLastError();
   28363         if (mem_base != xmlMemBlocks()) {
   28364             printf("Leak of %d blocks found in xmlIOHTTPMatch",
   28365 	           xmlMemBlocks() - mem_base);
   28366 	    test_ret++;
   28367             printf(" %d", n_filename);
   28368             printf("\n");
   28369         }
   28370     }
   28371     function_tests++;
   28372 #endif
   28373 
   28374     return(test_ret);
   28375 }
   28376 
   28377 
   28378 static int
   28379 test_xmlIOHTTPOpen(void) {
   28380     int test_ret = 0;
   28381 
   28382 #if defined(LIBXML_HTTP_ENABLED)
   28383     int mem_base;
   28384     void * ret_val;
   28385     const char * filename; /* the URI for matching */
   28386     int n_filename;
   28387 
   28388     for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
   28389         mem_base = xmlMemBlocks();
   28390         filename = gen_filepath(n_filename, 0);
   28391 
   28392         ret_val = xmlIOHTTPOpen(filename);
   28393         desret_xmlNanoHTTPCtxtPtr(ret_val);
   28394         call_tests++;
   28395         des_filepath(n_filename, filename, 0);
   28396         xmlResetLastError();
   28397         if (mem_base != xmlMemBlocks()) {
   28398             printf("Leak of %d blocks found in xmlIOHTTPOpen",
   28399 	           xmlMemBlocks() - mem_base);
   28400 	    test_ret++;
   28401             printf(" %d", n_filename);
   28402             printf("\n");
   28403         }
   28404     }
   28405     function_tests++;
   28406 #endif
   28407 
   28408     return(test_ret);
   28409 }
   28410 
   28411 
   28412 static int
   28413 test_xmlIOHTTPRead(void) {
   28414     int test_ret = 0;
   28415 
   28416 #if defined(LIBXML_HTTP_ENABLED)
   28417     int mem_base;
   28418     int ret_val;
   28419     void * context; /* the I/O context */
   28420     int n_context;
   28421     char * buffer; /* where to drop data */
   28422     int n_buffer;
   28423     int len; /* number of bytes to write */
   28424     int n_len;
   28425 
   28426     for (n_context = 0;n_context < gen_nb_void_ptr;n_context++) {
   28427     for (n_buffer = 0;n_buffer < gen_nb_char_ptr;n_buffer++) {
   28428     for (n_len = 0;n_len < gen_nb_int;n_len++) {
   28429         mem_base = xmlMemBlocks();
   28430         context = gen_void_ptr(n_context, 0);
   28431         buffer = gen_char_ptr(n_buffer, 1);
   28432         len = gen_int(n_len, 2);
   28433 
   28434         ret_val = xmlIOHTTPRead(context, buffer, len);
   28435         desret_int(ret_val);
   28436         call_tests++;
   28437         des_void_ptr(n_context, context, 0);
   28438         des_char_ptr(n_buffer, buffer, 1);
   28439         des_int(n_len, len, 2);
   28440         xmlResetLastError();
   28441         if (mem_base != xmlMemBlocks()) {
   28442             printf("Leak of %d blocks found in xmlIOHTTPRead",
   28443 	           xmlMemBlocks() - mem_base);
   28444 	    test_ret++;
   28445             printf(" %d", n_context);
   28446             printf(" %d", n_buffer);
   28447             printf(" %d", n_len);
   28448             printf("\n");
   28449         }
   28450     }
   28451     }
   28452     }
   28453     function_tests++;
   28454 #endif
   28455 
   28456     return(test_ret);
   28457 }
   28458 
   28459 
   28460 static int
   28461 test_xmlNoNetExternalEntityLoader(void) {
   28462     int test_ret = 0;
   28463 
   28464     int mem_base;
   28465     xmlParserInputPtr ret_val;
   28466     const char * URL; /* the URL for the entity to load */
   28467     int n_URL;
   28468     char * ID; /* the System ID for the entity to load */
   28469     int n_ID;
   28470     xmlParserCtxtPtr ctxt; /* the context in which the entity is called or NULL */
   28471     int n_ctxt;
   28472 
   28473     for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) {
   28474     for (n_ID = 0;n_ID < gen_nb_const_char_ptr;n_ID++) {
   28475     for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
   28476         mem_base = xmlMemBlocks();
   28477         URL = gen_filepath(n_URL, 0);
   28478         ID = gen_const_char_ptr(n_ID, 1);
   28479         ctxt = gen_xmlParserCtxtPtr(n_ctxt, 2);
   28480 
   28481         ret_val = xmlNoNetExternalEntityLoader(URL, (const char *)ID, ctxt);
   28482         desret_xmlParserInputPtr(ret_val);
   28483         call_tests++;
   28484         des_filepath(n_URL, URL, 0);
   28485         des_const_char_ptr(n_ID, (const char *)ID, 1);
   28486         des_xmlParserCtxtPtr(n_ctxt, ctxt, 2);
   28487         xmlResetLastError();
   28488         if (mem_base != xmlMemBlocks()) {
   28489             printf("Leak of %d blocks found in xmlNoNetExternalEntityLoader",
   28490 	           xmlMemBlocks() - mem_base);
   28491 	    test_ret++;
   28492             printf(" %d", n_URL);
   28493             printf(" %d", n_ID);
   28494             printf(" %d", n_ctxt);
   28495             printf("\n");
   28496         }
   28497     }
   28498     }
   28499     }
   28500     function_tests++;
   28501 
   28502     return(test_ret);
   28503 }
   28504 
   28505 
   28506 static int
   28507 test_xmlNormalizeWindowsPath(void) {
   28508     int test_ret = 0;
   28509 
   28510     int mem_base;
   28511     xmlChar * ret_val;
   28512     xmlChar * path; /* the input file path */
   28513     int n_path;
   28514 
   28515     for (n_path = 0;n_path < gen_nb_const_xmlChar_ptr;n_path++) {
   28516         mem_base = xmlMemBlocks();
   28517         path = gen_const_xmlChar_ptr(n_path, 0);
   28518 
   28519         ret_val = xmlNormalizeWindowsPath((const xmlChar *)path);
   28520         desret_xmlChar_ptr(ret_val);
   28521         call_tests++;
   28522         des_const_xmlChar_ptr(n_path, (const xmlChar *)path, 0);
   28523         xmlResetLastError();
   28524         if (mem_base != xmlMemBlocks()) {
   28525             printf("Leak of %d blocks found in xmlNormalizeWindowsPath",
   28526 	           xmlMemBlocks() - mem_base);
   28527 	    test_ret++;
   28528             printf(" %d", n_path);
   28529             printf("\n");
   28530         }
   28531     }
   28532     function_tests++;
   28533 
   28534     return(test_ret);
   28535 }
   28536 
   28537 
   28538 static int
   28539 test_xmlOutputBufferCreateBuffer(void) {
   28540     int test_ret = 0;
   28541 
   28542 #if defined(LIBXML_OUTPUT_ENABLED)
   28543     int mem_base;
   28544     xmlOutputBufferPtr ret_val;
   28545     xmlBufferPtr buffer; /* a xmlBufferPtr */
   28546     int n_buffer;
   28547     xmlCharEncodingHandlerPtr encoder; /* the encoding converter or NULL */
   28548     int n_encoder;
   28549 
   28550     for (n_buffer = 0;n_buffer < gen_nb_xmlBufferPtr;n_buffer++) {
   28551     for (n_encoder = 0;n_encoder < gen_nb_xmlCharEncodingHandlerPtr;n_encoder++) {
   28552         mem_base = xmlMemBlocks();
   28553         buffer = gen_xmlBufferPtr(n_buffer, 0);
   28554         encoder = gen_xmlCharEncodingHandlerPtr(n_encoder, 1);
   28555 
   28556         ret_val = xmlOutputBufferCreateBuffer(buffer, encoder);
   28557         desret_xmlOutputBufferPtr(ret_val);
   28558         call_tests++;
   28559         des_xmlBufferPtr(n_buffer, buffer, 0);
   28560         des_xmlCharEncodingHandlerPtr(n_encoder, encoder, 1);
   28561         xmlResetLastError();
   28562         if (mem_base != xmlMemBlocks()) {
   28563             printf("Leak of %d blocks found in xmlOutputBufferCreateBuffer",
   28564 	           xmlMemBlocks() - mem_base);
   28565 	    test_ret++;
   28566             printf(" %d", n_buffer);
   28567             printf(" %d", n_encoder);
   28568             printf("\n");
   28569         }
   28570     }
   28571     }
   28572     function_tests++;
   28573 #endif
   28574 
   28575     return(test_ret);
   28576 }
   28577 
   28578 
   28579 static int
   28580 test_xmlOutputBufferCreateFd(void) {
   28581     int test_ret = 0;
   28582 
   28583 #if defined(LIBXML_OUTPUT_ENABLED)
   28584     int mem_base;
   28585     xmlOutputBufferPtr ret_val;
   28586     int fd; /* a file descriptor number */
   28587     int n_fd;
   28588     xmlCharEncodingHandlerPtr encoder; /* the encoding converter or NULL */
   28589     int n_encoder;
   28590 
   28591     for (n_fd = 0;n_fd < gen_nb_int;n_fd++) {
   28592     for (n_encoder = 0;n_encoder < gen_nb_xmlCharEncodingHandlerPtr;n_encoder++) {
   28593         mem_base = xmlMemBlocks();
   28594         fd = gen_int(n_fd, 0);
   28595         encoder = gen_xmlCharEncodingHandlerPtr(n_encoder, 1);
   28596 
   28597         ret_val = xmlOutputBufferCreateFd(fd, encoder);
   28598         desret_xmlOutputBufferPtr(ret_val);
   28599         call_tests++;
   28600         des_int(n_fd, fd, 0);
   28601         des_xmlCharEncodingHandlerPtr(n_encoder, encoder, 1);
   28602         xmlResetLastError();
   28603         if (mem_base != xmlMemBlocks()) {
   28604             printf("Leak of %d blocks found in xmlOutputBufferCreateFd",
   28605 	           xmlMemBlocks() - mem_base);
   28606 	    test_ret++;
   28607             printf(" %d", n_fd);
   28608             printf(" %d", n_encoder);
   28609             printf("\n");
   28610         }
   28611     }
   28612     }
   28613     function_tests++;
   28614 #endif
   28615 
   28616     return(test_ret);
   28617 }
   28618 
   28619 
   28620 static int
   28621 test_xmlOutputBufferCreateFile(void) {
   28622     int test_ret = 0;
   28623 
   28624 #if defined(LIBXML_OUTPUT_ENABLED)
   28625     int mem_base;
   28626     xmlOutputBufferPtr ret_val;
   28627     FILE * file; /* a FILE* */
   28628     int n_file;
   28629     xmlCharEncodingHandlerPtr encoder; /* the encoding converter or NULL */
   28630     int n_encoder;
   28631 
   28632     for (n_file = 0;n_file < gen_nb_FILE_ptr;n_file++) {
   28633     for (n_encoder = 0;n_encoder < gen_nb_xmlCharEncodingHandlerPtr;n_encoder++) {
   28634         mem_base = xmlMemBlocks();
   28635         file = gen_FILE_ptr(n_file, 0);
   28636         encoder = gen_xmlCharEncodingHandlerPtr(n_encoder, 1);
   28637 
   28638         ret_val = xmlOutputBufferCreateFile(file, encoder);
   28639         desret_xmlOutputBufferPtr(ret_val);
   28640         call_tests++;
   28641         des_FILE_ptr(n_file, file, 0);
   28642         des_xmlCharEncodingHandlerPtr(n_encoder, encoder, 1);
   28643         xmlResetLastError();
   28644         if (mem_base != xmlMemBlocks()) {
   28645             printf("Leak of %d blocks found in xmlOutputBufferCreateFile",
   28646 	           xmlMemBlocks() - mem_base);
   28647 	    test_ret++;
   28648             printf(" %d", n_file);
   28649             printf(" %d", n_encoder);
   28650             printf("\n");
   28651         }
   28652     }
   28653     }
   28654     function_tests++;
   28655 #endif
   28656 
   28657     return(test_ret);
   28658 }
   28659 
   28660 
   28661 static int
   28662 test_xmlOutputBufferCreateFilename(void) {
   28663     int test_ret = 0;
   28664 
   28665 #if defined(LIBXML_OUTPUT_ENABLED)
   28666     int mem_base;
   28667     xmlOutputBufferPtr ret_val;
   28668     const char * URI; /* a C string containing the URI or filename */
   28669     int n_URI;
   28670     xmlCharEncodingHandlerPtr encoder; /* the encoding converter or NULL */
   28671     int n_encoder;
   28672     int compression; /* the compression ration (0 none, 9 max). */
   28673     int n_compression;
   28674 
   28675     for (n_URI = 0;n_URI < gen_nb_fileoutput;n_URI++) {
   28676     for (n_encoder = 0;n_encoder < gen_nb_xmlCharEncodingHandlerPtr;n_encoder++) {
   28677     for (n_compression = 0;n_compression < gen_nb_int;n_compression++) {
   28678         mem_base = xmlMemBlocks();
   28679         URI = gen_fileoutput(n_URI, 0);
   28680         encoder = gen_xmlCharEncodingHandlerPtr(n_encoder, 1);
   28681         compression = gen_int(n_compression, 2);
   28682 
   28683         ret_val = xmlOutputBufferCreateFilename(URI, encoder, compression);
   28684         desret_xmlOutputBufferPtr(ret_val);
   28685         call_tests++;
   28686         des_fileoutput(n_URI, URI, 0);
   28687         des_xmlCharEncodingHandlerPtr(n_encoder, encoder, 1);
   28688         des_int(n_compression, compression, 2);
   28689         xmlResetLastError();
   28690         if (mem_base != xmlMemBlocks()) {
   28691             printf("Leak of %d blocks found in xmlOutputBufferCreateFilename",
   28692 	           xmlMemBlocks() - mem_base);
   28693 	    test_ret++;
   28694             printf(" %d", n_URI);
   28695             printf(" %d", n_encoder);
   28696             printf(" %d", n_compression);
   28697             printf("\n");
   28698         }
   28699     }
   28700     }
   28701     }
   28702     function_tests++;
   28703 #endif
   28704 
   28705     return(test_ret);
   28706 }
   28707 
   28708 
   28709 static int
   28710 test_xmlOutputBufferFlush(void) {
   28711     int test_ret = 0;
   28712 
   28713 #if defined(LIBXML_OUTPUT_ENABLED)
   28714     int mem_base;
   28715     int ret_val;
   28716     xmlOutputBufferPtr out; /* a buffered output */
   28717     int n_out;
   28718 
   28719     for (n_out = 0;n_out < gen_nb_xmlOutputBufferPtr;n_out++) {
   28720         mem_base = xmlMemBlocks();
   28721         out = gen_xmlOutputBufferPtr(n_out, 0);
   28722 
   28723         ret_val = xmlOutputBufferFlush(out);
   28724         desret_int(ret_val);
   28725         call_tests++;
   28726         des_xmlOutputBufferPtr(n_out, out, 0);
   28727         xmlResetLastError();
   28728         if (mem_base != xmlMemBlocks()) {
   28729             printf("Leak of %d blocks found in xmlOutputBufferFlush",
   28730 	           xmlMemBlocks() - mem_base);
   28731 	    test_ret++;
   28732             printf(" %d", n_out);
   28733             printf("\n");
   28734         }
   28735     }
   28736     function_tests++;
   28737 #endif
   28738 
   28739     return(test_ret);
   28740 }
   28741 
   28742 
   28743 static int
   28744 test_xmlOutputBufferGetContent(void) {
   28745     int test_ret = 0;
   28746 
   28747 #if defined(LIBXML_OUTPUT_ENABLED)
   28748     int mem_base;
   28749     const xmlChar * ret_val;
   28750     xmlOutputBufferPtr out; /* an xmlOutputBufferPtr */
   28751     int n_out;
   28752 
   28753     for (n_out = 0;n_out < gen_nb_xmlOutputBufferPtr;n_out++) {
   28754         mem_base = xmlMemBlocks();
   28755         out = gen_xmlOutputBufferPtr(n_out, 0);
   28756 
   28757         ret_val = xmlOutputBufferGetContent(out);
   28758         desret_const_xmlChar_ptr(ret_val);
   28759         call_tests++;
   28760         des_xmlOutputBufferPtr(n_out, out, 0);
   28761         xmlResetLastError();
   28762         if (mem_base != xmlMemBlocks()) {
   28763             printf("Leak of %d blocks found in xmlOutputBufferGetContent",
   28764 	           xmlMemBlocks() - mem_base);
   28765 	    test_ret++;
   28766             printf(" %d", n_out);
   28767             printf("\n");
   28768         }
   28769     }
   28770     function_tests++;
   28771 #endif
   28772 
   28773     return(test_ret);
   28774 }
   28775 
   28776 
   28777 static int
   28778 test_xmlOutputBufferGetSize(void) {
   28779     int test_ret = 0;
   28780 
   28781 
   28782     /* missing type support */
   28783     return(test_ret);
   28784 }
   28785 
   28786 
   28787 static int
   28788 test_xmlOutputBufferWrite(void) {
   28789     int test_ret = 0;
   28790 
   28791 #if defined(LIBXML_OUTPUT_ENABLED)
   28792     int mem_base;
   28793     int ret_val;
   28794     xmlOutputBufferPtr out; /* a buffered parser output */
   28795     int n_out;
   28796     int len; /* the size in bytes of the array. */
   28797     int n_len;
   28798     char * buf; /* an char array */
   28799     int n_buf;
   28800 
   28801     for (n_out = 0;n_out < gen_nb_xmlOutputBufferPtr;n_out++) {
   28802     for (n_len = 0;n_len < gen_nb_int;n_len++) {
   28803     for (n_buf = 0;n_buf < gen_nb_const_char_ptr;n_buf++) {
   28804         mem_base = xmlMemBlocks();
   28805         out = gen_xmlOutputBufferPtr(n_out, 0);
   28806         len = gen_int(n_len, 1);
   28807         buf = gen_const_char_ptr(n_buf, 2);
   28808         if ((buf != NULL) &&
   28809             (len > (int) strlen((const char *) buf) + 1))
   28810             continue;
   28811 
   28812         ret_val = xmlOutputBufferWrite(out, len, (const char *)buf);
   28813         desret_int(ret_val);
   28814         call_tests++;
   28815         des_xmlOutputBufferPtr(n_out, out, 0);
   28816         des_int(n_len, len, 1);
   28817         des_const_char_ptr(n_buf, (const char *)buf, 2);
   28818         xmlResetLastError();
   28819         if (mem_base != xmlMemBlocks()) {
   28820             printf("Leak of %d blocks found in xmlOutputBufferWrite",
   28821 	           xmlMemBlocks() - mem_base);
   28822 	    test_ret++;
   28823             printf(" %d", n_out);
   28824             printf(" %d", n_len);
   28825             printf(" %d", n_buf);
   28826             printf("\n");
   28827         }
   28828     }
   28829     }
   28830     }
   28831     function_tests++;
   28832 #endif
   28833 
   28834     return(test_ret);
   28835 }
   28836 
   28837 
   28838 static int
   28839 test_xmlOutputBufferWriteEscape(void) {
   28840     int test_ret = 0;
   28841 
   28842 
   28843     /* missing type support */
   28844     return(test_ret);
   28845 }
   28846 
   28847 
   28848 static int
   28849 test_xmlOutputBufferWriteString(void) {
   28850     int test_ret = 0;
   28851 
   28852 #if defined(LIBXML_OUTPUT_ENABLED)
   28853     int mem_base;
   28854     int ret_val;
   28855     xmlOutputBufferPtr out; /* a buffered parser output */
   28856     int n_out;
   28857     char * str; /* a zero terminated C string */
   28858     int n_str;
   28859 
   28860     for (n_out = 0;n_out < gen_nb_xmlOutputBufferPtr;n_out++) {
   28861     for (n_str = 0;n_str < gen_nb_const_char_ptr;n_str++) {
   28862         mem_base = xmlMemBlocks();
   28863         out = gen_xmlOutputBufferPtr(n_out, 0);
   28864         str = gen_const_char_ptr(n_str, 1);
   28865 
   28866         ret_val = xmlOutputBufferWriteString(out, (const char *)str);
   28867         desret_int(ret_val);
   28868         call_tests++;
   28869         des_xmlOutputBufferPtr(n_out, out, 0);
   28870         des_const_char_ptr(n_str, (const char *)str, 1);
   28871         xmlResetLastError();
   28872         if (mem_base != xmlMemBlocks()) {
   28873             printf("Leak of %d blocks found in xmlOutputBufferWriteString",
   28874 	           xmlMemBlocks() - mem_base);
   28875 	    test_ret++;
   28876             printf(" %d", n_out);
   28877             printf(" %d", n_str);
   28878             printf("\n");
   28879         }
   28880     }
   28881     }
   28882     function_tests++;
   28883 #endif
   28884 
   28885     return(test_ret);
   28886 }
   28887 
   28888 
   28889 static int
   28890 test_xmlParserGetDirectory(void) {
   28891     int test_ret = 0;
   28892 
   28893 
   28894     /* missing type support */
   28895     return(test_ret);
   28896 }
   28897 
   28898 
   28899 static int
   28900 test_xmlParserInputBufferCreateFd(void) {
   28901     int test_ret = 0;
   28902 
   28903     int mem_base;
   28904     xmlParserInputBufferPtr ret_val;
   28905     int fd; /* a file descriptor number */
   28906     int n_fd;
   28907     xmlCharEncoding enc; /* the charset encoding if known */
   28908     int n_enc;
   28909 
   28910     for (n_fd = 0;n_fd < gen_nb_int;n_fd++) {
   28911     for (n_enc = 0;n_enc < gen_nb_xmlCharEncoding;n_enc++) {
   28912         mem_base = xmlMemBlocks();
   28913         fd = gen_int(n_fd, 0);
   28914         enc = gen_xmlCharEncoding(n_enc, 1);
   28915         if (fd >= 0) fd = -1;
   28916 
   28917         ret_val = xmlParserInputBufferCreateFd(fd, enc);
   28918         desret_xmlParserInputBufferPtr(ret_val);
   28919         call_tests++;
   28920         des_int(n_fd, fd, 0);
   28921         des_xmlCharEncoding(n_enc, enc, 1);
   28922         xmlResetLastError();
   28923         if (mem_base != xmlMemBlocks()) {
   28924             printf("Leak of %d blocks found in xmlParserInputBufferCreateFd",
   28925 	           xmlMemBlocks() - mem_base);
   28926 	    test_ret++;
   28927             printf(" %d", n_fd);
   28928             printf(" %d", n_enc);
   28929             printf("\n");
   28930         }
   28931     }
   28932     }
   28933     function_tests++;
   28934 
   28935     return(test_ret);
   28936 }
   28937 
   28938 
   28939 static int
   28940 test_xmlParserInputBufferCreateFile(void) {
   28941     int test_ret = 0;
   28942 
   28943     int mem_base;
   28944     xmlParserInputBufferPtr ret_val;
   28945     FILE * file; /* a FILE* */
   28946     int n_file;
   28947     xmlCharEncoding enc; /* the charset encoding if known */
   28948     int n_enc;
   28949 
   28950     for (n_file = 0;n_file < gen_nb_FILE_ptr;n_file++) {
   28951     for (n_enc = 0;n_enc < gen_nb_xmlCharEncoding;n_enc++) {
   28952         mem_base = xmlMemBlocks();
   28953         file = gen_FILE_ptr(n_file, 0);
   28954         enc = gen_xmlCharEncoding(n_enc, 1);
   28955 
   28956         ret_val = xmlParserInputBufferCreateFile(file, enc);
   28957         desret_xmlParserInputBufferPtr(ret_val);
   28958         call_tests++;
   28959         des_FILE_ptr(n_file, file, 0);
   28960         des_xmlCharEncoding(n_enc, enc, 1);
   28961         xmlResetLastError();
   28962         if (mem_base != xmlMemBlocks()) {
   28963             printf("Leak of %d blocks found in xmlParserInputBufferCreateFile",
   28964 	           xmlMemBlocks() - mem_base);
   28965 	    test_ret++;
   28966             printf(" %d", n_file);
   28967             printf(" %d", n_enc);
   28968             printf("\n");
   28969         }
   28970     }
   28971     }
   28972     function_tests++;
   28973 
   28974     return(test_ret);
   28975 }
   28976 
   28977 
   28978 static int
   28979 test_xmlParserInputBufferCreateFilename(void) {
   28980     int test_ret = 0;
   28981 
   28982     int mem_base;
   28983     xmlParserInputBufferPtr ret_val;
   28984     const char * URI; /* a C string containing the URI or filename */
   28985     int n_URI;
   28986     xmlCharEncoding enc; /* the charset encoding if known */
   28987     int n_enc;
   28988 
   28989     for (n_URI = 0;n_URI < gen_nb_fileoutput;n_URI++) {
   28990     for (n_enc = 0;n_enc < gen_nb_xmlCharEncoding;n_enc++) {
   28991         mem_base = xmlMemBlocks();
   28992         URI = gen_fileoutput(n_URI, 0);
   28993         enc = gen_xmlCharEncoding(n_enc, 1);
   28994 
   28995         ret_val = xmlParserInputBufferCreateFilename(URI, enc);
   28996         desret_xmlParserInputBufferPtr(ret_val);
   28997         call_tests++;
   28998         des_fileoutput(n_URI, URI, 0);
   28999         des_xmlCharEncoding(n_enc, enc, 1);
   29000         xmlResetLastError();
   29001         if (mem_base != xmlMemBlocks()) {
   29002             printf("Leak of %d blocks found in xmlParserInputBufferCreateFilename",
   29003 	           xmlMemBlocks() - mem_base);
   29004 	    test_ret++;
   29005             printf(" %d", n_URI);
   29006             printf(" %d", n_enc);
   29007             printf("\n");
   29008         }
   29009     }
   29010     }
   29011     function_tests++;
   29012 
   29013     return(test_ret);
   29014 }
   29015 
   29016 
   29017 static int
   29018 test_xmlParserInputBufferCreateMem(void) {
   29019     int test_ret = 0;
   29020 
   29021     int mem_base;
   29022     xmlParserInputBufferPtr ret_val;
   29023     char * mem; /* the memory input */
   29024     int n_mem;
   29025     int size; /* the length of the memory block */
   29026     int n_size;
   29027     xmlCharEncoding enc; /* the charset encoding if known */
   29028     int n_enc;
   29029 
   29030     for (n_mem = 0;n_mem < gen_nb_const_char_ptr;n_mem++) {
   29031     for (n_size = 0;n_size < gen_nb_int;n_size++) {
   29032     for (n_enc = 0;n_enc < gen_nb_xmlCharEncoding;n_enc++) {
   29033         mem_base = xmlMemBlocks();
   29034         mem = gen_const_char_ptr(n_mem, 0);
   29035         size = gen_int(n_size, 1);
   29036         enc = gen_xmlCharEncoding(n_enc, 2);
   29037         if ((mem != NULL) &&
   29038             (size > (int) strlen((const char *) mem) + 1))
   29039             continue;
   29040 
   29041         ret_val = xmlParserInputBufferCreateMem((const char *)mem, size, enc);
   29042         desret_xmlParserInputBufferPtr(ret_val);
   29043         call_tests++;
   29044         des_const_char_ptr(n_mem, (const char *)mem, 0);
   29045         des_int(n_size, size, 1);
   29046         des_xmlCharEncoding(n_enc, enc, 2);
   29047         xmlResetLastError();
   29048         if (mem_base != xmlMemBlocks()) {
   29049             printf("Leak of %d blocks found in xmlParserInputBufferCreateMem",
   29050 	           xmlMemBlocks() - mem_base);
   29051 	    test_ret++;
   29052             printf(" %d", n_mem);
   29053             printf(" %d", n_size);
   29054             printf(" %d", n_enc);
   29055             printf("\n");
   29056         }
   29057     }
   29058     }
   29059     }
   29060     function_tests++;
   29061 
   29062     return(test_ret);
   29063 }
   29064 
   29065 
   29066 static int
   29067 test_xmlParserInputBufferCreateStatic(void) {
   29068     int test_ret = 0;
   29069 
   29070     int mem_base;
   29071     xmlParserInputBufferPtr ret_val;
   29072     char * mem; /* the memory input */
   29073     int n_mem;
   29074     int size; /* the length of the memory block */
   29075     int n_size;
   29076     xmlCharEncoding enc; /* the charset encoding if known */
   29077     int n_enc;
   29078 
   29079     for (n_mem = 0;n_mem < gen_nb_const_char_ptr;n_mem++) {
   29080     for (n_size = 0;n_size < gen_nb_int;n_size++) {
   29081     for (n_enc = 0;n_enc < gen_nb_xmlCharEncoding;n_enc++) {
   29082         mem_base = xmlMemBlocks();
   29083         mem = gen_const_char_ptr(n_mem, 0);
   29084         size = gen_int(n_size, 1);
   29085         enc = gen_xmlCharEncoding(n_enc, 2);
   29086         if ((mem != NULL) &&
   29087             (size > (int) strlen((const char *) mem) + 1))
   29088             continue;
   29089 
   29090         ret_val = xmlParserInputBufferCreateStatic((const char *)mem, size, enc);
   29091         desret_xmlParserInputBufferPtr(ret_val);
   29092         call_tests++;
   29093         des_const_char_ptr(n_mem, (const char *)mem, 0);
   29094         des_int(n_size, size, 1);
   29095         des_xmlCharEncoding(n_enc, enc, 2);
   29096         xmlResetLastError();
   29097         if (mem_base != xmlMemBlocks()) {
   29098             printf("Leak of %d blocks found in xmlParserInputBufferCreateStatic",
   29099 	           xmlMemBlocks() - mem_base);
   29100 	    test_ret++;
   29101             printf(" %d", n_mem);
   29102             printf(" %d", n_size);
   29103             printf(" %d", n_enc);
   29104             printf("\n");
   29105         }
   29106     }
   29107     }
   29108     }
   29109     function_tests++;
   29110 
   29111     return(test_ret);
   29112 }
   29113 
   29114 
   29115 static int
   29116 test_xmlParserInputBufferGrow(void) {
   29117     int test_ret = 0;
   29118 
   29119     int mem_base;
   29120     int ret_val;
   29121     xmlParserInputBufferPtr in; /* a buffered parser input */
   29122     int n_in;
   29123     int len; /* indicative value of the amount of chars to read */
   29124     int n_len;
   29125 
   29126     for (n_in = 0;n_in < gen_nb_xmlParserInputBufferPtr;n_in++) {
   29127     for (n_len = 0;n_len < gen_nb_int;n_len++) {
   29128         mem_base = xmlMemBlocks();
   29129         in = gen_xmlParserInputBufferPtr(n_in, 0);
   29130         len = gen_int(n_len, 1);
   29131 
   29132         ret_val = xmlParserInputBufferGrow(in, len);
   29133         desret_int(ret_val);
   29134         call_tests++;
   29135         des_xmlParserInputBufferPtr(n_in, in, 0);
   29136         des_int(n_len, len, 1);
   29137         xmlResetLastError();
   29138         if (mem_base != xmlMemBlocks()) {
   29139             printf("Leak of %d blocks found in xmlParserInputBufferGrow",
   29140 	           xmlMemBlocks() - mem_base);
   29141 	    test_ret++;
   29142             printf(" %d", n_in);
   29143             printf(" %d", n_len);
   29144             printf("\n");
   29145         }
   29146     }
   29147     }
   29148     function_tests++;
   29149 
   29150     return(test_ret);
   29151 }
   29152 
   29153 
   29154 static int
   29155 test_xmlParserInputBufferPush(void) {
   29156     int test_ret = 0;
   29157 
   29158     int mem_base;
   29159     int ret_val;
   29160     xmlParserInputBufferPtr in; /* a buffered parser input */
   29161     int n_in;
   29162     int len; /* the size in bytes of the array. */
   29163     int n_len;
   29164     char * buf; /* an char array */
   29165     int n_buf;
   29166 
   29167     for (n_in = 0;n_in < gen_nb_xmlParserInputBufferPtr;n_in++) {
   29168     for (n_len = 0;n_len < gen_nb_int;n_len++) {
   29169     for (n_buf = 0;n_buf < gen_nb_const_char_ptr;n_buf++) {
   29170         mem_base = xmlMemBlocks();
   29171         in = gen_xmlParserInputBufferPtr(n_in, 0);
   29172         len = gen_int(n_len, 1);
   29173         buf = gen_const_char_ptr(n_buf, 2);
   29174         if ((buf != NULL) &&
   29175             (len > (int) strlen((const char *) buf) + 1))
   29176             continue;
   29177 
   29178         ret_val = xmlParserInputBufferPush(in, len, (const char *)buf);
   29179         desret_int(ret_val);
   29180         call_tests++;
   29181         des_xmlParserInputBufferPtr(n_in, in, 0);
   29182         des_int(n_len, len, 1);
   29183         des_const_char_ptr(n_buf, (const char *)buf, 2);
   29184         xmlResetLastError();
   29185         if (mem_base != xmlMemBlocks()) {
   29186             printf("Leak of %d blocks found in xmlParserInputBufferPush",
   29187 	           xmlMemBlocks() - mem_base);
   29188 	    test_ret++;
   29189             printf(" %d", n_in);
   29190             printf(" %d", n_len);
   29191             printf(" %d", n_buf);
   29192             printf("\n");
   29193         }
   29194     }
   29195     }
   29196     }
   29197     function_tests++;
   29198 
   29199     return(test_ret);
   29200 }
   29201 
   29202 
   29203 static int
   29204 test_xmlParserInputBufferRead(void) {
   29205     int test_ret = 0;
   29206 
   29207     int mem_base;
   29208     int ret_val;
   29209     xmlParserInputBufferPtr in; /* a buffered parser input */
   29210     int n_in;
   29211     int len; /* indicative value of the amount of chars to read */
   29212     int n_len;
   29213 
   29214     for (n_in = 0;n_in < gen_nb_xmlParserInputBufferPtr;n_in++) {
   29215     for (n_len = 0;n_len < gen_nb_int;n_len++) {
   29216         mem_base = xmlMemBlocks();
   29217         in = gen_xmlParserInputBufferPtr(n_in, 0);
   29218         len = gen_int(n_len, 1);
   29219 
   29220         ret_val = xmlParserInputBufferRead(in, len);
   29221         desret_int(ret_val);
   29222         call_tests++;
   29223         des_xmlParserInputBufferPtr(n_in, in, 0);
   29224         des_int(n_len, len, 1);
   29225         xmlResetLastError();
   29226         if (mem_base != xmlMemBlocks()) {
   29227             printf("Leak of %d blocks found in xmlParserInputBufferRead",
   29228 	           xmlMemBlocks() - mem_base);
   29229 	    test_ret++;
   29230             printf(" %d", n_in);
   29231             printf(" %d", n_len);
   29232             printf("\n");
   29233         }
   29234     }
   29235     }
   29236     function_tests++;
   29237 
   29238     return(test_ret);
   29239 }
   29240 
   29241 
   29242 static int
   29243 test_xmlPopInputCallbacks(void) {
   29244     int test_ret = 0;
   29245 
   29246     int mem_base;
   29247     int ret_val;
   29248 
   29249         mem_base = xmlMemBlocks();
   29250 
   29251         ret_val = xmlPopInputCallbacks();
   29252         desret_int(ret_val);
   29253         call_tests++;
   29254         xmlResetLastError();
   29255         if (mem_base != xmlMemBlocks()) {
   29256             printf("Leak of %d blocks found in xmlPopInputCallbacks",
   29257 	           xmlMemBlocks() - mem_base);
   29258 	    test_ret++;
   29259             printf("\n");
   29260         }
   29261     function_tests++;
   29262 
   29263     return(test_ret);
   29264 }
   29265 
   29266 
   29267 static int
   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
   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
   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
   29340 test_xmlIO(void) {
   29341     int test_ret = 0;
   29342 
   29343     if (quiet == 0) printf("Testing xmlIO : 40 of 50 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_xmlRegisterDefaultInputCallbacks();
   29385     test_ret += test_xmlRegisterDefaultOutputCallbacks();
   29386     test_ret += test_xmlRegisterHTTPPostCallbacks();
   29387 
   29388     if (test_ret != 0)
   29389 	printf("Module xmlIO: %d errors\n", test_ret);
   29390     return(test_ret);
   29391 }
   29392 #ifdef LIBXML_AUTOMATA_ENABLED
   29393 
   29394 #define gen_nb_xmlAutomataPtr 1
   29395 static xmlAutomataPtr gen_xmlAutomataPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
   29396     return(NULL);
   29397 }
   29398 static void des_xmlAutomataPtr(int no ATTRIBUTE_UNUSED, xmlAutomataPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
   29399 }
   29400 #endif
   29401 
   29402 
   29403 static int
   29404 test_xmlAutomataCompile(void) {
   29405     int test_ret = 0;
   29406 
   29407 
   29408     /* missing type support */
   29409     return(test_ret);
   29410 }
   29411 
   29412 
   29413 static int
   29414 test_xmlAutomataGetInitState(void) {
   29415     int test_ret = 0;
   29416 
   29417 
   29418     /* missing type support */
   29419     return(test_ret);
   29420 }
   29421 
   29422 
   29423 static int
   29424 test_xmlAutomataIsDeterminist(void) {
   29425     int test_ret = 0;
   29426 
   29427 #if defined(LIBXML_REGEXP_ENABLED) && defined(LIBXML_AUTOMATA_ENABLED)
   29428     int mem_base;
   29429     int ret_val;
   29430     xmlAutomataPtr am; /* an automata */
   29431     int n_am;
   29432 
   29433     for (n_am = 0;n_am < gen_nb_xmlAutomataPtr;n_am++) {
   29434         mem_base = xmlMemBlocks();
   29435         am = gen_xmlAutomataPtr(n_am, 0);
   29436 
   29437         ret_val = xmlAutomataIsDeterminist(am);
   29438         desret_int(ret_val);
   29439         call_tests++;
   29440         des_xmlAutomataPtr(n_am, am, 0);
   29441         xmlResetLastError();
   29442         if (mem_base != xmlMemBlocks()) {
   29443             printf("Leak of %d blocks found in xmlAutomataIsDeterminist",
   29444 	           xmlMemBlocks() - mem_base);
   29445 	    test_ret++;
   29446             printf(" %d", n_am);
   29447             printf("\n");
   29448         }
   29449     }
   29450     function_tests++;
   29451 #endif
   29452 
   29453     return(test_ret);
   29454 }
   29455 
   29456 #ifdef LIBXML_AUTOMATA_ENABLED
   29457 
   29458 #define gen_nb_xmlAutomataStatePtr 1
   29459 static xmlAutomataStatePtr gen_xmlAutomataStatePtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
   29460     return(NULL);
   29461 }
   29462 static void des_xmlAutomataStatePtr(int no ATTRIBUTE_UNUSED, xmlAutomataStatePtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
   29463 }
   29464 #endif
   29465 
   29466 
   29467 static int
   29468 test_xmlAutomataNewAllTrans(void) {
   29469     int test_ret = 0;
   29470 
   29471 
   29472     /* missing type support */
   29473     return(test_ret);
   29474 }
   29475 
   29476 
   29477 static int
   29478 test_xmlAutomataNewCountTrans(void) {
   29479     int test_ret = 0;
   29480 
   29481 
   29482     /* missing type support */
   29483     return(test_ret);
   29484 }
   29485 
   29486 
   29487 static int
   29488 test_xmlAutomataNewCountTrans2(void) {
   29489     int test_ret = 0;
   29490 
   29491 
   29492     /* missing type support */
   29493     return(test_ret);
   29494 }
   29495 
   29496 
   29497 static int
   29498 test_xmlAutomataNewCountedTrans(void) {
   29499     int test_ret = 0;
   29500 
   29501 
   29502     /* missing type support */
   29503     return(test_ret);
   29504 }
   29505 
   29506 
   29507 static int
   29508 test_xmlAutomataNewCounter(void) {
   29509     int test_ret = 0;
   29510 
   29511 #if defined(LIBXML_REGEXP_ENABLED) && defined(LIBXML_AUTOMATA_ENABLED)
   29512     int mem_base;
   29513     int ret_val;
   29514     xmlAutomataPtr am; /* an automata */
   29515     int n_am;
   29516     int min; /* the minimal value on the counter */
   29517     int n_min;
   29518     int max; /* the maximal value on the counter */
   29519     int n_max;
   29520 
   29521     for (n_am = 0;n_am < gen_nb_xmlAutomataPtr;n_am++) {
   29522     for (n_min = 0;n_min < gen_nb_int;n_min++) {
   29523     for (n_max = 0;n_max < gen_nb_int;n_max++) {
   29524         mem_base = xmlMemBlocks();
   29525         am = gen_xmlAutomataPtr(n_am, 0);
   29526         min = gen_int(n_min, 1);
   29527         max = gen_int(n_max, 2);
   29528 
   29529         ret_val = xmlAutomataNewCounter(am, min, max);
   29530         desret_int(ret_val);
   29531         call_tests++;
   29532         des_xmlAutomataPtr(n_am, am, 0);
   29533         des_int(n_min, min, 1);
   29534         des_int(n_max, max, 2);
   29535         xmlResetLastError();
   29536         if (mem_base != xmlMemBlocks()) {
   29537             printf("Leak of %d blocks found in xmlAutomataNewCounter",
   29538 	           xmlMemBlocks() - mem_base);
   29539 	    test_ret++;
   29540             printf(" %d", n_am);
   29541             printf(" %d", n_min);
   29542             printf(" %d", n_max);
   29543             printf("\n");
   29544         }
   29545     }
   29546     }
   29547     }
   29548     function_tests++;
   29549 #endif
   29550 
   29551     return(test_ret);
   29552 }
   29553 
   29554 
   29555 static int
   29556 test_xmlAutomataNewCounterTrans(void) {
   29557     int test_ret = 0;
   29558 
   29559 
   29560     /* missing type support */
   29561     return(test_ret);
   29562 }
   29563 
   29564 
   29565 static int
   29566 test_xmlAutomataNewEpsilon(void) {
   29567     int test_ret = 0;
   29568 
   29569 
   29570     /* missing type support */
   29571     return(test_ret);
   29572 }
   29573 
   29574 
   29575 static int
   29576 test_xmlAutomataNewNegTrans(void) {
   29577     int test_ret = 0;
   29578 
   29579 
   29580     /* missing type support */
   29581     return(test_ret);
   29582 }
   29583 
   29584 
   29585 static int
   29586 test_xmlAutomataNewOnceTrans(void) {
   29587     int test_ret = 0;
   29588 
   29589 
   29590     /* missing type support */
   29591     return(test_ret);
   29592 }
   29593 
   29594 
   29595 static int
   29596 test_xmlAutomataNewOnceTrans2(void) {
   29597     int test_ret = 0;
   29598 
   29599 
   29600     /* missing type support */
   29601     return(test_ret);
   29602 }
   29603 
   29604 
   29605 static int
   29606 test_xmlAutomataNewState(void) {
   29607     int test_ret = 0;
   29608 
   29609 
   29610     /* missing type support */
   29611     return(test_ret);
   29612 }
   29613 
   29614 
   29615 static int
   29616 test_xmlAutomataNewTransition(void) {
   29617     int test_ret = 0;
   29618 
   29619 
   29620     /* missing type support */
   29621     return(test_ret);
   29622 }
   29623 
   29624 
   29625 static int
   29626 test_xmlAutomataNewTransition2(void) {
   29627     int test_ret = 0;
   29628 
   29629 
   29630     /* missing type support */
   29631     return(test_ret);
   29632 }
   29633 
   29634 
   29635 static int
   29636 test_xmlAutomataSetFinalState(void) {
   29637     int test_ret = 0;
   29638 
   29639 #if defined(LIBXML_REGEXP_ENABLED) && defined(LIBXML_AUTOMATA_ENABLED)
   29640     int mem_base;
   29641     int ret_val;
   29642     xmlAutomataPtr am; /* an automata */
   29643     int n_am;
   29644     xmlAutomataStatePtr state; /* a state in this automata */
   29645     int n_state;
   29646 
   29647     for (n_am = 0;n_am < gen_nb_xmlAutomataPtr;n_am++) {
   29648     for (n_state = 0;n_state < gen_nb_xmlAutomataStatePtr;n_state++) {
   29649         mem_base = xmlMemBlocks();
   29650         am = gen_xmlAutomataPtr(n_am, 0);
   29651         state = gen_xmlAutomataStatePtr(n_state, 1);
   29652 
   29653         ret_val = xmlAutomataSetFinalState(am, state);
   29654         desret_int(ret_val);
   29655         call_tests++;
   29656         des_xmlAutomataPtr(n_am, am, 0);
   29657         des_xmlAutomataStatePtr(n_state, state, 1);
   29658         xmlResetLastError();
   29659         if (mem_base != xmlMemBlocks()) {
   29660             printf("Leak of %d blocks found in xmlAutomataSetFinalState",
   29661 	           xmlMemBlocks() - mem_base);
   29662 	    test_ret++;
   29663             printf(" %d", n_am);
   29664             printf(" %d", n_state);
   29665             printf("\n");
   29666         }
   29667     }
   29668     }
   29669     function_tests++;
   29670 #endif
   29671 
   29672     return(test_ret);
   29673 }
   29674 
   29675 
   29676 static int
   29677 test_xmlNewAutomata(void) {
   29678     int test_ret = 0;
   29679 
   29680 
   29681     /* missing type support */
   29682     return(test_ret);
   29683 }
   29684 
   29685 static int
   29686 test_xmlautomata(void) {
   29687     int test_ret = 0;
   29688 
   29689     if (quiet == 0) printf("Testing xmlautomata : 3 of 19 functions ...\n");
   29690     test_ret += test_xmlAutomataCompile();
   29691     test_ret += test_xmlAutomataGetInitState();
   29692     test_ret += test_xmlAutomataIsDeterminist();
   29693     test_ret += test_xmlAutomataNewAllTrans();
   29694     test_ret += test_xmlAutomataNewCountTrans();
   29695     test_ret += test_xmlAutomataNewCountTrans2();
   29696     test_ret += test_xmlAutomataNewCountedTrans();
   29697     test_ret += test_xmlAutomataNewCounter();
   29698     test_ret += test_xmlAutomataNewCounterTrans();
   29699     test_ret += test_xmlAutomataNewEpsilon();
   29700     test_ret += test_xmlAutomataNewNegTrans();
   29701     test_ret += test_xmlAutomataNewOnceTrans();
   29702     test_ret += test_xmlAutomataNewOnceTrans2();
   29703     test_ret += test_xmlAutomataNewState();
   29704     test_ret += test_xmlAutomataNewTransition();
   29705     test_ret += test_xmlAutomataNewTransition2();
   29706     test_ret += test_xmlAutomataSetFinalState();
   29707     test_ret += test_xmlNewAutomata();
   29708 
   29709     if (test_ret != 0)
   29710 	printf("Module xmlautomata: %d errors\n", test_ret);
   29711     return(test_ret);
   29712 }
   29713 
   29714 #define gen_nb_xmlGenericErrorFunc_ptr 1
   29715 static xmlGenericErrorFunc * gen_xmlGenericErrorFunc_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
   29716     return(NULL);
   29717 }
   29718 static void des_xmlGenericErrorFunc_ptr(int no ATTRIBUTE_UNUSED, xmlGenericErrorFunc * val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
   29719 }
   29720 
   29721 static int
   29722 test_initGenericErrorDefaultFunc(void) {
   29723     int test_ret = 0;
   29724 
   29725     int mem_base;
   29726     xmlGenericErrorFunc * handler; /* the handler */
   29727     int n_handler;
   29728 
   29729     for (n_handler = 0;n_handler < gen_nb_xmlGenericErrorFunc_ptr;n_handler++) {
   29730         mem_base = xmlMemBlocks();
   29731         handler = gen_xmlGenericErrorFunc_ptr(n_handler, 0);
   29732 
   29733         initGenericErrorDefaultFunc(handler);
   29734         call_tests++;
   29735         des_xmlGenericErrorFunc_ptr(n_handler, handler, 0);
   29736         xmlResetLastError();
   29737         if (mem_base != xmlMemBlocks()) {
   29738             printf("Leak of %d blocks found in initGenericErrorDefaultFunc",
   29739 	           xmlMemBlocks() - mem_base);
   29740 	    test_ret++;
   29741             printf(" %d", n_handler);
   29742             printf("\n");
   29743         }
   29744     }
   29745     function_tests++;
   29746 
   29747     return(test_ret);
   29748 }
   29749 
   29750 
   29751 #define gen_nb_xmlErrorPtr 1
   29752 static xmlErrorPtr gen_xmlErrorPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
   29753     return(NULL);
   29754 }
   29755 static void des_xmlErrorPtr(int no ATTRIBUTE_UNUSED, xmlErrorPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
   29756 }
   29757 
   29758 static int
   29759 test_xmlCopyError(void) {
   29760     int test_ret = 0;
   29761 
   29762     int mem_base;
   29763     int ret_val;
   29764     xmlErrorPtr from; /* a source error */
   29765     int n_from;
   29766     xmlErrorPtr to; /* a target error */
   29767     int n_to;
   29768 
   29769     for (n_from = 0;n_from < gen_nb_xmlErrorPtr;n_from++) {
   29770     for (n_to = 0;n_to < gen_nb_xmlErrorPtr;n_to++) {
   29771         mem_base = xmlMemBlocks();
   29772         from = gen_xmlErrorPtr(n_from, 0);
   29773         to = gen_xmlErrorPtr(n_to, 1);
   29774 
   29775         ret_val = xmlCopyError(from, to);
   29776         desret_int(ret_val);
   29777         call_tests++;
   29778         des_xmlErrorPtr(n_from, from, 0);
   29779         des_xmlErrorPtr(n_to, to, 1);
   29780         xmlResetLastError();
   29781         if (mem_base != xmlMemBlocks()) {
   29782             printf("Leak of %d blocks found in xmlCopyError",
   29783 	           xmlMemBlocks() - mem_base);
   29784 	    test_ret++;
   29785             printf(" %d", n_from);
   29786             printf(" %d", n_to);
   29787             printf("\n");
   29788         }
   29789     }
   29790     }
   29791     function_tests++;
   29792 
   29793     return(test_ret);
   29794 }
   29795 
   29796 
   29797 static int
   29798 test_xmlCtxtGetLastError(void) {
   29799     int test_ret = 0;
   29800 
   29801 
   29802     /* missing type support */
   29803     return(test_ret);
   29804 }
   29805 
   29806 
   29807 static int
   29808 test_xmlCtxtResetLastError(void) {
   29809     int test_ret = 0;
   29810 
   29811     int mem_base;
   29812     void * ctx; /* an XML parser context */
   29813     int n_ctx;
   29814 
   29815     for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
   29816         mem_base = xmlMemBlocks();
   29817         ctx = gen_void_ptr(n_ctx, 0);
   29818 
   29819         xmlCtxtResetLastError(ctx);
   29820         call_tests++;
   29821         des_void_ptr(n_ctx, ctx, 0);
   29822         xmlResetLastError();
   29823         if (mem_base != xmlMemBlocks()) {
   29824             printf("Leak of %d blocks found in xmlCtxtResetLastError",
   29825 	           xmlMemBlocks() - mem_base);
   29826 	    test_ret++;
   29827             printf(" %d", n_ctx);
   29828             printf("\n");
   29829         }
   29830     }
   29831     function_tests++;
   29832 
   29833     return(test_ret);
   29834 }
   29835 
   29836 
   29837 static int
   29838 test_xmlGetLastError(void) {
   29839     int test_ret = 0;
   29840 
   29841 
   29842     /* missing type support */
   29843     return(test_ret);
   29844 }
   29845 
   29846 
   29847 static int
   29848 test_xmlParserError(void) {
   29849     int test_ret = 0;
   29850 
   29851 
   29852     /* missing type support */
   29853     return(test_ret);
   29854 }
   29855 
   29856 
   29857 static int
   29858 test_xmlParserPrintFileContext(void) {
   29859     int test_ret = 0;
   29860 
   29861     int mem_base;
   29862     xmlParserInputPtr input; /* an xmlParserInputPtr input */
   29863     int n_input;
   29864 
   29865     for (n_input = 0;n_input < gen_nb_xmlParserInputPtr;n_input++) {
   29866         mem_base = xmlMemBlocks();
   29867         input = gen_xmlParserInputPtr(n_input, 0);
   29868 
   29869         xmlParserPrintFileContext(input);
   29870         call_tests++;
   29871         des_xmlParserInputPtr(n_input, input, 0);
   29872         xmlResetLastError();
   29873         if (mem_base != xmlMemBlocks()) {
   29874             printf("Leak of %d blocks found in xmlParserPrintFileContext",
   29875 	           xmlMemBlocks() - mem_base);
   29876 	    test_ret++;
   29877             printf(" %d", n_input);
   29878             printf("\n");
   29879         }
   29880     }
   29881     function_tests++;
   29882 
   29883     return(test_ret);
   29884 }
   29885 
   29886 
   29887 static int
   29888 test_xmlParserPrintFileInfo(void) {
   29889     int test_ret = 0;
   29890 
   29891     int mem_base;
   29892     xmlParserInputPtr input; /* an xmlParserInputPtr input */
   29893     int n_input;
   29894 
   29895     for (n_input = 0;n_input < gen_nb_xmlParserInputPtr;n_input++) {
   29896         mem_base = xmlMemBlocks();
   29897         input = gen_xmlParserInputPtr(n_input, 0);
   29898 
   29899         xmlParserPrintFileInfo(input);
   29900         call_tests++;
   29901         des_xmlParserInputPtr(n_input, input, 0);
   29902         xmlResetLastError();
   29903         if (mem_base != xmlMemBlocks()) {
   29904             printf("Leak of %d blocks found in xmlParserPrintFileInfo",
   29905 	           xmlMemBlocks() - mem_base);
   29906 	    test_ret++;
   29907             printf(" %d", n_input);
   29908             printf("\n");
   29909         }
   29910     }
   29911     function_tests++;
   29912 
   29913     return(test_ret);
   29914 }
   29915 
   29916 
   29917 static int
   29918 test_xmlParserValidityError(void) {
   29919     int test_ret = 0;
   29920 
   29921 
   29922     /* missing type support */
   29923     return(test_ret);
   29924 }
   29925 
   29926 
   29927 static int
   29928 test_xmlParserValidityWarning(void) {
   29929     int test_ret = 0;
   29930 
   29931 
   29932     /* missing type support */
   29933     return(test_ret);
   29934 }
   29935 
   29936 
   29937 static int
   29938 test_xmlParserWarning(void) {
   29939     int test_ret = 0;
   29940 
   29941 
   29942     /* missing type support */
   29943     return(test_ret);
   29944 }
   29945 
   29946 
   29947 static int
   29948 test_xmlResetError(void) {
   29949     int test_ret = 0;
   29950 
   29951     int mem_base;
   29952     xmlErrorPtr err; /* pointer to the error. */
   29953     int n_err;
   29954 
   29955     for (n_err = 0;n_err < gen_nb_xmlErrorPtr;n_err++) {
   29956         mem_base = xmlMemBlocks();
   29957         err = gen_xmlErrorPtr(n_err, 0);
   29958 
   29959         xmlResetError(err);
   29960         call_tests++;
   29961         des_xmlErrorPtr(n_err, err, 0);
   29962         xmlResetLastError();
   29963         if (mem_base != xmlMemBlocks()) {
   29964             printf("Leak of %d blocks found in xmlResetError",
   29965 	           xmlMemBlocks() - mem_base);
   29966 	    test_ret++;
   29967             printf(" %d", n_err);
   29968             printf("\n");
   29969         }
   29970     }
   29971     function_tests++;
   29972 
   29973     return(test_ret);
   29974 }
   29975 
   29976 
   29977 static int
   29978 test_xmlResetLastError(void) {
   29979     int test_ret = 0;
   29980 
   29981 
   29982 
   29983         xmlResetLastError();
   29984         call_tests++;
   29985         xmlResetLastError();
   29986     function_tests++;
   29987 
   29988     return(test_ret);
   29989 }
   29990 
   29991 
   29992 static int
   29993 test_xmlSetGenericErrorFunc(void) {
   29994     int test_ret = 0;
   29995 
   29996 
   29997     /* missing type support */
   29998     return(test_ret);
   29999 }
   30000 
   30001 
   30002 static int
   30003 test_xmlSetStructuredErrorFunc(void) {
   30004     int test_ret = 0;
   30005 
   30006 
   30007     /* missing type support */
   30008     return(test_ret);
   30009 }
   30010 
   30011 static int
   30012 test_xmlerror(void) {
   30013     int test_ret = 0;
   30014 
   30015     if (quiet == 0) printf("Testing xmlerror : 7 of 15 functions ...\n");
   30016     test_ret += test_initGenericErrorDefaultFunc();
   30017     test_ret += test_xmlCopyError();
   30018     test_ret += test_xmlCtxtGetLastError();
   30019     test_ret += test_xmlCtxtResetLastError();
   30020     test_ret += test_xmlGetLastError();
   30021     test_ret += test_xmlParserError();
   30022     test_ret += test_xmlParserPrintFileContext();
   30023     test_ret += test_xmlParserPrintFileInfo();
   30024     test_ret += test_xmlParserValidityError();
   30025     test_ret += test_xmlParserValidityWarning();
   30026     test_ret += test_xmlParserWarning();
   30027     test_ret += test_xmlResetError();
   30028     test_ret += test_xmlResetLastError();
   30029     test_ret += test_xmlSetGenericErrorFunc();
   30030     test_ret += test_xmlSetStructuredErrorFunc();
   30031 
   30032     if (test_ret != 0)
   30033 	printf("Module xmlerror: %d errors\n", test_ret);
   30034     return(test_ret);
   30035 }
   30036 #ifdef LIBXML_MODULES_ENABLED
   30037 
   30038 #define gen_nb_xmlModulePtr 1
   30039 static xmlModulePtr gen_xmlModulePtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
   30040     return(NULL);
   30041 }
   30042 static void des_xmlModulePtr(int no ATTRIBUTE_UNUSED, xmlModulePtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
   30043 }
   30044 #endif
   30045 
   30046 
   30047 static int
   30048 test_xmlModuleClose(void) {
   30049     int test_ret = 0;
   30050 
   30051 #if defined(LIBXML_MODULES_ENABLED)
   30052     int mem_base;
   30053     int ret_val;
   30054     xmlModulePtr module; /* the module handle */
   30055     int n_module;
   30056 
   30057     for (n_module = 0;n_module < gen_nb_xmlModulePtr;n_module++) {
   30058         mem_base = xmlMemBlocks();
   30059         module = gen_xmlModulePtr(n_module, 0);
   30060 
   30061         ret_val = xmlModuleClose(module);
   30062         desret_int(ret_val);
   30063         call_tests++;
   30064         des_xmlModulePtr(n_module, module, 0);
   30065         xmlResetLastError();
   30066         if (mem_base != xmlMemBlocks()) {
   30067             printf("Leak of %d blocks found in xmlModuleClose",
   30068 	           xmlMemBlocks() - mem_base);
   30069 	    test_ret++;
   30070             printf(" %d", n_module);
   30071             printf("\n");
   30072         }
   30073     }
   30074     function_tests++;
   30075 #endif
   30076 
   30077     return(test_ret);
   30078 }
   30079 
   30080 
   30081 static int
   30082 test_xmlModuleOpen(void) {
   30083     int test_ret = 0;
   30084 
   30085 
   30086     /* missing type support */
   30087     return(test_ret);
   30088 }
   30089 
   30090 
   30091 static int
   30092 test_xmlModuleSymbol(void) {
   30093     int test_ret = 0;
   30094 
   30095 #if defined(LIBXML_MODULES_ENABLED)
   30096     int mem_base;
   30097     int ret_val;
   30098     xmlModulePtr module; /* the module */
   30099     int n_module;
   30100     char * name; /* the name of the symbol */
   30101     int n_name;
   30102     void ** symbol; /* the resulting symbol address */
   30103     int n_symbol;
   30104 
   30105     for (n_module = 0;n_module < gen_nb_xmlModulePtr;n_module++) {
   30106     for (n_name = 0;n_name < gen_nb_const_char_ptr;n_name++) {
   30107     for (n_symbol = 0;n_symbol < gen_nb_void_ptr_ptr;n_symbol++) {
   30108         mem_base = xmlMemBlocks();
   30109         module = gen_xmlModulePtr(n_module, 0);
   30110         name = gen_const_char_ptr(n_name, 1);
   30111         symbol = gen_void_ptr_ptr(n_symbol, 2);
   30112 
   30113         ret_val = xmlModuleSymbol(module, (const char *)name, symbol);
   30114         desret_int(ret_val);
   30115         call_tests++;
   30116         des_xmlModulePtr(n_module, module, 0);
   30117         des_const_char_ptr(n_name, (const char *)name, 1);
   30118         des_void_ptr_ptr(n_symbol, symbol, 2);
   30119         xmlResetLastError();
   30120         if (mem_base != xmlMemBlocks()) {
   30121             printf("Leak of %d blocks found in xmlModuleSymbol",
   30122 	           xmlMemBlocks() - mem_base);
   30123 	    test_ret++;
   30124             printf(" %d", n_module);
   30125             printf(" %d", n_name);
   30126             printf(" %d", n_symbol);
   30127             printf("\n");
   30128         }
   30129     }
   30130     }
   30131     }
   30132     function_tests++;
   30133 #endif
   30134 
   30135     return(test_ret);
   30136 }
   30137 
   30138 static int
   30139 test_xmlmodule(void) {
   30140     int test_ret = 0;
   30141 
   30142     if (quiet == 0) printf("Testing xmlmodule : 2 of 4 functions ...\n");
   30143     test_ret += test_xmlModuleClose();
   30144     test_ret += test_xmlModuleOpen();
   30145     test_ret += test_xmlModuleSymbol();
   30146 
   30147     if (test_ret != 0)
   30148 	printf("Module xmlmodule: %d errors\n", test_ret);
   30149     return(test_ret);
   30150 }
   30151 
   30152 static int
   30153 test_xmlNewTextReader(void) {
   30154     int test_ret = 0;
   30155 
   30156 #if defined(LIBXML_READER_ENABLED)
   30157     int mem_base;
   30158     xmlTextReaderPtr ret_val;
   30159     xmlParserInputBufferPtr input; /* the xmlParserInputBufferPtr used to read data */
   30160     int n_input;
   30161     const char * URI; /* the URI information for the source if available */
   30162     int n_URI;
   30163 
   30164     for (n_input = 0;n_input < gen_nb_xmlParserInputBufferPtr;n_input++) {
   30165     for (n_URI = 0;n_URI < gen_nb_filepath;n_URI++) {
   30166         mem_base = xmlMemBlocks();
   30167         input = gen_xmlParserInputBufferPtr(n_input, 0);
   30168         URI = gen_filepath(n_URI, 1);
   30169 
   30170         ret_val = xmlNewTextReader(input, URI);
   30171         desret_xmlTextReaderPtr(ret_val);
   30172         call_tests++;
   30173         des_xmlParserInputBufferPtr(n_input, input, 0);
   30174         des_filepath(n_URI, URI, 1);
   30175         xmlResetLastError();
   30176         if (mem_base != xmlMemBlocks()) {
   30177             printf("Leak of %d blocks found in xmlNewTextReader",
   30178 	           xmlMemBlocks() - mem_base);
   30179 	    test_ret++;
   30180             printf(" %d", n_input);
   30181             printf(" %d", n_URI);
   30182             printf("\n");
   30183         }
   30184     }
   30185     }
   30186     function_tests++;
   30187 #endif
   30188 
   30189     return(test_ret);
   30190 }
   30191 
   30192 
   30193 static int
   30194 test_xmlNewTextReaderFilename(void) {
   30195     int test_ret = 0;
   30196 
   30197 #if defined(LIBXML_READER_ENABLED)
   30198     int mem_base;
   30199     xmlTextReaderPtr ret_val;
   30200     const char * URI; /* the URI of the resource to process */
   30201     int n_URI;
   30202 
   30203     for (n_URI = 0;n_URI < gen_nb_filepath;n_URI++) {
   30204         mem_base = xmlMemBlocks();
   30205         URI = gen_filepath(n_URI, 0);
   30206 
   30207         ret_val = xmlNewTextReaderFilename(URI);
   30208         desret_xmlTextReaderPtr(ret_val);
   30209         call_tests++;
   30210         des_filepath(n_URI, URI, 0);
   30211         xmlResetLastError();
   30212         if (mem_base != xmlMemBlocks()) {
   30213             printf("Leak of %d blocks found in xmlNewTextReaderFilename",
   30214 	           xmlMemBlocks() - mem_base);
   30215 	    test_ret++;
   30216             printf(" %d", n_URI);
   30217             printf("\n");
   30218         }
   30219     }
   30220     function_tests++;
   30221 #endif
   30222 
   30223     return(test_ret);
   30224 }
   30225 
   30226 
   30227 static int
   30228 test_xmlReaderForDoc(void) {
   30229     int test_ret = 0;
   30230 
   30231 #if defined(LIBXML_READER_ENABLED)
   30232     int mem_base;
   30233     xmlTextReaderPtr ret_val;
   30234     xmlChar * cur; /* a pointer to a zero terminated string */
   30235     int n_cur;
   30236     const char * URL; /* the base URL to use for the document */
   30237     int n_URL;
   30238     char * encoding; /* the document encoding, or NULL */
   30239     int n_encoding;
   30240     int options; /* a combination of xmlParserOption */
   30241     int n_options;
   30242 
   30243     for (n_cur = 0;n_cur < gen_nb_const_xmlChar_ptr;n_cur++) {
   30244     for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) {
   30245     for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
   30246     for (n_options = 0;n_options < gen_nb_parseroptions;n_options++) {
   30247         mem_base = xmlMemBlocks();
   30248         cur = gen_const_xmlChar_ptr(n_cur, 0);
   30249         URL = gen_filepath(n_URL, 1);
   30250         encoding = gen_const_char_ptr(n_encoding, 2);
   30251         options = gen_parseroptions(n_options, 3);
   30252 
   30253         ret_val = xmlReaderForDoc((const xmlChar *)cur, URL, (const char *)encoding, options);
   30254         desret_xmlTextReaderPtr(ret_val);
   30255         call_tests++;
   30256         des_const_xmlChar_ptr(n_cur, (const xmlChar *)cur, 0);
   30257         des_filepath(n_URL, URL, 1);
   30258         des_const_char_ptr(n_encoding, (const char *)encoding, 2);
   30259         des_parseroptions(n_options, options, 3);
   30260         xmlResetLastError();
   30261         if (mem_base != xmlMemBlocks()) {
   30262             printf("Leak of %d blocks found in xmlReaderForDoc",
   30263 	           xmlMemBlocks() - mem_base);
   30264 	    test_ret++;
   30265             printf(" %d", n_cur);
   30266             printf(" %d", n_URL);
   30267             printf(" %d", n_encoding);
   30268             printf(" %d", n_options);
   30269             printf("\n");
   30270         }
   30271     }
   30272     }
   30273     }
   30274     }
   30275     function_tests++;
   30276 #endif
   30277 
   30278     return(test_ret);
   30279 }
   30280 
   30281 
   30282 static int
   30283 test_xmlReaderForFile(void) {
   30284     int test_ret = 0;
   30285 
   30286 #if defined(LIBXML_READER_ENABLED)
   30287     int mem_base;
   30288     xmlTextReaderPtr ret_val;
   30289     const char * filename; /* a file or URL */
   30290     int n_filename;
   30291     char * encoding; /* the document encoding, or NULL */
   30292     int n_encoding;
   30293     int options; /* a combination of xmlParserOption */
   30294     int n_options;
   30295 
   30296     for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
   30297     for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
   30298     for (n_options = 0;n_options < gen_nb_parseroptions;n_options++) {
   30299         mem_base = xmlMemBlocks();
   30300         filename = gen_filepath(n_filename, 0);
   30301         encoding = gen_const_char_ptr(n_encoding, 1);
   30302         options = gen_parseroptions(n_options, 2);
   30303 
   30304         ret_val = xmlReaderForFile(filename, (const char *)encoding, options);
   30305         desret_xmlTextReaderPtr(ret_val);
   30306         call_tests++;
   30307         des_filepath(n_filename, filename, 0);
   30308         des_const_char_ptr(n_encoding, (const char *)encoding, 1);
   30309         des_parseroptions(n_options, options, 2);
   30310         xmlResetLastError();
   30311         if (mem_base != xmlMemBlocks()) {
   30312             printf("Leak of %d blocks found in xmlReaderForFile",
   30313 	           xmlMemBlocks() - mem_base);
   30314 	    test_ret++;
   30315             printf(" %d", n_filename);
   30316             printf(" %d", n_encoding);
   30317             printf(" %d", n_options);
   30318             printf("\n");
   30319         }
   30320     }
   30321     }
   30322     }
   30323     function_tests++;
   30324 #endif
   30325 
   30326     return(test_ret);
   30327 }
   30328 
   30329 
   30330 static int
   30331 test_xmlReaderForMemory(void) {
   30332     int test_ret = 0;
   30333 
   30334 #if defined(LIBXML_READER_ENABLED)
   30335     int mem_base;
   30336     xmlTextReaderPtr ret_val;
   30337     char * buffer; /* a pointer to a char array */
   30338     int n_buffer;
   30339     int size; /* the size of the array */
   30340     int n_size;
   30341     const char * URL; /* the base URL to use for the document */
   30342     int n_URL;
   30343     char * encoding; /* the document encoding, or NULL */
   30344     int n_encoding;
   30345     int options; /* a combination of xmlParserOption */
   30346     int n_options;
   30347 
   30348     for (n_buffer = 0;n_buffer < gen_nb_const_char_ptr;n_buffer++) {
   30349     for (n_size = 0;n_size < gen_nb_int;n_size++) {
   30350     for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) {
   30351     for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
   30352     for (n_options = 0;n_options < gen_nb_parseroptions;n_options++) {
   30353         mem_base = xmlMemBlocks();
   30354         buffer = gen_const_char_ptr(n_buffer, 0);
   30355         size = gen_int(n_size, 1);
   30356         URL = gen_filepath(n_URL, 2);
   30357         encoding = gen_const_char_ptr(n_encoding, 3);
   30358         options = gen_parseroptions(n_options, 4);
   30359         if ((buffer != NULL) &&
   30360             (size > (int) strlen((const char *) buffer) + 1))
   30361             continue;
   30362 
   30363         ret_val = xmlReaderForMemory((const char *)buffer, size, URL, (const char *)encoding, options);
   30364         desret_xmlTextReaderPtr(ret_val);
   30365         call_tests++;
   30366         des_const_char_ptr(n_buffer, (const char *)buffer, 0);
   30367         des_int(n_size, size, 1);
   30368         des_filepath(n_URL, URL, 2);
   30369         des_const_char_ptr(n_encoding, (const char *)encoding, 3);
   30370         des_parseroptions(n_options, options, 4);
   30371         xmlResetLastError();
   30372         if (mem_base != xmlMemBlocks()) {
   30373             printf("Leak of %d blocks found in xmlReaderForMemory",
   30374 	           xmlMemBlocks() - mem_base);
   30375 	    test_ret++;
   30376             printf(" %d", n_buffer);
   30377             printf(" %d", n_size);
   30378             printf(" %d", n_URL);
   30379             printf(" %d", n_encoding);
   30380             printf(" %d", n_options);
   30381             printf("\n");
   30382         }
   30383     }
   30384     }
   30385     }
   30386     }
   30387     }
   30388     function_tests++;
   30389 #endif
   30390 
   30391     return(test_ret);
   30392 }
   30393 
   30394 
   30395 static int
   30396 test_xmlReaderNewDoc(void) {
   30397     int test_ret = 0;
   30398 
   30399 #if defined(LIBXML_READER_ENABLED)
   30400     int mem_base;
   30401     int ret_val;
   30402     xmlTextReaderPtr reader; /* an XML reader */
   30403     int n_reader;
   30404     xmlChar * cur; /* a pointer to a zero terminated string */
   30405     int n_cur;
   30406     const char * URL; /* the base URL to use for the document */
   30407     int n_URL;
   30408     char * encoding; /* the document encoding, or NULL */
   30409     int n_encoding;
   30410     int options; /* a combination of xmlParserOption */
   30411     int n_options;
   30412 
   30413     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
   30414     for (n_cur = 0;n_cur < gen_nb_const_xmlChar_ptr;n_cur++) {
   30415     for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) {
   30416     for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
   30417     for (n_options = 0;n_options < gen_nb_parseroptions;n_options++) {
   30418         mem_base = xmlMemBlocks();
   30419         reader = gen_xmlTextReaderPtr(n_reader, 0);
   30420         cur = gen_const_xmlChar_ptr(n_cur, 1);
   30421         URL = gen_filepath(n_URL, 2);
   30422         encoding = gen_const_char_ptr(n_encoding, 3);
   30423         options = gen_parseroptions(n_options, 4);
   30424 
   30425         ret_val = xmlReaderNewDoc(reader, (const xmlChar *)cur, URL, (const char *)encoding, options);
   30426         desret_int(ret_val);
   30427         call_tests++;
   30428         des_xmlTextReaderPtr(n_reader, reader, 0);
   30429         des_const_xmlChar_ptr(n_cur, (const xmlChar *)cur, 1);
   30430         des_filepath(n_URL, URL, 2);
   30431         des_const_char_ptr(n_encoding, (const char *)encoding, 3);
   30432         des_parseroptions(n_options, options, 4);
   30433         xmlResetLastError();
   30434         if (mem_base != xmlMemBlocks()) {
   30435             printf("Leak of %d blocks found in xmlReaderNewDoc",
   30436 	           xmlMemBlocks() - mem_base);
   30437 	    test_ret++;
   30438             printf(" %d", n_reader);
   30439             printf(" %d", n_cur);
   30440             printf(" %d", n_URL);
   30441             printf(" %d", n_encoding);
   30442             printf(" %d", n_options);
   30443             printf("\n");
   30444         }
   30445     }
   30446     }
   30447     }
   30448     }
   30449     }
   30450     function_tests++;
   30451 #endif
   30452 
   30453     return(test_ret);
   30454 }
   30455 
   30456 
   30457 static int
   30458 test_xmlReaderNewFile(void) {
   30459     int test_ret = 0;
   30460 
   30461 #if defined(LIBXML_READER_ENABLED)
   30462     int mem_base;
   30463     int ret_val;
   30464     xmlTextReaderPtr reader; /* an XML reader */
   30465     int n_reader;
   30466     const char * filename; /* a file or URL */
   30467     int n_filename;
   30468     char * encoding; /* the document encoding, or NULL */
   30469     int n_encoding;
   30470     int options; /* a combination of xmlParserOption */
   30471     int n_options;
   30472 
   30473     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
   30474     for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
   30475     for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
   30476     for (n_options = 0;n_options < gen_nb_parseroptions;n_options++) {
   30477         mem_base = xmlMemBlocks();
   30478         reader = gen_xmlTextReaderPtr(n_reader, 0);
   30479         filename = gen_filepath(n_filename, 1);
   30480         encoding = gen_const_char_ptr(n_encoding, 2);
   30481         options = gen_parseroptions(n_options, 3);
   30482 
   30483         ret_val = xmlReaderNewFile(reader, filename, (const char *)encoding, options);
   30484         desret_int(ret_val);
   30485         call_tests++;
   30486         des_xmlTextReaderPtr(n_reader, reader, 0);
   30487         des_filepath(n_filename, filename, 1);
   30488         des_const_char_ptr(n_encoding, (const char *)encoding, 2);
   30489         des_parseroptions(n_options, options, 3);
   30490         xmlResetLastError();
   30491         if (mem_base != xmlMemBlocks()) {
   30492             printf("Leak of %d blocks found in xmlReaderNewFile",
   30493 	           xmlMemBlocks() - mem_base);
   30494 	    test_ret++;
   30495             printf(" %d", n_reader);
   30496             printf(" %d", n_filename);
   30497             printf(" %d", n_encoding);
   30498             printf(" %d", n_options);
   30499             printf("\n");
   30500         }
   30501     }
   30502     }
   30503     }
   30504     }
   30505     function_tests++;
   30506 #endif
   30507 
   30508     return(test_ret);
   30509 }
   30510 
   30511 
   30512 static int
   30513 test_xmlReaderNewMemory(void) {
   30514     int test_ret = 0;
   30515 
   30516 #if defined(LIBXML_READER_ENABLED)
   30517     int mem_base;
   30518     int ret_val;
   30519     xmlTextReaderPtr reader; /* an XML reader */
   30520     int n_reader;
   30521     char * buffer; /* a pointer to a char array */
   30522     int n_buffer;
   30523     int size; /* the size of the array */
   30524     int n_size;
   30525     const char * URL; /* the base URL to use for the document */
   30526     int n_URL;
   30527     char * encoding; /* the document encoding, or NULL */
   30528     int n_encoding;
   30529     int options; /* a combination of xmlParserOption */
   30530     int n_options;
   30531 
   30532     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
   30533     for (n_buffer = 0;n_buffer < gen_nb_const_char_ptr;n_buffer++) {
   30534     for (n_size = 0;n_size < gen_nb_int;n_size++) {
   30535     for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) {
   30536     for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
   30537     for (n_options = 0;n_options < gen_nb_parseroptions;n_options++) {
   30538         mem_base = xmlMemBlocks();
   30539         reader = gen_xmlTextReaderPtr(n_reader, 0);
   30540         buffer = gen_const_char_ptr(n_buffer, 1);
   30541         size = gen_int(n_size, 2);
   30542         URL = gen_filepath(n_URL, 3);
   30543         encoding = gen_const_char_ptr(n_encoding, 4);
   30544         options = gen_parseroptions(n_options, 5);
   30545         if ((buffer != NULL) &&
   30546             (size > (int) strlen((const char *) buffer) + 1))
   30547             continue;
   30548 
   30549         ret_val = xmlReaderNewMemory(reader, (const char *)buffer, size, URL, (const char *)encoding, options);
   30550         desret_int(ret_val);
   30551         call_tests++;
   30552         des_xmlTextReaderPtr(n_reader, reader, 0);
   30553         des_const_char_ptr(n_buffer, (const char *)buffer, 1);
   30554         des_int(n_size, size, 2);
   30555         des_filepath(n_URL, URL, 3);
   30556         des_const_char_ptr(n_encoding, (const char *)encoding, 4);
   30557         des_parseroptions(n_options, options, 5);
   30558         xmlResetLastError();
   30559         if (mem_base != xmlMemBlocks()) {
   30560             printf("Leak of %d blocks found in xmlReaderNewMemory",
   30561 	           xmlMemBlocks() - mem_base);
   30562 	    test_ret++;
   30563             printf(" %d", n_reader);
   30564             printf(" %d", n_buffer);
   30565             printf(" %d", n_size);
   30566             printf(" %d", n_URL);
   30567             printf(" %d", n_encoding);
   30568             printf(" %d", n_options);
   30569             printf("\n");
   30570         }
   30571     }
   30572     }
   30573     }
   30574     }
   30575     }
   30576     }
   30577     function_tests++;
   30578 #endif
   30579 
   30580     return(test_ret);
   30581 }
   30582 
   30583 
   30584 static int
   30585 test_xmlReaderNewWalker(void) {
   30586     int test_ret = 0;
   30587 
   30588 #if defined(LIBXML_READER_ENABLED)
   30589     int mem_base;
   30590     int ret_val;
   30591     xmlTextReaderPtr reader; /* an XML reader */
   30592     int n_reader;
   30593     xmlDocPtr doc; /* a preparsed document */
   30594     int n_doc;
   30595 
   30596     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
   30597     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
   30598         mem_base = xmlMemBlocks();
   30599         reader = gen_xmlTextReaderPtr(n_reader, 0);
   30600         doc = gen_xmlDocPtr(n_doc, 1);
   30601 
   30602         ret_val = xmlReaderNewWalker(reader, doc);
   30603         desret_int(ret_val);
   30604         call_tests++;
   30605         des_xmlTextReaderPtr(n_reader, reader, 0);
   30606         des_xmlDocPtr(n_doc, doc, 1);
   30607         xmlResetLastError();
   30608         if (mem_base != xmlMemBlocks()) {
   30609             printf("Leak of %d blocks found in xmlReaderNewWalker",
   30610 	           xmlMemBlocks() - mem_base);
   30611 	    test_ret++;
   30612             printf(" %d", n_reader);
   30613             printf(" %d", n_doc);
   30614             printf("\n");
   30615         }
   30616     }
   30617     }
   30618     function_tests++;
   30619 #endif
   30620 
   30621     return(test_ret);
   30622 }
   30623 
   30624 
   30625 static int
   30626 test_xmlReaderWalker(void) {
   30627     int test_ret = 0;
   30628 
   30629 #if defined(LIBXML_READER_ENABLED)
   30630     int mem_base;
   30631     xmlTextReaderPtr ret_val;
   30632     xmlDocPtr doc; /* a preparsed document */
   30633     int n_doc;
   30634 
   30635     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
   30636         mem_base = xmlMemBlocks();
   30637         doc = gen_xmlDocPtr(n_doc, 0);
   30638 
   30639         ret_val = xmlReaderWalker(doc);
   30640         desret_xmlTextReaderPtr(ret_val);
   30641         call_tests++;
   30642         des_xmlDocPtr(n_doc, doc, 0);
   30643         xmlResetLastError();
   30644         if (mem_base != xmlMemBlocks()) {
   30645             printf("Leak of %d blocks found in xmlReaderWalker",
   30646 	           xmlMemBlocks() - mem_base);
   30647 	    test_ret++;
   30648             printf(" %d", n_doc);
   30649             printf("\n");
   30650         }
   30651     }
   30652     function_tests++;
   30653 #endif
   30654 
   30655     return(test_ret);
   30656 }
   30657 
   30658 
   30659 static int
   30660 test_xmlTextReaderAttributeCount(void) {
   30661     int test_ret = 0;
   30662 
   30663 #if defined(LIBXML_READER_ENABLED)
   30664     int mem_base;
   30665     int ret_val;
   30666     xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
   30667     int n_reader;
   30668 
   30669     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
   30670         mem_base = xmlMemBlocks();
   30671         reader = gen_xmlTextReaderPtr(n_reader, 0);
   30672 
   30673         ret_val = xmlTextReaderAttributeCount(reader);
   30674         desret_int(ret_val);
   30675         call_tests++;
   30676         des_xmlTextReaderPtr(n_reader, reader, 0);
   30677         xmlResetLastError();
   30678         if (mem_base != xmlMemBlocks()) {
   30679             printf("Leak of %d blocks found in xmlTextReaderAttributeCount",
   30680 	           xmlMemBlocks() - mem_base);
   30681 	    test_ret++;
   30682             printf(" %d", n_reader);
   30683             printf("\n");
   30684         }
   30685     }
   30686     function_tests++;
   30687 #endif
   30688 
   30689     return(test_ret);
   30690 }
   30691 
   30692 
   30693 static int
   30694 test_xmlTextReaderBaseUri(void) {
   30695     int test_ret = 0;
   30696 
   30697 #if defined(LIBXML_READER_ENABLED)
   30698     int mem_base;
   30699     xmlChar * ret_val;
   30700     xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
   30701     int n_reader;
   30702 
   30703     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
   30704         mem_base = xmlMemBlocks();
   30705         reader = gen_xmlTextReaderPtr(n_reader, 0);
   30706 
   30707         ret_val = xmlTextReaderBaseUri(reader);
   30708         desret_xmlChar_ptr(ret_val);
   30709         call_tests++;
   30710         des_xmlTextReaderPtr(n_reader, reader, 0);
   30711         xmlResetLastError();
   30712         if (mem_base != xmlMemBlocks()) {
   30713             printf("Leak of %d blocks found in xmlTextReaderBaseUri",
   30714 	           xmlMemBlocks() - mem_base);
   30715 	    test_ret++;
   30716             printf(" %d", n_reader);
   30717             printf("\n");
   30718         }
   30719     }
   30720     function_tests++;
   30721 #endif
   30722 
   30723     return(test_ret);
   30724 }
   30725 
   30726 
   30727 static int
   30728 test_xmlTextReaderByteConsumed(void) {
   30729     int test_ret = 0;
   30730 
   30731 #if defined(LIBXML_READER_ENABLED)
   30732     int mem_base;
   30733     long ret_val;
   30734     xmlTextReaderPtr reader; /* an XML reader */
   30735     int n_reader;
   30736 
   30737     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
   30738         mem_base = xmlMemBlocks();
   30739         reader = gen_xmlTextReaderPtr(n_reader, 0);
   30740 
   30741         ret_val = xmlTextReaderByteConsumed(reader);
   30742         desret_long(ret_val);
   30743         call_tests++;
   30744         des_xmlTextReaderPtr(n_reader, reader, 0);
   30745         xmlResetLastError();
   30746         if (mem_base != xmlMemBlocks()) {
   30747             printf("Leak of %d blocks found in xmlTextReaderByteConsumed",
   30748 	           xmlMemBlocks() - mem_base);
   30749 	    test_ret++;
   30750             printf(" %d", n_reader);
   30751             printf("\n");
   30752         }
   30753     }
   30754     function_tests++;
   30755 #endif
   30756 
   30757     return(test_ret);
   30758 }
   30759 
   30760 
   30761 static int
   30762 test_xmlTextReaderClose(void) {
   30763     int test_ret = 0;
   30764 
   30765 #if defined(LIBXML_READER_ENABLED)
   30766     int mem_base;
   30767     int ret_val;
   30768     xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
   30769     int n_reader;
   30770 
   30771     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
   30772         mem_base = xmlMemBlocks();
   30773         reader = gen_xmlTextReaderPtr(n_reader, 0);
   30774 
   30775         ret_val = xmlTextReaderClose(reader);
   30776         desret_int(ret_val);
   30777         call_tests++;
   30778         des_xmlTextReaderPtr(n_reader, reader, 0);
   30779         xmlResetLastError();
   30780         if (mem_base != xmlMemBlocks()) {
   30781             printf("Leak of %d blocks found in xmlTextReaderClose",
   30782 	           xmlMemBlocks() - mem_base);
   30783 	    test_ret++;
   30784             printf(" %d", n_reader);
   30785             printf("\n");
   30786         }
   30787     }
   30788     function_tests++;
   30789 #endif
   30790 
   30791     return(test_ret);
   30792 }
   30793 
   30794 
   30795 static int
   30796 test_xmlTextReaderConstBaseUri(void) {
   30797     int test_ret = 0;
   30798 
   30799 #if defined(LIBXML_READER_ENABLED)
   30800     int mem_base;
   30801     const xmlChar * ret_val;
   30802     xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
   30803     int n_reader;
   30804 
   30805     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
   30806         mem_base = xmlMemBlocks();
   30807         reader = gen_xmlTextReaderPtr(n_reader, 0);
   30808 
   30809         ret_val = xmlTextReaderConstBaseUri(reader);
   30810         desret_const_xmlChar_ptr(ret_val);
   30811         call_tests++;
   30812         des_xmlTextReaderPtr(n_reader, reader, 0);
   30813         xmlResetLastError();
   30814         if (mem_base != xmlMemBlocks()) {
   30815             printf("Leak of %d blocks found in xmlTextReaderConstBaseUri",
   30816 	           xmlMemBlocks() - mem_base);
   30817 	    test_ret++;
   30818             printf(" %d", n_reader);
   30819             printf("\n");
   30820         }
   30821     }
   30822     function_tests++;
   30823 #endif
   30824 
   30825     return(test_ret);
   30826 }
   30827 
   30828 
   30829 static int
   30830 test_xmlTextReaderConstEncoding(void) {
   30831     int test_ret = 0;
   30832 
   30833 #if defined(LIBXML_READER_ENABLED)
   30834     int mem_base;
   30835     const xmlChar * ret_val;
   30836     xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
   30837     int n_reader;
   30838 
   30839     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
   30840         mem_base = xmlMemBlocks();
   30841         reader = gen_xmlTextReaderPtr(n_reader, 0);
   30842 
   30843         ret_val = xmlTextReaderConstEncoding(reader);
   30844         desret_const_xmlChar_ptr(ret_val);
   30845         call_tests++;
   30846         des_xmlTextReaderPtr(n_reader, reader, 0);
   30847         xmlResetLastError();
   30848         if (mem_base != xmlMemBlocks()) {
   30849             printf("Leak of %d blocks found in xmlTextReaderConstEncoding",
   30850 	           xmlMemBlocks() - mem_base);
   30851 	    test_ret++;
   30852             printf(" %d", n_reader);
   30853             printf("\n");
   30854         }
   30855     }
   30856     function_tests++;
   30857 #endif
   30858 
   30859     return(test_ret);
   30860 }
   30861 
   30862 
   30863 static int
   30864 test_xmlTextReaderConstLocalName(void) {
   30865     int test_ret = 0;
   30866 
   30867 #if defined(LIBXML_READER_ENABLED)
   30868     int mem_base;
   30869     const xmlChar * ret_val;
   30870     xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
   30871     int n_reader;
   30872 
   30873     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
   30874         mem_base = xmlMemBlocks();
   30875         reader = gen_xmlTextReaderPtr(n_reader, 0);
   30876 
   30877         ret_val = xmlTextReaderConstLocalName(reader);
   30878         desret_const_xmlChar_ptr(ret_val);
   30879         call_tests++;
   30880         des_xmlTextReaderPtr(n_reader, reader, 0);
   30881         xmlResetLastError();
   30882         if (mem_base != xmlMemBlocks()) {
   30883             printf("Leak of %d blocks found in xmlTextReaderConstLocalName",
   30884 	           xmlMemBlocks() - mem_base);
   30885 	    test_ret++;
   30886             printf(" %d", n_reader);
   30887             printf("\n");
   30888         }
   30889     }
   30890     function_tests++;
   30891 #endif
   30892 
   30893     return(test_ret);
   30894 }
   30895 
   30896 
   30897 static int
   30898 test_xmlTextReaderConstName(void) {
   30899     int test_ret = 0;
   30900 
   30901 #if defined(LIBXML_READER_ENABLED)
   30902     int mem_base;
   30903     const xmlChar * ret_val;
   30904     xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
   30905     int n_reader;
   30906 
   30907     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
   30908         mem_base = xmlMemBlocks();
   30909         reader = gen_xmlTextReaderPtr(n_reader, 0);
   30910 
   30911         ret_val = xmlTextReaderConstName(reader);
   30912         desret_const_xmlChar_ptr(ret_val);
   30913         call_tests++;
   30914         des_xmlTextReaderPtr(n_reader, reader, 0);
   30915         xmlResetLastError();
   30916         if (mem_base != xmlMemBlocks()) {
   30917             printf("Leak of %d blocks found in xmlTextReaderConstName",
   30918 	           xmlMemBlocks() - mem_base);
   30919 	    test_ret++;
   30920             printf(" %d", n_reader);
   30921             printf("\n");
   30922         }
   30923     }
   30924     function_tests++;
   30925 #endif
   30926 
   30927     return(test_ret);
   30928 }
   30929 
   30930 
   30931 static int
   30932 test_xmlTextReaderConstNamespaceUri(void) {
   30933     int test_ret = 0;
   30934 
   30935 #if defined(LIBXML_READER_ENABLED)
   30936     int mem_base;
   30937     const xmlChar * ret_val;
   30938     xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
   30939     int n_reader;
   30940 
   30941     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
   30942         mem_base = xmlMemBlocks();
   30943         reader = gen_xmlTextReaderPtr(n_reader, 0);
   30944 
   30945         ret_val = xmlTextReaderConstNamespaceUri(reader);
   30946         desret_const_xmlChar_ptr(ret_val);
   30947         call_tests++;
   30948         des_xmlTextReaderPtr(n_reader, reader, 0);
   30949         xmlResetLastError();
   30950         if (mem_base != xmlMemBlocks()) {
   30951             printf("Leak of %d blocks found in xmlTextReaderConstNamespaceUri",
   30952 	           xmlMemBlocks() - mem_base);
   30953 	    test_ret++;
   30954             printf(" %d", n_reader);
   30955             printf("\n");
   30956         }
   30957     }
   30958     function_tests++;
   30959 #endif
   30960 
   30961     return(test_ret);
   30962 }
   30963 
   30964 
   30965 static int
   30966 test_xmlTextReaderConstPrefix(void) {
   30967     int test_ret = 0;
   30968 
   30969 #if defined(LIBXML_READER_ENABLED)
   30970     int mem_base;
   30971     const xmlChar * ret_val;
   30972     xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
   30973     int n_reader;
   30974 
   30975     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
   30976         mem_base = xmlMemBlocks();
   30977         reader = gen_xmlTextReaderPtr(n_reader, 0);
   30978 
   30979         ret_val = xmlTextReaderConstPrefix(reader);
   30980         desret_const_xmlChar_ptr(ret_val);
   30981         call_tests++;
   30982         des_xmlTextReaderPtr(n_reader, reader, 0);
   30983         xmlResetLastError();
   30984         if (mem_base != xmlMemBlocks()) {
   30985             printf("Leak of %d blocks found in xmlTextReaderConstPrefix",
   30986 	           xmlMemBlocks() - mem_base);
   30987 	    test_ret++;
   30988             printf(" %d", n_reader);
   30989             printf("\n");
   30990         }
   30991     }
   30992     function_tests++;
   30993 #endif
   30994 
   30995     return(test_ret);
   30996 }
   30997 
   30998 
   30999 static int
   31000 test_xmlTextReaderConstString(void) {
   31001     int test_ret = 0;
   31002 
   31003 #if defined(LIBXML_READER_ENABLED)
   31004     int mem_base;
   31005     const xmlChar * ret_val;
   31006     xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
   31007     int n_reader;
   31008     xmlChar * str; /* the string to intern. */
   31009     int n_str;
   31010 
   31011     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
   31012     for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) {
   31013         mem_base = xmlMemBlocks();
   31014         reader = gen_xmlTextReaderPtr(n_reader, 0);
   31015         str = gen_const_xmlChar_ptr(n_str, 1);
   31016 
   31017         ret_val = xmlTextReaderConstString(reader, (const xmlChar *)str);
   31018         desret_const_xmlChar_ptr(ret_val);
   31019         call_tests++;
   31020         des_xmlTextReaderPtr(n_reader, reader, 0);
   31021         des_const_xmlChar_ptr(n_str, (const xmlChar *)str, 1);
   31022         xmlResetLastError();
   31023         if (mem_base != xmlMemBlocks()) {
   31024             printf("Leak of %d blocks found in xmlTextReaderConstString",
   31025 	           xmlMemBlocks() - mem_base);
   31026 	    test_ret++;
   31027             printf(" %d", n_reader);
   31028             printf(" %d", n_str);
   31029             printf("\n");
   31030         }
   31031     }
   31032     }
   31033     function_tests++;
   31034 #endif
   31035 
   31036     return(test_ret);
   31037 }
   31038 
   31039 
   31040 static int
   31041 test_xmlTextReaderConstValue(void) {
   31042     int test_ret = 0;
   31043 
   31044 #if defined(LIBXML_READER_ENABLED)
   31045     int mem_base;
   31046     const xmlChar * ret_val;
   31047     xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
   31048     int n_reader;
   31049 
   31050     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
   31051         mem_base = xmlMemBlocks();
   31052         reader = gen_xmlTextReaderPtr(n_reader, 0);
   31053 
   31054         ret_val = xmlTextReaderConstValue(reader);
   31055         desret_const_xmlChar_ptr(ret_val);
   31056         call_tests++;
   31057         des_xmlTextReaderPtr(n_reader, reader, 0);
   31058         xmlResetLastError();
   31059         if (mem_base != xmlMemBlocks()) {
   31060             printf("Leak of %d blocks found in xmlTextReaderConstValue",
   31061 	           xmlMemBlocks() - mem_base);
   31062 	    test_ret++;
   31063             printf(" %d", n_reader);
   31064             printf("\n");
   31065         }
   31066     }
   31067     function_tests++;
   31068 #endif
   31069 
   31070     return(test_ret);
   31071 }
   31072 
   31073 
   31074 static int
   31075 test_xmlTextReaderConstXmlLang(void) {
   31076     int test_ret = 0;
   31077 
   31078 #if defined(LIBXML_READER_ENABLED)
   31079     int mem_base;
   31080     const xmlChar * ret_val;
   31081     xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
   31082     int n_reader;
   31083 
   31084     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
   31085         mem_base = xmlMemBlocks();
   31086         reader = gen_xmlTextReaderPtr(n_reader, 0);
   31087 
   31088         ret_val = xmlTextReaderConstXmlLang(reader);
   31089         desret_const_xmlChar_ptr(ret_val);
   31090         call_tests++;
   31091         des_xmlTextReaderPtr(n_reader, reader, 0);
   31092         xmlResetLastError();
   31093         if (mem_base != xmlMemBlocks()) {
   31094             printf("Leak of %d blocks found in xmlTextReaderConstXmlLang",
   31095 	           xmlMemBlocks() - mem_base);
   31096 	    test_ret++;
   31097             printf(" %d", n_reader);
   31098             printf("\n");
   31099         }
   31100     }
   31101     function_tests++;
   31102 #endif
   31103 
   31104     return(test_ret);
   31105 }
   31106 
   31107 
   31108 static int
   31109 test_xmlTextReaderConstXmlVersion(void) {
   31110     int test_ret = 0;
   31111 
   31112 #if defined(LIBXML_READER_ENABLED)
   31113     int mem_base;
   31114     const xmlChar * ret_val;
   31115     xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
   31116     int n_reader;
   31117 
   31118     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
   31119         mem_base = xmlMemBlocks();
   31120         reader = gen_xmlTextReaderPtr(n_reader, 0);
   31121 
   31122         ret_val = xmlTextReaderConstXmlVersion(reader);
   31123         desret_const_xmlChar_ptr(ret_val);
   31124         call_tests++;
   31125         des_xmlTextReaderPtr(n_reader, reader, 0);
   31126         xmlResetLastError();
   31127         if (mem_base != xmlMemBlocks()) {
   31128             printf("Leak of %d blocks found in xmlTextReaderConstXmlVersion",
   31129 	           xmlMemBlocks() - mem_base);
   31130 	    test_ret++;
   31131             printf(" %d", n_reader);
   31132             printf("\n");
   31133         }
   31134     }
   31135     function_tests++;
   31136 #endif
   31137 
   31138     return(test_ret);
   31139 }
   31140 
   31141 
   31142 static int
   31143 test_xmlTextReaderCurrentDoc(void) {
   31144     int test_ret = 0;
   31145 
   31146 #if defined(LIBXML_READER_ENABLED)
   31147     int mem_base;
   31148     xmlDocPtr ret_val;
   31149     xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
   31150     int n_reader;
   31151 
   31152     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
   31153         mem_base = xmlMemBlocks();
   31154         reader = gen_xmlTextReaderPtr(n_reader, 0);
   31155 
   31156         ret_val = xmlTextReaderCurrentDoc(reader);
   31157         desret_xmlDocPtr(ret_val);
   31158         call_tests++;
   31159         des_xmlTextReaderPtr(n_reader, reader, 0);
   31160         xmlResetLastError();
   31161         if (mem_base != xmlMemBlocks()) {
   31162             printf("Leak of %d blocks found in xmlTextReaderCurrentDoc",
   31163 	           xmlMemBlocks() - mem_base);
   31164 	    test_ret++;
   31165             printf(" %d", n_reader);
   31166             printf("\n");
   31167         }
   31168     }
   31169     function_tests++;
   31170 #endif
   31171 
   31172     return(test_ret);
   31173 }
   31174 
   31175 
   31176 static int
   31177 test_xmlTextReaderCurrentNode(void) {
   31178     int test_ret = 0;
   31179 
   31180 #if defined(LIBXML_READER_ENABLED)
   31181     int mem_base;
   31182     xmlNodePtr ret_val;
   31183     xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
   31184     int n_reader;
   31185 
   31186     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
   31187         mem_base = xmlMemBlocks();
   31188         reader = gen_xmlTextReaderPtr(n_reader, 0);
   31189 
   31190         ret_val = xmlTextReaderCurrentNode(reader);
   31191         desret_xmlNodePtr(ret_val);
   31192         call_tests++;
   31193         des_xmlTextReaderPtr(n_reader, reader, 0);
   31194         xmlResetLastError();
   31195         if (mem_base != xmlMemBlocks()) {
   31196             printf("Leak of %d blocks found in xmlTextReaderCurrentNode",
   31197 	           xmlMemBlocks() - mem_base);
   31198 	    test_ret++;
   31199             printf(" %d", n_reader);
   31200             printf("\n");
   31201         }
   31202     }
   31203     function_tests++;
   31204 #endif
   31205 
   31206     return(test_ret);
   31207 }
   31208 
   31209 
   31210 static int
   31211 test_xmlTextReaderDepth(void) {
   31212     int test_ret = 0;
   31213 
   31214 #if defined(LIBXML_READER_ENABLED)
   31215     int mem_base;
   31216     int ret_val;
   31217     xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
   31218     int n_reader;
   31219 
   31220     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
   31221         mem_base = xmlMemBlocks();
   31222         reader = gen_xmlTextReaderPtr(n_reader, 0);
   31223 
   31224         ret_val = xmlTextReaderDepth(reader);
   31225         desret_int(ret_val);
   31226         call_tests++;
   31227         des_xmlTextReaderPtr(n_reader, reader, 0);
   31228         xmlResetLastError();
   31229         if (mem_base != xmlMemBlocks()) {
   31230             printf("Leak of %d blocks found in xmlTextReaderDepth",
   31231 	           xmlMemBlocks() - mem_base);
   31232 	    test_ret++;
   31233             printf(" %d", n_reader);
   31234             printf("\n");
   31235         }
   31236     }
   31237     function_tests++;
   31238 #endif
   31239 
   31240     return(test_ret);
   31241 }
   31242 
   31243 
   31244 static int
   31245 test_xmlTextReaderExpand(void) {
   31246     int test_ret = 0;
   31247 
   31248 #if defined(LIBXML_READER_ENABLED)
   31249     int mem_base;
   31250     xmlNodePtr ret_val;
   31251     xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
   31252     int n_reader;
   31253 
   31254     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
   31255         mem_base = xmlMemBlocks();
   31256         reader = gen_xmlTextReaderPtr(n_reader, 0);
   31257 
   31258         ret_val = xmlTextReaderExpand(reader);
   31259         desret_xmlNodePtr(ret_val);
   31260         call_tests++;
   31261         des_xmlTextReaderPtr(n_reader, reader, 0);
   31262         xmlResetLastError();
   31263         if (mem_base != xmlMemBlocks()) {
   31264             printf("Leak of %d blocks found in xmlTextReaderExpand",
   31265 	           xmlMemBlocks() - mem_base);
   31266 	    test_ret++;
   31267             printf(" %d", n_reader);
   31268             printf("\n");
   31269         }
   31270     }
   31271     function_tests++;
   31272 #endif
   31273 
   31274     return(test_ret);
   31275 }
   31276 
   31277 
   31278 static int
   31279 test_xmlTextReaderGetAttribute(void) {
   31280     int test_ret = 0;
   31281 
   31282 #if defined(LIBXML_READER_ENABLED)
   31283     int mem_base;
   31284     xmlChar * ret_val;
   31285     xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
   31286     int n_reader;
   31287     xmlChar * name; /* the qualified name of the attribute. */
   31288     int n_name;
   31289 
   31290     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
   31291     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
   31292         mem_base = xmlMemBlocks();
   31293         reader = gen_xmlTextReaderPtr(n_reader, 0);
   31294         name = gen_const_xmlChar_ptr(n_name, 1);
   31295 
   31296         ret_val = xmlTextReaderGetAttribute(reader, (const xmlChar *)name);
   31297         desret_xmlChar_ptr(ret_val);
   31298         call_tests++;
   31299         des_xmlTextReaderPtr(n_reader, reader, 0);
   31300         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
   31301         xmlResetLastError();
   31302         if (mem_base != xmlMemBlocks()) {
   31303             printf("Leak of %d blocks found in xmlTextReaderGetAttribute",
   31304 	           xmlMemBlocks() - mem_base);
   31305 	    test_ret++;
   31306             printf(" %d", n_reader);
   31307             printf(" %d", n_name);
   31308             printf("\n");
   31309         }
   31310     }
   31311     }
   31312     function_tests++;
   31313 #endif
   31314 
   31315     return(test_ret);
   31316 }
   31317 
   31318 
   31319 static int
   31320 test_xmlTextReaderGetAttributeNo(void) {
   31321     int test_ret = 0;
   31322 
   31323 #if defined(LIBXML_READER_ENABLED)
   31324     int mem_base;
   31325     xmlChar * ret_val;
   31326     xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
   31327     int n_reader;
   31328     int no; /* the zero-based index of the attribute relative to the containing element */
   31329     int n_no;
   31330 
   31331     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
   31332     for (n_no = 0;n_no < gen_nb_int;n_no++) {
   31333         mem_base = xmlMemBlocks();
   31334         reader = gen_xmlTextReaderPtr(n_reader, 0);
   31335         no = gen_int(n_no, 1);
   31336 
   31337         ret_val = xmlTextReaderGetAttributeNo(reader, no);
   31338         desret_xmlChar_ptr(ret_val);
   31339         call_tests++;
   31340         des_xmlTextReaderPtr(n_reader, reader, 0);
   31341         des_int(n_no, no, 1);
   31342         xmlResetLastError();
   31343         if (mem_base != xmlMemBlocks()) {
   31344             printf("Leak of %d blocks found in xmlTextReaderGetAttributeNo",
   31345 	           xmlMemBlocks() - mem_base);
   31346 	    test_ret++;
   31347             printf(" %d", n_reader);
   31348             printf(" %d", n_no);
   31349             printf("\n");
   31350         }
   31351     }
   31352     }
   31353     function_tests++;
   31354 #endif
   31355 
   31356     return(test_ret);
   31357 }
   31358 
   31359 
   31360 static int
   31361 test_xmlTextReaderGetAttributeNs(void) {
   31362     int test_ret = 0;
   31363 
   31364 #if defined(LIBXML_READER_ENABLED)
   31365     int mem_base;
   31366     xmlChar * ret_val;
   31367     xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
   31368     int n_reader;
   31369     xmlChar * localName; /* the local name of the attribute. */
   31370     int n_localName;
   31371     xmlChar * namespaceURI; /* the namespace URI of the attribute. */
   31372     int n_namespaceURI;
   31373 
   31374     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
   31375     for (n_localName = 0;n_localName < gen_nb_const_xmlChar_ptr;n_localName++) {
   31376     for (n_namespaceURI = 0;n_namespaceURI < gen_nb_const_xmlChar_ptr;n_namespaceURI++) {
   31377         mem_base = xmlMemBlocks();
   31378         reader = gen_xmlTextReaderPtr(n_reader, 0);
   31379         localName = gen_const_xmlChar_ptr(n_localName, 1);
   31380         namespaceURI = gen_const_xmlChar_ptr(n_namespaceURI, 2);
   31381 
   31382         ret_val = xmlTextReaderGetAttributeNs(reader, (const xmlChar *)localName, (const xmlChar *)namespaceURI);
   31383         desret_xmlChar_ptr(ret_val);
   31384         call_tests++;
   31385         des_xmlTextReaderPtr(n_reader, reader, 0);
   31386         des_const_xmlChar_ptr(n_localName, (const xmlChar *)localName, 1);
   31387         des_const_xmlChar_ptr(n_namespaceURI, (const xmlChar *)namespaceURI, 2);
   31388         xmlResetLastError();
   31389         if (mem_base != xmlMemBlocks()) {
   31390             printf("Leak of %d blocks found in xmlTextReaderGetAttributeNs",
   31391 	           xmlMemBlocks() - mem_base);
   31392 	    test_ret++;
   31393             printf(" %d", n_reader);
   31394             printf(" %d", n_localName);
   31395             printf(" %d", n_namespaceURI);
   31396             printf("\n");
   31397         }
   31398     }
   31399     }
   31400     }
   31401     function_tests++;
   31402 #endif
   31403 
   31404     return(test_ret);
   31405 }
   31406 
   31407 #ifdef LIBXML_READER_ENABLED
   31408 
   31409 #define gen_nb_xmlTextReaderErrorFunc_ptr 1
   31410 static xmlTextReaderErrorFunc * gen_xmlTextReaderErrorFunc_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
   31411     return(NULL);
   31412 }
   31413 static void des_xmlTextReaderErrorFunc_ptr(int no ATTRIBUTE_UNUSED, xmlTextReaderErrorFunc * val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
   31414 }
   31415 #endif
   31416 
   31417 
   31418 static int
   31419 test_xmlTextReaderGetErrorHandler(void) {
   31420     int test_ret = 0;
   31421 
   31422 #if defined(LIBXML_READER_ENABLED)
   31423     int mem_base;
   31424     xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
   31425     int n_reader;
   31426     xmlTextReaderErrorFunc * f; /* the callback function or NULL is no callback has been registered */
   31427     int n_f;
   31428     void ** arg; /* a user argument */
   31429     int n_arg;
   31430 
   31431     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
   31432     for (n_f = 0;n_f < gen_nb_xmlTextReaderErrorFunc_ptr;n_f++) {
   31433     for (n_arg = 0;n_arg < gen_nb_void_ptr_ptr;n_arg++) {
   31434         mem_base = xmlMemBlocks();
   31435         reader = gen_xmlTextReaderPtr(n_reader, 0);
   31436         f = gen_xmlTextReaderErrorFunc_ptr(n_f, 1);
   31437         arg = gen_void_ptr_ptr(n_arg, 2);
   31438 
   31439         xmlTextReaderGetErrorHandler(reader, f, arg);
   31440         call_tests++;
   31441         des_xmlTextReaderPtr(n_reader, reader, 0);
   31442         des_xmlTextReaderErrorFunc_ptr(n_f, f, 1);
   31443         des_void_ptr_ptr(n_arg, arg, 2);
   31444         xmlResetLastError();
   31445         if (mem_base != xmlMemBlocks()) {
   31446             printf("Leak of %d blocks found in xmlTextReaderGetErrorHandler",
   31447 	           xmlMemBlocks() - mem_base);
   31448 	    test_ret++;
   31449             printf(" %d", n_reader);
   31450             printf(" %d", n_f);
   31451             printf(" %d", n_arg);
   31452             printf("\n");
   31453         }
   31454     }
   31455     }
   31456     }
   31457     function_tests++;
   31458 #endif
   31459 
   31460     return(test_ret);
   31461 }
   31462 
   31463 
   31464 static int
   31465 test_xmlTextReaderGetParserColumnNumber(void) {
   31466     int test_ret = 0;
   31467 
   31468 #if defined(LIBXML_READER_ENABLED)
   31469     int mem_base;
   31470     int ret_val;
   31471     xmlTextReaderPtr reader; /* the user data (XML reader context) */
   31472     int n_reader;
   31473 
   31474     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
   31475         mem_base = xmlMemBlocks();
   31476         reader = gen_xmlTextReaderPtr(n_reader, 0);
   31477 
   31478         ret_val = xmlTextReaderGetParserColumnNumber(reader);
   31479         desret_int(ret_val);
   31480         call_tests++;
   31481         des_xmlTextReaderPtr(n_reader, reader, 0);
   31482         xmlResetLastError();
   31483         if (mem_base != xmlMemBlocks()) {
   31484             printf("Leak of %d blocks found in xmlTextReaderGetParserColumnNumber",
   31485 	           xmlMemBlocks() - mem_base);
   31486 	    test_ret++;
   31487             printf(" %d", n_reader);
   31488             printf("\n");
   31489         }
   31490     }
   31491     function_tests++;
   31492 #endif
   31493 
   31494     return(test_ret);
   31495 }
   31496 
   31497 
   31498 static int
   31499 test_xmlTextReaderGetParserLineNumber(void) {
   31500     int test_ret = 0;
   31501 
   31502 #if defined(LIBXML_READER_ENABLED)
   31503     int mem_base;
   31504     int ret_val;
   31505     xmlTextReaderPtr reader; /* the user data (XML reader context) */
   31506     int n_reader;
   31507 
   31508     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
   31509         mem_base = xmlMemBlocks();
   31510         reader = gen_xmlTextReaderPtr(n_reader, 0);
   31511 
   31512         ret_val = xmlTextReaderGetParserLineNumber(reader);
   31513         desret_int(ret_val);
   31514         call_tests++;
   31515         des_xmlTextReaderPtr(n_reader, reader, 0);
   31516         xmlResetLastError();
   31517         if (mem_base != xmlMemBlocks()) {
   31518             printf("Leak of %d blocks found in xmlTextReaderGetParserLineNumber",
   31519 	           xmlMemBlocks() - mem_base);
   31520 	    test_ret++;
   31521             printf(" %d", n_reader);
   31522             printf("\n");
   31523         }
   31524     }
   31525     function_tests++;
   31526 #endif
   31527 
   31528     return(test_ret);
   31529 }
   31530 
   31531 
   31532 static int
   31533 test_xmlTextReaderGetParserProp(void) {
   31534     int test_ret = 0;
   31535 
   31536 #if defined(LIBXML_READER_ENABLED)
   31537     int mem_base;
   31538     int ret_val;
   31539     xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
   31540     int n_reader;
   31541     int prop; /* the xmlParserProperties to get */
   31542     int n_prop;
   31543 
   31544     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
   31545     for (n_prop = 0;n_prop < gen_nb_int;n_prop++) {
   31546         mem_base = xmlMemBlocks();
   31547         reader = gen_xmlTextReaderPtr(n_reader, 0);
   31548         prop = gen_int(n_prop, 1);
   31549 
   31550         ret_val = xmlTextReaderGetParserProp(reader, prop);
   31551         desret_int(ret_val);
   31552         call_tests++;
   31553         des_xmlTextReaderPtr(n_reader, reader, 0);
   31554         des_int(n_prop, prop, 1);
   31555         xmlResetLastError();
   31556         if (mem_base != xmlMemBlocks()) {
   31557             printf("Leak of %d blocks found in xmlTextReaderGetParserProp",
   31558 	           xmlMemBlocks() - mem_base);
   31559 	    test_ret++;
   31560             printf(" %d", n_reader);
   31561             printf(" %d", n_prop);
   31562             printf("\n");
   31563         }
   31564     }
   31565     }
   31566     function_tests++;
   31567 #endif
   31568 
   31569     return(test_ret);
   31570 }
   31571 
   31572 
   31573 static int
   31574 test_xmlTextReaderGetRemainder(void) {
   31575     int test_ret = 0;
   31576 
   31577 #if defined(LIBXML_READER_ENABLED)
   31578     int mem_base;
   31579     xmlParserInputBufferPtr ret_val;
   31580     xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
   31581     int n_reader;
   31582 
   31583     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
   31584         mem_base = xmlMemBlocks();
   31585         reader = gen_xmlTextReaderPtr(n_reader, 0);
   31586 
   31587         ret_val = xmlTextReaderGetRemainder(reader);
   31588         desret_xmlParserInputBufferPtr(ret_val);
   31589         call_tests++;
   31590         des_xmlTextReaderPtr(n_reader, reader, 0);
   31591         xmlResetLastError();
   31592         if (mem_base != xmlMemBlocks()) {
   31593             printf("Leak of %d blocks found in xmlTextReaderGetRemainder",
   31594 	           xmlMemBlocks() - mem_base);
   31595 	    test_ret++;
   31596             printf(" %d", n_reader);
   31597             printf("\n");
   31598         }
   31599     }
   31600     function_tests++;
   31601 #endif
   31602 
   31603     return(test_ret);
   31604 }
   31605 
   31606 
   31607 static int
   31608 test_xmlTextReaderHasAttributes(void) {
   31609     int test_ret = 0;
   31610 
   31611 #if defined(LIBXML_READER_ENABLED)
   31612     int mem_base;
   31613     int ret_val;
   31614     xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
   31615     int n_reader;
   31616 
   31617     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
   31618         mem_base = xmlMemBlocks();
   31619         reader = gen_xmlTextReaderPtr(n_reader, 0);
   31620 
   31621         ret_val = xmlTextReaderHasAttributes(reader);
   31622         desret_int(ret_val);
   31623         call_tests++;
   31624         des_xmlTextReaderPtr(n_reader, reader, 0);
   31625         xmlResetLastError();
   31626         if (mem_base != xmlMemBlocks()) {
   31627             printf("Leak of %d blocks found in xmlTextReaderHasAttributes",
   31628 	           xmlMemBlocks() - mem_base);
   31629 	    test_ret++;
   31630             printf(" %d", n_reader);
   31631             printf("\n");
   31632         }
   31633     }
   31634     function_tests++;
   31635 #endif
   31636 
   31637     return(test_ret);
   31638 }
   31639 
   31640 
   31641 static int
   31642 test_xmlTextReaderHasValue(void) {
   31643     int test_ret = 0;
   31644 
   31645 #if defined(LIBXML_READER_ENABLED)
   31646     int mem_base;
   31647     int ret_val;
   31648     xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
   31649     int n_reader;
   31650 
   31651     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
   31652         mem_base = xmlMemBlocks();
   31653         reader = gen_xmlTextReaderPtr(n_reader, 0);
   31654 
   31655         ret_val = xmlTextReaderHasValue(reader);
   31656         desret_int(ret_val);
   31657         call_tests++;
   31658         des_xmlTextReaderPtr(n_reader, reader, 0);
   31659         xmlResetLastError();
   31660         if (mem_base != xmlMemBlocks()) {
   31661             printf("Leak of %d blocks found in xmlTextReaderHasValue",
   31662 	           xmlMemBlocks() - mem_base);
   31663 	    test_ret++;
   31664             printf(" %d", n_reader);
   31665             printf("\n");
   31666         }
   31667     }
   31668     function_tests++;
   31669 #endif
   31670 
   31671     return(test_ret);
   31672 }
   31673 
   31674 
   31675 static int
   31676 test_xmlTextReaderIsDefault(void) {
   31677     int test_ret = 0;
   31678 
   31679 #if defined(LIBXML_READER_ENABLED)
   31680     int mem_base;
   31681     int ret_val;
   31682     xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
   31683     int n_reader;
   31684 
   31685     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
   31686         mem_base = xmlMemBlocks();
   31687         reader = gen_xmlTextReaderPtr(n_reader, 0);
   31688 
   31689         ret_val = xmlTextReaderIsDefault(reader);
   31690         desret_int(ret_val);
   31691         call_tests++;
   31692         des_xmlTextReaderPtr(n_reader, reader, 0);
   31693         xmlResetLastError();
   31694         if (mem_base != xmlMemBlocks()) {
   31695             printf("Leak of %d blocks found in xmlTextReaderIsDefault",
   31696 	           xmlMemBlocks() - mem_base);
   31697 	    test_ret++;
   31698             printf(" %d", n_reader);
   31699             printf("\n");
   31700         }
   31701     }
   31702     function_tests++;
   31703 #endif
   31704 
   31705     return(test_ret);
   31706 }
   31707 
   31708 
   31709 static int
   31710 test_xmlTextReaderIsEmptyElement(void) {
   31711     int test_ret = 0;
   31712 
   31713 #if defined(LIBXML_READER_ENABLED)
   31714     int mem_base;
   31715     int ret_val;
   31716     xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
   31717     int n_reader;
   31718 
   31719     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
   31720         mem_base = xmlMemBlocks();
   31721         reader = gen_xmlTextReaderPtr(n_reader, 0);
   31722 
   31723         ret_val = xmlTextReaderIsEmptyElement(reader);
   31724         desret_int(ret_val);
   31725         call_tests++;
   31726         des_xmlTextReaderPtr(n_reader, reader, 0);
   31727         xmlResetLastError();
   31728         if (mem_base != xmlMemBlocks()) {
   31729             printf("Leak of %d blocks found in xmlTextReaderIsEmptyElement",
   31730 	           xmlMemBlocks() - mem_base);
   31731 	    test_ret++;
   31732             printf(" %d", n_reader);
   31733             printf("\n");
   31734         }
   31735     }
   31736     function_tests++;
   31737 #endif
   31738 
   31739     return(test_ret);
   31740 }
   31741 
   31742 
   31743 static int
   31744 test_xmlTextReaderIsNamespaceDecl(void) {
   31745     int test_ret = 0;
   31746 
   31747 #if defined(LIBXML_READER_ENABLED)
   31748     int mem_base;
   31749     int ret_val;
   31750     xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
   31751     int n_reader;
   31752 
   31753     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
   31754         mem_base = xmlMemBlocks();
   31755         reader = gen_xmlTextReaderPtr(n_reader, 0);
   31756 
   31757         ret_val = xmlTextReaderIsNamespaceDecl(reader);
   31758         desret_int(ret_val);
   31759         call_tests++;
   31760         des_xmlTextReaderPtr(n_reader, reader, 0);
   31761         xmlResetLastError();
   31762         if (mem_base != xmlMemBlocks()) {
   31763             printf("Leak of %d blocks found in xmlTextReaderIsNamespaceDecl",
   31764 	           xmlMemBlocks() - mem_base);
   31765 	    test_ret++;
   31766             printf(" %d", n_reader);
   31767             printf("\n");
   31768         }
   31769     }
   31770     function_tests++;
   31771 #endif
   31772 
   31773     return(test_ret);
   31774 }
   31775 
   31776 
   31777 static int
   31778 test_xmlTextReaderIsValid(void) {
   31779     int test_ret = 0;
   31780 
   31781 #if defined(LIBXML_READER_ENABLED)
   31782     int mem_base;
   31783     int ret_val;
   31784     xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
   31785     int n_reader;
   31786 
   31787     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
   31788         mem_base = xmlMemBlocks();
   31789         reader = gen_xmlTextReaderPtr(n_reader, 0);
   31790 
   31791         ret_val = xmlTextReaderIsValid(reader);
   31792         desret_int(ret_val);
   31793         call_tests++;
   31794         des_xmlTextReaderPtr(n_reader, reader, 0);
   31795         xmlResetLastError();
   31796         if (mem_base != xmlMemBlocks()) {
   31797             printf("Leak of %d blocks found in xmlTextReaderIsValid",
   31798 	           xmlMemBlocks() - mem_base);
   31799 	    test_ret++;
   31800             printf(" %d", n_reader);
   31801             printf("\n");
   31802         }
   31803     }
   31804     function_tests++;
   31805 #endif
   31806 
   31807     return(test_ret);
   31808 }
   31809 
   31810 
   31811 static int
   31812 test_xmlTextReaderLocalName(void) {
   31813     int test_ret = 0;
   31814 
   31815 #if defined(LIBXML_READER_ENABLED)
   31816     int mem_base;
   31817     xmlChar * ret_val;
   31818     xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
   31819     int n_reader;
   31820 
   31821     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
   31822         mem_base = xmlMemBlocks();
   31823         reader = gen_xmlTextReaderPtr(n_reader, 0);
   31824 
   31825         ret_val = xmlTextReaderLocalName(reader);
   31826         desret_xmlChar_ptr(ret_val);
   31827         call_tests++;
   31828         des_xmlTextReaderPtr(n_reader, reader, 0);
   31829         xmlResetLastError();
   31830         if (mem_base != xmlMemBlocks()) {
   31831             printf("Leak of %d blocks found in xmlTextReaderLocalName",
   31832 	           xmlMemBlocks() - mem_base);
   31833 	    test_ret++;
   31834             printf(" %d", n_reader);
   31835             printf("\n");
   31836         }
   31837     }
   31838     function_tests++;
   31839 #endif
   31840 
   31841     return(test_ret);
   31842 }
   31843 
   31844 #ifdef LIBXML_READER_ENABLED
   31845 
   31846 #define gen_nb_xmlTextReaderLocatorPtr 1
   31847 static xmlTextReaderLocatorPtr gen_xmlTextReaderLocatorPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
   31848     return(NULL);
   31849 }
   31850 static void des_xmlTextReaderLocatorPtr(int no ATTRIBUTE_UNUSED, xmlTextReaderLocatorPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
   31851 }
   31852 #endif
   31853 
   31854 
   31855 static int
   31856 test_xmlTextReaderLocatorBaseURI(void) {
   31857     int test_ret = 0;
   31858 
   31859 #if defined(LIBXML_READER_ENABLED)
   31860     int mem_base;
   31861     xmlChar * ret_val;
   31862     xmlTextReaderLocatorPtr locator; /* the xmlTextReaderLocatorPtr used */
   31863     int n_locator;
   31864 
   31865     for (n_locator = 0;n_locator < gen_nb_xmlTextReaderLocatorPtr;n_locator++) {
   31866         mem_base = xmlMemBlocks();
   31867         locator = gen_xmlTextReaderLocatorPtr(n_locator, 0);
   31868 
   31869         ret_val = xmlTextReaderLocatorBaseURI(locator);
   31870         desret_xmlChar_ptr(ret_val);
   31871         call_tests++;
   31872         des_xmlTextReaderLocatorPtr(n_locator, locator, 0);
   31873         xmlResetLastError();
   31874         if (mem_base != xmlMemBlocks()) {
   31875             printf("Leak of %d blocks found in xmlTextReaderLocatorBaseURI",
   31876 	           xmlMemBlocks() - mem_base);
   31877 	    test_ret++;
   31878             printf(" %d", n_locator);
   31879             printf("\n");
   31880         }
   31881     }
   31882     function_tests++;
   31883 #endif
   31884 
   31885     return(test_ret);
   31886 }
   31887 
   31888 
   31889 static int
   31890 test_xmlTextReaderLocatorLineNumber(void) {
   31891     int test_ret = 0;
   31892 
   31893 #if defined(LIBXML_READER_ENABLED)
   31894     int mem_base;
   31895     int ret_val;
   31896     xmlTextReaderLocatorPtr locator; /* the xmlTextReaderLocatorPtr used */
   31897     int n_locator;
   31898 
   31899     for (n_locator = 0;n_locator < gen_nb_xmlTextReaderLocatorPtr;n_locator++) {
   31900         mem_base = xmlMemBlocks();
   31901         locator = gen_xmlTextReaderLocatorPtr(n_locator, 0);
   31902 
   31903         ret_val = xmlTextReaderLocatorLineNumber(locator);
   31904         desret_int(ret_val);
   31905         call_tests++;
   31906         des_xmlTextReaderLocatorPtr(n_locator, locator, 0);
   31907         xmlResetLastError();
   31908         if (mem_base != xmlMemBlocks()) {
   31909             printf("Leak of %d blocks found in xmlTextReaderLocatorLineNumber",
   31910 	           xmlMemBlocks() - mem_base);
   31911 	    test_ret++;
   31912             printf(" %d", n_locator);
   31913             printf("\n");
   31914         }
   31915     }
   31916     function_tests++;
   31917 #endif
   31918 
   31919     return(test_ret);
   31920 }
   31921 
   31922 
   31923 static int
   31924 test_xmlTextReaderLookupNamespace(void) {
   31925     int test_ret = 0;
   31926 
   31927 #if defined(LIBXML_READER_ENABLED)
   31928     int mem_base;
   31929     xmlChar * ret_val;
   31930     xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
   31931     int n_reader;
   31932     xmlChar * prefix; /* the prefix whose namespace URI is to be resolved. To return the default namespace, specify NULL */
   31933     int n_prefix;
   31934 
   31935     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
   31936     for (n_prefix = 0;n_prefix < gen_nb_const_xmlChar_ptr;n_prefix++) {
   31937         mem_base = xmlMemBlocks();
   31938         reader = gen_xmlTextReaderPtr(n_reader, 0);
   31939         prefix = gen_const_xmlChar_ptr(n_prefix, 1);
   31940 
   31941         ret_val = xmlTextReaderLookupNamespace(reader, (const xmlChar *)prefix);
   31942         desret_xmlChar_ptr(ret_val);
   31943         call_tests++;
   31944         des_xmlTextReaderPtr(n_reader, reader, 0);
   31945         des_const_xmlChar_ptr(n_prefix, (const xmlChar *)prefix, 1);
   31946         xmlResetLastError();
   31947         if (mem_base != xmlMemBlocks()) {
   31948             printf("Leak of %d blocks found in xmlTextReaderLookupNamespace",
   31949 	           xmlMemBlocks() - mem_base);
   31950 	    test_ret++;
   31951             printf(" %d", n_reader);
   31952             printf(" %d", n_prefix);
   31953             printf("\n");
   31954         }
   31955     }
   31956     }
   31957     function_tests++;
   31958 #endif
   31959 
   31960     return(test_ret);
   31961 }
   31962 
   31963 
   31964 static int
   31965 test_xmlTextReaderMoveToAttribute(void) {
   31966     int test_ret = 0;
   31967 
   31968 #if defined(LIBXML_READER_ENABLED)
   31969     int mem_base;
   31970     int ret_val;
   31971     xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
   31972     int n_reader;
   31973     xmlChar * name; /* the qualified name of the attribute. */
   31974     int n_name;
   31975 
   31976     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
   31977     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
   31978         mem_base = xmlMemBlocks();
   31979         reader = gen_xmlTextReaderPtr(n_reader, 0);
   31980         name = gen_const_xmlChar_ptr(n_name, 1);
   31981 
   31982         ret_val = xmlTextReaderMoveToAttribute(reader, (const xmlChar *)name);
   31983         desret_int(ret_val);
   31984         call_tests++;
   31985         des_xmlTextReaderPtr(n_reader, reader, 0);
   31986         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
   31987         xmlResetLastError();
   31988         if (mem_base != xmlMemBlocks()) {
   31989             printf("Leak of %d blocks found in xmlTextReaderMoveToAttribute",
   31990 	           xmlMemBlocks() - mem_base);
   31991 	    test_ret++;
   31992             printf(" %d", n_reader);
   31993             printf(" %d", n_name);
   31994             printf("\n");
   31995         }
   31996     }
   31997     }
   31998     function_tests++;
   31999 #endif
   32000 
   32001     return(test_ret);
   32002 }
   32003 
   32004 
   32005 static int
   32006 test_xmlTextReaderMoveToAttributeNo(void) {
   32007     int test_ret = 0;
   32008 
   32009 #if defined(LIBXML_READER_ENABLED)
   32010     int mem_base;
   32011     int ret_val;
   32012     xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
   32013     int n_reader;
   32014     int no; /* the zero-based index of the attribute relative to the containing element. */
   32015     int n_no;
   32016 
   32017     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
   32018     for (n_no = 0;n_no < gen_nb_int;n_no++) {
   32019         mem_base = xmlMemBlocks();
   32020         reader = gen_xmlTextReaderPtr(n_reader, 0);
   32021         no = gen_int(n_no, 1);
   32022 
   32023         ret_val = xmlTextReaderMoveToAttributeNo(reader, no);
   32024         desret_int(ret_val);
   32025         call_tests++;
   32026         des_xmlTextReaderPtr(n_reader, reader, 0);
   32027         des_int(n_no, no, 1);
   32028         xmlResetLastError();
   32029         if (mem_base != xmlMemBlocks()) {
   32030             printf("Leak of %d blocks found in xmlTextReaderMoveToAttributeNo",
   32031 	           xmlMemBlocks() - mem_base);
   32032 	    test_ret++;
   32033             printf(" %d", n_reader);
   32034             printf(" %d", n_no);
   32035             printf("\n");
   32036         }
   32037     }
   32038     }
   32039     function_tests++;
   32040 #endif
   32041 
   32042     return(test_ret);
   32043 }
   32044 
   32045 
   32046 static int
   32047 test_xmlTextReaderMoveToAttributeNs(void) {
   32048     int test_ret = 0;
   32049 
   32050 #if defined(LIBXML_READER_ENABLED)
   32051     int mem_base;
   32052     int ret_val;
   32053     xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
   32054     int n_reader;
   32055     xmlChar * localName; /* the local name of the attribute. */
   32056     int n_localName;
   32057     xmlChar * namespaceURI; /* the namespace URI of the attribute. */
   32058     int n_namespaceURI;
   32059 
   32060     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
   32061     for (n_localName = 0;n_localName < gen_nb_const_xmlChar_ptr;n_localName++) {
   32062     for (n_namespaceURI = 0;n_namespaceURI < gen_nb_const_xmlChar_ptr;n_namespaceURI++) {
   32063         mem_base = xmlMemBlocks();
   32064         reader = gen_xmlTextReaderPtr(n_reader, 0);
   32065         localName = gen_const_xmlChar_ptr(n_localName, 1);
   32066         namespaceURI = gen_const_xmlChar_ptr(n_namespaceURI, 2);
   32067 
   32068         ret_val = xmlTextReaderMoveToAttributeNs(reader, (const xmlChar *)localName, (const xmlChar *)namespaceURI);
   32069         desret_int(ret_val);
   32070         call_tests++;
   32071         des_xmlTextReaderPtr(n_reader, reader, 0);
   32072         des_const_xmlChar_ptr(n_localName, (const xmlChar *)localName, 1);
   32073         des_const_xmlChar_ptr(n_namespaceURI, (const xmlChar *)namespaceURI, 2);
   32074         xmlResetLastError();
   32075         if (mem_base != xmlMemBlocks()) {
   32076             printf("Leak of %d blocks found in xmlTextReaderMoveToAttributeNs",
   32077 	           xmlMemBlocks() - mem_base);
   32078 	    test_ret++;
   32079             printf(" %d", n_reader);
   32080             printf(" %d", n_localName);
   32081             printf(" %d", n_namespaceURI);
   32082             printf("\n");
   32083         }
   32084     }
   32085     }
   32086     }
   32087     function_tests++;
   32088 #endif
   32089 
   32090     return(test_ret);
   32091 }
   32092 
   32093 
   32094 static int
   32095 test_xmlTextReaderMoveToElement(void) {
   32096     int test_ret = 0;
   32097 
   32098 #if defined(LIBXML_READER_ENABLED)
   32099     int mem_base;
   32100     int ret_val;
   32101     xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
   32102     int n_reader;
   32103 
   32104     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
   32105         mem_base = xmlMemBlocks();
   32106         reader = gen_xmlTextReaderPtr(n_reader, 0);
   32107 
   32108         ret_val = xmlTextReaderMoveToElement(reader);
   32109         desret_int(ret_val);
   32110         call_tests++;
   32111         des_xmlTextReaderPtr(n_reader, reader, 0);
   32112         xmlResetLastError();
   32113         if (mem_base != xmlMemBlocks()) {
   32114             printf("Leak of %d blocks found in xmlTextReaderMoveToElement",
   32115 	           xmlMemBlocks() - mem_base);
   32116 	    test_ret++;
   32117             printf(" %d", n_reader);
   32118             printf("\n");
   32119         }
   32120     }
   32121     function_tests++;
   32122 #endif
   32123 
   32124     return(test_ret);
   32125 }
   32126 
   32127 
   32128 static int
   32129 test_xmlTextReaderMoveToFirstAttribute(void) {
   32130     int test_ret = 0;
   32131 
   32132 #if defined(LIBXML_READER_ENABLED)
   32133     int mem_base;
   32134     int ret_val;
   32135     xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
   32136     int n_reader;
   32137 
   32138     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
   32139         mem_base = xmlMemBlocks();
   32140         reader = gen_xmlTextReaderPtr(n_reader, 0);
   32141 
   32142         ret_val = xmlTextReaderMoveToFirstAttribute(reader);
   32143         desret_int(ret_val);
   32144         call_tests++;
   32145         des_xmlTextReaderPtr(n_reader, reader, 0);
   32146         xmlResetLastError();
   32147         if (mem_base != xmlMemBlocks()) {
   32148             printf("Leak of %d blocks found in xmlTextReaderMoveToFirstAttribute",
   32149 	           xmlMemBlocks() - mem_base);
   32150 	    test_ret++;
   32151             printf(" %d", n_reader);
   32152             printf("\n");
   32153         }
   32154     }
   32155     function_tests++;
   32156 #endif
   32157 
   32158     return(test_ret);
   32159 }
   32160 
   32161 
   32162 static int
   32163 test_xmlTextReaderMoveToNextAttribute(void) {
   32164     int test_ret = 0;
   32165 
   32166 #if defined(LIBXML_READER_ENABLED)
   32167     int mem_base;
   32168     int ret_val;
   32169     xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
   32170     int n_reader;
   32171 
   32172     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
   32173         mem_base = xmlMemBlocks();
   32174         reader = gen_xmlTextReaderPtr(n_reader, 0);
   32175 
   32176         ret_val = xmlTextReaderMoveToNextAttribute(reader);
   32177         desret_int(ret_val);
   32178         call_tests++;
   32179         des_xmlTextReaderPtr(n_reader, reader, 0);
   32180         xmlResetLastError();
   32181         if (mem_base != xmlMemBlocks()) {
   32182             printf("Leak of %d blocks found in xmlTextReaderMoveToNextAttribute",
   32183 	           xmlMemBlocks() - mem_base);
   32184 	    test_ret++;
   32185             printf(" %d", n_reader);
   32186             printf("\n");
   32187         }
   32188     }
   32189     function_tests++;
   32190 #endif
   32191 
   32192     return(test_ret);
   32193 }
   32194 
   32195 
   32196 static int
   32197 test_xmlTextReaderName(void) {
   32198     int test_ret = 0;
   32199 
   32200 #if defined(LIBXML_READER_ENABLED)
   32201     int mem_base;
   32202     xmlChar * ret_val;
   32203     xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
   32204     int n_reader;
   32205 
   32206     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
   32207         mem_base = xmlMemBlocks();
   32208         reader = gen_xmlTextReaderPtr(n_reader, 0);
   32209 
   32210         ret_val = xmlTextReaderName(reader);
   32211         desret_xmlChar_ptr(ret_val);
   32212         call_tests++;
   32213         des_xmlTextReaderPtr(n_reader, reader, 0);
   32214         xmlResetLastError();
   32215         if (mem_base != xmlMemBlocks()) {
   32216             printf("Leak of %d blocks found in xmlTextReaderName",
   32217 	           xmlMemBlocks() - mem_base);
   32218 	    test_ret++;
   32219             printf(" %d", n_reader);
   32220             printf("\n");
   32221         }
   32222     }
   32223     function_tests++;
   32224 #endif
   32225 
   32226     return(test_ret);
   32227 }
   32228 
   32229 
   32230 static int
   32231 test_xmlTextReaderNamespaceUri(void) {
   32232     int test_ret = 0;
   32233 
   32234 #if defined(LIBXML_READER_ENABLED)
   32235     int mem_base;
   32236     xmlChar * ret_val;
   32237     xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
   32238     int n_reader;
   32239 
   32240     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
   32241         mem_base = xmlMemBlocks();
   32242         reader = gen_xmlTextReaderPtr(n_reader, 0);
   32243 
   32244         ret_val = xmlTextReaderNamespaceUri(reader);
   32245         desret_xmlChar_ptr(ret_val);
   32246         call_tests++;
   32247         des_xmlTextReaderPtr(n_reader, reader, 0);
   32248         xmlResetLastError();
   32249         if (mem_base != xmlMemBlocks()) {
   32250             printf("Leak of %d blocks found in xmlTextReaderNamespaceUri",
   32251 	           xmlMemBlocks() - mem_base);
   32252 	    test_ret++;
   32253             printf(" %d", n_reader);
   32254             printf("\n");
   32255         }
   32256     }
   32257     function_tests++;
   32258 #endif
   32259 
   32260     return(test_ret);
   32261 }
   32262 
   32263 
   32264 static int
   32265 test_xmlTextReaderNext(void) {
   32266     int test_ret = 0;
   32267 
   32268 #if defined(LIBXML_READER_ENABLED)
   32269     int mem_base;
   32270     int ret_val;
   32271     xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
   32272     int n_reader;
   32273 
   32274     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
   32275         mem_base = xmlMemBlocks();
   32276         reader = gen_xmlTextReaderPtr(n_reader, 0);
   32277 
   32278         ret_val = xmlTextReaderNext(reader);
   32279         desret_int(ret_val);
   32280         call_tests++;
   32281         des_xmlTextReaderPtr(n_reader, reader, 0);
   32282         xmlResetLastError();
   32283         if (mem_base != xmlMemBlocks()) {
   32284             printf("Leak of %d blocks found in xmlTextReaderNext",
   32285 	           xmlMemBlocks() - mem_base);
   32286 	    test_ret++;
   32287             printf(" %d", n_reader);
   32288             printf("\n");
   32289         }
   32290     }
   32291     function_tests++;
   32292 #endif
   32293 
   32294     return(test_ret);
   32295 }
   32296 
   32297 
   32298 static int
   32299 test_xmlTextReaderNextSibling(void) {
   32300     int test_ret = 0;
   32301 
   32302 #if defined(LIBXML_READER_ENABLED)
   32303     int mem_base;
   32304     int ret_val;
   32305     xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
   32306     int n_reader;
   32307 
   32308     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
   32309         mem_base = xmlMemBlocks();
   32310         reader = gen_xmlTextReaderPtr(n_reader, 0);
   32311 
   32312         ret_val = xmlTextReaderNextSibling(reader);
   32313         desret_int(ret_val);
   32314         call_tests++;
   32315         des_xmlTextReaderPtr(n_reader, reader, 0);
   32316         xmlResetLastError();
   32317         if (mem_base != xmlMemBlocks()) {
   32318             printf("Leak of %d blocks found in xmlTextReaderNextSibling",
   32319 	           xmlMemBlocks() - mem_base);
   32320 	    test_ret++;
   32321             printf(" %d", n_reader);
   32322             printf("\n");
   32323         }
   32324     }
   32325     function_tests++;
   32326 #endif
   32327 
   32328     return(test_ret);
   32329 }
   32330 
   32331 
   32332 static int
   32333 test_xmlTextReaderNodeType(void) {
   32334     int test_ret = 0;
   32335 
   32336 #if defined(LIBXML_READER_ENABLED)
   32337     int mem_base;
   32338     int ret_val;
   32339     xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
   32340     int n_reader;
   32341 
   32342     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
   32343         mem_base = xmlMemBlocks();
   32344         reader = gen_xmlTextReaderPtr(n_reader, 0);
   32345 
   32346         ret_val = xmlTextReaderNodeType(reader);
   32347         desret_int(ret_val);
   32348         call_tests++;
   32349         des_xmlTextReaderPtr(n_reader, reader, 0);
   32350         xmlResetLastError();
   32351         if (mem_base != xmlMemBlocks()) {
   32352             printf("Leak of %d blocks found in xmlTextReaderNodeType",
   32353 	           xmlMemBlocks() - mem_base);
   32354 	    test_ret++;
   32355             printf(" %d", n_reader);
   32356             printf("\n");
   32357         }
   32358     }
   32359     function_tests++;
   32360 #endif
   32361 
   32362     return(test_ret);
   32363 }
   32364 
   32365 
   32366 static int
   32367 test_xmlTextReaderNormalization(void) {
   32368     int test_ret = 0;
   32369 
   32370 #if defined(LIBXML_READER_ENABLED)
   32371     int mem_base;
   32372     int ret_val;
   32373     xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
   32374     int n_reader;
   32375 
   32376     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
   32377         mem_base = xmlMemBlocks();
   32378         reader = gen_xmlTextReaderPtr(n_reader, 0);
   32379 
   32380         ret_val = xmlTextReaderNormalization(reader);
   32381         desret_int(ret_val);
   32382         call_tests++;
   32383         des_xmlTextReaderPtr(n_reader, reader, 0);
   32384         xmlResetLastError();
   32385         if (mem_base != xmlMemBlocks()) {
   32386             printf("Leak of %d blocks found in xmlTextReaderNormalization",
   32387 	           xmlMemBlocks() - mem_base);
   32388 	    test_ret++;
   32389             printf(" %d", n_reader);
   32390             printf("\n");
   32391         }
   32392     }
   32393     function_tests++;
   32394 #endif
   32395 
   32396     return(test_ret);
   32397 }
   32398 
   32399 
   32400 static int
   32401 test_xmlTextReaderPrefix(void) {
   32402     int test_ret = 0;
   32403 
   32404 #if defined(LIBXML_READER_ENABLED)
   32405     int mem_base;
   32406     xmlChar * ret_val;
   32407     xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
   32408     int n_reader;
   32409 
   32410     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
   32411         mem_base = xmlMemBlocks();
   32412         reader = gen_xmlTextReaderPtr(n_reader, 0);
   32413 
   32414         ret_val = xmlTextReaderPrefix(reader);
   32415         desret_xmlChar_ptr(ret_val);
   32416         call_tests++;
   32417         des_xmlTextReaderPtr(n_reader, reader, 0);
   32418         xmlResetLastError();
   32419         if (mem_base != xmlMemBlocks()) {
   32420             printf("Leak of %d blocks found in xmlTextReaderPrefix",
   32421 	           xmlMemBlocks() - mem_base);
   32422 	    test_ret++;
   32423             printf(" %d", n_reader);
   32424             printf("\n");
   32425         }
   32426     }
   32427     function_tests++;
   32428 #endif
   32429 
   32430     return(test_ret);
   32431 }
   32432 
   32433 
   32434 static int
   32435 test_xmlTextReaderPreserve(void) {
   32436     int test_ret = 0;
   32437 
   32438 #if defined(LIBXML_READER_ENABLED)
   32439     int mem_base;
   32440     xmlNodePtr ret_val;
   32441     xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
   32442     int n_reader;
   32443 
   32444     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
   32445         mem_base = xmlMemBlocks();
   32446         reader = gen_xmlTextReaderPtr(n_reader, 0);
   32447 
   32448         ret_val = xmlTextReaderPreserve(reader);
   32449         desret_xmlNodePtr(ret_val);
   32450         call_tests++;
   32451         des_xmlTextReaderPtr(n_reader, reader, 0);
   32452         xmlResetLastError();
   32453         if (mem_base != xmlMemBlocks()) {
   32454             printf("Leak of %d blocks found in xmlTextReaderPreserve",
   32455 	           xmlMemBlocks() - mem_base);
   32456 	    test_ret++;
   32457             printf(" %d", n_reader);
   32458             printf("\n");
   32459         }
   32460     }
   32461     function_tests++;
   32462 #endif
   32463 
   32464     return(test_ret);
   32465 }
   32466 
   32467 
   32468 static int
   32469 test_xmlTextReaderPreservePattern(void) {
   32470     int test_ret = 0;
   32471 
   32472 #if defined(LIBXML_READER_ENABLED) && defined(LIBXML_PATTERN_ENABLED)
   32473 #ifdef LIBXML_PATTERN_ENABLED
   32474     int mem_base;
   32475     int ret_val;
   32476     xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
   32477     int n_reader;
   32478     xmlChar * pattern; /* an XPath subset pattern */
   32479     int n_pattern;
   32480     xmlChar ** namespaces; /* the prefix definitions, array of [URI, prefix] or NULL */
   32481     int n_namespaces;
   32482 
   32483     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
   32484     for (n_pattern = 0;n_pattern < gen_nb_const_xmlChar_ptr;n_pattern++) {
   32485     for (n_namespaces = 0;n_namespaces < gen_nb_const_xmlChar_ptr_ptr;n_namespaces++) {
   32486         mem_base = xmlMemBlocks();
   32487         reader = gen_xmlTextReaderPtr(n_reader, 0);
   32488         pattern = gen_const_xmlChar_ptr(n_pattern, 1);
   32489         namespaces = gen_const_xmlChar_ptr_ptr(n_namespaces, 2);
   32490 
   32491         ret_val = xmlTextReaderPreservePattern(reader, (const xmlChar *)pattern, (const xmlChar **)namespaces);
   32492         desret_int(ret_val);
   32493         call_tests++;
   32494         des_xmlTextReaderPtr(n_reader, reader, 0);
   32495         des_const_xmlChar_ptr(n_pattern, (const xmlChar *)pattern, 1);
   32496         des_const_xmlChar_ptr_ptr(n_namespaces, (const xmlChar **)namespaces, 2);
   32497         xmlResetLastError();
   32498         if (mem_base != xmlMemBlocks()) {
   32499             printf("Leak of %d blocks found in xmlTextReaderPreservePattern",
   32500 	           xmlMemBlocks() - mem_base);
   32501 	    test_ret++;
   32502             printf(" %d", n_reader);
   32503             printf(" %d", n_pattern);
   32504             printf(" %d", n_namespaces);
   32505             printf("\n");
   32506         }
   32507     }
   32508     }
   32509     }
   32510     function_tests++;
   32511 #endif
   32512 #endif
   32513 
   32514     return(test_ret);
   32515 }
   32516 
   32517 
   32518 static int
   32519 test_xmlTextReaderQuoteChar(void) {
   32520     int test_ret = 0;
   32521 
   32522 #if defined(LIBXML_READER_ENABLED)
   32523     int mem_base;
   32524     int ret_val;
   32525     xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
   32526     int n_reader;
   32527 
   32528     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
   32529         mem_base = xmlMemBlocks();
   32530         reader = gen_xmlTextReaderPtr(n_reader, 0);
   32531 
   32532         ret_val = xmlTextReaderQuoteChar(reader);
   32533         desret_int(ret_val);
   32534         call_tests++;
   32535         des_xmlTextReaderPtr(n_reader, reader, 0);
   32536         xmlResetLastError();
   32537         if (mem_base != xmlMemBlocks()) {
   32538             printf("Leak of %d blocks found in xmlTextReaderQuoteChar",
   32539 	           xmlMemBlocks() - mem_base);
   32540 	    test_ret++;
   32541             printf(" %d", n_reader);
   32542             printf("\n");
   32543         }
   32544     }
   32545     function_tests++;
   32546 #endif
   32547 
   32548     return(test_ret);
   32549 }
   32550 
   32551 
   32552 static int
   32553 test_xmlTextReaderRead(void) {
   32554     int test_ret = 0;
   32555 
   32556 #if defined(LIBXML_READER_ENABLED)
   32557     int mem_base;
   32558     int ret_val;
   32559     xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
   32560     int n_reader;
   32561 
   32562     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
   32563         mem_base = xmlMemBlocks();
   32564         reader = gen_xmlTextReaderPtr(n_reader, 0);
   32565 
   32566         ret_val = xmlTextReaderRead(reader);
   32567         desret_int(ret_val);
   32568         call_tests++;
   32569         des_xmlTextReaderPtr(n_reader, reader, 0);
   32570         xmlResetLastError();
   32571         if (mem_base != xmlMemBlocks()) {
   32572             printf("Leak of %d blocks found in xmlTextReaderRead",
   32573 	           xmlMemBlocks() - mem_base);
   32574 	    test_ret++;
   32575             printf(" %d", n_reader);
   32576             printf("\n");
   32577         }
   32578     }
   32579     function_tests++;
   32580 #endif
   32581 
   32582     return(test_ret);
   32583 }
   32584 
   32585 
   32586 static int
   32587 test_xmlTextReaderReadAttributeValue(void) {
   32588     int test_ret = 0;
   32589 
   32590 #if defined(LIBXML_READER_ENABLED)
   32591     int mem_base;
   32592     int ret_val;
   32593     xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
   32594     int n_reader;
   32595 
   32596     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
   32597         mem_base = xmlMemBlocks();
   32598         reader = gen_xmlTextReaderPtr(n_reader, 0);
   32599 
   32600         ret_val = xmlTextReaderReadAttributeValue(reader);
   32601         desret_int(ret_val);
   32602         call_tests++;
   32603         des_xmlTextReaderPtr(n_reader, reader, 0);
   32604         xmlResetLastError();
   32605         if (mem_base != xmlMemBlocks()) {
   32606             printf("Leak of %d blocks found in xmlTextReaderReadAttributeValue",
   32607 	           xmlMemBlocks() - mem_base);
   32608 	    test_ret++;
   32609             printf(" %d", n_reader);
   32610             printf("\n");
   32611         }
   32612     }
   32613     function_tests++;
   32614 #endif
   32615 
   32616     return(test_ret);
   32617 }
   32618 
   32619 
   32620 static int
   32621 test_xmlTextReaderReadState(void) {
   32622     int test_ret = 0;
   32623 
   32624 #if defined(LIBXML_READER_ENABLED)
   32625     int mem_base;
   32626     int ret_val;
   32627     xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
   32628     int n_reader;
   32629 
   32630     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
   32631         mem_base = xmlMemBlocks();
   32632         reader = gen_xmlTextReaderPtr(n_reader, 0);
   32633 
   32634         ret_val = xmlTextReaderReadState(reader);
   32635         desret_int(ret_val);
   32636         call_tests++;
   32637         des_xmlTextReaderPtr(n_reader, reader, 0);
   32638         xmlResetLastError();
   32639         if (mem_base != xmlMemBlocks()) {
   32640             printf("Leak of %d blocks found in xmlTextReaderReadState",
   32641 	           xmlMemBlocks() - mem_base);
   32642 	    test_ret++;
   32643             printf(" %d", n_reader);
   32644             printf("\n");
   32645         }
   32646     }
   32647     function_tests++;
   32648 #endif
   32649 
   32650     return(test_ret);
   32651 }
   32652 
   32653 
   32654 static int
   32655 test_xmlTextReaderRelaxNGSetSchema(void) {
   32656     int test_ret = 0;
   32657 
   32658 #if defined(LIBXML_READER_ENABLED) && defined(LIBXML_SCHEMAS_ENABLED)
   32659     int mem_base;
   32660     int ret_val;
   32661     xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
   32662     int n_reader;
   32663     xmlRelaxNGPtr schema; /* a precompiled RelaxNG schema */
   32664     int n_schema;
   32665 
   32666     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
   32667     for (n_schema = 0;n_schema < gen_nb_xmlRelaxNGPtr;n_schema++) {
   32668         mem_base = xmlMemBlocks();
   32669         reader = gen_xmlTextReaderPtr(n_reader, 0);
   32670         schema = gen_xmlRelaxNGPtr(n_schema, 1);
   32671 
   32672         ret_val = xmlTextReaderRelaxNGSetSchema(reader, schema);
   32673         desret_int(ret_val);
   32674         call_tests++;
   32675         des_xmlTextReaderPtr(n_reader, reader, 0);
   32676         des_xmlRelaxNGPtr(n_schema, schema, 1);
   32677         xmlResetLastError();
   32678         if (mem_base != xmlMemBlocks()) {
   32679             printf("Leak of %d blocks found in xmlTextReaderRelaxNGSetSchema",
   32680 	           xmlMemBlocks() - mem_base);
   32681 	    test_ret++;
   32682             printf(" %d", n_reader);
   32683             printf(" %d", n_schema);
   32684             printf("\n");
   32685         }
   32686     }
   32687     }
   32688     function_tests++;
   32689 #endif
   32690 
   32691     return(test_ret);
   32692 }
   32693 
   32694 
   32695 static int
   32696 test_xmlTextReaderRelaxNGValidate(void) {
   32697     int test_ret = 0;
   32698 
   32699 #if defined(LIBXML_READER_ENABLED) && defined(LIBXML_SCHEMAS_ENABLED)
   32700     int mem_base;
   32701     int ret_val;
   32702     xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
   32703     int n_reader;
   32704     char * rng; /* the path to a RelaxNG schema or NULL */
   32705     int n_rng;
   32706 
   32707     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
   32708     for (n_rng = 0;n_rng < gen_nb_const_char_ptr;n_rng++) {
   32709         mem_base = xmlMemBlocks();
   32710         reader = gen_xmlTextReaderPtr(n_reader, 0);
   32711         rng = gen_const_char_ptr(n_rng, 1);
   32712 
   32713         ret_val = xmlTextReaderRelaxNGValidate(reader, (const char *)rng);
   32714         desret_int(ret_val);
   32715         call_tests++;
   32716         des_xmlTextReaderPtr(n_reader, reader, 0);
   32717         des_const_char_ptr(n_rng, (const char *)rng, 1);
   32718         xmlResetLastError();
   32719         if (mem_base != xmlMemBlocks()) {
   32720             printf("Leak of %d blocks found in xmlTextReaderRelaxNGValidate",
   32721 	           xmlMemBlocks() - mem_base);
   32722 	    test_ret++;
   32723             printf(" %d", n_reader);
   32724             printf(" %d", n_rng);
   32725             printf("\n");
   32726         }
   32727     }
   32728     }
   32729     function_tests++;
   32730 #endif
   32731 
   32732     return(test_ret);
   32733 }
   32734 
   32735 
   32736 static int
   32737 test_xmlTextReaderRelaxNGValidateCtxt(void) {
   32738     int test_ret = 0;
   32739 
   32740 #if defined(LIBXML_READER_ENABLED) && defined(LIBXML_SCHEMAS_ENABLED)
   32741     int mem_base;
   32742     int ret_val;
   32743     xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
   32744     int n_reader;
   32745     xmlRelaxNGValidCtxtPtr ctxt; /* the RelaxNG schema validation context or NULL */
   32746     int n_ctxt;
   32747     int options; /* options (not used yet) */
   32748     int n_options;
   32749 
   32750     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
   32751     for (n_ctxt = 0;n_ctxt < gen_nb_xmlRelaxNGValidCtxtPtr;n_ctxt++) {
   32752     for (n_options = 0;n_options < gen_nb_parseroptions;n_options++) {
   32753         mem_base = xmlMemBlocks();
   32754         reader = gen_xmlTextReaderPtr(n_reader, 0);
   32755         ctxt = gen_xmlRelaxNGValidCtxtPtr(n_ctxt, 1);
   32756         options = gen_parseroptions(n_options, 2);
   32757 
   32758         ret_val = xmlTextReaderRelaxNGValidateCtxt(reader, ctxt, options);
   32759         desret_int(ret_val);
   32760         call_tests++;
   32761         des_xmlTextReaderPtr(n_reader, reader, 0);
   32762         des_xmlRelaxNGValidCtxtPtr(n_ctxt, ctxt, 1);
   32763         des_parseroptions(n_options, options, 2);
   32764         xmlResetLastError();
   32765         if (mem_base != xmlMemBlocks()) {
   32766             printf("Leak of %d blocks found in xmlTextReaderRelaxNGValidateCtxt",
   32767 	           xmlMemBlocks() - mem_base);
   32768 	    test_ret++;
   32769             printf(" %d", n_reader);
   32770             printf(" %d", n_ctxt);
   32771             printf(" %d", n_options);
   32772             printf("\n");
   32773         }
   32774     }
   32775     }
   32776     }
   32777     function_tests++;
   32778 #endif
   32779 
   32780     return(test_ret);
   32781 }
   32782 
   32783 
   32784 static int
   32785 test_xmlTextReaderSchemaValidate(void) {
   32786     int test_ret = 0;
   32787 
   32788 #if defined(LIBXML_READER_ENABLED) && defined(LIBXML_SCHEMAS_ENABLED)
   32789     int ret_val;
   32790     xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
   32791     int n_reader;
   32792     char * xsd; /* the path to a W3C XSD schema or NULL */
   32793     int n_xsd;
   32794 
   32795     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
   32796     for (n_xsd = 0;n_xsd < gen_nb_const_char_ptr;n_xsd++) {
   32797         reader = gen_xmlTextReaderPtr(n_reader, 0);
   32798         xsd = gen_const_char_ptr(n_xsd, 1);
   32799 
   32800         ret_val = xmlTextReaderSchemaValidate(reader, (const char *)xsd);
   32801         desret_int(ret_val);
   32802         call_tests++;
   32803         des_xmlTextReaderPtr(n_reader, reader, 0);
   32804         des_const_char_ptr(n_xsd, (const char *)xsd, 1);
   32805         xmlResetLastError();
   32806     }
   32807     }
   32808     function_tests++;
   32809 #endif
   32810 
   32811     return(test_ret);
   32812 }
   32813 
   32814 
   32815 static int
   32816 test_xmlTextReaderSchemaValidateCtxt(void) {
   32817     int test_ret = 0;
   32818 
   32819 #if defined(LIBXML_READER_ENABLED) && defined(LIBXML_SCHEMAS_ENABLED)
   32820     int mem_base;
   32821     int ret_val;
   32822     xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
   32823     int n_reader;
   32824     xmlSchemaValidCtxtPtr ctxt; /* the XML Schema validation context or NULL */
   32825     int n_ctxt;
   32826     int options; /* options (not used yet) */
   32827     int n_options;
   32828 
   32829     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
   32830     for (n_ctxt = 0;n_ctxt < gen_nb_xmlSchemaValidCtxtPtr;n_ctxt++) {
   32831     for (n_options = 0;n_options < gen_nb_parseroptions;n_options++) {
   32832         mem_base = xmlMemBlocks();
   32833         reader = gen_xmlTextReaderPtr(n_reader, 0);
   32834         ctxt = gen_xmlSchemaValidCtxtPtr(n_ctxt, 1);
   32835         options = gen_parseroptions(n_options, 2);
   32836 
   32837         ret_val = xmlTextReaderSchemaValidateCtxt(reader, ctxt, options);
   32838         desret_int(ret_val);
   32839         call_tests++;
   32840         des_xmlTextReaderPtr(n_reader, reader, 0);
   32841         des_xmlSchemaValidCtxtPtr(n_ctxt, ctxt, 1);
   32842         des_parseroptions(n_options, options, 2);
   32843         xmlResetLastError();
   32844         if (mem_base != xmlMemBlocks()) {
   32845             printf("Leak of %d blocks found in xmlTextReaderSchemaValidateCtxt",
   32846 	           xmlMemBlocks() - mem_base);
   32847 	    test_ret++;
   32848             printf(" %d", n_reader);
   32849             printf(" %d", n_ctxt);
   32850             printf(" %d", n_options);
   32851             printf("\n");
   32852         }
   32853     }
   32854     }
   32855     }
   32856     function_tests++;
   32857 #endif
   32858 
   32859     return(test_ret);
   32860 }
   32861 
   32862 
   32863 static int
   32864 test_xmlTextReaderSetErrorHandler(void) {
   32865     int test_ret = 0;
   32866 
   32867 
   32868     /* missing type support */
   32869     return(test_ret);
   32870 }
   32871 
   32872 
   32873 static int
   32874 test_xmlTextReaderSetParserProp(void) {
   32875     int test_ret = 0;
   32876 
   32877 #if defined(LIBXML_READER_ENABLED)
   32878     int mem_base;
   32879     int ret_val;
   32880     xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
   32881     int n_reader;
   32882     int prop; /* the xmlParserProperties to set */
   32883     int n_prop;
   32884     int value; /* usually 0 or 1 to (de)activate it */
   32885     int n_value;
   32886 
   32887     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
   32888     for (n_prop = 0;n_prop < gen_nb_int;n_prop++) {
   32889     for (n_value = 0;n_value < gen_nb_int;n_value++) {
   32890         mem_base = xmlMemBlocks();
   32891         reader = gen_xmlTextReaderPtr(n_reader, 0);
   32892         prop = gen_int(n_prop, 1);
   32893         value = gen_int(n_value, 2);
   32894 
   32895         ret_val = xmlTextReaderSetParserProp(reader, prop, value);
   32896         desret_int(ret_val);
   32897         call_tests++;
   32898         des_xmlTextReaderPtr(n_reader, reader, 0);
   32899         des_int(n_prop, prop, 1);
   32900         des_int(n_value, value, 2);
   32901         xmlResetLastError();
   32902         if (mem_base != xmlMemBlocks()) {
   32903             printf("Leak of %d blocks found in xmlTextReaderSetParserProp",
   32904 	           xmlMemBlocks() - mem_base);
   32905 	    test_ret++;
   32906             printf(" %d", n_reader);
   32907             printf(" %d", n_prop);
   32908             printf(" %d", n_value);
   32909             printf("\n");
   32910         }
   32911     }
   32912     }
   32913     }
   32914     function_tests++;
   32915 #endif
   32916 
   32917     return(test_ret);
   32918 }
   32919 
   32920 
   32921 static int
   32922 test_xmlTextReaderSetSchema(void) {
   32923     int test_ret = 0;
   32924 
   32925 #if defined(LIBXML_READER_ENABLED) && defined(LIBXML_SCHEMAS_ENABLED)
   32926     int mem_base;
   32927     int ret_val;
   32928     xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
   32929     int n_reader;
   32930     xmlSchemaPtr schema; /* a precompiled Schema schema */
   32931     int n_schema;
   32932 
   32933     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
   32934     for (n_schema = 0;n_schema < gen_nb_xmlSchemaPtr;n_schema++) {
   32935         mem_base = xmlMemBlocks();
   32936         reader = gen_xmlTextReaderPtr(n_reader, 0);
   32937         schema = gen_xmlSchemaPtr(n_schema, 1);
   32938 
   32939         ret_val = xmlTextReaderSetSchema(reader, schema);
   32940         desret_int(ret_val);
   32941         call_tests++;
   32942         des_xmlTextReaderPtr(n_reader, reader, 0);
   32943         des_xmlSchemaPtr(n_schema, schema, 1);
   32944         xmlResetLastError();
   32945         if (mem_base != xmlMemBlocks()) {
   32946             printf("Leak of %d blocks found in xmlTextReaderSetSchema",
   32947 	           xmlMemBlocks() - mem_base);
   32948 	    test_ret++;
   32949             printf(" %d", n_reader);
   32950             printf(" %d", n_schema);
   32951             printf("\n");
   32952         }
   32953     }
   32954     }
   32955     function_tests++;
   32956 #endif
   32957 
   32958     return(test_ret);
   32959 }
   32960 
   32961 
   32962 static int
   32963 test_xmlTextReaderSetStructuredErrorHandler(void) {
   32964     int test_ret = 0;
   32965 
   32966 
   32967     /* missing type support */
   32968     return(test_ret);
   32969 }
   32970 
   32971 
   32972 static int
   32973 test_xmlTextReaderSetup(void) {
   32974     int test_ret = 0;
   32975 
   32976 #if defined(LIBXML_READER_ENABLED)
   32977     int mem_base;
   32978     int ret_val;
   32979     xmlTextReaderPtr reader; /* an XML reader */
   32980     int n_reader;
   32981     xmlParserInputBufferPtr input; /* xmlParserInputBufferPtr used to feed the reader, will be destroyed with it. */
   32982     int n_input;
   32983     const char * URL; /* the base URL to use for the document */
   32984     int n_URL;
   32985     char * encoding; /* the document encoding, or NULL */
   32986     int n_encoding;
   32987     int options; /* a combination of xmlParserOption */
   32988     int n_options;
   32989 
   32990     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
   32991     for (n_input = 0;n_input < gen_nb_xmlParserInputBufferPtr;n_input++) {
   32992     for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) {
   32993     for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
   32994     for (n_options = 0;n_options < gen_nb_parseroptions;n_options++) {
   32995         mem_base = xmlMemBlocks();
   32996         reader = gen_xmlTextReaderPtr(n_reader, 0);
   32997         input = gen_xmlParserInputBufferPtr(n_input, 1);
   32998         URL = gen_filepath(n_URL, 2);
   32999         encoding = gen_const_char_ptr(n_encoding, 3);
   33000         options = gen_parseroptions(n_options, 4);
   33001 
   33002         ret_val = xmlTextReaderSetup(reader, input, URL, (const char *)encoding, options);
   33003         desret_int(ret_val);
   33004         call_tests++;
   33005         des_xmlTextReaderPtr(n_reader, reader, 0);
   33006         des_filepath(n_URL, URL, 2);
   33007         des_const_char_ptr(n_encoding, (const char *)encoding, 3);
   33008         des_parseroptions(n_options, options, 4);
   33009         xmlResetLastError();
   33010         if (mem_base != xmlMemBlocks()) {
   33011             printf("Leak of %d blocks found in xmlTextReaderSetup",
   33012 	           xmlMemBlocks() - mem_base);
   33013 	    test_ret++;
   33014             printf(" %d", n_reader);
   33015             printf(" %d", n_input);
   33016             printf(" %d", n_URL);
   33017             printf(" %d", n_encoding);
   33018             printf(" %d", n_options);
   33019             printf("\n");
   33020         }
   33021     }
   33022     }
   33023     }
   33024     }
   33025     }
   33026     function_tests++;
   33027 #endif
   33028 
   33029     return(test_ret);
   33030 }
   33031 
   33032 
   33033 static int
   33034 test_xmlTextReaderStandalone(void) {
   33035     int test_ret = 0;
   33036 
   33037 #if defined(LIBXML_READER_ENABLED)
   33038     int mem_base;
   33039     int ret_val;
   33040     xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
   33041     int n_reader;
   33042 
   33043     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
   33044         mem_base = xmlMemBlocks();
   33045         reader = gen_xmlTextReaderPtr(n_reader, 0);
   33046 
   33047         ret_val = xmlTextReaderStandalone(reader);
   33048         desret_int(ret_val);
   33049         call_tests++;
   33050         des_xmlTextReaderPtr(n_reader, reader, 0);
   33051         xmlResetLastError();
   33052         if (mem_base != xmlMemBlocks()) {
   33053             printf("Leak of %d blocks found in xmlTextReaderStandalone",
   33054 	           xmlMemBlocks() - mem_base);
   33055 	    test_ret++;
   33056             printf(" %d", n_reader);
   33057             printf("\n");
   33058         }
   33059     }
   33060     function_tests++;
   33061 #endif
   33062 
   33063     return(test_ret);
   33064 }
   33065 
   33066 
   33067 static int
   33068 test_xmlTextReaderValue(void) {
   33069     int test_ret = 0;
   33070 
   33071 #if defined(LIBXML_READER_ENABLED)
   33072     int mem_base;
   33073     xmlChar * ret_val;
   33074     xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
   33075     int n_reader;
   33076 
   33077     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
   33078         mem_base = xmlMemBlocks();
   33079         reader = gen_xmlTextReaderPtr(n_reader, 0);
   33080 
   33081         ret_val = xmlTextReaderValue(reader);
   33082         desret_xmlChar_ptr(ret_val);
   33083         call_tests++;
   33084         des_xmlTextReaderPtr(n_reader, reader, 0);
   33085         xmlResetLastError();
   33086         if (mem_base != xmlMemBlocks()) {
   33087             printf("Leak of %d blocks found in xmlTextReaderValue",
   33088 	           xmlMemBlocks() - mem_base);
   33089 	    test_ret++;
   33090             printf(" %d", n_reader);
   33091             printf("\n");
   33092         }
   33093     }
   33094     function_tests++;
   33095 #endif
   33096 
   33097     return(test_ret);
   33098 }
   33099 
   33100 
   33101 static int
   33102 test_xmlTextReaderXmlLang(void) {
   33103     int test_ret = 0;
   33104 
   33105 #if defined(LIBXML_READER_ENABLED)
   33106     int mem_base;
   33107     xmlChar * ret_val;
   33108     xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
   33109     int n_reader;
   33110 
   33111     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
   33112         mem_base = xmlMemBlocks();
   33113         reader = gen_xmlTextReaderPtr(n_reader, 0);
   33114 
   33115         ret_val = xmlTextReaderXmlLang(reader);
   33116         desret_xmlChar_ptr(ret_val);
   33117         call_tests++;
   33118         des_xmlTextReaderPtr(n_reader, reader, 0);
   33119         xmlResetLastError();
   33120         if (mem_base != xmlMemBlocks()) {
   33121             printf("Leak of %d blocks found in xmlTextReaderXmlLang",
   33122 	           xmlMemBlocks() - mem_base);
   33123 	    test_ret++;
   33124             printf(" %d", n_reader);
   33125             printf("\n");
   33126         }
   33127     }
   33128     function_tests++;
   33129 #endif
   33130 
   33131     return(test_ret);
   33132 }
   33133 
   33134 static int
   33135 test_xmlreader(void) {
   33136     int test_ret = 0;
   33137 
   33138     if (quiet == 0) printf("Testing xmlreader : 76 of 86 functions ...\n");
   33139     test_ret += test_xmlNewTextReader();
   33140     test_ret += test_xmlNewTextReaderFilename();
   33141     test_ret += test_xmlReaderForDoc();
   33142     test_ret += test_xmlReaderForFile();
   33143     test_ret += test_xmlReaderForMemory();
   33144     test_ret += test_xmlReaderNewDoc();
   33145     test_ret += test_xmlReaderNewFile();
   33146     test_ret += test_xmlReaderNewMemory();
   33147     test_ret += test_xmlReaderNewWalker();
   33148     test_ret += test_xmlReaderWalker();
   33149     test_ret += test_xmlTextReaderAttributeCount();
   33150     test_ret += test_xmlTextReaderBaseUri();
   33151     test_ret += test_xmlTextReaderByteConsumed();
   33152     test_ret += test_xmlTextReaderClose();
   33153     test_ret += test_xmlTextReaderConstBaseUri();
   33154     test_ret += test_xmlTextReaderConstEncoding();
   33155     test_ret += test_xmlTextReaderConstLocalName();
   33156     test_ret += test_xmlTextReaderConstName();
   33157     test_ret += test_xmlTextReaderConstNamespaceUri();
   33158     test_ret += test_xmlTextReaderConstPrefix();
   33159     test_ret += test_xmlTextReaderConstString();
   33160     test_ret += test_xmlTextReaderConstValue();
   33161     test_ret += test_xmlTextReaderConstXmlLang();
   33162     test_ret += test_xmlTextReaderConstXmlVersion();
   33163     test_ret += test_xmlTextReaderCurrentDoc();
   33164     test_ret += test_xmlTextReaderCurrentNode();
   33165     test_ret += test_xmlTextReaderDepth();
   33166     test_ret += test_xmlTextReaderExpand();
   33167     test_ret += test_xmlTextReaderGetAttribute();
   33168     test_ret += test_xmlTextReaderGetAttributeNo();
   33169     test_ret += test_xmlTextReaderGetAttributeNs();
   33170     test_ret += test_xmlTextReaderGetErrorHandler();
   33171     test_ret += test_xmlTextReaderGetParserColumnNumber();
   33172     test_ret += test_xmlTextReaderGetParserLineNumber();
   33173     test_ret += test_xmlTextReaderGetParserProp();
   33174     test_ret += test_xmlTextReaderGetRemainder();
   33175     test_ret += test_xmlTextReaderHasAttributes();
   33176     test_ret += test_xmlTextReaderHasValue();
   33177     test_ret += test_xmlTextReaderIsDefault();
   33178     test_ret += test_xmlTextReaderIsEmptyElement();
   33179     test_ret += test_xmlTextReaderIsNamespaceDecl();
   33180     test_ret += test_xmlTextReaderIsValid();
   33181     test_ret += test_xmlTextReaderLocalName();
   33182     test_ret += test_xmlTextReaderLocatorBaseURI();
   33183     test_ret += test_xmlTextReaderLocatorLineNumber();
   33184     test_ret += test_xmlTextReaderLookupNamespace();
   33185     test_ret += test_xmlTextReaderMoveToAttribute();
   33186     test_ret += test_xmlTextReaderMoveToAttributeNo();
   33187     test_ret += test_xmlTextReaderMoveToAttributeNs();
   33188     test_ret += test_xmlTextReaderMoveToElement();
   33189     test_ret += test_xmlTextReaderMoveToFirstAttribute();
   33190     test_ret += test_xmlTextReaderMoveToNextAttribute();
   33191     test_ret += test_xmlTextReaderName();
   33192     test_ret += test_xmlTextReaderNamespaceUri();
   33193     test_ret += test_xmlTextReaderNext();
   33194     test_ret += test_xmlTextReaderNextSibling();
   33195     test_ret += test_xmlTextReaderNodeType();
   33196     test_ret += test_xmlTextReaderNormalization();
   33197     test_ret += test_xmlTextReaderPrefix();
   33198     test_ret += test_xmlTextReaderPreserve();
   33199     test_ret += test_xmlTextReaderPreservePattern();
   33200     test_ret += test_xmlTextReaderQuoteChar();
   33201     test_ret += test_xmlTextReaderRead();
   33202     test_ret += test_xmlTextReaderReadAttributeValue();
   33203     test_ret += test_xmlTextReaderReadState();
   33204     test_ret += test_xmlTextReaderRelaxNGSetSchema();
   33205     test_ret += test_xmlTextReaderRelaxNGValidate();
   33206     test_ret += test_xmlTextReaderRelaxNGValidateCtxt();
   33207     test_ret += test_xmlTextReaderSchemaValidate();
   33208     test_ret += test_xmlTextReaderSchemaValidateCtxt();
   33209     test_ret += test_xmlTextReaderSetErrorHandler();
   33210     test_ret += test_xmlTextReaderSetParserProp();
   33211     test_ret += test_xmlTextReaderSetSchema();
   33212     test_ret += test_xmlTextReaderSetStructuredErrorHandler();
   33213     test_ret += test_xmlTextReaderSetup();
   33214     test_ret += test_xmlTextReaderStandalone();
   33215     test_ret += test_xmlTextReaderValue();
   33216     test_ret += test_xmlTextReaderXmlLang();
   33217 
   33218     if (test_ret != 0)
   33219 	printf("Module xmlreader: %d errors\n", test_ret);
   33220     return(test_ret);
   33221 }
   33222 
   33223 static int
   33224 test_xmlExpCtxtNbCons(void) {
   33225     int test_ret = 0;
   33226 
   33227 #if defined(LIBXML_REGEXP_ENABLED) && defined(LIBXML_EXPR_ENABLED)
   33228     int mem_base;
   33229     int ret_val;
   33230     xmlExpCtxtPtr ctxt; /* an expression context */
   33231     int n_ctxt;
   33232 
   33233     for (n_ctxt = 0;n_ctxt < gen_nb_xmlExpCtxtPtr;n_ctxt++) {
   33234         mem_base = xmlMemBlocks();
   33235         ctxt = gen_xmlExpCtxtPtr(n_ctxt, 0);
   33236 
   33237         ret_val = xmlExpCtxtNbCons(ctxt);
   33238         desret_int(ret_val);
   33239         call_tests++;
   33240         des_xmlExpCtxtPtr(n_ctxt, ctxt, 0);
   33241         xmlResetLastError();
   33242         if (mem_base != xmlMemBlocks()) {
   33243             printf("Leak of %d blocks found in xmlExpCtxtNbCons",
   33244 	           xmlMemBlocks() - mem_base);
   33245 	    test_ret++;
   33246             printf(" %d", n_ctxt);
   33247             printf("\n");
   33248         }
   33249     }
   33250     function_tests++;
   33251 #endif
   33252 
   33253     return(test_ret);
   33254 }
   33255 
   33256 
   33257 static int
   33258 test_xmlExpCtxtNbNodes(void) {
   33259     int test_ret = 0;
   33260 
   33261 #if defined(LIBXML_REGEXP_ENABLED) && defined(LIBXML_EXPR_ENABLED)
   33262     int mem_base;
   33263     int ret_val;
   33264     xmlExpCtxtPtr ctxt; /* an expression context */
   33265     int n_ctxt;
   33266 
   33267     for (n_ctxt = 0;n_ctxt < gen_nb_xmlExpCtxtPtr;n_ctxt++) {
   33268         mem_base = xmlMemBlocks();
   33269         ctxt = gen_xmlExpCtxtPtr(n_ctxt, 0);
   33270 
   33271         ret_val = xmlExpCtxtNbNodes(ctxt);
   33272         desret_int(ret_val);
   33273         call_tests++;
   33274         des_xmlExpCtxtPtr(n_ctxt, ctxt, 0);
   33275         xmlResetLastError();
   33276         if (mem_base != xmlMemBlocks()) {
   33277             printf("Leak of %d blocks found in xmlExpCtxtNbNodes",
   33278 	           xmlMemBlocks() - mem_base);
   33279 	    test_ret++;
   33280             printf(" %d", n_ctxt);
   33281             printf("\n");
   33282         }
   33283     }
   33284     function_tests++;
   33285 #endif
   33286 
   33287     return(test_ret);
   33288 }
   33289 
   33290 
   33291 static int
   33292 test_xmlExpDump(void) {
   33293     int test_ret = 0;
   33294 
   33295 #if defined(LIBXML_REGEXP_ENABLED) && defined(LIBXML_EXPR_ENABLED)
   33296     int mem_base;
   33297     xmlBufferPtr buf; /* a buffer to receive the output */
   33298     int n_buf;
   33299     xmlExpNodePtr expr; /* the compiled expression */
   33300     int n_expr;
   33301 
   33302     for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
   33303     for (n_expr = 0;n_expr < gen_nb_xmlExpNodePtr;n_expr++) {
   33304         mem_base = xmlMemBlocks();
   33305         buf = gen_xmlBufferPtr(n_buf, 0);
   33306         expr = gen_xmlExpNodePtr(n_expr, 1);
   33307 
   33308         xmlExpDump(buf, expr);
   33309         call_tests++;
   33310         des_xmlBufferPtr(n_buf, buf, 0);
   33311         des_xmlExpNodePtr(n_expr, expr, 1);
   33312         xmlResetLastError();
   33313         if (mem_base != xmlMemBlocks()) {
   33314             printf("Leak of %d blocks found in xmlExpDump",
   33315 	           xmlMemBlocks() - mem_base);
   33316 	    test_ret++;
   33317             printf(" %d", n_buf);
   33318             printf(" %d", n_expr);
   33319             printf("\n");
   33320         }
   33321     }
   33322     }
   33323     function_tests++;
   33324 #endif
   33325 
   33326     return(test_ret);
   33327 }
   33328 
   33329 
   33330 static int
   33331 test_xmlExpExpDerive(void) {
   33332     int test_ret = 0;
   33333 
   33334 
   33335     /* missing type support */
   33336     return(test_ret);
   33337 }
   33338 
   33339 
   33340 static int
   33341 test_xmlExpGetLanguage(void) {
   33342     int test_ret = 0;
   33343 
   33344 #if defined(LIBXML_REGEXP_ENABLED) && defined(LIBXML_EXPR_ENABLED)
   33345     int mem_base;
   33346     int ret_val;
   33347     xmlExpCtxtPtr ctxt; /* the expression context */
   33348     int n_ctxt;
   33349     xmlExpNodePtr exp; /* the expression */
   33350     int n_exp;
   33351     xmlChar ** langList; /* where to store the tokens */
   33352     int n_langList;
   33353     int len; /* the allocated length of @list */
   33354     int n_len;
   33355 
   33356     for (n_ctxt = 0;n_ctxt < gen_nb_xmlExpCtxtPtr;n_ctxt++) {
   33357     for (n_exp = 0;n_exp < gen_nb_xmlExpNodePtr;n_exp++) {
   33358     for (n_langList = 0;n_langList < gen_nb_const_xmlChar_ptr_ptr;n_langList++) {
   33359     for (n_len = 0;n_len < gen_nb_int;n_len++) {
   33360         mem_base = xmlMemBlocks();
   33361         ctxt = gen_xmlExpCtxtPtr(n_ctxt, 0);
   33362         exp = gen_xmlExpNodePtr(n_exp, 1);
   33363         langList = gen_const_xmlChar_ptr_ptr(n_langList, 2);
   33364         len = gen_int(n_len, 3);
   33365 
   33366         ret_val = xmlExpGetLanguage(ctxt, exp, (const xmlChar **)langList, len);
   33367         desret_int(ret_val);
   33368         call_tests++;
   33369         des_xmlExpCtxtPtr(n_ctxt, ctxt, 0);
   33370         des_xmlExpNodePtr(n_exp, exp, 1);
   33371         des_const_xmlChar_ptr_ptr(n_langList, (const xmlChar **)langList, 2);
   33372         des_int(n_len, len, 3);
   33373         xmlResetLastError();
   33374         if (mem_base != xmlMemBlocks()) {
   33375             printf("Leak of %d blocks found in xmlExpGetLanguage",
   33376 	           xmlMemBlocks() - mem_base);
   33377 	    test_ret++;
   33378             printf(" %d", n_ctxt);
   33379             printf(" %d", n_exp);
   33380             printf(" %d", n_langList);
   33381             printf(" %d", n_len);
   33382             printf("\n");
   33383         }
   33384     }
   33385     }
   33386     }
   33387     }
   33388     function_tests++;
   33389 #endif
   33390 
   33391     return(test_ret);
   33392 }
   33393 
   33394 
   33395 static int
   33396 test_xmlExpGetStart(void) {
   33397     int test_ret = 0;
   33398 
   33399 #if defined(LIBXML_REGEXP_ENABLED) && defined(LIBXML_EXPR_ENABLED)
   33400     int mem_base;
   33401     int ret_val;
   33402     xmlExpCtxtPtr ctxt; /* the expression context */
   33403     int n_ctxt;
   33404     xmlExpNodePtr exp; /* the expression */
   33405     int n_exp;
   33406     xmlChar ** tokList; /* where to store the tokens */
   33407     int n_tokList;
   33408     int len; /* the allocated length of @list */
   33409     int n_len;
   33410 
   33411     for (n_ctxt = 0;n_ctxt < gen_nb_xmlExpCtxtPtr;n_ctxt++) {
   33412     for (n_exp = 0;n_exp < gen_nb_xmlExpNodePtr;n_exp++) {
   33413     for (n_tokList = 0;n_tokList < gen_nb_const_xmlChar_ptr_ptr;n_tokList++) {
   33414     for (n_len = 0;n_len < gen_nb_int;n_len++) {
   33415         mem_base = xmlMemBlocks();
   33416         ctxt = gen_xmlExpCtxtPtr(n_ctxt, 0);
   33417         exp = gen_xmlExpNodePtr(n_exp, 1);
   33418         tokList = gen_const_xmlChar_ptr_ptr(n_tokList, 2);
   33419         len = gen_int(n_len, 3);
   33420 
   33421         ret_val = xmlExpGetStart(ctxt, exp, (const xmlChar **)tokList, len);
   33422         desret_int(ret_val);
   33423         call_tests++;
   33424         des_xmlExpCtxtPtr(n_ctxt, ctxt, 0);
   33425         des_xmlExpNodePtr(n_exp, exp, 1);
   33426         des_const_xmlChar_ptr_ptr(n_tokList, (const xmlChar **)tokList, 2);
   33427         des_int(n_len, len, 3);
   33428         xmlResetLastError();
   33429         if (mem_base != xmlMemBlocks()) {
   33430             printf("Leak of %d blocks found in xmlExpGetStart",
   33431 	           xmlMemBlocks() - mem_base);
   33432 	    test_ret++;
   33433             printf(" %d", n_ctxt);
   33434             printf(" %d", n_exp);
   33435             printf(" %d", n_tokList);
   33436             printf(" %d", n_len);
   33437             printf("\n");
   33438         }
   33439     }
   33440     }
   33441     }
   33442     }
   33443     function_tests++;
   33444 #endif
   33445 
   33446     return(test_ret);
   33447 }
   33448 
   33449 
   33450 static int
   33451 test_xmlExpIsNillable(void) {
   33452     int test_ret = 0;
   33453 
   33454 #if defined(LIBXML_REGEXP_ENABLED) && defined(LIBXML_EXPR_ENABLED)
   33455     int mem_base;
   33456     int ret_val;
   33457     xmlExpNodePtr exp; /* the expression */
   33458     int n_exp;
   33459 
   33460     for (n_exp = 0;n_exp < gen_nb_xmlExpNodePtr;n_exp++) {
   33461         mem_base = xmlMemBlocks();
   33462         exp = gen_xmlExpNodePtr(n_exp, 0);
   33463 
   33464         ret_val = xmlExpIsNillable(exp);
   33465         desret_int(ret_val);
   33466         call_tests++;
   33467         des_xmlExpNodePtr(n_exp, exp, 0);
   33468         xmlResetLastError();
   33469         if (mem_base != xmlMemBlocks()) {
   33470             printf("Leak of %d blocks found in xmlExpIsNillable",
   33471 	           xmlMemBlocks() - mem_base);
   33472 	    test_ret++;
   33473             printf(" %d", n_exp);
   33474             printf("\n");
   33475         }
   33476     }
   33477     function_tests++;
   33478 #endif
   33479 
   33480     return(test_ret);
   33481 }
   33482 
   33483 
   33484 static int
   33485 test_xmlExpMaxToken(void) {
   33486     int test_ret = 0;
   33487 
   33488 #if defined(LIBXML_REGEXP_ENABLED) && defined(LIBXML_EXPR_ENABLED)
   33489     int mem_base;
   33490     int ret_val;
   33491     xmlExpNodePtr expr; /* a compiled expression */
   33492     int n_expr;
   33493 
   33494     for (n_expr = 0;n_expr < gen_nb_xmlExpNodePtr;n_expr++) {
   33495         mem_base = xmlMemBlocks();
   33496         expr = gen_xmlExpNodePtr(n_expr, 0);
   33497 
   33498         ret_val = xmlExpMaxToken(expr);
   33499         desret_int(ret_val);
   33500         call_tests++;
   33501         des_xmlExpNodePtr(n_expr, expr, 0);
   33502         xmlResetLastError();
   33503         if (mem_base != xmlMemBlocks()) {
   33504             printf("Leak of %d blocks found in xmlExpMaxToken",
   33505 	           xmlMemBlocks() - mem_base);
   33506 	    test_ret++;
   33507             printf(" %d", n_expr);
   33508             printf("\n");
   33509         }
   33510     }
   33511     function_tests++;
   33512 #endif
   33513 
   33514     return(test_ret);
   33515 }
   33516 
   33517 
   33518 static int
   33519 test_xmlExpNewAtom(void) {
   33520     int test_ret = 0;
   33521 
   33522 
   33523     /* missing type support */
   33524     return(test_ret);
   33525 }
   33526 
   33527 
   33528 static int
   33529 test_xmlExpNewCtxt(void) {
   33530     int test_ret = 0;
   33531 
   33532 
   33533     /* missing type support */
   33534     return(test_ret);
   33535 }
   33536 
   33537 
   33538 static int
   33539 test_xmlExpNewOr(void) {
   33540     int test_ret = 0;
   33541 
   33542 
   33543     /* missing type support */
   33544     return(test_ret);
   33545 }
   33546 
   33547 
   33548 static int
   33549 test_xmlExpNewRange(void) {
   33550     int test_ret = 0;
   33551 
   33552 
   33553     /* missing type support */
   33554     return(test_ret);
   33555 }
   33556 
   33557 
   33558 static int
   33559 test_xmlExpNewSeq(void) {
   33560     int test_ret = 0;
   33561 
   33562 
   33563     /* missing type support */
   33564     return(test_ret);
   33565 }
   33566 
   33567 
   33568 static int
   33569 test_xmlExpParse(void) {
   33570     int test_ret = 0;
   33571 
   33572 
   33573     /* missing type support */
   33574     return(test_ret);
   33575 }
   33576 
   33577 
   33578 static int
   33579 test_xmlExpRef(void) {
   33580     int test_ret = 0;
   33581 
   33582 #if defined(LIBXML_REGEXP_ENABLED) && defined(LIBXML_EXPR_ENABLED)
   33583     int mem_base;
   33584     xmlExpNodePtr exp; /* the expression */
   33585     int n_exp;
   33586 
   33587     for (n_exp = 0;n_exp < gen_nb_xmlExpNodePtr;n_exp++) {
   33588         mem_base = xmlMemBlocks();
   33589         exp = gen_xmlExpNodePtr(n_exp, 0);
   33590 
   33591         xmlExpRef(exp);
   33592         call_tests++;
   33593         des_xmlExpNodePtr(n_exp, exp, 0);
   33594         xmlResetLastError();
   33595         if (mem_base != xmlMemBlocks()) {
   33596             printf("Leak of %d blocks found in xmlExpRef",
   33597 	           xmlMemBlocks() - mem_base);
   33598 	    test_ret++;
   33599             printf(" %d", n_exp);
   33600             printf("\n");
   33601         }
   33602     }
   33603     function_tests++;
   33604 #endif
   33605 
   33606     return(test_ret);
   33607 }
   33608 
   33609 
   33610 static int
   33611 test_xmlExpStringDerive(void) {
   33612     int test_ret = 0;
   33613 
   33614 
   33615     /* missing type support */
   33616     return(test_ret);
   33617 }
   33618 
   33619 
   33620 static int
   33621 test_xmlExpSubsume(void) {
   33622     int test_ret = 0;
   33623 
   33624 #if defined(LIBXML_REGEXP_ENABLED) && defined(LIBXML_EXPR_ENABLED)
   33625     int mem_base;
   33626     int ret_val;
   33627     xmlExpCtxtPtr ctxt; /* the expressions context */
   33628     int n_ctxt;
   33629     xmlExpNodePtr exp; /* the englobing expression */
   33630     int n_exp;
   33631     xmlExpNodePtr sub; /* the subexpression */
   33632     int n_sub;
   33633 
   33634     for (n_ctxt = 0;n_ctxt < gen_nb_xmlExpCtxtPtr;n_ctxt++) {
   33635     for (n_exp = 0;n_exp < gen_nb_xmlExpNodePtr;n_exp++) {
   33636     for (n_sub = 0;n_sub < gen_nb_xmlExpNodePtr;n_sub++) {
   33637         mem_base = xmlMemBlocks();
   33638         ctxt = gen_xmlExpCtxtPtr(n_ctxt, 0);
   33639         exp = gen_xmlExpNodePtr(n_exp, 1);
   33640         sub = gen_xmlExpNodePtr(n_sub, 2);
   33641 
   33642         ret_val = xmlExpSubsume(ctxt, exp, sub);
   33643         desret_int(ret_val);
   33644         call_tests++;
   33645         des_xmlExpCtxtPtr(n_ctxt, ctxt, 0);
   33646         des_xmlExpNodePtr(n_exp, exp, 1);
   33647         des_xmlExpNodePtr(n_sub, sub, 2);
   33648         xmlResetLastError();
   33649         if (mem_base != xmlMemBlocks()) {
   33650             printf("Leak of %d blocks found in xmlExpSubsume",
   33651 	           xmlMemBlocks() - mem_base);
   33652 	    test_ret++;
   33653             printf(" %d", n_ctxt);
   33654             printf(" %d", n_exp);
   33655             printf(" %d", n_sub);
   33656             printf("\n");
   33657         }
   33658     }
   33659     }
   33660     }
   33661     function_tests++;
   33662 #endif
   33663 
   33664     return(test_ret);
   33665 }
   33666 
   33667 #ifdef LIBXML_REGEXP_ENABLED
   33668 
   33669 #define gen_nb_xmlRegExecCtxtPtr 1
   33670 static xmlRegExecCtxtPtr gen_xmlRegExecCtxtPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
   33671     return(NULL);
   33672 }
   33673 static void des_xmlRegExecCtxtPtr(int no ATTRIBUTE_UNUSED, xmlRegExecCtxtPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
   33674 }
   33675 #endif
   33676 
   33677 
   33678 static int
   33679 test_xmlRegExecErrInfo(void) {
   33680     int test_ret = 0;
   33681 
   33682 #if defined(LIBXML_REGEXP_ENABLED)
   33683     int mem_base;
   33684     int ret_val;
   33685     xmlRegExecCtxtPtr exec; /* a regexp execution context generating an error */
   33686     int n_exec;
   33687     xmlChar ** string; /* return value for the error string */
   33688     int n_string;
   33689     int * nbval; /* pointer to the number of accepted values IN/OUT */
   33690     int n_nbval;
   33691     int * nbneg; /* return number of negative transitions */
   33692     int n_nbneg;
   33693     xmlChar ** values; /* pointer to the array of acceptable values */
   33694     int n_values;
   33695     int * terminal; /* return value if this was a terminal state */
   33696     int n_terminal;
   33697 
   33698     for (n_exec = 0;n_exec < gen_nb_xmlRegExecCtxtPtr;n_exec++) {
   33699     for (n_string = 0;n_string < gen_nb_const_xmlChar_ptr_ptr;n_string++) {
   33700     for (n_nbval = 0;n_nbval < gen_nb_int_ptr;n_nbval++) {
   33701     for (n_nbneg = 0;n_nbneg < gen_nb_int_ptr;n_nbneg++) {
   33702     for (n_values = 0;n_values < gen_nb_xmlChar_ptr_ptr;n_values++) {
   33703     for (n_terminal = 0;n_terminal < gen_nb_int_ptr;n_terminal++) {
   33704         mem_base = xmlMemBlocks();
   33705         exec = gen_xmlRegExecCtxtPtr(n_exec, 0);
   33706         string = gen_const_xmlChar_ptr_ptr(n_string, 1);
   33707         nbval = gen_int_ptr(n_nbval, 2);
   33708         nbneg = gen_int_ptr(n_nbneg, 3);
   33709         values = gen_xmlChar_ptr_ptr(n_values, 4);
   33710         terminal = gen_int_ptr(n_terminal, 5);
   33711 
   33712         ret_val = xmlRegExecErrInfo(exec, (const xmlChar **)string, nbval, nbneg, values, terminal);
   33713         desret_int(ret_val);
   33714         call_tests++;
   33715         des_xmlRegExecCtxtPtr(n_exec, exec, 0);
   33716         des_const_xmlChar_ptr_ptr(n_string, (const xmlChar **)string, 1);
   33717         des_int_ptr(n_nbval, nbval, 2);
   33718         des_int_ptr(n_nbneg, nbneg, 3);
   33719         des_xmlChar_ptr_ptr(n_values, values, 4);
   33720         des_int_ptr(n_terminal, terminal, 5);
   33721         xmlResetLastError();
   33722         if (mem_base != xmlMemBlocks()) {
   33723             printf("Leak of %d blocks found in xmlRegExecErrInfo",
   33724 	           xmlMemBlocks() - mem_base);
   33725 	    test_ret++;
   33726             printf(" %d", n_exec);
   33727             printf(" %d", n_string);
   33728             printf(" %d", n_nbval);
   33729             printf(" %d", n_nbneg);
   33730             printf(" %d", n_values);
   33731             printf(" %d", n_terminal);
   33732             printf("\n");
   33733         }
   33734     }
   33735     }
   33736     }
   33737     }
   33738     }
   33739     }
   33740     function_tests++;
   33741 #endif
   33742 
   33743     return(test_ret);
   33744 }
   33745 
   33746 
   33747 static int
   33748 test_xmlRegExecNextValues(void) {
   33749     int test_ret = 0;
   33750 
   33751 #if defined(LIBXML_REGEXP_ENABLED)
   33752     int mem_base;
   33753     int ret_val;
   33754     xmlRegExecCtxtPtr exec; /* a regexp execution context */
   33755     int n_exec;
   33756     int * nbval; /* pointer to the number of accepted values IN/OUT */
   33757     int n_nbval;
   33758     int * nbneg; /* return number of negative transitions */
   33759     int n_nbneg;
   33760     xmlChar ** values; /* pointer to the array of acceptable values */
   33761     int n_values;
   33762     int * terminal; /* return value if this was a terminal state */
   33763     int n_terminal;
   33764 
   33765     for (n_exec = 0;n_exec < gen_nb_xmlRegExecCtxtPtr;n_exec++) {
   33766     for (n_nbval = 0;n_nbval < gen_nb_int_ptr;n_nbval++) {
   33767     for (n_nbneg = 0;n_nbneg < gen_nb_int_ptr;n_nbneg++) {
   33768     for (n_values = 0;n_values < gen_nb_xmlChar_ptr_ptr;n_values++) {
   33769     for (n_terminal = 0;n_terminal < gen_nb_int_ptr;n_terminal++) {
   33770         mem_base = xmlMemBlocks();
   33771         exec = gen_xmlRegExecCtxtPtr(n_exec, 0);
   33772         nbval = gen_int_ptr(n_nbval, 1);
   33773         nbneg = gen_int_ptr(n_nbneg, 2);
   33774         values = gen_xmlChar_ptr_ptr(n_values, 3);
   33775         terminal = gen_int_ptr(n_terminal, 4);
   33776 
   33777         ret_val = xmlRegExecNextValues(exec, nbval, nbneg, values, terminal);
   33778         desret_int(ret_val);
   33779         call_tests++;
   33780         des_xmlRegExecCtxtPtr(n_exec, exec, 0);
   33781         des_int_ptr(n_nbval, nbval, 1);
   33782         des_int_ptr(n_nbneg, nbneg, 2);
   33783         des_xmlChar_ptr_ptr(n_values, values, 3);
   33784         des_int_ptr(n_terminal, terminal, 4);
   33785         xmlResetLastError();
   33786         if (mem_base != xmlMemBlocks()) {
   33787             printf("Leak of %d blocks found in xmlRegExecNextValues",
   33788 	           xmlMemBlocks() - mem_base);
   33789 	    test_ret++;
   33790             printf(" %d", n_exec);
   33791             printf(" %d", n_nbval);
   33792             printf(" %d", n_nbneg);
   33793             printf(" %d", n_values);
   33794             printf(" %d", n_terminal);
   33795             printf("\n");
   33796         }
   33797     }
   33798     }
   33799     }
   33800     }
   33801     }
   33802     function_tests++;
   33803 #endif
   33804 
   33805     return(test_ret);
   33806 }
   33807 
   33808 
   33809 static int
   33810 test_xmlRegExecPushString(void) {
   33811     int test_ret = 0;
   33812 
   33813 #if defined(LIBXML_REGEXP_ENABLED)
   33814     int mem_base;
   33815     int ret_val;
   33816     xmlRegExecCtxtPtr exec; /* a regexp execution context or NULL to indicate the end */
   33817     int n_exec;
   33818     xmlChar * value; /* a string token input */
   33819     int n_value;
   33820     void * data; /* data associated to the token to reuse in callbacks */
   33821     int n_data;
   33822 
   33823     for (n_exec = 0;n_exec < gen_nb_xmlRegExecCtxtPtr;n_exec++) {
   33824     for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
   33825     for (n_data = 0;n_data < gen_nb_userdata;n_data++) {
   33826         mem_base = xmlMemBlocks();
   33827         exec = gen_xmlRegExecCtxtPtr(n_exec, 0);
   33828         value = gen_const_xmlChar_ptr(n_value, 1);
   33829         data = gen_userdata(n_data, 2);
   33830 
   33831         ret_val = xmlRegExecPushString(exec, (const xmlChar *)value, data);
   33832         desret_int(ret_val);
   33833         call_tests++;
   33834         des_xmlRegExecCtxtPtr(n_exec, exec, 0);
   33835         des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 1);
   33836         des_userdata(n_data, data, 2);
   33837         xmlResetLastError();
   33838         if (mem_base != xmlMemBlocks()) {
   33839             printf("Leak of %d blocks found in xmlRegExecPushString",
   33840 	           xmlMemBlocks() - mem_base);
   33841 	    test_ret++;
   33842             printf(" %d", n_exec);
   33843             printf(" %d", n_value);
   33844             printf(" %d", n_data);
   33845             printf("\n");
   33846         }
   33847     }
   33848     }
   33849     }
   33850     function_tests++;
   33851 #endif
   33852 
   33853     return(test_ret);
   33854 }
   33855 
   33856 
   33857 static int
   33858 test_xmlRegExecPushString2(void) {
   33859     int test_ret = 0;
   33860 
   33861 #if defined(LIBXML_REGEXP_ENABLED)
   33862     int mem_base;
   33863     int ret_val;
   33864     xmlRegExecCtxtPtr exec; /* a regexp execution context or NULL to indicate the end */
   33865     int n_exec;
   33866     xmlChar * value; /* the first string token input */
   33867     int n_value;
   33868     xmlChar * value2; /* the second string token input */
   33869     int n_value2;
   33870     void * data; /* data associated to the token to reuse in callbacks */
   33871     int n_data;
   33872 
   33873     for (n_exec = 0;n_exec < gen_nb_xmlRegExecCtxtPtr;n_exec++) {
   33874     for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
   33875     for (n_value2 = 0;n_value2 < gen_nb_const_xmlChar_ptr;n_value2++) {
   33876     for (n_data = 0;n_data < gen_nb_userdata;n_data++) {
   33877         mem_base = xmlMemBlocks();
   33878         exec = gen_xmlRegExecCtxtPtr(n_exec, 0);
   33879         value = gen_const_xmlChar_ptr(n_value, 1);
   33880         value2 = gen_const_xmlChar_ptr(n_value2, 2);
   33881         data = gen_userdata(n_data, 3);
   33882 
   33883         ret_val = xmlRegExecPushString2(exec, (const xmlChar *)value, (const xmlChar *)value2, data);
   33884         desret_int(ret_val);
   33885         call_tests++;
   33886         des_xmlRegExecCtxtPtr(n_exec, exec, 0);
   33887         des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 1);
   33888         des_const_xmlChar_ptr(n_value2, (const xmlChar *)value2, 2);
   33889         des_userdata(n_data, data, 3);
   33890         xmlResetLastError();
   33891         if (mem_base != xmlMemBlocks()) {
   33892             printf("Leak of %d blocks found in xmlRegExecPushString2",
   33893 	           xmlMemBlocks() - mem_base);
   33894 	    test_ret++;
   33895             printf(" %d", n_exec);
   33896             printf(" %d", n_value);
   33897             printf(" %d", n_value2);
   33898             printf(" %d", n_data);
   33899             printf("\n");
   33900         }
   33901     }
   33902     }
   33903     }
   33904     }
   33905     function_tests++;
   33906 #endif
   33907 
   33908     return(test_ret);
   33909 }
   33910 
   33911 #ifdef LIBXML_REGEXP_ENABLED
   33912 
   33913 #define gen_nb_xmlRegexpPtr 1
   33914 static xmlRegexpPtr gen_xmlRegexpPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
   33915     return(NULL);
   33916 }
   33917 static void des_xmlRegexpPtr(int no ATTRIBUTE_UNUSED, xmlRegexpPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
   33918 }
   33919 #endif
   33920 
   33921 
   33922 static int
   33923 test_xmlRegNewExecCtxt(void) {
   33924     int test_ret = 0;
   33925 
   33926 
   33927     /* missing type support */
   33928     return(test_ret);
   33929 }
   33930 
   33931 
   33932 static int
   33933 test_xmlRegexpCompile(void) {
   33934     int test_ret = 0;
   33935 
   33936 
   33937     /* missing type support */
   33938     return(test_ret);
   33939 }
   33940 
   33941 
   33942 static int
   33943 test_xmlRegexpExec(void) {
   33944     int test_ret = 0;
   33945 
   33946 #if defined(LIBXML_REGEXP_ENABLED)
   33947     int mem_base;
   33948     int ret_val;
   33949     xmlRegexpPtr comp; /* the compiled regular expression */
   33950     int n_comp;
   33951     xmlChar * content; /* the value to check against the regular expression */
   33952     int n_content;
   33953 
   33954     for (n_comp = 0;n_comp < gen_nb_xmlRegexpPtr;n_comp++) {
   33955     for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
   33956         mem_base = xmlMemBlocks();
   33957         comp = gen_xmlRegexpPtr(n_comp, 0);
   33958         content = gen_const_xmlChar_ptr(n_content, 1);
   33959 
   33960         ret_val = xmlRegexpExec(comp, (const xmlChar *)content);
   33961         desret_int(ret_val);
   33962         call_tests++;
   33963         des_xmlRegexpPtr(n_comp, comp, 0);
   33964         des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 1);
   33965         xmlResetLastError();
   33966         if (mem_base != xmlMemBlocks()) {
   33967             printf("Leak of %d blocks found in xmlRegexpExec",
   33968 	           xmlMemBlocks() - mem_base);
   33969 	    test_ret++;
   33970             printf(" %d", n_comp);
   33971             printf(" %d", n_content);
   33972             printf("\n");
   33973         }
   33974     }
   33975     }
   33976     function_tests++;
   33977 #endif
   33978 
   33979     return(test_ret);
   33980 }
   33981 
   33982 
   33983 static int
   33984 test_xmlRegexpIsDeterminist(void) {
   33985     int test_ret = 0;
   33986 
   33987 #if defined(LIBXML_REGEXP_ENABLED)
   33988     int mem_base;
   33989     int ret_val;
   33990     xmlRegexpPtr comp; /* the compiled regular expression */
   33991     int n_comp;
   33992 
   33993     for (n_comp = 0;n_comp < gen_nb_xmlRegexpPtr;n_comp++) {
   33994         mem_base = xmlMemBlocks();
   33995         comp = gen_xmlRegexpPtr(n_comp, 0);
   33996 
   33997         ret_val = xmlRegexpIsDeterminist(comp);
   33998         desret_int(ret_val);
   33999         call_tests++;
   34000         des_xmlRegexpPtr(n_comp, comp, 0);
   34001         xmlResetLastError();
   34002         if (mem_base != xmlMemBlocks()) {
   34003             printf("Leak of %d blocks found in xmlRegexpIsDeterminist",
   34004 	           xmlMemBlocks() - mem_base);
   34005 	    test_ret++;
   34006             printf(" %d", n_comp);
   34007             printf("\n");
   34008         }
   34009     }
   34010     function_tests++;
   34011 #endif
   34012 
   34013     return(test_ret);
   34014 }
   34015 
   34016 
   34017 static int
   34018 test_xmlRegexpPrint(void) {
   34019     int test_ret = 0;
   34020 
   34021 #if defined(LIBXML_REGEXP_ENABLED)
   34022     int mem_base;
   34023     FILE * output; /* the file for the output debug */
   34024     int n_output;
   34025     xmlRegexpPtr regexp; /* the compiled regexp */
   34026     int n_regexp;
   34027 
   34028     for (n_output = 0;n_output < gen_nb_FILE_ptr;n_output++) {
   34029     for (n_regexp = 0;n_regexp < gen_nb_xmlRegexpPtr;n_regexp++) {
   34030         mem_base = xmlMemBlocks();
   34031         output = gen_FILE_ptr(n_output, 0);
   34032         regexp = gen_xmlRegexpPtr(n_regexp, 1);
   34033 
   34034         xmlRegexpPrint(output, regexp);
   34035         call_tests++;
   34036         des_FILE_ptr(n_output, output, 0);
   34037         des_xmlRegexpPtr(n_regexp, regexp, 1);
   34038         xmlResetLastError();
   34039         if (mem_base != xmlMemBlocks()) {
   34040             printf("Leak of %d blocks found in xmlRegexpPrint",
   34041 	           xmlMemBlocks() - mem_base);
   34042 	    test_ret++;
   34043             printf(" %d", n_output);
   34044             printf(" %d", n_regexp);
   34045             printf("\n");
   34046         }
   34047     }
   34048     }
   34049     function_tests++;
   34050 #endif
   34051 
   34052     return(test_ret);
   34053 }
   34054 
   34055 static int
   34056 test_xmlregexp(void) {
   34057     int test_ret = 0;
   34058 
   34059     if (quiet == 0) printf("Testing xmlregexp : 16 of 30 functions ...\n");
   34060     test_ret += test_xmlExpCtxtNbCons();
   34061     test_ret += test_xmlExpCtxtNbNodes();
   34062     test_ret += test_xmlExpDump();
   34063     test_ret += test_xmlExpExpDerive();
   34064     test_ret += test_xmlExpGetLanguage();
   34065     test_ret += test_xmlExpGetStart();
   34066     test_ret += test_xmlExpIsNillable();
   34067     test_ret += test_xmlExpMaxToken();
   34068     test_ret += test_xmlExpNewAtom();
   34069     test_ret += test_xmlExpNewCtxt();
   34070     test_ret += test_xmlExpNewOr();
   34071     test_ret += test_xmlExpNewRange();
   34072     test_ret += test_xmlExpNewSeq();
   34073     test_ret += test_xmlExpParse();
   34074     test_ret += test_xmlExpRef();
   34075     test_ret += test_xmlExpStringDerive();
   34076     test_ret += test_xmlExpSubsume();
   34077     test_ret += test_xmlRegExecErrInfo();
   34078     test_ret += test_xmlRegExecNextValues();
   34079     test_ret += test_xmlRegExecPushString();
   34080     test_ret += test_xmlRegExecPushString2();
   34081     test_ret += test_xmlRegNewExecCtxt();
   34082     test_ret += test_xmlRegexpCompile();
   34083     test_ret += test_xmlRegexpExec();
   34084     test_ret += test_xmlRegexpIsDeterminist();
   34085     test_ret += test_xmlRegexpPrint();
   34086 
   34087     if (test_ret != 0)
   34088 	printf("Module xmlregexp: %d errors\n", test_ret);
   34089     return(test_ret);
   34090 }
   34091 #ifdef LIBXML_OUTPUT_ENABLED
   34092 
   34093 #define gen_nb_xmlSaveCtxtPtr 1
   34094 static xmlSaveCtxtPtr gen_xmlSaveCtxtPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
   34095     return(NULL);
   34096 }
   34097 static void des_xmlSaveCtxtPtr(int no ATTRIBUTE_UNUSED, xmlSaveCtxtPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
   34098 }
   34099 #endif
   34100 
   34101 
   34102 static int
   34103 test_xmlSaveClose(void) {
   34104     int test_ret = 0;
   34105 
   34106 #if defined(LIBXML_OUTPUT_ENABLED)
   34107     int mem_base;
   34108     int ret_val;
   34109     xmlSaveCtxtPtr ctxt; /* a document saving context */
   34110     int n_ctxt;
   34111 
   34112     for (n_ctxt = 0;n_ctxt < gen_nb_xmlSaveCtxtPtr;n_ctxt++) {
   34113         mem_base = xmlMemBlocks();
   34114         ctxt = gen_xmlSaveCtxtPtr(n_ctxt, 0);
   34115 
   34116         ret_val = xmlSaveClose(ctxt);
   34117         desret_int(ret_val);
   34118         call_tests++;
   34119         des_xmlSaveCtxtPtr(n_ctxt, ctxt, 0);
   34120         xmlResetLastError();
   34121         if (mem_base != xmlMemBlocks()) {
   34122             printf("Leak of %d blocks found in xmlSaveClose",
   34123 	           xmlMemBlocks() - mem_base);
   34124 	    test_ret++;
   34125             printf(" %d", n_ctxt);
   34126             printf("\n");
   34127         }
   34128     }
   34129     function_tests++;
   34130 #endif
   34131 
   34132     return(test_ret);
   34133 }
   34134 
   34135 
   34136 static int
   34137 test_xmlSaveDoc(void) {
   34138     int test_ret = 0;
   34139 
   34140 #if defined(LIBXML_OUTPUT_ENABLED)
   34141     int mem_base;
   34142     long ret_val;
   34143     xmlSaveCtxtPtr ctxt; /* a document saving context */
   34144     int n_ctxt;
   34145     xmlDocPtr doc; /* a document */
   34146     int n_doc;
   34147 
   34148     for (n_ctxt = 0;n_ctxt < gen_nb_xmlSaveCtxtPtr;n_ctxt++) {
   34149     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
   34150         mem_base = xmlMemBlocks();
   34151         ctxt = gen_xmlSaveCtxtPtr(n_ctxt, 0);
   34152         doc = gen_xmlDocPtr(n_doc, 1);
   34153 
   34154         ret_val = xmlSaveDoc(ctxt, doc);
   34155         desret_long(ret_val);
   34156         call_tests++;
   34157         des_xmlSaveCtxtPtr(n_ctxt, ctxt, 0);
   34158         des_xmlDocPtr(n_doc, doc, 1);
   34159         xmlResetLastError();
   34160         if (mem_base != xmlMemBlocks()) {
   34161             printf("Leak of %d blocks found in xmlSaveDoc",
   34162 	           xmlMemBlocks() - mem_base);
   34163 	    test_ret++;
   34164             printf(" %d", n_ctxt);
   34165             printf(" %d", n_doc);
   34166             printf("\n");
   34167         }
   34168     }
   34169     }
   34170     function_tests++;
   34171 #endif
   34172 
   34173     return(test_ret);
   34174 }
   34175 
   34176 
   34177 static int
   34178 test_xmlSaveFlush(void) {
   34179     int test_ret = 0;
   34180 
   34181 #if defined(LIBXML_OUTPUT_ENABLED)
   34182     int mem_base;
   34183     int ret_val;
   34184     xmlSaveCtxtPtr ctxt; /* a document saving context */
   34185     int n_ctxt;
   34186 
   34187     for (n_ctxt = 0;n_ctxt < gen_nb_xmlSaveCtxtPtr;n_ctxt++) {
   34188         mem_base = xmlMemBlocks();
   34189         ctxt = gen_xmlSaveCtxtPtr(n_ctxt, 0);
   34190 
   34191         ret_val = xmlSaveFlush(ctxt);
   34192         desret_int(ret_val);
   34193         call_tests++;
   34194         des_xmlSaveCtxtPtr(n_ctxt, ctxt, 0);
   34195         xmlResetLastError();
   34196         if (mem_base != xmlMemBlocks()) {
   34197             printf("Leak of %d blocks found in xmlSaveFlush",
   34198 	           xmlMemBlocks() - mem_base);
   34199 	    test_ret++;
   34200             printf(" %d", n_ctxt);
   34201             printf("\n");
   34202         }
   34203     }
   34204     function_tests++;
   34205 #endif
   34206 
   34207     return(test_ret);
   34208 }
   34209 
   34210 
   34211 static int
   34212 test_xmlSaveSetAttrEscape(void) {
   34213     int test_ret = 0;
   34214 
   34215 
   34216     /* missing type support */
   34217     return(test_ret);
   34218 }
   34219 
   34220 
   34221 static int
   34222 test_xmlSaveSetEscape(void) {
   34223     int test_ret = 0;
   34224 
   34225 
   34226     /* missing type support */
   34227     return(test_ret);
   34228 }
   34229 
   34230 
   34231 static int
   34232 test_xmlSaveToBuffer(void) {
   34233     int test_ret = 0;
   34234 
   34235 
   34236     /* missing type support */
   34237     return(test_ret);
   34238 }
   34239 
   34240 
   34241 static int
   34242 test_xmlSaveToFd(void) {
   34243     int test_ret = 0;
   34244 
   34245 
   34246     /* missing type support */
   34247     return(test_ret);
   34248 }
   34249 
   34250 
   34251 static int
   34252 test_xmlSaveToFilename(void) {
   34253     int test_ret = 0;
   34254 
   34255 
   34256     /* missing type support */
   34257     return(test_ret);
   34258 }
   34259 
   34260 
   34261 static int
   34262 test_xmlSaveTree(void) {
   34263     int test_ret = 0;
   34264 
   34265 #if defined(LIBXML_OUTPUT_ENABLED)
   34266     int mem_base;
   34267     long ret_val;
   34268     xmlSaveCtxtPtr ctxt; /* a document saving context */
   34269     int n_ctxt;
   34270     xmlNodePtr node; /* the top node of the subtree to save */
   34271     int n_node;
   34272 
   34273     for (n_ctxt = 0;n_ctxt < gen_nb_xmlSaveCtxtPtr;n_ctxt++) {
   34274     for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
   34275         mem_base = xmlMemBlocks();
   34276         ctxt = gen_xmlSaveCtxtPtr(n_ctxt, 0);
   34277         node = gen_xmlNodePtr(n_node, 1);
   34278 
   34279         ret_val = xmlSaveTree(ctxt, node);
   34280         desret_long(ret_val);
   34281         call_tests++;
   34282         des_xmlSaveCtxtPtr(n_ctxt, ctxt, 0);
   34283         des_xmlNodePtr(n_node, node, 1);
   34284         xmlResetLastError();
   34285         if (mem_base != xmlMemBlocks()) {
   34286             printf("Leak of %d blocks found in xmlSaveTree",
   34287 	           xmlMemBlocks() - mem_base);
   34288 	    test_ret++;
   34289             printf(" %d", n_ctxt);
   34290             printf(" %d", n_node);
   34291             printf("\n");
   34292         }
   34293     }
   34294     }
   34295     function_tests++;
   34296 #endif
   34297 
   34298     return(test_ret);
   34299 }
   34300 
   34301 static int
   34302 test_xmlsave(void) {
   34303     int test_ret = 0;
   34304 
   34305     if (quiet == 0) printf("Testing xmlsave : 4 of 10 functions ...\n");
   34306     test_ret += test_xmlSaveClose();
   34307     test_ret += test_xmlSaveDoc();
   34308     test_ret += test_xmlSaveFlush();
   34309     test_ret += test_xmlSaveSetAttrEscape();
   34310     test_ret += test_xmlSaveSetEscape();
   34311     test_ret += test_xmlSaveToBuffer();
   34312     test_ret += test_xmlSaveToFd();
   34313     test_ret += test_xmlSaveToFilename();
   34314     test_ret += test_xmlSaveTree();
   34315 
   34316     if (test_ret != 0)
   34317 	printf("Module xmlsave: %d errors\n", test_ret);
   34318     return(test_ret);
   34319 }
   34320 
   34321 static int
   34322 test_xmlSchemaDump(void) {
   34323     int test_ret = 0;
   34324 
   34325 #if defined(LIBXML_SCHEMAS_ENABLED) && defined(LIBXML_OUTPUT_ENABLED)
   34326     int mem_base;
   34327     FILE * output; /* the file output */
   34328     int n_output;
   34329     xmlSchemaPtr schema; /* a schema structure */
   34330     int n_schema;
   34331 
   34332     for (n_output = 0;n_output < gen_nb_FILE_ptr;n_output++) {
   34333     for (n_schema = 0;n_schema < gen_nb_xmlSchemaPtr;n_schema++) {
   34334         mem_base = xmlMemBlocks();
   34335         output = gen_FILE_ptr(n_output, 0);
   34336         schema = gen_xmlSchemaPtr(n_schema, 1);
   34337 
   34338         xmlSchemaDump(output, schema);
   34339         call_tests++;
   34340         des_FILE_ptr(n_output, output, 0);
   34341         des_xmlSchemaPtr(n_schema, schema, 1);
   34342         xmlResetLastError();
   34343         if (mem_base != xmlMemBlocks()) {
   34344             printf("Leak of %d blocks found in xmlSchemaDump",
   34345 	           xmlMemBlocks() - mem_base);
   34346 	    test_ret++;
   34347             printf(" %d", n_output);
   34348             printf(" %d", n_schema);
   34349             printf("\n");
   34350         }
   34351     }
   34352     }
   34353     function_tests++;
   34354 #endif
   34355 
   34356     return(test_ret);
   34357 }
   34358 
   34359 #ifdef LIBXML_SCHEMAS_ENABLED
   34360 
   34361 #define gen_nb_xmlSchemaParserCtxtPtr 1
   34362 static xmlSchemaParserCtxtPtr gen_xmlSchemaParserCtxtPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
   34363     return(NULL);
   34364 }
   34365 static void des_xmlSchemaParserCtxtPtr(int no ATTRIBUTE_UNUSED, xmlSchemaParserCtxtPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
   34366 }
   34367 #endif
   34368 
   34369 #ifdef LIBXML_SCHEMAS_ENABLED
   34370 
   34371 #define gen_nb_xmlSchemaValidityErrorFunc_ptr 1
   34372 static xmlSchemaValidityErrorFunc * gen_xmlSchemaValidityErrorFunc_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
   34373     return(NULL);
   34374 }
   34375 static void des_xmlSchemaValidityErrorFunc_ptr(int no ATTRIBUTE_UNUSED, xmlSchemaValidityErrorFunc * val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
   34376 }
   34377 #endif
   34378 
   34379 #ifdef LIBXML_SCHEMAS_ENABLED
   34380 
   34381 #define gen_nb_xmlSchemaValidityWarningFunc_ptr 1
   34382 static xmlSchemaValidityWarningFunc * gen_xmlSchemaValidityWarningFunc_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
   34383     return(NULL);
   34384 }
   34385 static void des_xmlSchemaValidityWarningFunc_ptr(int no ATTRIBUTE_UNUSED, xmlSchemaValidityWarningFunc * val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
   34386 }
   34387 #endif
   34388 
   34389 
   34390 static int
   34391 test_xmlSchemaGetParserErrors(void) {
   34392     int test_ret = 0;
   34393 
   34394 #if defined(LIBXML_SCHEMAS_ENABLED)
   34395     int mem_base;
   34396     int ret_val;
   34397     xmlSchemaParserCtxtPtr ctxt; /* a XMl-Schema parser context */
   34398     int n_ctxt;
   34399     xmlSchemaValidityErrorFunc * err; /* the error callback result */
   34400     int n_err;
   34401     xmlSchemaValidityWarningFunc * warn; /* the warning callback result */
   34402     int n_warn;
   34403     void ** ctx; /* contextual data for the callbacks result */
   34404     int n_ctx;
   34405 
   34406     for (n_ctxt = 0;n_ctxt < gen_nb_xmlSchemaParserCtxtPtr;n_ctxt++) {
   34407     for (n_err = 0;n_err < gen_nb_xmlSchemaValidityErrorFunc_ptr;n_err++) {
   34408     for (n_warn = 0;n_warn < gen_nb_xmlSchemaValidityWarningFunc_ptr;n_warn++) {
   34409     for (n_ctx = 0;n_ctx < gen_nb_void_ptr_ptr;n_ctx++) {
   34410         mem_base = xmlMemBlocks();
   34411         ctxt = gen_xmlSchemaParserCtxtPtr(n_ctxt, 0);
   34412         err = gen_xmlSchemaValidityErrorFunc_ptr(n_err, 1);
   34413         warn = gen_xmlSchemaValidityWarningFunc_ptr(n_warn, 2);
   34414         ctx = gen_void_ptr_ptr(n_ctx, 3);
   34415 
   34416         ret_val = xmlSchemaGetParserErrors(ctxt, err, warn, ctx);
   34417         desret_int(ret_val);
   34418         call_tests++;
   34419         des_xmlSchemaParserCtxtPtr(n_ctxt, ctxt, 0);
   34420         des_xmlSchemaValidityErrorFunc_ptr(n_err, err, 1);
   34421         des_xmlSchemaValidityWarningFunc_ptr(n_warn, warn, 2);
   34422         des_void_ptr_ptr(n_ctx, ctx, 3);
   34423         xmlResetLastError();
   34424         if (mem_base != xmlMemBlocks()) {
   34425             printf("Leak of %d blocks found in xmlSchemaGetParserErrors",
   34426 	           xmlMemBlocks() - mem_base);
   34427 	    test_ret++;
   34428             printf(" %d", n_ctxt);
   34429             printf(" %d", n_err);
   34430             printf(" %d", n_warn);
   34431             printf(" %d", n_ctx);
   34432             printf("\n");
   34433         }
   34434     }
   34435     }
   34436     }
   34437     }
   34438     function_tests++;
   34439 #endif
   34440 
   34441     return(test_ret);
   34442 }
   34443 
   34444 
   34445 static int
   34446 test_xmlSchemaGetValidErrors(void) {
   34447     int test_ret = 0;
   34448 
   34449 #if defined(LIBXML_SCHEMAS_ENABLED)
   34450     int mem_base;
   34451     int ret_val;
   34452     xmlSchemaValidCtxtPtr ctxt; /* a XML-Schema validation context */
   34453     int n_ctxt;
   34454     xmlSchemaValidityErrorFunc * err; /* the error function result */
   34455     int n_err;
   34456     xmlSchemaValidityWarningFunc * warn; /* the warning function result */
   34457     int n_warn;
   34458     void ** ctx; /* the functions context result */
   34459     int n_ctx;
   34460 
   34461     for (n_ctxt = 0;n_ctxt < gen_nb_xmlSchemaValidCtxtPtr;n_ctxt++) {
   34462     for (n_err = 0;n_err < gen_nb_xmlSchemaValidityErrorFunc_ptr;n_err++) {
   34463     for (n_warn = 0;n_warn < gen_nb_xmlSchemaValidityWarningFunc_ptr;n_warn++) {
   34464     for (n_ctx = 0;n_ctx < gen_nb_void_ptr_ptr;n_ctx++) {
   34465         mem_base = xmlMemBlocks();
   34466         ctxt = gen_xmlSchemaValidCtxtPtr(n_ctxt, 0);
   34467         err = gen_xmlSchemaValidityErrorFunc_ptr(n_err, 1);
   34468         warn = gen_xmlSchemaValidityWarningFunc_ptr(n_warn, 2);
   34469         ctx = gen_void_ptr_ptr(n_ctx, 3);
   34470 
   34471         ret_val = xmlSchemaGetValidErrors(ctxt, err, warn, ctx);
   34472         desret_int(ret_val);
   34473         call_tests++;
   34474         des_xmlSchemaValidCtxtPtr(n_ctxt, ctxt, 0);
   34475         des_xmlSchemaValidityErrorFunc_ptr(n_err, err, 1);
   34476         des_xmlSchemaValidityWarningFunc_ptr(n_warn, warn, 2);
   34477         des_void_ptr_ptr(n_ctx, ctx, 3);
   34478         xmlResetLastError();
   34479         if (mem_base != xmlMemBlocks()) {
   34480             printf("Leak of %d blocks found in xmlSchemaGetValidErrors",
   34481 	           xmlMemBlocks() - mem_base);
   34482 	    test_ret++;
   34483             printf(" %d", n_ctxt);
   34484             printf(" %d", n_err);
   34485             printf(" %d", n_warn);
   34486             printf(" %d", n_ctx);
   34487             printf("\n");
   34488         }
   34489     }
   34490     }
   34491     }
   34492     }
   34493     function_tests++;
   34494 #endif
   34495 
   34496     return(test_ret);
   34497 }
   34498 
   34499 
   34500 static int
   34501 test_xmlSchemaIsValid(void) {
   34502     int test_ret = 0;
   34503 
   34504 #if defined(LIBXML_SCHEMAS_ENABLED)
   34505     int mem_base;
   34506     int ret_val;
   34507     xmlSchemaValidCtxtPtr ctxt; /* the schema validation context */
   34508     int n_ctxt;
   34509 
   34510     for (n_ctxt = 0;n_ctxt < gen_nb_xmlSchemaValidCtxtPtr;n_ctxt++) {
   34511         mem_base = xmlMemBlocks();
   34512         ctxt = gen_xmlSchemaValidCtxtPtr(n_ctxt, 0);
   34513 
   34514         ret_val = xmlSchemaIsValid(ctxt);
   34515         desret_int(ret_val);
   34516         call_tests++;
   34517         des_xmlSchemaValidCtxtPtr(n_ctxt, ctxt, 0);
   34518         xmlResetLastError();
   34519         if (mem_base != xmlMemBlocks()) {
   34520             printf("Leak of %d blocks found in xmlSchemaIsValid",
   34521 	           xmlMemBlocks() - mem_base);
   34522 	    test_ret++;
   34523             printf(" %d", n_ctxt);
   34524             printf("\n");
   34525         }
   34526     }
   34527     function_tests++;
   34528 #endif
   34529 
   34530     return(test_ret);
   34531 }
   34532 
   34533 
   34534 static int
   34535 test_xmlSchemaNewDocParserCtxt(void) {
   34536     int test_ret = 0;
   34537 
   34538 #if defined(LIBXML_SCHEMAS_ENABLED)
   34539     int mem_base;
   34540     xmlSchemaParserCtxtPtr ret_val;
   34541     xmlDocPtr doc; /* a preparsed document tree */
   34542     int n_doc;
   34543 
   34544     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
   34545         mem_base = xmlMemBlocks();
   34546         doc = gen_xmlDocPtr(n_doc, 0);
   34547 
   34548         ret_val = xmlSchemaNewDocParserCtxt(doc);
   34549         desret_xmlSchemaParserCtxtPtr(ret_val);
   34550         call_tests++;
   34551         des_xmlDocPtr(n_doc, doc, 0);
   34552         xmlResetLastError();
   34553         if (mem_base != xmlMemBlocks()) {
   34554             printf("Leak of %d blocks found in xmlSchemaNewDocParserCtxt",
   34555 	           xmlMemBlocks() - mem_base);
   34556 	    test_ret++;
   34557             printf(" %d", n_doc);
   34558             printf("\n");
   34559         }
   34560     }
   34561     function_tests++;
   34562 #endif
   34563 
   34564     return(test_ret);
   34565 }
   34566 
   34567 
   34568 static int
   34569 test_xmlSchemaNewMemParserCtxt(void) {
   34570     int test_ret = 0;
   34571 
   34572 #if defined(LIBXML_SCHEMAS_ENABLED)
   34573     int mem_base;
   34574     xmlSchemaParserCtxtPtr ret_val;
   34575     char * buffer; /* a pointer to a char array containing the schemas */
   34576     int n_buffer;
   34577     int size; /* the size of the array */
   34578     int n_size;
   34579 
   34580     for (n_buffer = 0;n_buffer < gen_nb_const_char_ptr;n_buffer++) {
   34581     for (n_size = 0;n_size < gen_nb_int;n_size++) {
   34582         mem_base = xmlMemBlocks();
   34583         buffer = gen_const_char_ptr(n_buffer, 0);
   34584         size = gen_int(n_size, 1);
   34585         if ((buffer != NULL) &&
   34586             (size > (int) strlen((const char *) buffer) + 1))
   34587             continue;
   34588 
   34589         ret_val = xmlSchemaNewMemParserCtxt((const char *)buffer, size);
   34590         desret_xmlSchemaParserCtxtPtr(ret_val);
   34591         call_tests++;
   34592         des_const_char_ptr(n_buffer, (const char *)buffer, 0);
   34593         des_int(n_size, size, 1);
   34594         xmlResetLastError();
   34595         if (mem_base != xmlMemBlocks()) {
   34596             printf("Leak of %d blocks found in xmlSchemaNewMemParserCtxt",
   34597 	           xmlMemBlocks() - mem_base);
   34598 	    test_ret++;
   34599             printf(" %d", n_buffer);
   34600             printf(" %d", n_size);
   34601             printf("\n");
   34602         }
   34603     }
   34604     }
   34605     function_tests++;
   34606 #endif
   34607 
   34608     return(test_ret);
   34609 }
   34610 
   34611 
   34612 static int
   34613 test_xmlSchemaNewParserCtxt(void) {
   34614     int test_ret = 0;
   34615 
   34616 #if defined(LIBXML_SCHEMAS_ENABLED)
   34617     int mem_base;
   34618     xmlSchemaParserCtxtPtr ret_val;
   34619     char * URL; /* the location of the schema */
   34620     int n_URL;
   34621 
   34622     for (n_URL = 0;n_URL < gen_nb_const_char_ptr;n_URL++) {
   34623         mem_base = xmlMemBlocks();
   34624         URL = gen_const_char_ptr(n_URL, 0);
   34625 
   34626         ret_val = xmlSchemaNewParserCtxt((const char *)URL);
   34627         desret_xmlSchemaParserCtxtPtr(ret_val);
   34628         call_tests++;
   34629         des_const_char_ptr(n_URL, (const char *)URL, 0);
   34630         xmlResetLastError();
   34631         if (mem_base != xmlMemBlocks()) {
   34632             printf("Leak of %d blocks found in xmlSchemaNewParserCtxt",
   34633 	           xmlMemBlocks() - mem_base);
   34634 	    test_ret++;
   34635             printf(" %d", n_URL);
   34636             printf("\n");
   34637         }
   34638     }
   34639     function_tests++;
   34640 #endif
   34641 
   34642     return(test_ret);
   34643 }
   34644 
   34645 
   34646 static int
   34647 test_xmlSchemaNewValidCtxt(void) {
   34648     int test_ret = 0;
   34649 
   34650 
   34651     /* missing type support */
   34652     return(test_ret);
   34653 }
   34654 
   34655 
   34656 static int
   34657 test_xmlSchemaParse(void) {
   34658     int test_ret = 0;
   34659 
   34660 
   34661     /* missing type support */
   34662     return(test_ret);
   34663 }
   34664 
   34665 #ifdef LIBXML_SCHEMAS_ENABLED
   34666 
   34667 #define gen_nb_xmlSAXHandlerPtr_ptr 1
   34668 static xmlSAXHandlerPtr * gen_xmlSAXHandlerPtr_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
   34669     return(NULL);
   34670 }
   34671 static void des_xmlSAXHandlerPtr_ptr(int no ATTRIBUTE_UNUSED, xmlSAXHandlerPtr * val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
   34672 }
   34673 #endif
   34674 
   34675 
   34676 static int
   34677 test_xmlSchemaSAXPlug(void) {
   34678     int test_ret = 0;
   34679 
   34680 
   34681     /* missing type support */
   34682     return(test_ret);
   34683 }
   34684 
   34685 #ifdef LIBXML_SCHEMAS_ENABLED
   34686 
   34687 #define gen_nb_xmlSchemaSAXPlugPtr 1
   34688 static xmlSchemaSAXPlugPtr gen_xmlSchemaSAXPlugPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
   34689     return(NULL);
   34690 }
   34691 static void des_xmlSchemaSAXPlugPtr(int no ATTRIBUTE_UNUSED, xmlSchemaSAXPlugPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
   34692 }
   34693 #endif
   34694 
   34695 
   34696 static int
   34697 test_xmlSchemaSAXUnplug(void) {
   34698     int test_ret = 0;
   34699 
   34700 #if defined(LIBXML_SCHEMAS_ENABLED)
   34701     int mem_base;
   34702     int ret_val;
   34703     xmlSchemaSAXPlugPtr plug; /* a data structure returned by xmlSchemaSAXPlug */
   34704     int n_plug;
   34705 
   34706     for (n_plug = 0;n_plug < gen_nb_xmlSchemaSAXPlugPtr;n_plug++) {
   34707         mem_base = xmlMemBlocks();
   34708         plug = gen_xmlSchemaSAXPlugPtr(n_plug, 0);
   34709 
   34710         ret_val = xmlSchemaSAXUnplug(plug);
   34711         desret_int(ret_val);
   34712         call_tests++;
   34713         des_xmlSchemaSAXPlugPtr(n_plug, plug, 0);
   34714         xmlResetLastError();
   34715         if (mem_base != xmlMemBlocks()) {
   34716             printf("Leak of %d blocks found in xmlSchemaSAXUnplug",
   34717 	           xmlMemBlocks() - mem_base);
   34718 	    test_ret++;
   34719             printf(" %d", n_plug);
   34720             printf("\n");
   34721         }
   34722     }
   34723     function_tests++;
   34724 #endif
   34725 
   34726     return(test_ret);
   34727 }
   34728 
   34729 
   34730 static int
   34731 test_xmlSchemaSetParserErrors(void) {
   34732     int test_ret = 0;
   34733 
   34734 
   34735     /* missing type support */
   34736     return(test_ret);
   34737 }
   34738 
   34739 
   34740 static int
   34741 test_xmlSchemaSetParserStructuredErrors(void) {
   34742     int test_ret = 0;
   34743 
   34744 
   34745     /* missing type support */
   34746     return(test_ret);
   34747 }
   34748 
   34749 
   34750 static int
   34751 test_xmlSchemaSetValidErrors(void) {
   34752     int test_ret = 0;
   34753 
   34754 
   34755     /* missing type support */
   34756     return(test_ret);
   34757 }
   34758 
   34759 
   34760 static int
   34761 test_xmlSchemaSetValidOptions(void) {
   34762     int test_ret = 0;
   34763 
   34764 #if defined(LIBXML_SCHEMAS_ENABLED)
   34765     int mem_base;
   34766     int ret_val;
   34767     xmlSchemaValidCtxtPtr ctxt; /* a schema validation context */
   34768     int n_ctxt;
   34769     int options; /* a combination of xmlSchemaValidOption */
   34770     int n_options;
   34771 
   34772     for (n_ctxt = 0;n_ctxt < gen_nb_xmlSchemaValidCtxtPtr;n_ctxt++) {
   34773     for (n_options = 0;n_options < gen_nb_int;n_options++) {
   34774         mem_base = xmlMemBlocks();
   34775         ctxt = gen_xmlSchemaValidCtxtPtr(n_ctxt, 0);
   34776         options = gen_int(n_options, 1);
   34777 
   34778         ret_val = xmlSchemaSetValidOptions(ctxt, options);
   34779         desret_int(ret_val);
   34780         call_tests++;
   34781         des_xmlSchemaValidCtxtPtr(n_ctxt, ctxt, 0);
   34782         des_int(n_options, options, 1);
   34783         xmlResetLastError();
   34784         if (mem_base != xmlMemBlocks()) {
   34785             printf("Leak of %d blocks found in xmlSchemaSetValidOptions",
   34786 	           xmlMemBlocks() - mem_base);
   34787 	    test_ret++;
   34788             printf(" %d", n_ctxt);
   34789             printf(" %d", n_options);
   34790             printf("\n");
   34791         }
   34792     }
   34793     }
   34794     function_tests++;
   34795 #endif
   34796 
   34797     return(test_ret);
   34798 }
   34799 
   34800 
   34801 static int
   34802 test_xmlSchemaSetValidStructuredErrors(void) {
   34803     int test_ret = 0;
   34804 
   34805 
   34806     /* missing type support */
   34807     return(test_ret);
   34808 }
   34809 
   34810 
   34811 static int
   34812 test_xmlSchemaValidCtxtGetOptions(void) {
   34813     int test_ret = 0;
   34814 
   34815 #if defined(LIBXML_SCHEMAS_ENABLED)
   34816     int mem_base;
   34817     int ret_val;
   34818     xmlSchemaValidCtxtPtr ctxt; /* a schema validation context */
   34819     int n_ctxt;
   34820 
   34821     for (n_ctxt = 0;n_ctxt < gen_nb_xmlSchemaValidCtxtPtr;n_ctxt++) {
   34822         mem_base = xmlMemBlocks();
   34823         ctxt = gen_xmlSchemaValidCtxtPtr(n_ctxt, 0);
   34824 
   34825         ret_val = xmlSchemaValidCtxtGetOptions(ctxt);
   34826         desret_int(ret_val);
   34827         call_tests++;
   34828         des_xmlSchemaValidCtxtPtr(n_ctxt, ctxt, 0);
   34829         xmlResetLastError();
   34830         if (mem_base != xmlMemBlocks()) {
   34831             printf("Leak of %d blocks found in xmlSchemaValidCtxtGetOptions",
   34832 	           xmlMemBlocks() - mem_base);
   34833 	    test_ret++;
   34834             printf(" %d", n_ctxt);
   34835             printf("\n");
   34836         }
   34837     }
   34838     function_tests++;
   34839 #endif
   34840 
   34841     return(test_ret);
   34842 }
   34843 
   34844 
   34845 static int
   34846 test_xmlSchemaValidCtxtGetParserCtxt(void) {
   34847     int test_ret = 0;
   34848 
   34849 #if defined(LIBXML_SCHEMAS_ENABLED)
   34850     int mem_base;
   34851     xmlParserCtxtPtr ret_val;
   34852     xmlSchemaValidCtxtPtr ctxt; /* a schema validation context */
   34853     int n_ctxt;
   34854 
   34855     for (n_ctxt = 0;n_ctxt < gen_nb_xmlSchemaValidCtxtPtr;n_ctxt++) {
   34856         mem_base = xmlMemBlocks();
   34857         ctxt = gen_xmlSchemaValidCtxtPtr(n_ctxt, 0);
   34858 
   34859         ret_val = xmlSchemaValidCtxtGetParserCtxt(ctxt);
   34860         desret_xmlParserCtxtPtr(ret_val);
   34861         call_tests++;
   34862         des_xmlSchemaValidCtxtPtr(n_ctxt, ctxt, 0);
   34863         xmlResetLastError();
   34864         if (mem_base != xmlMemBlocks()) {
   34865             printf("Leak of %d blocks found in xmlSchemaValidCtxtGetParserCtxt",
   34866 	           xmlMemBlocks() - mem_base);
   34867 	    test_ret++;
   34868             printf(" %d", n_ctxt);
   34869             printf("\n");
   34870         }
   34871     }
   34872     function_tests++;
   34873 #endif
   34874 
   34875     return(test_ret);
   34876 }
   34877 
   34878 
   34879 static int
   34880 test_xmlSchemaValidateDoc(void) {
   34881     int test_ret = 0;
   34882 
   34883 #if defined(LIBXML_SCHEMAS_ENABLED)
   34884     int mem_base;
   34885     int ret_val;
   34886     xmlSchemaValidCtxtPtr ctxt; /* a schema validation context */
   34887     int n_ctxt;
   34888     xmlDocPtr doc; /* a parsed document tree */
   34889     int n_doc;
   34890 
   34891     for (n_ctxt = 0;n_ctxt < gen_nb_xmlSchemaValidCtxtPtr;n_ctxt++) {
   34892     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
   34893         mem_base = xmlMemBlocks();
   34894         ctxt = gen_xmlSchemaValidCtxtPtr(n_ctxt, 0);
   34895         doc = gen_xmlDocPtr(n_doc, 1);
   34896 
   34897         ret_val = xmlSchemaValidateDoc(ctxt, doc);
   34898         desret_int(ret_val);
   34899         call_tests++;
   34900         des_xmlSchemaValidCtxtPtr(n_ctxt, ctxt, 0);
   34901         des_xmlDocPtr(n_doc, doc, 1);
   34902         xmlResetLastError();
   34903         if (mem_base != xmlMemBlocks()) {
   34904             printf("Leak of %d blocks found in xmlSchemaValidateDoc",
   34905 	           xmlMemBlocks() - mem_base);
   34906 	    test_ret++;
   34907             printf(" %d", n_ctxt);
   34908             printf(" %d", n_doc);
   34909             printf("\n");
   34910         }
   34911     }
   34912     }
   34913     function_tests++;
   34914 #endif
   34915 
   34916     return(test_ret);
   34917 }
   34918 
   34919 
   34920 static int
   34921 test_xmlSchemaValidateFile(void) {
   34922     int test_ret = 0;
   34923 
   34924 #if defined(LIBXML_SCHEMAS_ENABLED)
   34925     int mem_base;
   34926     int ret_val;
   34927     xmlSchemaValidCtxtPtr ctxt; /* a schema validation context */
   34928     int n_ctxt;
   34929     const char * filename; /* the URI of the instance */
   34930     int n_filename;
   34931     int options; /* a future set of options, currently unused */
   34932     int n_options;
   34933 
   34934     for (n_ctxt = 0;n_ctxt < gen_nb_xmlSchemaValidCtxtPtr;n_ctxt++) {
   34935     for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
   34936     for (n_options = 0;n_options < gen_nb_int;n_options++) {
   34937         mem_base = xmlMemBlocks();
   34938         ctxt = gen_xmlSchemaValidCtxtPtr(n_ctxt, 0);
   34939         filename = gen_filepath(n_filename, 1);
   34940         options = gen_int(n_options, 2);
   34941 
   34942         ret_val = xmlSchemaValidateFile(ctxt, filename, options);
   34943         desret_int(ret_val);
   34944         call_tests++;
   34945         des_xmlSchemaValidCtxtPtr(n_ctxt, ctxt, 0);
   34946         des_filepath(n_filename, filename, 1);
   34947         des_int(n_options, options, 2);
   34948         xmlResetLastError();
   34949         if (mem_base != xmlMemBlocks()) {
   34950             printf("Leak of %d blocks found in xmlSchemaValidateFile",
   34951 	           xmlMemBlocks() - mem_base);
   34952 	    test_ret++;
   34953             printf(" %d", n_ctxt);
   34954             printf(" %d", n_filename);
   34955             printf(" %d", n_options);
   34956             printf("\n");
   34957         }
   34958     }
   34959     }
   34960     }
   34961     function_tests++;
   34962 #endif
   34963 
   34964     return(test_ret);
   34965 }
   34966 
   34967 
   34968 static int
   34969 test_xmlSchemaValidateOneElement(void) {
   34970     int test_ret = 0;
   34971 
   34972 #if defined(LIBXML_SCHEMAS_ENABLED)
   34973     int mem_base;
   34974     int ret_val;
   34975     xmlSchemaValidCtxtPtr ctxt; /* a schema validation context */
   34976     int n_ctxt;
   34977     xmlNodePtr elem; /* an element node */
   34978     int n_elem;
   34979 
   34980     for (n_ctxt = 0;n_ctxt < gen_nb_xmlSchemaValidCtxtPtr;n_ctxt++) {
   34981     for (n_elem = 0;n_elem < gen_nb_xmlNodePtr;n_elem++) {
   34982         mem_base = xmlMemBlocks();
   34983         ctxt = gen_xmlSchemaValidCtxtPtr(n_ctxt, 0);
   34984         elem = gen_xmlNodePtr(n_elem, 1);
   34985 
   34986         ret_val = xmlSchemaValidateOneElement(ctxt, elem);
   34987         desret_int(ret_val);
   34988         call_tests++;
   34989         des_xmlSchemaValidCtxtPtr(n_ctxt, ctxt, 0);
   34990         des_xmlNodePtr(n_elem, elem, 1);
   34991         xmlResetLastError();
   34992         if (mem_base != xmlMemBlocks()) {
   34993             printf("Leak of %d blocks found in xmlSchemaValidateOneElement",
   34994 	           xmlMemBlocks() - mem_base);
   34995 	    test_ret++;
   34996             printf(" %d", n_ctxt);
   34997             printf(" %d", n_elem);
   34998             printf("\n");
   34999         }
   35000     }
   35001     }
   35002     function_tests++;
   35003 #endif
   35004 
   35005     return(test_ret);
   35006 }
   35007 
   35008 
   35009 static int
   35010 test_xmlSchemaValidateSetFilename(void) {
   35011     int test_ret = 0;
   35012 
   35013 #if defined(LIBXML_SCHEMAS_ENABLED)
   35014     int mem_base;
   35015     xmlSchemaValidCtxtPtr vctxt; /* the schema validation context */
   35016     int n_vctxt;
   35017     const char * filename; /* the file name */
   35018     int n_filename;
   35019 
   35020     for (n_vctxt = 0;n_vctxt < gen_nb_xmlSchemaValidCtxtPtr;n_vctxt++) {
   35021     for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
   35022         mem_base = xmlMemBlocks();
   35023         vctxt = gen_xmlSchemaValidCtxtPtr(n_vctxt, 0);
   35024         filename = gen_filepath(n_filename, 1);
   35025 
   35026         xmlSchemaValidateSetFilename(vctxt, filename);
   35027         call_tests++;
   35028         des_xmlSchemaValidCtxtPtr(n_vctxt, vctxt, 0);
   35029         des_filepath(n_filename, filename, 1);
   35030         xmlResetLastError();
   35031         if (mem_base != xmlMemBlocks()) {
   35032             printf("Leak of %d blocks found in xmlSchemaValidateSetFilename",
   35033 	           xmlMemBlocks() - mem_base);
   35034 	    test_ret++;
   35035             printf(" %d", n_vctxt);
   35036             printf(" %d", n_filename);
   35037             printf("\n");
   35038         }
   35039     }
   35040     }
   35041     function_tests++;
   35042 #endif
   35043 
   35044     return(test_ret);
   35045 }
   35046 
   35047 
   35048 static int
   35049 test_xmlSchemaValidateSetLocator(void) {
   35050     int test_ret = 0;
   35051 
   35052 
   35053     /* missing type support */
   35054     return(test_ret);
   35055 }
   35056 
   35057 
   35058 static int
   35059 test_xmlSchemaValidateStream(void) {
   35060     int test_ret = 0;
   35061 
   35062 #if defined(LIBXML_SCHEMAS_ENABLED)
   35063     int mem_base;
   35064     int ret_val;
   35065     xmlSchemaValidCtxtPtr ctxt; /* a schema validation context */
   35066     int n_ctxt;
   35067     xmlParserInputBufferPtr input; /* the input to use for reading the data */
   35068     int n_input;
   35069     xmlCharEncoding enc; /* an optional encoding information */
   35070     int n_enc;
   35071     xmlSAXHandlerPtr sax; /* a SAX handler for the resulting events */
   35072     int n_sax;
   35073     void * user_data; /* the context to provide to the SAX handler. */
   35074     int n_user_data;
   35075 
   35076     for (n_ctxt = 0;n_ctxt < gen_nb_xmlSchemaValidCtxtPtr;n_ctxt++) {
   35077     for (n_input = 0;n_input < gen_nb_xmlParserInputBufferPtr;n_input++) {
   35078     for (n_enc = 0;n_enc < gen_nb_xmlCharEncoding;n_enc++) {
   35079     for (n_sax = 0;n_sax < gen_nb_xmlSAXHandlerPtr;n_sax++) {
   35080     for (n_user_data = 0;n_user_data < gen_nb_userdata;n_user_data++) {
   35081         mem_base = xmlMemBlocks();
   35082         ctxt = gen_xmlSchemaValidCtxtPtr(n_ctxt, 0);
   35083         input = gen_xmlParserInputBufferPtr(n_input, 1);
   35084         enc = gen_xmlCharEncoding(n_enc, 2);
   35085         sax = gen_xmlSAXHandlerPtr(n_sax, 3);
   35086         user_data = gen_userdata(n_user_data, 4);
   35087 
   35088         ret_val = xmlSchemaValidateStream(ctxt, input, enc, sax, user_data);
   35089         desret_int(ret_val);
   35090         call_tests++;
   35091         des_xmlSchemaValidCtxtPtr(n_ctxt, ctxt, 0);
   35092         des_xmlParserInputBufferPtr(n_input, input, 1);
   35093         des_xmlCharEncoding(n_enc, enc, 2);
   35094         des_xmlSAXHandlerPtr(n_sax, sax, 3);
   35095         des_userdata(n_user_data, user_data, 4);
   35096         xmlResetLastError();
   35097         if (mem_base != xmlMemBlocks()) {
   35098             printf("Leak of %d blocks found in xmlSchemaValidateStream",
   35099 	           xmlMemBlocks() - mem_base);
   35100 	    test_ret++;
   35101             printf(" %d", n_ctxt);
   35102             printf(" %d", n_input);
   35103             printf(" %d", n_enc);
   35104             printf(" %d", n_sax);
   35105             printf(" %d", n_user_data);
   35106             printf("\n");
   35107         }
   35108     }
   35109     }
   35110     }
   35111     }
   35112     }
   35113     function_tests++;
   35114 #endif
   35115 
   35116     return(test_ret);
   35117 }
   35118 
   35119 static int
   35120 test_xmlschemas(void) {
   35121     int test_ret = 0;
   35122 
   35123     if (quiet == 0) printf("Testing xmlschemas : 16 of 27 functions ...\n");
   35124     test_ret += test_xmlSchemaDump();
   35125     test_ret += test_xmlSchemaGetParserErrors();
   35126     test_ret += test_xmlSchemaGetValidErrors();
   35127     test_ret += test_xmlSchemaIsValid();
   35128     test_ret += test_xmlSchemaNewDocParserCtxt();
   35129     test_ret += test_xmlSchemaNewMemParserCtxt();
   35130     test_ret += test_xmlSchemaNewParserCtxt();
   35131     test_ret += test_xmlSchemaNewValidCtxt();
   35132     test_ret += test_xmlSchemaParse();
   35133     test_ret += test_xmlSchemaSAXPlug();
   35134     test_ret += test_xmlSchemaSAXUnplug();
   35135     test_ret += test_xmlSchemaSetParserErrors();
   35136     test_ret += test_xmlSchemaSetParserStructuredErrors();
   35137     test_ret += test_xmlSchemaSetValidErrors();
   35138     test_ret += test_xmlSchemaSetValidOptions();
   35139     test_ret += test_xmlSchemaSetValidStructuredErrors();
   35140     test_ret += test_xmlSchemaValidCtxtGetOptions();
   35141     test_ret += test_xmlSchemaValidCtxtGetParserCtxt();
   35142     test_ret += test_xmlSchemaValidateDoc();
   35143     test_ret += test_xmlSchemaValidateFile();
   35144     test_ret += test_xmlSchemaValidateOneElement();
   35145     test_ret += test_xmlSchemaValidateSetFilename();
   35146     test_ret += test_xmlSchemaValidateSetLocator();
   35147     test_ret += test_xmlSchemaValidateStream();
   35148 
   35149     if (test_ret != 0)
   35150 	printf("Module xmlschemas: %d errors\n", test_ret);
   35151     return(test_ret);
   35152 }
   35153 #ifdef LIBXML_SCHEMAS_ENABLED
   35154 
   35155 #define gen_nb_xmlSchemaFacetPtr 1
   35156 static xmlSchemaFacetPtr gen_xmlSchemaFacetPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
   35157     return(NULL);
   35158 }
   35159 static void des_xmlSchemaFacetPtr(int no ATTRIBUTE_UNUSED, xmlSchemaFacetPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
   35160 }
   35161 #endif
   35162 
   35163 #ifdef LIBXML_SCHEMAS_ENABLED
   35164 
   35165 #define gen_nb_xmlSchemaTypePtr 1
   35166 static xmlSchemaTypePtr gen_xmlSchemaTypePtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
   35167     return(NULL);
   35168 }
   35169 static void des_xmlSchemaTypePtr(int no ATTRIBUTE_UNUSED, xmlSchemaTypePtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
   35170 }
   35171 #endif
   35172 
   35173 
   35174 static int
   35175 test_xmlSchemaCheckFacet(void) {
   35176     int test_ret = 0;
   35177 
   35178 #if defined(LIBXML_SCHEMAS_ENABLED)
   35179     int mem_base;
   35180     int ret_val;
   35181     xmlSchemaFacetPtr facet; /* the facet */
   35182     int n_facet;
   35183     xmlSchemaTypePtr typeDecl; /* the schema type definition */
   35184     int n_typeDecl;
   35185     xmlSchemaParserCtxtPtr pctxt; /* the schema parser context or NULL */
   35186     int n_pctxt;
   35187     xmlChar * name; /* the optional name of the type */
   35188     int n_name;
   35189 
   35190     for (n_facet = 0;n_facet < gen_nb_xmlSchemaFacetPtr;n_facet++) {
   35191     for (n_typeDecl = 0;n_typeDecl < gen_nb_xmlSchemaTypePtr;n_typeDecl++) {
   35192     for (n_pctxt = 0;n_pctxt < gen_nb_xmlSchemaParserCtxtPtr;n_pctxt++) {
   35193     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
   35194         mem_base = xmlMemBlocks();
   35195         facet = gen_xmlSchemaFacetPtr(n_facet, 0);
   35196         typeDecl = gen_xmlSchemaTypePtr(n_typeDecl, 1);
   35197         pctxt = gen_xmlSchemaParserCtxtPtr(n_pctxt, 2);
   35198         name = gen_const_xmlChar_ptr(n_name, 3);
   35199 
   35200         ret_val = xmlSchemaCheckFacet(facet, typeDecl, pctxt, (const xmlChar *)name);
   35201         desret_int(ret_val);
   35202         call_tests++;
   35203         des_xmlSchemaFacetPtr(n_facet, facet, 0);
   35204         des_xmlSchemaTypePtr(n_typeDecl, typeDecl, 1);
   35205         des_xmlSchemaParserCtxtPtr(n_pctxt, pctxt, 2);
   35206         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 3);
   35207         xmlResetLastError();
   35208         if (mem_base != xmlMemBlocks()) {
   35209             printf("Leak of %d blocks found in xmlSchemaCheckFacet",
   35210 	           xmlMemBlocks() - mem_base);
   35211 	    test_ret++;
   35212             printf(" %d", n_facet);
   35213             printf(" %d", n_typeDecl);
   35214             printf(" %d", n_pctxt);
   35215             printf(" %d", n_name);
   35216             printf("\n");
   35217         }
   35218     }
   35219     }
   35220     }
   35221     }
   35222     function_tests++;
   35223 #endif
   35224 
   35225     return(test_ret);
   35226 }
   35227 
   35228 
   35229 static int
   35230 test_xmlSchemaCleanupTypes(void) {
   35231     int test_ret = 0;
   35232 
   35233 #if defined(LIBXML_SCHEMAS_ENABLED)
   35234 
   35235 
   35236         xmlSchemaCleanupTypes();
   35237         call_tests++;
   35238         xmlResetLastError();
   35239     function_tests++;
   35240 #endif
   35241 
   35242     return(test_ret);
   35243 }
   35244 
   35245 
   35246 static int
   35247 test_xmlSchemaCollapseString(void) {
   35248     int test_ret = 0;
   35249 
   35250 #if defined(LIBXML_SCHEMAS_ENABLED)
   35251     int mem_base;
   35252     xmlChar * ret_val;
   35253     xmlChar * value; /* a value */
   35254     int n_value;
   35255 
   35256     for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
   35257         mem_base = xmlMemBlocks();
   35258         value = gen_const_xmlChar_ptr(n_value, 0);
   35259 
   35260         ret_val = xmlSchemaCollapseString((const xmlChar *)value);
   35261         desret_xmlChar_ptr(ret_val);
   35262         call_tests++;
   35263         des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 0);
   35264         xmlResetLastError();
   35265         if (mem_base != xmlMemBlocks()) {
   35266             printf("Leak of %d blocks found in xmlSchemaCollapseString",
   35267 	           xmlMemBlocks() - mem_base);
   35268 	    test_ret++;
   35269             printf(" %d", n_value);
   35270             printf("\n");
   35271         }
   35272     }
   35273     function_tests++;
   35274 #endif
   35275 
   35276     return(test_ret);
   35277 }
   35278 
   35279 #ifdef LIBXML_SCHEMAS_ENABLED
   35280 
   35281 #define gen_nb_xmlSchemaValPtr 1
   35282 static xmlSchemaValPtr gen_xmlSchemaValPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
   35283     return(NULL);
   35284 }
   35285 static void des_xmlSchemaValPtr(int no ATTRIBUTE_UNUSED, xmlSchemaValPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
   35286 }
   35287 #endif
   35288 
   35289 
   35290 static int
   35291 test_xmlSchemaCompareValues(void) {
   35292     int test_ret = 0;
   35293 
   35294 #if defined(LIBXML_SCHEMAS_ENABLED)
   35295     int mem_base;
   35296     int ret_val;
   35297     xmlSchemaValPtr x; /* a first value */
   35298     int n_x;
   35299     xmlSchemaValPtr y; /* a second value */
   35300     int n_y;
   35301 
   35302     for (n_x = 0;n_x < gen_nb_xmlSchemaValPtr;n_x++) {
   35303     for (n_y = 0;n_y < gen_nb_xmlSchemaValPtr;n_y++) {
   35304         mem_base = xmlMemBlocks();
   35305         x = gen_xmlSchemaValPtr(n_x, 0);
   35306         y = gen_xmlSchemaValPtr(n_y, 1);
   35307 
   35308         ret_val = xmlSchemaCompareValues(x, y);
   35309         desret_int(ret_val);
   35310         call_tests++;
   35311         des_xmlSchemaValPtr(n_x, x, 0);
   35312         des_xmlSchemaValPtr(n_y, y, 1);
   35313         xmlResetLastError();
   35314         if (mem_base != xmlMemBlocks()) {
   35315             printf("Leak of %d blocks found in xmlSchemaCompareValues",
   35316 	           xmlMemBlocks() - mem_base);
   35317 	    test_ret++;
   35318             printf(" %d", n_x);
   35319             printf(" %d", n_y);
   35320             printf("\n");
   35321         }
   35322     }
   35323     }
   35324     function_tests++;
   35325 #endif
   35326 
   35327     return(test_ret);
   35328 }
   35329 
   35330 
   35331 static int
   35332 test_xmlSchemaCompareValuesWhtsp(void) {
   35333     int test_ret = 0;
   35334 
   35335 #if defined(LIBXML_SCHEMAS_ENABLED)
   35336     int mem_base;
   35337     int ret_val;
   35338     xmlSchemaValPtr x; /* a first value */
   35339     int n_x;
   35340     xmlSchemaWhitespaceValueType xws; /* the whitespace value of x */
   35341     int n_xws;
   35342     xmlSchemaValPtr y; /* a second value */
   35343     int n_y;
   35344     xmlSchemaWhitespaceValueType yws; /* the whitespace value of y */
   35345     int n_yws;
   35346 
   35347     for (n_x = 0;n_x < gen_nb_xmlSchemaValPtr;n_x++) {
   35348     for (n_xws = 0;n_xws < gen_nb_xmlSchemaWhitespaceValueType;n_xws++) {
   35349     for (n_y = 0;n_y < gen_nb_xmlSchemaValPtr;n_y++) {
   35350     for (n_yws = 0;n_yws < gen_nb_xmlSchemaWhitespaceValueType;n_yws++) {
   35351         mem_base = xmlMemBlocks();
   35352         x = gen_xmlSchemaValPtr(n_x, 0);
   35353         xws = gen_xmlSchemaWhitespaceValueType(n_xws, 1);
   35354         y = gen_xmlSchemaValPtr(n_y, 2);
   35355         yws = gen_xmlSchemaWhitespaceValueType(n_yws, 3);
   35356 
   35357         ret_val = xmlSchemaCompareValuesWhtsp(x, xws, y, yws);
   35358         desret_int(ret_val);
   35359         call_tests++;
   35360         des_xmlSchemaValPtr(n_x, x, 0);
   35361         des_xmlSchemaWhitespaceValueType(n_xws, xws, 1);
   35362         des_xmlSchemaValPtr(n_y, y, 2);
   35363         des_xmlSchemaWhitespaceValueType(n_yws, yws, 3);
   35364         xmlResetLastError();
   35365         if (mem_base != xmlMemBlocks()) {
   35366             printf("Leak of %d blocks found in xmlSchemaCompareValuesWhtsp",
   35367 	           xmlMemBlocks() - mem_base);
   35368 	    test_ret++;
   35369             printf(" %d", n_x);
   35370             printf(" %d", n_xws);
   35371             printf(" %d", n_y);
   35372             printf(" %d", n_yws);
   35373             printf("\n");
   35374         }
   35375     }
   35376     }
   35377     }
   35378     }
   35379     function_tests++;
   35380 #endif
   35381 
   35382     return(test_ret);
   35383 }
   35384 
   35385 
   35386 static int
   35387 test_xmlSchemaCopyValue(void) {
   35388     int test_ret = 0;
   35389 
   35390 
   35391     /* missing type support */
   35392     return(test_ret);
   35393 }
   35394 
   35395 
   35396 static int
   35397 test_xmlSchemaGetBuiltInListSimpleTypeItemType(void) {
   35398     int test_ret = 0;
   35399 
   35400 #if defined(LIBXML_SCHEMAS_ENABLED)
   35401     int mem_base;
   35402     xmlSchemaTypePtr ret_val;
   35403     xmlSchemaTypePtr type; /* the built-in simple type. */
   35404     int n_type;
   35405 
   35406     for (n_type = 0;n_type < gen_nb_xmlSchemaTypePtr;n_type++) {
   35407         mem_base = xmlMemBlocks();
   35408         type = gen_xmlSchemaTypePtr(n_type, 0);
   35409 
   35410         ret_val = xmlSchemaGetBuiltInListSimpleTypeItemType(type);
   35411         desret_xmlSchemaTypePtr(ret_val);
   35412         call_tests++;
   35413         des_xmlSchemaTypePtr(n_type, type, 0);
   35414         xmlResetLastError();
   35415         if (mem_base != xmlMemBlocks()) {
   35416             printf("Leak of %d blocks found in xmlSchemaGetBuiltInListSimpleTypeItemType",
   35417 	           xmlMemBlocks() - mem_base);
   35418 	    test_ret++;
   35419             printf(" %d", n_type);
   35420             printf("\n");
   35421         }
   35422     }
   35423     function_tests++;
   35424 #endif
   35425 
   35426     return(test_ret);
   35427 }
   35428 
   35429 
   35430 static int
   35431 test_xmlSchemaGetBuiltInType(void) {
   35432     int test_ret = 0;
   35433 
   35434 #if defined(LIBXML_SCHEMAS_ENABLED)
   35435     xmlSchemaTypePtr ret_val;
   35436     xmlSchemaValType type; /* the type of the built in type */
   35437     int n_type;
   35438 
   35439     for (n_type = 0;n_type < gen_nb_xmlSchemaValType;n_type++) {
   35440         type = gen_xmlSchemaValType(n_type, 0);
   35441 
   35442         ret_val = xmlSchemaGetBuiltInType(type);
   35443         desret_xmlSchemaTypePtr(ret_val);
   35444         call_tests++;
   35445         des_xmlSchemaValType(n_type, type, 0);
   35446         xmlResetLastError();
   35447     }
   35448     function_tests++;
   35449 #endif
   35450 
   35451     return(test_ret);
   35452 }
   35453 
   35454 
   35455 static int
   35456 test_xmlSchemaGetCanonValue(void) {
   35457     int test_ret = 0;
   35458 
   35459 #if defined(LIBXML_SCHEMAS_ENABLED)
   35460     int mem_base;
   35461     int ret_val;
   35462     xmlSchemaValPtr val; /* the precomputed value */
   35463     int n_val;
   35464     xmlChar ** retValue; /* the returned value */
   35465     int n_retValue;
   35466 
   35467     for (n_val = 0;n_val < gen_nb_xmlSchemaValPtr;n_val++) {
   35468     for (n_retValue = 0;n_retValue < gen_nb_const_xmlChar_ptr_ptr;n_retValue++) {
   35469         mem_base = xmlMemBlocks();
   35470         val = gen_xmlSchemaValPtr(n_val, 0);
   35471         retValue = gen_const_xmlChar_ptr_ptr(n_retValue, 1);
   35472 
   35473         ret_val = xmlSchemaGetCanonValue(val, (const xmlChar **)retValue);
   35474         desret_int(ret_val);
   35475         call_tests++;
   35476         des_xmlSchemaValPtr(n_val, val, 0);
   35477         des_const_xmlChar_ptr_ptr(n_retValue, (const xmlChar **)retValue, 1);
   35478         xmlResetLastError();
   35479         if (mem_base != xmlMemBlocks()) {
   35480             printf("Leak of %d blocks found in xmlSchemaGetCanonValue",
   35481 	           xmlMemBlocks() - mem_base);
   35482 	    test_ret++;
   35483             printf(" %d", n_val);
   35484             printf(" %d", n_retValue);
   35485             printf("\n");
   35486         }
   35487     }
   35488     }
   35489     function_tests++;
   35490 #endif
   35491 
   35492     return(test_ret);
   35493 }
   35494 
   35495 
   35496 static int
   35497 test_xmlSchemaGetCanonValueWhtsp(void) {
   35498     int test_ret = 0;
   35499 
   35500 #if defined(LIBXML_SCHEMAS_ENABLED)
   35501     int mem_base;
   35502     int ret_val;
   35503     xmlSchemaValPtr val; /* the precomputed value */
   35504     int n_val;
   35505     xmlChar ** retValue; /* the returned value */
   35506     int n_retValue;
   35507     xmlSchemaWhitespaceValueType ws; /* the whitespace type of the value */
   35508     int n_ws;
   35509 
   35510     for (n_val = 0;n_val < gen_nb_xmlSchemaValPtr;n_val++) {
   35511     for (n_retValue = 0;n_retValue < gen_nb_const_xmlChar_ptr_ptr;n_retValue++) {
   35512     for (n_ws = 0;n_ws < gen_nb_xmlSchemaWhitespaceValueType;n_ws++) {
   35513         mem_base = xmlMemBlocks();
   35514         val = gen_xmlSchemaValPtr(n_val, 0);
   35515         retValue = gen_const_xmlChar_ptr_ptr(n_retValue, 1);
   35516         ws = gen_xmlSchemaWhitespaceValueType(n_ws, 2);
   35517 
   35518         ret_val = xmlSchemaGetCanonValueWhtsp(val, (const xmlChar **)retValue, ws);
   35519         desret_int(ret_val);
   35520         call_tests++;
   35521         des_xmlSchemaValPtr(n_val, val, 0);
   35522         des_const_xmlChar_ptr_ptr(n_retValue, (const xmlChar **)retValue, 1);
   35523         des_xmlSchemaWhitespaceValueType(n_ws, ws, 2);
   35524         xmlResetLastError();
   35525         if (mem_base != xmlMemBlocks()) {
   35526             printf("Leak of %d blocks found in xmlSchemaGetCanonValueWhtsp",
   35527 	           xmlMemBlocks() - mem_base);
   35528 	    test_ret++;
   35529             printf(" %d", n_val);
   35530             printf(" %d", n_retValue);
   35531             printf(" %d", n_ws);
   35532             printf("\n");
   35533         }
   35534     }
   35535     }
   35536     }
   35537     function_tests++;
   35538 #endif
   35539 
   35540     return(test_ret);
   35541 }
   35542 
   35543 
   35544 static int
   35545 test_xmlSchemaGetFacetValueAsULong(void) {
   35546     int test_ret = 0;
   35547 
   35548 #if defined(LIBXML_SCHEMAS_ENABLED)
   35549     int mem_base;
   35550     unsigned long ret_val;
   35551     xmlSchemaFacetPtr facet; /* an schemas type facet */
   35552     int n_facet;
   35553 
   35554     for (n_facet = 0;n_facet < gen_nb_xmlSchemaFacetPtr;n_facet++) {
   35555         mem_base = xmlMemBlocks();
   35556         facet = gen_xmlSchemaFacetPtr(n_facet, 0);
   35557 
   35558         ret_val = xmlSchemaGetFacetValueAsULong(facet);
   35559         desret_unsigned_long(ret_val);
   35560         call_tests++;
   35561         des_xmlSchemaFacetPtr(n_facet, facet, 0);
   35562         xmlResetLastError();
   35563         if (mem_base != xmlMemBlocks()) {
   35564             printf("Leak of %d blocks found in xmlSchemaGetFacetValueAsULong",
   35565 	           xmlMemBlocks() - mem_base);
   35566 	    test_ret++;
   35567             printf(" %d", n_facet);
   35568             printf("\n");
   35569         }
   35570     }
   35571     function_tests++;
   35572 #endif
   35573 
   35574     return(test_ret);
   35575 }
   35576 
   35577 
   35578 static int
   35579 test_xmlSchemaGetPredefinedType(void) {
   35580     int test_ret = 0;
   35581 
   35582 #if defined(LIBXML_SCHEMAS_ENABLED)
   35583     int mem_base;
   35584     xmlSchemaTypePtr ret_val;
   35585     xmlChar * name; /* the type name */
   35586     int n_name;
   35587     xmlChar * ns; /* the URI of the namespace usually "http://www.w3.org/2001/XMLSchema" */
   35588     int n_ns;
   35589 
   35590     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
   35591     for (n_ns = 0;n_ns < gen_nb_const_xmlChar_ptr;n_ns++) {
   35592         mem_base = xmlMemBlocks();
   35593         name = gen_const_xmlChar_ptr(n_name, 0);
   35594         ns = gen_const_xmlChar_ptr(n_ns, 1);
   35595 
   35596         ret_val = xmlSchemaGetPredefinedType((const xmlChar *)name, (const xmlChar *)ns);
   35597         desret_xmlSchemaTypePtr(ret_val);
   35598         call_tests++;
   35599         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 0);
   35600         des_const_xmlChar_ptr(n_ns, (const xmlChar *)ns, 1);
   35601         xmlResetLastError();
   35602         if (mem_base != xmlMemBlocks()) {
   35603             printf("Leak of %d blocks found in xmlSchemaGetPredefinedType",
   35604 	           xmlMemBlocks() - mem_base);
   35605 	    test_ret++;
   35606             printf(" %d", n_name);
   35607             printf(" %d", n_ns);
   35608             printf("\n");
   35609         }
   35610     }
   35611     }
   35612     function_tests++;
   35613 #endif
   35614 
   35615     return(test_ret);
   35616 }
   35617 
   35618 
   35619 static int
   35620 test_xmlSchemaGetValType(void) {
   35621     int test_ret = 0;
   35622 
   35623 #if defined(LIBXML_SCHEMAS_ENABLED)
   35624     int mem_base;
   35625     xmlSchemaValType ret_val;
   35626     xmlSchemaValPtr val; /* a schemas value */
   35627     int n_val;
   35628 
   35629     for (n_val = 0;n_val < gen_nb_xmlSchemaValPtr;n_val++) {
   35630         mem_base = xmlMemBlocks();
   35631         val = gen_xmlSchemaValPtr(n_val, 0);
   35632 
   35633         ret_val = xmlSchemaGetValType(val);
   35634         desret_xmlSchemaValType(ret_val);
   35635         call_tests++;
   35636         des_xmlSchemaValPtr(n_val, val, 0);
   35637         xmlResetLastError();
   35638         if (mem_base != xmlMemBlocks()) {
   35639             printf("Leak of %d blocks found in xmlSchemaGetValType",
   35640 	           xmlMemBlocks() - mem_base);
   35641 	    test_ret++;
   35642             printf(" %d", n_val);
   35643             printf("\n");
   35644         }
   35645     }
   35646     function_tests++;
   35647 #endif
   35648 
   35649     return(test_ret);
   35650 }
   35651 
   35652 
   35653 static int
   35654 test_xmlSchemaInitTypes(void) {
   35655     int test_ret = 0;
   35656 
   35657 #if defined(LIBXML_SCHEMAS_ENABLED)
   35658 
   35659 
   35660         xmlSchemaInitTypes();
   35661         call_tests++;
   35662         xmlResetLastError();
   35663     function_tests++;
   35664 #endif
   35665 
   35666     return(test_ret);
   35667 }
   35668 
   35669 
   35670 static int
   35671 test_xmlSchemaIsBuiltInTypeFacet(void) {
   35672     int test_ret = 0;
   35673 
   35674 #if defined(LIBXML_SCHEMAS_ENABLED)
   35675     int mem_base;
   35676     int ret_val;
   35677     xmlSchemaTypePtr type; /* the built-in type */
   35678     int n_type;
   35679     int facetType; /* the facet type */
   35680     int n_facetType;
   35681 
   35682     for (n_type = 0;n_type < gen_nb_xmlSchemaTypePtr;n_type++) {
   35683     for (n_facetType = 0;n_facetType < gen_nb_int;n_facetType++) {
   35684         mem_base = xmlMemBlocks();
   35685         type = gen_xmlSchemaTypePtr(n_type, 0);
   35686         facetType = gen_int(n_facetType, 1);
   35687 
   35688         ret_val = xmlSchemaIsBuiltInTypeFacet(type, facetType);
   35689         desret_int(ret_val);
   35690         call_tests++;
   35691         des_xmlSchemaTypePtr(n_type, type, 0);
   35692         des_int(n_facetType, facetType, 1);
   35693         xmlResetLastError();
   35694         if (mem_base != xmlMemBlocks()) {
   35695             printf("Leak of %d blocks found in xmlSchemaIsBuiltInTypeFacet",
   35696 	           xmlMemBlocks() - mem_base);
   35697 	    test_ret++;
   35698             printf(" %d", n_type);
   35699             printf(" %d", n_facetType);
   35700             printf("\n");
   35701         }
   35702     }
   35703     }
   35704     function_tests++;
   35705 #endif
   35706 
   35707     return(test_ret);
   35708 }
   35709 
   35710 
   35711 static int
   35712 test_xmlSchemaNewFacet(void) {
   35713     int test_ret = 0;
   35714 
   35715 
   35716     /* missing type support */
   35717     return(test_ret);
   35718 }
   35719 
   35720 
   35721 static int
   35722 test_xmlSchemaNewNOTATIONValue(void) {
   35723     int test_ret = 0;
   35724 
   35725 
   35726     /* missing type support */
   35727     return(test_ret);
   35728 }
   35729 
   35730 
   35731 static int
   35732 test_xmlSchemaNewQNameValue(void) {
   35733     int test_ret = 0;
   35734 
   35735 
   35736     /* missing type support */
   35737     return(test_ret);
   35738 }
   35739 
   35740 
   35741 static int
   35742 test_xmlSchemaNewStringValue(void) {
   35743     int test_ret = 0;
   35744 
   35745 
   35746     /* missing type support */
   35747     return(test_ret);
   35748 }
   35749 
   35750 #ifdef LIBXML_SCHEMAS_ENABLED
   35751 
   35752 #define gen_nb_xmlSchemaValPtr_ptr 1
   35753 static xmlSchemaValPtr * gen_xmlSchemaValPtr_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
   35754     return(NULL);
   35755 }
   35756 static void des_xmlSchemaValPtr_ptr(int no ATTRIBUTE_UNUSED, xmlSchemaValPtr * val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
   35757 }
   35758 #endif
   35759 
   35760 
   35761 static int
   35762 test_xmlSchemaValPredefTypeNode(void) {
   35763     int test_ret = 0;
   35764 
   35765 #if defined(LIBXML_SCHEMAS_ENABLED)
   35766     int mem_base;
   35767     int ret_val;
   35768     xmlSchemaTypePtr type; /* the predefined type */
   35769     int n_type;
   35770     xmlChar * value; /* the value to check */
   35771     int n_value;
   35772     xmlSchemaValPtr * val; /* the return computed value */
   35773     int n_val;
   35774     xmlNodePtr node; /* the node containing the value */
   35775     int n_node;
   35776 
   35777     for (n_type = 0;n_type < gen_nb_xmlSchemaTypePtr;n_type++) {
   35778     for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
   35779     for (n_val = 0;n_val < gen_nb_xmlSchemaValPtr_ptr;n_val++) {
   35780     for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
   35781         mem_base = xmlMemBlocks();
   35782         type = gen_xmlSchemaTypePtr(n_type, 0);
   35783         value = gen_const_xmlChar_ptr(n_value, 1);
   35784         val = gen_xmlSchemaValPtr_ptr(n_val, 2);
   35785         node = gen_xmlNodePtr(n_node, 3);
   35786 
   35787         ret_val = xmlSchemaValPredefTypeNode(type, (const xmlChar *)value, val, node);
   35788         desret_int(ret_val);
   35789         call_tests++;
   35790         des_xmlSchemaTypePtr(n_type, type, 0);
   35791         des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 1);
   35792         des_xmlSchemaValPtr_ptr(n_val, val, 2);
   35793         des_xmlNodePtr(n_node, node, 3);
   35794         xmlResetLastError();
   35795         if (mem_base != xmlMemBlocks()) {
   35796             printf("Leak of %d blocks found in xmlSchemaValPredefTypeNode",
   35797 	           xmlMemBlocks() - mem_base);
   35798 	    test_ret++;
   35799             printf(" %d", n_type);
   35800             printf(" %d", n_value);
   35801             printf(" %d", n_val);
   35802             printf(" %d", n_node);
   35803             printf("\n");
   35804         }
   35805     }
   35806     }
   35807     }
   35808     }
   35809     function_tests++;
   35810 #endif
   35811 
   35812     return(test_ret);
   35813 }
   35814 
   35815 
   35816 static int
   35817 test_xmlSchemaValPredefTypeNodeNoNorm(void) {
   35818     int test_ret = 0;
   35819 
   35820 #if defined(LIBXML_SCHEMAS_ENABLED)
   35821     int mem_base;
   35822     int ret_val;
   35823     xmlSchemaTypePtr type; /* the predefined type */
   35824     int n_type;
   35825     xmlChar * value; /* the value to check */
   35826     int n_value;
   35827     xmlSchemaValPtr * val; /* the return computed value */
   35828     int n_val;
   35829     xmlNodePtr node; /* the node containing the value */
   35830     int n_node;
   35831 
   35832     for (n_type = 0;n_type < gen_nb_xmlSchemaTypePtr;n_type++) {
   35833     for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
   35834     for (n_val = 0;n_val < gen_nb_xmlSchemaValPtr_ptr;n_val++) {
   35835     for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
   35836         mem_base = xmlMemBlocks();
   35837         type = gen_xmlSchemaTypePtr(n_type, 0);
   35838         value = gen_const_xmlChar_ptr(n_value, 1);
   35839         val = gen_xmlSchemaValPtr_ptr(n_val, 2);
   35840         node = gen_xmlNodePtr(n_node, 3);
   35841 
   35842         ret_val = xmlSchemaValPredefTypeNodeNoNorm(type, (const xmlChar *)value, val, node);
   35843         desret_int(ret_val);
   35844         call_tests++;
   35845         des_xmlSchemaTypePtr(n_type, type, 0);
   35846         des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 1);
   35847         des_xmlSchemaValPtr_ptr(n_val, val, 2);
   35848         des_xmlNodePtr(n_node, node, 3);
   35849         xmlResetLastError();
   35850         if (mem_base != xmlMemBlocks()) {
   35851             printf("Leak of %d blocks found in xmlSchemaValPredefTypeNodeNoNorm",
   35852 	           xmlMemBlocks() - mem_base);
   35853 	    test_ret++;
   35854             printf(" %d", n_type);
   35855             printf(" %d", n_value);
   35856             printf(" %d", n_val);
   35857             printf(" %d", n_node);
   35858             printf("\n");
   35859         }
   35860     }
   35861     }
   35862     }
   35863     }
   35864     function_tests++;
   35865 #endif
   35866 
   35867     return(test_ret);
   35868 }
   35869 
   35870 
   35871 static int
   35872 test_xmlSchemaValidateFacet(void) {
   35873     int test_ret = 0;
   35874 
   35875 #if defined(LIBXML_SCHEMAS_ENABLED)
   35876     int mem_base;
   35877     int ret_val;
   35878     xmlSchemaTypePtr base; /* the base type */
   35879     int n_base;
   35880     xmlSchemaFacetPtr facet; /* the facet to check */
   35881     int n_facet;
   35882     xmlChar * value; /* the lexical repr of the value to validate */
   35883     int n_value;
   35884     xmlSchemaValPtr val; /* the precomputed value */
   35885     int n_val;
   35886 
   35887     for (n_base = 0;n_base < gen_nb_xmlSchemaTypePtr;n_base++) {
   35888     for (n_facet = 0;n_facet < gen_nb_xmlSchemaFacetPtr;n_facet++) {
   35889     for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
   35890     for (n_val = 0;n_val < gen_nb_xmlSchemaValPtr;n_val++) {
   35891         mem_base = xmlMemBlocks();
   35892         base = gen_xmlSchemaTypePtr(n_base, 0);
   35893         facet = gen_xmlSchemaFacetPtr(n_facet, 1);
   35894         value = gen_const_xmlChar_ptr(n_value, 2);
   35895         val = gen_xmlSchemaValPtr(n_val, 3);
   35896 
   35897         ret_val = xmlSchemaValidateFacet(base, facet, (const xmlChar *)value, val);
   35898         desret_int(ret_val);
   35899         call_tests++;
   35900         des_xmlSchemaTypePtr(n_base, base, 0);
   35901         des_xmlSchemaFacetPtr(n_facet, facet, 1);
   35902         des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 2);
   35903         des_xmlSchemaValPtr(n_val, val, 3);
   35904         xmlResetLastError();
   35905         if (mem_base != xmlMemBlocks()) {
   35906             printf("Leak of %d blocks found in xmlSchemaValidateFacet",
   35907 	           xmlMemBlocks() - mem_base);
   35908 	    test_ret++;
   35909             printf(" %d", n_base);
   35910             printf(" %d", n_facet);
   35911             printf(" %d", n_value);
   35912             printf(" %d", n_val);
   35913             printf("\n");
   35914         }
   35915     }
   35916     }
   35917     }
   35918     }
   35919     function_tests++;
   35920 #endif
   35921 
   35922     return(test_ret);
   35923 }
   35924 
   35925 
   35926 static int
   35927 test_xmlSchemaValidateFacetWhtsp(void) {
   35928     int test_ret = 0;
   35929 
   35930 #if defined(LIBXML_SCHEMAS_ENABLED)
   35931     int mem_base;
   35932     int ret_val;
   35933     xmlSchemaFacetPtr facet; /* the facet to check */
   35934     int n_facet;
   35935     xmlSchemaWhitespaceValueType fws; /* the whitespace type of the facet's value */
   35936     int n_fws;
   35937     xmlSchemaValType valType; /* the built-in type of the value */
   35938     int n_valType;
   35939     xmlChar * value; /* the lexical (or normalized for pattern) repr of the value to validate */
   35940     int n_value;
   35941     xmlSchemaValPtr val; /* the precomputed value */
   35942     int n_val;
   35943     xmlSchemaWhitespaceValueType ws; /* the whitespace type of the value */
   35944     int n_ws;
   35945 
   35946     for (n_facet = 0;n_facet < gen_nb_xmlSchemaFacetPtr;n_facet++) {
   35947     for (n_fws = 0;n_fws < gen_nb_xmlSchemaWhitespaceValueType;n_fws++) {
   35948     for (n_valType = 0;n_valType < gen_nb_xmlSchemaValType;n_valType++) {
   35949     for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
   35950     for (n_val = 0;n_val < gen_nb_xmlSchemaValPtr;n_val++) {
   35951     for (n_ws = 0;n_ws < gen_nb_xmlSchemaWhitespaceValueType;n_ws++) {
   35952         mem_base = xmlMemBlocks();
   35953         facet = gen_xmlSchemaFacetPtr(n_facet, 0);
   35954         fws = gen_xmlSchemaWhitespaceValueType(n_fws, 1);
   35955         valType = gen_xmlSchemaValType(n_valType, 2);
   35956         value = gen_const_xmlChar_ptr(n_value, 3);
   35957         val = gen_xmlSchemaValPtr(n_val, 4);
   35958         ws = gen_xmlSchemaWhitespaceValueType(n_ws, 5);
   35959 
   35960         ret_val = xmlSchemaValidateFacetWhtsp(facet, fws, valType, (const xmlChar *)value, val, ws);
   35961         desret_int(ret_val);
   35962         call_tests++;
   35963         des_xmlSchemaFacetPtr(n_facet, facet, 0);
   35964         des_xmlSchemaWhitespaceValueType(n_fws, fws, 1);
   35965         des_xmlSchemaValType(n_valType, valType, 2);
   35966         des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 3);
   35967         des_xmlSchemaValPtr(n_val, val, 4);
   35968         des_xmlSchemaWhitespaceValueType(n_ws, ws, 5);
   35969         xmlResetLastError();
   35970         if (mem_base != xmlMemBlocks()) {
   35971             printf("Leak of %d blocks found in xmlSchemaValidateFacetWhtsp",
   35972 	           xmlMemBlocks() - mem_base);
   35973 	    test_ret++;
   35974             printf(" %d", n_facet);
   35975             printf(" %d", n_fws);
   35976             printf(" %d", n_valType);
   35977             printf(" %d", n_value);
   35978             printf(" %d", n_val);
   35979             printf(" %d", n_ws);
   35980             printf("\n");
   35981         }
   35982     }
   35983     }
   35984     }
   35985     }
   35986     }
   35987     }
   35988     function_tests++;
   35989 #endif
   35990 
   35991     return(test_ret);
   35992 }
   35993 
   35994 
   35995 static int
   35996 test_xmlSchemaValidateLengthFacet(void) {
   35997     int test_ret = 0;
   35998 
   35999 #if defined(LIBXML_SCHEMAS_ENABLED)
   36000     int mem_base;
   36001     int ret_val;
   36002     xmlSchemaTypePtr type; /* the built-in type */
   36003     int n_type;
   36004     xmlSchemaFacetPtr facet; /* the facet to check */
   36005     int n_facet;
   36006     xmlChar * value; /* the lexical repr. of the value to be validated */
   36007     int n_value;
   36008     xmlSchemaValPtr val; /* the precomputed value */
   36009     int n_val;
   36010     unsigned long * length; /* the actual length of the value */
   36011     int n_length;
   36012 
   36013     for (n_type = 0;n_type < gen_nb_xmlSchemaTypePtr;n_type++) {
   36014     for (n_facet = 0;n_facet < gen_nb_xmlSchemaFacetPtr;n_facet++) {
   36015     for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
   36016     for (n_val = 0;n_val < gen_nb_xmlSchemaValPtr;n_val++) {
   36017     for (n_length = 0;n_length < gen_nb_unsigned_long_ptr;n_length++) {
   36018         mem_base = xmlMemBlocks();
   36019         type = gen_xmlSchemaTypePtr(n_type, 0);
   36020         facet = gen_xmlSchemaFacetPtr(n_facet, 1);
   36021         value = gen_const_xmlChar_ptr(n_value, 2);
   36022         val = gen_xmlSchemaValPtr(n_val, 3);
   36023         length = gen_unsigned_long_ptr(n_length, 4);
   36024 
   36025         ret_val = xmlSchemaValidateLengthFacet(type, facet, (const xmlChar *)value, val, length);
   36026         desret_int(ret_val);
   36027         call_tests++;
   36028         des_xmlSchemaTypePtr(n_type, type, 0);
   36029         des_xmlSchemaFacetPtr(n_facet, facet, 1);
   36030         des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 2);
   36031         des_xmlSchemaValPtr(n_val, val, 3);
   36032         des_unsigned_long_ptr(n_length, length, 4);
   36033         xmlResetLastError();
   36034         if (mem_base != xmlMemBlocks()) {
   36035             printf("Leak of %d blocks found in xmlSchemaValidateLengthFacet",
   36036 	           xmlMemBlocks() - mem_base);
   36037 	    test_ret++;
   36038             printf(" %d", n_type);
   36039             printf(" %d", n_facet);
   36040             printf(" %d", n_value);
   36041             printf(" %d", n_val);
   36042             printf(" %d", n_length);
   36043             printf("\n");
   36044         }
   36045     }
   36046     }
   36047     }
   36048     }
   36049     }
   36050     function_tests++;
   36051 #endif
   36052 
   36053     return(test_ret);
   36054 }
   36055 
   36056 
   36057 static int
   36058 test_xmlSchemaValidateLengthFacetWhtsp(void) {
   36059     int test_ret = 0;
   36060 
   36061 #if defined(LIBXML_SCHEMAS_ENABLED)
   36062     int mem_base;
   36063     int ret_val;
   36064     xmlSchemaFacetPtr facet; /* the facet to check */
   36065     int n_facet;
   36066     xmlSchemaValType valType; /* the built-in type */
   36067     int n_valType;
   36068     xmlChar * value; /* the lexical repr. of the value to be validated */
   36069     int n_value;
   36070     xmlSchemaValPtr val; /* the precomputed value */
   36071     int n_val;
   36072     unsigned long * length; /* the actual length of the value */
   36073     int n_length;
   36074     xmlSchemaWhitespaceValueType ws; /* the whitespace type of the value */
   36075     int n_ws;
   36076 
   36077     for (n_facet = 0;n_facet < gen_nb_xmlSchemaFacetPtr;n_facet++) {
   36078     for (n_valType = 0;n_valType < gen_nb_xmlSchemaValType;n_valType++) {
   36079     for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
   36080     for (n_val = 0;n_val < gen_nb_xmlSchemaValPtr;n_val++) {
   36081     for (n_length = 0;n_length < gen_nb_unsigned_long_ptr;n_length++) {
   36082     for (n_ws = 0;n_ws < gen_nb_xmlSchemaWhitespaceValueType;n_ws++) {
   36083         mem_base = xmlMemBlocks();
   36084         facet = gen_xmlSchemaFacetPtr(n_facet, 0);
   36085         valType = gen_xmlSchemaValType(n_valType, 1);
   36086         value = gen_const_xmlChar_ptr(n_value, 2);
   36087         val = gen_xmlSchemaValPtr(n_val, 3);
   36088         length = gen_unsigned_long_ptr(n_length, 4);
   36089         ws = gen_xmlSchemaWhitespaceValueType(n_ws, 5);
   36090 
   36091         ret_val = xmlSchemaValidateLengthFacetWhtsp(facet, valType, (const xmlChar *)value, val, length, ws);
   36092         desret_int(ret_val);
   36093         call_tests++;
   36094         des_xmlSchemaFacetPtr(n_facet, facet, 0);
   36095         des_xmlSchemaValType(n_valType, valType, 1);
   36096         des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 2);
   36097         des_xmlSchemaValPtr(n_val, val, 3);
   36098         des_unsigned_long_ptr(n_length, length, 4);
   36099         des_xmlSchemaWhitespaceValueType(n_ws, ws, 5);
   36100         xmlResetLastError();
   36101         if (mem_base != xmlMemBlocks()) {
   36102             printf("Leak of %d blocks found in xmlSchemaValidateLengthFacetWhtsp",
   36103 	           xmlMemBlocks() - mem_base);
   36104 	    test_ret++;
   36105             printf(" %d", n_facet);
   36106             printf(" %d", n_valType);
   36107             printf(" %d", n_value);
   36108             printf(" %d", n_val);
   36109             printf(" %d", n_length);
   36110             printf(" %d", n_ws);
   36111             printf("\n");
   36112         }
   36113     }
   36114     }
   36115     }
   36116     }
   36117     }
   36118     }
   36119     function_tests++;
   36120 #endif
   36121 
   36122     return(test_ret);
   36123 }
   36124 
   36125 
   36126 static int
   36127 test_xmlSchemaValidateListSimpleTypeFacet(void) {
   36128     int test_ret = 0;
   36129 
   36130 #if defined(LIBXML_SCHEMAS_ENABLED)
   36131     int mem_base;
   36132     int ret_val;
   36133     xmlSchemaFacetPtr facet; /* the facet to check */
   36134     int n_facet;
   36135     xmlChar * value; /* the lexical repr of the value to validate */
   36136     int n_value;
   36137     unsigned long actualLen; /* the number of list items */
   36138     int n_actualLen;
   36139     unsigned long * expectedLen; /* the resulting expected number of list items */
   36140     int n_expectedLen;
   36141 
   36142     for (n_facet = 0;n_facet < gen_nb_xmlSchemaFacetPtr;n_facet++) {
   36143     for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
   36144     for (n_actualLen = 0;n_actualLen < gen_nb_unsigned_long;n_actualLen++) {
   36145     for (n_expectedLen = 0;n_expectedLen < gen_nb_unsigned_long_ptr;n_expectedLen++) {
   36146         mem_base = xmlMemBlocks();
   36147         facet = gen_xmlSchemaFacetPtr(n_facet, 0);
   36148         value = gen_const_xmlChar_ptr(n_value, 1);
   36149         actualLen = gen_unsigned_long(n_actualLen, 2);
   36150         expectedLen = gen_unsigned_long_ptr(n_expectedLen, 3);
   36151 
   36152         ret_val = xmlSchemaValidateListSimpleTypeFacet(facet, (const xmlChar *)value, actualLen, expectedLen);
   36153         desret_int(ret_val);
   36154         call_tests++;
   36155         des_xmlSchemaFacetPtr(n_facet, facet, 0);
   36156         des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 1);
   36157         des_unsigned_long(n_actualLen, actualLen, 2);
   36158         des_unsigned_long_ptr(n_expectedLen, expectedLen, 3);
   36159         xmlResetLastError();
   36160         if (mem_base != xmlMemBlocks()) {
   36161             printf("Leak of %d blocks found in xmlSchemaValidateListSimpleTypeFacet",
   36162 	           xmlMemBlocks() - mem_base);
   36163 	    test_ret++;
   36164             printf(" %d", n_facet);
   36165             printf(" %d", n_value);
   36166             printf(" %d", n_actualLen);
   36167             printf(" %d", n_expectedLen);
   36168             printf("\n");
   36169         }
   36170     }
   36171     }
   36172     }
   36173     }
   36174     function_tests++;
   36175 #endif
   36176 
   36177     return(test_ret);
   36178 }
   36179 
   36180 
   36181 static int
   36182 test_xmlSchemaValidatePredefinedType(void) {
   36183     int test_ret = 0;
   36184 
   36185 #if defined(LIBXML_SCHEMAS_ENABLED)
   36186     int mem_base;
   36187     int ret_val;
   36188     xmlSchemaTypePtr type; /* the predefined type */
   36189     int n_type;
   36190     xmlChar * value; /* the value to check */
   36191     int n_value;
   36192     xmlSchemaValPtr * val; /* the return computed value */
   36193     int n_val;
   36194 
   36195     for (n_type = 0;n_type < gen_nb_xmlSchemaTypePtr;n_type++) {
   36196     for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
   36197     for (n_val = 0;n_val < gen_nb_xmlSchemaValPtr_ptr;n_val++) {
   36198         mem_base = xmlMemBlocks();
   36199         type = gen_xmlSchemaTypePtr(n_type, 0);
   36200         value = gen_const_xmlChar_ptr(n_value, 1);
   36201         val = gen_xmlSchemaValPtr_ptr(n_val, 2);
   36202 
   36203         ret_val = xmlSchemaValidatePredefinedType(type, (const xmlChar *)value, val);
   36204         desret_int(ret_val);
   36205         call_tests++;
   36206         des_xmlSchemaTypePtr(n_type, type, 0);
   36207         des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 1);
   36208         des_xmlSchemaValPtr_ptr(n_val, val, 2);
   36209         xmlResetLastError();
   36210         if (mem_base != xmlMemBlocks()) {
   36211             printf("Leak of %d blocks found in xmlSchemaValidatePredefinedType",
   36212 	           xmlMemBlocks() - mem_base);
   36213 	    test_ret++;
   36214             printf(" %d", n_type);
   36215             printf(" %d", n_value);
   36216             printf(" %d", n_val);
   36217             printf("\n");
   36218         }
   36219     }
   36220     }
   36221     }
   36222     function_tests++;
   36223 #endif
   36224 
   36225     return(test_ret);
   36226 }
   36227 
   36228 
   36229 static int
   36230 test_xmlSchemaValueAppend(void) {
   36231     int test_ret = 0;
   36232 
   36233 #if defined(LIBXML_SCHEMAS_ENABLED)
   36234     int mem_base;
   36235     int ret_val;
   36236     xmlSchemaValPtr prev; /* the value */
   36237     int n_prev;
   36238     xmlSchemaValPtr cur; /* the value to be appended */
   36239     int n_cur;
   36240 
   36241     for (n_prev = 0;n_prev < gen_nb_xmlSchemaValPtr;n_prev++) {
   36242     for (n_cur = 0;n_cur < gen_nb_xmlSchemaValPtr;n_cur++) {
   36243         mem_base = xmlMemBlocks();
   36244         prev = gen_xmlSchemaValPtr(n_prev, 0);
   36245         cur = gen_xmlSchemaValPtr(n_cur, 1);
   36246 
   36247         ret_val = xmlSchemaValueAppend(prev, cur);
   36248         desret_int(ret_val);
   36249         call_tests++;
   36250         des_xmlSchemaValPtr(n_prev, prev, 0);
   36251         des_xmlSchemaValPtr(n_cur, cur, 1);
   36252         xmlResetLastError();
   36253         if (mem_base != xmlMemBlocks()) {
   36254             printf("Leak of %d blocks found in xmlSchemaValueAppend",
   36255 	           xmlMemBlocks() - mem_base);
   36256 	    test_ret++;
   36257             printf(" %d", n_prev);
   36258             printf(" %d", n_cur);
   36259             printf("\n");
   36260         }
   36261     }
   36262     }
   36263     function_tests++;
   36264 #endif
   36265 
   36266     return(test_ret);
   36267 }
   36268 
   36269 
   36270 static int
   36271 test_xmlSchemaValueGetAsBoolean(void) {
   36272     int test_ret = 0;
   36273 
   36274 #if defined(LIBXML_SCHEMAS_ENABLED)
   36275     int mem_base;
   36276     int ret_val;
   36277     xmlSchemaValPtr val; /* the value */
   36278     int n_val;
   36279 
   36280     for (n_val = 0;n_val < gen_nb_xmlSchemaValPtr;n_val++) {
   36281         mem_base = xmlMemBlocks();
   36282         val = gen_xmlSchemaValPtr(n_val, 0);
   36283 
   36284         ret_val = xmlSchemaValueGetAsBoolean(val);
   36285         desret_int(ret_val);
   36286         call_tests++;
   36287         des_xmlSchemaValPtr(n_val, val, 0);
   36288         xmlResetLastError();
   36289         if (mem_base != xmlMemBlocks()) {
   36290             printf("Leak of %d blocks found in xmlSchemaValueGetAsBoolean",
   36291 	           xmlMemBlocks() - mem_base);
   36292 	    test_ret++;
   36293             printf(" %d", n_val);
   36294             printf("\n");
   36295         }
   36296     }
   36297     function_tests++;
   36298 #endif
   36299 
   36300     return(test_ret);
   36301 }
   36302 
   36303 
   36304 static int
   36305 test_xmlSchemaValueGetAsString(void) {
   36306     int test_ret = 0;
   36307 
   36308 #if defined(LIBXML_SCHEMAS_ENABLED)
   36309     int mem_base;
   36310     const xmlChar * ret_val;
   36311     xmlSchemaValPtr val; /* the value */
   36312     int n_val;
   36313 
   36314     for (n_val = 0;n_val < gen_nb_xmlSchemaValPtr;n_val++) {
   36315         mem_base = xmlMemBlocks();
   36316         val = gen_xmlSchemaValPtr(n_val, 0);
   36317 
   36318         ret_val = xmlSchemaValueGetAsString(val);
   36319         desret_const_xmlChar_ptr(ret_val);
   36320         call_tests++;
   36321         des_xmlSchemaValPtr(n_val, val, 0);
   36322         xmlResetLastError();
   36323         if (mem_base != xmlMemBlocks()) {
   36324             printf("Leak of %d blocks found in xmlSchemaValueGetAsString",
   36325 	           xmlMemBlocks() - mem_base);
   36326 	    test_ret++;
   36327             printf(" %d", n_val);
   36328             printf("\n");
   36329         }
   36330     }
   36331     function_tests++;
   36332 #endif
   36333 
   36334     return(test_ret);
   36335 }
   36336 
   36337 
   36338 static int
   36339 test_xmlSchemaValueGetNext(void) {
   36340     int test_ret = 0;
   36341 
   36342 
   36343     /* missing type support */
   36344     return(test_ret);
   36345 }
   36346 
   36347 
   36348 static int
   36349 test_xmlSchemaWhiteSpaceReplace(void) {
   36350     int test_ret = 0;
   36351 
   36352 #if defined(LIBXML_SCHEMAS_ENABLED)
   36353     int mem_base;
   36354     xmlChar * ret_val;
   36355     xmlChar * value; /* a value */
   36356     int n_value;
   36357 
   36358     for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
   36359         mem_base = xmlMemBlocks();
   36360         value = gen_const_xmlChar_ptr(n_value, 0);
   36361 
   36362         ret_val = xmlSchemaWhiteSpaceReplace((const xmlChar *)value);
   36363         desret_xmlChar_ptr(ret_val);
   36364         call_tests++;
   36365         des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 0);
   36366         xmlResetLastError();
   36367         if (mem_base != xmlMemBlocks()) {
   36368             printf("Leak of %d blocks found in xmlSchemaWhiteSpaceReplace",
   36369 	           xmlMemBlocks() - mem_base);
   36370 	    test_ret++;
   36371             printf(" %d", n_value);
   36372             printf("\n");
   36373         }
   36374     }
   36375     function_tests++;
   36376 #endif
   36377 
   36378     return(test_ret);
   36379 }
   36380 
   36381 static int
   36382 test_xmlschemastypes(void) {
   36383     int test_ret = 0;
   36384 
   36385     if (quiet == 0) printf("Testing xmlschemastypes : 26 of 34 functions ...\n");
   36386     test_ret += test_xmlSchemaCheckFacet();
   36387     test_ret += test_xmlSchemaCleanupTypes();
   36388     test_ret += test_xmlSchemaCollapseString();
   36389     test_ret += test_xmlSchemaCompareValues();
   36390     test_ret += test_xmlSchemaCompareValuesWhtsp();
   36391     test_ret += test_xmlSchemaCopyValue();
   36392     test_ret += test_xmlSchemaGetBuiltInListSimpleTypeItemType();
   36393     test_ret += test_xmlSchemaGetBuiltInType();
   36394     test_ret += test_xmlSchemaGetCanonValue();
   36395     test_ret += test_xmlSchemaGetCanonValueWhtsp();
   36396     test_ret += test_xmlSchemaGetFacetValueAsULong();
   36397     test_ret += test_xmlSchemaGetPredefinedType();
   36398     test_ret += test_xmlSchemaGetValType();
   36399     test_ret += test_xmlSchemaInitTypes();
   36400     test_ret += test_xmlSchemaIsBuiltInTypeFacet();
   36401     test_ret += test_xmlSchemaNewFacet();
   36402     test_ret += test_xmlSchemaNewNOTATIONValue();
   36403     test_ret += test_xmlSchemaNewQNameValue();
   36404     test_ret += test_xmlSchemaNewStringValue();
   36405     test_ret += test_xmlSchemaValPredefTypeNode();
   36406     test_ret += test_xmlSchemaValPredefTypeNodeNoNorm();
   36407     test_ret += test_xmlSchemaValidateFacet();
   36408     test_ret += test_xmlSchemaValidateFacetWhtsp();
   36409     test_ret += test_xmlSchemaValidateLengthFacet();
   36410     test_ret += test_xmlSchemaValidateLengthFacetWhtsp();
   36411     test_ret += test_xmlSchemaValidateListSimpleTypeFacet();
   36412     test_ret += test_xmlSchemaValidatePredefinedType();
   36413     test_ret += test_xmlSchemaValueAppend();
   36414     test_ret += test_xmlSchemaValueGetAsBoolean();
   36415     test_ret += test_xmlSchemaValueGetAsString();
   36416     test_ret += test_xmlSchemaValueGetNext();
   36417     test_ret += test_xmlSchemaWhiteSpaceReplace();
   36418 
   36419     if (test_ret != 0)
   36420 	printf("Module xmlschemastypes: %d errors\n", test_ret);
   36421     return(test_ret);
   36422 }
   36423 
   36424 static int
   36425 test_xmlCharStrdup(void) {
   36426     int test_ret = 0;
   36427 
   36428     int mem_base;
   36429     xmlChar * ret_val;
   36430     char * cur; /* the input char * */
   36431     int n_cur;
   36432 
   36433     for (n_cur = 0;n_cur < gen_nb_const_char_ptr;n_cur++) {
   36434         mem_base = xmlMemBlocks();
   36435         cur = gen_const_char_ptr(n_cur, 0);
   36436 
   36437         ret_val = xmlCharStrdup((const char *)cur);
   36438         desret_xmlChar_ptr(ret_val);
   36439         call_tests++;
   36440         des_const_char_ptr(n_cur, (const char *)cur, 0);
   36441         xmlResetLastError();
   36442         if (mem_base != xmlMemBlocks()) {
   36443             printf("Leak of %d blocks found in xmlCharStrdup",
   36444 	           xmlMemBlocks() - mem_base);
   36445 	    test_ret++;
   36446             printf(" %d", n_cur);
   36447             printf("\n");
   36448         }
   36449     }
   36450     function_tests++;
   36451 
   36452     return(test_ret);
   36453 }
   36454 
   36455 
   36456 static int
   36457 test_xmlCharStrndup(void) {
   36458     int test_ret = 0;
   36459 
   36460     int mem_base;
   36461     xmlChar * ret_val;
   36462     char * cur; /* the input char * */
   36463     int n_cur;
   36464     int len; /* the len of @cur */
   36465     int n_len;
   36466 
   36467     for (n_cur = 0;n_cur < gen_nb_const_char_ptr;n_cur++) {
   36468     for (n_len = 0;n_len < gen_nb_int;n_len++) {
   36469         mem_base = xmlMemBlocks();
   36470         cur = gen_const_char_ptr(n_cur, 0);
   36471         len = gen_int(n_len, 1);
   36472         if ((cur != NULL) &&
   36473             (len > (int) strlen((const char *) cur) + 1))
   36474             continue;
   36475 
   36476         ret_val = xmlCharStrndup((const char *)cur, len);
   36477         desret_xmlChar_ptr(ret_val);
   36478         call_tests++;
   36479         des_const_char_ptr(n_cur, (const char *)cur, 0);
   36480         des_int(n_len, len, 1);
   36481         xmlResetLastError();
   36482         if (mem_base != xmlMemBlocks()) {
   36483             printf("Leak of %d blocks found in xmlCharStrndup",
   36484 	           xmlMemBlocks() - mem_base);
   36485 	    test_ret++;
   36486             printf(" %d", n_cur);
   36487             printf(" %d", n_len);
   36488             printf("\n");
   36489         }
   36490     }
   36491     }
   36492     function_tests++;
   36493 
   36494     return(test_ret);
   36495 }
   36496 
   36497 
   36498 static int
   36499 test_xmlCheckUTF8(void) {
   36500     int test_ret = 0;
   36501 
   36502     int mem_base;
   36503     int ret_val;
   36504     unsigned char * utf; /* Pointer to putative UTF-8 encoded string. */
   36505     int n_utf;
   36506 
   36507     for (n_utf = 0;n_utf < gen_nb_const_unsigned_char_ptr;n_utf++) {
   36508         mem_base = xmlMemBlocks();
   36509         utf = gen_const_unsigned_char_ptr(n_utf, 0);
   36510 
   36511         ret_val = xmlCheckUTF8((const unsigned char *)utf);
   36512         desret_int(ret_val);
   36513         call_tests++;
   36514         des_const_unsigned_char_ptr(n_utf, (const unsigned char *)utf, 0);
   36515         xmlResetLastError();
   36516         if (mem_base != xmlMemBlocks()) {
   36517             printf("Leak of %d blocks found in xmlCheckUTF8",
   36518 	           xmlMemBlocks() - mem_base);
   36519 	    test_ret++;
   36520             printf(" %d", n_utf);
   36521             printf("\n");
   36522         }
   36523     }
   36524     function_tests++;
   36525 
   36526     return(test_ret);
   36527 }
   36528 
   36529 
   36530 static int
   36531 test_xmlGetUTF8Char(void) {
   36532     int test_ret = 0;
   36533 
   36534     int mem_base;
   36535     int ret_val;
   36536     unsigned char * utf; /* a sequence of UTF-8 encoded bytes */
   36537     int n_utf;
   36538     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. */
   36539     int n_len;
   36540 
   36541     for (n_utf = 0;n_utf < gen_nb_const_unsigned_char_ptr;n_utf++) {
   36542     for (n_len = 0;n_len < gen_nb_int_ptr;n_len++) {
   36543         mem_base = xmlMemBlocks();
   36544         utf = gen_const_unsigned_char_ptr(n_utf, 0);
   36545         len = gen_int_ptr(n_len, 1);
   36546 
   36547         ret_val = xmlGetUTF8Char((const unsigned char *)utf, len);
   36548         desret_int(ret_val);
   36549         call_tests++;
   36550         des_const_unsigned_char_ptr(n_utf, (const unsigned char *)utf, 0);
   36551         des_int_ptr(n_len, len, 1);
   36552         xmlResetLastError();
   36553         if (mem_base != xmlMemBlocks()) {
   36554             printf("Leak of %d blocks found in xmlGetUTF8Char",
   36555 	           xmlMemBlocks() - mem_base);
   36556 	    test_ret++;
   36557             printf(" %d", n_utf);
   36558             printf(" %d", n_len);
   36559             printf("\n");
   36560         }
   36561     }
   36562     }
   36563     function_tests++;
   36564 
   36565     return(test_ret);
   36566 }
   36567 
   36568 
   36569 static int
   36570 test_xmlStrEqual(void) {
   36571     int test_ret = 0;
   36572 
   36573     int mem_base;
   36574     int ret_val;
   36575     xmlChar * str1; /* the first xmlChar * */
   36576     int n_str1;
   36577     xmlChar * str2; /* the second xmlChar * */
   36578     int n_str2;
   36579 
   36580     for (n_str1 = 0;n_str1 < gen_nb_const_xmlChar_ptr;n_str1++) {
   36581     for (n_str2 = 0;n_str2 < gen_nb_const_xmlChar_ptr;n_str2++) {
   36582         mem_base = xmlMemBlocks();
   36583         str1 = gen_const_xmlChar_ptr(n_str1, 0);
   36584         str2 = gen_const_xmlChar_ptr(n_str2, 1);
   36585 
   36586         ret_val = xmlStrEqual((const xmlChar *)str1, (const xmlChar *)str2);
   36587         desret_int(ret_val);
   36588         call_tests++;
   36589         des_const_xmlChar_ptr(n_str1, (const xmlChar *)str1, 0);
   36590         des_const_xmlChar_ptr(n_str2, (const xmlChar *)str2, 1);
   36591         xmlResetLastError();
   36592         if (mem_base != xmlMemBlocks()) {
   36593             printf("Leak of %d blocks found in xmlStrEqual",
   36594 	           xmlMemBlocks() - mem_base);
   36595 	    test_ret++;
   36596             printf(" %d", n_str1);
   36597             printf(" %d", n_str2);
   36598             printf("\n");
   36599         }
   36600     }
   36601     }
   36602     function_tests++;
   36603 
   36604     return(test_ret);
   36605 }
   36606 
   36607 
   36608 static int
   36609 test_xmlStrPrintf(void) {
   36610     int test_ret = 0;
   36611 
   36612 
   36613     /* missing type support */
   36614     return(test_ret);
   36615 }
   36616 
   36617 
   36618 static int
   36619 test_xmlStrQEqual(void) {
   36620     int test_ret = 0;
   36621 
   36622     int mem_base;
   36623     int ret_val;
   36624     xmlChar * pref; /* the prefix of the QName */
   36625     int n_pref;
   36626     xmlChar * name; /* the localname of the QName */
   36627     int n_name;
   36628     xmlChar * str; /* the second xmlChar * */
   36629     int n_str;
   36630 
   36631     for (n_pref = 0;n_pref < gen_nb_const_xmlChar_ptr;n_pref++) {
   36632     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
   36633     for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) {
   36634         mem_base = xmlMemBlocks();
   36635         pref = gen_const_xmlChar_ptr(n_pref, 0);
   36636         name = gen_const_xmlChar_ptr(n_name, 1);
   36637         str = gen_const_xmlChar_ptr(n_str, 2);
   36638 
   36639         ret_val = xmlStrQEqual((const xmlChar *)pref, (const xmlChar *)name, (const xmlChar *)str);
   36640         desret_int(ret_val);
   36641         call_tests++;
   36642         des_const_xmlChar_ptr(n_pref, (const xmlChar *)pref, 0);
   36643         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
   36644         des_const_xmlChar_ptr(n_str, (const xmlChar *)str, 2);
   36645         xmlResetLastError();
   36646         if (mem_base != xmlMemBlocks()) {
   36647             printf("Leak of %d blocks found in xmlStrQEqual",
   36648 	           xmlMemBlocks() - mem_base);
   36649 	    test_ret++;
   36650             printf(" %d", n_pref);
   36651             printf(" %d", n_name);
   36652             printf(" %d", n_str);
   36653             printf("\n");
   36654         }
   36655     }
   36656     }
   36657     }
   36658     function_tests++;
   36659 
   36660     return(test_ret);
   36661 }
   36662 
   36663 
   36664 static int
   36665 test_xmlStrVPrintf(void) {
   36666     int test_ret = 0;
   36667 
   36668 
   36669     /* missing type support */
   36670     return(test_ret);
   36671 }
   36672 
   36673 
   36674 static int
   36675 test_xmlStrcasecmp(void) {
   36676     int test_ret = 0;
   36677 
   36678     int mem_base;
   36679     int ret_val;
   36680     xmlChar * str1; /* the first xmlChar * */
   36681     int n_str1;
   36682     xmlChar * str2; /* the second xmlChar * */
   36683     int n_str2;
   36684 
   36685     for (n_str1 = 0;n_str1 < gen_nb_const_xmlChar_ptr;n_str1++) {
   36686     for (n_str2 = 0;n_str2 < gen_nb_const_xmlChar_ptr;n_str2++) {
   36687         mem_base = xmlMemBlocks();
   36688         str1 = gen_const_xmlChar_ptr(n_str1, 0);
   36689         str2 = gen_const_xmlChar_ptr(n_str2, 1);
   36690 
   36691         ret_val = xmlStrcasecmp((const xmlChar *)str1, (const xmlChar *)str2);
   36692         desret_int(ret_val);
   36693         call_tests++;
   36694         des_const_xmlChar_ptr(n_str1, (const xmlChar *)str1, 0);
   36695         des_const_xmlChar_ptr(n_str2, (const xmlChar *)str2, 1);
   36696         xmlResetLastError();
   36697         if (mem_base != xmlMemBlocks()) {
   36698             printf("Leak of %d blocks found in xmlStrcasecmp",
   36699 	           xmlMemBlocks() - mem_base);
   36700 	    test_ret++;
   36701             printf(" %d", n_str1);
   36702             printf(" %d", n_str2);
   36703             printf("\n");
   36704         }
   36705     }
   36706     }
   36707     function_tests++;
   36708 
   36709     return(test_ret);
   36710 }
   36711 
   36712 
   36713 static int
   36714 test_xmlStrcasestr(void) {
   36715     int test_ret = 0;
   36716 
   36717     int mem_base;
   36718     const xmlChar * ret_val;
   36719     xmlChar * str; /* the xmlChar * array (haystack) */
   36720     int n_str;
   36721     xmlChar * val; /* the xmlChar to search (needle) */
   36722     int n_val;
   36723 
   36724     for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) {
   36725     for (n_val = 0;n_val < gen_nb_const_xmlChar_ptr;n_val++) {
   36726         mem_base = xmlMemBlocks();
   36727         str = gen_const_xmlChar_ptr(n_str, 0);
   36728         val = gen_const_xmlChar_ptr(n_val, 1);
   36729 
   36730         ret_val = xmlStrcasestr((const xmlChar *)str, (const xmlChar *)val);
   36731         desret_const_xmlChar_ptr(ret_val);
   36732         call_tests++;
   36733         des_const_xmlChar_ptr(n_str, (const xmlChar *)str, 0);
   36734         des_const_xmlChar_ptr(n_val, (const xmlChar *)val, 1);
   36735         xmlResetLastError();
   36736         if (mem_base != xmlMemBlocks()) {
   36737             printf("Leak of %d blocks found in xmlStrcasestr",
   36738 	           xmlMemBlocks() - mem_base);
   36739 	    test_ret++;
   36740             printf(" %d", n_str);
   36741             printf(" %d", n_val);
   36742             printf("\n");
   36743         }
   36744     }
   36745     }
   36746     function_tests++;
   36747 
   36748     return(test_ret);
   36749 }
   36750 
   36751 
   36752 static int
   36753 test_xmlStrchr(void) {
   36754     int test_ret = 0;
   36755 
   36756     int mem_base;
   36757     const xmlChar * ret_val;
   36758     xmlChar * str; /* the xmlChar * array */
   36759     int n_str;
   36760     xmlChar val; /* the xmlChar to search */
   36761     int n_val;
   36762 
   36763     for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) {
   36764     for (n_val = 0;n_val < gen_nb_xmlChar;n_val++) {
   36765         mem_base = xmlMemBlocks();
   36766         str = gen_const_xmlChar_ptr(n_str, 0);
   36767         val = gen_xmlChar(n_val, 1);
   36768 
   36769         ret_val = xmlStrchr((const xmlChar *)str, val);
   36770         desret_const_xmlChar_ptr(ret_val);
   36771         call_tests++;
   36772         des_const_xmlChar_ptr(n_str, (const xmlChar *)str, 0);
   36773         des_xmlChar(n_val, val, 1);
   36774         xmlResetLastError();
   36775         if (mem_base != xmlMemBlocks()) {
   36776             printf("Leak of %d blocks found in xmlStrchr",
   36777 	           xmlMemBlocks() - mem_base);
   36778 	    test_ret++;
   36779             printf(" %d", n_str);
   36780             printf(" %d", n_val);
   36781             printf("\n");
   36782         }
   36783     }
   36784     }
   36785     function_tests++;
   36786 
   36787     return(test_ret);
   36788 }
   36789 
   36790 
   36791 static int
   36792 test_xmlStrcmp(void) {
   36793     int test_ret = 0;
   36794 
   36795     int mem_base;
   36796     int ret_val;
   36797     xmlChar * str1; /* the first xmlChar * */
   36798     int n_str1;
   36799     xmlChar * str2; /* the second xmlChar * */
   36800     int n_str2;
   36801 
   36802     for (n_str1 = 0;n_str1 < gen_nb_const_xmlChar_ptr;n_str1++) {
   36803     for (n_str2 = 0;n_str2 < gen_nb_const_xmlChar_ptr;n_str2++) {
   36804         mem_base = xmlMemBlocks();
   36805         str1 = gen_const_xmlChar_ptr(n_str1, 0);
   36806         str2 = gen_const_xmlChar_ptr(n_str2, 1);
   36807 
   36808         ret_val = xmlStrcmp((const xmlChar *)str1, (const xmlChar *)str2);
   36809         desret_int(ret_val);
   36810         call_tests++;
   36811         des_const_xmlChar_ptr(n_str1, (const xmlChar *)str1, 0);
   36812         des_const_xmlChar_ptr(n_str2, (const xmlChar *)str2, 1);
   36813         xmlResetLastError();
   36814         if (mem_base != xmlMemBlocks()) {
   36815             printf("Leak of %d blocks found in xmlStrcmp",
   36816 	           xmlMemBlocks() - mem_base);
   36817 	    test_ret++;
   36818             printf(" %d", n_str1);
   36819             printf(" %d", n_str2);
   36820             printf("\n");
   36821         }
   36822     }
   36823     }
   36824     function_tests++;
   36825 
   36826     return(test_ret);
   36827 }
   36828 
   36829 
   36830 static int
   36831 test_xmlStrdup(void) {
   36832     int test_ret = 0;
   36833 
   36834     int mem_base;
   36835     xmlChar * ret_val;
   36836     xmlChar * cur; /* the input xmlChar * */
   36837     int n_cur;
   36838 
   36839     for (n_cur = 0;n_cur < gen_nb_const_xmlChar_ptr;n_cur++) {
   36840         mem_base = xmlMemBlocks();
   36841         cur = gen_const_xmlChar_ptr(n_cur, 0);
   36842 
   36843         ret_val = xmlStrdup((const xmlChar *)cur);
   36844         desret_xmlChar_ptr(ret_val);
   36845         call_tests++;
   36846         des_const_xmlChar_ptr(n_cur, (const xmlChar *)cur, 0);
   36847         xmlResetLastError();
   36848         if (mem_base != xmlMemBlocks()) {
   36849             printf("Leak of %d blocks found in xmlStrdup",
   36850 	           xmlMemBlocks() - mem_base);
   36851 	    test_ret++;
   36852             printf(" %d", n_cur);
   36853             printf("\n");
   36854         }
   36855     }
   36856     function_tests++;
   36857 
   36858     return(test_ret);
   36859 }
   36860 
   36861 
   36862 static int
   36863 test_xmlStrlen(void) {
   36864     int test_ret = 0;
   36865 
   36866     int mem_base;
   36867     int ret_val;
   36868     xmlChar * str; /* the xmlChar * array */
   36869     int n_str;
   36870 
   36871     for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) {
   36872         mem_base = xmlMemBlocks();
   36873         str = gen_const_xmlChar_ptr(n_str, 0);
   36874 
   36875         ret_val = xmlStrlen((const xmlChar *)str);
   36876         desret_int(ret_val);
   36877         call_tests++;
   36878         des_const_xmlChar_ptr(n_str, (const xmlChar *)str, 0);
   36879         xmlResetLastError();
   36880         if (mem_base != xmlMemBlocks()) {
   36881             printf("Leak of %d blocks found in xmlStrlen",
   36882 	           xmlMemBlocks() - mem_base);
   36883 	    test_ret++;
   36884             printf(" %d", n_str);
   36885             printf("\n");
   36886         }
   36887     }
   36888     function_tests++;
   36889 
   36890     return(test_ret);
   36891 }
   36892 
   36893 
   36894 static int
   36895 test_xmlStrncasecmp(void) {
   36896     int test_ret = 0;
   36897 
   36898     int mem_base;
   36899     int ret_val;
   36900     xmlChar * str1; /* the first xmlChar * */
   36901     int n_str1;
   36902     xmlChar * str2; /* the second xmlChar * */
   36903     int n_str2;
   36904     int len; /* the max comparison length */
   36905     int n_len;
   36906 
   36907     for (n_str1 = 0;n_str1 < gen_nb_const_xmlChar_ptr;n_str1++) {
   36908     for (n_str2 = 0;n_str2 < gen_nb_const_xmlChar_ptr;n_str2++) {
   36909     for (n_len = 0;n_len < gen_nb_int;n_len++) {
   36910         mem_base = xmlMemBlocks();
   36911         str1 = gen_const_xmlChar_ptr(n_str1, 0);
   36912         str2 = gen_const_xmlChar_ptr(n_str2, 1);
   36913         len = gen_int(n_len, 2);
   36914         if ((str2 != NULL) &&
   36915             (len > (int) strlen((const char *) str2) + 1))
   36916             continue;
   36917 
   36918         ret_val = xmlStrncasecmp((const xmlChar *)str1, (const xmlChar *)str2, len);
   36919         desret_int(ret_val);
   36920         call_tests++;
   36921         des_const_xmlChar_ptr(n_str1, (const xmlChar *)str1, 0);
   36922         des_const_xmlChar_ptr(n_str2, (const xmlChar *)str2, 1);
   36923         des_int(n_len, len, 2);
   36924         xmlResetLastError();
   36925         if (mem_base != xmlMemBlocks()) {
   36926             printf("Leak of %d blocks found in xmlStrncasecmp",
   36927 	           xmlMemBlocks() - mem_base);
   36928 	    test_ret++;
   36929             printf(" %d", n_str1);
   36930             printf(" %d", n_str2);
   36931             printf(" %d", n_len);
   36932             printf("\n");
   36933         }
   36934     }
   36935     }
   36936     }
   36937     function_tests++;
   36938 
   36939     return(test_ret);
   36940 }
   36941 
   36942 
   36943 static int
   36944 test_xmlStrncatNew(void) {
   36945     int test_ret = 0;
   36946 
   36947     int mem_base;
   36948     xmlChar * ret_val;
   36949     xmlChar * str1; /* first xmlChar string */
   36950     int n_str1;
   36951     xmlChar * str2; /* second xmlChar string */
   36952     int n_str2;
   36953     int len; /* the len of @str2 or < 0 */
   36954     int n_len;
   36955 
   36956     for (n_str1 = 0;n_str1 < gen_nb_const_xmlChar_ptr;n_str1++) {
   36957     for (n_str2 = 0;n_str2 < gen_nb_const_xmlChar_ptr;n_str2++) {
   36958     for (n_len = 0;n_len < gen_nb_int;n_len++) {
   36959         mem_base = xmlMemBlocks();
   36960         str1 = gen_const_xmlChar_ptr(n_str1, 0);
   36961         str2 = gen_const_xmlChar_ptr(n_str2, 1);
   36962         len = gen_int(n_len, 2);
   36963         if ((str2 != NULL) &&
   36964             (len > (int) strlen((const char *) str2) + 1))
   36965             continue;
   36966 
   36967         ret_val = xmlStrncatNew((const xmlChar *)str1, (const xmlChar *)str2, len);
   36968         desret_xmlChar_ptr(ret_val);
   36969         call_tests++;
   36970         des_const_xmlChar_ptr(n_str1, (const xmlChar *)str1, 0);
   36971         des_const_xmlChar_ptr(n_str2, (const xmlChar *)str2, 1);
   36972         des_int(n_len, len, 2);
   36973         xmlResetLastError();
   36974         if (mem_base != xmlMemBlocks()) {
   36975             printf("Leak of %d blocks found in xmlStrncatNew",
   36976 	           xmlMemBlocks() - mem_base);
   36977 	    test_ret++;
   36978             printf(" %d", n_str1);
   36979             printf(" %d", n_str2);
   36980             printf(" %d", n_len);
   36981             printf("\n");
   36982         }
   36983     }
   36984     }
   36985     }
   36986     function_tests++;
   36987 
   36988     return(test_ret);
   36989 }
   36990 
   36991 
   36992 static int
   36993 test_xmlStrncmp(void) {
   36994     int test_ret = 0;
   36995 
   36996     int mem_base;
   36997     int ret_val;
   36998     xmlChar * str1; /* the first xmlChar * */
   36999     int n_str1;
   37000     xmlChar * str2; /* the second xmlChar * */
   37001     int n_str2;
   37002     int len; /* the max comparison length */
   37003     int n_len;
   37004 
   37005     for (n_str1 = 0;n_str1 < gen_nb_const_xmlChar_ptr;n_str1++) {
   37006     for (n_str2 = 0;n_str2 < gen_nb_const_xmlChar_ptr;n_str2++) {
   37007     for (n_len = 0;n_len < gen_nb_int;n_len++) {
   37008         mem_base = xmlMemBlocks();
   37009         str1 = gen_const_xmlChar_ptr(n_str1, 0);
   37010         str2 = gen_const_xmlChar_ptr(n_str2, 1);
   37011         len = gen_int(n_len, 2);
   37012         if ((str2 != NULL) &&
   37013             (len > (int) strlen((const char *) str2) + 1))
   37014             continue;
   37015 
   37016         ret_val = xmlStrncmp((const xmlChar *)str1, (const xmlChar *)str2, len);
   37017         desret_int(ret_val);
   37018         call_tests++;
   37019         des_const_xmlChar_ptr(n_str1, (const xmlChar *)str1, 0);
   37020         des_const_xmlChar_ptr(n_str2, (const xmlChar *)str2, 1);
   37021         des_int(n_len, len, 2);
   37022         xmlResetLastError();
   37023         if (mem_base != xmlMemBlocks()) {
   37024             printf("Leak of %d blocks found in xmlStrncmp",
   37025 	           xmlMemBlocks() - mem_base);
   37026 	    test_ret++;
   37027             printf(" %d", n_str1);
   37028             printf(" %d", n_str2);
   37029             printf(" %d", n_len);
   37030             printf("\n");
   37031         }
   37032     }
   37033     }
   37034     }
   37035     function_tests++;
   37036 
   37037     return(test_ret);
   37038 }
   37039 
   37040 
   37041 static int
   37042 test_xmlStrndup(void) {
   37043     int test_ret = 0;
   37044 
   37045     int mem_base;
   37046     xmlChar * ret_val;
   37047     xmlChar * cur; /* the input xmlChar * */
   37048     int n_cur;
   37049     int len; /* the len of @cur */
   37050     int n_len;
   37051 
   37052     for (n_cur = 0;n_cur < gen_nb_const_xmlChar_ptr;n_cur++) {
   37053     for (n_len = 0;n_len < gen_nb_int;n_len++) {
   37054         mem_base = xmlMemBlocks();
   37055         cur = gen_const_xmlChar_ptr(n_cur, 0);
   37056         len = gen_int(n_len, 1);
   37057         if ((cur != NULL) &&
   37058             (len > (int) strlen((const char *) cur) + 1))
   37059             continue;
   37060 
   37061         ret_val = xmlStrndup((const xmlChar *)cur, len);
   37062         desret_xmlChar_ptr(ret_val);
   37063         call_tests++;
   37064         des_const_xmlChar_ptr(n_cur, (const xmlChar *)cur, 0);
   37065         des_int(n_len, len, 1);
   37066         xmlResetLastError();
   37067         if (mem_base != xmlMemBlocks()) {
   37068             printf("Leak of %d blocks found in xmlStrndup",
   37069 	           xmlMemBlocks() - mem_base);
   37070 	    test_ret++;
   37071             printf(" %d", n_cur);
   37072             printf(" %d", n_len);
   37073             printf("\n");
   37074         }
   37075     }
   37076     }
   37077     function_tests++;
   37078 
   37079     return(test_ret);
   37080 }
   37081 
   37082 
   37083 static int
   37084 test_xmlStrstr(void) {
   37085     int test_ret = 0;
   37086 
   37087     int mem_base;
   37088     const xmlChar * ret_val;
   37089     xmlChar * str; /* the xmlChar * array (haystack) */
   37090     int n_str;
   37091     xmlChar * val; /* the xmlChar to search (needle) */
   37092     int n_val;
   37093 
   37094     for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) {
   37095     for (n_val = 0;n_val < gen_nb_const_xmlChar_ptr;n_val++) {
   37096         mem_base = xmlMemBlocks();
   37097         str = gen_const_xmlChar_ptr(n_str, 0);
   37098         val = gen_const_xmlChar_ptr(n_val, 1);
   37099 
   37100         ret_val = xmlStrstr((const xmlChar *)str, (const xmlChar *)val);
   37101         desret_const_xmlChar_ptr(ret_val);
   37102         call_tests++;
   37103         des_const_xmlChar_ptr(n_str, (const xmlChar *)str, 0);
   37104         des_const_xmlChar_ptr(n_val, (const xmlChar *)val, 1);
   37105         xmlResetLastError();
   37106         if (mem_base != xmlMemBlocks()) {
   37107             printf("Leak of %d blocks found in xmlStrstr",
   37108 	           xmlMemBlocks() - mem_base);
   37109 	    test_ret++;
   37110             printf(" %d", n_str);
   37111             printf(" %d", n_val);
   37112             printf("\n");
   37113         }
   37114     }
   37115     }
   37116     function_tests++;
   37117 
   37118     return(test_ret);
   37119 }
   37120 
   37121 
   37122 static int
   37123 test_xmlStrsub(void) {
   37124     int test_ret = 0;
   37125 
   37126     int mem_base;
   37127     xmlChar * ret_val;
   37128     xmlChar * str; /* the xmlChar * array (haystack) */
   37129     int n_str;
   37130     int start; /* the index of the first char (zero based) */
   37131     int n_start;
   37132     int len; /* the length of the substring */
   37133     int n_len;
   37134 
   37135     for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) {
   37136     for (n_start = 0;n_start < gen_nb_int;n_start++) {
   37137     for (n_len = 0;n_len < gen_nb_int;n_len++) {
   37138         mem_base = xmlMemBlocks();
   37139         str = gen_const_xmlChar_ptr(n_str, 0);
   37140         start = gen_int(n_start, 1);
   37141         len = gen_int(n_len, 2);
   37142         if ((str != NULL) &&
   37143             (start > (int) strlen((const char *) str) + 1))
   37144             continue;
   37145         if ((str != NULL) &&
   37146             (len > (int) strlen((const char *) str) + 1))
   37147             continue;
   37148 
   37149         ret_val = xmlStrsub((const xmlChar *)str, start, len);
   37150         desret_xmlChar_ptr(ret_val);
   37151         call_tests++;
   37152         des_const_xmlChar_ptr(n_str, (const xmlChar *)str, 0);
   37153         des_int(n_start, start, 1);
   37154         des_int(n_len, len, 2);
   37155         xmlResetLastError();
   37156         if (mem_base != xmlMemBlocks()) {
   37157             printf("Leak of %d blocks found in xmlStrsub",
   37158 	           xmlMemBlocks() - mem_base);
   37159 	    test_ret++;
   37160             printf(" %d", n_str);
   37161             printf(" %d", n_start);
   37162             printf(" %d", n_len);
   37163             printf("\n");
   37164         }
   37165     }
   37166     }
   37167     }
   37168     function_tests++;
   37169 
   37170     return(test_ret);
   37171 }
   37172 
   37173 
   37174 static int
   37175 test_xmlUTF8Charcmp(void) {
   37176     int test_ret = 0;
   37177 
   37178     int mem_base;
   37179     int ret_val;
   37180     xmlChar * utf1; /* pointer to first UTF8 char */
   37181     int n_utf1;
   37182     xmlChar * utf2; /* pointer to second UTF8 char */
   37183     int n_utf2;
   37184 
   37185     for (n_utf1 = 0;n_utf1 < gen_nb_const_xmlChar_ptr;n_utf1++) {
   37186     for (n_utf2 = 0;n_utf2 < gen_nb_const_xmlChar_ptr;n_utf2++) {
   37187         mem_base = xmlMemBlocks();
   37188         utf1 = gen_const_xmlChar_ptr(n_utf1, 0);
   37189         utf2 = gen_const_xmlChar_ptr(n_utf2, 1);
   37190 
   37191         ret_val = xmlUTF8Charcmp((const xmlChar *)utf1, (const xmlChar *)utf2);
   37192         desret_int(ret_val);
   37193         call_tests++;
   37194         des_const_xmlChar_ptr(n_utf1, (const xmlChar *)utf1, 0);
   37195         des_const_xmlChar_ptr(n_utf2, (const xmlChar *)utf2, 1);
   37196         xmlResetLastError();
   37197         if (mem_base != xmlMemBlocks()) {
   37198             printf("Leak of %d blocks found in xmlUTF8Charcmp",
   37199 	           xmlMemBlocks() - mem_base);
   37200 	    test_ret++;
   37201             printf(" %d", n_utf1);
   37202             printf(" %d", n_utf2);
   37203             printf("\n");
   37204         }
   37205     }
   37206     }
   37207     function_tests++;
   37208 
   37209     return(test_ret);
   37210 }
   37211 
   37212 
   37213 static int
   37214 test_xmlUTF8Size(void) {
   37215     int test_ret = 0;
   37216 
   37217     int mem_base;
   37218     int ret_val;
   37219     xmlChar * utf; /* pointer to the UTF8 character */
   37220     int n_utf;
   37221 
   37222     for (n_utf = 0;n_utf < gen_nb_const_xmlChar_ptr;n_utf++) {
   37223         mem_base = xmlMemBlocks();
   37224         utf = gen_const_xmlChar_ptr(n_utf, 0);
   37225 
   37226         ret_val = xmlUTF8Size((const xmlChar *)utf);
   37227         desret_int(ret_val);
   37228         call_tests++;
   37229         des_const_xmlChar_ptr(n_utf, (const xmlChar *)utf, 0);
   37230         xmlResetLastError();
   37231         if (mem_base != xmlMemBlocks()) {
   37232             printf("Leak of %d blocks found in xmlUTF8Size",
   37233 	           xmlMemBlocks() - mem_base);
   37234 	    test_ret++;
   37235             printf(" %d", n_utf);
   37236             printf("\n");
   37237         }
   37238     }
   37239     function_tests++;
   37240 
   37241     return(test_ret);
   37242 }
   37243 
   37244 
   37245 static int
   37246 test_xmlUTF8Strlen(void) {
   37247     int test_ret = 0;
   37248 
   37249     int mem_base;
   37250     int ret_val;
   37251     xmlChar * utf; /* a sequence of UTF-8 encoded bytes */
   37252     int n_utf;
   37253 
   37254     for (n_utf = 0;n_utf < gen_nb_const_xmlChar_ptr;n_utf++) {
   37255         mem_base = xmlMemBlocks();
   37256         utf = gen_const_xmlChar_ptr(n_utf, 0);
   37257 
   37258         ret_val = xmlUTF8Strlen((const xmlChar *)utf);
   37259         desret_int(ret_val);
   37260         call_tests++;
   37261         des_const_xmlChar_ptr(n_utf, (const xmlChar *)utf, 0);
   37262         xmlResetLastError();
   37263         if (mem_base != xmlMemBlocks()) {
   37264             printf("Leak of %d blocks found in xmlUTF8Strlen",
   37265 	           xmlMemBlocks() - mem_base);
   37266 	    test_ret++;
   37267             printf(" %d", n_utf);
   37268             printf("\n");
   37269         }
   37270     }
   37271     function_tests++;
   37272 
   37273     return(test_ret);
   37274 }
   37275 
   37276 
   37277 static int
   37278 test_xmlUTF8Strloc(void) {
   37279     int test_ret = 0;
   37280 
   37281     int mem_base;
   37282     int ret_val;
   37283     xmlChar * utf; /* the input UTF8 * */
   37284     int n_utf;
   37285     xmlChar * utfchar; /* the UTF8 character to be found */
   37286     int n_utfchar;
   37287 
   37288     for (n_utf = 0;n_utf < gen_nb_const_xmlChar_ptr;n_utf++) {
   37289     for (n_utfchar = 0;n_utfchar < gen_nb_const_xmlChar_ptr;n_utfchar++) {
   37290         mem_base = xmlMemBlocks();
   37291         utf = gen_const_xmlChar_ptr(n_utf, 0);
   37292         utfchar = gen_const_xmlChar_ptr(n_utfchar, 1);
   37293 
   37294         ret_val = xmlUTF8Strloc((const xmlChar *)utf, (const xmlChar *)utfchar);
   37295         desret_int(ret_val);
   37296         call_tests++;
   37297         des_const_xmlChar_ptr(n_utf, (const xmlChar *)utf, 0);
   37298         des_const_xmlChar_ptr(n_utfchar, (const xmlChar *)utfchar, 1);
   37299         xmlResetLastError();
   37300         if (mem_base != xmlMemBlocks()) {
   37301             printf("Leak of %d blocks found in xmlUTF8Strloc",
   37302 	           xmlMemBlocks() - mem_base);
   37303 	    test_ret++;
   37304             printf(" %d", n_utf);
   37305             printf(" %d", n_utfchar);
   37306             printf("\n");
   37307         }
   37308     }
   37309     }
   37310     function_tests++;
   37311 
   37312     return(test_ret);
   37313 }
   37314 
   37315 
   37316 static int
   37317 test_xmlUTF8Strndup(void) {
   37318     int test_ret = 0;
   37319 
   37320     int mem_base;
   37321     xmlChar * ret_val;
   37322     xmlChar * utf; /* the input UTF8 * */
   37323     int n_utf;
   37324     int len; /* the len of @utf (in chars) */
   37325     int n_len;
   37326 
   37327     for (n_utf = 0;n_utf < gen_nb_const_xmlChar_ptr;n_utf++) {
   37328     for (n_len = 0;n_len < gen_nb_int;n_len++) {
   37329         mem_base = xmlMemBlocks();
   37330         utf = gen_const_xmlChar_ptr(n_utf, 0);
   37331         len = gen_int(n_len, 1);
   37332         if ((utf != NULL) &&
   37333             (len > (int) strlen((const char *) utf) + 1))
   37334             continue;
   37335 
   37336         ret_val = xmlUTF8Strndup((const xmlChar *)utf, len);
   37337         desret_xmlChar_ptr(ret_val);
   37338         call_tests++;
   37339         des_const_xmlChar_ptr(n_utf, (const xmlChar *)utf, 0);
   37340         des_int(n_len, len, 1);
   37341         xmlResetLastError();
   37342         if (mem_base != xmlMemBlocks()) {
   37343             printf("Leak of %d blocks found in xmlUTF8Strndup",
   37344 	           xmlMemBlocks() - mem_base);
   37345 	    test_ret++;
   37346             printf(" %d", n_utf);
   37347             printf(" %d", n_len);
   37348             printf("\n");
   37349         }
   37350     }
   37351     }
   37352     function_tests++;
   37353 
   37354     return(test_ret);
   37355 }
   37356 
   37357 
   37358 static int
   37359 test_xmlUTF8Strpos(void) {
   37360     int test_ret = 0;
   37361 
   37362     int mem_base;
   37363     const xmlChar * ret_val;
   37364     xmlChar * utf; /* the input UTF8 * */
   37365     int n_utf;
   37366     int pos; /* the position of the desired UTF8 char (in chars) */
   37367     int n_pos;
   37368 
   37369     for (n_utf = 0;n_utf < gen_nb_const_xmlChar_ptr;n_utf++) {
   37370     for (n_pos = 0;n_pos < gen_nb_int;n_pos++) {
   37371         mem_base = xmlMemBlocks();
   37372         utf = gen_const_xmlChar_ptr(n_utf, 0);
   37373         pos = gen_int(n_pos, 1);
   37374 
   37375         ret_val = xmlUTF8Strpos((const xmlChar *)utf, pos);
   37376         desret_const_xmlChar_ptr(ret_val);
   37377         call_tests++;
   37378         des_const_xmlChar_ptr(n_utf, (const xmlChar *)utf, 0);
   37379         des_int(n_pos, pos, 1);
   37380         xmlResetLastError();
   37381         if (mem_base != xmlMemBlocks()) {
   37382             printf("Leak of %d blocks found in xmlUTF8Strpos",
   37383 	           xmlMemBlocks() - mem_base);
   37384 	    test_ret++;
   37385             printf(" %d", n_utf);
   37386             printf(" %d", n_pos);
   37387             printf("\n");
   37388         }
   37389     }
   37390     }
   37391     function_tests++;
   37392 
   37393     return(test_ret);
   37394 }
   37395 
   37396 
   37397 static int
   37398 test_xmlUTF8Strsize(void) {
   37399     int test_ret = 0;
   37400 
   37401     int mem_base;
   37402     int ret_val;
   37403     xmlChar * utf; /* a sequence of UTF-8 encoded bytes */
   37404     int n_utf;
   37405     int len; /* the number of characters in the array */
   37406     int n_len;
   37407 
   37408     for (n_utf = 0;n_utf < gen_nb_const_xmlChar_ptr;n_utf++) {
   37409     for (n_len = 0;n_len < gen_nb_int;n_len++) {
   37410         mem_base = xmlMemBlocks();
   37411         utf = gen_const_xmlChar_ptr(n_utf, 0);
   37412         len = gen_int(n_len, 1);
   37413         if ((utf != NULL) &&
   37414             (len > (int) strlen((const char *) utf) + 1))
   37415             continue;
   37416 
   37417         ret_val = xmlUTF8Strsize((const xmlChar *)utf, len);
   37418         desret_int(ret_val);
   37419         call_tests++;
   37420         des_const_xmlChar_ptr(n_utf, (const xmlChar *)utf, 0);
   37421         des_int(n_len, len, 1);
   37422         xmlResetLastError();
   37423         if (mem_base != xmlMemBlocks()) {
   37424             printf("Leak of %d blocks found in xmlUTF8Strsize",
   37425 	           xmlMemBlocks() - mem_base);
   37426 	    test_ret++;
   37427             printf(" %d", n_utf);
   37428             printf(" %d", n_len);
   37429             printf("\n");
   37430         }
   37431     }
   37432     }
   37433     function_tests++;
   37434 
   37435     return(test_ret);
   37436 }
   37437 
   37438 
   37439 static int
   37440 test_xmlUTF8Strsub(void) {
   37441     int test_ret = 0;
   37442 
   37443     int mem_base;
   37444     xmlChar * ret_val;
   37445     xmlChar * utf; /* a sequence of UTF-8 encoded bytes */
   37446     int n_utf;
   37447     int start; /* relative pos of first char */
   37448     int n_start;
   37449     int len; /* total number to copy */
   37450     int n_len;
   37451 
   37452     for (n_utf = 0;n_utf < gen_nb_const_xmlChar_ptr;n_utf++) {
   37453     for (n_start = 0;n_start < gen_nb_int;n_start++) {
   37454     for (n_len = 0;n_len < gen_nb_int;n_len++) {
   37455         mem_base = xmlMemBlocks();
   37456         utf = gen_const_xmlChar_ptr(n_utf, 0);
   37457         start = gen_int(n_start, 1);
   37458         len = gen_int(n_len, 2);
   37459         if ((utf != NULL) &&
   37460             (start > (int) strlen((const char *) utf) + 1))
   37461             continue;
   37462         if ((utf != NULL) &&
   37463             (len > (int) strlen((const char *) utf) + 1))
   37464             continue;
   37465 
   37466         ret_val = xmlUTF8Strsub((const xmlChar *)utf, start, len);
   37467         desret_xmlChar_ptr(ret_val);
   37468         call_tests++;
   37469         des_const_xmlChar_ptr(n_utf, (const xmlChar *)utf, 0);
   37470         des_int(n_start, start, 1);
   37471         des_int(n_len, len, 2);
   37472         xmlResetLastError();
   37473         if (mem_base != xmlMemBlocks()) {
   37474             printf("Leak of %d blocks found in xmlUTF8Strsub",
   37475 	           xmlMemBlocks() - mem_base);
   37476 	    test_ret++;
   37477             printf(" %d", n_utf);
   37478             printf(" %d", n_start);
   37479             printf(" %d", n_len);
   37480             printf("\n");
   37481         }
   37482     }
   37483     }
   37484     }
   37485     function_tests++;
   37486 
   37487     return(test_ret);
   37488 }
   37489 
   37490 static int
   37491 test_xmlstring(void) {
   37492     int test_ret = 0;
   37493 
   37494     if (quiet == 0) printf("Testing xmlstring : 26 of 30 functions ...\n");
   37495     test_ret += test_xmlCharStrdup();
   37496     test_ret += test_xmlCharStrndup();
   37497     test_ret += test_xmlCheckUTF8();
   37498     test_ret += test_xmlGetUTF8Char();
   37499     test_ret += test_xmlStrEqual();
   37500     test_ret += test_xmlStrPrintf();
   37501     test_ret += test_xmlStrQEqual();
   37502     test_ret += test_xmlStrVPrintf();
   37503     test_ret += test_xmlStrcasecmp();
   37504     test_ret += test_xmlStrcasestr();
   37505     test_ret += test_xmlStrchr();
   37506     test_ret += test_xmlStrcmp();
   37507     test_ret += test_xmlStrdup();
   37508     test_ret += test_xmlStrlen();
   37509     test_ret += test_xmlStrncasecmp();
   37510     test_ret += test_xmlStrncatNew();
   37511     test_ret += test_xmlStrncmp();
   37512     test_ret += test_xmlStrndup();
   37513     test_ret += test_xmlStrstr();
   37514     test_ret += test_xmlStrsub();
   37515     test_ret += test_xmlUTF8Charcmp();
   37516     test_ret += test_xmlUTF8Size();
   37517     test_ret += test_xmlUTF8Strlen();
   37518     test_ret += test_xmlUTF8Strloc();
   37519     test_ret += test_xmlUTF8Strndup();
   37520     test_ret += test_xmlUTF8Strpos();
   37521     test_ret += test_xmlUTF8Strsize();
   37522     test_ret += test_xmlUTF8Strsub();
   37523 
   37524     if (test_ret != 0)
   37525 	printf("Module xmlstring: %d errors\n", test_ret);
   37526     return(test_ret);
   37527 }
   37528 
   37529 static int
   37530 test_xmlUCSIsAegeanNumbers(void) {
   37531     int test_ret = 0;
   37532 
   37533 #if defined(LIBXML_UNICODE_ENABLED)
   37534     int mem_base;
   37535     int ret_val;
   37536     int code; /* UCS code point */
   37537     int n_code;
   37538 
   37539     for (n_code = 0;n_code < gen_nb_int;n_code++) {
   37540         mem_base = xmlMemBlocks();
   37541         code = gen_int(n_code, 0);
   37542 
   37543         ret_val = xmlUCSIsAegeanNumbers(code);
   37544         desret_int(ret_val);
   37545         call_tests++;
   37546         des_int(n_code, code, 0);
   37547         xmlResetLastError();
   37548         if (mem_base != xmlMemBlocks()) {
   37549             printf("Leak of %d blocks found in xmlUCSIsAegeanNumbers",
   37550 	           xmlMemBlocks() - mem_base);
   37551 	    test_ret++;
   37552             printf(" %d", n_code);
   37553             printf("\n");
   37554         }
   37555     }
   37556     function_tests++;
   37557 #endif
   37558 
   37559     return(test_ret);
   37560 }
   37561 
   37562 
   37563 static int
   37564 test_xmlUCSIsAlphabeticPresentationForms(void) {
   37565     int test_ret = 0;
   37566 
   37567 #if defined(LIBXML_UNICODE_ENABLED)
   37568     int mem_base;
   37569     int ret_val;
   37570     int code; /* UCS code point */
   37571     int n_code;
   37572 
   37573     for (n_code = 0;n_code < gen_nb_int;n_code++) {
   37574         mem_base = xmlMemBlocks();
   37575         code = gen_int(n_code, 0);
   37576 
   37577         ret_val = xmlUCSIsAlphabeticPresentationForms(code);
   37578         desret_int(ret_val);
   37579         call_tests++;
   37580         des_int(n_code, code, 0);
   37581         xmlResetLastError();
   37582         if (mem_base != xmlMemBlocks()) {
   37583             printf("Leak of %d blocks found in xmlUCSIsAlphabeticPresentationForms",
   37584 	           xmlMemBlocks() - mem_base);
   37585 	    test_ret++;
   37586             printf(" %d", n_code);
   37587             printf("\n");
   37588         }
   37589     }
   37590     function_tests++;
   37591 #endif
   37592 
   37593     return(test_ret);
   37594 }
   37595 
   37596 
   37597 static int
   37598 test_xmlUCSIsArabic(void) {
   37599     int test_ret = 0;
   37600 
   37601 #if defined(LIBXML_UNICODE_ENABLED)
   37602     int mem_base;
   37603     int ret_val;
   37604     int code; /* UCS code point */
   37605     int n_code;
   37606 
   37607     for (n_code = 0;n_code < gen_nb_int;n_code++) {
   37608         mem_base = xmlMemBlocks();
   37609         code = gen_int(n_code, 0);
   37610 
   37611         ret_val = xmlUCSIsArabic(code);
   37612         desret_int(ret_val);
   37613         call_tests++;
   37614         des_int(n_code, code, 0);
   37615         xmlResetLastError();
   37616         if (mem_base != xmlMemBlocks()) {
   37617             printf("Leak of %d blocks found in xmlUCSIsArabic",
   37618 	           xmlMemBlocks() - mem_base);
   37619 	    test_ret++;
   37620             printf(" %d", n_code);
   37621             printf("\n");
   37622         }
   37623     }
   37624     function_tests++;
   37625 #endif
   37626 
   37627     return(test_ret);
   37628 }
   37629 
   37630 
   37631 static int
   37632 test_xmlUCSIsArabicPresentationFormsA(void) {
   37633     int test_ret = 0;
   37634 
   37635 #if defined(LIBXML_UNICODE_ENABLED)
   37636     int mem_base;
   37637     int ret_val;
   37638     int code; /* UCS code point */
   37639     int n_code;
   37640 
   37641     for (n_code = 0;n_code < gen_nb_int;n_code++) {
   37642         mem_base = xmlMemBlocks();
   37643         code = gen_int(n_code, 0);
   37644 
   37645         ret_val = xmlUCSIsArabicPresentationFormsA(code);
   37646         desret_int(ret_val);
   37647         call_tests++;
   37648         des_int(n_code, code, 0);
   37649         xmlResetLastError();
   37650         if (mem_base != xmlMemBlocks()) {
   37651             printf("Leak of %d blocks found in xmlUCSIsArabicPresentationFormsA",
   37652 	           xmlMemBlocks() - mem_base);
   37653 	    test_ret++;
   37654             printf(" %d", n_code);
   37655             printf("\n");
   37656         }
   37657     }
   37658     function_tests++;
   37659 #endif
   37660 
   37661     return(test_ret);
   37662 }
   37663 
   37664 
   37665 static int
   37666 test_xmlUCSIsArabicPresentationFormsB(void) {
   37667     int test_ret = 0;
   37668 
   37669 #if defined(LIBXML_UNICODE_ENABLED)
   37670     int mem_base;
   37671     int ret_val;
   37672     int code; /* UCS code point */
   37673     int n_code;
   37674 
   37675     for (n_code = 0;n_code < gen_nb_int;n_code++) {
   37676         mem_base = xmlMemBlocks();
   37677         code = gen_int(n_code, 0);
   37678 
   37679         ret_val = xmlUCSIsArabicPresentationFormsB(code);
   37680         desret_int(ret_val);
   37681         call_tests++;
   37682         des_int(n_code, code, 0);
   37683         xmlResetLastError();
   37684         if (mem_base != xmlMemBlocks()) {
   37685             printf("Leak of %d blocks found in xmlUCSIsArabicPresentationFormsB",
   37686 	           xmlMemBlocks() - mem_base);
   37687 	    test_ret++;
   37688             printf(" %d", n_code);
   37689             printf("\n");
   37690         }
   37691     }
   37692     function_tests++;
   37693 #endif
   37694 
   37695     return(test_ret);
   37696 }
   37697 
   37698 
   37699 static int
   37700 test_xmlUCSIsArmenian(void) {
   37701     int test_ret = 0;
   37702 
   37703 #if defined(LIBXML_UNICODE_ENABLED)
   37704     int mem_base;
   37705     int ret_val;
   37706     int code; /* UCS code point */
   37707     int n_code;
   37708 
   37709     for (n_code = 0;n_code < gen_nb_int;n_code++) {
   37710         mem_base = xmlMemBlocks();
   37711         code = gen_int(n_code, 0);
   37712 
   37713         ret_val = xmlUCSIsArmenian(code);
   37714         desret_int(ret_val);
   37715         call_tests++;
   37716         des_int(n_code, code, 0);
   37717         xmlResetLastError();
   37718         if (mem_base != xmlMemBlocks()) {
   37719             printf("Leak of %d blocks found in xmlUCSIsArmenian",
   37720 	           xmlMemBlocks() - mem_base);
   37721 	    test_ret++;
   37722             printf(" %d", n_code);
   37723             printf("\n");
   37724         }
   37725     }
   37726     function_tests++;
   37727 #endif
   37728 
   37729     return(test_ret);
   37730 }
   37731 
   37732 
   37733 static int
   37734 test_xmlUCSIsArrows(void) {
   37735     int test_ret = 0;
   37736 
   37737 #if defined(LIBXML_UNICODE_ENABLED)
   37738     int mem_base;
   37739     int ret_val;
   37740     int code; /* UCS code point */
   37741     int n_code;
   37742 
   37743     for (n_code = 0;n_code < gen_nb_int;n_code++) {
   37744         mem_base = xmlMemBlocks();
   37745         code = gen_int(n_code, 0);
   37746 
   37747         ret_val = xmlUCSIsArrows(code);
   37748         desret_int(ret_val);
   37749         call_tests++;
   37750         des_int(n_code, code, 0);
   37751         xmlResetLastError();
   37752         if (mem_base != xmlMemBlocks()) {
   37753             printf("Leak of %d blocks found in xmlUCSIsArrows",
   37754 	           xmlMemBlocks() - mem_base);
   37755 	    test_ret++;
   37756             printf(" %d", n_code);
   37757             printf("\n");
   37758         }
   37759     }
   37760     function_tests++;
   37761 #endif
   37762 
   37763     return(test_ret);
   37764 }
   37765 
   37766 
   37767 static int
   37768 test_xmlUCSIsBasicLatin(void) {
   37769     int test_ret = 0;
   37770 
   37771 #if defined(LIBXML_UNICODE_ENABLED)
   37772     int mem_base;
   37773     int ret_val;
   37774     int code; /* UCS code point */
   37775     int n_code;
   37776 
   37777     for (n_code = 0;n_code < gen_nb_int;n_code++) {
   37778         mem_base = xmlMemBlocks();
   37779         code = gen_int(n_code, 0);
   37780 
   37781         ret_val = xmlUCSIsBasicLatin(code);
   37782         desret_int(ret_val);
   37783         call_tests++;
   37784         des_int(n_code, code, 0);
   37785         xmlResetLastError();
   37786         if (mem_base != xmlMemBlocks()) {
   37787             printf("Leak of %d blocks found in xmlUCSIsBasicLatin",
   37788 	           xmlMemBlocks() - mem_base);
   37789 	    test_ret++;
   37790             printf(" %d", n_code);
   37791             printf("\n");
   37792         }
   37793     }
   37794     function_tests++;
   37795 #endif
   37796 
   37797     return(test_ret);
   37798 }
   37799 
   37800 
   37801 static int
   37802 test_xmlUCSIsBengali(void) {
   37803     int test_ret = 0;
   37804 
   37805 #if defined(LIBXML_UNICODE_ENABLED)
   37806     int mem_base;
   37807     int ret_val;
   37808     int code; /* UCS code point */
   37809     int n_code;
   37810 
   37811     for (n_code = 0;n_code < gen_nb_int;n_code++) {
   37812         mem_base = xmlMemBlocks();
   37813         code = gen_int(n_code, 0);
   37814 
   37815         ret_val = xmlUCSIsBengali(code);
   37816         desret_int(ret_val);
   37817         call_tests++;
   37818         des_int(n_code, code, 0);
   37819         xmlResetLastError();
   37820         if (mem_base != xmlMemBlocks()) {
   37821             printf("Leak of %d blocks found in xmlUCSIsBengali",
   37822 	           xmlMemBlocks() - mem_base);
   37823 	    test_ret++;
   37824             printf(" %d", n_code);
   37825             printf("\n");
   37826         }
   37827     }
   37828     function_tests++;
   37829 #endif
   37830 
   37831     return(test_ret);
   37832 }
   37833 
   37834 
   37835 static int
   37836 test_xmlUCSIsBlock(void) {
   37837     int test_ret = 0;
   37838 
   37839 #if defined(LIBXML_UNICODE_ENABLED)
   37840     int mem_base;
   37841     int ret_val;
   37842     int code; /* UCS code point */
   37843     int n_code;
   37844     char * block; /* UCS block name */
   37845     int n_block;
   37846 
   37847     for (n_code = 0;n_code < gen_nb_int;n_code++) {
   37848     for (n_block = 0;n_block < gen_nb_const_char_ptr;n_block++) {
   37849         mem_base = xmlMemBlocks();
   37850         code = gen_int(n_code, 0);
   37851         block = gen_const_char_ptr(n_block, 1);
   37852 
   37853         ret_val = xmlUCSIsBlock(code, (const char *)block);
   37854         desret_int(ret_val);
   37855         call_tests++;
   37856         des_int(n_code, code, 0);
   37857         des_const_char_ptr(n_block, (const char *)block, 1);
   37858         xmlResetLastError();
   37859         if (mem_base != xmlMemBlocks()) {
   37860             printf("Leak of %d blocks found in xmlUCSIsBlock",
   37861 	           xmlMemBlocks() - mem_base);
   37862 	    test_ret++;
   37863             printf(" %d", n_code);
   37864             printf(" %d", n_block);
   37865             printf("\n");
   37866         }
   37867     }
   37868     }
   37869     function_tests++;
   37870 #endif
   37871 
   37872     return(test_ret);
   37873 }
   37874 
   37875 
   37876 static int
   37877 test_xmlUCSIsBlockElements(void) {
   37878     int test_ret = 0;
   37879 
   37880 #if defined(LIBXML_UNICODE_ENABLED)
   37881     int mem_base;
   37882     int ret_val;
   37883     int code; /* UCS code point */
   37884     int n_code;
   37885 
   37886     for (n_code = 0;n_code < gen_nb_int;n_code++) {
   37887         mem_base = xmlMemBlocks();
   37888         code = gen_int(n_code, 0);
   37889 
   37890         ret_val = xmlUCSIsBlockElements(code);
   37891         desret_int(ret_val);
   37892         call_tests++;
   37893         des_int(n_code, code, 0);
   37894         xmlResetLastError();
   37895         if (mem_base != xmlMemBlocks()) {
   37896             printf("Leak of %d blocks found in xmlUCSIsBlockElements",
   37897 	           xmlMemBlocks() - mem_base);
   37898 	    test_ret++;
   37899             printf(" %d", n_code);
   37900             printf("\n");
   37901         }
   37902     }
   37903     function_tests++;
   37904 #endif
   37905 
   37906     return(test_ret);
   37907 }
   37908 
   37909 
   37910 static int
   37911 test_xmlUCSIsBopomofo(void) {
   37912     int test_ret = 0;
   37913 
   37914 #if defined(LIBXML_UNICODE_ENABLED)
   37915     int mem_base;
   37916     int ret_val;
   37917     int code; /* UCS code point */
   37918     int n_code;
   37919 
   37920     for (n_code = 0;n_code < gen_nb_int;n_code++) {
   37921         mem_base = xmlMemBlocks();
   37922         code = gen_int(n_code, 0);
   37923 
   37924         ret_val = xmlUCSIsBopomofo(code);
   37925         desret_int(ret_val);
   37926         call_tests++;
   37927         des_int(n_code, code, 0);
   37928         xmlResetLastError();
   37929         if (mem_base != xmlMemBlocks()) {
   37930             printf("Leak of %d blocks found in xmlUCSIsBopomofo",
   37931 	           xmlMemBlocks() - mem_base);
   37932 	    test_ret++;
   37933             printf(" %d", n_code);
   37934             printf("\n");
   37935         }
   37936     }
   37937     function_tests++;
   37938 #endif
   37939 
   37940     return(test_ret);
   37941 }
   37942 
   37943 
   37944 static int
   37945 test_xmlUCSIsBopomofoExtended(void) {
   37946     int test_ret = 0;
   37947 
   37948 #if defined(LIBXML_UNICODE_ENABLED)
   37949     int mem_base;
   37950     int ret_val;
   37951     int code; /* UCS code point */
   37952     int n_code;
   37953 
   37954     for (n_code = 0;n_code < gen_nb_int;n_code++) {
   37955         mem_base = xmlMemBlocks();
   37956         code = gen_int(n_code, 0);
   37957 
   37958         ret_val = xmlUCSIsBopomofoExtended(code);
   37959         desret_int(ret_val);
   37960         call_tests++;
   37961         des_int(n_code, code, 0);
   37962         xmlResetLastError();
   37963         if (mem_base != xmlMemBlocks()) {
   37964             printf("Leak of %d blocks found in xmlUCSIsBopomofoExtended",
   37965 	           xmlMemBlocks() - mem_base);
   37966 	    test_ret++;
   37967             printf(" %d", n_code);
   37968             printf("\n");
   37969         }
   37970     }
   37971     function_tests++;
   37972 #endif
   37973 
   37974     return(test_ret);
   37975 }
   37976 
   37977 
   37978 static int
   37979 test_xmlUCSIsBoxDrawing(void) {
   37980     int test_ret = 0;
   37981 
   37982 #if defined(LIBXML_UNICODE_ENABLED)
   37983     int mem_base;
   37984     int ret_val;
   37985     int code; /* UCS code point */
   37986     int n_code;
   37987 
   37988     for (n_code = 0;n_code < gen_nb_int;n_code++) {
   37989         mem_base = xmlMemBlocks();
   37990         code = gen_int(n_code, 0);
   37991 
   37992         ret_val = xmlUCSIsBoxDrawing(code);
   37993         desret_int(ret_val);
   37994         call_tests++;
   37995         des_int(n_code, code, 0);
   37996         xmlResetLastError();
   37997         if (mem_base != xmlMemBlocks()) {
   37998             printf("Leak of %d blocks found in xmlUCSIsBoxDrawing",
   37999 	           xmlMemBlocks() - mem_base);
   38000 	    test_ret++;
   38001             printf(" %d", n_code);
   38002             printf("\n");
   38003         }
   38004     }
   38005     function_tests++;
   38006 #endif
   38007 
   38008     return(test_ret);
   38009 }
   38010 
   38011 
   38012 static int
   38013 test_xmlUCSIsBraillePatterns(void) {
   38014     int test_ret = 0;
   38015 
   38016 #if defined(LIBXML_UNICODE_ENABLED)
   38017     int mem_base;
   38018     int ret_val;
   38019     int code; /* UCS code point */
   38020     int n_code;
   38021 
   38022     for (n_code = 0;n_code < gen_nb_int;n_code++) {
   38023         mem_base = xmlMemBlocks();
   38024         code = gen_int(n_code, 0);
   38025 
   38026         ret_val = xmlUCSIsBraillePatterns(code);
   38027         desret_int(ret_val);
   38028         call_tests++;
   38029         des_int(n_code, code, 0);
   38030         xmlResetLastError();
   38031         if (mem_base != xmlMemBlocks()) {
   38032             printf("Leak of %d blocks found in xmlUCSIsBraillePatterns",
   38033 	           xmlMemBlocks() - mem_base);
   38034 	    test_ret++;
   38035             printf(" %d", n_code);
   38036             printf("\n");
   38037         }
   38038     }
   38039     function_tests++;
   38040 #endif
   38041 
   38042     return(test_ret);
   38043 }
   38044 
   38045 
   38046 static int
   38047 test_xmlUCSIsBuhid(void) {
   38048     int test_ret = 0;
   38049 
   38050 #if defined(LIBXML_UNICODE_ENABLED)
   38051     int mem_base;
   38052     int ret_val;
   38053     int code; /* UCS code point */
   38054     int n_code;
   38055 
   38056     for (n_code = 0;n_code < gen_nb_int;n_code++) {
   38057         mem_base = xmlMemBlocks();
   38058         code = gen_int(n_code, 0);
   38059 
   38060         ret_val = xmlUCSIsBuhid(code);
   38061         desret_int(ret_val);
   38062         call_tests++;
   38063         des_int(n_code, code, 0);
   38064         xmlResetLastError();
   38065         if (mem_base != xmlMemBlocks()) {
   38066             printf("Leak of %d blocks found in xmlUCSIsBuhid",
   38067 	           xmlMemBlocks() - mem_base);
   38068 	    test_ret++;
   38069             printf(" %d", n_code);
   38070             printf("\n");
   38071         }
   38072     }
   38073     function_tests++;
   38074 #endif
   38075 
   38076     return(test_ret);
   38077 }
   38078 
   38079 
   38080 static int
   38081 test_xmlUCSIsByzantineMusicalSymbols(void) {
   38082     int test_ret = 0;
   38083 
   38084 #if defined(LIBXML_UNICODE_ENABLED)
   38085     int mem_base;
   38086     int ret_val;
   38087     int code; /* UCS code point */
   38088     int n_code;
   38089 
   38090     for (n_code = 0;n_code < gen_nb_int;n_code++) {
   38091         mem_base = xmlMemBlocks();
   38092         code = gen_int(n_code, 0);
   38093 
   38094         ret_val = xmlUCSIsByzantineMusicalSymbols(code);
   38095         desret_int(ret_val);
   38096         call_tests++;
   38097         des_int(n_code, code, 0);
   38098         xmlResetLastError();
   38099         if (mem_base != xmlMemBlocks()) {
   38100             printf("Leak of %d blocks found in xmlUCSIsByzantineMusicalSymbols",
   38101 	           xmlMemBlocks() - mem_base);
   38102 	    test_ret++;
   38103             printf(" %d", n_code);
   38104             printf("\n");
   38105         }
   38106     }
   38107     function_tests++;
   38108 #endif
   38109 
   38110     return(test_ret);
   38111 }
   38112 
   38113 
   38114 static int
   38115 test_xmlUCSIsCJKCompatibility(void) {
   38116     int test_ret = 0;
   38117 
   38118 #if defined(LIBXML_UNICODE_ENABLED)
   38119     int mem_base;
   38120     int ret_val;
   38121     int code; /* UCS code point */
   38122     int n_code;
   38123 
   38124     for (n_code = 0;n_code < gen_nb_int;n_code++) {
   38125         mem_base = xmlMemBlocks();
   38126         code = gen_int(n_code, 0);
   38127 
   38128         ret_val = xmlUCSIsCJKCompatibility(code);
   38129         desret_int(ret_val);
   38130         call_tests++;
   38131         des_int(n_code, code, 0);
   38132         xmlResetLastError();
   38133         if (mem_base != xmlMemBlocks()) {
   38134             printf("Leak of %d blocks found in xmlUCSIsCJKCompatibility",
   38135 	           xmlMemBlocks() - mem_base);
   38136 	    test_ret++;
   38137             printf(" %d", n_code);
   38138             printf("\n");
   38139         }
   38140     }
   38141     function_tests++;
   38142 #endif
   38143 
   38144     return(test_ret);
   38145 }
   38146 
   38147 
   38148 static int
   38149 test_xmlUCSIsCJKCompatibilityForms(void) {
   38150     int test_ret = 0;
   38151 
   38152 #if defined(LIBXML_UNICODE_ENABLED)
   38153     int mem_base;
   38154     int ret_val;
   38155     int code; /* UCS code point */
   38156     int n_code;
   38157 
   38158     for (n_code = 0;n_code < gen_nb_int;n_code++) {
   38159         mem_base = xmlMemBlocks();
   38160         code = gen_int(n_code, 0);
   38161 
   38162         ret_val = xmlUCSIsCJKCompatibilityForms(code);
   38163         desret_int(ret_val);
   38164         call_tests++;
   38165         des_int(n_code, code, 0);
   38166         xmlResetLastError();
   38167         if (mem_base != xmlMemBlocks()) {
   38168             printf("Leak of %d blocks found in xmlUCSIsCJKCompatibilityForms",
   38169 	           xmlMemBlocks() - mem_base);
   38170 	    test_ret++;
   38171             printf(" %d", n_code);
   38172             printf("\n");
   38173         }
   38174     }
   38175     function_tests++;
   38176 #endif
   38177 
   38178     return(test_ret);
   38179 }
   38180 
   38181 
   38182 static int
   38183 test_xmlUCSIsCJKCompatibilityIdeographs(void) {
   38184     int test_ret = 0;
   38185 
   38186 #if defined(LIBXML_UNICODE_ENABLED)
   38187     int mem_base;
   38188     int ret_val;
   38189     int code; /* UCS code point */
   38190     int n_code;
   38191 
   38192     for (n_code = 0;n_code < gen_nb_int;n_code++) {
   38193         mem_base = xmlMemBlocks();
   38194         code = gen_int(n_code, 0);
   38195 
   38196         ret_val = xmlUCSIsCJKCompatibilityIdeographs(code);
   38197         desret_int(ret_val);
   38198         call_tests++;
   38199         des_int(n_code, code, 0);
   38200         xmlResetLastError();
   38201         if (mem_base != xmlMemBlocks()) {
   38202             printf("Leak of %d blocks found in xmlUCSIsCJKCompatibilityIdeographs",
   38203 	           xmlMemBlocks() - mem_base);
   38204 	    test_ret++;
   38205             printf(" %d", n_code);
   38206             printf("\n");
   38207         }
   38208     }
   38209     function_tests++;
   38210 #endif
   38211 
   38212     return(test_ret);
   38213 }
   38214 
   38215 
   38216 static int
   38217 test_xmlUCSIsCJKCompatibilityIdeographsSupplement(void) {
   38218     int test_ret = 0;
   38219 
   38220 #if defined(LIBXML_UNICODE_ENABLED)
   38221     int mem_base;
   38222     int ret_val;
   38223     int code; /* UCS code point */
   38224     int n_code;
   38225 
   38226     for (n_code = 0;n_code < gen_nb_int;n_code++) {
   38227         mem_base = xmlMemBlocks();
   38228         code = gen_int(n_code, 0);
   38229 
   38230         ret_val = xmlUCSIsCJKCompatibilityIdeographsSupplement(code);
   38231         desret_int(ret_val);
   38232         call_tests++;
   38233         des_int(n_code, code, 0);
   38234         xmlResetLastError();
   38235         if (mem_base != xmlMemBlocks()) {
   38236             printf("Leak of %d blocks found in xmlUCSIsCJKCompatibilityIdeographsSupplement",
   38237 	           xmlMemBlocks() - mem_base);
   38238 	    test_ret++;
   38239             printf(" %d", n_code);
   38240             printf("\n");
   38241         }
   38242     }
   38243     function_tests++;
   38244 #endif
   38245 
   38246     return(test_ret);
   38247 }
   38248 
   38249 
   38250 static int
   38251 test_xmlUCSIsCJKRadicalsSupplement(void) {
   38252     int test_ret = 0;
   38253 
   38254 #if defined(LIBXML_UNICODE_ENABLED)
   38255     int mem_base;
   38256     int ret_val;
   38257     int code; /* UCS code point */
   38258     int n_code;
   38259 
   38260     for (n_code = 0;n_code < gen_nb_int;n_code++) {
   38261         mem_base = xmlMemBlocks();
   38262         code = gen_int(n_code, 0);
   38263 
   38264         ret_val = xmlUCSIsCJKRadicalsSupplement(code);
   38265         desret_int(ret_val);
   38266         call_tests++;
   38267         des_int(n_code, code, 0);
   38268         xmlResetLastError();
   38269         if (mem_base != xmlMemBlocks()) {
   38270             printf("Leak of %d blocks found in xmlUCSIsCJKRadicalsSupplement",
   38271 	           xmlMemBlocks() - mem_base);
   38272 	    test_ret++;
   38273             printf(" %d", n_code);
   38274             printf("\n");
   38275         }
   38276     }
   38277     function_tests++;
   38278 #endif
   38279 
   38280     return(test_ret);
   38281 }
   38282 
   38283 
   38284 static int
   38285 test_xmlUCSIsCJKSymbolsandPunctuation(void) {
   38286     int test_ret = 0;
   38287 
   38288 #if defined(LIBXML_UNICODE_ENABLED)
   38289     int mem_base;
   38290     int ret_val;
   38291     int code; /* UCS code point */
   38292     int n_code;
   38293 
   38294     for (n_code = 0;n_code < gen_nb_int;n_code++) {
   38295         mem_base = xmlMemBlocks();
   38296         code = gen_int(n_code, 0);
   38297 
   38298         ret_val = xmlUCSIsCJKSymbolsandPunctuation(code);
   38299         desret_int(ret_val);
   38300         call_tests++;
   38301         des_int(n_code, code, 0);
   38302         xmlResetLastError();
   38303         if (mem_base != xmlMemBlocks()) {
   38304             printf("Leak of %d blocks found in xmlUCSIsCJKSymbolsandPunctuation",
   38305 	           xmlMemBlocks() - mem_base);
   38306 	    test_ret++;
   38307             printf(" %d", n_code);
   38308             printf("\n");
   38309         }
   38310     }
   38311     function_tests++;
   38312 #endif
   38313 
   38314     return(test_ret);
   38315 }
   38316 
   38317 
   38318 static int
   38319 test_xmlUCSIsCJKUnifiedIdeographs(void) {
   38320     int test_ret = 0;
   38321 
   38322 #if defined(LIBXML_UNICODE_ENABLED)
   38323     int mem_base;
   38324     int ret_val;
   38325     int code; /* UCS code point */
   38326     int n_code;
   38327 
   38328     for (n_code = 0;n_code < gen_nb_int;n_code++) {
   38329         mem_base = xmlMemBlocks();
   38330         code = gen_int(n_code, 0);
   38331 
   38332         ret_val = xmlUCSIsCJKUnifiedIdeographs(code);
   38333         desret_int(ret_val);
   38334         call_tests++;
   38335         des_int(n_code, code, 0);
   38336         xmlResetLastError();
   38337         if (mem_base != xmlMemBlocks()) {
   38338             printf("Leak of %d blocks found in xmlUCSIsCJKUnifiedIdeographs",
   38339 	           xmlMemBlocks() - mem_base);
   38340 	    test_ret++;
   38341             printf(" %d", n_code);
   38342             printf("\n");
   38343         }
   38344     }
   38345     function_tests++;
   38346 #endif
   38347 
   38348     return(test_ret);
   38349 }
   38350 
   38351 
   38352 static int
   38353 test_xmlUCSIsCJKUnifiedIdeographsExtensionA(void) {
   38354     int test_ret = 0;
   38355 
   38356 #if defined(LIBXML_UNICODE_ENABLED)
   38357     int mem_base;
   38358     int ret_val;
   38359     int code; /* UCS code point */
   38360     int n_code;
   38361 
   38362     for (n_code = 0;n_code < gen_nb_int;n_code++) {
   38363         mem_base = xmlMemBlocks();
   38364         code = gen_int(n_code, 0);
   38365 
   38366         ret_val = xmlUCSIsCJKUnifiedIdeographsExtensionA(code);
   38367         desret_int(ret_val);
   38368         call_tests++;
   38369         des_int(n_code, code, 0);
   38370         xmlResetLastError();
   38371         if (mem_base != xmlMemBlocks()) {
   38372             printf("Leak of %d blocks found in xmlUCSIsCJKUnifiedIdeographsExtensionA",
   38373 	           xmlMemBlocks() - mem_base);
   38374 	    test_ret++;
   38375             printf(" %d", n_code);
   38376             printf("\n");
   38377         }
   38378     }
   38379     function_tests++;
   38380 #endif
   38381 
   38382     return(test_ret);
   38383 }
   38384 
   38385 
   38386 static int
   38387 test_xmlUCSIsCJKUnifiedIdeographsExtensionB(void) {
   38388     int test_ret = 0;
   38389 
   38390 #if defined(LIBXML_UNICODE_ENABLED)
   38391     int mem_base;
   38392     int ret_val;
   38393     int code; /* UCS code point */
   38394     int n_code;
   38395 
   38396     for (n_code = 0;n_code < gen_nb_int;n_code++) {
   38397         mem_base = xmlMemBlocks();
   38398         code = gen_int(n_code, 0);
   38399 
   38400         ret_val = xmlUCSIsCJKUnifiedIdeographsExtensionB(code);
   38401         desret_int(ret_val);
   38402         call_tests++;
   38403         des_int(n_code, code, 0);
   38404         xmlResetLastError();
   38405         if (mem_base != xmlMemBlocks()) {
   38406             printf("Leak of %d blocks found in xmlUCSIsCJKUnifiedIdeographsExtensionB",
   38407 	           xmlMemBlocks() - mem_base);
   38408 	    test_ret++;
   38409             printf(" %d", n_code);
   38410             printf("\n");
   38411         }
   38412     }
   38413     function_tests++;
   38414 #endif
   38415 
   38416     return(test_ret);
   38417 }
   38418 
   38419 
   38420 static int
   38421 test_xmlUCSIsCat(void) {
   38422     int test_ret = 0;
   38423 
   38424 #if defined(LIBXML_UNICODE_ENABLED)
   38425     int mem_base;
   38426     int ret_val;
   38427     int code; /* UCS code point */
   38428     int n_code;
   38429     char * cat; /* UCS Category name */
   38430     int n_cat;
   38431 
   38432     for (n_code = 0;n_code < gen_nb_int;n_code++) {
   38433     for (n_cat = 0;n_cat < gen_nb_const_char_ptr;n_cat++) {
   38434         mem_base = xmlMemBlocks();
   38435         code = gen_int(n_code, 0);
   38436         cat = gen_const_char_ptr(n_cat, 1);
   38437 
   38438         ret_val = xmlUCSIsCat(code, (const char *)cat);
   38439         desret_int(ret_val);
   38440         call_tests++;
   38441         des_int(n_code, code, 0);
   38442         des_const_char_ptr(n_cat, (const char *)cat, 1);
   38443         xmlResetLastError();
   38444         if (mem_base != xmlMemBlocks()) {
   38445             printf("Leak of %d blocks found in xmlUCSIsCat",
   38446 	           xmlMemBlocks() - mem_base);
   38447 	    test_ret++;
   38448             printf(" %d", n_code);
   38449             printf(" %d", n_cat);
   38450             printf("\n");
   38451         }
   38452     }
   38453     }
   38454     function_tests++;
   38455 #endif
   38456 
   38457     return(test_ret);
   38458 }
   38459 
   38460 
   38461 static int
   38462 test_xmlUCSIsCatC(void) {
   38463     int test_ret = 0;
   38464 
   38465 #if defined(LIBXML_UNICODE_ENABLED)
   38466     int mem_base;
   38467     int ret_val;
   38468     int code; /* UCS code point */
   38469     int n_code;
   38470 
   38471     for (n_code = 0;n_code < gen_nb_int;n_code++) {
   38472         mem_base = xmlMemBlocks();
   38473         code = gen_int(n_code, 0);
   38474 
   38475         ret_val = xmlUCSIsCatC(code);
   38476         desret_int(ret_val);
   38477         call_tests++;
   38478         des_int(n_code, code, 0);
   38479         xmlResetLastError();
   38480         if (mem_base != xmlMemBlocks()) {
   38481             printf("Leak of %d blocks found in xmlUCSIsCatC",
   38482 	           xmlMemBlocks() - mem_base);
   38483 	    test_ret++;
   38484             printf(" %d", n_code);
   38485             printf("\n");
   38486         }
   38487     }
   38488     function_tests++;
   38489 #endif
   38490 
   38491     return(test_ret);
   38492 }
   38493 
   38494 
   38495 static int
   38496 test_xmlUCSIsCatCc(void) {
   38497     int test_ret = 0;
   38498 
   38499 #if defined(LIBXML_UNICODE_ENABLED)
   38500     int mem_base;
   38501     int ret_val;
   38502     int code; /* UCS code point */
   38503     int n_code;
   38504 
   38505     for (n_code = 0;n_code < gen_nb_int;n_code++) {
   38506         mem_base = xmlMemBlocks();
   38507         code = gen_int(n_code, 0);
   38508 
   38509         ret_val = xmlUCSIsCatCc(code);
   38510         desret_int(ret_val);
   38511         call_tests++;
   38512         des_int(n_code, code, 0);
   38513         xmlResetLastError();
   38514         if (mem_base != xmlMemBlocks()) {
   38515             printf("Leak of %d blocks found in xmlUCSIsCatCc",
   38516 	           xmlMemBlocks() - mem_base);
   38517 	    test_ret++;
   38518             printf(" %d", n_code);
   38519             printf("\n");
   38520         }
   38521     }
   38522     function_tests++;
   38523 #endif
   38524 
   38525     return(test_ret);
   38526 }
   38527 
   38528 
   38529 static int
   38530 test_xmlUCSIsCatCf(void) {
   38531     int test_ret = 0;
   38532 
   38533 #if defined(LIBXML_UNICODE_ENABLED)
   38534     int mem_base;
   38535     int ret_val;
   38536     int code; /* UCS code point */
   38537     int n_code;
   38538 
   38539     for (n_code = 0;n_code < gen_nb_int;n_code++) {
   38540         mem_base = xmlMemBlocks();
   38541         code = gen_int(n_code, 0);
   38542 
   38543         ret_val = xmlUCSIsCatCf(code);
   38544         desret_int(ret_val);
   38545         call_tests++;
   38546         des_int(n_code, code, 0);
   38547         xmlResetLastError();
   38548         if (mem_base != xmlMemBlocks()) {
   38549             printf("Leak of %d blocks found in xmlUCSIsCatCf",
   38550 	           xmlMemBlocks() - mem_base);
   38551 	    test_ret++;
   38552             printf(" %d", n_code);
   38553             printf("\n");
   38554         }
   38555     }
   38556     function_tests++;
   38557 #endif
   38558 
   38559     return(test_ret);
   38560 }
   38561 
   38562 
   38563 static int
   38564 test_xmlUCSIsCatCo(void) {
   38565     int test_ret = 0;
   38566 
   38567 #if defined(LIBXML_UNICODE_ENABLED)
   38568     int mem_base;
   38569     int ret_val;
   38570     int code; /* UCS code point */
   38571     int n_code;
   38572 
   38573     for (n_code = 0;n_code < gen_nb_int;n_code++) {
   38574         mem_base = xmlMemBlocks();
   38575         code = gen_int(n_code, 0);
   38576 
   38577         ret_val = xmlUCSIsCatCo(code);
   38578         desret_int(ret_val);
   38579         call_tests++;
   38580         des_int(n_code, code, 0);
   38581         xmlResetLastError();
   38582         if (mem_base != xmlMemBlocks()) {
   38583             printf("Leak of %d blocks found in xmlUCSIsCatCo",
   38584 	           xmlMemBlocks() - mem_base);
   38585 	    test_ret++;
   38586             printf(" %d", n_code);
   38587             printf("\n");
   38588         }
   38589     }
   38590     function_tests++;
   38591 #endif
   38592 
   38593     return(test_ret);
   38594 }
   38595 
   38596 
   38597 static int
   38598 test_xmlUCSIsCatCs(void) {
   38599     int test_ret = 0;
   38600 
   38601 #if defined(LIBXML_UNICODE_ENABLED)
   38602     int mem_base;
   38603     int ret_val;
   38604     int code; /* UCS code point */
   38605     int n_code;
   38606 
   38607     for (n_code = 0;n_code < gen_nb_int;n_code++) {
   38608         mem_base = xmlMemBlocks();
   38609         code = gen_int(n_code, 0);
   38610 
   38611         ret_val = xmlUCSIsCatCs(code);
   38612         desret_int(ret_val);
   38613         call_tests++;
   38614         des_int(n_code, code, 0);
   38615         xmlResetLastError();
   38616         if (mem_base != xmlMemBlocks()) {
   38617             printf("Leak of %d blocks found in xmlUCSIsCatCs",
   38618 	           xmlMemBlocks() - mem_base);
   38619 	    test_ret++;
   38620             printf(" %d", n_code);
   38621             printf("\n");
   38622         }
   38623     }
   38624     function_tests++;
   38625 #endif
   38626 
   38627     return(test_ret);
   38628 }
   38629 
   38630 
   38631 static int
   38632 test_xmlUCSIsCatL(void) {
   38633     int test_ret = 0;
   38634 
   38635 #if defined(LIBXML_UNICODE_ENABLED)
   38636     int mem_base;
   38637     int ret_val;
   38638     int code; /* UCS code point */
   38639     int n_code;
   38640 
   38641     for (n_code = 0;n_code < gen_nb_int;n_code++) {
   38642         mem_base = xmlMemBlocks();
   38643         code = gen_int(n_code, 0);
   38644 
   38645         ret_val = xmlUCSIsCatL(code);
   38646         desret_int(ret_val);
   38647         call_tests++;
   38648         des_int(n_code, code, 0);
   38649         xmlResetLastError();
   38650         if (mem_base != xmlMemBlocks()) {
   38651             printf("Leak of %d blocks found in xmlUCSIsCatL",
   38652 	           xmlMemBlocks() - mem_base);
   38653 	    test_ret++;
   38654             printf(" %d", n_code);
   38655             printf("\n");
   38656         }
   38657     }
   38658     function_tests++;
   38659 #endif
   38660 
   38661     return(test_ret);
   38662 }
   38663 
   38664 
   38665 static int
   38666 test_xmlUCSIsCatLl(void) {
   38667     int test_ret = 0;
   38668 
   38669 #if defined(LIBXML_UNICODE_ENABLED)
   38670     int mem_base;
   38671     int ret_val;
   38672     int code; /* UCS code point */
   38673     int n_code;
   38674 
   38675     for (n_code = 0;n_code < gen_nb_int;n_code++) {
   38676         mem_base = xmlMemBlocks();
   38677         code = gen_int(n_code, 0);
   38678 
   38679         ret_val = xmlUCSIsCatLl(code);
   38680         desret_int(ret_val);
   38681         call_tests++;
   38682         des_int(n_code, code, 0);
   38683         xmlResetLastError();
   38684         if (mem_base != xmlMemBlocks()) {
   38685             printf("Leak of %d blocks found in xmlUCSIsCatLl",
   38686 	           xmlMemBlocks() - mem_base);
   38687 	    test_ret++;
   38688             printf(" %d", n_code);
   38689             printf("\n");
   38690         }
   38691     }
   38692     function_tests++;
   38693 #endif
   38694 
   38695     return(test_ret);
   38696 }
   38697 
   38698 
   38699 static int
   38700 test_xmlUCSIsCatLm(void) {
   38701     int test_ret = 0;
   38702 
   38703 #if defined(LIBXML_UNICODE_ENABLED)
   38704     int mem_base;
   38705     int ret_val;
   38706     int code; /* UCS code point */
   38707     int n_code;
   38708 
   38709     for (n_code = 0;n_code < gen_nb_int;n_code++) {
   38710         mem_base = xmlMemBlocks();
   38711         code = gen_int(n_code, 0);
   38712 
   38713         ret_val = xmlUCSIsCatLm(code);
   38714         desret_int(ret_val);
   38715         call_tests++;
   38716         des_int(n_code, code, 0);
   38717         xmlResetLastError();
   38718         if (mem_base != xmlMemBlocks()) {
   38719             printf("Leak of %d blocks found in xmlUCSIsCatLm",
   38720 	           xmlMemBlocks() - mem_base);
   38721 	    test_ret++;
   38722             printf(" %d", n_code);
   38723             printf("\n");
   38724         }
   38725     }
   38726     function_tests++;
   38727 #endif
   38728 
   38729     return(test_ret);
   38730 }
   38731 
   38732 
   38733 static int
   38734 test_xmlUCSIsCatLo(void) {
   38735     int test_ret = 0;
   38736 
   38737 #if defined(LIBXML_UNICODE_ENABLED)
   38738     int mem_base;
   38739     int ret_val;
   38740     int code; /* UCS code point */
   38741     int n_code;
   38742 
   38743     for (n_code = 0;n_code < gen_nb_int;n_code++) {
   38744         mem_base = xmlMemBlocks();
   38745         code = gen_int(n_code, 0);
   38746 
   38747         ret_val = xmlUCSIsCatLo(code);
   38748         desret_int(ret_val);
   38749         call_tests++;
   38750         des_int(n_code, code, 0);
   38751         xmlResetLastError();
   38752         if (mem_base != xmlMemBlocks()) {
   38753             printf("Leak of %d blocks found in xmlUCSIsCatLo",
   38754 	           xmlMemBlocks() - mem_base);
   38755 	    test_ret++;
   38756             printf(" %d", n_code);
   38757             printf("\n");
   38758         }
   38759     }
   38760     function_tests++;
   38761 #endif
   38762 
   38763     return(test_ret);
   38764 }
   38765 
   38766 
   38767 static int
   38768 test_xmlUCSIsCatLt(void) {
   38769     int test_ret = 0;
   38770 
   38771 #if defined(LIBXML_UNICODE_ENABLED)
   38772     int mem_base;
   38773     int ret_val;
   38774     int code; /* UCS code point */
   38775     int n_code;
   38776 
   38777     for (n_code = 0;n_code < gen_nb_int;n_code++) {
   38778         mem_base = xmlMemBlocks();
   38779         code = gen_int(n_code, 0);
   38780 
   38781         ret_val = xmlUCSIsCatLt(code);
   38782         desret_int(ret_val);
   38783         call_tests++;
   38784         des_int(n_code, code, 0);
   38785         xmlResetLastError();
   38786         if (mem_base != xmlMemBlocks()) {
   38787             printf("Leak of %d blocks found in xmlUCSIsCatLt",
   38788 	           xmlMemBlocks() - mem_base);
   38789 	    test_ret++;
   38790             printf(" %d", n_code);
   38791             printf("\n");
   38792         }
   38793     }
   38794     function_tests++;
   38795 #endif
   38796 
   38797     return(test_ret);
   38798 }
   38799 
   38800 
   38801 static int
   38802 test_xmlUCSIsCatLu(void) {
   38803     int test_ret = 0;
   38804 
   38805 #if defined(LIBXML_UNICODE_ENABLED)
   38806     int mem_base;
   38807     int ret_val;
   38808     int code; /* UCS code point */
   38809     int n_code;
   38810 
   38811     for (n_code = 0;n_code < gen_nb_int;n_code++) {
   38812         mem_base = xmlMemBlocks();
   38813         code = gen_int(n_code, 0);
   38814 
   38815         ret_val = xmlUCSIsCatLu(code);
   38816         desret_int(ret_val);
   38817         call_tests++;
   38818         des_int(n_code, code, 0);
   38819         xmlResetLastError();
   38820         if (mem_base != xmlMemBlocks()) {
   38821             printf("Leak of %d blocks found in xmlUCSIsCatLu",
   38822 	           xmlMemBlocks() - mem_base);
   38823 	    test_ret++;
   38824             printf(" %d", n_code);
   38825             printf("\n");
   38826         }
   38827     }
   38828     function_tests++;
   38829 #endif
   38830 
   38831     return(test_ret);
   38832 }
   38833 
   38834 
   38835 static int
   38836 test_xmlUCSIsCatM(void) {
   38837     int test_ret = 0;
   38838 
   38839 #if defined(LIBXML_UNICODE_ENABLED)
   38840     int mem_base;
   38841     int ret_val;
   38842     int code; /* UCS code point */
   38843     int n_code;
   38844 
   38845     for (n_code = 0;n_code < gen_nb_int;n_code++) {
   38846         mem_base = xmlMemBlocks();
   38847         code = gen_int(n_code, 0);
   38848 
   38849         ret_val = xmlUCSIsCatM(code);
   38850         desret_int(ret_val);
   38851         call_tests++;
   38852         des_int(n_code, code, 0);
   38853         xmlResetLastError();
   38854         if (mem_base != xmlMemBlocks()) {
   38855             printf("Leak of %d blocks found in xmlUCSIsCatM",
   38856 	           xmlMemBlocks() - mem_base);
   38857 	    test_ret++;
   38858             printf(" %d", n_code);
   38859             printf("\n");
   38860         }
   38861     }
   38862     function_tests++;
   38863 #endif
   38864 
   38865     return(test_ret);
   38866 }
   38867 
   38868 
   38869 static int
   38870 test_xmlUCSIsCatMc(void) {
   38871     int test_ret = 0;
   38872 
   38873 #if defined(LIBXML_UNICODE_ENABLED)
   38874     int mem_base;
   38875     int ret_val;
   38876     int code; /* UCS code point */
   38877     int n_code;
   38878 
   38879     for (n_code = 0;n_code < gen_nb_int;n_code++) {
   38880         mem_base = xmlMemBlocks();
   38881         code = gen_int(n_code, 0);
   38882 
   38883         ret_val = xmlUCSIsCatMc(code);
   38884         desret_int(ret_val);
   38885         call_tests++;
   38886         des_int(n_code, code, 0);
   38887         xmlResetLastError();
   38888         if (mem_base != xmlMemBlocks()) {
   38889             printf("Leak of %d blocks found in xmlUCSIsCatMc",
   38890 	           xmlMemBlocks() - mem_base);
   38891 	    test_ret++;
   38892             printf(" %d", n_code);
   38893             printf("\n");
   38894         }
   38895     }
   38896     function_tests++;
   38897 #endif
   38898 
   38899     return(test_ret);
   38900 }
   38901 
   38902 
   38903 static int
   38904 test_xmlUCSIsCatMe(void) {
   38905     int test_ret = 0;
   38906 
   38907 #if defined(LIBXML_UNICODE_ENABLED)
   38908     int mem_base;
   38909     int ret_val;
   38910     int code; /* UCS code point */
   38911     int n_code;
   38912 
   38913     for (n_code = 0;n_code < gen_nb_int;n_code++) {
   38914         mem_base = xmlMemBlocks();
   38915         code = gen_int(n_code, 0);
   38916 
   38917         ret_val = xmlUCSIsCatMe(code);
   38918         desret_int(ret_val);
   38919         call_tests++;
   38920         des_int(n_code, code, 0);
   38921         xmlResetLastError();
   38922         if (mem_base != xmlMemBlocks()) {
   38923             printf("Leak of %d blocks found in xmlUCSIsCatMe",
   38924 	           xmlMemBlocks() - mem_base);
   38925 	    test_ret++;
   38926             printf(" %d", n_code);
   38927             printf("\n");
   38928         }
   38929     }
   38930     function_tests++;
   38931 #endif
   38932 
   38933     return(test_ret);
   38934 }
   38935 
   38936 
   38937 static int
   38938 test_xmlUCSIsCatMn(void) {
   38939     int test_ret = 0;
   38940 
   38941 #if defined(LIBXML_UNICODE_ENABLED)
   38942     int mem_base;
   38943     int ret_val;
   38944     int code; /* UCS code point */
   38945     int n_code;
   38946 
   38947     for (n_code = 0;n_code < gen_nb_int;n_code++) {
   38948         mem_base = xmlMemBlocks();
   38949         code = gen_int(n_code, 0);
   38950 
   38951         ret_val = xmlUCSIsCatMn(code);
   38952         desret_int(ret_val);
   38953         call_tests++;
   38954         des_int(n_code, code, 0);
   38955         xmlResetLastError();
   38956         if (mem_base != xmlMemBlocks()) {
   38957             printf("Leak of %d blocks found in xmlUCSIsCatMn",
   38958 	           xmlMemBlocks() - mem_base);
   38959 	    test_ret++;
   38960             printf(" %d", n_code);
   38961             printf("\n");
   38962         }
   38963     }
   38964     function_tests++;
   38965 #endif
   38966 
   38967     return(test_ret);
   38968 }
   38969 
   38970 
   38971 static int
   38972 test_xmlUCSIsCatN(void) {
   38973     int test_ret = 0;
   38974 
   38975 #if defined(LIBXML_UNICODE_ENABLED)
   38976     int mem_base;
   38977     int ret_val;
   38978     int code; /* UCS code point */
   38979     int n_code;
   38980 
   38981     for (n_code = 0;n_code < gen_nb_int;n_code++) {
   38982         mem_base = xmlMemBlocks();
   38983         code = gen_int(n_code, 0);
   38984 
   38985         ret_val = xmlUCSIsCatN(code);
   38986         desret_int(ret_val);
   38987         call_tests++;
   38988         des_int(n_code, code, 0);
   38989         xmlResetLastError();
   38990         if (mem_base != xmlMemBlocks()) {
   38991             printf("Leak of %d blocks found in xmlUCSIsCatN",
   38992 	           xmlMemBlocks() - mem_base);
   38993 	    test_ret++;
   38994             printf(" %d", n_code);
   38995             printf("\n");
   38996         }
   38997     }
   38998     function_tests++;
   38999 #endif
   39000 
   39001     return(test_ret);
   39002 }
   39003 
   39004 
   39005 static int
   39006 test_xmlUCSIsCatNd(void) {
   39007     int test_ret = 0;
   39008 
   39009 #if defined(LIBXML_UNICODE_ENABLED)
   39010     int mem_base;
   39011     int ret_val;
   39012     int code; /* UCS code point */
   39013     int n_code;
   39014 
   39015     for (n_code = 0;n_code < gen_nb_int;n_code++) {
   39016         mem_base = xmlMemBlocks();
   39017         code = gen_int(n_code, 0);
   39018 
   39019         ret_val = xmlUCSIsCatNd(code);
   39020         desret_int(ret_val);
   39021         call_tests++;
   39022         des_int(n_code, code, 0);
   39023         xmlResetLastError();
   39024         if (mem_base != xmlMemBlocks()) {
   39025             printf("Leak of %d blocks found in xmlUCSIsCatNd",
   39026 	           xmlMemBlocks() - mem_base);
   39027 	    test_ret++;
   39028             printf(" %d", n_code);
   39029             printf("\n");
   39030         }
   39031     }
   39032     function_tests++;
   39033 #endif
   39034 
   39035     return(test_ret);
   39036 }
   39037 
   39038 
   39039 static int
   39040 test_xmlUCSIsCatNl(void) {
   39041     int test_ret = 0;
   39042 
   39043 #if defined(LIBXML_UNICODE_ENABLED)
   39044     int mem_base;
   39045     int ret_val;
   39046     int code; /* UCS code point */
   39047     int n_code;
   39048 
   39049     for (n_code = 0;n_code < gen_nb_int;n_code++) {
   39050         mem_base = xmlMemBlocks();
   39051         code = gen_int(n_code, 0);
   39052 
   39053         ret_val = xmlUCSIsCatNl(code);
   39054         desret_int(ret_val);
   39055         call_tests++;
   39056         des_int(n_code, code, 0);
   39057         xmlResetLastError();
   39058         if (mem_base != xmlMemBlocks()) {
   39059             printf("Leak of %d blocks found in xmlUCSIsCatNl",
   39060 	           xmlMemBlocks() - mem_base);
   39061 	    test_ret++;
   39062             printf(" %d", n_code);
   39063             printf("\n");
   39064         }
   39065     }
   39066     function_tests++;
   39067 #endif
   39068 
   39069     return(test_ret);
   39070 }
   39071 
   39072 
   39073 static int
   39074 test_xmlUCSIsCatNo(void) {
   39075     int test_ret = 0;
   39076 
   39077 #if defined(LIBXML_UNICODE_ENABLED)
   39078     int mem_base;
   39079     int ret_val;
   39080     int code; /* UCS code point */
   39081     int n_code;
   39082 
   39083     for (n_code = 0;n_code < gen_nb_int;n_code++) {
   39084         mem_base = xmlMemBlocks();
   39085         code = gen_int(n_code, 0);
   39086 
   39087         ret_val = xmlUCSIsCatNo(code);
   39088         desret_int(ret_val);
   39089         call_tests++;
   39090         des_int(n_code, code, 0);
   39091         xmlResetLastError();
   39092         if (mem_base != xmlMemBlocks()) {
   39093             printf("Leak of %d blocks found in xmlUCSIsCatNo",
   39094 	           xmlMemBlocks() - mem_base);
   39095 	    test_ret++;
   39096             printf(" %d", n_code);
   39097             printf("\n");
   39098         }
   39099     }
   39100     function_tests++;
   39101 #endif
   39102 
   39103     return(test_ret);
   39104 }
   39105 
   39106 
   39107 static int
   39108 test_xmlUCSIsCatP(void) {
   39109     int test_ret = 0;
   39110 
   39111 #if defined(LIBXML_UNICODE_ENABLED)
   39112     int mem_base;
   39113     int ret_val;
   39114     int code; /* UCS code point */
   39115     int n_code;
   39116 
   39117     for (n_code = 0;n_code < gen_nb_int;n_code++) {
   39118         mem_base = xmlMemBlocks();
   39119         code = gen_int(n_code, 0);
   39120 
   39121         ret_val = xmlUCSIsCatP(code);
   39122         desret_int(ret_val);
   39123         call_tests++;
   39124         des_int(n_code, code, 0);
   39125         xmlResetLastError();
   39126         if (mem_base != xmlMemBlocks()) {
   39127             printf("Leak of %d blocks found in xmlUCSIsCatP",
   39128 	           xmlMemBlocks() - mem_base);
   39129 	    test_ret++;
   39130             printf(" %d", n_code);
   39131             printf("\n");
   39132         }
   39133     }
   39134     function_tests++;
   39135 #endif
   39136 
   39137     return(test_ret);
   39138 }
   39139 
   39140 
   39141 static int
   39142 test_xmlUCSIsCatPc(void) {
   39143     int test_ret = 0;
   39144 
   39145 #if defined(LIBXML_UNICODE_ENABLED)
   39146     int mem_base;
   39147     int ret_val;
   39148     int code; /* UCS code point */
   39149     int n_code;
   39150 
   39151     for (n_code = 0;n_code < gen_nb_int;n_code++) {
   39152         mem_base = xmlMemBlocks();
   39153         code = gen_int(n_code, 0);
   39154 
   39155         ret_val = xmlUCSIsCatPc(code);
   39156         desret_int(ret_val);
   39157         call_tests++;
   39158         des_int(n_code, code, 0);
   39159         xmlResetLastError();
   39160         if (mem_base != xmlMemBlocks()) {
   39161             printf("Leak of %d blocks found in xmlUCSIsCatPc",
   39162 	           xmlMemBlocks() - mem_base);
   39163 	    test_ret++;
   39164             printf(" %d", n_code);
   39165             printf("\n");
   39166         }
   39167     }
   39168     function_tests++;
   39169 #endif
   39170 
   39171     return(test_ret);
   39172 }
   39173 
   39174 
   39175 static int
   39176 test_xmlUCSIsCatPd(void) {
   39177     int test_ret = 0;
   39178 
   39179 #if defined(LIBXML_UNICODE_ENABLED)
   39180     int mem_base;
   39181     int ret_val;
   39182     int code; /* UCS code point */
   39183     int n_code;
   39184 
   39185     for (n_code = 0;n_code < gen_nb_int;n_code++) {
   39186         mem_base = xmlMemBlocks();
   39187         code = gen_int(n_code, 0);
   39188 
   39189         ret_val = xmlUCSIsCatPd(code);
   39190         desret_int(ret_val);
   39191         call_tests++;
   39192         des_int(n_code, code, 0);
   39193         xmlResetLastError();
   39194         if (mem_base != xmlMemBlocks()) {
   39195             printf("Leak of %d blocks found in xmlUCSIsCatPd",
   39196 	           xmlMemBlocks() - mem_base);
   39197 	    test_ret++;
   39198             printf(" %d", n_code);
   39199             printf("\n");
   39200         }
   39201     }
   39202     function_tests++;
   39203 #endif
   39204 
   39205     return(test_ret);
   39206 }
   39207 
   39208 
   39209 static int
   39210 test_xmlUCSIsCatPe(void) {
   39211     int test_ret = 0;
   39212 
   39213 #if defined(LIBXML_UNICODE_ENABLED)
   39214     int mem_base;
   39215     int ret_val;
   39216     int code; /* UCS code point */
   39217     int n_code;
   39218 
   39219     for (n_code = 0;n_code < gen_nb_int;n_code++) {
   39220         mem_base = xmlMemBlocks();
   39221         code = gen_int(n_code, 0);
   39222 
   39223         ret_val = xmlUCSIsCatPe(code);
   39224         desret_int(ret_val);
   39225         call_tests++;
   39226         des_int(n_code, code, 0);
   39227         xmlResetLastError();
   39228         if (mem_base != xmlMemBlocks()) {
   39229             printf("Leak of %d blocks found in xmlUCSIsCatPe",
   39230 	           xmlMemBlocks() - mem_base);
   39231 	    test_ret++;
   39232             printf(" %d", n_code);
   39233             printf("\n");
   39234         }
   39235     }
   39236     function_tests++;
   39237 #endif
   39238 
   39239     return(test_ret);
   39240 }
   39241 
   39242 
   39243 static int
   39244 test_xmlUCSIsCatPf(void) {
   39245     int test_ret = 0;
   39246 
   39247 #if defined(LIBXML_UNICODE_ENABLED)
   39248     int mem_base;
   39249     int ret_val;
   39250     int code; /* UCS code point */
   39251     int n_code;
   39252 
   39253     for (n_code = 0;n_code < gen_nb_int;n_code++) {
   39254         mem_base = xmlMemBlocks();
   39255         code = gen_int(n_code, 0);
   39256 
   39257         ret_val = xmlUCSIsCatPf(code);
   39258         desret_int(ret_val);
   39259         call_tests++;
   39260         des_int(n_code, code, 0);
   39261         xmlResetLastError();
   39262         if (mem_base != xmlMemBlocks()) {
   39263             printf("Leak of %d blocks found in xmlUCSIsCatPf",
   39264 	           xmlMemBlocks() - mem_base);
   39265 	    test_ret++;
   39266             printf(" %d", n_code);
   39267             printf("\n");
   39268         }
   39269     }
   39270     function_tests++;
   39271 #endif
   39272 
   39273     return(test_ret);
   39274 }
   39275 
   39276 
   39277 static int
   39278 test_xmlUCSIsCatPi(void) {
   39279     int test_ret = 0;
   39280 
   39281 #if defined(LIBXML_UNICODE_ENABLED)
   39282     int mem_base;
   39283     int ret_val;
   39284     int code; /* UCS code point */
   39285     int n_code;
   39286 
   39287     for (n_code = 0;n_code < gen_nb_int;n_code++) {
   39288         mem_base = xmlMemBlocks();
   39289         code = gen_int(n_code, 0);
   39290 
   39291         ret_val = xmlUCSIsCatPi(code);
   39292         desret_int(ret_val);
   39293         call_tests++;
   39294         des_int(n_code, code, 0);
   39295         xmlResetLastError();
   39296         if (mem_base != xmlMemBlocks()) {
   39297             printf("Leak of %d blocks found in xmlUCSIsCatPi",
   39298 	           xmlMemBlocks() - mem_base);
   39299 	    test_ret++;
   39300             printf(" %d", n_code);
   39301             printf("\n");
   39302         }
   39303     }
   39304     function_tests++;
   39305 #endif
   39306 
   39307     return(test_ret);
   39308 }
   39309 
   39310 
   39311 static int
   39312 test_xmlUCSIsCatPo(void) {
   39313     int test_ret = 0;
   39314 
   39315 #if defined(LIBXML_UNICODE_ENABLED)
   39316     int mem_base;
   39317     int ret_val;
   39318     int code; /* UCS code point */
   39319     int n_code;
   39320 
   39321     for (n_code = 0;n_code < gen_nb_int;n_code++) {
   39322         mem_base = xmlMemBlocks();
   39323         code = gen_int(n_code, 0);
   39324 
   39325         ret_val = xmlUCSIsCatPo(code);
   39326         desret_int(ret_val);
   39327         call_tests++;
   39328         des_int(n_code, code, 0);
   39329         xmlResetLastError();
   39330         if (mem_base != xmlMemBlocks()) {
   39331             printf("Leak of %d blocks found in xmlUCSIsCatPo",
   39332 	           xmlMemBlocks() - mem_base);
   39333 	    test_ret++;
   39334             printf(" %d", n_code);
   39335             printf("\n");
   39336         }
   39337     }
   39338     function_tests++;
   39339 #endif
   39340 
   39341     return(test_ret);
   39342 }
   39343 
   39344 
   39345 static int
   39346 test_xmlUCSIsCatPs(void) {
   39347     int test_ret = 0;
   39348 
   39349 #if defined(LIBXML_UNICODE_ENABLED)
   39350     int mem_base;
   39351     int ret_val;
   39352     int code; /* UCS code point */
   39353     int n_code;
   39354 
   39355     for (n_code = 0;n_code < gen_nb_int;n_code++) {
   39356         mem_base = xmlMemBlocks();
   39357         code = gen_int(n_code, 0);
   39358 
   39359         ret_val = xmlUCSIsCatPs(code);
   39360         desret_int(ret_val);
   39361         call_tests++;
   39362         des_int(n_code, code, 0);
   39363         xmlResetLastError();
   39364         if (mem_base != xmlMemBlocks()) {
   39365             printf("Leak of %d blocks found in xmlUCSIsCatPs",
   39366 	           xmlMemBlocks() - mem_base);
   39367 	    test_ret++;
   39368             printf(" %d", n_code);
   39369             printf("\n");
   39370         }
   39371     }
   39372     function_tests++;
   39373 #endif
   39374 
   39375     return(test_ret);
   39376 }
   39377 
   39378 
   39379 static int
   39380 test_xmlUCSIsCatS(void) {
   39381     int test_ret = 0;
   39382 
   39383 #if defined(LIBXML_UNICODE_ENABLED)
   39384     int mem_base;
   39385     int ret_val;
   39386     int code; /* UCS code point */
   39387     int n_code;
   39388 
   39389     for (n_code = 0;n_code < gen_nb_int;n_code++) {
   39390         mem_base = xmlMemBlocks();
   39391         code = gen_int(n_code, 0);
   39392 
   39393         ret_val = xmlUCSIsCatS(code);
   39394         desret_int(ret_val);
   39395         call_tests++;
   39396         des_int(n_code, code, 0);
   39397         xmlResetLastError();
   39398         if (mem_base != xmlMemBlocks()) {
   39399             printf("Leak of %d blocks found in xmlUCSIsCatS",
   39400 	           xmlMemBlocks() - mem_base);
   39401 	    test_ret++;
   39402             printf(" %d", n_code);
   39403             printf("\n");
   39404         }
   39405     }
   39406     function_tests++;
   39407 #endif
   39408 
   39409     return(test_ret);
   39410 }
   39411 
   39412 
   39413 static int
   39414 test_xmlUCSIsCatSc(void) {
   39415     int test_ret = 0;
   39416 
   39417 #if defined(LIBXML_UNICODE_ENABLED)
   39418     int mem_base;
   39419     int ret_val;
   39420     int code; /* UCS code point */
   39421     int n_code;
   39422 
   39423     for (n_code = 0;n_code < gen_nb_int;n_code++) {
   39424         mem_base = xmlMemBlocks();
   39425         code = gen_int(n_code, 0);
   39426 
   39427         ret_val = xmlUCSIsCatSc(code);
   39428         desret_int(ret_val);
   39429         call_tests++;
   39430         des_int(n_code, code, 0);
   39431         xmlResetLastError();
   39432         if (mem_base != xmlMemBlocks()) {
   39433             printf("Leak of %d blocks found in xmlUCSIsCatSc",
   39434 	           xmlMemBlocks() - mem_base);
   39435 	    test_ret++;
   39436             printf(" %d", n_code);
   39437             printf("\n");
   39438         }
   39439     }
   39440     function_tests++;
   39441 #endif
   39442 
   39443     return(test_ret);
   39444 }
   39445 
   39446 
   39447 static int
   39448 test_xmlUCSIsCatSk(void) {
   39449     int test_ret = 0;
   39450 
   39451 #if defined(LIBXML_UNICODE_ENABLED)
   39452     int mem_base;
   39453     int ret_val;
   39454     int code; /* UCS code point */
   39455     int n_code;
   39456 
   39457     for (n_code = 0;n_code < gen_nb_int;n_code++) {
   39458         mem_base = xmlMemBlocks();
   39459         code = gen_int(n_code, 0);
   39460 
   39461         ret_val = xmlUCSIsCatSk(code);
   39462         desret_int(ret_val);
   39463         call_tests++;
   39464         des_int(n_code, code, 0);
   39465         xmlResetLastError();
   39466         if (mem_base != xmlMemBlocks()) {
   39467             printf("Leak of %d blocks found in xmlUCSIsCatSk",
   39468 	           xmlMemBlocks() - mem_base);
   39469 	    test_ret++;
   39470             printf(" %d", n_code);
   39471             printf("\n");
   39472         }
   39473     }
   39474     function_tests++;
   39475 #endif
   39476 
   39477     return(test_ret);
   39478 }
   39479 
   39480 
   39481 static int
   39482 test_xmlUCSIsCatSm(void) {
   39483     int test_ret = 0;
   39484 
   39485 #if defined(LIBXML_UNICODE_ENABLED)
   39486     int mem_base;
   39487     int ret_val;
   39488     int code; /* UCS code point */
   39489     int n_code;
   39490 
   39491     for (n_code = 0;n_code < gen_nb_int;n_code++) {
   39492         mem_base = xmlMemBlocks();
   39493         code = gen_int(n_code, 0);
   39494 
   39495         ret_val = xmlUCSIsCatSm(code);
   39496         desret_int(ret_val);
   39497         call_tests++;
   39498         des_int(n_code, code, 0);
   39499         xmlResetLastError();
   39500         if (mem_base != xmlMemBlocks()) {
   39501             printf("Leak of %d blocks found in xmlUCSIsCatSm",
   39502 	           xmlMemBlocks() - mem_base);
   39503 	    test_ret++;
   39504             printf(" %d", n_code);
   39505             printf("\n");
   39506         }
   39507     }
   39508     function_tests++;
   39509 #endif
   39510 
   39511     return(test_ret);
   39512 }
   39513 
   39514 
   39515 static int
   39516 test_xmlUCSIsCatSo(void) {
   39517     int test_ret = 0;
   39518 
   39519 #if defined(LIBXML_UNICODE_ENABLED)
   39520     int mem_base;
   39521     int ret_val;
   39522     int code; /* UCS code point */
   39523     int n_code;
   39524 
   39525     for (n_code = 0;n_code < gen_nb_int;n_code++) {
   39526         mem_base = xmlMemBlocks();
   39527         code = gen_int(n_code, 0);
   39528 
   39529         ret_val = xmlUCSIsCatSo(code);
   39530         desret_int(ret_val);
   39531         call_tests++;
   39532         des_int(n_code, code, 0);
   39533         xmlResetLastError();
   39534         if (mem_base != xmlMemBlocks()) {
   39535             printf("Leak of %d blocks found in xmlUCSIsCatSo",
   39536 	           xmlMemBlocks() - mem_base);
   39537 	    test_ret++;
   39538             printf(" %d", n_code);
   39539             printf("\n");
   39540         }
   39541     }
   39542     function_tests++;
   39543 #endif
   39544 
   39545     return(test_ret);
   39546 }
   39547 
   39548 
   39549 static int
   39550 test_xmlUCSIsCatZ(void) {
   39551     int test_ret = 0;
   39552 
   39553 #if defined(LIBXML_UNICODE_ENABLED)
   39554     int mem_base;
   39555     int ret_val;
   39556     int code; /* UCS code point */
   39557     int n_code;
   39558 
   39559     for (n_code = 0;n_code < gen_nb_int;n_code++) {
   39560         mem_base = xmlMemBlocks();
   39561         code = gen_int(n_code, 0);
   39562 
   39563         ret_val = xmlUCSIsCatZ(code);
   39564         desret_int(ret_val);
   39565         call_tests++;
   39566         des_int(n_code, code, 0);
   39567         xmlResetLastError();
   39568         if (mem_base != xmlMemBlocks()) {
   39569             printf("Leak of %d blocks found in xmlUCSIsCatZ",
   39570 	           xmlMemBlocks() - mem_base);
   39571 	    test_ret++;
   39572             printf(" %d", n_code);
   39573             printf("\n");
   39574         }
   39575     }
   39576     function_tests++;
   39577 #endif
   39578 
   39579     return(test_ret);
   39580 }
   39581 
   39582 
   39583 static int
   39584 test_xmlUCSIsCatZl(void) {
   39585     int test_ret = 0;
   39586 
   39587 #if defined(LIBXML_UNICODE_ENABLED)
   39588     int mem_base;
   39589     int ret_val;
   39590     int code; /* UCS code point */
   39591     int n_code;
   39592 
   39593     for (n_code = 0;n_code < gen_nb_int;n_code++) {
   39594         mem_base = xmlMemBlocks();
   39595         code = gen_int(n_code, 0);
   39596 
   39597         ret_val = xmlUCSIsCatZl(code);
   39598         desret_int(ret_val);
   39599         call_tests++;
   39600         des_int(n_code, code, 0);
   39601         xmlResetLastError();
   39602         if (mem_base != xmlMemBlocks()) {
   39603             printf("Leak of %d blocks found in xmlUCSIsCatZl",
   39604 	           xmlMemBlocks() - mem_base);
   39605 	    test_ret++;
   39606             printf(" %d", n_code);
   39607             printf("\n");
   39608         }
   39609     }
   39610     function_tests++;
   39611 #endif
   39612 
   39613     return(test_ret);
   39614 }
   39615 
   39616 
   39617 static int
   39618 test_xmlUCSIsCatZp(void) {
   39619     int test_ret = 0;
   39620 
   39621 #if defined(LIBXML_UNICODE_ENABLED)
   39622     int mem_base;
   39623     int ret_val;
   39624     int code; /* UCS code point */
   39625     int n_code;
   39626 
   39627     for (n_code = 0;n_code < gen_nb_int;n_code++) {
   39628         mem_base = xmlMemBlocks();
   39629         code = gen_int(n_code, 0);
   39630 
   39631         ret_val = xmlUCSIsCatZp(code);
   39632         desret_int(ret_val);
   39633         call_tests++;
   39634         des_int(n_code, code, 0);
   39635         xmlResetLastError();
   39636         if (mem_base != xmlMemBlocks()) {
   39637             printf("Leak of %d blocks found in xmlUCSIsCatZp",
   39638 	           xmlMemBlocks() - mem_base);
   39639 	    test_ret++;
   39640             printf(" %d", n_code);
   39641             printf("\n");
   39642         }
   39643     }
   39644     function_tests++;
   39645 #endif
   39646 
   39647     return(test_ret);
   39648 }
   39649 
   39650 
   39651 static int
   39652 test_xmlUCSIsCatZs(void) {
   39653     int test_ret = 0;
   39654 
   39655 #if defined(LIBXML_UNICODE_ENABLED)
   39656     int mem_base;
   39657     int ret_val;
   39658     int code; /* UCS code point */
   39659     int n_code;
   39660 
   39661     for (n_code = 0;n_code < gen_nb_int;n_code++) {
   39662         mem_base = xmlMemBlocks();
   39663         code = gen_int(n_code, 0);
   39664 
   39665         ret_val = xmlUCSIsCatZs(code);
   39666         desret_int(ret_val);
   39667         call_tests++;
   39668         des_int(n_code, code, 0);
   39669         xmlResetLastError();
   39670         if (mem_base != xmlMemBlocks()) {
   39671             printf("Leak of %d blocks found in xmlUCSIsCatZs",
   39672 	           xmlMemBlocks() - mem_base);
   39673 	    test_ret++;
   39674             printf(" %d", n_code);
   39675             printf("\n");
   39676         }
   39677     }
   39678     function_tests++;
   39679 #endif
   39680 
   39681     return(test_ret);
   39682 }
   39683 
   39684 
   39685 static int
   39686 test_xmlUCSIsCherokee(void) {
   39687     int test_ret = 0;
   39688 
   39689 #if defined(LIBXML_UNICODE_ENABLED)
   39690     int mem_base;
   39691     int ret_val;
   39692     int code; /* UCS code point */
   39693     int n_code;
   39694 
   39695     for (n_code = 0;n_code < gen_nb_int;n_code++) {
   39696         mem_base = xmlMemBlocks();
   39697         code = gen_int(n_code, 0);
   39698 
   39699         ret_val = xmlUCSIsCherokee(code);
   39700         desret_int(ret_val);
   39701         call_tests++;
   39702         des_int(n_code, code, 0);
   39703         xmlResetLastError();
   39704         if (mem_base != xmlMemBlocks()) {
   39705             printf("Leak of %d blocks found in xmlUCSIsCherokee",
   39706 	           xmlMemBlocks() - mem_base);
   39707 	    test_ret++;
   39708             printf(" %d", n_code);
   39709             printf("\n");
   39710         }
   39711     }
   39712     function_tests++;
   39713 #endif
   39714 
   39715     return(test_ret);
   39716 }
   39717 
   39718 
   39719 static int
   39720 test_xmlUCSIsCombiningDiacriticalMarks(void) {
   39721     int test_ret = 0;
   39722 
   39723 #if defined(LIBXML_UNICODE_ENABLED)
   39724     int mem_base;
   39725     int ret_val;
   39726     int code; /* UCS code point */
   39727     int n_code;
   39728 
   39729     for (n_code = 0;n_code < gen_nb_int;n_code++) {
   39730         mem_base = xmlMemBlocks();
   39731         code = gen_int(n_code, 0);
   39732 
   39733         ret_val = xmlUCSIsCombiningDiacriticalMarks(code);
   39734         desret_int(ret_val);
   39735         call_tests++;
   39736         des_int(n_code, code, 0);
   39737         xmlResetLastError();
   39738         if (mem_base != xmlMemBlocks()) {
   39739             printf("Leak of %d blocks found in xmlUCSIsCombiningDiacriticalMarks",
   39740 	           xmlMemBlocks() - mem_base);
   39741 	    test_ret++;
   39742             printf(" %d", n_code);
   39743             printf("\n");
   39744         }
   39745     }
   39746     function_tests++;
   39747 #endif
   39748 
   39749     return(test_ret);
   39750 }
   39751 
   39752 
   39753 static int
   39754 test_xmlUCSIsCombiningDiacriticalMarksforSymbols(void) {
   39755     int test_ret = 0;
   39756 
   39757 #if defined(LIBXML_UNICODE_ENABLED)
   39758     int mem_base;
   39759     int ret_val;
   39760     int code; /* UCS code point */
   39761     int n_code;
   39762 
   39763     for (n_code = 0;n_code < gen_nb_int;n_code++) {
   39764         mem_base = xmlMemBlocks();
   39765         code = gen_int(n_code, 0);
   39766 
   39767         ret_val = xmlUCSIsCombiningDiacriticalMarksforSymbols(code);
   39768         desret_int(ret_val);
   39769         call_tests++;
   39770         des_int(n_code, code, 0);
   39771         xmlResetLastError();
   39772         if (mem_base != xmlMemBlocks()) {
   39773             printf("Leak of %d blocks found in xmlUCSIsCombiningDiacriticalMarksforSymbols",
   39774 	           xmlMemBlocks() - mem_base);
   39775 	    test_ret++;
   39776             printf(" %d", n_code);
   39777             printf("\n");
   39778         }
   39779     }
   39780     function_tests++;
   39781 #endif
   39782 
   39783     return(test_ret);
   39784 }
   39785 
   39786 
   39787 static int
   39788 test_xmlUCSIsCombiningHalfMarks(void) {
   39789     int test_ret = 0;
   39790 
   39791 #if defined(LIBXML_UNICODE_ENABLED)
   39792     int mem_base;
   39793     int ret_val;
   39794     int code; /* UCS code point */
   39795     int n_code;
   39796 
   39797     for (n_code = 0;n_code < gen_nb_int;n_code++) {
   39798         mem_base = xmlMemBlocks();
   39799         code = gen_int(n_code, 0);
   39800 
   39801         ret_val = xmlUCSIsCombiningHalfMarks(code);
   39802         desret_int(ret_val);
   39803         call_tests++;
   39804         des_int(n_code, code, 0);
   39805         xmlResetLastError();
   39806         if (mem_base != xmlMemBlocks()) {
   39807             printf("Leak of %d blocks found in xmlUCSIsCombiningHalfMarks",
   39808 	           xmlMemBlocks() - mem_base);
   39809 	    test_ret++;
   39810             printf(" %d", n_code);
   39811             printf("\n");
   39812         }
   39813     }
   39814     function_tests++;
   39815 #endif
   39816 
   39817     return(test_ret);
   39818 }
   39819 
   39820 
   39821 static int
   39822 test_xmlUCSIsCombiningMarksforSymbols(void) {
   39823     int test_ret = 0;
   39824 
   39825 #if defined(LIBXML_UNICODE_ENABLED)
   39826     int mem_base;
   39827     int ret_val;
   39828     int code; /* UCS code point */
   39829     int n_code;
   39830 
   39831     for (n_code = 0;n_code < gen_nb_int;n_code++) {
   39832         mem_base = xmlMemBlocks();
   39833         code = gen_int(n_code, 0);
   39834 
   39835         ret_val = xmlUCSIsCombiningMarksforSymbols(code);
   39836         desret_int(ret_val);
   39837         call_tests++;
   39838         des_int(n_code, code, 0);
   39839         xmlResetLastError();
   39840         if (mem_base != xmlMemBlocks()) {
   39841             printf("Leak of %d blocks found in xmlUCSIsCombiningMarksforSymbols",
   39842 	           xmlMemBlocks() - mem_base);
   39843 	    test_ret++;
   39844             printf(" %d", n_code);
   39845             printf("\n");
   39846         }
   39847     }
   39848     function_tests++;
   39849 #endif
   39850 
   39851     return(test_ret);
   39852 }
   39853 
   39854 
   39855 static int
   39856 test_xmlUCSIsControlPictures(void) {
   39857     int test_ret = 0;
   39858 
   39859 #if defined(LIBXML_UNICODE_ENABLED)
   39860     int mem_base;
   39861     int ret_val;
   39862     int code; /* UCS code point */
   39863     int n_code;
   39864 
   39865     for (n_code = 0;n_code < gen_nb_int;n_code++) {
   39866         mem_base = xmlMemBlocks();
   39867         code = gen_int(n_code, 0);
   39868 
   39869         ret_val = xmlUCSIsControlPictures(code);
   39870         desret_int(ret_val);
   39871         call_tests++;
   39872         des_int(n_code, code, 0);
   39873         xmlResetLastError();
   39874         if (mem_base != xmlMemBlocks()) {
   39875             printf("Leak of %d blocks found in xmlUCSIsControlPictures",
   39876 	           xmlMemBlocks() - mem_base);
   39877 	    test_ret++;
   39878             printf(" %d", n_code);
   39879             printf("\n");
   39880         }
   39881     }
   39882     function_tests++;
   39883 #endif
   39884 
   39885     return(test_ret);
   39886 }
   39887 
   39888 
   39889 static int
   39890 test_xmlUCSIsCurrencySymbols(void) {
   39891     int test_ret = 0;
   39892 
   39893 #if defined(LIBXML_UNICODE_ENABLED)
   39894     int mem_base;
   39895     int ret_val;
   39896     int code; /* UCS code point */
   39897     int n_code;
   39898 
   39899     for (n_code = 0;n_code < gen_nb_int;n_code++) {
   39900         mem_base = xmlMemBlocks();
   39901         code = gen_int(n_code, 0);
   39902 
   39903         ret_val = xmlUCSIsCurrencySymbols(code);
   39904         desret_int(ret_val);
   39905         call_tests++;
   39906         des_int(n_code, code, 0);
   39907         xmlResetLastError();
   39908         if (mem_base != xmlMemBlocks()) {
   39909             printf("Leak of %d blocks found in xmlUCSIsCurrencySymbols",
   39910 	           xmlMemBlocks() - mem_base);
   39911 	    test_ret++;
   39912             printf(" %d", n_code);
   39913             printf("\n");
   39914         }
   39915     }
   39916     function_tests++;
   39917 #endif
   39918 
   39919     return(test_ret);
   39920 }
   39921 
   39922 
   39923 static int
   39924 test_xmlUCSIsCypriotSyllabary(void) {
   39925     int test_ret = 0;
   39926 
   39927 #if defined(LIBXML_UNICODE_ENABLED)
   39928     int mem_base;
   39929     int ret_val;
   39930     int code; /* UCS code point */
   39931     int n_code;
   39932 
   39933     for (n_code = 0;n_code < gen_nb_int;n_code++) {
   39934         mem_base = xmlMemBlocks();
   39935         code = gen_int(n_code, 0);
   39936 
   39937         ret_val = xmlUCSIsCypriotSyllabary(code);
   39938         desret_int(ret_val);
   39939         call_tests++;
   39940         des_int(n_code, code, 0);
   39941         xmlResetLastError();
   39942         if (mem_base != xmlMemBlocks()) {
   39943             printf("Leak of %d blocks found in xmlUCSIsCypriotSyllabary",
   39944 	           xmlMemBlocks() - mem_base);
   39945 	    test_ret++;
   39946             printf(" %d", n_code);
   39947             printf("\n");
   39948         }
   39949     }
   39950     function_tests++;
   39951 #endif
   39952 
   39953     return(test_ret);
   39954 }
   39955 
   39956 
   39957 static int
   39958 test_xmlUCSIsCyrillic(void) {
   39959     int test_ret = 0;
   39960 
   39961 #if defined(LIBXML_UNICODE_ENABLED)
   39962     int mem_base;
   39963     int ret_val;
   39964     int code; /* UCS code point */
   39965     int n_code;
   39966 
   39967     for (n_code = 0;n_code < gen_nb_int;n_code++) {
   39968         mem_base = xmlMemBlocks();
   39969         code = gen_int(n_code, 0);
   39970 
   39971         ret_val = xmlUCSIsCyrillic(code);
   39972         desret_int(ret_val);
   39973         call_tests++;
   39974         des_int(n_code, code, 0);
   39975         xmlResetLastError();
   39976         if (mem_base != xmlMemBlocks()) {
   39977             printf("Leak of %d blocks found in xmlUCSIsCyrillic",
   39978 	           xmlMemBlocks() - mem_base);
   39979 	    test_ret++;
   39980             printf(" %d", n_code);
   39981             printf("\n");
   39982         }
   39983     }
   39984     function_tests++;
   39985 #endif
   39986 
   39987     return(test_ret);
   39988 }
   39989 
   39990 
   39991 static int
   39992 test_xmlUCSIsCyrillicSupplement(void) {
   39993     int test_ret = 0;
   39994 
   39995 #if defined(LIBXML_UNICODE_ENABLED)
   39996     int mem_base;
   39997     int ret_val;
   39998     int code; /* UCS code point */
   39999     int n_code;
   40000 
   40001     for (n_code = 0;n_code < gen_nb_int;n_code++) {
   40002         mem_base = xmlMemBlocks();
   40003         code = gen_int(n_code, 0);
   40004 
   40005         ret_val = xmlUCSIsCyrillicSupplement(code);
   40006         desret_int(ret_val);
   40007         call_tests++;
   40008         des_int(n_code, code, 0);
   40009         xmlResetLastError();
   40010         if (mem_base != xmlMemBlocks()) {
   40011             printf("Leak of %d blocks found in xmlUCSIsCyrillicSupplement",
   40012 	           xmlMemBlocks() - mem_base);
   40013 	    test_ret++;
   40014             printf(" %d", n_code);
   40015             printf("\n");
   40016         }
   40017     }
   40018     function_tests++;
   40019 #endif
   40020 
   40021     return(test_ret);
   40022 }
   40023 
   40024 
   40025 static int
   40026 test_xmlUCSIsDeseret(void) {
   40027     int test_ret = 0;
   40028 
   40029 #if defined(LIBXML_UNICODE_ENABLED)
   40030     int mem_base;
   40031     int ret_val;
   40032     int code; /* UCS code point */
   40033     int n_code;
   40034 
   40035     for (n_code = 0;n_code < gen_nb_int;n_code++) {
   40036         mem_base = xmlMemBlocks();
   40037         code = gen_int(n_code, 0);
   40038 
   40039         ret_val = xmlUCSIsDeseret(code);
   40040         desret_int(ret_val);
   40041         call_tests++;
   40042         des_int(n_code, code, 0);
   40043         xmlResetLastError();
   40044         if (mem_base != xmlMemBlocks()) {
   40045             printf("Leak of %d blocks found in xmlUCSIsDeseret",
   40046 	           xmlMemBlocks() - mem_base);
   40047 	    test_ret++;
   40048             printf(" %d", n_code);
   40049             printf("\n");
   40050         }
   40051     }
   40052     function_tests++;
   40053 #endif
   40054 
   40055     return(test_ret);
   40056 }
   40057 
   40058 
   40059 static int
   40060 test_xmlUCSIsDevanagari(void) {
   40061     int test_ret = 0;
   40062 
   40063 #if defined(LIBXML_UNICODE_ENABLED)
   40064     int mem_base;
   40065     int ret_val;
   40066     int code; /* UCS code point */
   40067     int n_code;
   40068 
   40069     for (n_code = 0;n_code < gen_nb_int;n_code++) {
   40070         mem_base = xmlMemBlocks();
   40071         code = gen_int(n_code, 0);
   40072 
   40073         ret_val = xmlUCSIsDevanagari(code);
   40074         desret_int(ret_val);
   40075         call_tests++;
   40076         des_int(n_code, code, 0);
   40077         xmlResetLastError();
   40078         if (mem_base != xmlMemBlocks()) {
   40079             printf("Leak of %d blocks found in xmlUCSIsDevanagari",
   40080 	           xmlMemBlocks() - mem_base);
   40081 	    test_ret++;
   40082             printf(" %d", n_code);
   40083             printf("\n");
   40084         }
   40085     }
   40086     function_tests++;
   40087 #endif
   40088 
   40089     return(test_ret);
   40090 }
   40091 
   40092 
   40093 static int
   40094 test_xmlUCSIsDingbats(void) {
   40095     int test_ret = 0;
   40096 
   40097 #if defined(LIBXML_UNICODE_ENABLED)
   40098     int mem_base;
   40099     int ret_val;
   40100     int code; /* UCS code point */
   40101     int n_code;
   40102 
   40103     for (n_code = 0;n_code < gen_nb_int;n_code++) {
   40104         mem_base = xmlMemBlocks();
   40105         code = gen_int(n_code, 0);
   40106 
   40107         ret_val = xmlUCSIsDingbats(code);
   40108         desret_int(ret_val);
   40109         call_tests++;
   40110         des_int(n_code, code, 0);
   40111         xmlResetLastError();
   40112         if (mem_base != xmlMemBlocks()) {
   40113             printf("Leak of %d blocks found in xmlUCSIsDingbats",
   40114 	           xmlMemBlocks() - mem_base);
   40115 	    test_ret++;
   40116             printf(" %d", n_code);
   40117             printf("\n");
   40118         }
   40119     }
   40120     function_tests++;
   40121 #endif
   40122 
   40123     return(test_ret);
   40124 }
   40125 
   40126 
   40127 static int
   40128 test_xmlUCSIsEnclosedAlphanumerics(void) {
   40129     int test_ret = 0;
   40130 
   40131 #if defined(LIBXML_UNICODE_ENABLED)
   40132     int mem_base;
   40133     int ret_val;
   40134     int code; /* UCS code point */
   40135     int n_code;
   40136 
   40137     for (n_code = 0;n_code < gen_nb_int;n_code++) {
   40138         mem_base = xmlMemBlocks();
   40139         code = gen_int(n_code, 0);
   40140 
   40141         ret_val = xmlUCSIsEnclosedAlphanumerics(code);
   40142         desret_int(ret_val);
   40143         call_tests++;
   40144         des_int(n_code, code, 0);
   40145         xmlResetLastError();
   40146         if (mem_base != xmlMemBlocks()) {
   40147             printf("Leak of %d blocks found in xmlUCSIsEnclosedAlphanumerics",
   40148 	           xmlMemBlocks() - mem_base);
   40149 	    test_ret++;
   40150             printf(" %d", n_code);
   40151             printf("\n");
   40152         }
   40153     }
   40154     function_tests++;
   40155 #endif
   40156 
   40157     return(test_ret);
   40158 }
   40159 
   40160 
   40161 static int
   40162 test_xmlUCSIsEnclosedCJKLettersandMonths(void) {
   40163     int test_ret = 0;
   40164 
   40165 #if defined(LIBXML_UNICODE_ENABLED)
   40166     int mem_base;
   40167     int ret_val;
   40168     int code; /* UCS code point */
   40169     int n_code;
   40170 
   40171     for (n_code = 0;n_code < gen_nb_int;n_code++) {
   40172         mem_base = xmlMemBlocks();
   40173         code = gen_int(n_code, 0);
   40174 
   40175         ret_val = xmlUCSIsEnclosedCJKLettersandMonths(code);
   40176         desret_int(ret_val);
   40177         call_tests++;
   40178         des_int(n_code, code, 0);
   40179         xmlResetLastError();
   40180         if (mem_base != xmlMemBlocks()) {
   40181             printf("Leak of %d blocks found in xmlUCSIsEnclosedCJKLettersandMonths",
   40182 	           xmlMemBlocks() - mem_base);
   40183 	    test_ret++;
   40184             printf(" %d", n_code);
   40185             printf("\n");
   40186         }
   40187     }
   40188     function_tests++;
   40189 #endif
   40190 
   40191     return(test_ret);
   40192 }
   40193 
   40194 
   40195 static int
   40196 test_xmlUCSIsEthiopic(void) {
   40197     int test_ret = 0;
   40198 
   40199 #if defined(LIBXML_UNICODE_ENABLED)
   40200     int mem_base;
   40201     int ret_val;
   40202     int code; /* UCS code point */
   40203     int n_code;
   40204 
   40205     for (n_code = 0;n_code < gen_nb_int;n_code++) {
   40206         mem_base = xmlMemBlocks();
   40207         code = gen_int(n_code, 0);
   40208 
   40209         ret_val = xmlUCSIsEthiopic(code);
   40210         desret_int(ret_val);
   40211         call_tests++;
   40212         des_int(n_code, code, 0);
   40213         xmlResetLastError();
   40214         if (mem_base != xmlMemBlocks()) {
   40215             printf("Leak of %d blocks found in xmlUCSIsEthiopic",
   40216 	           xmlMemBlocks() - mem_base);
   40217 	    test_ret++;
   40218             printf(" %d", n_code);
   40219             printf("\n");
   40220         }
   40221     }
   40222     function_tests++;
   40223 #endif
   40224 
   40225     return(test_ret);
   40226 }
   40227 
   40228 
   40229 static int
   40230 test_xmlUCSIsGeneralPunctuation(void) {
   40231     int test_ret = 0;
   40232 
   40233 #if defined(LIBXML_UNICODE_ENABLED)
   40234     int mem_base;
   40235     int ret_val;
   40236     int code; /* UCS code point */
   40237     int n_code;
   40238 
   40239     for (n_code = 0;n_code < gen_nb_int;n_code++) {
   40240         mem_base = xmlMemBlocks();
   40241         code = gen_int(n_code, 0);
   40242 
   40243         ret_val = xmlUCSIsGeneralPunctuation(code);
   40244         desret_int(ret_val);
   40245         call_tests++;
   40246         des_int(n_code, code, 0);
   40247         xmlResetLastError();
   40248         if (mem_base != xmlMemBlocks()) {
   40249             printf("Leak of %d blocks found in xmlUCSIsGeneralPunctuation",
   40250 	           xmlMemBlocks() - mem_base);
   40251 	    test_ret++;
   40252             printf(" %d", n_code);
   40253             printf("\n");
   40254         }
   40255     }
   40256     function_tests++;
   40257 #endif
   40258 
   40259     return(test_ret);
   40260 }
   40261 
   40262 
   40263 static int
   40264 test_xmlUCSIsGeometricShapes(void) {
   40265     int test_ret = 0;
   40266 
   40267 #if defined(LIBXML_UNICODE_ENABLED)
   40268     int mem_base;
   40269     int ret_val;
   40270     int code; /* UCS code point */
   40271     int n_code;
   40272 
   40273     for (n_code = 0;n_code < gen_nb_int;n_code++) {
   40274         mem_base = xmlMemBlocks();
   40275         code = gen_int(n_code, 0);
   40276 
   40277         ret_val = xmlUCSIsGeometricShapes(code);
   40278         desret_int(ret_val);
   40279         call_tests++;
   40280         des_int(n_code, code, 0);
   40281         xmlResetLastError();
   40282         if (mem_base != xmlMemBlocks()) {
   40283             printf("Leak of %d blocks found in xmlUCSIsGeometricShapes",
   40284 	           xmlMemBlocks() - mem_base);
   40285 	    test_ret++;
   40286             printf(" %d", n_code);
   40287             printf("\n");
   40288         }
   40289     }
   40290     function_tests++;
   40291 #endif
   40292 
   40293     return(test_ret);
   40294 }
   40295 
   40296 
   40297 static int
   40298 test_xmlUCSIsGeorgian(void) {
   40299     int test_ret = 0;
   40300 
   40301 #if defined(LIBXML_UNICODE_ENABLED)
   40302     int mem_base;
   40303     int ret_val;
   40304     int code; /* UCS code point */
   40305     int n_code;
   40306 
   40307     for (n_code = 0;n_code < gen_nb_int;n_code++) {
   40308         mem_base = xmlMemBlocks();
   40309         code = gen_int(n_code, 0);
   40310 
   40311         ret_val = xmlUCSIsGeorgian(code);
   40312         desret_int(ret_val);
   40313         call_tests++;
   40314         des_int(n_code, code, 0);
   40315         xmlResetLastError();
   40316         if (mem_base != xmlMemBlocks()) {
   40317             printf("Leak of %d blocks found in xmlUCSIsGeorgian",
   40318 	           xmlMemBlocks() - mem_base);
   40319 	    test_ret++;
   40320             printf(" %d", n_code);
   40321             printf("\n");
   40322         }
   40323     }
   40324     function_tests++;
   40325 #endif
   40326 
   40327     return(test_ret);
   40328 }
   40329 
   40330 
   40331 static int
   40332 test_xmlUCSIsGothic(void) {
   40333     int test_ret = 0;
   40334 
   40335 #if defined(LIBXML_UNICODE_ENABLED)
   40336     int mem_base;
   40337     int ret_val;
   40338     int code; /* UCS code point */
   40339     int n_code;
   40340 
   40341     for (n_code = 0;n_code < gen_nb_int;n_code++) {
   40342         mem_base = xmlMemBlocks();
   40343         code = gen_int(n_code, 0);
   40344 
   40345         ret_val = xmlUCSIsGothic(code);
   40346         desret_int(ret_val);
   40347         call_tests++;
   40348         des_int(n_code, code, 0);
   40349         xmlResetLastError();
   40350         if (mem_base != xmlMemBlocks()) {
   40351             printf("Leak of %d blocks found in xmlUCSIsGothic",
   40352 	           xmlMemBlocks() - mem_base);
   40353 	    test_ret++;
   40354             printf(" %d", n_code);
   40355             printf("\n");
   40356         }
   40357     }
   40358     function_tests++;
   40359 #endif
   40360 
   40361     return(test_ret);
   40362 }
   40363 
   40364 
   40365 static int
   40366 test_xmlUCSIsGreek(void) {
   40367     int test_ret = 0;
   40368 
   40369 #if defined(LIBXML_UNICODE_ENABLED)
   40370     int mem_base;
   40371     int ret_val;
   40372     int code; /* UCS code point */
   40373     int n_code;
   40374 
   40375     for (n_code = 0;n_code < gen_nb_int;n_code++) {
   40376         mem_base = xmlMemBlocks();
   40377         code = gen_int(n_code, 0);
   40378 
   40379         ret_val = xmlUCSIsGreek(code);
   40380         desret_int(ret_val);
   40381         call_tests++;
   40382         des_int(n_code, code, 0);
   40383         xmlResetLastError();
   40384         if (mem_base != xmlMemBlocks()) {
   40385             printf("Leak of %d blocks found in xmlUCSIsGreek",
   40386 	           xmlMemBlocks() - mem_base);
   40387 	    test_ret++;
   40388             printf(" %d", n_code);
   40389             printf("\n");
   40390         }
   40391     }
   40392     function_tests++;
   40393 #endif
   40394 
   40395     return(test_ret);
   40396 }
   40397 
   40398 
   40399 static int
   40400 test_xmlUCSIsGreekExtended(void) {
   40401     int test_ret = 0;
   40402 
   40403 #if defined(LIBXML_UNICODE_ENABLED)
   40404     int mem_base;
   40405     int ret_val;
   40406     int code; /* UCS code point */
   40407     int n_code;
   40408 
   40409     for (n_code = 0;n_code < gen_nb_int;n_code++) {
   40410         mem_base = xmlMemBlocks();
   40411         code = gen_int(n_code, 0);
   40412 
   40413         ret_val = xmlUCSIsGreekExtended(code);
   40414         desret_int(ret_val);
   40415         call_tests++;
   40416         des_int(n_code, code, 0);
   40417         xmlResetLastError();
   40418         if (mem_base != xmlMemBlocks()) {
   40419             printf("Leak of %d blocks found in xmlUCSIsGreekExtended",
   40420 	           xmlMemBlocks() - mem_base);
   40421 	    test_ret++;
   40422             printf(" %d", n_code);
   40423             printf("\n");
   40424         }
   40425     }
   40426     function_tests++;
   40427 #endif
   40428 
   40429     return(test_ret);
   40430 }
   40431 
   40432 
   40433 static int
   40434 test_xmlUCSIsGreekandCoptic(void) {
   40435     int test_ret = 0;
   40436 
   40437 #if defined(LIBXML_UNICODE_ENABLED)
   40438     int mem_base;
   40439     int ret_val;
   40440     int code; /* UCS code point */
   40441     int n_code;
   40442 
   40443     for (n_code = 0;n_code < gen_nb_int;n_code++) {
   40444         mem_base = xmlMemBlocks();
   40445         code = gen_int(n_code, 0);
   40446 
   40447         ret_val = xmlUCSIsGreekandCoptic(code);
   40448         desret_int(ret_val);
   40449         call_tests++;
   40450         des_int(n_code, code, 0);
   40451         xmlResetLastError();
   40452         if (mem_base != xmlMemBlocks()) {
   40453             printf("Leak of %d blocks found in xmlUCSIsGreekandCoptic",
   40454 	           xmlMemBlocks() - mem_base);
   40455 	    test_ret++;
   40456             printf(" %d", n_code);
   40457             printf("\n");
   40458         }
   40459     }
   40460     function_tests++;
   40461 #endif
   40462 
   40463     return(test_ret);
   40464 }
   40465 
   40466 
   40467 static int
   40468 test_xmlUCSIsGujarati(void) {
   40469     int test_ret = 0;
   40470 
   40471 #if defined(LIBXML_UNICODE_ENABLED)
   40472     int mem_base;
   40473     int ret_val;
   40474     int code; /* UCS code point */
   40475     int n_code;
   40476 
   40477     for (n_code = 0;n_code < gen_nb_int;n_code++) {
   40478         mem_base = xmlMemBlocks();
   40479         code = gen_int(n_code, 0);
   40480 
   40481         ret_val = xmlUCSIsGujarati(code);
   40482         desret_int(ret_val);
   40483         call_tests++;
   40484         des_int(n_code, code, 0);
   40485         xmlResetLastError();
   40486         if (mem_base != xmlMemBlocks()) {
   40487             printf("Leak of %d blocks found in xmlUCSIsGujarati",
   40488 	           xmlMemBlocks() - mem_base);
   40489 	    test_ret++;
   40490             printf(" %d", n_code);
   40491             printf("\n");
   40492         }
   40493     }
   40494     function_tests++;
   40495 #endif
   40496 
   40497     return(test_ret);
   40498 }
   40499 
   40500 
   40501 static int
   40502 test_xmlUCSIsGurmukhi(void) {
   40503     int test_ret = 0;
   40504 
   40505 #if defined(LIBXML_UNICODE_ENABLED)
   40506     int mem_base;
   40507     int ret_val;
   40508     int code; /* UCS code point */
   40509     int n_code;
   40510 
   40511     for (n_code = 0;n_code < gen_nb_int;n_code++) {
   40512         mem_base = xmlMemBlocks();
   40513         code = gen_int(n_code, 0);
   40514 
   40515         ret_val = xmlUCSIsGurmukhi(code);
   40516         desret_int(ret_val);
   40517         call_tests++;
   40518         des_int(n_code, code, 0);
   40519         xmlResetLastError();
   40520         if (mem_base != xmlMemBlocks()) {
   40521             printf("Leak of %d blocks found in xmlUCSIsGurmukhi",
   40522 	           xmlMemBlocks() - mem_base);
   40523 	    test_ret++;
   40524             printf(" %d", n_code);
   40525             printf("\n");
   40526         }
   40527     }
   40528     function_tests++;
   40529 #endif
   40530 
   40531     return(test_ret);
   40532 }
   40533 
   40534 
   40535 static int
   40536 test_xmlUCSIsHalfwidthandFullwidthForms(void) {
   40537     int test_ret = 0;
   40538 
   40539 #if defined(LIBXML_UNICODE_ENABLED)
   40540     int mem_base;
   40541     int ret_val;
   40542     int code; /* UCS code point */
   40543     int n_code;
   40544 
   40545     for (n_code = 0;n_code < gen_nb_int;n_code++) {
   40546         mem_base = xmlMemBlocks();
   40547         code = gen_int(n_code, 0);
   40548 
   40549         ret_val = xmlUCSIsHalfwidthandFullwidthForms(code);
   40550         desret_int(ret_val);
   40551         call_tests++;
   40552         des_int(n_code, code, 0);
   40553         xmlResetLastError();
   40554         if (mem_base != xmlMemBlocks()) {
   40555             printf("Leak of %d blocks found in xmlUCSIsHalfwidthandFullwidthForms",
   40556 	           xmlMemBlocks() - mem_base);
   40557 	    test_ret++;
   40558             printf(" %d", n_code);
   40559             printf("\n");
   40560         }
   40561     }
   40562     function_tests++;
   40563 #endif
   40564 
   40565     return(test_ret);
   40566 }
   40567 
   40568 
   40569 static int
   40570 test_xmlUCSIsHangulCompatibilityJamo(void) {
   40571     int test_ret = 0;
   40572 
   40573 #if defined(LIBXML_UNICODE_ENABLED)
   40574     int mem_base;
   40575     int ret_val;
   40576     int code; /* UCS code point */
   40577     int n_code;
   40578 
   40579     for (n_code = 0;n_code < gen_nb_int;n_code++) {
   40580         mem_base = xmlMemBlocks();
   40581         code = gen_int(n_code, 0);
   40582 
   40583         ret_val = xmlUCSIsHangulCompatibilityJamo(code);
   40584         desret_int(ret_val);
   40585         call_tests++;
   40586         des_int(n_code, code, 0);
   40587         xmlResetLastError();
   40588         if (mem_base != xmlMemBlocks()) {
   40589             printf("Leak of %d blocks found in xmlUCSIsHangulCompatibilityJamo",
   40590 	           xmlMemBlocks() - mem_base);
   40591 	    test_ret++;
   40592             printf(" %d", n_code);
   40593             printf("\n");
   40594         }
   40595     }
   40596     function_tests++;
   40597 #endif
   40598 
   40599     return(test_ret);
   40600 }
   40601 
   40602 
   40603 static int
   40604 test_xmlUCSIsHangulJamo(void) {
   40605     int test_ret = 0;
   40606 
   40607 #if defined(LIBXML_UNICODE_ENABLED)
   40608     int mem_base;
   40609     int ret_val;
   40610     int code; /* UCS code point */
   40611     int n_code;
   40612 
   40613     for (n_code = 0;n_code < gen_nb_int;n_code++) {
   40614         mem_base = xmlMemBlocks();
   40615         code = gen_int(n_code, 0);
   40616 
   40617         ret_val = xmlUCSIsHangulJamo(code);
   40618         desret_int(ret_val);
   40619         call_tests++;
   40620         des_int(n_code, code, 0);
   40621         xmlResetLastError();
   40622         if (mem_base != xmlMemBlocks()) {
   40623             printf("Leak of %d blocks found in xmlUCSIsHangulJamo",
   40624 	           xmlMemBlocks() - mem_base);
   40625 	    test_ret++;
   40626             printf(" %d", n_code);
   40627             printf("\n");
   40628         }
   40629     }
   40630     function_tests++;
   40631 #endif
   40632 
   40633     return(test_ret);
   40634 }
   40635 
   40636 
   40637 static int
   40638 test_xmlUCSIsHangulSyllables(void) {
   40639     int test_ret = 0;
   40640 
   40641 #if defined(LIBXML_UNICODE_ENABLED)
   40642     int mem_base;
   40643     int ret_val;
   40644     int code; /* UCS code point */
   40645     int n_code;
   40646 
   40647     for (n_code = 0;n_code < gen_nb_int;n_code++) {
   40648         mem_base = xmlMemBlocks();
   40649         code = gen_int(n_code, 0);
   40650 
   40651         ret_val = xmlUCSIsHangulSyllables(code);
   40652         desret_int(ret_val);
   40653         call_tests++;
   40654         des_int(n_code, code, 0);
   40655         xmlResetLastError();
   40656         if (mem_base != xmlMemBlocks()) {
   40657             printf("Leak of %d blocks found in xmlUCSIsHangulSyllables",
   40658 	           xmlMemBlocks() - mem_base);
   40659 	    test_ret++;
   40660             printf(" %d", n_code);
   40661             printf("\n");
   40662         }
   40663     }
   40664     function_tests++;
   40665 #endif
   40666 
   40667     return(test_ret);
   40668 }
   40669 
   40670 
   40671 static int
   40672 test_xmlUCSIsHanunoo(void) {
   40673     int test_ret = 0;
   40674 
   40675 #if defined(LIBXML_UNICODE_ENABLED)
   40676     int mem_base;
   40677     int ret_val;
   40678     int code; /* UCS code point */
   40679     int n_code;
   40680 
   40681     for (n_code = 0;n_code < gen_nb_int;n_code++) {
   40682         mem_base = xmlMemBlocks();
   40683         code = gen_int(n_code, 0);
   40684 
   40685         ret_val = xmlUCSIsHanunoo(code);
   40686         desret_int(ret_val);
   40687         call_tests++;
   40688         des_int(n_code, code, 0);
   40689         xmlResetLastError();
   40690         if (mem_base != xmlMemBlocks()) {
   40691             printf("Leak of %d blocks found in xmlUCSIsHanunoo",
   40692 	           xmlMemBlocks() - mem_base);
   40693 	    test_ret++;
   40694             printf(" %d", n_code);
   40695             printf("\n");
   40696         }
   40697     }
   40698     function_tests++;
   40699 #endif
   40700 
   40701     return(test_ret);
   40702 }
   40703 
   40704 
   40705 static int
   40706 test_xmlUCSIsHebrew(void) {
   40707     int test_ret = 0;
   40708 
   40709 #if defined(LIBXML_UNICODE_ENABLED)
   40710     int mem_base;
   40711     int ret_val;
   40712     int code; /* UCS code point */
   40713     int n_code;
   40714 
   40715     for (n_code = 0;n_code < gen_nb_int;n_code++) {
   40716         mem_base = xmlMemBlocks();
   40717         code = gen_int(n_code, 0);
   40718 
   40719         ret_val = xmlUCSIsHebrew(code);
   40720         desret_int(ret_val);
   40721         call_tests++;
   40722         des_int(n_code, code, 0);
   40723         xmlResetLastError();
   40724         if (mem_base != xmlMemBlocks()) {
   40725             printf("Leak of %d blocks found in xmlUCSIsHebrew",
   40726 	           xmlMemBlocks() - mem_base);
   40727 	    test_ret++;
   40728             printf(" %d", n_code);
   40729             printf("\n");
   40730         }
   40731     }
   40732     function_tests++;
   40733 #endif
   40734 
   40735     return(test_ret);
   40736 }
   40737 
   40738 
   40739 static int
   40740 test_xmlUCSIsHighPrivateUseSurrogates(void) {
   40741     int test_ret = 0;
   40742 
   40743 #if defined(LIBXML_UNICODE_ENABLED)
   40744     int mem_base;
   40745     int ret_val;
   40746     int code; /* UCS code point */
   40747     int n_code;
   40748 
   40749     for (n_code = 0;n_code < gen_nb_int;n_code++) {
   40750         mem_base = xmlMemBlocks();
   40751         code = gen_int(n_code, 0);
   40752 
   40753         ret_val = xmlUCSIsHighPrivateUseSurrogates(code);
   40754         desret_int(ret_val);
   40755         call_tests++;
   40756         des_int(n_code, code, 0);
   40757         xmlResetLastError();
   40758         if (mem_base != xmlMemBlocks()) {
   40759             printf("Leak of %d blocks found in xmlUCSIsHighPrivateUseSurrogates",
   40760 	           xmlMemBlocks() - mem_base);
   40761 	    test_ret++;
   40762             printf(" %d", n_code);
   40763             printf("\n");
   40764         }
   40765     }
   40766     function_tests++;
   40767 #endif
   40768 
   40769     return(test_ret);
   40770 }
   40771 
   40772 
   40773 static int
   40774 test_xmlUCSIsHighSurrogates(void) {
   40775     int test_ret = 0;
   40776 
   40777 #if defined(LIBXML_UNICODE_ENABLED)
   40778     int mem_base;
   40779     int ret_val;
   40780     int code; /* UCS code point */
   40781     int n_code;
   40782 
   40783     for (n_code = 0;n_code < gen_nb_int;n_code++) {
   40784         mem_base = xmlMemBlocks();
   40785         code = gen_int(n_code, 0);
   40786 
   40787         ret_val = xmlUCSIsHighSurrogates(code);
   40788         desret_int(ret_val);
   40789         call_tests++;
   40790         des_int(n_code, code, 0);
   40791         xmlResetLastError();
   40792         if (mem_base != xmlMemBlocks()) {
   40793             printf("Leak of %d blocks found in xmlUCSIsHighSurrogates",
   40794 	           xmlMemBlocks() - mem_base);
   40795 	    test_ret++;
   40796             printf(" %d", n_code);
   40797             printf("\n");
   40798         }
   40799     }
   40800     function_tests++;
   40801 #endif
   40802 
   40803     return(test_ret);
   40804 }
   40805 
   40806 
   40807 static int
   40808 test_xmlUCSIsHiragana(void) {
   40809     int test_ret = 0;
   40810 
   40811 #if defined(LIBXML_UNICODE_ENABLED)
   40812     int mem_base;
   40813     int ret_val;
   40814     int code; /* UCS code point */
   40815     int n_code;
   40816 
   40817     for (n_code = 0;n_code < gen_nb_int;n_code++) {
   40818         mem_base = xmlMemBlocks();
   40819         code = gen_int(n_code, 0);
   40820 
   40821         ret_val = xmlUCSIsHiragana(code);
   40822         desret_int(ret_val);
   40823         call_tests++;
   40824         des_int(n_code, code, 0);
   40825         xmlResetLastError();
   40826         if (mem_base != xmlMemBlocks()) {
   40827             printf("Leak of %d blocks found in xmlUCSIsHiragana",
   40828 	           xmlMemBlocks() - mem_base);
   40829 	    test_ret++;
   40830             printf(" %d", n_code);
   40831             printf("\n");
   40832         }
   40833     }
   40834     function_tests++;
   40835 #endif
   40836 
   40837     return(test_ret);
   40838 }
   40839 
   40840 
   40841 static int
   40842 test_xmlUCSIsIPAExtensions(void) {
   40843     int test_ret = 0;
   40844 
   40845 #if defined(LIBXML_UNICODE_ENABLED)
   40846     int mem_base;
   40847     int ret_val;
   40848     int code; /* UCS code point */
   40849     int n_code;
   40850 
   40851     for (n_code = 0;n_code < gen_nb_int;n_code++) {
   40852         mem_base = xmlMemBlocks();
   40853         code = gen_int(n_code, 0);
   40854 
   40855         ret_val = xmlUCSIsIPAExtensions(code);
   40856         desret_int(ret_val);
   40857         call_tests++;
   40858         des_int(n_code, code, 0);
   40859         xmlResetLastError();
   40860         if (mem_base != xmlMemBlocks()) {
   40861             printf("Leak of %d blocks found in xmlUCSIsIPAExtensions",
   40862 	           xmlMemBlocks() - mem_base);
   40863 	    test_ret++;
   40864             printf(" %d", n_code);
   40865             printf("\n");
   40866         }
   40867     }
   40868     function_tests++;
   40869 #endif
   40870 
   40871     return(test_ret);
   40872 }
   40873 
   40874 
   40875 static int
   40876 test_xmlUCSIsIdeographicDescriptionCharacters(void) {
   40877     int test_ret = 0;
   40878 
   40879 #if defined(LIBXML_UNICODE_ENABLED)
   40880     int mem_base;
   40881     int ret_val;
   40882     int code; /* UCS code point */
   40883     int n_code;
   40884 
   40885     for (n_code = 0;n_code < gen_nb_int;n_code++) {
   40886         mem_base = xmlMemBlocks();
   40887         code = gen_int(n_code, 0);
   40888 
   40889         ret_val = xmlUCSIsIdeographicDescriptionCharacters(code);
   40890         desret_int(ret_val);
   40891         call_tests++;
   40892         des_int(n_code, code, 0);
   40893         xmlResetLastError();
   40894         if (mem_base != xmlMemBlocks()) {
   40895             printf("Leak of %d blocks found in xmlUCSIsIdeographicDescriptionCharacters",
   40896 	           xmlMemBlocks() - mem_base);
   40897 	    test_ret++;
   40898             printf(" %d", n_code);
   40899             printf("\n");
   40900         }
   40901     }
   40902     function_tests++;
   40903 #endif
   40904 
   40905     return(test_ret);
   40906 }
   40907 
   40908 
   40909 static int
   40910 test_xmlUCSIsKanbun(void) {
   40911     int test_ret = 0;
   40912 
   40913 #if defined(LIBXML_UNICODE_ENABLED)
   40914     int mem_base;
   40915     int ret_val;
   40916     int code; /* UCS code point */
   40917     int n_code;
   40918 
   40919     for (n_code = 0;n_code < gen_nb_int;n_code++) {
   40920         mem_base = xmlMemBlocks();
   40921         code = gen_int(n_code, 0);
   40922 
   40923         ret_val = xmlUCSIsKanbun(code);
   40924         desret_int(ret_val);
   40925         call_tests++;
   40926         des_int(n_code, code, 0);
   40927         xmlResetLastError();
   40928         if (mem_base != xmlMemBlocks()) {
   40929             printf("Leak of %d blocks found in xmlUCSIsKanbun",
   40930 	           xmlMemBlocks() - mem_base);
   40931 	    test_ret++;
   40932             printf(" %d", n_code);
   40933             printf("\n");
   40934         }
   40935     }
   40936     function_tests++;
   40937 #endif
   40938 
   40939     return(test_ret);
   40940 }
   40941 
   40942 
   40943 static int
   40944 test_xmlUCSIsKangxiRadicals(void) {
   40945     int test_ret = 0;
   40946 
   40947 #if defined(LIBXML_UNICODE_ENABLED)
   40948     int mem_base;
   40949     int ret_val;
   40950     int code; /* UCS code point */
   40951     int n_code;
   40952 
   40953     for (n_code = 0;n_code < gen_nb_int;n_code++) {
   40954         mem_base = xmlMemBlocks();
   40955         code = gen_int(n_code, 0);
   40956 
   40957         ret_val = xmlUCSIsKangxiRadicals(code);
   40958         desret_int(ret_val);
   40959         call_tests++;
   40960         des_int(n_code, code, 0);
   40961         xmlResetLastError();
   40962         if (mem_base != xmlMemBlocks()) {
   40963             printf("Leak of %d blocks found in xmlUCSIsKangxiRadicals",
   40964 	           xmlMemBlocks() - mem_base);
   40965 	    test_ret++;
   40966             printf(" %d", n_code);
   40967             printf("\n");
   40968         }
   40969     }
   40970     function_tests++;
   40971 #endif
   40972 
   40973     return(test_ret);
   40974 }
   40975 
   40976 
   40977 static int
   40978 test_xmlUCSIsKannada(void) {
   40979     int test_ret = 0;
   40980 
   40981 #if defined(LIBXML_UNICODE_ENABLED)
   40982     int mem_base;
   40983     int ret_val;
   40984     int code; /* UCS code point */
   40985     int n_code;
   40986 
   40987     for (n_code = 0;n_code < gen_nb_int;n_code++) {
   40988         mem_base = xmlMemBlocks();
   40989         code = gen_int(n_code, 0);
   40990 
   40991         ret_val = xmlUCSIsKannada(code);
   40992         desret_int(ret_val);
   40993         call_tests++;
   40994         des_int(n_code, code, 0);
   40995         xmlResetLastError();
   40996         if (mem_base != xmlMemBlocks()) {
   40997             printf("Leak of %d blocks found in xmlUCSIsKannada",
   40998 	           xmlMemBlocks() - mem_base);
   40999 	    test_ret++;
   41000             printf(" %d", n_code);
   41001             printf("\n");
   41002         }
   41003     }
   41004     function_tests++;
   41005 #endif
   41006 
   41007     return(test_ret);
   41008 }
   41009 
   41010 
   41011 static int
   41012 test_xmlUCSIsKatakana(void) {
   41013     int test_ret = 0;
   41014 
   41015 #if defined(LIBXML_UNICODE_ENABLED)
   41016     int mem_base;
   41017     int ret_val;
   41018     int code; /* UCS code point */
   41019     int n_code;
   41020 
   41021     for (n_code = 0;n_code < gen_nb_int;n_code++) {
   41022         mem_base = xmlMemBlocks();
   41023         code = gen_int(n_code, 0);
   41024 
   41025         ret_val = xmlUCSIsKatakana(code);
   41026         desret_int(ret_val);
   41027         call_tests++;
   41028         des_int(n_code, code, 0);
   41029         xmlResetLastError();
   41030         if (mem_base != xmlMemBlocks()) {
   41031             printf("Leak of %d blocks found in xmlUCSIsKatakana",
   41032 	           xmlMemBlocks() - mem_base);
   41033 	    test_ret++;
   41034             printf(" %d", n_code);
   41035             printf("\n");
   41036         }
   41037     }
   41038     function_tests++;
   41039 #endif
   41040 
   41041     return(test_ret);
   41042 }
   41043 
   41044 
   41045 static int
   41046 test_xmlUCSIsKatakanaPhoneticExtensions(void) {
   41047     int test_ret = 0;
   41048 
   41049 #if defined(LIBXML_UNICODE_ENABLED)
   41050     int mem_base;
   41051     int ret_val;
   41052     int code; /* UCS code point */
   41053     int n_code;
   41054 
   41055     for (n_code = 0;n_code < gen_nb_int;n_code++) {
   41056         mem_base = xmlMemBlocks();
   41057         code = gen_int(n_code, 0);
   41058 
   41059         ret_val = xmlUCSIsKatakanaPhoneticExtensions(code);
   41060         desret_int(ret_val);
   41061         call_tests++;
   41062         des_int(n_code, code, 0);
   41063         xmlResetLastError();
   41064         if (mem_base != xmlMemBlocks()) {
   41065             printf("Leak of %d blocks found in xmlUCSIsKatakanaPhoneticExtensions",
   41066 	           xmlMemBlocks() - mem_base);
   41067 	    test_ret++;
   41068             printf(" %d", n_code);
   41069             printf("\n");
   41070         }
   41071     }
   41072     function_tests++;
   41073 #endif
   41074 
   41075     return(test_ret);
   41076 }
   41077 
   41078 
   41079 static int
   41080 test_xmlUCSIsKhmer(void) {
   41081     int test_ret = 0;
   41082 
   41083 #if defined(LIBXML_UNICODE_ENABLED)
   41084     int mem_base;
   41085     int ret_val;
   41086     int code; /* UCS code point */
   41087     int n_code;
   41088 
   41089     for (n_code = 0;n_code < gen_nb_int;n_code++) {
   41090         mem_base = xmlMemBlocks();
   41091         code = gen_int(n_code, 0);
   41092 
   41093         ret_val = xmlUCSIsKhmer(code);
   41094         desret_int(ret_val);
   41095         call_tests++;
   41096         des_int(n_code, code, 0);
   41097         xmlResetLastError();
   41098         if (mem_base != xmlMemBlocks()) {
   41099             printf("Leak of %d blocks found in xmlUCSIsKhmer",
   41100 	           xmlMemBlocks() - mem_base);
   41101 	    test_ret++;
   41102             printf(" %d", n_code);
   41103             printf("\n");
   41104         }
   41105     }
   41106     function_tests++;
   41107 #endif
   41108 
   41109     return(test_ret);
   41110 }
   41111 
   41112 
   41113 static int
   41114 test_xmlUCSIsKhmerSymbols(void) {
   41115     int test_ret = 0;
   41116 
   41117 #if defined(LIBXML_UNICODE_ENABLED)
   41118     int mem_base;
   41119     int ret_val;
   41120     int code; /* UCS code point */
   41121     int n_code;
   41122 
   41123     for (n_code = 0;n_code < gen_nb_int;n_code++) {
   41124         mem_base = xmlMemBlocks();
   41125         code = gen_int(n_code, 0);
   41126 
   41127         ret_val = xmlUCSIsKhmerSymbols(code);
   41128         desret_int(ret_val);
   41129         call_tests++;
   41130         des_int(n_code, code, 0);
   41131         xmlResetLastError();
   41132         if (mem_base != xmlMemBlocks()) {
   41133             printf("Leak of %d blocks found in xmlUCSIsKhmerSymbols",
   41134 	           xmlMemBlocks() - mem_base);
   41135 	    test_ret++;
   41136             printf(" %d", n_code);
   41137             printf("\n");
   41138         }
   41139     }
   41140     function_tests++;
   41141 #endif
   41142 
   41143     return(test_ret);
   41144 }
   41145 
   41146 
   41147 static int
   41148 test_xmlUCSIsLao(void) {
   41149     int test_ret = 0;
   41150 
   41151 #if defined(LIBXML_UNICODE_ENABLED)
   41152     int mem_base;
   41153     int ret_val;
   41154     int code; /* UCS code point */
   41155     int n_code;
   41156 
   41157     for (n_code = 0;n_code < gen_nb_int;n_code++) {
   41158         mem_base = xmlMemBlocks();
   41159         code = gen_int(n_code, 0);
   41160 
   41161         ret_val = xmlUCSIsLao(code);
   41162         desret_int(ret_val);
   41163         call_tests++;
   41164         des_int(n_code, code, 0);
   41165         xmlResetLastError();
   41166         if (mem_base != xmlMemBlocks()) {
   41167             printf("Leak of %d blocks found in xmlUCSIsLao",
   41168 	           xmlMemBlocks() - mem_base);
   41169 	    test_ret++;
   41170             printf(" %d", n_code);
   41171             printf("\n");
   41172         }
   41173     }
   41174     function_tests++;
   41175 #endif
   41176 
   41177     return(test_ret);
   41178 }
   41179 
   41180 
   41181 static int
   41182 test_xmlUCSIsLatin1Supplement(void) {
   41183     int test_ret = 0;
   41184 
   41185 #if defined(LIBXML_UNICODE_ENABLED)
   41186     int mem_base;
   41187     int ret_val;
   41188     int code; /* UCS code point */
   41189     int n_code;
   41190 
   41191     for (n_code = 0;n_code < gen_nb_int;n_code++) {
   41192         mem_base = xmlMemBlocks();
   41193         code = gen_int(n_code, 0);
   41194 
   41195         ret_val = xmlUCSIsLatin1Supplement(code);
   41196         desret_int(ret_val);
   41197         call_tests++;
   41198         des_int(n_code, code, 0);
   41199         xmlResetLastError();
   41200         if (mem_base != xmlMemBlocks()) {
   41201             printf("Leak of %d blocks found in xmlUCSIsLatin1Supplement",
   41202 	           xmlMemBlocks() - mem_base);
   41203 	    test_ret++;
   41204             printf(" %d", n_code);
   41205             printf("\n");
   41206         }
   41207     }
   41208     function_tests++;
   41209 #endif
   41210 
   41211     return(test_ret);
   41212 }
   41213 
   41214 
   41215 static int
   41216 test_xmlUCSIsLatinExtendedA(void) {
   41217     int test_ret = 0;
   41218 
   41219 #if defined(LIBXML_UNICODE_ENABLED)
   41220     int mem_base;
   41221     int ret_val;
   41222     int code; /* UCS code point */
   41223     int n_code;
   41224 
   41225     for (n_code = 0;n_code < gen_nb_int;n_code++) {
   41226         mem_base = xmlMemBlocks();
   41227         code = gen_int(n_code, 0);
   41228 
   41229         ret_val = xmlUCSIsLatinExtendedA(code);
   41230         desret_int(ret_val);
   41231         call_tests++;
   41232         des_int(n_code, code, 0);
   41233         xmlResetLastError();
   41234         if (mem_base != xmlMemBlocks()) {
   41235             printf("Leak of %d blocks found in xmlUCSIsLatinExtendedA",
   41236 	           xmlMemBlocks() - mem_base);
   41237 	    test_ret++;
   41238             printf(" %d", n_code);
   41239             printf("\n");
   41240         }
   41241     }
   41242     function_tests++;
   41243 #endif
   41244 
   41245     return(test_ret);
   41246 }
   41247 
   41248 
   41249 static int
   41250 test_xmlUCSIsLatinExtendedAdditional(void) {
   41251     int test_ret = 0;
   41252 
   41253 #if defined(LIBXML_UNICODE_ENABLED)
   41254     int mem_base;
   41255     int ret_val;
   41256     int code; /* UCS code point */
   41257     int n_code;
   41258 
   41259     for (n_code = 0;n_code < gen_nb_int;n_code++) {
   41260         mem_base = xmlMemBlocks();
   41261         code = gen_int(n_code, 0);
   41262 
   41263         ret_val = xmlUCSIsLatinExtendedAdditional(code);
   41264         desret_int(ret_val);
   41265         call_tests++;
   41266         des_int(n_code, code, 0);
   41267         xmlResetLastError();
   41268         if (mem_base != xmlMemBlocks()) {
   41269             printf("Leak of %d blocks found in xmlUCSIsLatinExtendedAdditional",
   41270 	           xmlMemBlocks() - mem_base);
   41271 	    test_ret++;
   41272             printf(" %d", n_code);
   41273             printf("\n");
   41274         }
   41275     }
   41276     function_tests++;
   41277 #endif
   41278 
   41279     return(test_ret);
   41280 }
   41281 
   41282 
   41283 static int
   41284 test_xmlUCSIsLatinExtendedB(void) {
   41285     int test_ret = 0;
   41286 
   41287 #if defined(LIBXML_UNICODE_ENABLED)
   41288     int mem_base;
   41289     int ret_val;
   41290     int code; /* UCS code point */
   41291     int n_code;
   41292 
   41293     for (n_code = 0;n_code < gen_nb_int;n_code++) {
   41294         mem_base = xmlMemBlocks();
   41295         code = gen_int(n_code, 0);
   41296 
   41297         ret_val = xmlUCSIsLatinExtendedB(code);
   41298         desret_int(ret_val);
   41299         call_tests++;
   41300         des_int(n_code, code, 0);
   41301         xmlResetLastError();
   41302         if (mem_base != xmlMemBlocks()) {
   41303             printf("Leak of %d blocks found in xmlUCSIsLatinExtendedB",
   41304 	           xmlMemBlocks() - mem_base);
   41305 	    test_ret++;
   41306             printf(" %d", n_code);
   41307             printf("\n");
   41308         }
   41309     }
   41310     function_tests++;
   41311 #endif
   41312 
   41313     return(test_ret);
   41314 }
   41315 
   41316 
   41317 static int
   41318 test_xmlUCSIsLetterlikeSymbols(void) {
   41319     int test_ret = 0;
   41320 
   41321 #if defined(LIBXML_UNICODE_ENABLED)
   41322     int mem_base;
   41323     int ret_val;
   41324     int code; /* UCS code point */
   41325     int n_code;
   41326 
   41327     for (n_code = 0;n_code < gen_nb_int;n_code++) {
   41328         mem_base = xmlMemBlocks();
   41329         code = gen_int(n_code, 0);
   41330 
   41331         ret_val = xmlUCSIsLetterlikeSymbols(code);
   41332         desret_int(ret_val);
   41333         call_tests++;
   41334         des_int(n_code, code, 0);
   41335         xmlResetLastError();
   41336         if (mem_base != xmlMemBlocks()) {
   41337             printf("Leak of %d blocks found in xmlUCSIsLetterlikeSymbols",
   41338 	           xmlMemBlocks() - mem_base);
   41339 	    test_ret++;
   41340             printf(" %d", n_code);
   41341             printf("\n");
   41342         }
   41343     }
   41344     function_tests++;
   41345 #endif
   41346 
   41347     return(test_ret);
   41348 }
   41349 
   41350 
   41351 static int
   41352 test_xmlUCSIsLimbu(void) {
   41353     int test_ret = 0;
   41354 
   41355 #if defined(LIBXML_UNICODE_ENABLED)
   41356     int mem_base;
   41357     int ret_val;
   41358     int code; /* UCS code point */
   41359     int n_code;
   41360 
   41361     for (n_code = 0;n_code < gen_nb_int;n_code++) {
   41362         mem_base = xmlMemBlocks();
   41363         code = gen_int(n_code, 0);
   41364 
   41365         ret_val = xmlUCSIsLimbu(code);
   41366         desret_int(ret_val);
   41367         call_tests++;
   41368         des_int(n_code, code, 0);
   41369         xmlResetLastError();
   41370         if (mem_base != xmlMemBlocks()) {
   41371             printf("Leak of %d blocks found in xmlUCSIsLimbu",
   41372 	           xmlMemBlocks() - mem_base);
   41373 	    test_ret++;
   41374             printf(" %d", n_code);
   41375             printf("\n");
   41376         }
   41377     }
   41378     function_tests++;
   41379 #endif
   41380 
   41381     return(test_ret);
   41382 }
   41383 
   41384 
   41385 static int
   41386 test_xmlUCSIsLinearBIdeograms(void) {
   41387     int test_ret = 0;
   41388 
   41389 #if defined(LIBXML_UNICODE_ENABLED)
   41390     int mem_base;
   41391     int ret_val;
   41392     int code; /* UCS code point */
   41393     int n_code;
   41394 
   41395     for (n_code = 0;n_code < gen_nb_int;n_code++) {
   41396         mem_base = xmlMemBlocks();
   41397         code = gen_int(n_code, 0);
   41398 
   41399         ret_val = xmlUCSIsLinearBIdeograms(code);
   41400         desret_int(ret_val);
   41401         call_tests++;
   41402         des_int(n_code, code, 0);
   41403         xmlResetLastError();
   41404         if (mem_base != xmlMemBlocks()) {
   41405             printf("Leak of %d blocks found in xmlUCSIsLinearBIdeograms",
   41406 	           xmlMemBlocks() - mem_base);
   41407 	    test_ret++;
   41408             printf(" %d", n_code);
   41409             printf("\n");
   41410         }
   41411     }
   41412     function_tests++;
   41413 #endif
   41414 
   41415     return(test_ret);
   41416 }
   41417 
   41418 
   41419 static int
   41420 test_xmlUCSIsLinearBSyllabary(void) {
   41421     int test_ret = 0;
   41422 
   41423 #if defined(LIBXML_UNICODE_ENABLED)
   41424     int mem_base;
   41425     int ret_val;
   41426     int code; /* UCS code point */
   41427     int n_code;
   41428 
   41429     for (n_code = 0;n_code < gen_nb_int;n_code++) {
   41430         mem_base = xmlMemBlocks();
   41431         code = gen_int(n_code, 0);
   41432 
   41433         ret_val = xmlUCSIsLinearBSyllabary(code);
   41434         desret_int(ret_val);
   41435         call_tests++;
   41436         des_int(n_code, code, 0);
   41437         xmlResetLastError();
   41438         if (mem_base != xmlMemBlocks()) {
   41439             printf("Leak of %d blocks found in xmlUCSIsLinearBSyllabary",
   41440 	           xmlMemBlocks() - mem_base);
   41441 	    test_ret++;
   41442             printf(" %d", n_code);
   41443             printf("\n");
   41444         }
   41445     }
   41446     function_tests++;
   41447 #endif
   41448 
   41449     return(test_ret);
   41450 }
   41451 
   41452 
   41453 static int
   41454 test_xmlUCSIsLowSurrogates(void) {
   41455     int test_ret = 0;
   41456 
   41457 #if defined(LIBXML_UNICODE_ENABLED)
   41458     int mem_base;
   41459     int ret_val;
   41460     int code; /* UCS code point */
   41461     int n_code;
   41462 
   41463     for (n_code = 0;n_code < gen_nb_int;n_code++) {
   41464         mem_base = xmlMemBlocks();
   41465         code = gen_int(n_code, 0);
   41466 
   41467         ret_val = xmlUCSIsLowSurrogates(code);
   41468         desret_int(ret_val);
   41469         call_tests++;
   41470         des_int(n_code, code, 0);
   41471         xmlResetLastError();
   41472         if (mem_base != xmlMemBlocks()) {
   41473             printf("Leak of %d blocks found in xmlUCSIsLowSurrogates",
   41474 	           xmlMemBlocks() - mem_base);
   41475 	    test_ret++;
   41476             printf(" %d", n_code);
   41477             printf("\n");
   41478         }
   41479     }
   41480     function_tests++;
   41481 #endif
   41482 
   41483     return(test_ret);
   41484 }
   41485 
   41486 
   41487 static int
   41488 test_xmlUCSIsMalayalam(void) {
   41489     int test_ret = 0;
   41490 
   41491 #if defined(LIBXML_UNICODE_ENABLED)
   41492     int mem_base;
   41493     int ret_val;
   41494     int code; /* UCS code point */
   41495     int n_code;
   41496 
   41497     for (n_code = 0;n_code < gen_nb_int;n_code++) {
   41498         mem_base = xmlMemBlocks();
   41499         code = gen_int(n_code, 0);
   41500 
   41501         ret_val = xmlUCSIsMalayalam(code);
   41502         desret_int(ret_val);
   41503         call_tests++;
   41504         des_int(n_code, code, 0);
   41505         xmlResetLastError();
   41506         if (mem_base != xmlMemBlocks()) {
   41507             printf("Leak of %d blocks found in xmlUCSIsMalayalam",
   41508 	           xmlMemBlocks() - mem_base);
   41509 	    test_ret++;
   41510             printf(" %d", n_code);
   41511             printf("\n");
   41512         }
   41513     }
   41514     function_tests++;
   41515 #endif
   41516 
   41517     return(test_ret);
   41518 }
   41519 
   41520 
   41521 static int
   41522 test_xmlUCSIsMathematicalAlphanumericSymbols(void) {
   41523     int test_ret = 0;
   41524 
   41525 #if defined(LIBXML_UNICODE_ENABLED)
   41526     int mem_base;
   41527     int ret_val;
   41528     int code; /* UCS code point */
   41529     int n_code;
   41530 
   41531     for (n_code = 0;n_code < gen_nb_int;n_code++) {
   41532         mem_base = xmlMemBlocks();
   41533         code = gen_int(n_code, 0);
   41534 
   41535         ret_val = xmlUCSIsMathematicalAlphanumericSymbols(code);
   41536         desret_int(ret_val);
   41537         call_tests++;
   41538         des_int(n_code, code, 0);
   41539         xmlResetLastError();
   41540         if (mem_base != xmlMemBlocks()) {
   41541             printf("Leak of %d blocks found in xmlUCSIsMathematicalAlphanumericSymbols",
   41542 	           xmlMemBlocks() - mem_base);
   41543 	    test_ret++;
   41544             printf(" %d", n_code);
   41545             printf("\n");
   41546         }
   41547     }
   41548     function_tests++;
   41549 #endif
   41550 
   41551     return(test_ret);
   41552 }
   41553 
   41554 
   41555 static int
   41556 test_xmlUCSIsMathematicalOperators(void) {
   41557     int test_ret = 0;
   41558 
   41559 #if defined(LIBXML_UNICODE_ENABLED)
   41560     int mem_base;
   41561     int ret_val;
   41562     int code; /* UCS code point */
   41563     int n_code;
   41564 
   41565     for (n_code = 0;n_code < gen_nb_int;n_code++) {
   41566         mem_base = xmlMemBlocks();
   41567         code = gen_int(n_code, 0);
   41568 
   41569         ret_val = xmlUCSIsMathematicalOperators(code);
   41570         desret_int(ret_val);
   41571         call_tests++;
   41572         des_int(n_code, code, 0);
   41573         xmlResetLastError();
   41574         if (mem_base != xmlMemBlocks()) {
   41575             printf("Leak of %d blocks found in xmlUCSIsMathematicalOperators",
   41576 	           xmlMemBlocks() - mem_base);
   41577 	    test_ret++;
   41578             printf(" %d", n_code);
   41579             printf("\n");
   41580         }
   41581     }
   41582     function_tests++;
   41583 #endif
   41584 
   41585     return(test_ret);
   41586 }
   41587 
   41588 
   41589 static int
   41590 test_xmlUCSIsMiscellaneousMathematicalSymbolsA(void) {
   41591     int test_ret = 0;
   41592 
   41593 #if defined(LIBXML_UNICODE_ENABLED)
   41594     int mem_base;
   41595     int ret_val;
   41596     int code; /* UCS code point */
   41597     int n_code;
   41598 
   41599     for (n_code = 0;n_code < gen_nb_int;n_code++) {
   41600         mem_base = xmlMemBlocks();
   41601         code = gen_int(n_code, 0);
   41602 
   41603         ret_val = xmlUCSIsMiscellaneousMathematicalSymbolsA(code);
   41604         desret_int(ret_val);
   41605         call_tests++;
   41606         des_int(n_code, code, 0);
   41607         xmlResetLastError();
   41608         if (mem_base != xmlMemBlocks()) {
   41609             printf("Leak of %d blocks found in xmlUCSIsMiscellaneousMathematicalSymbolsA",
   41610 	           xmlMemBlocks() - mem_base);
   41611 	    test_ret++;
   41612             printf(" %d", n_code);
   41613             printf("\n");
   41614         }
   41615     }
   41616     function_tests++;
   41617 #endif
   41618 
   41619     return(test_ret);
   41620 }
   41621 
   41622 
   41623 static int
   41624 test_xmlUCSIsMiscellaneousMathematicalSymbolsB(void) {
   41625     int test_ret = 0;
   41626 
   41627 #if defined(LIBXML_UNICODE_ENABLED)
   41628     int mem_base;
   41629     int ret_val;
   41630     int code; /* UCS code point */
   41631     int n_code;
   41632 
   41633     for (n_code = 0;n_code < gen_nb_int;n_code++) {
   41634         mem_base = xmlMemBlocks();
   41635         code = gen_int(n_code, 0);
   41636 
   41637         ret_val = xmlUCSIsMiscellaneousMathematicalSymbolsB(code);
   41638         desret_int(ret_val);
   41639         call_tests++;
   41640         des_int(n_code, code, 0);
   41641         xmlResetLastError();
   41642         if (mem_base != xmlMemBlocks()) {
   41643             printf("Leak of %d blocks found in xmlUCSIsMiscellaneousMathematicalSymbolsB",
   41644 	           xmlMemBlocks() - mem_base);
   41645 	    test_ret++;
   41646             printf(" %d", n_code);
   41647             printf("\n");
   41648         }
   41649     }
   41650     function_tests++;
   41651 #endif
   41652 
   41653     return(test_ret);
   41654 }
   41655 
   41656 
   41657 static int
   41658 test_xmlUCSIsMiscellaneousSymbols(void) {
   41659     int test_ret = 0;
   41660 
   41661 #if defined(LIBXML_UNICODE_ENABLED)
   41662     int mem_base;
   41663     int ret_val;
   41664     int code; /* UCS code point */
   41665     int n_code;
   41666 
   41667     for (n_code = 0;n_code < gen_nb_int;n_code++) {
   41668         mem_base = xmlMemBlocks();
   41669         code = gen_int(n_code, 0);
   41670 
   41671         ret_val = xmlUCSIsMiscellaneousSymbols(code);
   41672         desret_int(ret_val);
   41673         call_tests++;
   41674         des_int(n_code, code, 0);
   41675         xmlResetLastError();
   41676         if (mem_base != xmlMemBlocks()) {
   41677             printf("Leak of %d blocks found in xmlUCSIsMiscellaneousSymbols",
   41678 	           xmlMemBlocks() - mem_base);
   41679 	    test_ret++;
   41680             printf(" %d", n_code);
   41681             printf("\n");
   41682         }
   41683     }
   41684     function_tests++;
   41685 #endif
   41686 
   41687     return(test_ret);
   41688 }
   41689 
   41690 
   41691 static int
   41692 test_xmlUCSIsMiscellaneousSymbolsandArrows(void) {
   41693     int test_ret = 0;
   41694 
   41695 #if defined(LIBXML_UNICODE_ENABLED)
   41696     int mem_base;
   41697     int ret_val;
   41698     int code; /* UCS code point */
   41699     int n_code;
   41700 
   41701     for (n_code = 0;n_code < gen_nb_int;n_code++) {
   41702         mem_base = xmlMemBlocks();
   41703         code = gen_int(n_code, 0);
   41704 
   41705         ret_val = xmlUCSIsMiscellaneousSymbolsandArrows(code);
   41706         desret_int(ret_val);
   41707         call_tests++;
   41708         des_int(n_code, code, 0);
   41709         xmlResetLastError();
   41710         if (mem_base != xmlMemBlocks()) {
   41711             printf("Leak of %d blocks found in xmlUCSIsMiscellaneousSymbolsandArrows",
   41712 	           xmlMemBlocks() - mem_base);
   41713 	    test_ret++;
   41714             printf(" %d", n_code);
   41715             printf("\n");
   41716         }
   41717     }
   41718     function_tests++;
   41719 #endif
   41720 
   41721     return(test_ret);
   41722 }
   41723 
   41724 
   41725 static int
   41726 test_xmlUCSIsMiscellaneousTechnical(void) {
   41727     int test_ret = 0;
   41728 
   41729 #if defined(LIBXML_UNICODE_ENABLED)
   41730     int mem_base;
   41731     int ret_val;
   41732     int code; /* UCS code point */
   41733     int n_code;
   41734 
   41735     for (n_code = 0;n_code < gen_nb_int;n_code++) {
   41736         mem_base = xmlMemBlocks();
   41737         code = gen_int(n_code, 0);
   41738 
   41739         ret_val = xmlUCSIsMiscellaneousTechnical(code);
   41740         desret_int(ret_val);
   41741         call_tests++;
   41742         des_int(n_code, code, 0);
   41743         xmlResetLastError();
   41744         if (mem_base != xmlMemBlocks()) {
   41745             printf("Leak of %d blocks found in xmlUCSIsMiscellaneousTechnical",
   41746 	           xmlMemBlocks() - mem_base);
   41747 	    test_ret++;
   41748             printf(" %d", n_code);
   41749             printf("\n");
   41750         }
   41751     }
   41752     function_tests++;
   41753 #endif
   41754 
   41755     return(test_ret);
   41756 }
   41757 
   41758 
   41759 static int
   41760 test_xmlUCSIsMongolian(void) {
   41761     int test_ret = 0;
   41762 
   41763 #if defined(LIBXML_UNICODE_ENABLED)
   41764     int mem_base;
   41765     int ret_val;
   41766     int code; /* UCS code point */
   41767     int n_code;
   41768 
   41769     for (n_code = 0;n_code < gen_nb_int;n_code++) {
   41770         mem_base = xmlMemBlocks();
   41771         code = gen_int(n_code, 0);
   41772 
   41773         ret_val = xmlUCSIsMongolian(code);
   41774         desret_int(ret_val);
   41775         call_tests++;
   41776         des_int(n_code, code, 0);
   41777         xmlResetLastError();
   41778         if (mem_base != xmlMemBlocks()) {
   41779             printf("Leak of %d blocks found in xmlUCSIsMongolian",
   41780 	           xmlMemBlocks() - mem_base);
   41781 	    test_ret++;
   41782             printf(" %d", n_code);
   41783             printf("\n");
   41784         }
   41785     }
   41786     function_tests++;
   41787 #endif
   41788 
   41789     return(test_ret);
   41790 }
   41791 
   41792 
   41793 static int
   41794 test_xmlUCSIsMusicalSymbols(void) {
   41795     int test_ret = 0;
   41796 
   41797 #if defined(LIBXML_UNICODE_ENABLED)
   41798     int mem_base;
   41799     int ret_val;
   41800     int code; /* UCS code point */
   41801     int n_code;
   41802 
   41803     for (n_code = 0;n_code < gen_nb_int;n_code++) {
   41804         mem_base = xmlMemBlocks();
   41805         code = gen_int(n_code, 0);
   41806 
   41807         ret_val = xmlUCSIsMusicalSymbols(code);
   41808         desret_int(ret_val);
   41809         call_tests++;
   41810         des_int(n_code, code, 0);
   41811         xmlResetLastError();
   41812         if (mem_base != xmlMemBlocks()) {
   41813             printf("Leak of %d blocks found in xmlUCSIsMusicalSymbols",
   41814 	           xmlMemBlocks() - mem_base);
   41815 	    test_ret++;
   41816             printf(" %d", n_code);
   41817             printf("\n");
   41818         }
   41819     }
   41820     function_tests++;
   41821 #endif
   41822 
   41823     return(test_ret);
   41824 }
   41825 
   41826 
   41827 static int
   41828 test_xmlUCSIsMyanmar(void) {
   41829     int test_ret = 0;
   41830 
   41831 #if defined(LIBXML_UNICODE_ENABLED)
   41832     int mem_base;
   41833     int ret_val;
   41834     int code; /* UCS code point */
   41835     int n_code;
   41836 
   41837     for (n_code = 0;n_code < gen_nb_int;n_code++) {
   41838         mem_base = xmlMemBlocks();
   41839         code = gen_int(n_code, 0);
   41840 
   41841         ret_val = xmlUCSIsMyanmar(code);
   41842         desret_int(ret_val);
   41843         call_tests++;
   41844         des_int(n_code, code, 0);
   41845         xmlResetLastError();
   41846         if (mem_base != xmlMemBlocks()) {
   41847             printf("Leak of %d blocks found in xmlUCSIsMyanmar",
   41848 	           xmlMemBlocks() - mem_base);
   41849 	    test_ret++;
   41850             printf(" %d", n_code);
   41851             printf("\n");
   41852         }
   41853     }
   41854     function_tests++;
   41855 #endif
   41856 
   41857     return(test_ret);
   41858 }
   41859 
   41860 
   41861 static int
   41862 test_xmlUCSIsNumberForms(void) {
   41863     int test_ret = 0;
   41864 
   41865 #if defined(LIBXML_UNICODE_ENABLED)
   41866     int mem_base;
   41867     int ret_val;
   41868     int code; /* UCS code point */
   41869     int n_code;
   41870 
   41871     for (n_code = 0;n_code < gen_nb_int;n_code++) {
   41872         mem_base = xmlMemBlocks();
   41873         code = gen_int(n_code, 0);
   41874 
   41875         ret_val = xmlUCSIsNumberForms(code);
   41876         desret_int(ret_val);
   41877         call_tests++;
   41878         des_int(n_code, code, 0);
   41879         xmlResetLastError();
   41880         if (mem_base != xmlMemBlocks()) {
   41881             printf("Leak of %d blocks found in xmlUCSIsNumberForms",
   41882 	           xmlMemBlocks() - mem_base);
   41883 	    test_ret++;
   41884             printf(" %d", n_code);
   41885             printf("\n");
   41886         }
   41887     }
   41888     function_tests++;
   41889 #endif
   41890 
   41891     return(test_ret);
   41892 }
   41893 
   41894 
   41895 static int
   41896 test_xmlUCSIsOgham(void) {
   41897     int test_ret = 0;
   41898 
   41899 #if defined(LIBXML_UNICODE_ENABLED)
   41900     int mem_base;
   41901     int ret_val;
   41902     int code; /* UCS code point */
   41903     int n_code;
   41904 
   41905     for (n_code = 0;n_code < gen_nb_int;n_code++) {
   41906         mem_base = xmlMemBlocks();
   41907         code = gen_int(n_code, 0);
   41908 
   41909         ret_val = xmlUCSIsOgham(code);
   41910         desret_int(ret_val);
   41911         call_tests++;
   41912         des_int(n_code, code, 0);
   41913         xmlResetLastError();
   41914         if (mem_base != xmlMemBlocks()) {
   41915             printf("Leak of %d blocks found in xmlUCSIsOgham",
   41916 	           xmlMemBlocks() - mem_base);
   41917 	    test_ret++;
   41918             printf(" %d", n_code);
   41919             printf("\n");
   41920         }
   41921     }
   41922     function_tests++;
   41923 #endif
   41924 
   41925     return(test_ret);
   41926 }
   41927 
   41928 
   41929 static int
   41930 test_xmlUCSIsOldItalic(void) {
   41931     int test_ret = 0;
   41932 
   41933 #if defined(LIBXML_UNICODE_ENABLED)
   41934     int mem_base;
   41935     int ret_val;
   41936     int code; /* UCS code point */
   41937     int n_code;
   41938 
   41939     for (n_code = 0;n_code < gen_nb_int;n_code++) {
   41940         mem_base = xmlMemBlocks();
   41941         code = gen_int(n_code, 0);
   41942 
   41943         ret_val = xmlUCSIsOldItalic(code);
   41944         desret_int(ret_val);
   41945         call_tests++;
   41946         des_int(n_code, code, 0);
   41947         xmlResetLastError();
   41948         if (mem_base != xmlMemBlocks()) {
   41949             printf("Leak of %d blocks found in xmlUCSIsOldItalic",
   41950 	           xmlMemBlocks() - mem_base);
   41951 	    test_ret++;
   41952             printf(" %d", n_code);
   41953             printf("\n");
   41954         }
   41955     }
   41956     function_tests++;
   41957 #endif
   41958 
   41959     return(test_ret);
   41960 }
   41961 
   41962 
   41963 static int
   41964 test_xmlUCSIsOpticalCharacterRecognition(void) {
   41965     int test_ret = 0;
   41966 
   41967 #if defined(LIBXML_UNICODE_ENABLED)
   41968     int mem_base;
   41969     int ret_val;
   41970     int code; /* UCS code point */
   41971     int n_code;
   41972 
   41973     for (n_code = 0;n_code < gen_nb_int;n_code++) {
   41974         mem_base = xmlMemBlocks();
   41975         code = gen_int(n_code, 0);
   41976 
   41977         ret_val = xmlUCSIsOpticalCharacterRecognition(code);
   41978         desret_int(ret_val);
   41979         call_tests++;
   41980         des_int(n_code, code, 0);
   41981         xmlResetLastError();
   41982         if (mem_base != xmlMemBlocks()) {
   41983             printf("Leak of %d blocks found in xmlUCSIsOpticalCharacterRecognition",
   41984 	           xmlMemBlocks() - mem_base);
   41985 	    test_ret++;
   41986             printf(" %d", n_code);
   41987             printf("\n");
   41988         }
   41989     }
   41990     function_tests++;
   41991 #endif
   41992 
   41993     return(test_ret);
   41994 }
   41995 
   41996 
   41997 static int
   41998 test_xmlUCSIsOriya(void) {
   41999     int test_ret = 0;
   42000 
   42001 #if defined(LIBXML_UNICODE_ENABLED)
   42002     int mem_base;
   42003     int ret_val;
   42004     int code; /* UCS code point */
   42005     int n_code;
   42006 
   42007     for (n_code = 0;n_code < gen_nb_int;n_code++) {
   42008         mem_base = xmlMemBlocks();
   42009         code = gen_int(n_code, 0);
   42010 
   42011         ret_val = xmlUCSIsOriya(code);
   42012         desret_int(ret_val);
   42013         call_tests++;
   42014         des_int(n_code, code, 0);
   42015         xmlResetLastError();
   42016         if (mem_base != xmlMemBlocks()) {
   42017             printf("Leak of %d blocks found in xmlUCSIsOriya",
   42018 	           xmlMemBlocks() - mem_base);
   42019 	    test_ret++;
   42020             printf(" %d", n_code);
   42021             printf("\n");
   42022         }
   42023     }
   42024     function_tests++;
   42025 #endif
   42026 
   42027     return(test_ret);
   42028 }
   42029 
   42030 
   42031 static int
   42032 test_xmlUCSIsOsmanya(void) {
   42033     int test_ret = 0;
   42034 
   42035 #if defined(LIBXML_UNICODE_ENABLED)
   42036     int mem_base;
   42037     int ret_val;
   42038     int code; /* UCS code point */
   42039     int n_code;
   42040 
   42041     for (n_code = 0;n_code < gen_nb_int;n_code++) {
   42042         mem_base = xmlMemBlocks();
   42043         code = gen_int(n_code, 0);
   42044 
   42045         ret_val = xmlUCSIsOsmanya(code);
   42046         desret_int(ret_val);
   42047         call_tests++;
   42048         des_int(n_code, code, 0);
   42049         xmlResetLastError();
   42050         if (mem_base != xmlMemBlocks()) {
   42051             printf("Leak of %d blocks found in xmlUCSIsOsmanya",
   42052 	           xmlMemBlocks() - mem_base);
   42053 	    test_ret++;
   42054             printf(" %d", n_code);
   42055             printf("\n");
   42056         }
   42057     }
   42058     function_tests++;
   42059 #endif
   42060 
   42061     return(test_ret);
   42062 }
   42063 
   42064 
   42065 static int
   42066 test_xmlUCSIsPhoneticExtensions(void) {
   42067     int test_ret = 0;
   42068 
   42069 #if defined(LIBXML_UNICODE_ENABLED)
   42070     int mem_base;
   42071     int ret_val;
   42072     int code; /* UCS code point */
   42073     int n_code;
   42074 
   42075     for (n_code = 0;n_code < gen_nb_int;n_code++) {
   42076         mem_base = xmlMemBlocks();
   42077         code = gen_int(n_code, 0);
   42078 
   42079         ret_val = xmlUCSIsPhoneticExtensions(code);
   42080         desret_int(ret_val);
   42081         call_tests++;
   42082         des_int(n_code, code, 0);
   42083         xmlResetLastError();
   42084         if (mem_base != xmlMemBlocks()) {
   42085             printf("Leak of %d blocks found in xmlUCSIsPhoneticExtensions",
   42086 	           xmlMemBlocks() - mem_base);
   42087 	    test_ret++;
   42088             printf(" %d", n_code);
   42089             printf("\n");
   42090         }
   42091     }
   42092     function_tests++;
   42093 #endif
   42094 
   42095     return(test_ret);
   42096 }
   42097 
   42098 
   42099 static int
   42100 test_xmlUCSIsPrivateUse(void) {
   42101     int test_ret = 0;
   42102 
   42103 #if defined(LIBXML_UNICODE_ENABLED)
   42104     int mem_base;
   42105     int ret_val;
   42106     int code; /* UCS code point */
   42107     int n_code;
   42108 
   42109     for (n_code = 0;n_code < gen_nb_int;n_code++) {
   42110         mem_base = xmlMemBlocks();
   42111         code = gen_int(n_code, 0);
   42112 
   42113         ret_val = xmlUCSIsPrivateUse(code);
   42114         desret_int(ret_val);
   42115         call_tests++;
   42116         des_int(n_code, code, 0);
   42117         xmlResetLastError();
   42118         if (mem_base != xmlMemBlocks()) {
   42119             printf("Leak of %d blocks found in xmlUCSIsPrivateUse",
   42120 	           xmlMemBlocks() - mem_base);
   42121 	    test_ret++;
   42122             printf(" %d", n_code);
   42123             printf("\n");
   42124         }
   42125     }
   42126     function_tests++;
   42127 #endif
   42128 
   42129     return(test_ret);
   42130 }
   42131 
   42132 
   42133 static int
   42134 test_xmlUCSIsPrivateUseArea(void) {
   42135     int test_ret = 0;
   42136 
   42137 #if defined(LIBXML_UNICODE_ENABLED)
   42138     int mem_base;
   42139     int ret_val;
   42140     int code; /* UCS code point */
   42141     int n_code;
   42142 
   42143     for (n_code = 0;n_code < gen_nb_int;n_code++) {
   42144         mem_base = xmlMemBlocks();
   42145         code = gen_int(n_code, 0);
   42146 
   42147         ret_val = xmlUCSIsPrivateUseArea(code);
   42148         desret_int(ret_val);
   42149         call_tests++;
   42150         des_int(n_code, code, 0);
   42151         xmlResetLastError();
   42152         if (mem_base != xmlMemBlocks()) {
   42153             printf("Leak of %d blocks found in xmlUCSIsPrivateUseArea",
   42154 	           xmlMemBlocks() - mem_base);
   42155 	    test_ret++;
   42156             printf(" %d", n_code);
   42157             printf("\n");
   42158         }
   42159     }
   42160     function_tests++;
   42161 #endif
   42162 
   42163     return(test_ret);
   42164 }
   42165 
   42166 
   42167 static int
   42168 test_xmlUCSIsRunic(void) {
   42169     int test_ret = 0;
   42170 
   42171 #if defined(LIBXML_UNICODE_ENABLED)
   42172     int mem_base;
   42173     int ret_val;
   42174     int code; /* UCS code point */
   42175     int n_code;
   42176 
   42177     for (n_code = 0;n_code < gen_nb_int;n_code++) {
   42178         mem_base = xmlMemBlocks();
   42179         code = gen_int(n_code, 0);
   42180 
   42181         ret_val = xmlUCSIsRunic(code);
   42182         desret_int(ret_val);
   42183         call_tests++;
   42184         des_int(n_code, code, 0);
   42185         xmlResetLastError();
   42186         if (mem_base != xmlMemBlocks()) {
   42187             printf("Leak of %d blocks found in xmlUCSIsRunic",
   42188 	           xmlMemBlocks() - mem_base);
   42189 	    test_ret++;
   42190             printf(" %d", n_code);
   42191             printf("\n");
   42192         }
   42193     }
   42194     function_tests++;
   42195 #endif
   42196 
   42197     return(test_ret);
   42198 }
   42199 
   42200 
   42201 static int
   42202 test_xmlUCSIsShavian(void) {
   42203     int test_ret = 0;
   42204 
   42205 #if defined(LIBXML_UNICODE_ENABLED)
   42206     int mem_base;
   42207     int ret_val;
   42208     int code; /* UCS code point */
   42209     int n_code;
   42210 
   42211     for (n_code = 0;n_code < gen_nb_int;n_code++) {
   42212         mem_base = xmlMemBlocks();
   42213         code = gen_int(n_code, 0);
   42214 
   42215         ret_val = xmlUCSIsShavian(code);
   42216         desret_int(ret_val);
   42217         call_tests++;
   42218         des_int(n_code, code, 0);
   42219         xmlResetLastError();
   42220         if (mem_base != xmlMemBlocks()) {
   42221             printf("Leak of %d blocks found in xmlUCSIsShavian",
   42222 	           xmlMemBlocks() - mem_base);
   42223 	    test_ret++;
   42224             printf(" %d", n_code);
   42225             printf("\n");
   42226         }
   42227     }
   42228     function_tests++;
   42229 #endif
   42230 
   42231     return(test_ret);
   42232 }
   42233 
   42234 
   42235 static int
   42236 test_xmlUCSIsSinhala(void) {
   42237     int test_ret = 0;
   42238 
   42239 #if defined(LIBXML_UNICODE_ENABLED)
   42240     int mem_base;
   42241     int ret_val;
   42242     int code; /* UCS code point */
   42243     int n_code;
   42244 
   42245     for (n_code = 0;n_code < gen_nb_int;n_code++) {
   42246         mem_base = xmlMemBlocks();
   42247         code = gen_int(n_code, 0);
   42248 
   42249         ret_val = xmlUCSIsSinhala(code);
   42250         desret_int(ret_val);
   42251         call_tests++;
   42252         des_int(n_code, code, 0);
   42253         xmlResetLastError();
   42254         if (mem_base != xmlMemBlocks()) {
   42255             printf("Leak of %d blocks found in xmlUCSIsSinhala",
   42256 	           xmlMemBlocks() - mem_base);
   42257 	    test_ret++;
   42258             printf(" %d", n_code);
   42259             printf("\n");
   42260         }
   42261     }
   42262     function_tests++;
   42263 #endif
   42264 
   42265     return(test_ret);
   42266 }
   42267 
   42268 
   42269 static int
   42270 test_xmlUCSIsSmallFormVariants(void) {
   42271     int test_ret = 0;
   42272 
   42273 #if defined(LIBXML_UNICODE_ENABLED)
   42274     int mem_base;
   42275     int ret_val;
   42276     int code; /* UCS code point */
   42277     int n_code;
   42278 
   42279     for (n_code = 0;n_code < gen_nb_int;n_code++) {
   42280         mem_base = xmlMemBlocks();
   42281         code = gen_int(n_code, 0);
   42282 
   42283         ret_val = xmlUCSIsSmallFormVariants(code);
   42284         desret_int(ret_val);
   42285         call_tests++;
   42286         des_int(n_code, code, 0);
   42287         xmlResetLastError();
   42288         if (mem_base != xmlMemBlocks()) {
   42289             printf("Leak of %d blocks found in xmlUCSIsSmallFormVariants",
   42290 	           xmlMemBlocks() - mem_base);
   42291 	    test_ret++;
   42292             printf(" %d", n_code);
   42293             printf("\n");
   42294         }
   42295     }
   42296     function_tests++;
   42297 #endif
   42298 
   42299     return(test_ret);
   42300 }
   42301 
   42302 
   42303 static int
   42304 test_xmlUCSIsSpacingModifierLetters(void) {
   42305     int test_ret = 0;
   42306 
   42307 #if defined(LIBXML_UNICODE_ENABLED)
   42308     int mem_base;
   42309     int ret_val;
   42310     int code; /* UCS code point */
   42311     int n_code;
   42312 
   42313     for (n_code = 0;n_code < gen_nb_int;n_code++) {
   42314         mem_base = xmlMemBlocks();
   42315         code = gen_int(n_code, 0);
   42316 
   42317         ret_val = xmlUCSIsSpacingModifierLetters(code);
   42318         desret_int(ret_val);
   42319         call_tests++;
   42320         des_int(n_code, code, 0);
   42321         xmlResetLastError();
   42322         if (mem_base != xmlMemBlocks()) {
   42323             printf("Leak of %d blocks found in xmlUCSIsSpacingModifierLetters",
   42324 	           xmlMemBlocks() - mem_base);
   42325 	    test_ret++;
   42326             printf(" %d", n_code);
   42327             printf("\n");
   42328         }
   42329     }
   42330     function_tests++;
   42331 #endif
   42332 
   42333     return(test_ret);
   42334 }
   42335 
   42336 
   42337 static int
   42338 test_xmlUCSIsSpecials(void) {
   42339     int test_ret = 0;
   42340 
   42341 #if defined(LIBXML_UNICODE_ENABLED)
   42342     int mem_base;
   42343     int ret_val;
   42344     int code; /* UCS code point */
   42345     int n_code;
   42346 
   42347     for (n_code = 0;n_code < gen_nb_int;n_code++) {
   42348         mem_base = xmlMemBlocks();
   42349         code = gen_int(n_code, 0);
   42350 
   42351         ret_val = xmlUCSIsSpecials(code);
   42352         desret_int(ret_val);
   42353         call_tests++;
   42354         des_int(n_code, code, 0);
   42355         xmlResetLastError();
   42356         if (mem_base != xmlMemBlocks()) {
   42357             printf("Leak of %d blocks found in xmlUCSIsSpecials",
   42358 	           xmlMemBlocks() - mem_base);
   42359 	    test_ret++;
   42360             printf(" %d", n_code);
   42361             printf("\n");
   42362         }
   42363     }
   42364     function_tests++;
   42365 #endif
   42366 
   42367     return(test_ret);
   42368 }
   42369 
   42370 
   42371 static int
   42372 test_xmlUCSIsSuperscriptsandSubscripts(void) {
   42373     int test_ret = 0;
   42374 
   42375 #if defined(LIBXML_UNICODE_ENABLED)
   42376     int mem_base;
   42377     int ret_val;
   42378     int code; /* UCS code point */
   42379     int n_code;
   42380 
   42381     for (n_code = 0;n_code < gen_nb_int;n_code++) {
   42382         mem_base = xmlMemBlocks();
   42383         code = gen_int(n_code, 0);
   42384 
   42385         ret_val = xmlUCSIsSuperscriptsandSubscripts(code);
   42386         desret_int(ret_val);
   42387         call_tests++;
   42388         des_int(n_code, code, 0);
   42389         xmlResetLastError();
   42390         if (mem_base != xmlMemBlocks()) {
   42391             printf("Leak of %d blocks found in xmlUCSIsSuperscriptsandSubscripts",
   42392 	           xmlMemBlocks() - mem_base);
   42393 	    test_ret++;
   42394             printf(" %d", n_code);
   42395             printf("\n");
   42396         }
   42397     }
   42398     function_tests++;
   42399 #endif
   42400 
   42401     return(test_ret);
   42402 }
   42403 
   42404 
   42405 static int
   42406 test_xmlUCSIsSupplementalArrowsA(void) {
   42407     int test_ret = 0;
   42408 
   42409 #if defined(LIBXML_UNICODE_ENABLED)
   42410     int mem_base;
   42411     int ret_val;
   42412     int code; /* UCS code point */
   42413     int n_code;
   42414 
   42415     for (n_code = 0;n_code < gen_nb_int;n_code++) {
   42416         mem_base = xmlMemBlocks();
   42417         code = gen_int(n_code, 0);
   42418 
   42419         ret_val = xmlUCSIsSupplementalArrowsA(code);
   42420         desret_int(ret_val);
   42421         call_tests++;
   42422         des_int(n_code, code, 0);
   42423         xmlResetLastError();
   42424         if (mem_base != xmlMemBlocks()) {
   42425             printf("Leak of %d blocks found in xmlUCSIsSupplementalArrowsA",
   42426 	           xmlMemBlocks() - mem_base);
   42427 	    test_ret++;
   42428             printf(" %d", n_code);
   42429             printf("\n");
   42430         }
   42431     }
   42432     function_tests++;
   42433 #endif
   42434 
   42435     return(test_ret);
   42436 }
   42437 
   42438 
   42439 static int
   42440 test_xmlUCSIsSupplementalArrowsB(void) {
   42441     int test_ret = 0;
   42442 
   42443 #if defined(LIBXML_UNICODE_ENABLED)
   42444     int mem_base;
   42445     int ret_val;
   42446     int code; /* UCS code point */
   42447     int n_code;
   42448 
   42449     for (n_code = 0;n_code < gen_nb_int;n_code++) {
   42450         mem_base = xmlMemBlocks();
   42451         code = gen_int(n_code, 0);
   42452 
   42453         ret_val = xmlUCSIsSupplementalArrowsB(code);
   42454         desret_int(ret_val);
   42455         call_tests++;
   42456         des_int(n_code, code, 0);
   42457         xmlResetLastError();
   42458         if (mem_base != xmlMemBlocks()) {
   42459             printf("Leak of %d blocks found in xmlUCSIsSupplementalArrowsB",
   42460 	           xmlMemBlocks() - mem_base);
   42461 	    test_ret++;
   42462             printf(" %d", n_code);
   42463             printf("\n");
   42464         }
   42465     }
   42466     function_tests++;
   42467 #endif
   42468 
   42469     return(test_ret);
   42470 }
   42471 
   42472 
   42473 static int
   42474 test_xmlUCSIsSupplementalMathematicalOperators(void) {
   42475     int test_ret = 0;
   42476 
   42477 #if defined(LIBXML_UNICODE_ENABLED)
   42478     int mem_base;
   42479     int ret_val;
   42480     int code; /* UCS code point */
   42481     int n_code;
   42482 
   42483     for (n_code = 0;n_code < gen_nb_int;n_code++) {
   42484         mem_base = xmlMemBlocks();
   42485         code = gen_int(n_code, 0);
   42486 
   42487         ret_val = xmlUCSIsSupplementalMathematicalOperators(code);
   42488         desret_int(ret_val);
   42489         call_tests++;
   42490         des_int(n_code, code, 0);
   42491         xmlResetLastError();
   42492         if (mem_base != xmlMemBlocks()) {
   42493             printf("Leak of %d blocks found in xmlUCSIsSupplementalMathematicalOperators",
   42494 	           xmlMemBlocks() - mem_base);
   42495 	    test_ret++;
   42496             printf(" %d", n_code);
   42497             printf("\n");
   42498         }
   42499     }
   42500     function_tests++;
   42501 #endif
   42502 
   42503     return(test_ret);
   42504 }
   42505 
   42506 
   42507 static int
   42508 test_xmlUCSIsSupplementaryPrivateUseAreaA(void) {
   42509     int test_ret = 0;
   42510 
   42511 #if defined(LIBXML_UNICODE_ENABLED)
   42512     int mem_base;
   42513     int ret_val;
   42514     int code; /* UCS code point */
   42515     int n_code;
   42516 
   42517     for (n_code = 0;n_code < gen_nb_int;n_code++) {
   42518         mem_base = xmlMemBlocks();
   42519         code = gen_int(n_code, 0);
   42520 
   42521         ret_val = xmlUCSIsSupplementaryPrivateUseAreaA(code);
   42522         desret_int(ret_val);
   42523         call_tests++;
   42524         des_int(n_code, code, 0);
   42525         xmlResetLastError();
   42526         if (mem_base != xmlMemBlocks()) {
   42527             printf("Leak of %d blocks found in xmlUCSIsSupplementaryPrivateUseAreaA",
   42528 	           xmlMemBlocks() - mem_base);
   42529 	    test_ret++;
   42530             printf(" %d", n_code);
   42531             printf("\n");
   42532         }
   42533     }
   42534     function_tests++;
   42535 #endif
   42536 
   42537     return(test_ret);
   42538 }
   42539 
   42540 
   42541 static int
   42542 test_xmlUCSIsSupplementaryPrivateUseAreaB(void) {
   42543     int test_ret = 0;
   42544 
   42545 #if defined(LIBXML_UNICODE_ENABLED)
   42546     int mem_base;
   42547     int ret_val;
   42548     int code; /* UCS code point */
   42549     int n_code;
   42550 
   42551     for (n_code = 0;n_code < gen_nb_int;n_code++) {
   42552         mem_base = xmlMemBlocks();
   42553         code = gen_int(n_code, 0);
   42554 
   42555         ret_val = xmlUCSIsSupplementaryPrivateUseAreaB(code);
   42556         desret_int(ret_val);
   42557         call_tests++;
   42558         des_int(n_code, code, 0);
   42559         xmlResetLastError();
   42560         if (mem_base != xmlMemBlocks()) {
   42561             printf("Leak of %d blocks found in xmlUCSIsSupplementaryPrivateUseAreaB",
   42562 	           xmlMemBlocks() - mem_base);
   42563 	    test_ret++;
   42564             printf(" %d", n_code);
   42565             printf("\n");
   42566         }
   42567     }
   42568     function_tests++;
   42569 #endif
   42570 
   42571     return(test_ret);
   42572 }
   42573 
   42574 
   42575 static int
   42576 test_xmlUCSIsSyriac(void) {
   42577     int test_ret = 0;
   42578 
   42579 #if defined(LIBXML_UNICODE_ENABLED)
   42580     int mem_base;
   42581     int ret_val;
   42582     int code; /* UCS code point */
   42583     int n_code;
   42584 
   42585     for (n_code = 0;n_code < gen_nb_int;n_code++) {
   42586         mem_base = xmlMemBlocks();
   42587         code = gen_int(n_code, 0);
   42588 
   42589         ret_val = xmlUCSIsSyriac(code);
   42590         desret_int(ret_val);
   42591         call_tests++;
   42592         des_int(n_code, code, 0);
   42593         xmlResetLastError();
   42594         if (mem_base != xmlMemBlocks()) {
   42595             printf("Leak of %d blocks found in xmlUCSIsSyriac",
   42596 	           xmlMemBlocks() - mem_base);
   42597 	    test_ret++;
   42598             printf(" %d", n_code);
   42599             printf("\n");
   42600         }
   42601     }
   42602     function_tests++;
   42603 #endif
   42604 
   42605     return(test_ret);
   42606 }
   42607 
   42608 
   42609 static int
   42610 test_xmlUCSIsTagalog(void) {
   42611     int test_ret = 0;
   42612 
   42613 #if defined(LIBXML_UNICODE_ENABLED)
   42614     int mem_base;
   42615     int ret_val;
   42616     int code; /* UCS code point */
   42617     int n_code;
   42618 
   42619     for (n_code = 0;n_code < gen_nb_int;n_code++) {
   42620         mem_base = xmlMemBlocks();
   42621         code = gen_int(n_code, 0);
   42622 
   42623         ret_val = xmlUCSIsTagalog(code);
   42624         desret_int(ret_val);
   42625         call_tests++;
   42626         des_int(n_code, code, 0);
   42627         xmlResetLastError();
   42628         if (mem_base != xmlMemBlocks()) {
   42629             printf("Leak of %d blocks found in xmlUCSIsTagalog",
   42630 	           xmlMemBlocks() - mem_base);
   42631 	    test_ret++;
   42632             printf(" %d", n_code);
   42633             printf("\n");
   42634         }
   42635     }
   42636     function_tests++;
   42637 #endif
   42638 
   42639     return(test_ret);
   42640 }
   42641 
   42642 
   42643 static int
   42644 test_xmlUCSIsTagbanwa(void) {
   42645     int test_ret = 0;
   42646 
   42647 #if defined(LIBXML_UNICODE_ENABLED)
   42648     int mem_base;
   42649     int ret_val;
   42650     int code; /* UCS code point */
   42651     int n_code;
   42652 
   42653     for (n_code = 0;n_code < gen_nb_int;n_code++) {
   42654         mem_base = xmlMemBlocks();
   42655         code = gen_int(n_code, 0);
   42656 
   42657         ret_val = xmlUCSIsTagbanwa(code);
   42658         desret_int(ret_val);
   42659         call_tests++;
   42660         des_int(n_code, code, 0);
   42661         xmlResetLastError();
   42662         if (mem_base != xmlMemBlocks()) {
   42663             printf("Leak of %d blocks found in xmlUCSIsTagbanwa",
   42664 	           xmlMemBlocks() - mem_base);
   42665 	    test_ret++;
   42666             printf(" %d", n_code);
   42667             printf("\n");
   42668         }
   42669     }
   42670     function_tests++;
   42671 #endif
   42672 
   42673     return(test_ret);
   42674 }
   42675 
   42676 
   42677 static int
   42678 test_xmlUCSIsTags(void) {
   42679     int test_ret = 0;
   42680 
   42681 #if defined(LIBXML_UNICODE_ENABLED)
   42682     int mem_base;
   42683     int ret_val;
   42684     int code; /* UCS code point */
   42685     int n_code;
   42686 
   42687     for (n_code = 0;n_code < gen_nb_int;n_code++) {
   42688         mem_base = xmlMemBlocks();
   42689         code = gen_int(n_code, 0);
   42690 
   42691         ret_val = xmlUCSIsTags(code);
   42692         desret_int(ret_val);
   42693         call_tests++;
   42694         des_int(n_code, code, 0);
   42695         xmlResetLastError();
   42696         if (mem_base != xmlMemBlocks()) {
   42697             printf("Leak of %d blocks found in xmlUCSIsTags",
   42698 	           xmlMemBlocks() - mem_base);
   42699 	    test_ret++;
   42700             printf(" %d", n_code);
   42701             printf("\n");
   42702         }
   42703     }
   42704     function_tests++;
   42705 #endif
   42706 
   42707     return(test_ret);
   42708 }
   42709 
   42710 
   42711 static int
   42712 test_xmlUCSIsTaiLe(void) {
   42713     int test_ret = 0;
   42714 
   42715 #if defined(LIBXML_UNICODE_ENABLED)
   42716     int mem_base;
   42717     int ret_val;
   42718     int code; /* UCS code point */
   42719     int n_code;
   42720 
   42721     for (n_code = 0;n_code < gen_nb_int;n_code++) {
   42722         mem_base = xmlMemBlocks();
   42723         code = gen_int(n_code, 0);
   42724 
   42725         ret_val = xmlUCSIsTaiLe(code);
   42726         desret_int(ret_val);
   42727         call_tests++;
   42728         des_int(n_code, code, 0);
   42729         xmlResetLastError();
   42730         if (mem_base != xmlMemBlocks()) {
   42731             printf("Leak of %d blocks found in xmlUCSIsTaiLe",
   42732 	           xmlMemBlocks() - mem_base);
   42733 	    test_ret++;
   42734             printf(" %d", n_code);
   42735             printf("\n");
   42736         }
   42737     }
   42738     function_tests++;
   42739 #endif
   42740 
   42741     return(test_ret);
   42742 }
   42743 
   42744 
   42745 static int
   42746 test_xmlUCSIsTaiXuanJingSymbols(void) {
   42747     int test_ret = 0;
   42748 
   42749 #if defined(LIBXML_UNICODE_ENABLED)
   42750     int mem_base;
   42751     int ret_val;
   42752     int code; /* UCS code point */
   42753     int n_code;
   42754 
   42755     for (n_code = 0;n_code < gen_nb_int;n_code++) {
   42756         mem_base = xmlMemBlocks();
   42757         code = gen_int(n_code, 0);
   42758 
   42759         ret_val = xmlUCSIsTaiXuanJingSymbols(code);
   42760         desret_int(ret_val);
   42761         call_tests++;
   42762         des_int(n_code, code, 0);
   42763         xmlResetLastError();
   42764         if (mem_base != xmlMemBlocks()) {
   42765             printf("Leak of %d blocks found in xmlUCSIsTaiXuanJingSymbols",
   42766 	           xmlMemBlocks() - mem_base);
   42767 	    test_ret++;
   42768             printf(" %d", n_code);
   42769             printf("\n");
   42770         }
   42771     }
   42772     function_tests++;
   42773 #endif
   42774 
   42775     return(test_ret);
   42776 }
   42777 
   42778 
   42779 static int
   42780 test_xmlUCSIsTamil(void) {
   42781     int test_ret = 0;
   42782 
   42783 #if defined(LIBXML_UNICODE_ENABLED)
   42784     int mem_base;
   42785     int ret_val;
   42786     int code; /* UCS code point */
   42787     int n_code;
   42788 
   42789     for (n_code = 0;n_code < gen_nb_int;n_code++) {
   42790         mem_base = xmlMemBlocks();
   42791         code = gen_int(n_code, 0);
   42792 
   42793         ret_val = xmlUCSIsTamil(code);
   42794         desret_int(ret_val);
   42795         call_tests++;
   42796         des_int(n_code, code, 0);
   42797         xmlResetLastError();
   42798         if (mem_base != xmlMemBlocks()) {
   42799             printf("Leak of %d blocks found in xmlUCSIsTamil",
   42800 	           xmlMemBlocks() - mem_base);
   42801 	    test_ret++;
   42802             printf(" %d", n_code);
   42803             printf("\n");
   42804         }
   42805     }
   42806     function_tests++;
   42807 #endif
   42808 
   42809     return(test_ret);
   42810 }
   42811 
   42812 
   42813 static int
   42814 test_xmlUCSIsTelugu(void) {
   42815     int test_ret = 0;
   42816 
   42817 #if defined(LIBXML_UNICODE_ENABLED)
   42818     int mem_base;
   42819     int ret_val;
   42820     int code; /* UCS code point */
   42821     int n_code;
   42822 
   42823     for (n_code = 0;n_code < gen_nb_int;n_code++) {
   42824         mem_base = xmlMemBlocks();
   42825         code = gen_int(n_code, 0);
   42826 
   42827         ret_val = xmlUCSIsTelugu(code);
   42828         desret_int(ret_val);
   42829         call_tests++;
   42830         des_int(n_code, code, 0);
   42831         xmlResetLastError();
   42832         if (mem_base != xmlMemBlocks()) {
   42833             printf("Leak of %d blocks found in xmlUCSIsTelugu",
   42834 	           xmlMemBlocks() - mem_base);
   42835 	    test_ret++;
   42836             printf(" %d", n_code);
   42837             printf("\n");
   42838         }
   42839     }
   42840     function_tests++;
   42841 #endif
   42842 
   42843     return(test_ret);
   42844 }
   42845 
   42846 
   42847 static int
   42848 test_xmlUCSIsThaana(void) {
   42849     int test_ret = 0;
   42850 
   42851 #if defined(LIBXML_UNICODE_ENABLED)
   42852     int mem_base;
   42853     int ret_val;
   42854     int code; /* UCS code point */
   42855     int n_code;
   42856 
   42857     for (n_code = 0;n_code < gen_nb_int;n_code++) {
   42858         mem_base = xmlMemBlocks();
   42859         code = gen_int(n_code, 0);
   42860 
   42861         ret_val = xmlUCSIsThaana(code);
   42862         desret_int(ret_val);
   42863         call_tests++;
   42864         des_int(n_code, code, 0);
   42865         xmlResetLastError();
   42866         if (mem_base != xmlMemBlocks()) {
   42867             printf("Leak of %d blocks found in xmlUCSIsThaana",
   42868 	           xmlMemBlocks() - mem_base);
   42869 	    test_ret++;
   42870             printf(" %d", n_code);
   42871             printf("\n");
   42872         }
   42873     }
   42874     function_tests++;
   42875 #endif
   42876 
   42877     return(test_ret);
   42878 }
   42879 
   42880 
   42881 static int
   42882 test_xmlUCSIsThai(void) {
   42883     int test_ret = 0;
   42884 
   42885 #if defined(LIBXML_UNICODE_ENABLED)
   42886     int mem_base;
   42887     int ret_val;
   42888     int code; /* UCS code point */
   42889     int n_code;
   42890 
   42891     for (n_code = 0;n_code < gen_nb_int;n_code++) {
   42892         mem_base = xmlMemBlocks();
   42893         code = gen_int(n_code, 0);
   42894 
   42895         ret_val = xmlUCSIsThai(code);
   42896         desret_int(ret_val);
   42897         call_tests++;
   42898         des_int(n_code, code, 0);
   42899         xmlResetLastError();
   42900         if (mem_base != xmlMemBlocks()) {
   42901             printf("Leak of %d blocks found in xmlUCSIsThai",
   42902 	           xmlMemBlocks() - mem_base);
   42903 	    test_ret++;
   42904             printf(" %d", n_code);
   42905             printf("\n");
   42906         }
   42907     }
   42908     function_tests++;
   42909 #endif
   42910 
   42911     return(test_ret);
   42912 }
   42913 
   42914 
   42915 static int
   42916 test_xmlUCSIsTibetan(void) {
   42917     int test_ret = 0;
   42918 
   42919 #if defined(LIBXML_UNICODE_ENABLED)
   42920     int mem_base;
   42921     int ret_val;
   42922     int code; /* UCS code point */
   42923     int n_code;
   42924 
   42925     for (n_code = 0;n_code < gen_nb_int;n_code++) {
   42926         mem_base = xmlMemBlocks();
   42927         code = gen_int(n_code, 0);
   42928 
   42929         ret_val = xmlUCSIsTibetan(code);
   42930         desret_int(ret_val);
   42931         call_tests++;
   42932         des_int(n_code, code, 0);
   42933         xmlResetLastError();
   42934         if (mem_base != xmlMemBlocks()) {
   42935             printf("Leak of %d blocks found in xmlUCSIsTibetan",
   42936 	           xmlMemBlocks() - mem_base);
   42937 	    test_ret++;
   42938             printf(" %d", n_code);
   42939             printf("\n");
   42940         }
   42941     }
   42942     function_tests++;
   42943 #endif
   42944 
   42945     return(test_ret);
   42946 }
   42947 
   42948 
   42949 static int
   42950 test_xmlUCSIsUgaritic(void) {
   42951     int test_ret = 0;
   42952 
   42953 #if defined(LIBXML_UNICODE_ENABLED)
   42954     int mem_base;
   42955     int ret_val;
   42956     int code; /* UCS code point */
   42957     int n_code;
   42958 
   42959     for (n_code = 0;n_code < gen_nb_int;n_code++) {
   42960         mem_base = xmlMemBlocks();
   42961         code = gen_int(n_code, 0);
   42962 
   42963         ret_val = xmlUCSIsUgaritic(code);
   42964         desret_int(ret_val);
   42965         call_tests++;
   42966         des_int(n_code, code, 0);
   42967         xmlResetLastError();
   42968         if (mem_base != xmlMemBlocks()) {
   42969             printf("Leak of %d blocks found in xmlUCSIsUgaritic",
   42970 	           xmlMemBlocks() - mem_base);
   42971 	    test_ret++;
   42972             printf(" %d", n_code);
   42973             printf("\n");
   42974         }
   42975     }
   42976     function_tests++;
   42977 #endif
   42978 
   42979     return(test_ret);
   42980 }
   42981 
   42982 
   42983 static int
   42984 test_xmlUCSIsUnifiedCanadianAboriginalSyllabics(void) {
   42985     int test_ret = 0;
   42986 
   42987 #if defined(LIBXML_UNICODE_ENABLED)
   42988     int mem_base;
   42989     int ret_val;
   42990     int code; /* UCS code point */
   42991     int n_code;
   42992 
   42993     for (n_code = 0;n_code < gen_nb_int;n_code++) {
   42994         mem_base = xmlMemBlocks();
   42995         code = gen_int(n_code, 0);
   42996 
   42997         ret_val = xmlUCSIsUnifiedCanadianAboriginalSyllabics(code);
   42998         desret_int(ret_val);
   42999         call_tests++;
   43000         des_int(n_code, code, 0);
   43001         xmlResetLastError();
   43002         if (mem_base != xmlMemBlocks()) {
   43003             printf("Leak of %d blocks found in xmlUCSIsUnifiedCanadianAboriginalSyllabics",
   43004 	           xmlMemBlocks() - mem_base);
   43005 	    test_ret++;
   43006             printf(" %d", n_code);
   43007             printf("\n");
   43008         }
   43009     }
   43010     function_tests++;
   43011 #endif
   43012 
   43013     return(test_ret);
   43014 }
   43015 
   43016 
   43017 static int
   43018 test_xmlUCSIsVariationSelectors(void) {
   43019     int test_ret = 0;
   43020 
   43021 #if defined(LIBXML_UNICODE_ENABLED)
   43022     int mem_base;
   43023     int ret_val;
   43024     int code; /* UCS code point */
   43025     int n_code;
   43026 
   43027     for (n_code = 0;n_code < gen_nb_int;n_code++) {
   43028         mem_base = xmlMemBlocks();
   43029         code = gen_int(n_code, 0);
   43030 
   43031         ret_val = xmlUCSIsVariationSelectors(code);
   43032         desret_int(ret_val);
   43033         call_tests++;
   43034         des_int(n_code, code, 0);
   43035         xmlResetLastError();
   43036         if (mem_base != xmlMemBlocks()) {
   43037             printf("Leak of %d blocks found in xmlUCSIsVariationSelectors",
   43038 	           xmlMemBlocks() - mem_base);
   43039 	    test_ret++;
   43040             printf(" %d", n_code);
   43041             printf("\n");
   43042         }
   43043     }
   43044     function_tests++;
   43045 #endif
   43046 
   43047     return(test_ret);
   43048 }
   43049 
   43050 
   43051 static int
   43052 test_xmlUCSIsVariationSelectorsSupplement(void) {
   43053     int test_ret = 0;
   43054 
   43055 #if defined(LIBXML_UNICODE_ENABLED)
   43056     int mem_base;
   43057     int ret_val;
   43058     int code; /* UCS code point */
   43059     int n_code;
   43060 
   43061     for (n_code = 0;n_code < gen_nb_int;n_code++) {
   43062         mem_base = xmlMemBlocks();
   43063         code = gen_int(n_code, 0);
   43064 
   43065         ret_val = xmlUCSIsVariationSelectorsSupplement(code);
   43066         desret_int(ret_val);
   43067         call_tests++;
   43068         des_int(n_code, code, 0);
   43069         xmlResetLastError();
   43070         if (mem_base != xmlMemBlocks()) {
   43071             printf("Leak of %d blocks found in xmlUCSIsVariationSelectorsSupplement",
   43072 	           xmlMemBlocks() - mem_base);
   43073 	    test_ret++;
   43074             printf(" %d", n_code);
   43075             printf("\n");
   43076         }
   43077     }
   43078     function_tests++;
   43079 #endif
   43080 
   43081     return(test_ret);
   43082 }
   43083 
   43084 
   43085 static int
   43086 test_xmlUCSIsYiRadicals(void) {
   43087     int test_ret = 0;
   43088 
   43089 #if defined(LIBXML_UNICODE_ENABLED)
   43090     int mem_base;
   43091     int ret_val;
   43092     int code; /* UCS code point */
   43093     int n_code;
   43094 
   43095     for (n_code = 0;n_code < gen_nb_int;n_code++) {
   43096         mem_base = xmlMemBlocks();
   43097         code = gen_int(n_code, 0);
   43098 
   43099         ret_val = xmlUCSIsYiRadicals(code);
   43100         desret_int(ret_val);
   43101         call_tests++;
   43102         des_int(n_code, code, 0);
   43103         xmlResetLastError();
   43104         if (mem_base != xmlMemBlocks()) {
   43105             printf("Leak of %d blocks found in xmlUCSIsYiRadicals",
   43106 	           xmlMemBlocks() - mem_base);
   43107 	    test_ret++;
   43108             printf(" %d", n_code);
   43109             printf("\n");
   43110         }
   43111     }
   43112     function_tests++;
   43113 #endif
   43114 
   43115     return(test_ret);
   43116 }
   43117 
   43118 
   43119 static int
   43120 test_xmlUCSIsYiSyllables(void) {
   43121     int test_ret = 0;
   43122 
   43123 #if defined(LIBXML_UNICODE_ENABLED)
   43124     int mem_base;
   43125     int ret_val;
   43126     int code; /* UCS code point */
   43127     int n_code;
   43128 
   43129     for (n_code = 0;n_code < gen_nb_int;n_code++) {
   43130         mem_base = xmlMemBlocks();
   43131         code = gen_int(n_code, 0);
   43132 
   43133         ret_val = xmlUCSIsYiSyllables(code);
   43134         desret_int(ret_val);
   43135         call_tests++;
   43136         des_int(n_code, code, 0);
   43137         xmlResetLastError();
   43138         if (mem_base != xmlMemBlocks()) {
   43139             printf("Leak of %d blocks found in xmlUCSIsYiSyllables",
   43140 	           xmlMemBlocks() - mem_base);
   43141 	    test_ret++;
   43142             printf(" %d", n_code);
   43143             printf("\n");
   43144         }
   43145     }
   43146     function_tests++;
   43147 #endif
   43148 
   43149     return(test_ret);
   43150 }
   43151 
   43152 
   43153 static int
   43154 test_xmlUCSIsYijingHexagramSymbols(void) {
   43155     int test_ret = 0;
   43156 
   43157 #if defined(LIBXML_UNICODE_ENABLED)
   43158     int mem_base;
   43159     int ret_val;
   43160     int code; /* UCS code point */
   43161     int n_code;
   43162 
   43163     for (n_code = 0;n_code < gen_nb_int;n_code++) {
   43164         mem_base = xmlMemBlocks();
   43165         code = gen_int(n_code, 0);
   43166 
   43167         ret_val = xmlUCSIsYijingHexagramSymbols(code);
   43168         desret_int(ret_val);
   43169         call_tests++;
   43170         des_int(n_code, code, 0);
   43171         xmlResetLastError();
   43172         if (mem_base != xmlMemBlocks()) {
   43173             printf("Leak of %d blocks found in xmlUCSIsYijingHexagramSymbols",
   43174 	           xmlMemBlocks() - mem_base);
   43175 	    test_ret++;
   43176             printf(" %d", n_code);
   43177             printf("\n");
   43178         }
   43179     }
   43180     function_tests++;
   43181 #endif
   43182 
   43183     return(test_ret);
   43184 }
   43185 
   43186 static int
   43187 test_xmlunicode(void) {
   43188     int test_ret = 0;
   43189 
   43190     if (quiet == 0) printf("Testing xmlunicode : 166 of 166 functions ...\n");
   43191     test_ret += test_xmlUCSIsAegeanNumbers();
   43192     test_ret += test_xmlUCSIsAlphabeticPresentationForms();
   43193     test_ret += test_xmlUCSIsArabic();
   43194     test_ret += test_xmlUCSIsArabicPresentationFormsA();
   43195     test_ret += test_xmlUCSIsArabicPresentationFormsB();
   43196     test_ret += test_xmlUCSIsArmenian();
   43197     test_ret += test_xmlUCSIsArrows();
   43198     test_ret += test_xmlUCSIsBasicLatin();
   43199     test_ret += test_xmlUCSIsBengali();
   43200     test_ret += test_xmlUCSIsBlock();
   43201     test_ret += test_xmlUCSIsBlockElements();
   43202     test_ret += test_xmlUCSIsBopomofo();
   43203     test_ret += test_xmlUCSIsBopomofoExtended();
   43204     test_ret += test_xmlUCSIsBoxDrawing();
   43205     test_ret += test_xmlUCSIsBraillePatterns();
   43206     test_ret += test_xmlUCSIsBuhid();
   43207     test_ret += test_xmlUCSIsByzantineMusicalSymbols();
   43208     test_ret += test_xmlUCSIsCJKCompatibility();
   43209     test_ret += test_xmlUCSIsCJKCompatibilityForms();
   43210     test_ret += test_xmlUCSIsCJKCompatibilityIdeographs();
   43211     test_ret += test_xmlUCSIsCJKCompatibilityIdeographsSupplement();
   43212     test_ret += test_xmlUCSIsCJKRadicalsSupplement();
   43213     test_ret += test_xmlUCSIsCJKSymbolsandPunctuation();
   43214     test_ret += test_xmlUCSIsCJKUnifiedIdeographs();
   43215     test_ret += test_xmlUCSIsCJKUnifiedIdeographsExtensionA();
   43216     test_ret += test_xmlUCSIsCJKUnifiedIdeographsExtensionB();
   43217     test_ret += test_xmlUCSIsCat();
   43218     test_ret += test_xmlUCSIsCatC();
   43219     test_ret += test_xmlUCSIsCatCc();
   43220     test_ret += test_xmlUCSIsCatCf();
   43221     test_ret += test_xmlUCSIsCatCo();
   43222     test_ret += test_xmlUCSIsCatCs();
   43223     test_ret += test_xmlUCSIsCatL();
   43224     test_ret += test_xmlUCSIsCatLl();
   43225     test_ret += test_xmlUCSIsCatLm();
   43226     test_ret += test_xmlUCSIsCatLo();
   43227     test_ret += test_xmlUCSIsCatLt();
   43228     test_ret += test_xmlUCSIsCatLu();
   43229     test_ret += test_xmlUCSIsCatM();
   43230     test_ret += test_xmlUCSIsCatMc();
   43231     test_ret += test_xmlUCSIsCatMe();
   43232     test_ret += test_xmlUCSIsCatMn();
   43233     test_ret += test_xmlUCSIsCatN();
   43234     test_ret += test_xmlUCSIsCatNd();
   43235     test_ret += test_xmlUCSIsCatNl();
   43236     test_ret += test_xmlUCSIsCatNo();
   43237     test_ret += test_xmlUCSIsCatP();
   43238     test_ret += test_xmlUCSIsCatPc();
   43239     test_ret += test_xmlUCSIsCatPd();
   43240     test_ret += test_xmlUCSIsCatPe();
   43241     test_ret += test_xmlUCSIsCatPf();
   43242     test_ret += test_xmlUCSIsCatPi();
   43243     test_ret += test_xmlUCSIsCatPo();
   43244     test_ret += test_xmlUCSIsCatPs();
   43245     test_ret += test_xmlUCSIsCatS();
   43246     test_ret += test_xmlUCSIsCatSc();
   43247     test_ret += test_xmlUCSIsCatSk();
   43248     test_ret += test_xmlUCSIsCatSm();
   43249     test_ret += test_xmlUCSIsCatSo();
   43250     test_ret += test_xmlUCSIsCatZ();
   43251     test_ret += test_xmlUCSIsCatZl();
   43252     test_ret += test_xmlUCSIsCatZp();
   43253     test_ret += test_xmlUCSIsCatZs();
   43254     test_ret += test_xmlUCSIsCherokee();
   43255     test_ret += test_xmlUCSIsCombiningDiacriticalMarks();
   43256     test_ret += test_xmlUCSIsCombiningDiacriticalMarksforSymbols();
   43257     test_ret += test_xmlUCSIsCombiningHalfMarks();
   43258     test_ret += test_xmlUCSIsCombiningMarksforSymbols();
   43259     test_ret += test_xmlUCSIsControlPictures();
   43260     test_ret += test_xmlUCSIsCurrencySymbols();
   43261     test_ret += test_xmlUCSIsCypriotSyllabary();
   43262     test_ret += test_xmlUCSIsCyrillic();
   43263     test_ret += test_xmlUCSIsCyrillicSupplement();
   43264     test_ret += test_xmlUCSIsDeseret();
   43265     test_ret += test_xmlUCSIsDevanagari();
   43266     test_ret += test_xmlUCSIsDingbats();
   43267     test_ret += test_xmlUCSIsEnclosedAlphanumerics();
   43268     test_ret += test_xmlUCSIsEnclosedCJKLettersandMonths();
   43269     test_ret += test_xmlUCSIsEthiopic();
   43270     test_ret += test_xmlUCSIsGeneralPunctuation();
   43271     test_ret += test_xmlUCSIsGeometricShapes();
   43272     test_ret += test_xmlUCSIsGeorgian();
   43273     test_ret += test_xmlUCSIsGothic();
   43274     test_ret += test_xmlUCSIsGreek();
   43275     test_ret += test_xmlUCSIsGreekExtended();
   43276     test_ret += test_xmlUCSIsGreekandCoptic();
   43277     test_ret += test_xmlUCSIsGujarati();
   43278     test_ret += test_xmlUCSIsGurmukhi();
   43279     test_ret += test_xmlUCSIsHalfwidthandFullwidthForms();
   43280     test_ret += test_xmlUCSIsHangulCompatibilityJamo();
   43281     test_ret += test_xmlUCSIsHangulJamo();
   43282     test_ret += test_xmlUCSIsHangulSyllables();
   43283     test_ret += test_xmlUCSIsHanunoo();
   43284     test_ret += test_xmlUCSIsHebrew();
   43285     test_ret += test_xmlUCSIsHighPrivateUseSurrogates();
   43286     test_ret += test_xmlUCSIsHighSurrogates();
   43287     test_ret += test_xmlUCSIsHiragana();
   43288     test_ret += test_xmlUCSIsIPAExtensions();
   43289     test_ret += test_xmlUCSIsIdeographicDescriptionCharacters();
   43290     test_ret += test_xmlUCSIsKanbun();
   43291     test_ret += test_xmlUCSIsKangxiRadicals();
   43292     test_ret += test_xmlUCSIsKannada();
   43293     test_ret += test_xmlUCSIsKatakana();
   43294     test_ret += test_xmlUCSIsKatakanaPhoneticExtensions();
   43295     test_ret += test_xmlUCSIsKhmer();
   43296     test_ret += test_xmlUCSIsKhmerSymbols();
   43297     test_ret += test_xmlUCSIsLao();
   43298     test_ret += test_xmlUCSIsLatin1Supplement();
   43299     test_ret += test_xmlUCSIsLatinExtendedA();
   43300     test_ret += test_xmlUCSIsLatinExtendedAdditional();
   43301     test_ret += test_xmlUCSIsLatinExtendedB();
   43302     test_ret += test_xmlUCSIsLetterlikeSymbols();
   43303     test_ret += test_xmlUCSIsLimbu();
   43304     test_ret += test_xmlUCSIsLinearBIdeograms();
   43305     test_ret += test_xmlUCSIsLinearBSyllabary();
   43306     test_ret += test_xmlUCSIsLowSurrogates();
   43307     test_ret += test_xmlUCSIsMalayalam();
   43308     test_ret += test_xmlUCSIsMathematicalAlphanumericSymbols();
   43309     test_ret += test_xmlUCSIsMathematicalOperators();
   43310     test_ret += test_xmlUCSIsMiscellaneousMathematicalSymbolsA();
   43311     test_ret += test_xmlUCSIsMiscellaneousMathematicalSymbolsB();
   43312     test_ret += test_xmlUCSIsMiscellaneousSymbols();
   43313     test_ret += test_xmlUCSIsMiscellaneousSymbolsandArrows();
   43314     test_ret += test_xmlUCSIsMiscellaneousTechnical();
   43315     test_ret += test_xmlUCSIsMongolian();
   43316     test_ret += test_xmlUCSIsMusicalSymbols();
   43317     test_ret += test_xmlUCSIsMyanmar();
   43318     test_ret += test_xmlUCSIsNumberForms();
   43319     test_ret += test_xmlUCSIsOgham();
   43320     test_ret += test_xmlUCSIsOldItalic();
   43321     test_ret += test_xmlUCSIsOpticalCharacterRecognition();
   43322     test_ret += test_xmlUCSIsOriya();
   43323     test_ret += test_xmlUCSIsOsmanya();
   43324     test_ret += test_xmlUCSIsPhoneticExtensions();
   43325     test_ret += test_xmlUCSIsPrivateUse();
   43326     test_ret += test_xmlUCSIsPrivateUseArea();
   43327     test_ret += test_xmlUCSIsRunic();
   43328     test_ret += test_xmlUCSIsShavian();
   43329     test_ret += test_xmlUCSIsSinhala();
   43330     test_ret += test_xmlUCSIsSmallFormVariants();
   43331     test_ret += test_xmlUCSIsSpacingModifierLetters();
   43332     test_ret += test_xmlUCSIsSpecials();
   43333     test_ret += test_xmlUCSIsSuperscriptsandSubscripts();
   43334     test_ret += test_xmlUCSIsSupplementalArrowsA();
   43335     test_ret += test_xmlUCSIsSupplementalArrowsB();
   43336     test_ret += test_xmlUCSIsSupplementalMathematicalOperators();
   43337     test_ret += test_xmlUCSIsSupplementaryPrivateUseAreaA();
   43338     test_ret += test_xmlUCSIsSupplementaryPrivateUseAreaB();
   43339     test_ret += test_xmlUCSIsSyriac();
   43340     test_ret += test_xmlUCSIsTagalog();
   43341     test_ret += test_xmlUCSIsTagbanwa();
   43342     test_ret += test_xmlUCSIsTags();
   43343     test_ret += test_xmlUCSIsTaiLe();
   43344     test_ret += test_xmlUCSIsTaiXuanJingSymbols();
   43345     test_ret += test_xmlUCSIsTamil();
   43346     test_ret += test_xmlUCSIsTelugu();
   43347     test_ret += test_xmlUCSIsThaana();
   43348     test_ret += test_xmlUCSIsThai();
   43349     test_ret += test_xmlUCSIsTibetan();
   43350     test_ret += test_xmlUCSIsUgaritic();
   43351     test_ret += test_xmlUCSIsUnifiedCanadianAboriginalSyllabics();
   43352     test_ret += test_xmlUCSIsVariationSelectors();
   43353     test_ret += test_xmlUCSIsVariationSelectorsSupplement();
   43354     test_ret += test_xmlUCSIsYiRadicals();
   43355     test_ret += test_xmlUCSIsYiSyllables();
   43356     test_ret += test_xmlUCSIsYijingHexagramSymbols();
   43357 
   43358     if (test_ret != 0)
   43359 	printf("Module xmlunicode: %d errors\n", test_ret);
   43360     return(test_ret);
   43361 }
   43362 
   43363 static int
   43364 test_xmlNewTextWriter(void) {
   43365     int test_ret = 0;
   43366 
   43367 #if defined(LIBXML_WRITER_ENABLED)
   43368     int mem_base;
   43369     xmlTextWriterPtr ret_val;
   43370     xmlOutputBufferPtr out; /* an xmlOutputBufferPtr */
   43371     int n_out;
   43372 
   43373     for (n_out = 0;n_out < gen_nb_xmlOutputBufferPtr;n_out++) {
   43374         mem_base = xmlMemBlocks();
   43375         out = gen_xmlOutputBufferPtr(n_out, 0);
   43376 
   43377         ret_val = xmlNewTextWriter(out);
   43378         if (ret_val != NULL) out = NULL;
   43379         desret_xmlTextWriterPtr(ret_val);
   43380         call_tests++;
   43381         des_xmlOutputBufferPtr(n_out, out, 0);
   43382         xmlResetLastError();
   43383         if (mem_base != xmlMemBlocks()) {
   43384             printf("Leak of %d blocks found in xmlNewTextWriter",
   43385 	           xmlMemBlocks() - mem_base);
   43386 	    test_ret++;
   43387             printf(" %d", n_out);
   43388             printf("\n");
   43389         }
   43390     }
   43391     function_tests++;
   43392 #endif
   43393 
   43394     return(test_ret);
   43395 }
   43396 
   43397 
   43398 static int
   43399 test_xmlNewTextWriterFilename(void) {
   43400     int test_ret = 0;
   43401 
   43402 #if defined(LIBXML_WRITER_ENABLED)
   43403     int mem_base;
   43404     xmlTextWriterPtr ret_val;
   43405     const char * uri; /* the URI of the resource for the output */
   43406     int n_uri;
   43407     int compression; /* compress the output? */
   43408     int n_compression;
   43409 
   43410     for (n_uri = 0;n_uri < gen_nb_fileoutput;n_uri++) {
   43411     for (n_compression = 0;n_compression < gen_nb_int;n_compression++) {
   43412         mem_base = xmlMemBlocks();
   43413         uri = gen_fileoutput(n_uri, 0);
   43414         compression = gen_int(n_compression, 1);
   43415 
   43416         ret_val = xmlNewTextWriterFilename(uri, compression);
   43417         desret_xmlTextWriterPtr(ret_val);
   43418         call_tests++;
   43419         des_fileoutput(n_uri, uri, 0);
   43420         des_int(n_compression, compression, 1);
   43421         xmlResetLastError();
   43422         if (mem_base != xmlMemBlocks()) {
   43423             printf("Leak of %d blocks found in xmlNewTextWriterFilename",
   43424 	           xmlMemBlocks() - mem_base);
   43425 	    test_ret++;
   43426             printf(" %d", n_uri);
   43427             printf(" %d", n_compression);
   43428             printf("\n");
   43429         }
   43430     }
   43431     }
   43432     function_tests++;
   43433 #endif
   43434 
   43435     return(test_ret);
   43436 }
   43437 
   43438 
   43439 static int
   43440 test_xmlNewTextWriterMemory(void) {
   43441     int test_ret = 0;
   43442 
   43443 #if defined(LIBXML_WRITER_ENABLED)
   43444     int mem_base;
   43445     xmlTextWriterPtr ret_val;
   43446     xmlBufferPtr buf; /* xmlBufferPtr */
   43447     int n_buf;
   43448     int compression; /* compress the output? */
   43449     int n_compression;
   43450 
   43451     for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
   43452     for (n_compression = 0;n_compression < gen_nb_int;n_compression++) {
   43453         mem_base = xmlMemBlocks();
   43454         buf = gen_xmlBufferPtr(n_buf, 0);
   43455         compression = gen_int(n_compression, 1);
   43456 
   43457         ret_val = xmlNewTextWriterMemory(buf, compression);
   43458         desret_xmlTextWriterPtr(ret_val);
   43459         call_tests++;
   43460         des_xmlBufferPtr(n_buf, buf, 0);
   43461         des_int(n_compression, compression, 1);
   43462         xmlResetLastError();
   43463         if (mem_base != xmlMemBlocks()) {
   43464             printf("Leak of %d blocks found in xmlNewTextWriterMemory",
   43465 	           xmlMemBlocks() - mem_base);
   43466 	    test_ret++;
   43467             printf(" %d", n_buf);
   43468             printf(" %d", n_compression);
   43469             printf("\n");
   43470         }
   43471     }
   43472     }
   43473     function_tests++;
   43474 #endif
   43475 
   43476     return(test_ret);
   43477 }
   43478 
   43479 
   43480 static int
   43481 test_xmlNewTextWriterPushParser(void) {
   43482     int test_ret = 0;
   43483 
   43484 #if defined(LIBXML_WRITER_ENABLED)
   43485     int mem_base;
   43486     xmlTextWriterPtr ret_val;
   43487     xmlParserCtxtPtr ctxt; /* xmlParserCtxtPtr to hold the new XML document tree */
   43488     int n_ctxt;
   43489     int compression; /* compress the output? */
   43490     int n_compression;
   43491 
   43492     for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
   43493     for (n_compression = 0;n_compression < gen_nb_int;n_compression++) {
   43494         mem_base = xmlMemBlocks();
   43495         ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
   43496         compression = gen_int(n_compression, 1);
   43497 
   43498         ret_val = xmlNewTextWriterPushParser(ctxt, compression);
   43499         if (ctxt != NULL) {xmlFreeDoc(ctxt->myDoc); ctxt->myDoc = NULL;} if (ret_val != NULL) ctxt = NULL;
   43500         desret_xmlTextWriterPtr(ret_val);
   43501         call_tests++;
   43502         des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
   43503         des_int(n_compression, compression, 1);
   43504         xmlResetLastError();
   43505         if (mem_base != xmlMemBlocks()) {
   43506             printf("Leak of %d blocks found in xmlNewTextWriterPushParser",
   43507 	           xmlMemBlocks() - mem_base);
   43508 	    test_ret++;
   43509             printf(" %d", n_ctxt);
   43510             printf(" %d", n_compression);
   43511             printf("\n");
   43512         }
   43513     }
   43514     }
   43515     function_tests++;
   43516 #endif
   43517 
   43518     return(test_ret);
   43519 }
   43520 
   43521 
   43522 static int
   43523 test_xmlNewTextWriterTree(void) {
   43524     int test_ret = 0;
   43525 
   43526 #if defined(LIBXML_WRITER_ENABLED)
   43527     int mem_base;
   43528     xmlTextWriterPtr ret_val;
   43529     xmlDocPtr doc; /* xmlDocPtr */
   43530     int n_doc;
   43531     xmlNodePtr node; /* xmlNodePtr or NULL for doc->children */
   43532     int n_node;
   43533     int compression; /* compress the output? */
   43534     int n_compression;
   43535 
   43536     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
   43537     for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
   43538     for (n_compression = 0;n_compression < gen_nb_int;n_compression++) {
   43539         mem_base = xmlMemBlocks();
   43540         doc = gen_xmlDocPtr(n_doc, 0);
   43541         node = gen_xmlNodePtr(n_node, 1);
   43542         compression = gen_int(n_compression, 2);
   43543 
   43544         ret_val = xmlNewTextWriterTree(doc, node, compression);
   43545         desret_xmlTextWriterPtr(ret_val);
   43546         call_tests++;
   43547         des_xmlDocPtr(n_doc, doc, 0);
   43548         des_xmlNodePtr(n_node, node, 1);
   43549         des_int(n_compression, compression, 2);
   43550         xmlResetLastError();
   43551         if (mem_base != xmlMemBlocks()) {
   43552             printf("Leak of %d blocks found in xmlNewTextWriterTree",
   43553 	           xmlMemBlocks() - mem_base);
   43554 	    test_ret++;
   43555             printf(" %d", n_doc);
   43556             printf(" %d", n_node);
   43557             printf(" %d", n_compression);
   43558             printf("\n");
   43559         }
   43560     }
   43561     }
   43562     }
   43563     function_tests++;
   43564 #endif
   43565 
   43566     return(test_ret);
   43567 }
   43568 
   43569 
   43570 static int
   43571 test_xmlTextWriterEndAttribute(void) {
   43572     int test_ret = 0;
   43573 
   43574 #if defined(LIBXML_WRITER_ENABLED)
   43575     int mem_base;
   43576     int ret_val;
   43577     xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
   43578     int n_writer;
   43579 
   43580     for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
   43581         mem_base = xmlMemBlocks();
   43582         writer = gen_xmlTextWriterPtr(n_writer, 0);
   43583 
   43584         ret_val = xmlTextWriterEndAttribute(writer);
   43585         desret_int(ret_val);
   43586         call_tests++;
   43587         des_xmlTextWriterPtr(n_writer, writer, 0);
   43588         xmlResetLastError();
   43589         if (mem_base != xmlMemBlocks()) {
   43590             printf("Leak of %d blocks found in xmlTextWriterEndAttribute",
   43591 	           xmlMemBlocks() - mem_base);
   43592 	    test_ret++;
   43593             printf(" %d", n_writer);
   43594             printf("\n");
   43595         }
   43596     }
   43597     function_tests++;
   43598 #endif
   43599 
   43600     return(test_ret);
   43601 }
   43602 
   43603 
   43604 static int
   43605 test_xmlTextWriterEndCDATA(void) {
   43606     int test_ret = 0;
   43607 
   43608 #if defined(LIBXML_WRITER_ENABLED)
   43609     int mem_base;
   43610     int ret_val;
   43611     xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
   43612     int n_writer;
   43613 
   43614     for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
   43615         mem_base = xmlMemBlocks();
   43616         writer = gen_xmlTextWriterPtr(n_writer, 0);
   43617 
   43618         ret_val = xmlTextWriterEndCDATA(writer);
   43619         desret_int(ret_val);
   43620         call_tests++;
   43621         des_xmlTextWriterPtr(n_writer, writer, 0);
   43622         xmlResetLastError();
   43623         if (mem_base != xmlMemBlocks()) {
   43624             printf("Leak of %d blocks found in xmlTextWriterEndCDATA",
   43625 	           xmlMemBlocks() - mem_base);
   43626 	    test_ret++;
   43627             printf(" %d", n_writer);
   43628             printf("\n");
   43629         }
   43630     }
   43631     function_tests++;
   43632 #endif
   43633 
   43634     return(test_ret);
   43635 }
   43636 
   43637 
   43638 static int
   43639 test_xmlTextWriterEndComment(void) {
   43640     int test_ret = 0;
   43641 
   43642 #if defined(LIBXML_WRITER_ENABLED)
   43643     int mem_base;
   43644     int ret_val;
   43645     xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
   43646     int n_writer;
   43647 
   43648     for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
   43649         mem_base = xmlMemBlocks();
   43650         writer = gen_xmlTextWriterPtr(n_writer, 0);
   43651 
   43652         ret_val = xmlTextWriterEndComment(writer);
   43653         desret_int(ret_val);
   43654         call_tests++;
   43655         des_xmlTextWriterPtr(n_writer, writer, 0);
   43656         xmlResetLastError();
   43657         if (mem_base != xmlMemBlocks()) {
   43658             printf("Leak of %d blocks found in xmlTextWriterEndComment",
   43659 	           xmlMemBlocks() - mem_base);
   43660 	    test_ret++;
   43661             printf(" %d", n_writer);
   43662             printf("\n");
   43663         }
   43664     }
   43665     function_tests++;
   43666 #endif
   43667 
   43668     return(test_ret);
   43669 }
   43670 
   43671 
   43672 static int
   43673 test_xmlTextWriterEndDTD(void) {
   43674     int test_ret = 0;
   43675 
   43676 #if defined(LIBXML_WRITER_ENABLED)
   43677     int mem_base;
   43678     int ret_val;
   43679     xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
   43680     int n_writer;
   43681 
   43682     for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
   43683         mem_base = xmlMemBlocks();
   43684         writer = gen_xmlTextWriterPtr(n_writer, 0);
   43685 
   43686         ret_val = xmlTextWriterEndDTD(writer);
   43687         desret_int(ret_val);
   43688         call_tests++;
   43689         des_xmlTextWriterPtr(n_writer, writer, 0);
   43690         xmlResetLastError();
   43691         if (mem_base != xmlMemBlocks()) {
   43692             printf("Leak of %d blocks found in xmlTextWriterEndDTD",
   43693 	           xmlMemBlocks() - mem_base);
   43694 	    test_ret++;
   43695             printf(" %d", n_writer);
   43696             printf("\n");
   43697         }
   43698     }
   43699     function_tests++;
   43700 #endif
   43701 
   43702     return(test_ret);
   43703 }
   43704 
   43705 
   43706 static int
   43707 test_xmlTextWriterEndDTDAttlist(void) {
   43708     int test_ret = 0;
   43709 
   43710 #if defined(LIBXML_WRITER_ENABLED)
   43711     int mem_base;
   43712     int ret_val;
   43713     xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
   43714     int n_writer;
   43715 
   43716     for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
   43717         mem_base = xmlMemBlocks();
   43718         writer = gen_xmlTextWriterPtr(n_writer, 0);
   43719 
   43720         ret_val = xmlTextWriterEndDTDAttlist(writer);
   43721         desret_int(ret_val);
   43722         call_tests++;
   43723         des_xmlTextWriterPtr(n_writer, writer, 0);
   43724         xmlResetLastError();
   43725         if (mem_base != xmlMemBlocks()) {
   43726             printf("Leak of %d blocks found in xmlTextWriterEndDTDAttlist",
   43727 	           xmlMemBlocks() - mem_base);
   43728 	    test_ret++;
   43729             printf(" %d", n_writer);
   43730             printf("\n");
   43731         }
   43732     }
   43733     function_tests++;
   43734 #endif
   43735 
   43736     return(test_ret);
   43737 }
   43738 
   43739 
   43740 static int
   43741 test_xmlTextWriterEndDTDElement(void) {
   43742     int test_ret = 0;
   43743 
   43744 #if defined(LIBXML_WRITER_ENABLED)
   43745     int mem_base;
   43746     int ret_val;
   43747     xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
   43748     int n_writer;
   43749 
   43750     for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
   43751         mem_base = xmlMemBlocks();
   43752         writer = gen_xmlTextWriterPtr(n_writer, 0);
   43753 
   43754         ret_val = xmlTextWriterEndDTDElement(writer);
   43755         desret_int(ret_val);
   43756         call_tests++;
   43757         des_xmlTextWriterPtr(n_writer, writer, 0);
   43758         xmlResetLastError();
   43759         if (mem_base != xmlMemBlocks()) {
   43760             printf("Leak of %d blocks found in xmlTextWriterEndDTDElement",
   43761 	           xmlMemBlocks() - mem_base);
   43762 	    test_ret++;
   43763             printf(" %d", n_writer);
   43764             printf("\n");
   43765         }
   43766     }
   43767     function_tests++;
   43768 #endif
   43769 
   43770     return(test_ret);
   43771 }
   43772 
   43773 
   43774 static int
   43775 test_xmlTextWriterEndDTDEntity(void) {
   43776     int test_ret = 0;
   43777 
   43778 #if defined(LIBXML_WRITER_ENABLED)
   43779     int mem_base;
   43780     int ret_val;
   43781     xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
   43782     int n_writer;
   43783 
   43784     for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
   43785         mem_base = xmlMemBlocks();
   43786         writer = gen_xmlTextWriterPtr(n_writer, 0);
   43787 
   43788         ret_val = xmlTextWriterEndDTDEntity(writer);
   43789         desret_int(ret_val);
   43790         call_tests++;
   43791         des_xmlTextWriterPtr(n_writer, writer, 0);
   43792         xmlResetLastError();
   43793         if (mem_base != xmlMemBlocks()) {
   43794             printf("Leak of %d blocks found in xmlTextWriterEndDTDEntity",
   43795 	           xmlMemBlocks() - mem_base);
   43796 	    test_ret++;
   43797             printf(" %d", n_writer);
   43798             printf("\n");
   43799         }
   43800     }
   43801     function_tests++;
   43802 #endif
   43803 
   43804     return(test_ret);
   43805 }
   43806 
   43807 
   43808 static int
   43809 test_xmlTextWriterEndDocument(void) {
   43810     int test_ret = 0;
   43811 
   43812 #if defined(LIBXML_WRITER_ENABLED)
   43813     int mem_base;
   43814     int ret_val;
   43815     xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
   43816     int n_writer;
   43817 
   43818     for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
   43819         mem_base = xmlMemBlocks();
   43820         writer = gen_xmlTextWriterPtr(n_writer, 0);
   43821 
   43822         ret_val = xmlTextWriterEndDocument(writer);
   43823         desret_int(ret_val);
   43824         call_tests++;
   43825         des_xmlTextWriterPtr(n_writer, writer, 0);
   43826         xmlResetLastError();
   43827         if (mem_base != xmlMemBlocks()) {
   43828             printf("Leak of %d blocks found in xmlTextWriterEndDocument",
   43829 	           xmlMemBlocks() - mem_base);
   43830 	    test_ret++;
   43831             printf(" %d", n_writer);
   43832             printf("\n");
   43833         }
   43834     }
   43835     function_tests++;
   43836 #endif
   43837 
   43838     return(test_ret);
   43839 }
   43840 
   43841 
   43842 static int
   43843 test_xmlTextWriterEndElement(void) {
   43844     int test_ret = 0;
   43845 
   43846 #if defined(LIBXML_WRITER_ENABLED)
   43847     int mem_base;
   43848     int ret_val;
   43849     xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
   43850     int n_writer;
   43851 
   43852     for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
   43853         mem_base = xmlMemBlocks();
   43854         writer = gen_xmlTextWriterPtr(n_writer, 0);
   43855 
   43856         ret_val = xmlTextWriterEndElement(writer);
   43857         desret_int(ret_val);
   43858         call_tests++;
   43859         des_xmlTextWriterPtr(n_writer, writer, 0);
   43860         xmlResetLastError();
   43861         if (mem_base != xmlMemBlocks()) {
   43862             printf("Leak of %d blocks found in xmlTextWriterEndElement",
   43863 	           xmlMemBlocks() - mem_base);
   43864 	    test_ret++;
   43865             printf(" %d", n_writer);
   43866             printf("\n");
   43867         }
   43868     }
   43869     function_tests++;
   43870 #endif
   43871 
   43872     return(test_ret);
   43873 }
   43874 
   43875 
   43876 static int
   43877 test_xmlTextWriterEndPI(void) {
   43878     int test_ret = 0;
   43879 
   43880 #if defined(LIBXML_WRITER_ENABLED)
   43881     int mem_base;
   43882     int ret_val;
   43883     xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
   43884     int n_writer;
   43885 
   43886     for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
   43887         mem_base = xmlMemBlocks();
   43888         writer = gen_xmlTextWriterPtr(n_writer, 0);
   43889 
   43890         ret_val = xmlTextWriterEndPI(writer);
   43891         desret_int(ret_val);
   43892         call_tests++;
   43893         des_xmlTextWriterPtr(n_writer, writer, 0);
   43894         xmlResetLastError();
   43895         if (mem_base != xmlMemBlocks()) {
   43896             printf("Leak of %d blocks found in xmlTextWriterEndPI",
   43897 	           xmlMemBlocks() - mem_base);
   43898 	    test_ret++;
   43899             printf(" %d", n_writer);
   43900             printf("\n");
   43901         }
   43902     }
   43903     function_tests++;
   43904 #endif
   43905 
   43906     return(test_ret);
   43907 }
   43908 
   43909 
   43910 static int
   43911 test_xmlTextWriterFlush(void) {
   43912     int test_ret = 0;
   43913 
   43914 #if defined(LIBXML_WRITER_ENABLED)
   43915     int mem_base;
   43916     int ret_val;
   43917     xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
   43918     int n_writer;
   43919 
   43920     for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
   43921         mem_base = xmlMemBlocks();
   43922         writer = gen_xmlTextWriterPtr(n_writer, 0);
   43923 
   43924         ret_val = xmlTextWriterFlush(writer);
   43925         desret_int(ret_val);
   43926         call_tests++;
   43927         des_xmlTextWriterPtr(n_writer, writer, 0);
   43928         xmlResetLastError();
   43929         if (mem_base != xmlMemBlocks()) {
   43930             printf("Leak of %d blocks found in xmlTextWriterFlush",
   43931 	           xmlMemBlocks() - mem_base);
   43932 	    test_ret++;
   43933             printf(" %d", n_writer);
   43934             printf("\n");
   43935         }
   43936     }
   43937     function_tests++;
   43938 #endif
   43939 
   43940     return(test_ret);
   43941 }
   43942 
   43943 
   43944 static int
   43945 test_xmlTextWriterFullEndElement(void) {
   43946     int test_ret = 0;
   43947 
   43948 #if defined(LIBXML_WRITER_ENABLED)
   43949     int mem_base;
   43950     int ret_val;
   43951     xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
   43952     int n_writer;
   43953 
   43954     for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
   43955         mem_base = xmlMemBlocks();
   43956         writer = gen_xmlTextWriterPtr(n_writer, 0);
   43957 
   43958         ret_val = xmlTextWriterFullEndElement(writer);
   43959         desret_int(ret_val);
   43960         call_tests++;
   43961         des_xmlTextWriterPtr(n_writer, writer, 0);
   43962         xmlResetLastError();
   43963         if (mem_base != xmlMemBlocks()) {
   43964             printf("Leak of %d blocks found in xmlTextWriterFullEndElement",
   43965 	           xmlMemBlocks() - mem_base);
   43966 	    test_ret++;
   43967             printf(" %d", n_writer);
   43968             printf("\n");
   43969         }
   43970     }
   43971     function_tests++;
   43972 #endif
   43973 
   43974     return(test_ret);
   43975 }
   43976 
   43977 
   43978 static int
   43979 test_xmlTextWriterSetIndent(void) {
   43980     int test_ret = 0;
   43981 
   43982 #if defined(LIBXML_WRITER_ENABLED)
   43983     int mem_base;
   43984     int ret_val;
   43985     xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
   43986     int n_writer;
   43987     int indent; /* do indentation? */
   43988     int n_indent;
   43989 
   43990     for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
   43991     for (n_indent = 0;n_indent < gen_nb_int;n_indent++) {
   43992         mem_base = xmlMemBlocks();
   43993         writer = gen_xmlTextWriterPtr(n_writer, 0);
   43994         indent = gen_int(n_indent, 1);
   43995 
   43996         ret_val = xmlTextWriterSetIndent(writer, indent);
   43997         desret_int(ret_val);
   43998         call_tests++;
   43999         des_xmlTextWriterPtr(n_writer, writer, 0);
   44000         des_int(n_indent, indent, 1);
   44001         xmlResetLastError();
   44002         if (mem_base != xmlMemBlocks()) {
   44003             printf("Leak of %d blocks found in xmlTextWriterSetIndent",
   44004 	           xmlMemBlocks() - mem_base);
   44005 	    test_ret++;
   44006             printf(" %d", n_writer);
   44007             printf(" %d", n_indent);
   44008             printf("\n");
   44009         }
   44010     }
   44011     }
   44012     function_tests++;
   44013 #endif
   44014 
   44015     return(test_ret);
   44016 }
   44017 
   44018 
   44019 static int
   44020 test_xmlTextWriterSetIndentString(void) {
   44021     int test_ret = 0;
   44022 
   44023 #if defined(LIBXML_WRITER_ENABLED)
   44024     int mem_base;
   44025     int ret_val;
   44026     xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
   44027     int n_writer;
   44028     xmlChar * str; /* the xmlChar string */
   44029     int n_str;
   44030 
   44031     for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
   44032     for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) {
   44033         mem_base = xmlMemBlocks();
   44034         writer = gen_xmlTextWriterPtr(n_writer, 0);
   44035         str = gen_const_xmlChar_ptr(n_str, 1);
   44036 
   44037         ret_val = xmlTextWriterSetIndentString(writer, (const xmlChar *)str);
   44038         desret_int(ret_val);
   44039         call_tests++;
   44040         des_xmlTextWriterPtr(n_writer, writer, 0);
   44041         des_const_xmlChar_ptr(n_str, (const xmlChar *)str, 1);
   44042         xmlResetLastError();
   44043         if (mem_base != xmlMemBlocks()) {
   44044             printf("Leak of %d blocks found in xmlTextWriterSetIndentString",
   44045 	           xmlMemBlocks() - mem_base);
   44046 	    test_ret++;
   44047             printf(" %d", n_writer);
   44048             printf(" %d", n_str);
   44049             printf("\n");
   44050         }
   44051     }
   44052     }
   44053     function_tests++;
   44054 #endif
   44055 
   44056     return(test_ret);
   44057 }
   44058 
   44059 
   44060 static int
   44061 test_xmlTextWriterSetQuoteChar(void) {
   44062     int test_ret = 0;
   44063 
   44064 #if defined(LIBXML_WRITER_ENABLED)
   44065     int mem_base;
   44066     int ret_val;
   44067     xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
   44068     int n_writer;
   44069     xmlChar quotechar; /* the quote character */
   44070     int n_quotechar;
   44071 
   44072     for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
   44073     for (n_quotechar = 0;n_quotechar < gen_nb_xmlChar;n_quotechar++) {
   44074         mem_base = xmlMemBlocks();
   44075         writer = gen_xmlTextWriterPtr(n_writer, 0);
   44076         quotechar = gen_xmlChar(n_quotechar, 1);
   44077 
   44078         ret_val = xmlTextWriterSetQuoteChar(writer, quotechar);
   44079         desret_int(ret_val);
   44080         call_tests++;
   44081         des_xmlTextWriterPtr(n_writer, writer, 0);
   44082         des_xmlChar(n_quotechar, quotechar, 1);
   44083         xmlResetLastError();
   44084         if (mem_base != xmlMemBlocks()) {
   44085             printf("Leak of %d blocks found in xmlTextWriterSetQuoteChar",
   44086 	           xmlMemBlocks() - mem_base);
   44087 	    test_ret++;
   44088             printf(" %d", n_writer);
   44089             printf(" %d", n_quotechar);
   44090             printf("\n");
   44091         }
   44092     }
   44093     }
   44094     function_tests++;
   44095 #endif
   44096 
   44097     return(test_ret);
   44098 }
   44099 
   44100 
   44101 static int
   44102 test_xmlTextWriterStartAttribute(void) {
   44103     int test_ret = 0;
   44104 
   44105 #if defined(LIBXML_WRITER_ENABLED)
   44106     int mem_base;
   44107     int ret_val;
   44108     xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
   44109     int n_writer;
   44110     xmlChar * name; /* element name */
   44111     int n_name;
   44112 
   44113     for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
   44114     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
   44115         mem_base = xmlMemBlocks();
   44116         writer = gen_xmlTextWriterPtr(n_writer, 0);
   44117         name = gen_const_xmlChar_ptr(n_name, 1);
   44118 
   44119         ret_val = xmlTextWriterStartAttribute(writer, (const xmlChar *)name);
   44120         desret_int(ret_val);
   44121         call_tests++;
   44122         des_xmlTextWriterPtr(n_writer, writer, 0);
   44123         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
   44124         xmlResetLastError();
   44125         if (mem_base != xmlMemBlocks()) {
   44126             printf("Leak of %d blocks found in xmlTextWriterStartAttribute",
   44127 	           xmlMemBlocks() - mem_base);
   44128 	    test_ret++;
   44129             printf(" %d", n_writer);
   44130             printf(" %d", n_name);
   44131             printf("\n");
   44132         }
   44133     }
   44134     }
   44135     function_tests++;
   44136 #endif
   44137 
   44138     return(test_ret);
   44139 }
   44140 
   44141 
   44142 static int
   44143 test_xmlTextWriterStartAttributeNS(void) {
   44144     int test_ret = 0;
   44145 
   44146 #if defined(LIBXML_WRITER_ENABLED)
   44147     int mem_base;
   44148     int ret_val;
   44149     xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
   44150     int n_writer;
   44151     xmlChar * prefix; /* namespace prefix or NULL */
   44152     int n_prefix;
   44153     xmlChar * name; /* element local name */
   44154     int n_name;
   44155     xmlChar * namespaceURI; /* namespace URI or NULL */
   44156     int n_namespaceURI;
   44157 
   44158     for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
   44159     for (n_prefix = 0;n_prefix < gen_nb_const_xmlChar_ptr;n_prefix++) {
   44160     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
   44161     for (n_namespaceURI = 0;n_namespaceURI < gen_nb_const_xmlChar_ptr;n_namespaceURI++) {
   44162         mem_base = xmlMemBlocks();
   44163         writer = gen_xmlTextWriterPtr(n_writer, 0);
   44164         prefix = gen_const_xmlChar_ptr(n_prefix, 1);
   44165         name = gen_const_xmlChar_ptr(n_name, 2);
   44166         namespaceURI = gen_const_xmlChar_ptr(n_namespaceURI, 3);
   44167 
   44168         ret_val = xmlTextWriterStartAttributeNS(writer, (const xmlChar *)prefix, (const xmlChar *)name, (const xmlChar *)namespaceURI);
   44169         desret_int(ret_val);
   44170         call_tests++;
   44171         des_xmlTextWriterPtr(n_writer, writer, 0);
   44172         des_const_xmlChar_ptr(n_prefix, (const xmlChar *)prefix, 1);
   44173         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 2);
   44174         des_const_xmlChar_ptr(n_namespaceURI, (const xmlChar *)namespaceURI, 3);
   44175         xmlResetLastError();
   44176         if (mem_base != xmlMemBlocks()) {
   44177             printf("Leak of %d blocks found in xmlTextWriterStartAttributeNS",
   44178 	           xmlMemBlocks() - mem_base);
   44179 	    test_ret++;
   44180             printf(" %d", n_writer);
   44181             printf(" %d", n_prefix);
   44182             printf(" %d", n_name);
   44183             printf(" %d", n_namespaceURI);
   44184             printf("\n");
   44185         }
   44186     }
   44187     }
   44188     }
   44189     }
   44190     function_tests++;
   44191 #endif
   44192 
   44193     return(test_ret);
   44194 }
   44195 
   44196 
   44197 static int
   44198 test_xmlTextWriterStartCDATA(void) {
   44199     int test_ret = 0;
   44200 
   44201 #if defined(LIBXML_WRITER_ENABLED)
   44202     int mem_base;
   44203     int ret_val;
   44204     xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
   44205     int n_writer;
   44206 
   44207     for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
   44208         mem_base = xmlMemBlocks();
   44209         writer = gen_xmlTextWriterPtr(n_writer, 0);
   44210 
   44211         ret_val = xmlTextWriterStartCDATA(writer);
   44212         desret_int(ret_val);
   44213         call_tests++;
   44214         des_xmlTextWriterPtr(n_writer, writer, 0);
   44215         xmlResetLastError();
   44216         if (mem_base != xmlMemBlocks()) {
   44217             printf("Leak of %d blocks found in xmlTextWriterStartCDATA",
   44218 	           xmlMemBlocks() - mem_base);
   44219 	    test_ret++;
   44220             printf(" %d", n_writer);
   44221             printf("\n");
   44222         }
   44223     }
   44224     function_tests++;
   44225 #endif
   44226 
   44227     return(test_ret);
   44228 }
   44229 
   44230 
   44231 static int
   44232 test_xmlTextWriterStartComment(void) {
   44233     int test_ret = 0;
   44234 
   44235 #if defined(LIBXML_WRITER_ENABLED)
   44236     int mem_base;
   44237     int ret_val;
   44238     xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
   44239     int n_writer;
   44240 
   44241     for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
   44242         mem_base = xmlMemBlocks();
   44243         writer = gen_xmlTextWriterPtr(n_writer, 0);
   44244 
   44245         ret_val = xmlTextWriterStartComment(writer);
   44246         desret_int(ret_val);
   44247         call_tests++;
   44248         des_xmlTextWriterPtr(n_writer, writer, 0);
   44249         xmlResetLastError();
   44250         if (mem_base != xmlMemBlocks()) {
   44251             printf("Leak of %d blocks found in xmlTextWriterStartComment",
   44252 	           xmlMemBlocks() - mem_base);
   44253 	    test_ret++;
   44254             printf(" %d", n_writer);
   44255             printf("\n");
   44256         }
   44257     }
   44258     function_tests++;
   44259 #endif
   44260 
   44261     return(test_ret);
   44262 }
   44263 
   44264 
   44265 static int
   44266 test_xmlTextWriterStartDTD(void) {
   44267     int test_ret = 0;
   44268 
   44269 #if defined(LIBXML_WRITER_ENABLED)
   44270     int mem_base;
   44271     int ret_val;
   44272     xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
   44273     int n_writer;
   44274     xmlChar * name; /* the name of the DTD */
   44275     int n_name;
   44276     xmlChar * pubid; /* the public identifier, which is an alternative to the system identifier */
   44277     int n_pubid;
   44278     xmlChar * sysid; /* the system identifier, which is the URI of the DTD */
   44279     int n_sysid;
   44280 
   44281     for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
   44282     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
   44283     for (n_pubid = 0;n_pubid < gen_nb_const_xmlChar_ptr;n_pubid++) {
   44284     for (n_sysid = 0;n_sysid < gen_nb_const_xmlChar_ptr;n_sysid++) {
   44285         mem_base = xmlMemBlocks();
   44286         writer = gen_xmlTextWriterPtr(n_writer, 0);
   44287         name = gen_const_xmlChar_ptr(n_name, 1);
   44288         pubid = gen_const_xmlChar_ptr(n_pubid, 2);
   44289         sysid = gen_const_xmlChar_ptr(n_sysid, 3);
   44290 
   44291         ret_val = xmlTextWriterStartDTD(writer, (const xmlChar *)name, (const xmlChar *)pubid, (const xmlChar *)sysid);
   44292         desret_int(ret_val);
   44293         call_tests++;
   44294         des_xmlTextWriterPtr(n_writer, writer, 0);
   44295         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
   44296         des_const_xmlChar_ptr(n_pubid, (const xmlChar *)pubid, 2);
   44297         des_const_xmlChar_ptr(n_sysid, (const xmlChar *)sysid, 3);
   44298         xmlResetLastError();
   44299         if (mem_base != xmlMemBlocks()) {
   44300             printf("Leak of %d blocks found in xmlTextWriterStartDTD",
   44301 	           xmlMemBlocks() - mem_base);
   44302 	    test_ret++;
   44303             printf(" %d", n_writer);
   44304             printf(" %d", n_name);
   44305             printf(" %d", n_pubid);
   44306             printf(" %d", n_sysid);
   44307             printf("\n");
   44308         }
   44309     }
   44310     }
   44311     }
   44312     }
   44313     function_tests++;
   44314 #endif
   44315 
   44316     return(test_ret);
   44317 }
   44318 
   44319 
   44320 static int
   44321 test_xmlTextWriterStartDTDAttlist(void) {
   44322     int test_ret = 0;
   44323 
   44324 #if defined(LIBXML_WRITER_ENABLED)
   44325     int mem_base;
   44326     int ret_val;
   44327     xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
   44328     int n_writer;
   44329     xmlChar * name; /* the name of the DTD ATTLIST */
   44330     int n_name;
   44331 
   44332     for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
   44333     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
   44334         mem_base = xmlMemBlocks();
   44335         writer = gen_xmlTextWriterPtr(n_writer, 0);
   44336         name = gen_const_xmlChar_ptr(n_name, 1);
   44337 
   44338         ret_val = xmlTextWriterStartDTDAttlist(writer, (const xmlChar *)name);
   44339         desret_int(ret_val);
   44340         call_tests++;
   44341         des_xmlTextWriterPtr(n_writer, writer, 0);
   44342         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
   44343         xmlResetLastError();
   44344         if (mem_base != xmlMemBlocks()) {
   44345             printf("Leak of %d blocks found in xmlTextWriterStartDTDAttlist",
   44346 	           xmlMemBlocks() - mem_base);
   44347 	    test_ret++;
   44348             printf(" %d", n_writer);
   44349             printf(" %d", n_name);
   44350             printf("\n");
   44351         }
   44352     }
   44353     }
   44354     function_tests++;
   44355 #endif
   44356 
   44357     return(test_ret);
   44358 }
   44359 
   44360 
   44361 static int
   44362 test_xmlTextWriterStartDTDElement(void) {
   44363     int test_ret = 0;
   44364 
   44365 #if defined(LIBXML_WRITER_ENABLED)
   44366     int mem_base;
   44367     int ret_val;
   44368     xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
   44369     int n_writer;
   44370     xmlChar * name; /* the name of the DTD element */
   44371     int n_name;
   44372 
   44373     for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
   44374     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
   44375         mem_base = xmlMemBlocks();
   44376         writer = gen_xmlTextWriterPtr(n_writer, 0);
   44377         name = gen_const_xmlChar_ptr(n_name, 1);
   44378 
   44379         ret_val = xmlTextWriterStartDTDElement(writer, (const xmlChar *)name);
   44380         desret_int(ret_val);
   44381         call_tests++;
   44382         des_xmlTextWriterPtr(n_writer, writer, 0);
   44383         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
   44384         xmlResetLastError();
   44385         if (mem_base != xmlMemBlocks()) {
   44386             printf("Leak of %d blocks found in xmlTextWriterStartDTDElement",
   44387 	           xmlMemBlocks() - mem_base);
   44388 	    test_ret++;
   44389             printf(" %d", n_writer);
   44390             printf(" %d", n_name);
   44391             printf("\n");
   44392         }
   44393     }
   44394     }
   44395     function_tests++;
   44396 #endif
   44397 
   44398     return(test_ret);
   44399 }
   44400 
   44401 
   44402 static int
   44403 test_xmlTextWriterStartDTDEntity(void) {
   44404     int test_ret = 0;
   44405 
   44406 #if defined(LIBXML_WRITER_ENABLED)
   44407     int mem_base;
   44408     int ret_val;
   44409     xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
   44410     int n_writer;
   44411     int pe; /* TRUE if this is a parameter entity, FALSE if not */
   44412     int n_pe;
   44413     xmlChar * name; /* the name of the DTD ATTLIST */
   44414     int n_name;
   44415 
   44416     for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
   44417     for (n_pe = 0;n_pe < gen_nb_int;n_pe++) {
   44418     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
   44419         mem_base = xmlMemBlocks();
   44420         writer = gen_xmlTextWriterPtr(n_writer, 0);
   44421         pe = gen_int(n_pe, 1);
   44422         name = gen_const_xmlChar_ptr(n_name, 2);
   44423 
   44424         ret_val = xmlTextWriterStartDTDEntity(writer, pe, (const xmlChar *)name);
   44425         desret_int(ret_val);
   44426         call_tests++;
   44427         des_xmlTextWriterPtr(n_writer, writer, 0);
   44428         des_int(n_pe, pe, 1);
   44429         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 2);
   44430         xmlResetLastError();
   44431         if (mem_base != xmlMemBlocks()) {
   44432             printf("Leak of %d blocks found in xmlTextWriterStartDTDEntity",
   44433 	           xmlMemBlocks() - mem_base);
   44434 	    test_ret++;
   44435             printf(" %d", n_writer);
   44436             printf(" %d", n_pe);
   44437             printf(" %d", n_name);
   44438             printf("\n");
   44439         }
   44440     }
   44441     }
   44442     }
   44443     function_tests++;
   44444 #endif
   44445 
   44446     return(test_ret);
   44447 }
   44448 
   44449 
   44450 static int
   44451 test_xmlTextWriterStartDocument(void) {
   44452     int test_ret = 0;
   44453 
   44454 #if defined(LIBXML_WRITER_ENABLED)
   44455     int mem_base;
   44456     int ret_val;
   44457     xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
   44458     int n_writer;
   44459     char * version; /* the xml version ("1.0") or NULL for default ("1.0") */
   44460     int n_version;
   44461     char * encoding; /* the encoding or NULL for default */
   44462     int n_encoding;
   44463     char * standalone; /* "yes" or "no" or NULL for default */
   44464     int n_standalone;
   44465 
   44466     for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
   44467     for (n_version = 0;n_version < gen_nb_const_char_ptr;n_version++) {
   44468     for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
   44469     for (n_standalone = 0;n_standalone < gen_nb_const_char_ptr;n_standalone++) {
   44470         mem_base = xmlMemBlocks();
   44471         writer = gen_xmlTextWriterPtr(n_writer, 0);
   44472         version = gen_const_char_ptr(n_version, 1);
   44473         encoding = gen_const_char_ptr(n_encoding, 2);
   44474         standalone = gen_const_char_ptr(n_standalone, 3);
   44475 
   44476         ret_val = xmlTextWriterStartDocument(writer, (const char *)version, (const char *)encoding, (const char *)standalone);
   44477         desret_int(ret_val);
   44478         call_tests++;
   44479         des_xmlTextWriterPtr(n_writer, writer, 0);
   44480         des_const_char_ptr(n_version, (const char *)version, 1);
   44481         des_const_char_ptr(n_encoding, (const char *)encoding, 2);
   44482         des_const_char_ptr(n_standalone, (const char *)standalone, 3);
   44483         xmlResetLastError();
   44484         if (mem_base != xmlMemBlocks()) {
   44485             printf("Leak of %d blocks found in xmlTextWriterStartDocument",
   44486 	           xmlMemBlocks() - mem_base);
   44487 	    test_ret++;
   44488             printf(" %d", n_writer);
   44489             printf(" %d", n_version);
   44490             printf(" %d", n_encoding);
   44491             printf(" %d", n_standalone);
   44492             printf("\n");
   44493         }
   44494     }
   44495     }
   44496     }
   44497     }
   44498     function_tests++;
   44499 #endif
   44500 
   44501     return(test_ret);
   44502 }
   44503 
   44504 
   44505 static int
   44506 test_xmlTextWriterStartElement(void) {
   44507     int test_ret = 0;
   44508 
   44509 #if defined(LIBXML_WRITER_ENABLED)
   44510     int mem_base;
   44511     int ret_val;
   44512     xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
   44513     int n_writer;
   44514     xmlChar * name; /* element name */
   44515     int n_name;
   44516 
   44517     for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
   44518     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
   44519         mem_base = xmlMemBlocks();
   44520         writer = gen_xmlTextWriterPtr(n_writer, 0);
   44521         name = gen_const_xmlChar_ptr(n_name, 1);
   44522 
   44523         ret_val = xmlTextWriterStartElement(writer, (const xmlChar *)name);
   44524         desret_int(ret_val);
   44525         call_tests++;
   44526         des_xmlTextWriterPtr(n_writer, writer, 0);
   44527         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
   44528         xmlResetLastError();
   44529         if (mem_base != xmlMemBlocks()) {
   44530             printf("Leak of %d blocks found in xmlTextWriterStartElement",
   44531 	           xmlMemBlocks() - mem_base);
   44532 	    test_ret++;
   44533             printf(" %d", n_writer);
   44534             printf(" %d", n_name);
   44535             printf("\n");
   44536         }
   44537     }
   44538     }
   44539     function_tests++;
   44540 #endif
   44541 
   44542     return(test_ret);
   44543 }
   44544 
   44545 
   44546 static int
   44547 test_xmlTextWriterStartElementNS(void) {
   44548     int test_ret = 0;
   44549 
   44550 #if defined(LIBXML_WRITER_ENABLED)
   44551     int mem_base;
   44552     int ret_val;
   44553     xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
   44554     int n_writer;
   44555     xmlChar * prefix; /* namespace prefix or NULL */
   44556     int n_prefix;
   44557     xmlChar * name; /* element local name */
   44558     int n_name;
   44559     xmlChar * namespaceURI; /* namespace URI or NULL */
   44560     int n_namespaceURI;
   44561 
   44562     for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
   44563     for (n_prefix = 0;n_prefix < gen_nb_const_xmlChar_ptr;n_prefix++) {
   44564     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
   44565     for (n_namespaceURI = 0;n_namespaceURI < gen_nb_const_xmlChar_ptr;n_namespaceURI++) {
   44566         mem_base = xmlMemBlocks();
   44567         writer = gen_xmlTextWriterPtr(n_writer, 0);
   44568         prefix = gen_const_xmlChar_ptr(n_prefix, 1);
   44569         name = gen_const_xmlChar_ptr(n_name, 2);
   44570         namespaceURI = gen_const_xmlChar_ptr(n_namespaceURI, 3);
   44571 
   44572         ret_val = xmlTextWriterStartElementNS(writer, (const xmlChar *)prefix, (const xmlChar *)name, (const xmlChar *)namespaceURI);
   44573         desret_int(ret_val);
   44574         call_tests++;
   44575         des_xmlTextWriterPtr(n_writer, writer, 0);
   44576         des_const_xmlChar_ptr(n_prefix, (const xmlChar *)prefix, 1);
   44577         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 2);
   44578         des_const_xmlChar_ptr(n_namespaceURI, (const xmlChar *)namespaceURI, 3);
   44579         xmlResetLastError();
   44580         if (mem_base != xmlMemBlocks()) {
   44581             printf("Leak of %d blocks found in xmlTextWriterStartElementNS",
   44582 	           xmlMemBlocks() - mem_base);
   44583 	    test_ret++;
   44584             printf(" %d", n_writer);
   44585             printf(" %d", n_prefix);
   44586             printf(" %d", n_name);
   44587             printf(" %d", n_namespaceURI);
   44588             printf("\n");
   44589         }
   44590     }
   44591     }
   44592     }
   44593     }
   44594     function_tests++;
   44595 #endif
   44596 
   44597     return(test_ret);
   44598 }
   44599 
   44600 
   44601 static int
   44602 test_xmlTextWriterStartPI(void) {
   44603     int test_ret = 0;
   44604 
   44605 #if defined(LIBXML_WRITER_ENABLED)
   44606     int mem_base;
   44607     int ret_val;
   44608     xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
   44609     int n_writer;
   44610     xmlChar * target; /* PI target */
   44611     int n_target;
   44612 
   44613     for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
   44614     for (n_target = 0;n_target < gen_nb_const_xmlChar_ptr;n_target++) {
   44615         mem_base = xmlMemBlocks();
   44616         writer = gen_xmlTextWriterPtr(n_writer, 0);
   44617         target = gen_const_xmlChar_ptr(n_target, 1);
   44618 
   44619         ret_val = xmlTextWriterStartPI(writer, (const xmlChar *)target);
   44620         desret_int(ret_val);
   44621         call_tests++;
   44622         des_xmlTextWriterPtr(n_writer, writer, 0);
   44623         des_const_xmlChar_ptr(n_target, (const xmlChar *)target, 1);
   44624         xmlResetLastError();
   44625         if (mem_base != xmlMemBlocks()) {
   44626             printf("Leak of %d blocks found in xmlTextWriterStartPI",
   44627 	           xmlMemBlocks() - mem_base);
   44628 	    test_ret++;
   44629             printf(" %d", n_writer);
   44630             printf(" %d", n_target);
   44631             printf("\n");
   44632         }
   44633     }
   44634     }
   44635     function_tests++;
   44636 #endif
   44637 
   44638     return(test_ret);
   44639 }
   44640 
   44641 
   44642 static int
   44643 test_xmlTextWriterWriteAttribute(void) {
   44644     int test_ret = 0;
   44645 
   44646 #if defined(LIBXML_WRITER_ENABLED)
   44647     int mem_base;
   44648     int ret_val;
   44649     xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
   44650     int n_writer;
   44651     xmlChar * name; /* attribute name */
   44652     int n_name;
   44653     xmlChar * content; /* attribute content */
   44654     int n_content;
   44655 
   44656     for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
   44657     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
   44658     for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
   44659         mem_base = xmlMemBlocks();
   44660         writer = gen_xmlTextWriterPtr(n_writer, 0);
   44661         name = gen_const_xmlChar_ptr(n_name, 1);
   44662         content = gen_const_xmlChar_ptr(n_content, 2);
   44663 
   44664         ret_val = xmlTextWriterWriteAttribute(writer, (const xmlChar *)name, (const xmlChar *)content);
   44665         desret_int(ret_val);
   44666         call_tests++;
   44667         des_xmlTextWriterPtr(n_writer, writer, 0);
   44668         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
   44669         des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 2);
   44670         xmlResetLastError();
   44671         if (mem_base != xmlMemBlocks()) {
   44672             printf("Leak of %d blocks found in xmlTextWriterWriteAttribute",
   44673 	           xmlMemBlocks() - mem_base);
   44674 	    test_ret++;
   44675             printf(" %d", n_writer);
   44676             printf(" %d", n_name);
   44677             printf(" %d", n_content);
   44678             printf("\n");
   44679         }
   44680     }
   44681     }
   44682     }
   44683     function_tests++;
   44684 #endif
   44685 
   44686     return(test_ret);
   44687 }
   44688 
   44689 
   44690 static int
   44691 test_xmlTextWriterWriteAttributeNS(void) {
   44692     int test_ret = 0;
   44693 
   44694 #if defined(LIBXML_WRITER_ENABLED)
   44695     int mem_base;
   44696     int ret_val;
   44697     xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
   44698     int n_writer;
   44699     xmlChar * prefix; /* namespace prefix */
   44700     int n_prefix;
   44701     xmlChar * name; /* attribute local name */
   44702     int n_name;
   44703     xmlChar * namespaceURI; /* namespace URI */
   44704     int n_namespaceURI;
   44705     xmlChar * content; /* attribute content */
   44706     int n_content;
   44707 
   44708     for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
   44709     for (n_prefix = 0;n_prefix < gen_nb_const_xmlChar_ptr;n_prefix++) {
   44710     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
   44711     for (n_namespaceURI = 0;n_namespaceURI < gen_nb_const_xmlChar_ptr;n_namespaceURI++) {
   44712     for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
   44713         mem_base = xmlMemBlocks();
   44714         writer = gen_xmlTextWriterPtr(n_writer, 0);
   44715         prefix = gen_const_xmlChar_ptr(n_prefix, 1);
   44716         name = gen_const_xmlChar_ptr(n_name, 2);
   44717         namespaceURI = gen_const_xmlChar_ptr(n_namespaceURI, 3);
   44718         content = gen_const_xmlChar_ptr(n_content, 4);
   44719 
   44720         ret_val = xmlTextWriterWriteAttributeNS(writer, (const xmlChar *)prefix, (const xmlChar *)name, (const xmlChar *)namespaceURI, (const xmlChar *)content);
   44721         desret_int(ret_val);
   44722         call_tests++;
   44723         des_xmlTextWriterPtr(n_writer, writer, 0);
   44724         des_const_xmlChar_ptr(n_prefix, (const xmlChar *)prefix, 1);
   44725         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 2);
   44726         des_const_xmlChar_ptr(n_namespaceURI, (const xmlChar *)namespaceURI, 3);
   44727         des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 4);
   44728         xmlResetLastError();
   44729         if (mem_base != xmlMemBlocks()) {
   44730             printf("Leak of %d blocks found in xmlTextWriterWriteAttributeNS",
   44731 	           xmlMemBlocks() - mem_base);
   44732 	    test_ret++;
   44733             printf(" %d", n_writer);
   44734             printf(" %d", n_prefix);
   44735             printf(" %d", n_name);
   44736             printf(" %d", n_namespaceURI);
   44737             printf(" %d", n_content);
   44738             printf("\n");
   44739         }
   44740     }
   44741     }
   44742     }
   44743     }
   44744     }
   44745     function_tests++;
   44746 #endif
   44747 
   44748     return(test_ret);
   44749 }
   44750 
   44751 
   44752 static int
   44753 test_xmlTextWriterWriteBase64(void) {
   44754     int test_ret = 0;
   44755 
   44756 #if defined(LIBXML_WRITER_ENABLED)
   44757     int mem_base;
   44758     int ret_val;
   44759     xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
   44760     int n_writer;
   44761     char * data; /* binary data */
   44762     int n_data;
   44763     int start; /* the position within the data of the first byte to encode */
   44764     int n_start;
   44765     int len; /* the number of bytes to encode */
   44766     int n_len;
   44767 
   44768     for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
   44769     for (n_data = 0;n_data < gen_nb_const_char_ptr;n_data++) {
   44770     for (n_start = 0;n_start < gen_nb_int;n_start++) {
   44771     for (n_len = 0;n_len < gen_nb_int;n_len++) {
   44772         mem_base = xmlMemBlocks();
   44773         writer = gen_xmlTextWriterPtr(n_writer, 0);
   44774         data = gen_const_char_ptr(n_data, 1);
   44775         start = gen_int(n_start, 2);
   44776         len = gen_int(n_len, 3);
   44777         if ((data != NULL) &&
   44778             (start > (int) strlen((const char *) data) + 1))
   44779             continue;
   44780         if ((data != NULL) &&
   44781             (len > (int) strlen((const char *) data) + 1))
   44782             continue;
   44783 
   44784         ret_val = xmlTextWriterWriteBase64(writer, (const char *)data, start, len);
   44785         desret_int(ret_val);
   44786         call_tests++;
   44787         des_xmlTextWriterPtr(n_writer, writer, 0);
   44788         des_const_char_ptr(n_data, (const char *)data, 1);
   44789         des_int(n_start, start, 2);
   44790         des_int(n_len, len, 3);
   44791         xmlResetLastError();
   44792         if (mem_base != xmlMemBlocks()) {
   44793             printf("Leak of %d blocks found in xmlTextWriterWriteBase64",
   44794 	           xmlMemBlocks() - mem_base);
   44795 	    test_ret++;
   44796             printf(" %d", n_writer);
   44797             printf(" %d", n_data);
   44798             printf(" %d", n_start);
   44799             printf(" %d", n_len);
   44800             printf("\n");
   44801         }
   44802     }
   44803     }
   44804     }
   44805     }
   44806     function_tests++;
   44807 #endif
   44808 
   44809     return(test_ret);
   44810 }
   44811 
   44812 
   44813 static int
   44814 test_xmlTextWriterWriteBinHex(void) {
   44815     int test_ret = 0;
   44816 
   44817 #if defined(LIBXML_WRITER_ENABLED)
   44818     int mem_base;
   44819     int ret_val;
   44820     xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
   44821     int n_writer;
   44822     char * data; /* binary data */
   44823     int n_data;
   44824     int start; /* the position within the data of the first byte to encode */
   44825     int n_start;
   44826     int len; /* the number of bytes to encode */
   44827     int n_len;
   44828 
   44829     for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
   44830     for (n_data = 0;n_data < gen_nb_const_char_ptr;n_data++) {
   44831     for (n_start = 0;n_start < gen_nb_int;n_start++) {
   44832     for (n_len = 0;n_len < gen_nb_int;n_len++) {
   44833         mem_base = xmlMemBlocks();
   44834         writer = gen_xmlTextWriterPtr(n_writer, 0);
   44835         data = gen_const_char_ptr(n_data, 1);
   44836         start = gen_int(n_start, 2);
   44837         len = gen_int(n_len, 3);
   44838         if ((data != NULL) &&
   44839             (start > (int) strlen((const char *) data) + 1))
   44840             continue;
   44841         if ((data != NULL) &&
   44842             (len > (int) strlen((const char *) data) + 1))
   44843             continue;
   44844 
   44845         ret_val = xmlTextWriterWriteBinHex(writer, (const char *)data, start, len);
   44846         desret_int(ret_val);
   44847         call_tests++;
   44848         des_xmlTextWriterPtr(n_writer, writer, 0);
   44849         des_const_char_ptr(n_data, (const char *)data, 1);
   44850         des_int(n_start, start, 2);
   44851         des_int(n_len, len, 3);
   44852         xmlResetLastError();
   44853         if (mem_base != xmlMemBlocks()) {
   44854             printf("Leak of %d blocks found in xmlTextWriterWriteBinHex",
   44855 	           xmlMemBlocks() - mem_base);
   44856 	    test_ret++;
   44857             printf(" %d", n_writer);
   44858             printf(" %d", n_data);
   44859             printf(" %d", n_start);
   44860             printf(" %d", n_len);
   44861             printf("\n");
   44862         }
   44863     }
   44864     }
   44865     }
   44866     }
   44867     function_tests++;
   44868 #endif
   44869 
   44870     return(test_ret);
   44871 }
   44872 
   44873 
   44874 static int
   44875 test_xmlTextWriterWriteCDATA(void) {
   44876     int test_ret = 0;
   44877 
   44878 #if defined(LIBXML_WRITER_ENABLED)
   44879     int mem_base;
   44880     int ret_val;
   44881     xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
   44882     int n_writer;
   44883     xmlChar * content; /* CDATA content */
   44884     int n_content;
   44885 
   44886     for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
   44887     for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
   44888         mem_base = xmlMemBlocks();
   44889         writer = gen_xmlTextWriterPtr(n_writer, 0);
   44890         content = gen_const_xmlChar_ptr(n_content, 1);
   44891 
   44892         ret_val = xmlTextWriterWriteCDATA(writer, (const xmlChar *)content);
   44893         desret_int(ret_val);
   44894         call_tests++;
   44895         des_xmlTextWriterPtr(n_writer, writer, 0);
   44896         des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 1);
   44897         xmlResetLastError();
   44898         if (mem_base != xmlMemBlocks()) {
   44899             printf("Leak of %d blocks found in xmlTextWriterWriteCDATA",
   44900 	           xmlMemBlocks() - mem_base);
   44901 	    test_ret++;
   44902             printf(" %d", n_writer);
   44903             printf(" %d", n_content);
   44904             printf("\n");
   44905         }
   44906     }
   44907     }
   44908     function_tests++;
   44909 #endif
   44910 
   44911     return(test_ret);
   44912 }
   44913 
   44914 
   44915 static int
   44916 test_xmlTextWriterWriteComment(void) {
   44917     int test_ret = 0;
   44918 
   44919 #if defined(LIBXML_WRITER_ENABLED)
   44920     int mem_base;
   44921     int ret_val;
   44922     xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
   44923     int n_writer;
   44924     xmlChar * content; /* comment string */
   44925     int n_content;
   44926 
   44927     for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
   44928     for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
   44929         mem_base = xmlMemBlocks();
   44930         writer = gen_xmlTextWriterPtr(n_writer, 0);
   44931         content = gen_const_xmlChar_ptr(n_content, 1);
   44932 
   44933         ret_val = xmlTextWriterWriteComment(writer, (const xmlChar *)content);
   44934         desret_int(ret_val);
   44935         call_tests++;
   44936         des_xmlTextWriterPtr(n_writer, writer, 0);
   44937         des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 1);
   44938         xmlResetLastError();
   44939         if (mem_base != xmlMemBlocks()) {
   44940             printf("Leak of %d blocks found in xmlTextWriterWriteComment",
   44941 	           xmlMemBlocks() - mem_base);
   44942 	    test_ret++;
   44943             printf(" %d", n_writer);
   44944             printf(" %d", n_content);
   44945             printf("\n");
   44946         }
   44947     }
   44948     }
   44949     function_tests++;
   44950 #endif
   44951 
   44952     return(test_ret);
   44953 }
   44954 
   44955 
   44956 static int
   44957 test_xmlTextWriterWriteDTD(void) {
   44958     int test_ret = 0;
   44959 
   44960 #if defined(LIBXML_WRITER_ENABLED)
   44961     int mem_base;
   44962     int ret_val;
   44963     xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
   44964     int n_writer;
   44965     xmlChar * name; /* the name of the DTD */
   44966     int n_name;
   44967     xmlChar * pubid; /* the public identifier, which is an alternative to the system identifier */
   44968     int n_pubid;
   44969     xmlChar * sysid; /* the system identifier, which is the URI of the DTD */
   44970     int n_sysid;
   44971     xmlChar * subset; /* string content of the DTD */
   44972     int n_subset;
   44973 
   44974     for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
   44975     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
   44976     for (n_pubid = 0;n_pubid < gen_nb_const_xmlChar_ptr;n_pubid++) {
   44977     for (n_sysid = 0;n_sysid < gen_nb_const_xmlChar_ptr;n_sysid++) {
   44978     for (n_subset = 0;n_subset < gen_nb_const_xmlChar_ptr;n_subset++) {
   44979         mem_base = xmlMemBlocks();
   44980         writer = gen_xmlTextWriterPtr(n_writer, 0);
   44981         name = gen_const_xmlChar_ptr(n_name, 1);
   44982         pubid = gen_const_xmlChar_ptr(n_pubid, 2);
   44983         sysid = gen_const_xmlChar_ptr(n_sysid, 3);
   44984         subset = gen_const_xmlChar_ptr(n_subset, 4);
   44985 
   44986         ret_val = xmlTextWriterWriteDTD(writer, (const xmlChar *)name, (const xmlChar *)pubid, (const xmlChar *)sysid, (const xmlChar *)subset);
   44987         desret_int(ret_val);
   44988         call_tests++;
   44989         des_xmlTextWriterPtr(n_writer, writer, 0);
   44990         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
   44991         des_const_xmlChar_ptr(n_pubid, (const xmlChar *)pubid, 2);
   44992         des_const_xmlChar_ptr(n_sysid, (const xmlChar *)sysid, 3);
   44993         des_const_xmlChar_ptr(n_subset, (const xmlChar *)subset, 4);
   44994         xmlResetLastError();
   44995         if (mem_base != xmlMemBlocks()) {
   44996             printf("Leak of %d blocks found in xmlTextWriterWriteDTD",
   44997 	           xmlMemBlocks() - mem_base);
   44998 	    test_ret++;
   44999             printf(" %d", n_writer);
   45000             printf(" %d", n_name);
   45001             printf(" %d", n_pubid);
   45002             printf(" %d", n_sysid);
   45003             printf(" %d", n_subset);
   45004             printf("\n");
   45005         }
   45006     }
   45007     }
   45008     }
   45009     }
   45010     }
   45011     function_tests++;
   45012 #endif
   45013 
   45014     return(test_ret);
   45015 }
   45016 
   45017 
   45018 static int
   45019 test_xmlTextWriterWriteDTDAttlist(void) {
   45020     int test_ret = 0;
   45021 
   45022 #if defined(LIBXML_WRITER_ENABLED)
   45023     int mem_base;
   45024     int ret_val;
   45025     xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
   45026     int n_writer;
   45027     xmlChar * name; /* the name of the DTD ATTLIST */
   45028     int n_name;
   45029     xmlChar * content; /* content of the ATTLIST */
   45030     int n_content;
   45031 
   45032     for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
   45033     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
   45034     for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
   45035         mem_base = xmlMemBlocks();
   45036         writer = gen_xmlTextWriterPtr(n_writer, 0);
   45037         name = gen_const_xmlChar_ptr(n_name, 1);
   45038         content = gen_const_xmlChar_ptr(n_content, 2);
   45039 
   45040         ret_val = xmlTextWriterWriteDTDAttlist(writer, (const xmlChar *)name, (const xmlChar *)content);
   45041         desret_int(ret_val);
   45042         call_tests++;
   45043         des_xmlTextWriterPtr(n_writer, writer, 0);
   45044         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
   45045         des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 2);
   45046         xmlResetLastError();
   45047         if (mem_base != xmlMemBlocks()) {
   45048             printf("Leak of %d blocks found in xmlTextWriterWriteDTDAttlist",
   45049 	           xmlMemBlocks() - mem_base);
   45050 	    test_ret++;
   45051             printf(" %d", n_writer);
   45052             printf(" %d", n_name);
   45053             printf(" %d", n_content);
   45054             printf("\n");
   45055         }
   45056     }
   45057     }
   45058     }
   45059     function_tests++;
   45060 #endif
   45061 
   45062     return(test_ret);
   45063 }
   45064 
   45065 
   45066 static int
   45067 test_xmlTextWriterWriteDTDElement(void) {
   45068     int test_ret = 0;
   45069 
   45070 #if defined(LIBXML_WRITER_ENABLED)
   45071     int mem_base;
   45072     int ret_val;
   45073     xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
   45074     int n_writer;
   45075     xmlChar * name; /* the name of the DTD element */
   45076     int n_name;
   45077     xmlChar * content; /* content of the element */
   45078     int n_content;
   45079 
   45080     for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
   45081     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
   45082     for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
   45083         mem_base = xmlMemBlocks();
   45084         writer = gen_xmlTextWriterPtr(n_writer, 0);
   45085         name = gen_const_xmlChar_ptr(n_name, 1);
   45086         content = gen_const_xmlChar_ptr(n_content, 2);
   45087 
   45088         ret_val = xmlTextWriterWriteDTDElement(writer, (const xmlChar *)name, (const xmlChar *)content);
   45089         desret_int(ret_val);
   45090         call_tests++;
   45091         des_xmlTextWriterPtr(n_writer, writer, 0);
   45092         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
   45093         des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 2);
   45094         xmlResetLastError();
   45095         if (mem_base != xmlMemBlocks()) {
   45096             printf("Leak of %d blocks found in xmlTextWriterWriteDTDElement",
   45097 	           xmlMemBlocks() - mem_base);
   45098 	    test_ret++;
   45099             printf(" %d", n_writer);
   45100             printf(" %d", n_name);
   45101             printf(" %d", n_content);
   45102             printf("\n");
   45103         }
   45104     }
   45105     }
   45106     }
   45107     function_tests++;
   45108 #endif
   45109 
   45110     return(test_ret);
   45111 }
   45112 
   45113 
   45114 static int
   45115 test_xmlTextWriterWriteDTDEntity(void) {
   45116     int test_ret = 0;
   45117 
   45118 #if defined(LIBXML_WRITER_ENABLED)
   45119     int mem_base;
   45120     int ret_val;
   45121     xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
   45122     int n_writer;
   45123     int pe; /* TRUE if this is a parameter entity, FALSE if not */
   45124     int n_pe;
   45125     xmlChar * name; /* the name of the DTD entity */
   45126     int n_name;
   45127     xmlChar * pubid; /* the public identifier, which is an alternative to the system identifier */
   45128     int n_pubid;
   45129     xmlChar * sysid; /* the system identifier, which is the URI of the DTD */
   45130     int n_sysid;
   45131     xmlChar * ndataid; /* the xml notation name. */
   45132     int n_ndataid;
   45133     xmlChar * content; /* content of the entity */
   45134     int n_content;
   45135 
   45136     for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
   45137     for (n_pe = 0;n_pe < gen_nb_int;n_pe++) {
   45138     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
   45139     for (n_pubid = 0;n_pubid < gen_nb_const_xmlChar_ptr;n_pubid++) {
   45140     for (n_sysid = 0;n_sysid < gen_nb_const_xmlChar_ptr;n_sysid++) {
   45141     for (n_ndataid = 0;n_ndataid < gen_nb_const_xmlChar_ptr;n_ndataid++) {
   45142     for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
   45143         mem_base = xmlMemBlocks();
   45144         writer = gen_xmlTextWriterPtr(n_writer, 0);
   45145         pe = gen_int(n_pe, 1);
   45146         name = gen_const_xmlChar_ptr(n_name, 2);
   45147         pubid = gen_const_xmlChar_ptr(n_pubid, 3);
   45148         sysid = gen_const_xmlChar_ptr(n_sysid, 4);
   45149         ndataid = gen_const_xmlChar_ptr(n_ndataid, 5);
   45150         content = gen_const_xmlChar_ptr(n_content, 6);
   45151 
   45152         ret_val = xmlTextWriterWriteDTDEntity(writer, pe, (const xmlChar *)name, (const xmlChar *)pubid, (const xmlChar *)sysid, (const xmlChar *)ndataid, (const xmlChar *)content);
   45153         desret_int(ret_val);
   45154         call_tests++;
   45155         des_xmlTextWriterPtr(n_writer, writer, 0);
   45156         des_int(n_pe, pe, 1);
   45157         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 2);
   45158         des_const_xmlChar_ptr(n_pubid, (const xmlChar *)pubid, 3);
   45159         des_const_xmlChar_ptr(n_sysid, (const xmlChar *)sysid, 4);
   45160         des_const_xmlChar_ptr(n_ndataid, (const xmlChar *)ndataid, 5);
   45161         des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 6);
   45162         xmlResetLastError();
   45163         if (mem_base != xmlMemBlocks()) {
   45164             printf("Leak of %d blocks found in xmlTextWriterWriteDTDEntity",
   45165 	           xmlMemBlocks() - mem_base);
   45166 	    test_ret++;
   45167             printf(" %d", n_writer);
   45168             printf(" %d", n_pe);
   45169             printf(" %d", n_name);
   45170             printf(" %d", n_pubid);
   45171             printf(" %d", n_sysid);
   45172             printf(" %d", n_ndataid);
   45173             printf(" %d", n_content);
   45174             printf("\n");
   45175         }
   45176     }
   45177     }
   45178     }
   45179     }
   45180     }
   45181     }
   45182     }
   45183     function_tests++;
   45184 #endif
   45185 
   45186     return(test_ret);
   45187 }
   45188 
   45189 
   45190 static int
   45191 test_xmlTextWriterWriteDTDExternalEntity(void) {
   45192     int test_ret = 0;
   45193 
   45194 #if defined(LIBXML_WRITER_ENABLED)
   45195     int mem_base;
   45196     int ret_val;
   45197     xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
   45198     int n_writer;
   45199     int pe; /* TRUE if this is a parameter entity, FALSE if not */
   45200     int n_pe;
   45201     xmlChar * name; /* the name of the DTD entity */
   45202     int n_name;
   45203     xmlChar * pubid; /* the public identifier, which is an alternative to the system identifier */
   45204     int n_pubid;
   45205     xmlChar * sysid; /* the system identifier, which is the URI of the DTD */
   45206     int n_sysid;
   45207     xmlChar * ndataid; /* the xml notation name. */
   45208     int n_ndataid;
   45209 
   45210     for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
   45211     for (n_pe = 0;n_pe < gen_nb_int;n_pe++) {
   45212     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
   45213     for (n_pubid = 0;n_pubid < gen_nb_const_xmlChar_ptr;n_pubid++) {
   45214     for (n_sysid = 0;n_sysid < gen_nb_const_xmlChar_ptr;n_sysid++) {
   45215     for (n_ndataid = 0;n_ndataid < gen_nb_const_xmlChar_ptr;n_ndataid++) {
   45216         mem_base = xmlMemBlocks();
   45217         writer = gen_xmlTextWriterPtr(n_writer, 0);
   45218         pe = gen_int(n_pe, 1);
   45219         name = gen_const_xmlChar_ptr(n_name, 2);
   45220         pubid = gen_const_xmlChar_ptr(n_pubid, 3);
   45221         sysid = gen_const_xmlChar_ptr(n_sysid, 4);
   45222         ndataid = gen_const_xmlChar_ptr(n_ndataid, 5);
   45223 
   45224         ret_val = xmlTextWriterWriteDTDExternalEntity(writer, pe, (const xmlChar *)name, (const xmlChar *)pubid, (const xmlChar *)sysid, (const xmlChar *)ndataid);
   45225         desret_int(ret_val);
   45226         call_tests++;
   45227         des_xmlTextWriterPtr(n_writer, writer, 0);
   45228         des_int(n_pe, pe, 1);
   45229         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 2);
   45230         des_const_xmlChar_ptr(n_pubid, (const xmlChar *)pubid, 3);
   45231         des_const_xmlChar_ptr(n_sysid, (const xmlChar *)sysid, 4);
   45232         des_const_xmlChar_ptr(n_ndataid, (const xmlChar *)ndataid, 5);
   45233         xmlResetLastError();
   45234         if (mem_base != xmlMemBlocks()) {
   45235             printf("Leak of %d blocks found in xmlTextWriterWriteDTDExternalEntity",
   45236 	           xmlMemBlocks() - mem_base);
   45237 	    test_ret++;
   45238             printf(" %d", n_writer);
   45239             printf(" %d", n_pe);
   45240             printf(" %d", n_name);
   45241             printf(" %d", n_pubid);
   45242             printf(" %d", n_sysid);
   45243             printf(" %d", n_ndataid);
   45244             printf("\n");
   45245         }
   45246     }
   45247     }
   45248     }
   45249     }
   45250     }
   45251     }
   45252     function_tests++;
   45253 #endif
   45254 
   45255     return(test_ret);
   45256 }
   45257 
   45258 
   45259 static int
   45260 test_xmlTextWriterWriteDTDExternalEntityContents(void) {
   45261     int test_ret = 0;
   45262 
   45263 #if defined(LIBXML_WRITER_ENABLED)
   45264     int mem_base;
   45265     int ret_val;
   45266     xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
   45267     int n_writer;
   45268     xmlChar * pubid; /* the public identifier, which is an alternative to the system identifier */
   45269     int n_pubid;
   45270     xmlChar * sysid; /* the system identifier, which is the URI of the DTD */
   45271     int n_sysid;
   45272     xmlChar * ndataid; /* the xml notation name. */
   45273     int n_ndataid;
   45274 
   45275     for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
   45276     for (n_pubid = 0;n_pubid < gen_nb_const_xmlChar_ptr;n_pubid++) {
   45277     for (n_sysid = 0;n_sysid < gen_nb_const_xmlChar_ptr;n_sysid++) {
   45278     for (n_ndataid = 0;n_ndataid < gen_nb_const_xmlChar_ptr;n_ndataid++) {
   45279         mem_base = xmlMemBlocks();
   45280         writer = gen_xmlTextWriterPtr(n_writer, 0);
   45281         pubid = gen_const_xmlChar_ptr(n_pubid, 1);
   45282         sysid = gen_const_xmlChar_ptr(n_sysid, 2);
   45283         ndataid = gen_const_xmlChar_ptr(n_ndataid, 3);
   45284 
   45285         ret_val = xmlTextWriterWriteDTDExternalEntityContents(writer, (const xmlChar *)pubid, (const xmlChar *)sysid, (const xmlChar *)ndataid);
   45286         desret_int(ret_val);
   45287         call_tests++;
   45288         des_xmlTextWriterPtr(n_writer, writer, 0);
   45289         des_const_xmlChar_ptr(n_pubid, (const xmlChar *)pubid, 1);
   45290         des_const_xmlChar_ptr(n_sysid, (const xmlChar *)sysid, 2);
   45291         des_const_xmlChar_ptr(n_ndataid, (const xmlChar *)ndataid, 3);
   45292         xmlResetLastError();
   45293         if (mem_base != xmlMemBlocks()) {
   45294             printf("Leak of %d blocks found in xmlTextWriterWriteDTDExternalEntityContents",
   45295 	           xmlMemBlocks() - mem_base);
   45296 	    test_ret++;
   45297             printf(" %d", n_writer);
   45298             printf(" %d", n_pubid);
   45299             printf(" %d", n_sysid);
   45300             printf(" %d", n_ndataid);
   45301             printf("\n");
   45302         }
   45303     }
   45304     }
   45305     }
   45306     }
   45307     function_tests++;
   45308 #endif
   45309 
   45310     return(test_ret);
   45311 }
   45312 
   45313 
   45314 static int
   45315 test_xmlTextWriterWriteDTDInternalEntity(void) {
   45316     int test_ret = 0;
   45317 
   45318 #if defined(LIBXML_WRITER_ENABLED)
   45319     int mem_base;
   45320     int ret_val;
   45321     xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
   45322     int n_writer;
   45323     int pe; /* TRUE if this is a parameter entity, FALSE if not */
   45324     int n_pe;
   45325     xmlChar * name; /* the name of the DTD entity */
   45326     int n_name;
   45327     xmlChar * content; /* content of the entity */
   45328     int n_content;
   45329 
   45330     for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
   45331     for (n_pe = 0;n_pe < gen_nb_int;n_pe++) {
   45332     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
   45333     for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
   45334         mem_base = xmlMemBlocks();
   45335         writer = gen_xmlTextWriterPtr(n_writer, 0);
   45336         pe = gen_int(n_pe, 1);
   45337         name = gen_const_xmlChar_ptr(n_name, 2);
   45338         content = gen_const_xmlChar_ptr(n_content, 3);
   45339 
   45340         ret_val = xmlTextWriterWriteDTDInternalEntity(writer, pe, (const xmlChar *)name, (const xmlChar *)content);
   45341         desret_int(ret_val);
   45342         call_tests++;
   45343         des_xmlTextWriterPtr(n_writer, writer, 0);
   45344         des_int(n_pe, pe, 1);
   45345         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 2);
   45346         des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 3);
   45347         xmlResetLastError();
   45348         if (mem_base != xmlMemBlocks()) {
   45349             printf("Leak of %d blocks found in xmlTextWriterWriteDTDInternalEntity",
   45350 	           xmlMemBlocks() - mem_base);
   45351 	    test_ret++;
   45352             printf(" %d", n_writer);
   45353             printf(" %d", n_pe);
   45354             printf(" %d", n_name);
   45355             printf(" %d", n_content);
   45356             printf("\n");
   45357         }
   45358     }
   45359     }
   45360     }
   45361     }
   45362     function_tests++;
   45363 #endif
   45364 
   45365     return(test_ret);
   45366 }
   45367 
   45368 
   45369 static int
   45370 test_xmlTextWriterWriteDTDNotation(void) {
   45371     int test_ret = 0;
   45372 
   45373 #if defined(LIBXML_WRITER_ENABLED)
   45374     int mem_base;
   45375     int ret_val;
   45376     xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
   45377     int n_writer;
   45378     xmlChar * name; /* the name of the xml notation */
   45379     int n_name;
   45380     xmlChar * pubid; /* the public identifier, which is an alternative to the system identifier */
   45381     int n_pubid;
   45382     xmlChar * sysid; /* the system identifier, which is the URI of the DTD */
   45383     int n_sysid;
   45384 
   45385     for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
   45386     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
   45387     for (n_pubid = 0;n_pubid < gen_nb_const_xmlChar_ptr;n_pubid++) {
   45388     for (n_sysid = 0;n_sysid < gen_nb_const_xmlChar_ptr;n_sysid++) {
   45389         mem_base = xmlMemBlocks();
   45390         writer = gen_xmlTextWriterPtr(n_writer, 0);
   45391         name = gen_const_xmlChar_ptr(n_name, 1);
   45392         pubid = gen_const_xmlChar_ptr(n_pubid, 2);
   45393         sysid = gen_const_xmlChar_ptr(n_sysid, 3);
   45394 
   45395         ret_val = xmlTextWriterWriteDTDNotation(writer, (const xmlChar *)name, (const xmlChar *)pubid, (const xmlChar *)sysid);
   45396         desret_int(ret_val);
   45397         call_tests++;
   45398         des_xmlTextWriterPtr(n_writer, writer, 0);
   45399         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
   45400         des_const_xmlChar_ptr(n_pubid, (const xmlChar *)pubid, 2);
   45401         des_const_xmlChar_ptr(n_sysid, (const xmlChar *)sysid, 3);
   45402         xmlResetLastError();
   45403         if (mem_base != xmlMemBlocks()) {
   45404             printf("Leak of %d blocks found in xmlTextWriterWriteDTDNotation",
   45405 	           xmlMemBlocks() - mem_base);
   45406 	    test_ret++;
   45407             printf(" %d", n_writer);
   45408             printf(" %d", n_name);
   45409             printf(" %d", n_pubid);
   45410             printf(" %d", n_sysid);
   45411             printf("\n");
   45412         }
   45413     }
   45414     }
   45415     }
   45416     }
   45417     function_tests++;
   45418 #endif
   45419 
   45420     return(test_ret);
   45421 }
   45422 
   45423 
   45424 static int
   45425 test_xmlTextWriterWriteElement(void) {
   45426     int test_ret = 0;
   45427 
   45428 #if defined(LIBXML_WRITER_ENABLED)
   45429     int mem_base;
   45430     int ret_val;
   45431     xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
   45432     int n_writer;
   45433     xmlChar * name; /* element name */
   45434     int n_name;
   45435     xmlChar * content; /* element content */
   45436     int n_content;
   45437 
   45438     for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
   45439     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
   45440     for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
   45441         mem_base = xmlMemBlocks();
   45442         writer = gen_xmlTextWriterPtr(n_writer, 0);
   45443         name = gen_const_xmlChar_ptr(n_name, 1);
   45444         content = gen_const_xmlChar_ptr(n_content, 2);
   45445 
   45446         ret_val = xmlTextWriterWriteElement(writer, (const xmlChar *)name, (const xmlChar *)content);
   45447         desret_int(ret_val);
   45448         call_tests++;
   45449         des_xmlTextWriterPtr(n_writer, writer, 0);
   45450         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
   45451         des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 2);
   45452         xmlResetLastError();
   45453         if (mem_base != xmlMemBlocks()) {
   45454             printf("Leak of %d blocks found in xmlTextWriterWriteElement",
   45455 	           xmlMemBlocks() - mem_base);
   45456 	    test_ret++;
   45457             printf(" %d", n_writer);
   45458             printf(" %d", n_name);
   45459             printf(" %d", n_content);
   45460             printf("\n");
   45461         }
   45462     }
   45463     }
   45464     }
   45465     function_tests++;
   45466 #endif
   45467 
   45468     return(test_ret);
   45469 }
   45470 
   45471 
   45472 static int
   45473 test_xmlTextWriterWriteElementNS(void) {
   45474     int test_ret = 0;
   45475 
   45476 #if defined(LIBXML_WRITER_ENABLED)
   45477     int mem_base;
   45478     int ret_val;
   45479     xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
   45480     int n_writer;
   45481     xmlChar * prefix; /* namespace prefix */
   45482     int n_prefix;
   45483     xmlChar * name; /* element local name */
   45484     int n_name;
   45485     xmlChar * namespaceURI; /* namespace URI */
   45486     int n_namespaceURI;
   45487     xmlChar * content; /* element content */
   45488     int n_content;
   45489 
   45490     for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
   45491     for (n_prefix = 0;n_prefix < gen_nb_const_xmlChar_ptr;n_prefix++) {
   45492     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
   45493     for (n_namespaceURI = 0;n_namespaceURI < gen_nb_const_xmlChar_ptr;n_namespaceURI++) {
   45494     for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
   45495         mem_base = xmlMemBlocks();
   45496         writer = gen_xmlTextWriterPtr(n_writer, 0);
   45497         prefix = gen_const_xmlChar_ptr(n_prefix, 1);
   45498         name = gen_const_xmlChar_ptr(n_name, 2);
   45499         namespaceURI = gen_const_xmlChar_ptr(n_namespaceURI, 3);
   45500         content = gen_const_xmlChar_ptr(n_content, 4);
   45501 
   45502         ret_val = xmlTextWriterWriteElementNS(writer, (const xmlChar *)prefix, (const xmlChar *)name, (const xmlChar *)namespaceURI, (const xmlChar *)content);
   45503         desret_int(ret_val);
   45504         call_tests++;
   45505         des_xmlTextWriterPtr(n_writer, writer, 0);
   45506         des_const_xmlChar_ptr(n_prefix, (const xmlChar *)prefix, 1);
   45507         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 2);
   45508         des_const_xmlChar_ptr(n_namespaceURI, (const xmlChar *)namespaceURI, 3);
   45509         des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 4);
   45510         xmlResetLastError();
   45511         if (mem_base != xmlMemBlocks()) {
   45512             printf("Leak of %d blocks found in xmlTextWriterWriteElementNS",
   45513 	           xmlMemBlocks() - mem_base);
   45514 	    test_ret++;
   45515             printf(" %d", n_writer);
   45516             printf(" %d", n_prefix);
   45517             printf(" %d", n_name);
   45518             printf(" %d", n_namespaceURI);
   45519             printf(" %d", n_content);
   45520             printf("\n");
   45521         }
   45522     }
   45523     }
   45524     }
   45525     }
   45526     }
   45527     function_tests++;
   45528 #endif
   45529 
   45530     return(test_ret);
   45531 }
   45532 
   45533 
   45534 static int
   45535 test_xmlTextWriterWriteFormatAttribute(void) {
   45536     int test_ret = 0;
   45537 
   45538 
   45539     /* missing type support */
   45540     return(test_ret);
   45541 }
   45542 
   45543 
   45544 static int
   45545 test_xmlTextWriterWriteFormatAttributeNS(void) {
   45546     int test_ret = 0;
   45547 
   45548 
   45549     /* missing type support */
   45550     return(test_ret);
   45551 }
   45552 
   45553 
   45554 static int
   45555 test_xmlTextWriterWriteFormatCDATA(void) {
   45556     int test_ret = 0;
   45557 
   45558 
   45559     /* missing type support */
   45560     return(test_ret);
   45561 }
   45562 
   45563 
   45564 static int
   45565 test_xmlTextWriterWriteFormatComment(void) {
   45566     int test_ret = 0;
   45567 
   45568 
   45569     /* missing type support */
   45570     return(test_ret);
   45571 }
   45572 
   45573 
   45574 static int
   45575 test_xmlTextWriterWriteFormatDTD(void) {
   45576     int test_ret = 0;
   45577 
   45578 
   45579     /* missing type support */
   45580     return(test_ret);
   45581 }
   45582 
   45583 
   45584 static int
   45585 test_xmlTextWriterWriteFormatDTDAttlist(void) {
   45586     int test_ret = 0;
   45587 
   45588 
   45589     /* missing type support */
   45590     return(test_ret);
   45591 }
   45592 
   45593 
   45594 static int
   45595 test_xmlTextWriterWriteFormatDTDElement(void) {
   45596     int test_ret = 0;
   45597 
   45598 
   45599     /* missing type support */
   45600     return(test_ret);
   45601 }
   45602 
   45603 
   45604 static int
   45605 test_xmlTextWriterWriteFormatDTDInternalEntity(void) {
   45606     int test_ret = 0;
   45607 
   45608 
   45609     /* missing type support */
   45610     return(test_ret);
   45611 }
   45612 
   45613 
   45614 static int
   45615 test_xmlTextWriterWriteFormatElement(void) {
   45616     int test_ret = 0;
   45617 
   45618 
   45619     /* missing type support */
   45620     return(test_ret);
   45621 }
   45622 
   45623 
   45624 static int
   45625 test_xmlTextWriterWriteFormatElementNS(void) {
   45626     int test_ret = 0;
   45627 
   45628 
   45629     /* missing type support */
   45630     return(test_ret);
   45631 }
   45632 
   45633 
   45634 static int
   45635 test_xmlTextWriterWriteFormatPI(void) {
   45636     int test_ret = 0;
   45637 
   45638 
   45639     /* missing type support */
   45640     return(test_ret);
   45641 }
   45642 
   45643 
   45644 static int
   45645 test_xmlTextWriterWriteFormatRaw(void) {
   45646     int test_ret = 0;
   45647 
   45648 
   45649     /* missing type support */
   45650     return(test_ret);
   45651 }
   45652 
   45653 
   45654 static int
   45655 test_xmlTextWriterWriteFormatString(void) {
   45656     int test_ret = 0;
   45657 
   45658 
   45659     /* missing type support */
   45660     return(test_ret);
   45661 }
   45662 
   45663 
   45664 static int
   45665 test_xmlTextWriterWritePI(void) {
   45666     int test_ret = 0;
   45667 
   45668 #if defined(LIBXML_WRITER_ENABLED)
   45669     int mem_base;
   45670     int ret_val;
   45671     xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
   45672     int n_writer;
   45673     xmlChar * target; /* PI target */
   45674     int n_target;
   45675     xmlChar * content; /* PI content */
   45676     int n_content;
   45677 
   45678     for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
   45679     for (n_target = 0;n_target < gen_nb_const_xmlChar_ptr;n_target++) {
   45680     for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
   45681         mem_base = xmlMemBlocks();
   45682         writer = gen_xmlTextWriterPtr(n_writer, 0);
   45683         target = gen_const_xmlChar_ptr(n_target, 1);
   45684         content = gen_const_xmlChar_ptr(n_content, 2);
   45685 
   45686         ret_val = xmlTextWriterWritePI(writer, (const xmlChar *)target, (const xmlChar *)content);
   45687         desret_int(ret_val);
   45688         call_tests++;
   45689         des_xmlTextWriterPtr(n_writer, writer, 0);
   45690         des_const_xmlChar_ptr(n_target, (const xmlChar *)target, 1);
   45691         des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 2);
   45692         xmlResetLastError();
   45693         if (mem_base != xmlMemBlocks()) {
   45694             printf("Leak of %d blocks found in xmlTextWriterWritePI",
   45695 	           xmlMemBlocks() - mem_base);
   45696 	    test_ret++;
   45697             printf(" %d", n_writer);
   45698             printf(" %d", n_target);
   45699             printf(" %d", n_content);
   45700             printf("\n");
   45701         }
   45702     }
   45703     }
   45704     }
   45705     function_tests++;
   45706 #endif
   45707 
   45708     return(test_ret);
   45709 }
   45710 
   45711 
   45712 static int
   45713 test_xmlTextWriterWriteRaw(void) {
   45714     int test_ret = 0;
   45715 
   45716 #if defined(LIBXML_WRITER_ENABLED)
   45717     int mem_base;
   45718     int ret_val;
   45719     xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
   45720     int n_writer;
   45721     xmlChar * content; /* text string */
   45722     int n_content;
   45723 
   45724     for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
   45725     for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
   45726         mem_base = xmlMemBlocks();
   45727         writer = gen_xmlTextWriterPtr(n_writer, 0);
   45728         content = gen_const_xmlChar_ptr(n_content, 1);
   45729 
   45730         ret_val = xmlTextWriterWriteRaw(writer, (const xmlChar *)content);
   45731         desret_int(ret_val);
   45732         call_tests++;
   45733         des_xmlTextWriterPtr(n_writer, writer, 0);
   45734         des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 1);
   45735         xmlResetLastError();
   45736         if (mem_base != xmlMemBlocks()) {
   45737             printf("Leak of %d blocks found in xmlTextWriterWriteRaw",
   45738 	           xmlMemBlocks() - mem_base);
   45739 	    test_ret++;
   45740             printf(" %d", n_writer);
   45741             printf(" %d", n_content);
   45742             printf("\n");
   45743         }
   45744     }
   45745     }
   45746     function_tests++;
   45747 #endif
   45748 
   45749     return(test_ret);
   45750 }
   45751 
   45752 
   45753 static int
   45754 test_xmlTextWriterWriteRawLen(void) {
   45755     int test_ret = 0;
   45756 
   45757 #if defined(LIBXML_WRITER_ENABLED)
   45758     int mem_base;
   45759     int ret_val;
   45760     xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
   45761     int n_writer;
   45762     xmlChar * content; /* text string */
   45763     int n_content;
   45764     int len; /* length of the text string */
   45765     int n_len;
   45766 
   45767     for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
   45768     for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
   45769     for (n_len = 0;n_len < gen_nb_int;n_len++) {
   45770         mem_base = xmlMemBlocks();
   45771         writer = gen_xmlTextWriterPtr(n_writer, 0);
   45772         content = gen_const_xmlChar_ptr(n_content, 1);
   45773         len = gen_int(n_len, 2);
   45774         if ((content != NULL) &&
   45775             (len > (int) strlen((const char *) content) + 1))
   45776             continue;
   45777 
   45778         ret_val = xmlTextWriterWriteRawLen(writer, (const xmlChar *)content, len);
   45779         desret_int(ret_val);
   45780         call_tests++;
   45781         des_xmlTextWriterPtr(n_writer, writer, 0);
   45782         des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 1);
   45783         des_int(n_len, len, 2);
   45784         xmlResetLastError();
   45785         if (mem_base != xmlMemBlocks()) {
   45786             printf("Leak of %d blocks found in xmlTextWriterWriteRawLen",
   45787 	           xmlMemBlocks() - mem_base);
   45788 	    test_ret++;
   45789             printf(" %d", n_writer);
   45790             printf(" %d", n_content);
   45791             printf(" %d", n_len);
   45792             printf("\n");
   45793         }
   45794     }
   45795     }
   45796     }
   45797     function_tests++;
   45798 #endif
   45799 
   45800     return(test_ret);
   45801 }
   45802 
   45803 
   45804 static int
   45805 test_xmlTextWriterWriteString(void) {
   45806     int test_ret = 0;
   45807 
   45808 #if defined(LIBXML_WRITER_ENABLED)
   45809     int mem_base;
   45810     int ret_val;
   45811     xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
   45812     int n_writer;
   45813     xmlChar * content; /* text string */
   45814     int n_content;
   45815 
   45816     for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
   45817     for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
   45818         mem_base = xmlMemBlocks();
   45819         writer = gen_xmlTextWriterPtr(n_writer, 0);
   45820         content = gen_const_xmlChar_ptr(n_content, 1);
   45821 
   45822         ret_val = xmlTextWriterWriteString(writer, (const xmlChar *)content);
   45823         desret_int(ret_val);
   45824         call_tests++;
   45825         des_xmlTextWriterPtr(n_writer, writer, 0);
   45826         des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 1);
   45827         xmlResetLastError();
   45828         if (mem_base != xmlMemBlocks()) {
   45829             printf("Leak of %d blocks found in xmlTextWriterWriteString",
   45830 	           xmlMemBlocks() - mem_base);
   45831 	    test_ret++;
   45832             printf(" %d", n_writer);
   45833             printf(" %d", n_content);
   45834             printf("\n");
   45835         }
   45836     }
   45837     }
   45838     function_tests++;
   45839 #endif
   45840 
   45841     return(test_ret);
   45842 }
   45843 
   45844 
   45845 static int
   45846 test_xmlTextWriterWriteVFormatAttribute(void) {
   45847     int test_ret = 0;
   45848 
   45849 
   45850     /* missing type support */
   45851     return(test_ret);
   45852 }
   45853 
   45854 
   45855 static int
   45856 test_xmlTextWriterWriteVFormatAttributeNS(void) {
   45857     int test_ret = 0;
   45858 
   45859 
   45860     /* missing type support */
   45861     return(test_ret);
   45862 }
   45863 
   45864 
   45865 static int
   45866 test_xmlTextWriterWriteVFormatCDATA(void) {
   45867     int test_ret = 0;
   45868 
   45869 
   45870     /* missing type support */
   45871     return(test_ret);
   45872 }
   45873 
   45874 
   45875 static int
   45876 test_xmlTextWriterWriteVFormatComment(void) {
   45877     int test_ret = 0;
   45878 
   45879 
   45880     /* missing type support */
   45881     return(test_ret);
   45882 }
   45883 
   45884 
   45885 static int
   45886 test_xmlTextWriterWriteVFormatDTD(void) {
   45887     int test_ret = 0;
   45888 
   45889 
   45890     /* missing type support */
   45891     return(test_ret);
   45892 }
   45893 
   45894 
   45895 static int
   45896 test_xmlTextWriterWriteVFormatDTDAttlist(void) {
   45897     int test_ret = 0;
   45898 
   45899 
   45900     /* missing type support */
   45901     return(test_ret);
   45902 }
   45903 
   45904 
   45905 static int
   45906 test_xmlTextWriterWriteVFormatDTDElement(void) {
   45907     int test_ret = 0;
   45908 
   45909 
   45910     /* missing type support */
   45911     return(test_ret);
   45912 }
   45913 
   45914 
   45915 static int
   45916 test_xmlTextWriterWriteVFormatDTDInternalEntity(void) {
   45917     int test_ret = 0;
   45918 
   45919 
   45920     /* missing type support */
   45921     return(test_ret);
   45922 }
   45923 
   45924 
   45925 static int
   45926 test_xmlTextWriterWriteVFormatElement(void) {
   45927     int test_ret = 0;
   45928 
   45929 
   45930     /* missing type support */
   45931     return(test_ret);
   45932 }
   45933 
   45934 
   45935 static int
   45936 test_xmlTextWriterWriteVFormatElementNS(void) {
   45937     int test_ret = 0;
   45938 
   45939 
   45940     /* missing type support */
   45941     return(test_ret);
   45942 }
   45943 
   45944 
   45945 static int
   45946 test_xmlTextWriterWriteVFormatPI(void) {
   45947     int test_ret = 0;
   45948 
   45949 
   45950     /* missing type support */
   45951     return(test_ret);
   45952 }
   45953 
   45954 
   45955 static int
   45956 test_xmlTextWriterWriteVFormatRaw(void) {
   45957     int test_ret = 0;
   45958 
   45959 
   45960     /* missing type support */
   45961     return(test_ret);
   45962 }
   45963 
   45964 
   45965 static int
   45966 test_xmlTextWriterWriteVFormatString(void) {
   45967     int test_ret = 0;
   45968 
   45969 
   45970     /* missing type support */
   45971     return(test_ret);
   45972 }
   45973 
   45974 static int
   45975 test_xmlwriter(void) {
   45976     int test_ret = 0;
   45977 
   45978     if (quiet == 0) printf("Testing xmlwriter : 52 of 80 functions ...\n");
   45979     test_ret += test_xmlNewTextWriter();
   45980     test_ret += test_xmlNewTextWriterFilename();
   45981     test_ret += test_xmlNewTextWriterMemory();
   45982     test_ret += test_xmlNewTextWriterPushParser();
   45983     test_ret += test_xmlNewTextWriterTree();
   45984     test_ret += test_xmlTextWriterEndAttribute();
   45985     test_ret += test_xmlTextWriterEndCDATA();
   45986     test_ret += test_xmlTextWriterEndComment();
   45987     test_ret += test_xmlTextWriterEndDTD();
   45988     test_ret += test_xmlTextWriterEndDTDAttlist();
   45989     test_ret += test_xmlTextWriterEndDTDElement();
   45990     test_ret += test_xmlTextWriterEndDTDEntity();
   45991     test_ret += test_xmlTextWriterEndDocument();
   45992     test_ret += test_xmlTextWriterEndElement();
   45993     test_ret += test_xmlTextWriterEndPI();
   45994     test_ret += test_xmlTextWriterFlush();
   45995     test_ret += test_xmlTextWriterFullEndElement();
   45996     test_ret += test_xmlTextWriterSetIndent();
   45997     test_ret += test_xmlTextWriterSetIndentString();
   45998     test_ret += test_xmlTextWriterSetQuoteChar();
   45999     test_ret += test_xmlTextWriterStartAttribute();
   46000     test_ret += test_xmlTextWriterStartAttributeNS();
   46001     test_ret += test_xmlTextWriterStartCDATA();
   46002     test_ret += test_xmlTextWriterStartComment();
   46003     test_ret += test_xmlTextWriterStartDTD();
   46004     test_ret += test_xmlTextWriterStartDTDAttlist();
   46005     test_ret += test_xmlTextWriterStartDTDElement();
   46006     test_ret += test_xmlTextWriterStartDTDEntity();
   46007     test_ret += test_xmlTextWriterStartDocument();
   46008     test_ret += test_xmlTextWriterStartElement();
   46009     test_ret += test_xmlTextWriterStartElementNS();
   46010     test_ret += test_xmlTextWriterStartPI();
   46011     test_ret += test_xmlTextWriterWriteAttribute();
   46012     test_ret += test_xmlTextWriterWriteAttributeNS();
   46013     test_ret += test_xmlTextWriterWriteBase64();
   46014     test_ret += test_xmlTextWriterWriteBinHex();
   46015     test_ret += test_xmlTextWriterWriteCDATA();
   46016     test_ret += test_xmlTextWriterWriteComment();
   46017     test_ret += test_xmlTextWriterWriteDTD();
   46018     test_ret += test_xmlTextWriterWriteDTDAttlist();
   46019     test_ret += test_xmlTextWriterWriteDTDElement();
   46020     test_ret += test_xmlTextWriterWriteDTDEntity();
   46021     test_ret += test_xmlTextWriterWriteDTDExternalEntity();
   46022     test_ret += test_xmlTextWriterWriteDTDExternalEntityContents();
   46023     test_ret += test_xmlTextWriterWriteDTDInternalEntity();
   46024     test_ret += test_xmlTextWriterWriteDTDNotation();
   46025     test_ret += test_xmlTextWriterWriteElement();
   46026     test_ret += test_xmlTextWriterWriteElementNS();
   46027     test_ret += test_xmlTextWriterWriteFormatAttribute();
   46028     test_ret += test_xmlTextWriterWriteFormatAttributeNS();
   46029     test_ret += test_xmlTextWriterWriteFormatCDATA();
   46030     test_ret += test_xmlTextWriterWriteFormatComment();
   46031     test_ret += test_xmlTextWriterWriteFormatDTD();
   46032     test_ret += test_xmlTextWriterWriteFormatDTDAttlist();
   46033     test_ret += test_xmlTextWriterWriteFormatDTDElement();
   46034     test_ret += test_xmlTextWriterWriteFormatDTDInternalEntity();
   46035     test_ret += test_xmlTextWriterWriteFormatElement();
   46036     test_ret += test_xmlTextWriterWriteFormatElementNS();
   46037     test_ret += test_xmlTextWriterWriteFormatPI();
   46038     test_ret += test_xmlTextWriterWriteFormatRaw();
   46039     test_ret += test_xmlTextWriterWriteFormatString();
   46040     test_ret += test_xmlTextWriterWritePI();
   46041     test_ret += test_xmlTextWriterWriteRaw();
   46042     test_ret += test_xmlTextWriterWriteRawLen();
   46043     test_ret += test_xmlTextWriterWriteString();
   46044     test_ret += test_xmlTextWriterWriteVFormatAttribute();
   46045     test_ret += test_xmlTextWriterWriteVFormatAttributeNS();
   46046     test_ret += test_xmlTextWriterWriteVFormatCDATA();
   46047     test_ret += test_xmlTextWriterWriteVFormatComment();
   46048     test_ret += test_xmlTextWriterWriteVFormatDTD();
   46049     test_ret += test_xmlTextWriterWriteVFormatDTDAttlist();
   46050     test_ret += test_xmlTextWriterWriteVFormatDTDElement();
   46051     test_ret += test_xmlTextWriterWriteVFormatDTDInternalEntity();
   46052     test_ret += test_xmlTextWriterWriteVFormatElement();
   46053     test_ret += test_xmlTextWriterWriteVFormatElementNS();
   46054     test_ret += test_xmlTextWriterWriteVFormatPI();
   46055     test_ret += test_xmlTextWriterWriteVFormatRaw();
   46056     test_ret += test_xmlTextWriterWriteVFormatString();
   46057 
   46058     if (test_ret != 0)
   46059 	printf("Module xmlwriter: %d errors\n", test_ret);
   46060     return(test_ret);
   46061 }
   46062 
   46063 static int
   46064 test_xmlXPathCastBooleanToNumber(void) {
   46065     int test_ret = 0;
   46066 
   46067 #if defined(LIBXML_XPATH_ENABLED)
   46068     int mem_base;
   46069     double ret_val;
   46070     int val; /* a boolean */
   46071     int n_val;
   46072 
   46073     for (n_val = 0;n_val < gen_nb_int;n_val++) {
   46074         mem_base = xmlMemBlocks();
   46075         val = gen_int(n_val, 0);
   46076 
   46077         ret_val = xmlXPathCastBooleanToNumber(val);
   46078         desret_double(ret_val);
   46079         call_tests++;
   46080         des_int(n_val, val, 0);
   46081         xmlResetLastError();
   46082         if (mem_base != xmlMemBlocks()) {
   46083             printf("Leak of %d blocks found in xmlXPathCastBooleanToNumber",
   46084 	           xmlMemBlocks() - mem_base);
   46085 	    test_ret++;
   46086             printf(" %d", n_val);
   46087             printf("\n");
   46088         }
   46089     }
   46090     function_tests++;
   46091 #endif
   46092 
   46093     return(test_ret);
   46094 }
   46095 
   46096 
   46097 static int
   46098 test_xmlXPathCastBooleanToString(void) {
   46099     int test_ret = 0;
   46100 
   46101 #if defined(LIBXML_XPATH_ENABLED)
   46102     int mem_base;
   46103     xmlChar * ret_val;
   46104     int val; /* a boolean */
   46105     int n_val;
   46106 
   46107     for (n_val = 0;n_val < gen_nb_int;n_val++) {
   46108         mem_base = xmlMemBlocks();
   46109         val = gen_int(n_val, 0);
   46110 
   46111         ret_val = xmlXPathCastBooleanToString(val);
   46112         desret_xmlChar_ptr(ret_val);
   46113         call_tests++;
   46114         des_int(n_val, val, 0);
   46115         xmlResetLastError();
   46116         if (mem_base != xmlMemBlocks()) {
   46117             printf("Leak of %d blocks found in xmlXPathCastBooleanToString",
   46118 	           xmlMemBlocks() - mem_base);
   46119 	    test_ret++;
   46120             printf(" %d", n_val);
   46121             printf("\n");
   46122         }
   46123     }
   46124     function_tests++;
   46125 #endif
   46126 
   46127     return(test_ret);
   46128 }
   46129 
   46130 
   46131 static int
   46132 test_xmlXPathCastNodeSetToBoolean(void) {
   46133     int test_ret = 0;
   46134 
   46135 #if defined(LIBXML_XPATH_ENABLED)
   46136     int mem_base;
   46137     int ret_val;
   46138     xmlNodeSetPtr ns; /* a node-set */
   46139     int n_ns;
   46140 
   46141     for (n_ns = 0;n_ns < gen_nb_xmlNodeSetPtr;n_ns++) {
   46142         mem_base = xmlMemBlocks();
   46143         ns = gen_xmlNodeSetPtr(n_ns, 0);
   46144 
   46145         ret_val = xmlXPathCastNodeSetToBoolean(ns);
   46146         desret_int(ret_val);
   46147         call_tests++;
   46148         des_xmlNodeSetPtr(n_ns, ns, 0);
   46149         xmlResetLastError();
   46150         if (mem_base != xmlMemBlocks()) {
   46151             printf("Leak of %d blocks found in xmlXPathCastNodeSetToBoolean",
   46152 	           xmlMemBlocks() - mem_base);
   46153 	    test_ret++;
   46154             printf(" %d", n_ns);
   46155             printf("\n");
   46156         }
   46157     }
   46158     function_tests++;
   46159 #endif
   46160 
   46161     return(test_ret);
   46162 }
   46163 
   46164 
   46165 static int
   46166 test_xmlXPathCastNodeSetToNumber(void) {
   46167     int test_ret = 0;
   46168 
   46169 #if defined(LIBXML_XPATH_ENABLED)
   46170     int mem_base;
   46171     double ret_val;
   46172     xmlNodeSetPtr ns; /* a node-set */
   46173     int n_ns;
   46174 
   46175     for (n_ns = 0;n_ns < gen_nb_xmlNodeSetPtr;n_ns++) {
   46176         mem_base = xmlMemBlocks();
   46177         ns = gen_xmlNodeSetPtr(n_ns, 0);
   46178 
   46179         ret_val = xmlXPathCastNodeSetToNumber(ns);
   46180         desret_double(ret_val);
   46181         call_tests++;
   46182         des_xmlNodeSetPtr(n_ns, ns, 0);
   46183         xmlResetLastError();
   46184         if (mem_base != xmlMemBlocks()) {
   46185             printf("Leak of %d blocks found in xmlXPathCastNodeSetToNumber",
   46186 	           xmlMemBlocks() - mem_base);
   46187 	    test_ret++;
   46188             printf(" %d", n_ns);
   46189             printf("\n");
   46190         }
   46191     }
   46192     function_tests++;
   46193 #endif
   46194 
   46195     return(test_ret);
   46196 }
   46197 
   46198 
   46199 static int
   46200 test_xmlXPathCastNodeSetToString(void) {
   46201     int test_ret = 0;
   46202 
   46203 #if defined(LIBXML_XPATH_ENABLED)
   46204     int mem_base;
   46205     xmlChar * ret_val;
   46206     xmlNodeSetPtr ns; /* a node-set */
   46207     int n_ns;
   46208 
   46209     for (n_ns = 0;n_ns < gen_nb_xmlNodeSetPtr;n_ns++) {
   46210         mem_base = xmlMemBlocks();
   46211         ns = gen_xmlNodeSetPtr(n_ns, 0);
   46212 
   46213         ret_val = xmlXPathCastNodeSetToString(ns);
   46214         desret_xmlChar_ptr(ret_val);
   46215         call_tests++;
   46216         des_xmlNodeSetPtr(n_ns, ns, 0);
   46217         xmlResetLastError();
   46218         if (mem_base != xmlMemBlocks()) {
   46219             printf("Leak of %d blocks found in xmlXPathCastNodeSetToString",
   46220 	           xmlMemBlocks() - mem_base);
   46221 	    test_ret++;
   46222             printf(" %d", n_ns);
   46223             printf("\n");
   46224         }
   46225     }
   46226     function_tests++;
   46227 #endif
   46228 
   46229     return(test_ret);
   46230 }
   46231 
   46232 
   46233 static int
   46234 test_xmlXPathCastNodeToNumber(void) {
   46235     int test_ret = 0;
   46236 
   46237 #if defined(LIBXML_XPATH_ENABLED)
   46238     int mem_base;
   46239     double ret_val;
   46240     xmlNodePtr node; /* a node */
   46241     int n_node;
   46242 
   46243     for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
   46244         mem_base = xmlMemBlocks();
   46245         node = gen_xmlNodePtr(n_node, 0);
   46246 
   46247         ret_val = xmlXPathCastNodeToNumber(node);
   46248         desret_double(ret_val);
   46249         call_tests++;
   46250         des_xmlNodePtr(n_node, node, 0);
   46251         xmlResetLastError();
   46252         if (mem_base != xmlMemBlocks()) {
   46253             printf("Leak of %d blocks found in xmlXPathCastNodeToNumber",
   46254 	           xmlMemBlocks() - mem_base);
   46255 	    test_ret++;
   46256             printf(" %d", n_node);
   46257             printf("\n");
   46258         }
   46259     }
   46260     function_tests++;
   46261 #endif
   46262 
   46263     return(test_ret);
   46264 }
   46265 
   46266 
   46267 static int
   46268 test_xmlXPathCastNodeToString(void) {
   46269     int test_ret = 0;
   46270 
   46271 #if defined(LIBXML_XPATH_ENABLED)
   46272     int mem_base;
   46273     xmlChar * ret_val;
   46274     xmlNodePtr node; /* a node */
   46275     int n_node;
   46276 
   46277     for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
   46278         mem_base = xmlMemBlocks();
   46279         node = gen_xmlNodePtr(n_node, 0);
   46280 
   46281         ret_val = xmlXPathCastNodeToString(node);
   46282         desret_xmlChar_ptr(ret_val);
   46283         call_tests++;
   46284         des_xmlNodePtr(n_node, node, 0);
   46285         xmlResetLastError();
   46286         if (mem_base != xmlMemBlocks()) {
   46287             printf("Leak of %d blocks found in xmlXPathCastNodeToString",
   46288 	           xmlMemBlocks() - mem_base);
   46289 	    test_ret++;
   46290             printf(" %d", n_node);
   46291             printf("\n");
   46292         }
   46293     }
   46294     function_tests++;
   46295 #endif
   46296 
   46297     return(test_ret);
   46298 }
   46299 
   46300 
   46301 static int
   46302 test_xmlXPathCastNumberToBoolean(void) {
   46303     int test_ret = 0;
   46304 
   46305 #if defined(LIBXML_XPATH_ENABLED)
   46306     int mem_base;
   46307     int ret_val;
   46308     double val; /* a number */
   46309     int n_val;
   46310 
   46311     for (n_val = 0;n_val < gen_nb_double;n_val++) {
   46312         mem_base = xmlMemBlocks();
   46313         val = gen_double(n_val, 0);
   46314 
   46315         ret_val = xmlXPathCastNumberToBoolean(val);
   46316         desret_int(ret_val);
   46317         call_tests++;
   46318         des_double(n_val, val, 0);
   46319         xmlResetLastError();
   46320         if (mem_base != xmlMemBlocks()) {
   46321             printf("Leak of %d blocks found in xmlXPathCastNumberToBoolean",
   46322 	           xmlMemBlocks() - mem_base);
   46323 	    test_ret++;
   46324             printf(" %d", n_val);
   46325             printf("\n");
   46326         }
   46327     }
   46328     function_tests++;
   46329 #endif
   46330 
   46331     return(test_ret);
   46332 }
   46333 
   46334 
   46335 static int
   46336 test_xmlXPathCastNumberToString(void) {
   46337     int test_ret = 0;
   46338 
   46339 #if defined(LIBXML_XPATH_ENABLED)
   46340     int mem_base;
   46341     xmlChar * ret_val;
   46342     double val; /* a number */
   46343     int n_val;
   46344 
   46345     for (n_val = 0;n_val < gen_nb_double;n_val++) {
   46346         mem_base = xmlMemBlocks();
   46347         val = gen_double(n_val, 0);
   46348 
   46349         ret_val = xmlXPathCastNumberToString(val);
   46350         desret_xmlChar_ptr(ret_val);
   46351         call_tests++;
   46352         des_double(n_val, val, 0);
   46353         xmlResetLastError();
   46354         if (mem_base != xmlMemBlocks()) {
   46355             printf("Leak of %d blocks found in xmlXPathCastNumberToString",
   46356 	           xmlMemBlocks() - mem_base);
   46357 	    test_ret++;
   46358             printf(" %d", n_val);
   46359             printf("\n");
   46360         }
   46361     }
   46362     function_tests++;
   46363 #endif
   46364 
   46365     return(test_ret);
   46366 }
   46367 
   46368 
   46369 static int
   46370 test_xmlXPathCastStringToBoolean(void) {
   46371     int test_ret = 0;
   46372 
   46373 #if defined(LIBXML_XPATH_ENABLED)
   46374     int mem_base;
   46375     int ret_val;
   46376     xmlChar * val; /* a string */
   46377     int n_val;
   46378 
   46379     for (n_val = 0;n_val < gen_nb_const_xmlChar_ptr;n_val++) {
   46380         mem_base = xmlMemBlocks();
   46381         val = gen_const_xmlChar_ptr(n_val, 0);
   46382 
   46383         ret_val = xmlXPathCastStringToBoolean((const xmlChar *)val);
   46384         desret_int(ret_val);
   46385         call_tests++;
   46386         des_const_xmlChar_ptr(n_val, (const xmlChar *)val, 0);
   46387         xmlResetLastError();
   46388         if (mem_base != xmlMemBlocks()) {
   46389             printf("Leak of %d blocks found in xmlXPathCastStringToBoolean",
   46390 	           xmlMemBlocks() - mem_base);
   46391 	    test_ret++;
   46392             printf(" %d", n_val);
   46393             printf("\n");
   46394         }
   46395     }
   46396     function_tests++;
   46397 #endif
   46398 
   46399     return(test_ret);
   46400 }
   46401 
   46402 
   46403 static int
   46404 test_xmlXPathCastStringToNumber(void) {
   46405     int test_ret = 0;
   46406 
   46407 #if defined(LIBXML_XPATH_ENABLED)
   46408     int mem_base;
   46409     double ret_val;
   46410     xmlChar * val; /* a string */
   46411     int n_val;
   46412 
   46413     for (n_val = 0;n_val < gen_nb_const_xmlChar_ptr;n_val++) {
   46414         mem_base = xmlMemBlocks();
   46415         val = gen_const_xmlChar_ptr(n_val, 0);
   46416 
   46417         ret_val = xmlXPathCastStringToNumber((const xmlChar *)val);
   46418         desret_double(ret_val);
   46419         call_tests++;
   46420         des_const_xmlChar_ptr(n_val, (const xmlChar *)val, 0);
   46421         xmlResetLastError();
   46422         if (mem_base != xmlMemBlocks()) {
   46423             printf("Leak of %d blocks found in xmlXPathCastStringToNumber",
   46424 	           xmlMemBlocks() - mem_base);
   46425 	    test_ret++;
   46426             printf(" %d", n_val);
   46427             printf("\n");
   46428         }
   46429     }
   46430     function_tests++;
   46431 #endif
   46432 
   46433     return(test_ret);
   46434 }
   46435 
   46436 
   46437 static int
   46438 test_xmlXPathCastToBoolean(void) {
   46439     int test_ret = 0;
   46440 
   46441 #if defined(LIBXML_XPATH_ENABLED)
   46442     int mem_base;
   46443     int ret_val;
   46444     xmlXPathObjectPtr val; /* an XPath object */
   46445     int n_val;
   46446 
   46447     for (n_val = 0;n_val < gen_nb_xmlXPathObjectPtr;n_val++) {
   46448         mem_base = xmlMemBlocks();
   46449         val = gen_xmlXPathObjectPtr(n_val, 0);
   46450 
   46451         ret_val = xmlXPathCastToBoolean(val);
   46452         desret_int(ret_val);
   46453         call_tests++;
   46454         des_xmlXPathObjectPtr(n_val, val, 0);
   46455         xmlResetLastError();
   46456         if (mem_base != xmlMemBlocks()) {
   46457             printf("Leak of %d blocks found in xmlXPathCastToBoolean",
   46458 	           xmlMemBlocks() - mem_base);
   46459 	    test_ret++;
   46460             printf(" %d", n_val);
   46461             printf("\n");
   46462         }
   46463     }
   46464     function_tests++;
   46465 #endif
   46466 
   46467     return(test_ret);
   46468 }
   46469 
   46470 
   46471 static int
   46472 test_xmlXPathCastToNumber(void) {
   46473     int test_ret = 0;
   46474 
   46475 #if defined(LIBXML_XPATH_ENABLED)
   46476     int mem_base;
   46477     double ret_val;
   46478     xmlXPathObjectPtr val; /* an XPath object */
   46479     int n_val;
   46480 
   46481     for (n_val = 0;n_val < gen_nb_xmlXPathObjectPtr;n_val++) {
   46482         mem_base = xmlMemBlocks();
   46483         val = gen_xmlXPathObjectPtr(n_val, 0);
   46484 
   46485         ret_val = xmlXPathCastToNumber(val);
   46486         desret_double(ret_val);
   46487         call_tests++;
   46488         des_xmlXPathObjectPtr(n_val, val, 0);
   46489         xmlResetLastError();
   46490         if (mem_base != xmlMemBlocks()) {
   46491             printf("Leak of %d blocks found in xmlXPathCastToNumber",
   46492 	           xmlMemBlocks() - mem_base);
   46493 	    test_ret++;
   46494             printf(" %d", n_val);
   46495             printf("\n");
   46496         }
   46497     }
   46498     function_tests++;
   46499 #endif
   46500 
   46501     return(test_ret);
   46502 }
   46503 
   46504 
   46505 static int
   46506 test_xmlXPathCastToString(void) {
   46507     int test_ret = 0;
   46508 
   46509 #if defined(LIBXML_XPATH_ENABLED)
   46510     int mem_base;
   46511     xmlChar * ret_val;
   46512     xmlXPathObjectPtr val; /* an XPath object */
   46513     int n_val;
   46514 
   46515     for (n_val = 0;n_val < gen_nb_xmlXPathObjectPtr;n_val++) {
   46516         mem_base = xmlMemBlocks();
   46517         val = gen_xmlXPathObjectPtr(n_val, 0);
   46518 
   46519         ret_val = xmlXPathCastToString(val);
   46520         desret_xmlChar_ptr(ret_val);
   46521         call_tests++;
   46522         des_xmlXPathObjectPtr(n_val, val, 0);
   46523         xmlResetLastError();
   46524         if (mem_base != xmlMemBlocks()) {
   46525             printf("Leak of %d blocks found in xmlXPathCastToString",
   46526 	           xmlMemBlocks() - mem_base);
   46527 	    test_ret++;
   46528             printf(" %d", n_val);
   46529             printf("\n");
   46530         }
   46531     }
   46532     function_tests++;
   46533 #endif
   46534 
   46535     return(test_ret);
   46536 }
   46537 
   46538 
   46539 static int
   46540 test_xmlXPathCmpNodes(void) {
   46541     int test_ret = 0;
   46542 
   46543 #if defined(LIBXML_XPATH_ENABLED)
   46544     int mem_base;
   46545     int ret_val;
   46546     xmlNodePtr node1; /* the first node */
   46547     int n_node1;
   46548     xmlNodePtr node2; /* the second node */
   46549     int n_node2;
   46550 
   46551     for (n_node1 = 0;n_node1 < gen_nb_xmlNodePtr;n_node1++) {
   46552     for (n_node2 = 0;n_node2 < gen_nb_xmlNodePtr;n_node2++) {
   46553         mem_base = xmlMemBlocks();
   46554         node1 = gen_xmlNodePtr(n_node1, 0);
   46555         node2 = gen_xmlNodePtr(n_node2, 1);
   46556 
   46557         ret_val = xmlXPathCmpNodes(node1, node2);
   46558         desret_int(ret_val);
   46559         call_tests++;
   46560         des_xmlNodePtr(n_node1, node1, 0);
   46561         des_xmlNodePtr(n_node2, node2, 1);
   46562         xmlResetLastError();
   46563         if (mem_base != xmlMemBlocks()) {
   46564             printf("Leak of %d blocks found in xmlXPathCmpNodes",
   46565 	           xmlMemBlocks() - mem_base);
   46566 	    test_ret++;
   46567             printf(" %d", n_node1);
   46568             printf(" %d", n_node2);
   46569             printf("\n");
   46570         }
   46571     }
   46572     }
   46573     function_tests++;
   46574 #endif
   46575 
   46576     return(test_ret);
   46577 }
   46578 
   46579 
   46580 static int
   46581 test_xmlXPathCompile(void) {
   46582     int test_ret = 0;
   46583 
   46584 
   46585     /* missing type support */
   46586     return(test_ret);
   46587 }
   46588 
   46589 #ifdef LIBXML_XPATH_ENABLED
   46590 
   46591 #define gen_nb_xmlXPathCompExprPtr 1
   46592 static xmlXPathCompExprPtr gen_xmlXPathCompExprPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
   46593     return(NULL);
   46594 }
   46595 static void des_xmlXPathCompExprPtr(int no ATTRIBUTE_UNUSED, xmlXPathCompExprPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
   46596 }
   46597 #endif
   46598 
   46599 #ifdef LIBXML_XPATH_ENABLED
   46600 
   46601 #define gen_nb_xmlXPathContextPtr 1
   46602 static xmlXPathContextPtr gen_xmlXPathContextPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
   46603     return(NULL);
   46604 }
   46605 static void des_xmlXPathContextPtr(int no ATTRIBUTE_UNUSED, xmlXPathContextPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
   46606 }
   46607 #endif
   46608 
   46609 
   46610 static int
   46611 test_xmlXPathCompiledEval(void) {
   46612     int test_ret = 0;
   46613 
   46614 #if defined(LIBXML_XPATH_ENABLED)
   46615     int mem_base;
   46616     xmlXPathObjectPtr ret_val;
   46617     xmlXPathCompExprPtr comp; /* the compiled XPath expression */
   46618     int n_comp;
   46619     xmlXPathContextPtr ctx; /* the XPath context */
   46620     int n_ctx;
   46621 
   46622     for (n_comp = 0;n_comp < gen_nb_xmlXPathCompExprPtr;n_comp++) {
   46623     for (n_ctx = 0;n_ctx < gen_nb_xmlXPathContextPtr;n_ctx++) {
   46624         mem_base = xmlMemBlocks();
   46625         comp = gen_xmlXPathCompExprPtr(n_comp, 0);
   46626         ctx = gen_xmlXPathContextPtr(n_ctx, 1);
   46627 
   46628         ret_val = xmlXPathCompiledEval(comp, ctx);
   46629         desret_xmlXPathObjectPtr(ret_val);
   46630         call_tests++;
   46631         des_xmlXPathCompExprPtr(n_comp, comp, 0);
   46632         des_xmlXPathContextPtr(n_ctx, ctx, 1);
   46633         xmlResetLastError();
   46634         if (mem_base != xmlMemBlocks()) {
   46635             printf("Leak of %d blocks found in xmlXPathCompiledEval",
   46636 	           xmlMemBlocks() - mem_base);
   46637 	    test_ret++;
   46638             printf(" %d", n_comp);
   46639             printf(" %d", n_ctx);
   46640             printf("\n");
   46641         }
   46642     }
   46643     }
   46644     function_tests++;
   46645 #endif
   46646 
   46647     return(test_ret);
   46648 }
   46649 
   46650 
   46651 static int
   46652 test_xmlXPathCompiledEvalToBoolean(void) {
   46653     int test_ret = 0;
   46654 
   46655 #if defined(LIBXML_XPATH_ENABLED)
   46656     int mem_base;
   46657     int ret_val;
   46658     xmlXPathCompExprPtr comp; /* the compiled XPath expression */
   46659     int n_comp;
   46660     xmlXPathContextPtr ctxt; /* the XPath context */
   46661     int n_ctxt;
   46662 
   46663     for (n_comp = 0;n_comp < gen_nb_xmlXPathCompExprPtr;n_comp++) {
   46664     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathContextPtr;n_ctxt++) {
   46665         mem_base = xmlMemBlocks();
   46666         comp = gen_xmlXPathCompExprPtr(n_comp, 0);
   46667         ctxt = gen_xmlXPathContextPtr(n_ctxt, 1);
   46668 
   46669         ret_val = xmlXPathCompiledEvalToBoolean(comp, ctxt);
   46670         desret_int(ret_val);
   46671         call_tests++;
   46672         des_xmlXPathCompExprPtr(n_comp, comp, 0);
   46673         des_xmlXPathContextPtr(n_ctxt, ctxt, 1);
   46674         xmlResetLastError();
   46675         if (mem_base != xmlMemBlocks()) {
   46676             printf("Leak of %d blocks found in xmlXPathCompiledEvalToBoolean",
   46677 	           xmlMemBlocks() - mem_base);
   46678 	    test_ret++;
   46679             printf(" %d", n_comp);
   46680             printf(" %d", n_ctxt);
   46681             printf("\n");
   46682         }
   46683     }
   46684     }
   46685     function_tests++;
   46686 #endif
   46687 
   46688     return(test_ret);
   46689 }
   46690 
   46691 
   46692 static int
   46693 test_xmlXPathContextSetCache(void) {
   46694     int test_ret = 0;
   46695 
   46696 #if defined(LIBXML_XPATH_ENABLED)
   46697     int mem_base;
   46698     int ret_val;
   46699     xmlXPathContextPtr ctxt; /* the XPath context */
   46700     int n_ctxt;
   46701     int active; /* enables/disables (creates/frees) the cache */
   46702     int n_active;
   46703     int value; /* a value with semantics dependant on @options */
   46704     int n_value;
   46705     int options; /* options (currently only the value 0 is used) */
   46706     int n_options;
   46707 
   46708     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathContextPtr;n_ctxt++) {
   46709     for (n_active = 0;n_active < gen_nb_int;n_active++) {
   46710     for (n_value = 0;n_value < gen_nb_int;n_value++) {
   46711     for (n_options = 0;n_options < gen_nb_int;n_options++) {
   46712         mem_base = xmlMemBlocks();
   46713         ctxt = gen_xmlXPathContextPtr(n_ctxt, 0);
   46714         active = gen_int(n_active, 1);
   46715         value = gen_int(n_value, 2);
   46716         options = gen_int(n_options, 3);
   46717 
   46718         ret_val = xmlXPathContextSetCache(ctxt, active, value, options);
   46719         desret_int(ret_val);
   46720         call_tests++;
   46721         des_xmlXPathContextPtr(n_ctxt, ctxt, 0);
   46722         des_int(n_active, active, 1);
   46723         des_int(n_value, value, 2);
   46724         des_int(n_options, options, 3);
   46725         xmlResetLastError();
   46726         if (mem_base != xmlMemBlocks()) {
   46727             printf("Leak of %d blocks found in xmlXPathContextSetCache",
   46728 	           xmlMemBlocks() - mem_base);
   46729 	    test_ret++;
   46730             printf(" %d", n_ctxt);
   46731             printf(" %d", n_active);
   46732             printf(" %d", n_value);
   46733             printf(" %d", n_options);
   46734             printf("\n");
   46735         }
   46736     }
   46737     }
   46738     }
   46739     }
   46740     function_tests++;
   46741 #endif
   46742 
   46743     return(test_ret);
   46744 }
   46745 
   46746 
   46747 static int
   46748 test_xmlXPathConvertBoolean(void) {
   46749     int test_ret = 0;
   46750 
   46751 #if defined(LIBXML_XPATH_ENABLED)
   46752     int mem_base;
   46753     xmlXPathObjectPtr ret_val;
   46754     xmlXPathObjectPtr val; /* an XPath object */
   46755     int n_val;
   46756 
   46757     for (n_val = 0;n_val < gen_nb_xmlXPathObjectPtr;n_val++) {
   46758         mem_base = xmlMemBlocks();
   46759         val = gen_xmlXPathObjectPtr(n_val, 0);
   46760 
   46761         ret_val = xmlXPathConvertBoolean(val);
   46762         val = NULL;
   46763         desret_xmlXPathObjectPtr(ret_val);
   46764         call_tests++;
   46765         des_xmlXPathObjectPtr(n_val, val, 0);
   46766         xmlResetLastError();
   46767         if (mem_base != xmlMemBlocks()) {
   46768             printf("Leak of %d blocks found in xmlXPathConvertBoolean",
   46769 	           xmlMemBlocks() - mem_base);
   46770 	    test_ret++;
   46771             printf(" %d", n_val);
   46772             printf("\n");
   46773         }
   46774     }
   46775     function_tests++;
   46776 #endif
   46777 
   46778     return(test_ret);
   46779 }
   46780 
   46781 
   46782 static int
   46783 test_xmlXPathConvertNumber(void) {
   46784     int test_ret = 0;
   46785 
   46786 #if defined(LIBXML_XPATH_ENABLED)
   46787     int mem_base;
   46788     xmlXPathObjectPtr ret_val;
   46789     xmlXPathObjectPtr val; /* an XPath object */
   46790     int n_val;
   46791 
   46792     for (n_val = 0;n_val < gen_nb_xmlXPathObjectPtr;n_val++) {
   46793         mem_base = xmlMemBlocks();
   46794         val = gen_xmlXPathObjectPtr(n_val, 0);
   46795 
   46796         ret_val = xmlXPathConvertNumber(val);
   46797         val = NULL;
   46798         desret_xmlXPathObjectPtr(ret_val);
   46799         call_tests++;
   46800         des_xmlXPathObjectPtr(n_val, val, 0);
   46801         xmlResetLastError();
   46802         if (mem_base != xmlMemBlocks()) {
   46803             printf("Leak of %d blocks found in xmlXPathConvertNumber",
   46804 	           xmlMemBlocks() - mem_base);
   46805 	    test_ret++;
   46806             printf(" %d", n_val);
   46807             printf("\n");
   46808         }
   46809     }
   46810     function_tests++;
   46811 #endif
   46812 
   46813     return(test_ret);
   46814 }
   46815 
   46816 
   46817 static int
   46818 test_xmlXPathConvertString(void) {
   46819     int test_ret = 0;
   46820 
   46821 #if defined(LIBXML_XPATH_ENABLED)
   46822     int mem_base;
   46823     xmlXPathObjectPtr ret_val;
   46824     xmlXPathObjectPtr val; /* an XPath object */
   46825     int n_val;
   46826 
   46827     for (n_val = 0;n_val < gen_nb_xmlXPathObjectPtr;n_val++) {
   46828         mem_base = xmlMemBlocks();
   46829         val = gen_xmlXPathObjectPtr(n_val, 0);
   46830 
   46831         ret_val = xmlXPathConvertString(val);
   46832         val = NULL;
   46833         desret_xmlXPathObjectPtr(ret_val);
   46834         call_tests++;
   46835         des_xmlXPathObjectPtr(n_val, val, 0);
   46836         xmlResetLastError();
   46837         if (mem_base != xmlMemBlocks()) {
   46838             printf("Leak of %d blocks found in xmlXPathConvertString",
   46839 	           xmlMemBlocks() - mem_base);
   46840 	    test_ret++;
   46841             printf(" %d", n_val);
   46842             printf("\n");
   46843         }
   46844     }
   46845     function_tests++;
   46846 #endif
   46847 
   46848     return(test_ret);
   46849 }
   46850 
   46851 
   46852 static int
   46853 test_xmlXPathCtxtCompile(void) {
   46854     int test_ret = 0;
   46855 
   46856 
   46857     /* missing type support */
   46858     return(test_ret);
   46859 }
   46860 
   46861 
   46862 static int
   46863 test_xmlXPathEval(void) {
   46864     int test_ret = 0;
   46865 
   46866 #if defined(LIBXML_XPATH_ENABLED)
   46867     int mem_base;
   46868     xmlXPathObjectPtr ret_val;
   46869     xmlChar * str; /* the XPath expression */
   46870     int n_str;
   46871     xmlXPathContextPtr ctx; /* the XPath context */
   46872     int n_ctx;
   46873 
   46874     for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) {
   46875     for (n_ctx = 0;n_ctx < gen_nb_xmlXPathContextPtr;n_ctx++) {
   46876         mem_base = xmlMemBlocks();
   46877         str = gen_const_xmlChar_ptr(n_str, 0);
   46878         ctx = gen_xmlXPathContextPtr(n_ctx, 1);
   46879 
   46880         ret_val = xmlXPathEval((const xmlChar *)str, ctx);
   46881         desret_xmlXPathObjectPtr(ret_val);
   46882         call_tests++;
   46883         des_const_xmlChar_ptr(n_str, (const xmlChar *)str, 0);
   46884         des_xmlXPathContextPtr(n_ctx, ctx, 1);
   46885         xmlResetLastError();
   46886         if (mem_base != xmlMemBlocks()) {
   46887             printf("Leak of %d blocks found in xmlXPathEval",
   46888 	           xmlMemBlocks() - mem_base);
   46889 	    test_ret++;
   46890             printf(" %d", n_str);
   46891             printf(" %d", n_ctx);
   46892             printf("\n");
   46893         }
   46894     }
   46895     }
   46896     function_tests++;
   46897 #endif
   46898 
   46899     return(test_ret);
   46900 }
   46901 
   46902 
   46903 static int
   46904 test_xmlXPathEvalExpression(void) {
   46905     int test_ret = 0;
   46906 
   46907 #if defined(LIBXML_XPATH_ENABLED)
   46908     int mem_base;
   46909     xmlXPathObjectPtr ret_val;
   46910     xmlChar * str; /* the XPath expression */
   46911     int n_str;
   46912     xmlXPathContextPtr ctxt; /* the XPath context */
   46913     int n_ctxt;
   46914 
   46915     for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) {
   46916     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathContextPtr;n_ctxt++) {
   46917         mem_base = xmlMemBlocks();
   46918         str = gen_const_xmlChar_ptr(n_str, 0);
   46919         ctxt = gen_xmlXPathContextPtr(n_ctxt, 1);
   46920 
   46921         ret_val = xmlXPathEvalExpression((const xmlChar *)str, ctxt);
   46922         desret_xmlXPathObjectPtr(ret_val);
   46923         call_tests++;
   46924         des_const_xmlChar_ptr(n_str, (const xmlChar *)str, 0);
   46925         des_xmlXPathContextPtr(n_ctxt, ctxt, 1);
   46926         xmlResetLastError();
   46927         if (mem_base != xmlMemBlocks()) {
   46928             printf("Leak of %d blocks found in xmlXPathEvalExpression",
   46929 	           xmlMemBlocks() - mem_base);
   46930 	    test_ret++;
   46931             printf(" %d", n_str);
   46932             printf(" %d", n_ctxt);
   46933             printf("\n");
   46934         }
   46935     }
   46936     }
   46937     function_tests++;
   46938 #endif
   46939 
   46940     return(test_ret);
   46941 }
   46942 
   46943 
   46944 static int
   46945 test_xmlXPathEvalPredicate(void) {
   46946     int test_ret = 0;
   46947 
   46948 #if defined(LIBXML_XPATH_ENABLED)
   46949     int mem_base;
   46950     int ret_val;
   46951     xmlXPathContextPtr ctxt; /* the XPath context */
   46952     int n_ctxt;
   46953     xmlXPathObjectPtr res; /* the Predicate Expression evaluation result */
   46954     int n_res;
   46955 
   46956     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathContextPtr;n_ctxt++) {
   46957     for (n_res = 0;n_res < gen_nb_xmlXPathObjectPtr;n_res++) {
   46958         mem_base = xmlMemBlocks();
   46959         ctxt = gen_xmlXPathContextPtr(n_ctxt, 0);
   46960         res = gen_xmlXPathObjectPtr(n_res, 1);
   46961 
   46962         ret_val = xmlXPathEvalPredicate(ctxt, res);
   46963         desret_int(ret_val);
   46964         call_tests++;
   46965         des_xmlXPathContextPtr(n_ctxt, ctxt, 0);
   46966         des_xmlXPathObjectPtr(n_res, res, 1);
   46967         xmlResetLastError();
   46968         if (mem_base != xmlMemBlocks()) {
   46969             printf("Leak of %d blocks found in xmlXPathEvalPredicate",
   46970 	           xmlMemBlocks() - mem_base);
   46971 	    test_ret++;
   46972             printf(" %d", n_ctxt);
   46973             printf(" %d", n_res);
   46974             printf("\n");
   46975         }
   46976     }
   46977     }
   46978     function_tests++;
   46979 #endif
   46980 
   46981     return(test_ret);
   46982 }
   46983 
   46984 
   46985 static int
   46986 test_xmlXPathInit(void) {
   46987     int test_ret = 0;
   46988 
   46989 #if defined(LIBXML_XPATH_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED)
   46990     int mem_base;
   46991 
   46992         mem_base = xmlMemBlocks();
   46993 
   46994         xmlXPathInit();
   46995         call_tests++;
   46996         xmlResetLastError();
   46997         if (mem_base != xmlMemBlocks()) {
   46998             printf("Leak of %d blocks found in xmlXPathInit",
   46999 	           xmlMemBlocks() - mem_base);
   47000 	    test_ret++;
   47001             printf("\n");
   47002         }
   47003     function_tests++;
   47004 #endif
   47005 
   47006     return(test_ret);
   47007 }
   47008 
   47009 
   47010 static int
   47011 test_xmlXPathIsInf(void) {
   47012     int test_ret = 0;
   47013 
   47014 #if defined(LIBXML_XPATH_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED)
   47015     int mem_base;
   47016     int ret_val;
   47017     double val; /* a double value */
   47018     int n_val;
   47019 
   47020     for (n_val = 0;n_val < gen_nb_double;n_val++) {
   47021         mem_base = xmlMemBlocks();
   47022         val = gen_double(n_val, 0);
   47023 
   47024         ret_val = xmlXPathIsInf(val);
   47025         desret_int(ret_val);
   47026         call_tests++;
   47027         des_double(n_val, val, 0);
   47028         xmlResetLastError();
   47029         if (mem_base != xmlMemBlocks()) {
   47030             printf("Leak of %d blocks found in xmlXPathIsInf",
   47031 	           xmlMemBlocks() - mem_base);
   47032 	    test_ret++;
   47033             printf(" %d", n_val);
   47034             printf("\n");
   47035         }
   47036     }
   47037     function_tests++;
   47038 #endif
   47039 
   47040     return(test_ret);
   47041 }
   47042 
   47043 
   47044 static int
   47045 test_xmlXPathIsNaN(void) {
   47046     int test_ret = 0;
   47047 
   47048 #if defined(LIBXML_XPATH_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED)
   47049     int mem_base;
   47050     int ret_val;
   47051     double val; /* a double value */
   47052     int n_val;
   47053 
   47054     for (n_val = 0;n_val < gen_nb_double;n_val++) {
   47055         mem_base = xmlMemBlocks();
   47056         val = gen_double(n_val, 0);
   47057 
   47058         ret_val = xmlXPathIsNaN(val);
   47059         desret_int(ret_val);
   47060         call_tests++;
   47061         des_double(n_val, val, 0);
   47062         xmlResetLastError();
   47063         if (mem_base != xmlMemBlocks()) {
   47064             printf("Leak of %d blocks found in xmlXPathIsNaN",
   47065 	           xmlMemBlocks() - mem_base);
   47066 	    test_ret++;
   47067             printf(" %d", n_val);
   47068             printf("\n");
   47069         }
   47070     }
   47071     function_tests++;
   47072 #endif
   47073 
   47074     return(test_ret);
   47075 }
   47076 
   47077 
   47078 static int
   47079 test_xmlXPathNewContext(void) {
   47080     int test_ret = 0;
   47081 
   47082 
   47083     /* missing type support */
   47084     return(test_ret);
   47085 }
   47086 
   47087 
   47088 static int
   47089 test_xmlXPathNodeEval(void) {
   47090     int test_ret = 0;
   47091 
   47092 #if defined(LIBXML_XPATH_ENABLED)
   47093     int mem_base;
   47094     xmlXPathObjectPtr ret_val;
   47095     xmlNodePtr node; /* the node to to use as the context node */
   47096     int n_node;
   47097     xmlChar * str; /* the XPath expression */
   47098     int n_str;
   47099     xmlXPathContextPtr ctx; /* the XPath context */
   47100     int n_ctx;
   47101 
   47102     for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
   47103     for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) {
   47104     for (n_ctx = 0;n_ctx < gen_nb_xmlXPathContextPtr;n_ctx++) {
   47105         mem_base = xmlMemBlocks();
   47106         node = gen_xmlNodePtr(n_node, 0);
   47107         str = gen_const_xmlChar_ptr(n_str, 1);
   47108         ctx = gen_xmlXPathContextPtr(n_ctx, 2);
   47109 
   47110         ret_val = xmlXPathNodeEval(node, (const xmlChar *)str, ctx);
   47111         desret_xmlXPathObjectPtr(ret_val);
   47112         call_tests++;
   47113         des_xmlNodePtr(n_node, node, 0);
   47114         des_const_xmlChar_ptr(n_str, (const xmlChar *)str, 1);
   47115         des_xmlXPathContextPtr(n_ctx, ctx, 2);
   47116         xmlResetLastError();
   47117         if (mem_base != xmlMemBlocks()) {
   47118             printf("Leak of %d blocks found in xmlXPathNodeEval",
   47119 	           xmlMemBlocks() - mem_base);
   47120 	    test_ret++;
   47121             printf(" %d", n_node);
   47122             printf(" %d", n_str);
   47123             printf(" %d", n_ctx);
   47124             printf("\n");
   47125         }
   47126     }
   47127     }
   47128     }
   47129     function_tests++;
   47130 #endif
   47131 
   47132     return(test_ret);
   47133 }
   47134 
   47135 
   47136 static int
   47137 test_xmlXPathNodeSetCreate(void) {
   47138     int test_ret = 0;
   47139 
   47140 #if defined(LIBXML_XPATH_ENABLED)
   47141     int mem_base;
   47142     xmlNodeSetPtr ret_val;
   47143     xmlNodePtr val; /* an initial xmlNodePtr, or NULL */
   47144     int n_val;
   47145 
   47146     for (n_val = 0;n_val < gen_nb_xmlNodePtr;n_val++) {
   47147         mem_base = xmlMemBlocks();
   47148         val = gen_xmlNodePtr(n_val, 0);
   47149 
   47150         ret_val = xmlXPathNodeSetCreate(val);
   47151         desret_xmlNodeSetPtr(ret_val);
   47152         call_tests++;
   47153         des_xmlNodePtr(n_val, val, 0);
   47154         xmlResetLastError();
   47155         if (mem_base != xmlMemBlocks()) {
   47156             printf("Leak of %d blocks found in xmlXPathNodeSetCreate",
   47157 	           xmlMemBlocks() - mem_base);
   47158 	    test_ret++;
   47159             printf(" %d", n_val);
   47160             printf("\n");
   47161         }
   47162     }
   47163     function_tests++;
   47164 #endif
   47165 
   47166     return(test_ret);
   47167 }
   47168 
   47169 
   47170 static int
   47171 test_xmlXPathObjectCopy(void) {
   47172     int test_ret = 0;
   47173 
   47174 #if defined(LIBXML_XPATH_ENABLED)
   47175     int mem_base;
   47176     xmlXPathObjectPtr ret_val;
   47177     xmlXPathObjectPtr val; /* the original object */
   47178     int n_val;
   47179 
   47180     for (n_val = 0;n_val < gen_nb_xmlXPathObjectPtr;n_val++) {
   47181         mem_base = xmlMemBlocks();
   47182         val = gen_xmlXPathObjectPtr(n_val, 0);
   47183 
   47184         ret_val = xmlXPathObjectCopy(val);
   47185         desret_xmlXPathObjectPtr(ret_val);
   47186         call_tests++;
   47187         des_xmlXPathObjectPtr(n_val, val, 0);
   47188         xmlResetLastError();
   47189         if (mem_base != xmlMemBlocks()) {
   47190             printf("Leak of %d blocks found in xmlXPathObjectCopy",
   47191 	           xmlMemBlocks() - mem_base);
   47192 	    test_ret++;
   47193             printf(" %d", n_val);
   47194             printf("\n");
   47195         }
   47196     }
   47197     function_tests++;
   47198 #endif
   47199 
   47200     return(test_ret);
   47201 }
   47202 
   47203 
   47204 static int
   47205 test_xmlXPathOrderDocElems(void) {
   47206     int test_ret = 0;
   47207 
   47208 #if defined(LIBXML_XPATH_ENABLED)
   47209     int mem_base;
   47210     long ret_val;
   47211     xmlDocPtr doc; /* an input document */
   47212     int n_doc;
   47213 
   47214     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
   47215         mem_base = xmlMemBlocks();
   47216         doc = gen_xmlDocPtr(n_doc, 0);
   47217 
   47218         ret_val = xmlXPathOrderDocElems(doc);
   47219         desret_long(ret_val);
   47220         call_tests++;
   47221         des_xmlDocPtr(n_doc, doc, 0);
   47222         xmlResetLastError();
   47223         if (mem_base != xmlMemBlocks()) {
   47224             printf("Leak of %d blocks found in xmlXPathOrderDocElems",
   47225 	           xmlMemBlocks() - mem_base);
   47226 	    test_ret++;
   47227             printf(" %d", n_doc);
   47228             printf("\n");
   47229         }
   47230     }
   47231     function_tests++;
   47232 #endif
   47233 
   47234     return(test_ret);
   47235 }
   47236 
   47237 
   47238 static int
   47239 test_xmlXPathSetContextNode(void) {
   47240     int test_ret = 0;
   47241 
   47242 #if defined(LIBXML_XPATH_ENABLED)
   47243     int mem_base;
   47244     int ret_val;
   47245     xmlNodePtr node; /* the node to to use as the context node */
   47246     int n_node;
   47247     xmlXPathContextPtr ctx; /* the XPath context */
   47248     int n_ctx;
   47249 
   47250     for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
   47251     for (n_ctx = 0;n_ctx < gen_nb_xmlXPathContextPtr;n_ctx++) {
   47252         mem_base = xmlMemBlocks();
   47253         node = gen_xmlNodePtr(n_node, 0);
   47254         ctx = gen_xmlXPathContextPtr(n_ctx, 1);
   47255 
   47256         ret_val = xmlXPathSetContextNode(node, ctx);
   47257         desret_int(ret_val);
   47258         call_tests++;
   47259         des_xmlNodePtr(n_node, node, 0);
   47260         des_xmlXPathContextPtr(n_ctx, ctx, 1);
   47261         xmlResetLastError();
   47262         if (mem_base != xmlMemBlocks()) {
   47263             printf("Leak of %d blocks found in xmlXPathSetContextNode",
   47264 	           xmlMemBlocks() - mem_base);
   47265 	    test_ret++;
   47266             printf(" %d", n_node);
   47267             printf(" %d", n_ctx);
   47268             printf("\n");
   47269         }
   47270     }
   47271     }
   47272     function_tests++;
   47273 #endif
   47274 
   47275     return(test_ret);
   47276 }
   47277 
   47278 static int
   47279 test_xpath(void) {
   47280     int test_ret = 0;
   47281 
   47282     if (quiet == 0) printf("Testing xpath : 32 of 40 functions ...\n");
   47283     test_ret += test_xmlXPathCastBooleanToNumber();
   47284     test_ret += test_xmlXPathCastBooleanToString();
   47285     test_ret += test_xmlXPathCastNodeSetToBoolean();
   47286     test_ret += test_xmlXPathCastNodeSetToNumber();
   47287     test_ret += test_xmlXPathCastNodeSetToString();
   47288     test_ret += test_xmlXPathCastNodeToNumber();
   47289     test_ret += test_xmlXPathCastNodeToString();
   47290     test_ret += test_xmlXPathCastNumberToBoolean();
   47291     test_ret += test_xmlXPathCastNumberToString();
   47292     test_ret += test_xmlXPathCastStringToBoolean();
   47293     test_ret += test_xmlXPathCastStringToNumber();
   47294     test_ret += test_xmlXPathCastToBoolean();
   47295     test_ret += test_xmlXPathCastToNumber();
   47296     test_ret += test_xmlXPathCastToString();
   47297     test_ret += test_xmlXPathCmpNodes();
   47298     test_ret += test_xmlXPathCompile();
   47299     test_ret += test_xmlXPathCompiledEval();
   47300     test_ret += test_xmlXPathCompiledEvalToBoolean();
   47301     test_ret += test_xmlXPathContextSetCache();
   47302     test_ret += test_xmlXPathConvertBoolean();
   47303     test_ret += test_xmlXPathConvertNumber();
   47304     test_ret += test_xmlXPathConvertString();
   47305     test_ret += test_xmlXPathCtxtCompile();
   47306     test_ret += test_xmlXPathEval();
   47307     test_ret += test_xmlXPathEvalExpression();
   47308     test_ret += test_xmlXPathEvalPredicate();
   47309     test_ret += test_xmlXPathInit();
   47310     test_ret += test_xmlXPathIsInf();
   47311     test_ret += test_xmlXPathIsNaN();
   47312     test_ret += test_xmlXPathNewContext();
   47313     test_ret += test_xmlXPathNodeEval();
   47314     test_ret += test_xmlXPathNodeSetCreate();
   47315     test_ret += test_xmlXPathObjectCopy();
   47316     test_ret += test_xmlXPathOrderDocElems();
   47317     test_ret += test_xmlXPathSetContextNode();
   47318 
   47319     if (test_ret != 0)
   47320 	printf("Module xpath: %d errors\n", test_ret);
   47321     return(test_ret);
   47322 }
   47323 #ifdef LIBXML_XPATH_ENABLED
   47324 
   47325 #define gen_nb_xmlXPathParserContextPtr 1
   47326 static xmlXPathParserContextPtr gen_xmlXPathParserContextPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
   47327     return(NULL);
   47328 }
   47329 static void des_xmlXPathParserContextPtr(int no ATTRIBUTE_UNUSED, xmlXPathParserContextPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
   47330 }
   47331 #endif
   47332 
   47333 
   47334 static int
   47335 test_valuePop(void) {
   47336     int test_ret = 0;
   47337 
   47338 #if defined(LIBXML_XPATH_ENABLED)
   47339     int mem_base;
   47340     xmlXPathObjectPtr ret_val;
   47341     xmlXPathParserContextPtr ctxt; /* an XPath evaluation context */
   47342     int n_ctxt;
   47343 
   47344     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
   47345         mem_base = xmlMemBlocks();
   47346         ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
   47347 
   47348         ret_val = valuePop(ctxt);
   47349         desret_xmlXPathObjectPtr(ret_val);
   47350         call_tests++;
   47351         des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
   47352         xmlResetLastError();
   47353         if (mem_base != xmlMemBlocks()) {
   47354             printf("Leak of %d blocks found in valuePop",
   47355 	           xmlMemBlocks() - mem_base);
   47356 	    test_ret++;
   47357             printf(" %d", n_ctxt);
   47358             printf("\n");
   47359         }
   47360     }
   47361     function_tests++;
   47362 #endif
   47363 
   47364     return(test_ret);
   47365 }
   47366 
   47367 
   47368 static int
   47369 test_valuePush(void) {
   47370     int test_ret = 0;
   47371 
   47372 #if defined(LIBXML_XPATH_ENABLED)
   47373     int mem_base;
   47374     int ret_val;
   47375     xmlXPathParserContextPtr ctxt; /* an XPath evaluation context */
   47376     int n_ctxt;
   47377     xmlXPathObjectPtr value; /* the XPath object */
   47378     int n_value;
   47379 
   47380     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
   47381     for (n_value = 0;n_value < gen_nb_xmlXPathObjectPtr;n_value++) {
   47382         mem_base = xmlMemBlocks();
   47383         ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
   47384         value = gen_xmlXPathObjectPtr(n_value, 1);
   47385 
   47386         ret_val = valuePush(ctxt, value);
   47387         desret_int(ret_val);
   47388         call_tests++;
   47389         des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
   47390         des_xmlXPathObjectPtr(n_value, value, 1);
   47391         xmlResetLastError();
   47392         if (mem_base != xmlMemBlocks()) {
   47393             printf("Leak of %d blocks found in valuePush",
   47394 	           xmlMemBlocks() - mem_base);
   47395 	    test_ret++;
   47396             printf(" %d", n_ctxt);
   47397             printf(" %d", n_value);
   47398             printf("\n");
   47399         }
   47400     }
   47401     }
   47402     function_tests++;
   47403 #endif
   47404 
   47405     return(test_ret);
   47406 }
   47407 
   47408 
   47409 static int
   47410 test_xmlXPathAddValues(void) {
   47411     int test_ret = 0;
   47412 
   47413 #if defined(LIBXML_XPATH_ENABLED)
   47414     int mem_base;
   47415     xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
   47416     int n_ctxt;
   47417 
   47418     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
   47419         mem_base = xmlMemBlocks();
   47420         ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
   47421 
   47422         xmlXPathAddValues(ctxt);
   47423         call_tests++;
   47424         des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
   47425         xmlResetLastError();
   47426         if (mem_base != xmlMemBlocks()) {
   47427             printf("Leak of %d blocks found in xmlXPathAddValues",
   47428 	           xmlMemBlocks() - mem_base);
   47429 	    test_ret++;
   47430             printf(" %d", n_ctxt);
   47431             printf("\n");
   47432         }
   47433     }
   47434     function_tests++;
   47435 #endif
   47436 
   47437     return(test_ret);
   47438 }
   47439 
   47440 
   47441 static int
   47442 test_xmlXPathBooleanFunction(void) {
   47443     int test_ret = 0;
   47444 
   47445 #if defined(LIBXML_XPATH_ENABLED)
   47446     int mem_base;
   47447     xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
   47448     int n_ctxt;
   47449     int nargs; /* the number of arguments */
   47450     int n_nargs;
   47451 
   47452     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
   47453     for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
   47454         mem_base = xmlMemBlocks();
   47455         ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
   47456         nargs = gen_int(n_nargs, 1);
   47457 
   47458         xmlXPathBooleanFunction(ctxt, nargs);
   47459         call_tests++;
   47460         des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
   47461         des_int(n_nargs, nargs, 1);
   47462         xmlResetLastError();
   47463         if (mem_base != xmlMemBlocks()) {
   47464             printf("Leak of %d blocks found in xmlXPathBooleanFunction",
   47465 	           xmlMemBlocks() - mem_base);
   47466 	    test_ret++;
   47467             printf(" %d", n_ctxt);
   47468             printf(" %d", n_nargs);
   47469             printf("\n");
   47470         }
   47471     }
   47472     }
   47473     function_tests++;
   47474 #endif
   47475 
   47476     return(test_ret);
   47477 }
   47478 
   47479 
   47480 static int
   47481 test_xmlXPathCeilingFunction(void) {
   47482     int test_ret = 0;
   47483 
   47484 #if defined(LIBXML_XPATH_ENABLED)
   47485     int mem_base;
   47486     xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
   47487     int n_ctxt;
   47488     int nargs; /* the number of arguments */
   47489     int n_nargs;
   47490 
   47491     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
   47492     for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
   47493         mem_base = xmlMemBlocks();
   47494         ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
   47495         nargs = gen_int(n_nargs, 1);
   47496 
   47497         xmlXPathCeilingFunction(ctxt, nargs);
   47498         call_tests++;
   47499         des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
   47500         des_int(n_nargs, nargs, 1);
   47501         xmlResetLastError();
   47502         if (mem_base != xmlMemBlocks()) {
   47503             printf("Leak of %d blocks found in xmlXPathCeilingFunction",
   47504 	           xmlMemBlocks() - mem_base);
   47505 	    test_ret++;
   47506             printf(" %d", n_ctxt);
   47507             printf(" %d", n_nargs);
   47508             printf("\n");
   47509         }
   47510     }
   47511     }
   47512     function_tests++;
   47513 #endif
   47514 
   47515     return(test_ret);
   47516 }
   47517 
   47518 
   47519 static int
   47520 test_xmlXPathCompareValues(void) {
   47521     int test_ret = 0;
   47522 
   47523 #if defined(LIBXML_XPATH_ENABLED)
   47524     int mem_base;
   47525     int ret_val;
   47526     xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
   47527     int n_ctxt;
   47528     int inf; /* less than (1) or greater than (0) */
   47529     int n_inf;
   47530     int strict; /* is the comparison strict */
   47531     int n_strict;
   47532 
   47533     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
   47534     for (n_inf = 0;n_inf < gen_nb_int;n_inf++) {
   47535     for (n_strict = 0;n_strict < gen_nb_int;n_strict++) {
   47536         mem_base = xmlMemBlocks();
   47537         ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
   47538         inf = gen_int(n_inf, 1);
   47539         strict = gen_int(n_strict, 2);
   47540 
   47541         ret_val = xmlXPathCompareValues(ctxt, inf, strict);
   47542         desret_int(ret_val);
   47543         call_tests++;
   47544         des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
   47545         des_int(n_inf, inf, 1);
   47546         des_int(n_strict, strict, 2);
   47547         xmlResetLastError();
   47548         if (mem_base != xmlMemBlocks()) {
   47549             printf("Leak of %d blocks found in xmlXPathCompareValues",
   47550 	           xmlMemBlocks() - mem_base);
   47551 	    test_ret++;
   47552             printf(" %d", n_ctxt);
   47553             printf(" %d", n_inf);
   47554             printf(" %d", n_strict);
   47555             printf("\n");
   47556         }
   47557     }
   47558     }
   47559     }
   47560     function_tests++;
   47561 #endif
   47562 
   47563     return(test_ret);
   47564 }
   47565 
   47566 
   47567 static int
   47568 test_xmlXPathConcatFunction(void) {
   47569     int test_ret = 0;
   47570 
   47571 #if defined(LIBXML_XPATH_ENABLED)
   47572     int mem_base;
   47573     xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
   47574     int n_ctxt;
   47575     int nargs; /* the number of arguments */
   47576     int n_nargs;
   47577 
   47578     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
   47579     for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
   47580         mem_base = xmlMemBlocks();
   47581         ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
   47582         nargs = gen_int(n_nargs, 1);
   47583 
   47584         xmlXPathConcatFunction(ctxt, nargs);
   47585         call_tests++;
   47586         des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
   47587         des_int(n_nargs, nargs, 1);
   47588         xmlResetLastError();
   47589         if (mem_base != xmlMemBlocks()) {
   47590             printf("Leak of %d blocks found in xmlXPathConcatFunction",
   47591 	           xmlMemBlocks() - mem_base);
   47592 	    test_ret++;
   47593             printf(" %d", n_ctxt);
   47594             printf(" %d", n_nargs);
   47595             printf("\n");
   47596         }
   47597     }
   47598     }
   47599     function_tests++;
   47600 #endif
   47601 
   47602     return(test_ret);
   47603 }
   47604 
   47605 
   47606 static int
   47607 test_xmlXPathContainsFunction(void) {
   47608     int test_ret = 0;
   47609 
   47610 #if defined(LIBXML_XPATH_ENABLED)
   47611     int mem_base;
   47612     xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
   47613     int n_ctxt;
   47614     int nargs; /* the number of arguments */
   47615     int n_nargs;
   47616 
   47617     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
   47618     for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
   47619         mem_base = xmlMemBlocks();
   47620         ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
   47621         nargs = gen_int(n_nargs, 1);
   47622 
   47623         xmlXPathContainsFunction(ctxt, nargs);
   47624         call_tests++;
   47625         des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
   47626         des_int(n_nargs, nargs, 1);
   47627         xmlResetLastError();
   47628         if (mem_base != xmlMemBlocks()) {
   47629             printf("Leak of %d blocks found in xmlXPathContainsFunction",
   47630 	           xmlMemBlocks() - mem_base);
   47631 	    test_ret++;
   47632             printf(" %d", n_ctxt);
   47633             printf(" %d", n_nargs);
   47634             printf("\n");
   47635         }
   47636     }
   47637     }
   47638     function_tests++;
   47639 #endif
   47640 
   47641     return(test_ret);
   47642 }
   47643 
   47644 
   47645 static int
   47646 test_xmlXPathCountFunction(void) {
   47647     int test_ret = 0;
   47648 
   47649 #if defined(LIBXML_XPATH_ENABLED)
   47650     int mem_base;
   47651     xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
   47652     int n_ctxt;
   47653     int nargs; /* the number of arguments */
   47654     int n_nargs;
   47655 
   47656     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
   47657     for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
   47658         mem_base = xmlMemBlocks();
   47659         ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
   47660         nargs = gen_int(n_nargs, 1);
   47661 
   47662         xmlXPathCountFunction(ctxt, nargs);
   47663         call_tests++;
   47664         des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
   47665         des_int(n_nargs, nargs, 1);
   47666         xmlResetLastError();
   47667         if (mem_base != xmlMemBlocks()) {
   47668             printf("Leak of %d blocks found in xmlXPathCountFunction",
   47669 	           xmlMemBlocks() - mem_base);
   47670 	    test_ret++;
   47671             printf(" %d", n_ctxt);
   47672             printf(" %d", n_nargs);
   47673             printf("\n");
   47674         }
   47675     }
   47676     }
   47677     function_tests++;
   47678 #endif
   47679 
   47680     return(test_ret);
   47681 }
   47682 
   47683 
   47684 static int
   47685 test_xmlXPathDebugDumpCompExpr(void) {
   47686     int test_ret = 0;
   47687 
   47688 #if defined(LIBXML_XPATH_ENABLED) && defined(LIBXML_DEBUG_ENABLED)
   47689     int mem_base;
   47690     FILE * output; /* the FILE * for the output */
   47691     int n_output;
   47692     xmlXPathCompExprPtr comp; /* the precompiled XPath expression */
   47693     int n_comp;
   47694     int depth; /* the indentation level. */
   47695     int n_depth;
   47696 
   47697     for (n_output = 0;n_output < gen_nb_FILE_ptr;n_output++) {
   47698     for (n_comp = 0;n_comp < gen_nb_xmlXPathCompExprPtr;n_comp++) {
   47699     for (n_depth = 0;n_depth < gen_nb_int;n_depth++) {
   47700         mem_base = xmlMemBlocks();
   47701         output = gen_FILE_ptr(n_output, 0);
   47702         comp = gen_xmlXPathCompExprPtr(n_comp, 1);
   47703         depth = gen_int(n_depth, 2);
   47704 
   47705         xmlXPathDebugDumpCompExpr(output, comp, depth);
   47706         call_tests++;
   47707         des_FILE_ptr(n_output, output, 0);
   47708         des_xmlXPathCompExprPtr(n_comp, comp, 1);
   47709         des_int(n_depth, depth, 2);
   47710         xmlResetLastError();
   47711         if (mem_base != xmlMemBlocks()) {
   47712             printf("Leak of %d blocks found in xmlXPathDebugDumpCompExpr",
   47713 	           xmlMemBlocks() - mem_base);
   47714 	    test_ret++;
   47715             printf(" %d", n_output);
   47716             printf(" %d", n_comp);
   47717             printf(" %d", n_depth);
   47718             printf("\n");
   47719         }
   47720     }
   47721     }
   47722     }
   47723     function_tests++;
   47724 #endif
   47725 
   47726     return(test_ret);
   47727 }
   47728 
   47729 
   47730 static int
   47731 test_xmlXPathDebugDumpObject(void) {
   47732     int test_ret = 0;
   47733 
   47734 #if defined(LIBXML_XPATH_ENABLED) && defined(LIBXML_DEBUG_ENABLED)
   47735     int mem_base;
   47736     FILE * output; /* the FILE * to dump the output */
   47737     int n_output;
   47738     xmlXPathObjectPtr cur; /* the object to inspect */
   47739     int n_cur;
   47740     int depth; /* indentation level */
   47741     int n_depth;
   47742 
   47743     for (n_output = 0;n_output < gen_nb_FILE_ptr;n_output++) {
   47744     for (n_cur = 0;n_cur < gen_nb_xmlXPathObjectPtr;n_cur++) {
   47745     for (n_depth = 0;n_depth < gen_nb_int;n_depth++) {
   47746         mem_base = xmlMemBlocks();
   47747         output = gen_FILE_ptr(n_output, 0);
   47748         cur = gen_xmlXPathObjectPtr(n_cur, 1);
   47749         depth = gen_int(n_depth, 2);
   47750 
   47751         xmlXPathDebugDumpObject(output, cur, depth);
   47752         call_tests++;
   47753         des_FILE_ptr(n_output, output, 0);
   47754         des_xmlXPathObjectPtr(n_cur, cur, 1);
   47755         des_int(n_depth, depth, 2);
   47756         xmlResetLastError();
   47757         if (mem_base != xmlMemBlocks()) {
   47758             printf("Leak of %d blocks found in xmlXPathDebugDumpObject",
   47759 	           xmlMemBlocks() - mem_base);
   47760 	    test_ret++;
   47761             printf(" %d", n_output);
   47762             printf(" %d", n_cur);
   47763             printf(" %d", n_depth);
   47764             printf("\n");
   47765         }
   47766     }
   47767     }
   47768     }
   47769     function_tests++;
   47770 #endif
   47771 
   47772     return(test_ret);
   47773 }
   47774 
   47775 
   47776 static int
   47777 test_xmlXPathDifference(void) {
   47778     int test_ret = 0;
   47779 
   47780 #if defined(LIBXML_XPATH_ENABLED)
   47781     int mem_base;
   47782     xmlNodeSetPtr ret_val;
   47783     xmlNodeSetPtr nodes1; /* a node-set */
   47784     int n_nodes1;
   47785     xmlNodeSetPtr nodes2; /* a node-set */
   47786     int n_nodes2;
   47787 
   47788     for (n_nodes1 = 0;n_nodes1 < gen_nb_xmlNodeSetPtr;n_nodes1++) {
   47789     for (n_nodes2 = 0;n_nodes2 < gen_nb_xmlNodeSetPtr;n_nodes2++) {
   47790         mem_base = xmlMemBlocks();
   47791         nodes1 = gen_xmlNodeSetPtr(n_nodes1, 0);
   47792         nodes2 = gen_xmlNodeSetPtr(n_nodes2, 1);
   47793 
   47794         ret_val = xmlXPathDifference(nodes1, nodes2);
   47795         desret_xmlNodeSetPtr(ret_val);
   47796         call_tests++;
   47797         des_xmlNodeSetPtr(n_nodes1, nodes1, 0);
   47798         des_xmlNodeSetPtr(n_nodes2, nodes2, 1);
   47799         xmlResetLastError();
   47800         if (mem_base != xmlMemBlocks()) {
   47801             printf("Leak of %d blocks found in xmlXPathDifference",
   47802 	           xmlMemBlocks() - mem_base);
   47803 	    test_ret++;
   47804             printf(" %d", n_nodes1);
   47805             printf(" %d", n_nodes2);
   47806             printf("\n");
   47807         }
   47808     }
   47809     }
   47810     function_tests++;
   47811 #endif
   47812 
   47813     return(test_ret);
   47814 }
   47815 
   47816 
   47817 static int
   47818 test_xmlXPathDistinct(void) {
   47819     int test_ret = 0;
   47820 
   47821 #if defined(LIBXML_XPATH_ENABLED)
   47822     int mem_base;
   47823     xmlNodeSetPtr ret_val;
   47824     xmlNodeSetPtr nodes; /* a node-set */
   47825     int n_nodes;
   47826 
   47827     for (n_nodes = 0;n_nodes < gen_nb_xmlNodeSetPtr;n_nodes++) {
   47828         mem_base = xmlMemBlocks();
   47829         nodes = gen_xmlNodeSetPtr(n_nodes, 0);
   47830 
   47831         ret_val = xmlXPathDistinct(nodes);
   47832         desret_xmlNodeSetPtr(ret_val);
   47833         call_tests++;
   47834         des_xmlNodeSetPtr(n_nodes, nodes, 0);
   47835         xmlResetLastError();
   47836         if (mem_base != xmlMemBlocks()) {
   47837             printf("Leak of %d blocks found in xmlXPathDistinct",
   47838 	           xmlMemBlocks() - mem_base);
   47839 	    test_ret++;
   47840             printf(" %d", n_nodes);
   47841             printf("\n");
   47842         }
   47843     }
   47844     function_tests++;
   47845 #endif
   47846 
   47847     return(test_ret);
   47848 }
   47849 
   47850 
   47851 static int
   47852 test_xmlXPathDistinctSorted(void) {
   47853     int test_ret = 0;
   47854 
   47855 #if defined(LIBXML_XPATH_ENABLED)
   47856     int mem_base;
   47857     xmlNodeSetPtr ret_val;
   47858     xmlNodeSetPtr nodes; /* a node-set, sorted by document order */
   47859     int n_nodes;
   47860 
   47861     for (n_nodes = 0;n_nodes < gen_nb_xmlNodeSetPtr;n_nodes++) {
   47862         mem_base = xmlMemBlocks();
   47863         nodes = gen_xmlNodeSetPtr(n_nodes, 0);
   47864 
   47865         ret_val = xmlXPathDistinctSorted(nodes);
   47866         desret_xmlNodeSetPtr(ret_val);
   47867         call_tests++;
   47868         des_xmlNodeSetPtr(n_nodes, nodes, 0);
   47869         xmlResetLastError();
   47870         if (mem_base != xmlMemBlocks()) {
   47871             printf("Leak of %d blocks found in xmlXPathDistinctSorted",
   47872 	           xmlMemBlocks() - mem_base);
   47873 	    test_ret++;
   47874             printf(" %d", n_nodes);
   47875             printf("\n");
   47876         }
   47877     }
   47878     function_tests++;
   47879 #endif
   47880 
   47881     return(test_ret);
   47882 }
   47883 
   47884 
   47885 static int
   47886 test_xmlXPathDivValues(void) {
   47887     int test_ret = 0;
   47888 
   47889 #if defined(LIBXML_XPATH_ENABLED)
   47890     int mem_base;
   47891     xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
   47892     int n_ctxt;
   47893 
   47894     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
   47895         mem_base = xmlMemBlocks();
   47896         ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
   47897 
   47898         xmlXPathDivValues(ctxt);
   47899         call_tests++;
   47900         des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
   47901         xmlResetLastError();
   47902         if (mem_base != xmlMemBlocks()) {
   47903             printf("Leak of %d blocks found in xmlXPathDivValues",
   47904 	           xmlMemBlocks() - mem_base);
   47905 	    test_ret++;
   47906             printf(" %d", n_ctxt);
   47907             printf("\n");
   47908         }
   47909     }
   47910     function_tests++;
   47911 #endif
   47912 
   47913     return(test_ret);
   47914 }
   47915 
   47916 
   47917 static int
   47918 test_xmlXPathEqualValues(void) {
   47919     int test_ret = 0;
   47920 
   47921 #if defined(LIBXML_XPATH_ENABLED)
   47922     int mem_base;
   47923     int ret_val;
   47924     xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
   47925     int n_ctxt;
   47926 
   47927     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
   47928         mem_base = xmlMemBlocks();
   47929         ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
   47930 
   47931         ret_val = xmlXPathEqualValues(ctxt);
   47932         desret_int(ret_val);
   47933         call_tests++;
   47934         des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
   47935         xmlResetLastError();
   47936         if (mem_base != xmlMemBlocks()) {
   47937             printf("Leak of %d blocks found in xmlXPathEqualValues",
   47938 	           xmlMemBlocks() - mem_base);
   47939 	    test_ret++;
   47940             printf(" %d", n_ctxt);
   47941             printf("\n");
   47942         }
   47943     }
   47944     function_tests++;
   47945 #endif
   47946 
   47947     return(test_ret);
   47948 }
   47949 
   47950 
   47951 static int
   47952 test_xmlXPathErr(void) {
   47953     int test_ret = 0;
   47954 
   47955 #if defined(LIBXML_XPATH_ENABLED)
   47956     int mem_base;
   47957     xmlXPathParserContextPtr ctxt; /* a XPath parser context */
   47958     int n_ctxt;
   47959     int error; /* the error code */
   47960     int n_error;
   47961 
   47962     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
   47963     for (n_error = 0;n_error < gen_nb_int;n_error++) {
   47964         mem_base = xmlMemBlocks();
   47965         ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
   47966         error = gen_int(n_error, 1);
   47967 
   47968         xmlXPathErr(ctxt, error);
   47969         call_tests++;
   47970         des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
   47971         des_int(n_error, error, 1);
   47972         xmlResetLastError();
   47973         if (mem_base != xmlMemBlocks()) {
   47974             printf("Leak of %d blocks found in xmlXPathErr",
   47975 	           xmlMemBlocks() - mem_base);
   47976 	    test_ret++;
   47977             printf(" %d", n_ctxt);
   47978             printf(" %d", n_error);
   47979             printf("\n");
   47980         }
   47981     }
   47982     }
   47983     function_tests++;
   47984 #endif
   47985 
   47986     return(test_ret);
   47987 }
   47988 
   47989 
   47990 static int
   47991 test_xmlXPathEvalExpr(void) {
   47992     int test_ret = 0;
   47993 
   47994 #if defined(LIBXML_XPATH_ENABLED)
   47995     int mem_base;
   47996     xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
   47997     int n_ctxt;
   47998 
   47999     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
   48000         mem_base = xmlMemBlocks();
   48001         ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
   48002 
   48003         xmlXPathEvalExpr(ctxt);
   48004         call_tests++;
   48005         des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
   48006         xmlResetLastError();
   48007         if (mem_base != xmlMemBlocks()) {
   48008             printf("Leak of %d blocks found in xmlXPathEvalExpr",
   48009 	           xmlMemBlocks() - mem_base);
   48010 	    test_ret++;
   48011             printf(" %d", n_ctxt);
   48012             printf("\n");
   48013         }
   48014     }
   48015     function_tests++;
   48016 #endif
   48017 
   48018     return(test_ret);
   48019 }
   48020 
   48021 
   48022 static int
   48023 test_xmlXPathEvaluatePredicateResult(void) {
   48024     int test_ret = 0;
   48025 
   48026 #if defined(LIBXML_XPATH_ENABLED)
   48027     int mem_base;
   48028     int ret_val;
   48029     xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
   48030     int n_ctxt;
   48031     xmlXPathObjectPtr res; /* the Predicate Expression evaluation result */
   48032     int n_res;
   48033 
   48034     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
   48035     for (n_res = 0;n_res < gen_nb_xmlXPathObjectPtr;n_res++) {
   48036         mem_base = xmlMemBlocks();
   48037         ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
   48038         res = gen_xmlXPathObjectPtr(n_res, 1);
   48039 
   48040         ret_val = xmlXPathEvaluatePredicateResult(ctxt, res);
   48041         desret_int(ret_val);
   48042         call_tests++;
   48043         des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
   48044         des_xmlXPathObjectPtr(n_res, res, 1);
   48045         xmlResetLastError();
   48046         if (mem_base != xmlMemBlocks()) {
   48047             printf("Leak of %d blocks found in xmlXPathEvaluatePredicateResult",
   48048 	           xmlMemBlocks() - mem_base);
   48049 	    test_ret++;
   48050             printf(" %d", n_ctxt);
   48051             printf(" %d", n_res);
   48052             printf("\n");
   48053         }
   48054     }
   48055     }
   48056     function_tests++;
   48057 #endif
   48058 
   48059     return(test_ret);
   48060 }
   48061 
   48062 
   48063 static int
   48064 test_xmlXPathFalseFunction(void) {
   48065     int test_ret = 0;
   48066 
   48067 #if defined(LIBXML_XPATH_ENABLED)
   48068     int mem_base;
   48069     xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
   48070     int n_ctxt;
   48071     int nargs; /* the number of arguments */
   48072     int n_nargs;
   48073 
   48074     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
   48075     for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
   48076         mem_base = xmlMemBlocks();
   48077         ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
   48078         nargs = gen_int(n_nargs, 1);
   48079 
   48080         xmlXPathFalseFunction(ctxt, nargs);
   48081         call_tests++;
   48082         des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
   48083         des_int(n_nargs, nargs, 1);
   48084         xmlResetLastError();
   48085         if (mem_base != xmlMemBlocks()) {
   48086             printf("Leak of %d blocks found in xmlXPathFalseFunction",
   48087 	           xmlMemBlocks() - mem_base);
   48088 	    test_ret++;
   48089             printf(" %d", n_ctxt);
   48090             printf(" %d", n_nargs);
   48091             printf("\n");
   48092         }
   48093     }
   48094     }
   48095     function_tests++;
   48096 #endif
   48097 
   48098     return(test_ret);
   48099 }
   48100 
   48101 
   48102 static int
   48103 test_xmlXPathFloorFunction(void) {
   48104     int test_ret = 0;
   48105 
   48106 #if defined(LIBXML_XPATH_ENABLED)
   48107     int mem_base;
   48108     xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
   48109     int n_ctxt;
   48110     int nargs; /* the number of arguments */
   48111     int n_nargs;
   48112 
   48113     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
   48114     for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
   48115         mem_base = xmlMemBlocks();
   48116         ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
   48117         nargs = gen_int(n_nargs, 1);
   48118 
   48119         xmlXPathFloorFunction(ctxt, nargs);
   48120         call_tests++;
   48121         des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
   48122         des_int(n_nargs, nargs, 1);
   48123         xmlResetLastError();
   48124         if (mem_base != xmlMemBlocks()) {
   48125             printf("Leak of %d blocks found in xmlXPathFloorFunction",
   48126 	           xmlMemBlocks() - mem_base);
   48127 	    test_ret++;
   48128             printf(" %d", n_ctxt);
   48129             printf(" %d", n_nargs);
   48130             printf("\n");
   48131         }
   48132     }
   48133     }
   48134     function_tests++;
   48135 #endif
   48136 
   48137     return(test_ret);
   48138 }
   48139 
   48140 
   48141 static int
   48142 test_xmlXPathFunctionLookup(void) {
   48143     int test_ret = 0;
   48144 
   48145 
   48146     /* missing type support */
   48147     return(test_ret);
   48148 }
   48149 
   48150 
   48151 static int
   48152 test_xmlXPathFunctionLookupNS(void) {
   48153     int test_ret = 0;
   48154 
   48155 
   48156     /* missing type support */
   48157     return(test_ret);
   48158 }
   48159 
   48160 
   48161 static int
   48162 test_xmlXPathHasSameNodes(void) {
   48163     int test_ret = 0;
   48164 
   48165 #if defined(LIBXML_XPATH_ENABLED)
   48166     int mem_base;
   48167     int ret_val;
   48168     xmlNodeSetPtr nodes1; /* a node-set */
   48169     int n_nodes1;
   48170     xmlNodeSetPtr nodes2; /* a node-set */
   48171     int n_nodes2;
   48172 
   48173     for (n_nodes1 = 0;n_nodes1 < gen_nb_xmlNodeSetPtr;n_nodes1++) {
   48174     for (n_nodes2 = 0;n_nodes2 < gen_nb_xmlNodeSetPtr;n_nodes2++) {
   48175         mem_base = xmlMemBlocks();
   48176         nodes1 = gen_xmlNodeSetPtr(n_nodes1, 0);
   48177         nodes2 = gen_xmlNodeSetPtr(n_nodes2, 1);
   48178 
   48179         ret_val = xmlXPathHasSameNodes(nodes1, nodes2);
   48180         desret_int(ret_val);
   48181         call_tests++;
   48182         des_xmlNodeSetPtr(n_nodes1, nodes1, 0);
   48183         des_xmlNodeSetPtr(n_nodes2, nodes2, 1);
   48184         xmlResetLastError();
   48185         if (mem_base != xmlMemBlocks()) {
   48186             printf("Leak of %d blocks found in xmlXPathHasSameNodes",
   48187 	           xmlMemBlocks() - mem_base);
   48188 	    test_ret++;
   48189             printf(" %d", n_nodes1);
   48190             printf(" %d", n_nodes2);
   48191             printf("\n");
   48192         }
   48193     }
   48194     }
   48195     function_tests++;
   48196 #endif
   48197 
   48198     return(test_ret);
   48199 }
   48200 
   48201 
   48202 static int
   48203 test_xmlXPathIdFunction(void) {
   48204     int test_ret = 0;
   48205 
   48206 #if defined(LIBXML_XPATH_ENABLED)
   48207     int mem_base;
   48208     xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
   48209     int n_ctxt;
   48210     int nargs; /* the number of arguments */
   48211     int n_nargs;
   48212 
   48213     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
   48214     for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
   48215         mem_base = xmlMemBlocks();
   48216         ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
   48217         nargs = gen_int(n_nargs, 1);
   48218 
   48219         xmlXPathIdFunction(ctxt, nargs);
   48220         call_tests++;
   48221         des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
   48222         des_int(n_nargs, nargs, 1);
   48223         xmlResetLastError();
   48224         if (mem_base != xmlMemBlocks()) {
   48225             printf("Leak of %d blocks found in xmlXPathIdFunction",
   48226 	           xmlMemBlocks() - mem_base);
   48227 	    test_ret++;
   48228             printf(" %d", n_ctxt);
   48229             printf(" %d", n_nargs);
   48230             printf("\n");
   48231         }
   48232     }
   48233     }
   48234     function_tests++;
   48235 #endif
   48236 
   48237     return(test_ret);
   48238 }
   48239 
   48240 
   48241 static int
   48242 test_xmlXPathIntersection(void) {
   48243     int test_ret = 0;
   48244 
   48245 #if defined(LIBXML_XPATH_ENABLED)
   48246     int mem_base;
   48247     xmlNodeSetPtr ret_val;
   48248     xmlNodeSetPtr nodes1; /* a node-set */
   48249     int n_nodes1;
   48250     xmlNodeSetPtr nodes2; /* a node-set */
   48251     int n_nodes2;
   48252 
   48253     for (n_nodes1 = 0;n_nodes1 < gen_nb_xmlNodeSetPtr;n_nodes1++) {
   48254     for (n_nodes2 = 0;n_nodes2 < gen_nb_xmlNodeSetPtr;n_nodes2++) {
   48255         mem_base = xmlMemBlocks();
   48256         nodes1 = gen_xmlNodeSetPtr(n_nodes1, 0);
   48257         nodes2 = gen_xmlNodeSetPtr(n_nodes2, 1);
   48258 
   48259         ret_val = xmlXPathIntersection(nodes1, nodes2);
   48260         desret_xmlNodeSetPtr(ret_val);
   48261         call_tests++;
   48262         des_xmlNodeSetPtr(n_nodes1, nodes1, 0);
   48263         des_xmlNodeSetPtr(n_nodes2, nodes2, 1);
   48264         xmlResetLastError();
   48265         if (mem_base != xmlMemBlocks()) {
   48266             printf("Leak of %d blocks found in xmlXPathIntersection",
   48267 	           xmlMemBlocks() - mem_base);
   48268 	    test_ret++;
   48269             printf(" %d", n_nodes1);
   48270             printf(" %d", n_nodes2);
   48271             printf("\n");
   48272         }
   48273     }
   48274     }
   48275     function_tests++;
   48276 #endif
   48277 
   48278     return(test_ret);
   48279 }
   48280 
   48281 
   48282 static int
   48283 test_xmlXPathIsNodeType(void) {
   48284     int test_ret = 0;
   48285 
   48286 #if defined(LIBXML_XPATH_ENABLED)
   48287     int mem_base;
   48288     int ret_val;
   48289     xmlChar * name; /* a name string */
   48290     int n_name;
   48291 
   48292     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
   48293         mem_base = xmlMemBlocks();
   48294         name = gen_const_xmlChar_ptr(n_name, 0);
   48295 
   48296         ret_val = xmlXPathIsNodeType((const xmlChar *)name);
   48297         desret_int(ret_val);
   48298         call_tests++;
   48299         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 0);
   48300         xmlResetLastError();
   48301         if (mem_base != xmlMemBlocks()) {
   48302             printf("Leak of %d blocks found in xmlXPathIsNodeType",
   48303 	           xmlMemBlocks() - mem_base);
   48304 	    test_ret++;
   48305             printf(" %d", n_name);
   48306             printf("\n");
   48307         }
   48308     }
   48309     function_tests++;
   48310 #endif
   48311 
   48312     return(test_ret);
   48313 }
   48314 
   48315 
   48316 static int
   48317 test_xmlXPathLangFunction(void) {
   48318     int test_ret = 0;
   48319 
   48320 #if defined(LIBXML_XPATH_ENABLED)
   48321     int mem_base;
   48322     xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
   48323     int n_ctxt;
   48324     int nargs; /* the number of arguments */
   48325     int n_nargs;
   48326 
   48327     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
   48328     for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
   48329         mem_base = xmlMemBlocks();
   48330         ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
   48331         nargs = gen_int(n_nargs, 1);
   48332 
   48333         xmlXPathLangFunction(ctxt, nargs);
   48334         call_tests++;
   48335         des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
   48336         des_int(n_nargs, nargs, 1);
   48337         xmlResetLastError();
   48338         if (mem_base != xmlMemBlocks()) {
   48339             printf("Leak of %d blocks found in xmlXPathLangFunction",
   48340 	           xmlMemBlocks() - mem_base);
   48341 	    test_ret++;
   48342             printf(" %d", n_ctxt);
   48343             printf(" %d", n_nargs);
   48344             printf("\n");
   48345         }
   48346     }
   48347     }
   48348     function_tests++;
   48349 #endif
   48350 
   48351     return(test_ret);
   48352 }
   48353 
   48354 
   48355 static int
   48356 test_xmlXPathLastFunction(void) {
   48357     int test_ret = 0;
   48358 
   48359 #if defined(LIBXML_XPATH_ENABLED)
   48360     int mem_base;
   48361     xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
   48362     int n_ctxt;
   48363     int nargs; /* the number of arguments */
   48364     int n_nargs;
   48365 
   48366     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
   48367     for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
   48368         mem_base = xmlMemBlocks();
   48369         ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
   48370         nargs = gen_int(n_nargs, 1);
   48371 
   48372         xmlXPathLastFunction(ctxt, nargs);
   48373         call_tests++;
   48374         des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
   48375         des_int(n_nargs, nargs, 1);
   48376         xmlResetLastError();
   48377         if (mem_base != xmlMemBlocks()) {
   48378             printf("Leak of %d blocks found in xmlXPathLastFunction",
   48379 	           xmlMemBlocks() - mem_base);
   48380 	    test_ret++;
   48381             printf(" %d", n_ctxt);
   48382             printf(" %d", n_nargs);
   48383             printf("\n");
   48384         }
   48385     }
   48386     }
   48387     function_tests++;
   48388 #endif
   48389 
   48390     return(test_ret);
   48391 }
   48392 
   48393 
   48394 static int
   48395 test_xmlXPathLeading(void) {
   48396     int test_ret = 0;
   48397 
   48398 #if defined(LIBXML_XPATH_ENABLED)
   48399     int mem_base;
   48400     xmlNodeSetPtr ret_val;
   48401     xmlNodeSetPtr nodes1; /* a node-set */
   48402     int n_nodes1;
   48403     xmlNodeSetPtr nodes2; /* a node-set */
   48404     int n_nodes2;
   48405 
   48406     for (n_nodes1 = 0;n_nodes1 < gen_nb_xmlNodeSetPtr;n_nodes1++) {
   48407     for (n_nodes2 = 0;n_nodes2 < gen_nb_xmlNodeSetPtr;n_nodes2++) {
   48408         mem_base = xmlMemBlocks();
   48409         nodes1 = gen_xmlNodeSetPtr(n_nodes1, 0);
   48410         nodes2 = gen_xmlNodeSetPtr(n_nodes2, 1);
   48411 
   48412         ret_val = xmlXPathLeading(nodes1, nodes2);
   48413         desret_xmlNodeSetPtr(ret_val);
   48414         call_tests++;
   48415         des_xmlNodeSetPtr(n_nodes1, nodes1, 0);
   48416         des_xmlNodeSetPtr(n_nodes2, nodes2, 1);
   48417         xmlResetLastError();
   48418         if (mem_base != xmlMemBlocks()) {
   48419             printf("Leak of %d blocks found in xmlXPathLeading",
   48420 	           xmlMemBlocks() - mem_base);
   48421 	    test_ret++;
   48422             printf(" %d", n_nodes1);
   48423             printf(" %d", n_nodes2);
   48424             printf("\n");
   48425         }
   48426     }
   48427     }
   48428     function_tests++;
   48429 #endif
   48430 
   48431     return(test_ret);
   48432 }
   48433 
   48434 
   48435 static int
   48436 test_xmlXPathLeadingSorted(void) {
   48437     int test_ret = 0;
   48438 
   48439 #if defined(LIBXML_XPATH_ENABLED)
   48440     int mem_base;
   48441     xmlNodeSetPtr ret_val;
   48442     xmlNodeSetPtr nodes1; /* a node-set, sorted by document order */
   48443     int n_nodes1;
   48444     xmlNodeSetPtr nodes2; /* a node-set, sorted by document order */
   48445     int n_nodes2;
   48446 
   48447     for (n_nodes1 = 0;n_nodes1 < gen_nb_xmlNodeSetPtr;n_nodes1++) {
   48448     for (n_nodes2 = 0;n_nodes2 < gen_nb_xmlNodeSetPtr;n_nodes2++) {
   48449         mem_base = xmlMemBlocks();
   48450         nodes1 = gen_xmlNodeSetPtr(n_nodes1, 0);
   48451         nodes2 = gen_xmlNodeSetPtr(n_nodes2, 1);
   48452 
   48453         ret_val = xmlXPathLeadingSorted(nodes1, nodes2);
   48454         desret_xmlNodeSetPtr(ret_val);
   48455         call_tests++;
   48456         des_xmlNodeSetPtr(n_nodes1, nodes1, 0);
   48457         des_xmlNodeSetPtr(n_nodes2, nodes2, 1);
   48458         xmlResetLastError();
   48459         if (mem_base != xmlMemBlocks()) {
   48460             printf("Leak of %d blocks found in xmlXPathLeadingSorted",
   48461 	           xmlMemBlocks() - mem_base);
   48462 	    test_ret++;
   48463             printf(" %d", n_nodes1);
   48464             printf(" %d", n_nodes2);
   48465             printf("\n");
   48466         }
   48467     }
   48468     }
   48469     function_tests++;
   48470 #endif
   48471 
   48472     return(test_ret);
   48473 }
   48474 
   48475 
   48476 static int
   48477 test_xmlXPathLocalNameFunction(void) {
   48478     int test_ret = 0;
   48479 
   48480 #if defined(LIBXML_XPATH_ENABLED)
   48481     int mem_base;
   48482     xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
   48483     int n_ctxt;
   48484     int nargs; /* the number of arguments */
   48485     int n_nargs;
   48486 
   48487     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
   48488     for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
   48489         mem_base = xmlMemBlocks();
   48490         ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
   48491         nargs = gen_int(n_nargs, 1);
   48492 
   48493         xmlXPathLocalNameFunction(ctxt, nargs);
   48494         call_tests++;
   48495         des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
   48496         des_int(n_nargs, nargs, 1);
   48497         xmlResetLastError();
   48498         if (mem_base != xmlMemBlocks()) {
   48499             printf("Leak of %d blocks found in xmlXPathLocalNameFunction",
   48500 	           xmlMemBlocks() - mem_base);
   48501 	    test_ret++;
   48502             printf(" %d", n_ctxt);
   48503             printf(" %d", n_nargs);
   48504             printf("\n");
   48505         }
   48506     }
   48507     }
   48508     function_tests++;
   48509 #endif
   48510 
   48511     return(test_ret);
   48512 }
   48513 
   48514 
   48515 static int
   48516 test_xmlXPathModValues(void) {
   48517     int test_ret = 0;
   48518 
   48519 #if defined(LIBXML_XPATH_ENABLED)
   48520     int mem_base;
   48521     xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
   48522     int n_ctxt;
   48523 
   48524     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
   48525         mem_base = xmlMemBlocks();
   48526         ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
   48527 
   48528         xmlXPathModValues(ctxt);
   48529         call_tests++;
   48530         des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
   48531         xmlResetLastError();
   48532         if (mem_base != xmlMemBlocks()) {
   48533             printf("Leak of %d blocks found in xmlXPathModValues",
   48534 	           xmlMemBlocks() - mem_base);
   48535 	    test_ret++;
   48536             printf(" %d", n_ctxt);
   48537             printf("\n");
   48538         }
   48539     }
   48540     function_tests++;
   48541 #endif
   48542 
   48543     return(test_ret);
   48544 }
   48545 
   48546 
   48547 static int
   48548 test_xmlXPathMultValues(void) {
   48549     int test_ret = 0;
   48550 
   48551 #if defined(LIBXML_XPATH_ENABLED)
   48552     int mem_base;
   48553     xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
   48554     int n_ctxt;
   48555 
   48556     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
   48557         mem_base = xmlMemBlocks();
   48558         ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
   48559 
   48560         xmlXPathMultValues(ctxt);
   48561         call_tests++;
   48562         des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
   48563         xmlResetLastError();
   48564         if (mem_base != xmlMemBlocks()) {
   48565             printf("Leak of %d blocks found in xmlXPathMultValues",
   48566 	           xmlMemBlocks() - mem_base);
   48567 	    test_ret++;
   48568             printf(" %d", n_ctxt);
   48569             printf("\n");
   48570         }
   48571     }
   48572     function_tests++;
   48573 #endif
   48574 
   48575     return(test_ret);
   48576 }
   48577 
   48578 
   48579 static int
   48580 test_xmlXPathNamespaceURIFunction(void) {
   48581     int test_ret = 0;
   48582 
   48583 #if defined(LIBXML_XPATH_ENABLED)
   48584     int mem_base;
   48585     xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
   48586     int n_ctxt;
   48587     int nargs; /* the number of arguments */
   48588     int n_nargs;
   48589 
   48590     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
   48591     for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
   48592         mem_base = xmlMemBlocks();
   48593         ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
   48594         nargs = gen_int(n_nargs, 1);
   48595 
   48596         xmlXPathNamespaceURIFunction(ctxt, nargs);
   48597         call_tests++;
   48598         des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
   48599         des_int(n_nargs, nargs, 1);
   48600         xmlResetLastError();
   48601         if (mem_base != xmlMemBlocks()) {
   48602             printf("Leak of %d blocks found in xmlXPathNamespaceURIFunction",
   48603 	           xmlMemBlocks() - mem_base);
   48604 	    test_ret++;
   48605             printf(" %d", n_ctxt);
   48606             printf(" %d", n_nargs);
   48607             printf("\n");
   48608         }
   48609     }
   48610     }
   48611     function_tests++;
   48612 #endif
   48613 
   48614     return(test_ret);
   48615 }
   48616 
   48617 
   48618 static int
   48619 test_xmlXPathNewBoolean(void) {
   48620     int test_ret = 0;
   48621 
   48622 #if defined(LIBXML_XPATH_ENABLED)
   48623     int mem_base;
   48624     xmlXPathObjectPtr ret_val;
   48625     int val; /* the boolean value */
   48626     int n_val;
   48627 
   48628     for (n_val = 0;n_val < gen_nb_int;n_val++) {
   48629         mem_base = xmlMemBlocks();
   48630         val = gen_int(n_val, 0);
   48631 
   48632         ret_val = xmlXPathNewBoolean(val);
   48633         desret_xmlXPathObjectPtr(ret_val);
   48634         call_tests++;
   48635         des_int(n_val, val, 0);
   48636         xmlResetLastError();
   48637         if (mem_base != xmlMemBlocks()) {
   48638             printf("Leak of %d blocks found in xmlXPathNewBoolean",
   48639 	           xmlMemBlocks() - mem_base);
   48640 	    test_ret++;
   48641             printf(" %d", n_val);
   48642             printf("\n");
   48643         }
   48644     }
   48645     function_tests++;
   48646 #endif
   48647 
   48648     return(test_ret);
   48649 }
   48650 
   48651 
   48652 static int
   48653 test_xmlXPathNewCString(void) {
   48654     int test_ret = 0;
   48655 
   48656 #if defined(LIBXML_XPATH_ENABLED)
   48657     int mem_base;
   48658     xmlXPathObjectPtr ret_val;
   48659     char * val; /* the char * value */
   48660     int n_val;
   48661 
   48662     for (n_val = 0;n_val < gen_nb_const_char_ptr;n_val++) {
   48663         mem_base = xmlMemBlocks();
   48664         val = gen_const_char_ptr(n_val, 0);
   48665 
   48666         ret_val = xmlXPathNewCString((const char *)val);
   48667         desret_xmlXPathObjectPtr(ret_val);
   48668         call_tests++;
   48669         des_const_char_ptr(n_val, (const char *)val, 0);
   48670         xmlResetLastError();
   48671         if (mem_base != xmlMemBlocks()) {
   48672             printf("Leak of %d blocks found in xmlXPathNewCString",
   48673 	           xmlMemBlocks() - mem_base);
   48674 	    test_ret++;
   48675             printf(" %d", n_val);
   48676             printf("\n");
   48677         }
   48678     }
   48679     function_tests++;
   48680 #endif
   48681 
   48682     return(test_ret);
   48683 }
   48684 
   48685 
   48686 static int
   48687 test_xmlXPathNewFloat(void) {
   48688     int test_ret = 0;
   48689 
   48690 #if defined(LIBXML_XPATH_ENABLED)
   48691     int mem_base;
   48692     xmlXPathObjectPtr ret_val;
   48693     double val; /* the double value */
   48694     int n_val;
   48695 
   48696     for (n_val = 0;n_val < gen_nb_double;n_val++) {
   48697         mem_base = xmlMemBlocks();
   48698         val = gen_double(n_val, 0);
   48699 
   48700         ret_val = xmlXPathNewFloat(val);
   48701         desret_xmlXPathObjectPtr(ret_val);
   48702         call_tests++;
   48703         des_double(n_val, val, 0);
   48704         xmlResetLastError();
   48705         if (mem_base != xmlMemBlocks()) {
   48706             printf("Leak of %d blocks found in xmlXPathNewFloat",
   48707 	           xmlMemBlocks() - mem_base);
   48708 	    test_ret++;
   48709             printf(" %d", n_val);
   48710             printf("\n");
   48711         }
   48712     }
   48713     function_tests++;
   48714 #endif
   48715 
   48716     return(test_ret);
   48717 }
   48718 
   48719 
   48720 static int
   48721 test_xmlXPathNewNodeSet(void) {
   48722     int test_ret = 0;
   48723 
   48724 #if defined(LIBXML_XPATH_ENABLED)
   48725     int mem_base;
   48726     xmlXPathObjectPtr ret_val;
   48727     xmlNodePtr val; /* the NodePtr value */
   48728     int n_val;
   48729 
   48730     for (n_val = 0;n_val < gen_nb_xmlNodePtr;n_val++) {
   48731         mem_base = xmlMemBlocks();
   48732         val = gen_xmlNodePtr(n_val, 0);
   48733 
   48734         ret_val = xmlXPathNewNodeSet(val);
   48735         desret_xmlXPathObjectPtr(ret_val);
   48736         call_tests++;
   48737         des_xmlNodePtr(n_val, val, 0);
   48738         xmlResetLastError();
   48739         if (mem_base != xmlMemBlocks()) {
   48740             printf("Leak of %d blocks found in xmlXPathNewNodeSet",
   48741 	           xmlMemBlocks() - mem_base);
   48742 	    test_ret++;
   48743             printf(" %d", n_val);
   48744             printf("\n");
   48745         }
   48746     }
   48747     function_tests++;
   48748 #endif
   48749 
   48750     return(test_ret);
   48751 }
   48752 
   48753 
   48754 static int
   48755 test_xmlXPathNewNodeSetList(void) {
   48756     int test_ret = 0;
   48757 
   48758 #if defined(LIBXML_XPATH_ENABLED)
   48759     int mem_base;
   48760     xmlXPathObjectPtr ret_val;
   48761     xmlNodeSetPtr val; /* an existing NodeSet */
   48762     int n_val;
   48763 
   48764     for (n_val = 0;n_val < gen_nb_xmlNodeSetPtr;n_val++) {
   48765         mem_base = xmlMemBlocks();
   48766         val = gen_xmlNodeSetPtr(n_val, 0);
   48767 
   48768         ret_val = xmlXPathNewNodeSetList(val);
   48769         desret_xmlXPathObjectPtr(ret_val);
   48770         call_tests++;
   48771         des_xmlNodeSetPtr(n_val, val, 0);
   48772         xmlResetLastError();
   48773         if (mem_base != xmlMemBlocks()) {
   48774             printf("Leak of %d blocks found in xmlXPathNewNodeSetList",
   48775 	           xmlMemBlocks() - mem_base);
   48776 	    test_ret++;
   48777             printf(" %d", n_val);
   48778             printf("\n");
   48779         }
   48780     }
   48781     function_tests++;
   48782 #endif
   48783 
   48784     return(test_ret);
   48785 }
   48786 
   48787 
   48788 static int
   48789 test_xmlXPathNewParserContext(void) {
   48790     int test_ret = 0;
   48791 
   48792 
   48793     /* missing type support */
   48794     return(test_ret);
   48795 }
   48796 
   48797 
   48798 static int
   48799 test_xmlXPathNewString(void) {
   48800     int test_ret = 0;
   48801 
   48802 #if defined(LIBXML_XPATH_ENABLED)
   48803     int mem_base;
   48804     xmlXPathObjectPtr ret_val;
   48805     xmlChar * val; /* the xmlChar * value */
   48806     int n_val;
   48807 
   48808     for (n_val = 0;n_val < gen_nb_const_xmlChar_ptr;n_val++) {
   48809         mem_base = xmlMemBlocks();
   48810         val = gen_const_xmlChar_ptr(n_val, 0);
   48811 
   48812         ret_val = xmlXPathNewString((const xmlChar *)val);
   48813         desret_xmlXPathObjectPtr(ret_val);
   48814         call_tests++;
   48815         des_const_xmlChar_ptr(n_val, (const xmlChar *)val, 0);
   48816         xmlResetLastError();
   48817         if (mem_base != xmlMemBlocks()) {
   48818             printf("Leak of %d blocks found in xmlXPathNewString",
   48819 	           xmlMemBlocks() - mem_base);
   48820 	    test_ret++;
   48821             printf(" %d", n_val);
   48822             printf("\n");
   48823         }
   48824     }
   48825     function_tests++;
   48826 #endif
   48827 
   48828     return(test_ret);
   48829 }
   48830 
   48831 
   48832 static int
   48833 test_xmlXPathNextAncestor(void) {
   48834     int test_ret = 0;
   48835 
   48836 #if defined(LIBXML_XPATH_ENABLED)
   48837     int mem_base;
   48838     xmlNodePtr ret_val;
   48839     xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
   48840     int n_ctxt;
   48841     xmlNodePtr cur; /* the current node in the traversal */
   48842     int n_cur;
   48843 
   48844     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
   48845     for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
   48846         mem_base = xmlMemBlocks();
   48847         ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
   48848         cur = gen_xmlNodePtr(n_cur, 1);
   48849 
   48850         ret_val = xmlXPathNextAncestor(ctxt, cur);
   48851         desret_xmlNodePtr(ret_val);
   48852         call_tests++;
   48853         des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
   48854         des_xmlNodePtr(n_cur, cur, 1);
   48855         xmlResetLastError();
   48856         if (mem_base != xmlMemBlocks()) {
   48857             printf("Leak of %d blocks found in xmlXPathNextAncestor",
   48858 	           xmlMemBlocks() - mem_base);
   48859 	    test_ret++;
   48860             printf(" %d", n_ctxt);
   48861             printf(" %d", n_cur);
   48862             printf("\n");
   48863         }
   48864     }
   48865     }
   48866     function_tests++;
   48867 #endif
   48868 
   48869     return(test_ret);
   48870 }
   48871 
   48872 
   48873 static int
   48874 test_xmlXPathNextAncestorOrSelf(void) {
   48875     int test_ret = 0;
   48876 
   48877 #if defined(LIBXML_XPATH_ENABLED)
   48878     int mem_base;
   48879     xmlNodePtr ret_val;
   48880     xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
   48881     int n_ctxt;
   48882     xmlNodePtr cur; /* the current node in the traversal */
   48883     int n_cur;
   48884 
   48885     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
   48886     for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
   48887         mem_base = xmlMemBlocks();
   48888         ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
   48889         cur = gen_xmlNodePtr(n_cur, 1);
   48890 
   48891         ret_val = xmlXPathNextAncestorOrSelf(ctxt, cur);
   48892         desret_xmlNodePtr(ret_val);
   48893         call_tests++;
   48894         des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
   48895         des_xmlNodePtr(n_cur, cur, 1);
   48896         xmlResetLastError();
   48897         if (mem_base != xmlMemBlocks()) {
   48898             printf("Leak of %d blocks found in xmlXPathNextAncestorOrSelf",
   48899 	           xmlMemBlocks() - mem_base);
   48900 	    test_ret++;
   48901             printf(" %d", n_ctxt);
   48902             printf(" %d", n_cur);
   48903             printf("\n");
   48904         }
   48905     }
   48906     }
   48907     function_tests++;
   48908 #endif
   48909 
   48910     return(test_ret);
   48911 }
   48912 
   48913 
   48914 static int
   48915 test_xmlXPathNextAttribute(void) {
   48916     int test_ret = 0;
   48917 
   48918 #if defined(LIBXML_XPATH_ENABLED)
   48919     int mem_base;
   48920     xmlNodePtr ret_val;
   48921     xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
   48922     int n_ctxt;
   48923     xmlNodePtr cur; /* the current attribute in the traversal */
   48924     int n_cur;
   48925 
   48926     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
   48927     for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
   48928         mem_base = xmlMemBlocks();
   48929         ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
   48930         cur = gen_xmlNodePtr(n_cur, 1);
   48931 
   48932         ret_val = xmlXPathNextAttribute(ctxt, cur);
   48933         desret_xmlNodePtr(ret_val);
   48934         call_tests++;
   48935         des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
   48936         des_xmlNodePtr(n_cur, cur, 1);
   48937         xmlResetLastError();
   48938         if (mem_base != xmlMemBlocks()) {
   48939             printf("Leak of %d blocks found in xmlXPathNextAttribute",
   48940 	           xmlMemBlocks() - mem_base);
   48941 	    test_ret++;
   48942             printf(" %d", n_ctxt);
   48943             printf(" %d", n_cur);
   48944             printf("\n");
   48945         }
   48946     }
   48947     }
   48948     function_tests++;
   48949 #endif
   48950 
   48951     return(test_ret);
   48952 }
   48953 
   48954 
   48955 static int
   48956 test_xmlXPathNextChild(void) {
   48957     int test_ret = 0;
   48958 
   48959 #if defined(LIBXML_XPATH_ENABLED)
   48960     int mem_base;
   48961     xmlNodePtr ret_val;
   48962     xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
   48963     int n_ctxt;
   48964     xmlNodePtr cur; /* the current node in the traversal */
   48965     int n_cur;
   48966 
   48967     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
   48968     for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
   48969         mem_base = xmlMemBlocks();
   48970         ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
   48971         cur = gen_xmlNodePtr(n_cur, 1);
   48972 
   48973         ret_val = xmlXPathNextChild(ctxt, cur);
   48974         desret_xmlNodePtr(ret_val);
   48975         call_tests++;
   48976         des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
   48977         des_xmlNodePtr(n_cur, cur, 1);
   48978         xmlResetLastError();
   48979         if (mem_base != xmlMemBlocks()) {
   48980             printf("Leak of %d blocks found in xmlXPathNextChild",
   48981 	           xmlMemBlocks() - mem_base);
   48982 	    test_ret++;
   48983             printf(" %d", n_ctxt);
   48984             printf(" %d", n_cur);
   48985             printf("\n");
   48986         }
   48987     }
   48988     }
   48989     function_tests++;
   48990 #endif
   48991 
   48992     return(test_ret);
   48993 }
   48994 
   48995 
   48996 static int
   48997 test_xmlXPathNextDescendant(void) {
   48998     int test_ret = 0;
   48999 
   49000 #if defined(LIBXML_XPATH_ENABLED)
   49001     int mem_base;
   49002     xmlNodePtr ret_val;
   49003     xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
   49004     int n_ctxt;
   49005     xmlNodePtr cur; /* the current node in the traversal */
   49006     int n_cur;
   49007 
   49008     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
   49009     for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
   49010         mem_base = xmlMemBlocks();
   49011         ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
   49012         cur = gen_xmlNodePtr(n_cur, 1);
   49013 
   49014         ret_val = xmlXPathNextDescendant(ctxt, cur);
   49015         desret_xmlNodePtr(ret_val);
   49016         call_tests++;
   49017         des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
   49018         des_xmlNodePtr(n_cur, cur, 1);
   49019         xmlResetLastError();
   49020         if (mem_base != xmlMemBlocks()) {
   49021             printf("Leak of %d blocks found in xmlXPathNextDescendant",
   49022 	           xmlMemBlocks() - mem_base);
   49023 	    test_ret++;
   49024             printf(" %d", n_ctxt);
   49025             printf(" %d", n_cur);
   49026             printf("\n");
   49027         }
   49028     }
   49029     }
   49030     function_tests++;
   49031 #endif
   49032 
   49033     return(test_ret);
   49034 }
   49035 
   49036 
   49037 static int
   49038 test_xmlXPathNextDescendantOrSelf(void) {
   49039     int test_ret = 0;
   49040 
   49041 #if defined(LIBXML_XPATH_ENABLED)
   49042     int mem_base;
   49043     xmlNodePtr ret_val;
   49044     xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
   49045     int n_ctxt;
   49046     xmlNodePtr cur; /* the current node in the traversal */
   49047     int n_cur;
   49048 
   49049     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
   49050     for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
   49051         mem_base = xmlMemBlocks();
   49052         ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
   49053         cur = gen_xmlNodePtr(n_cur, 1);
   49054 
   49055         ret_val = xmlXPathNextDescendantOrSelf(ctxt, cur);
   49056         desret_xmlNodePtr(ret_val);
   49057         call_tests++;
   49058         des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
   49059         des_xmlNodePtr(n_cur, cur, 1);
   49060         xmlResetLastError();
   49061         if (mem_base != xmlMemBlocks()) {
   49062             printf("Leak of %d blocks found in xmlXPathNextDescendantOrSelf",
   49063 	           xmlMemBlocks() - mem_base);
   49064 	    test_ret++;
   49065             printf(" %d", n_ctxt);
   49066             printf(" %d", n_cur);
   49067             printf("\n");
   49068         }
   49069     }
   49070     }
   49071     function_tests++;
   49072 #endif
   49073 
   49074     return(test_ret);
   49075 }
   49076 
   49077 
   49078 static int
   49079 test_xmlXPathNextFollowing(void) {
   49080     int test_ret = 0;
   49081 
   49082 #if defined(LIBXML_XPATH_ENABLED)
   49083     int mem_base;
   49084     xmlNodePtr ret_val;
   49085     xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
   49086     int n_ctxt;
   49087     xmlNodePtr cur; /* the current node in the traversal */
   49088     int n_cur;
   49089 
   49090     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
   49091     for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
   49092         mem_base = xmlMemBlocks();
   49093         ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
   49094         cur = gen_xmlNodePtr(n_cur, 1);
   49095 
   49096         ret_val = xmlXPathNextFollowing(ctxt, cur);
   49097         desret_xmlNodePtr(ret_val);
   49098         call_tests++;
   49099         des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
   49100         des_xmlNodePtr(n_cur, cur, 1);
   49101         xmlResetLastError();
   49102         if (mem_base != xmlMemBlocks()) {
   49103             printf("Leak of %d blocks found in xmlXPathNextFollowing",
   49104 	           xmlMemBlocks() - mem_base);
   49105 	    test_ret++;
   49106             printf(" %d", n_ctxt);
   49107             printf(" %d", n_cur);
   49108             printf("\n");
   49109         }
   49110     }
   49111     }
   49112     function_tests++;
   49113 #endif
   49114 
   49115     return(test_ret);
   49116 }
   49117 
   49118 
   49119 static int
   49120 test_xmlXPathNextFollowingSibling(void) {
   49121     int test_ret = 0;
   49122 
   49123 #if defined(LIBXML_XPATH_ENABLED)
   49124     int mem_base;
   49125     xmlNodePtr ret_val;
   49126     xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
   49127     int n_ctxt;
   49128     xmlNodePtr cur; /* the current node in the traversal */
   49129     int n_cur;
   49130 
   49131     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
   49132     for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
   49133         mem_base = xmlMemBlocks();
   49134         ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
   49135         cur = gen_xmlNodePtr(n_cur, 1);
   49136 
   49137         ret_val = xmlXPathNextFollowingSibling(ctxt, cur);
   49138         desret_xmlNodePtr(ret_val);
   49139         call_tests++;
   49140         des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
   49141         des_xmlNodePtr(n_cur, cur, 1);
   49142         xmlResetLastError();
   49143         if (mem_base != xmlMemBlocks()) {
   49144             printf("Leak of %d blocks found in xmlXPathNextFollowingSibling",
   49145 	           xmlMemBlocks() - mem_base);
   49146 	    test_ret++;
   49147             printf(" %d", n_ctxt);
   49148             printf(" %d", n_cur);
   49149             printf("\n");
   49150         }
   49151     }
   49152     }
   49153     function_tests++;
   49154 #endif
   49155 
   49156     return(test_ret);
   49157 }
   49158 
   49159 
   49160 static int
   49161 test_xmlXPathNextNamespace(void) {
   49162     int test_ret = 0;
   49163 
   49164 #if defined(LIBXML_XPATH_ENABLED)
   49165     int mem_base;
   49166     xmlNodePtr ret_val;
   49167     xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
   49168     int n_ctxt;
   49169     xmlNodePtr cur; /* the current attribute in the traversal */
   49170     int n_cur;
   49171 
   49172     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
   49173     for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
   49174         mem_base = xmlMemBlocks();
   49175         ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
   49176         cur = gen_xmlNodePtr(n_cur, 1);
   49177 
   49178         ret_val = xmlXPathNextNamespace(ctxt, cur);
   49179         desret_xmlNodePtr(ret_val);
   49180         call_tests++;
   49181         des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
   49182         des_xmlNodePtr(n_cur, cur, 1);
   49183         xmlResetLastError();
   49184         if (mem_base != xmlMemBlocks()) {
   49185             printf("Leak of %d blocks found in xmlXPathNextNamespace",
   49186 	           xmlMemBlocks() - mem_base);
   49187 	    test_ret++;
   49188             printf(" %d", n_ctxt);
   49189             printf(" %d", n_cur);
   49190             printf("\n");
   49191         }
   49192     }
   49193     }
   49194     function_tests++;
   49195 #endif
   49196 
   49197     return(test_ret);
   49198 }
   49199 
   49200 
   49201 static int
   49202 test_xmlXPathNextParent(void) {
   49203     int test_ret = 0;
   49204 
   49205 #if defined(LIBXML_XPATH_ENABLED)
   49206     int mem_base;
   49207     xmlNodePtr ret_val;
   49208     xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
   49209     int n_ctxt;
   49210     xmlNodePtr cur; /* the current node in the traversal */
   49211     int n_cur;
   49212 
   49213     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
   49214     for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
   49215         mem_base = xmlMemBlocks();
   49216         ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
   49217         cur = gen_xmlNodePtr(n_cur, 1);
   49218 
   49219         ret_val = xmlXPathNextParent(ctxt, cur);
   49220         desret_xmlNodePtr(ret_val);
   49221         call_tests++;
   49222         des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
   49223         des_xmlNodePtr(n_cur, cur, 1);
   49224         xmlResetLastError();
   49225         if (mem_base != xmlMemBlocks()) {
   49226             printf("Leak of %d blocks found in xmlXPathNextParent",
   49227 	           xmlMemBlocks() - mem_base);
   49228 	    test_ret++;
   49229             printf(" %d", n_ctxt);
   49230             printf(" %d", n_cur);
   49231             printf("\n");
   49232         }
   49233     }
   49234     }
   49235     function_tests++;
   49236 #endif
   49237 
   49238     return(test_ret);
   49239 }
   49240 
   49241 
   49242 static int
   49243 test_xmlXPathNextPreceding(void) {
   49244     int test_ret = 0;
   49245 
   49246 #if defined(LIBXML_XPATH_ENABLED)
   49247     int mem_base;
   49248     xmlNodePtr ret_val;
   49249     xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
   49250     int n_ctxt;
   49251     xmlNodePtr cur; /* the current node in the traversal */
   49252     int n_cur;
   49253 
   49254     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
   49255     for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
   49256         mem_base = xmlMemBlocks();
   49257         ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
   49258         cur = gen_xmlNodePtr(n_cur, 1);
   49259 
   49260         ret_val = xmlXPathNextPreceding(ctxt, cur);
   49261         desret_xmlNodePtr(ret_val);
   49262         call_tests++;
   49263         des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
   49264         des_xmlNodePtr(n_cur, cur, 1);
   49265         xmlResetLastError();
   49266         if (mem_base != xmlMemBlocks()) {
   49267             printf("Leak of %d blocks found in xmlXPathNextPreceding",
   49268 	           xmlMemBlocks() - mem_base);
   49269 	    test_ret++;
   49270             printf(" %d", n_ctxt);
   49271             printf(" %d", n_cur);
   49272             printf("\n");
   49273         }
   49274     }
   49275     }
   49276     function_tests++;
   49277 #endif
   49278 
   49279     return(test_ret);
   49280 }
   49281 
   49282 
   49283 static int
   49284 test_xmlXPathNextPrecedingSibling(void) {
   49285     int test_ret = 0;
   49286 
   49287 #if defined(LIBXML_XPATH_ENABLED)
   49288     int mem_base;
   49289     xmlNodePtr ret_val;
   49290     xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
   49291     int n_ctxt;
   49292     xmlNodePtr cur; /* the current node in the traversal */
   49293     int n_cur;
   49294 
   49295     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
   49296     for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
   49297         mem_base = xmlMemBlocks();
   49298         ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
   49299         cur = gen_xmlNodePtr(n_cur, 1);
   49300 
   49301         ret_val = xmlXPathNextPrecedingSibling(ctxt, cur);
   49302         desret_xmlNodePtr(ret_val);
   49303         call_tests++;
   49304         des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
   49305         des_xmlNodePtr(n_cur, cur, 1);
   49306         xmlResetLastError();
   49307         if (mem_base != xmlMemBlocks()) {
   49308             printf("Leak of %d blocks found in xmlXPathNextPrecedingSibling",
   49309 	           xmlMemBlocks() - mem_base);
   49310 	    test_ret++;
   49311             printf(" %d", n_ctxt);
   49312             printf(" %d", n_cur);
   49313             printf("\n");
   49314         }
   49315     }
   49316     }
   49317     function_tests++;
   49318 #endif
   49319 
   49320     return(test_ret);
   49321 }
   49322 
   49323 
   49324 static int
   49325 test_xmlXPathNextSelf(void) {
   49326     int test_ret = 0;
   49327 
   49328 #if defined(LIBXML_XPATH_ENABLED)
   49329     int mem_base;
   49330     xmlNodePtr ret_val;
   49331     xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
   49332     int n_ctxt;
   49333     xmlNodePtr cur; /* the current node in the traversal */
   49334     int n_cur;
   49335 
   49336     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
   49337     for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
   49338         mem_base = xmlMemBlocks();
   49339         ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
   49340         cur = gen_xmlNodePtr(n_cur, 1);
   49341 
   49342         ret_val = xmlXPathNextSelf(ctxt, cur);
   49343         desret_xmlNodePtr(ret_val);
   49344         call_tests++;
   49345         des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
   49346         des_xmlNodePtr(n_cur, cur, 1);
   49347         xmlResetLastError();
   49348         if (mem_base != xmlMemBlocks()) {
   49349             printf("Leak of %d blocks found in xmlXPathNextSelf",
   49350 	           xmlMemBlocks() - mem_base);
   49351 	    test_ret++;
   49352             printf(" %d", n_ctxt);
   49353             printf(" %d", n_cur);
   49354             printf("\n");
   49355         }
   49356     }
   49357     }
   49358     function_tests++;
   49359 #endif
   49360 
   49361     return(test_ret);
   49362 }
   49363 
   49364 
   49365 static int
   49366 test_xmlXPathNodeLeading(void) {
   49367     int test_ret = 0;
   49368 
   49369 #if defined(LIBXML_XPATH_ENABLED)
   49370     int mem_base;
   49371     xmlNodeSetPtr ret_val;
   49372     xmlNodeSetPtr nodes; /* a node-set */
   49373     int n_nodes;
   49374     xmlNodePtr node; /* a node */
   49375     int n_node;
   49376 
   49377     for (n_nodes = 0;n_nodes < gen_nb_xmlNodeSetPtr;n_nodes++) {
   49378     for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
   49379         mem_base = xmlMemBlocks();
   49380         nodes = gen_xmlNodeSetPtr(n_nodes, 0);
   49381         node = gen_xmlNodePtr(n_node, 1);
   49382 
   49383         ret_val = xmlXPathNodeLeading(nodes, node);
   49384         desret_xmlNodeSetPtr(ret_val);
   49385         call_tests++;
   49386         des_xmlNodeSetPtr(n_nodes, nodes, 0);
   49387         des_xmlNodePtr(n_node, node, 1);
   49388         xmlResetLastError();
   49389         if (mem_base != xmlMemBlocks()) {
   49390             printf("Leak of %d blocks found in xmlXPathNodeLeading",
   49391 	           xmlMemBlocks() - mem_base);
   49392 	    test_ret++;
   49393             printf(" %d", n_nodes);
   49394             printf(" %d", n_node);
   49395             printf("\n");
   49396         }
   49397     }
   49398     }
   49399     function_tests++;
   49400 #endif
   49401 
   49402     return(test_ret);
   49403 }
   49404 
   49405 
   49406 static int
   49407 test_xmlXPathNodeLeadingSorted(void) {
   49408     int test_ret = 0;
   49409 
   49410 #if defined(LIBXML_XPATH_ENABLED)
   49411     int mem_base;
   49412     xmlNodeSetPtr ret_val;
   49413     xmlNodeSetPtr nodes; /* a node-set, sorted by document order */
   49414     int n_nodes;
   49415     xmlNodePtr node; /* a node */
   49416     int n_node;
   49417 
   49418     for (n_nodes = 0;n_nodes < gen_nb_xmlNodeSetPtr;n_nodes++) {
   49419     for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
   49420         mem_base = xmlMemBlocks();
   49421         nodes = gen_xmlNodeSetPtr(n_nodes, 0);
   49422         node = gen_xmlNodePtr(n_node, 1);
   49423 
   49424         ret_val = xmlXPathNodeLeadingSorted(nodes, node);
   49425         desret_xmlNodeSetPtr(ret_val);
   49426         call_tests++;
   49427         des_xmlNodeSetPtr(n_nodes, nodes, 0);
   49428         des_xmlNodePtr(n_node, node, 1);
   49429         xmlResetLastError();
   49430         if (mem_base != xmlMemBlocks()) {
   49431             printf("Leak of %d blocks found in xmlXPathNodeLeadingSorted",
   49432 	           xmlMemBlocks() - mem_base);
   49433 	    test_ret++;
   49434             printf(" %d", n_nodes);
   49435             printf(" %d", n_node);
   49436             printf("\n");
   49437         }
   49438     }
   49439     }
   49440     function_tests++;
   49441 #endif
   49442 
   49443     return(test_ret);
   49444 }
   49445 
   49446 
   49447 static int
   49448 test_xmlXPathNodeSetAdd(void) {
   49449     int test_ret = 0;
   49450 
   49451 #if defined(LIBXML_XPATH_ENABLED)
   49452     int mem_base;
   49453     int ret_val;
   49454     xmlNodeSetPtr cur; /* the initial node set */
   49455     int n_cur;
   49456     xmlNodePtr val; /* a new xmlNodePtr */
   49457     int n_val;
   49458 
   49459     for (n_cur = 0;n_cur < gen_nb_xmlNodeSetPtr;n_cur++) {
   49460     for (n_val = 0;n_val < gen_nb_xmlNodePtr;n_val++) {
   49461         mem_base = xmlMemBlocks();
   49462         cur = gen_xmlNodeSetPtr(n_cur, 0);
   49463         val = gen_xmlNodePtr(n_val, 1);
   49464 
   49465         ret_val = xmlXPathNodeSetAdd(cur, val);
   49466         desret_int(ret_val);
   49467         call_tests++;
   49468         des_xmlNodeSetPtr(n_cur, cur, 0);
   49469         des_xmlNodePtr(n_val, val, 1);
   49470         xmlResetLastError();
   49471         if (mem_base != xmlMemBlocks()) {
   49472             printf("Leak of %d blocks found in xmlXPathNodeSetAdd",
   49473 	           xmlMemBlocks() - mem_base);
   49474 	    test_ret++;
   49475             printf(" %d", n_cur);
   49476             printf(" %d", n_val);
   49477             printf("\n");
   49478         }
   49479     }
   49480     }
   49481     function_tests++;
   49482 #endif
   49483 
   49484     return(test_ret);
   49485 }
   49486 
   49487 
   49488 static int
   49489 test_xmlXPathNodeSetAddNs(void) {
   49490     int test_ret = 0;
   49491 
   49492 #if defined(LIBXML_XPATH_ENABLED)
   49493     int mem_base;
   49494     int ret_val;
   49495     xmlNodeSetPtr cur; /* the initial node set */
   49496     int n_cur;
   49497     xmlNodePtr node; /* the hosting node */
   49498     int n_node;
   49499     xmlNsPtr ns; /* a the namespace node */
   49500     int n_ns;
   49501 
   49502     for (n_cur = 0;n_cur < gen_nb_xmlNodeSetPtr;n_cur++) {
   49503     for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
   49504     for (n_ns = 0;n_ns < gen_nb_xmlNsPtr;n_ns++) {
   49505         mem_base = xmlMemBlocks();
   49506         cur = gen_xmlNodeSetPtr(n_cur, 0);
   49507         node = gen_xmlNodePtr(n_node, 1);
   49508         ns = gen_xmlNsPtr(n_ns, 2);
   49509 
   49510         ret_val = xmlXPathNodeSetAddNs(cur, node, ns);
   49511         desret_int(ret_val);
   49512         call_tests++;
   49513         des_xmlNodeSetPtr(n_cur, cur, 0);
   49514         des_xmlNodePtr(n_node, node, 1);
   49515         des_xmlNsPtr(n_ns, ns, 2);
   49516         xmlResetLastError();
   49517         if (mem_base != xmlMemBlocks()) {
   49518             printf("Leak of %d blocks found in xmlXPathNodeSetAddNs",
   49519 	           xmlMemBlocks() - mem_base);
   49520 	    test_ret++;
   49521             printf(" %d", n_cur);
   49522             printf(" %d", n_node);
   49523             printf(" %d", n_ns);
   49524             printf("\n");
   49525         }
   49526     }
   49527     }
   49528     }
   49529     function_tests++;
   49530 #endif
   49531 
   49532     return(test_ret);
   49533 }
   49534 
   49535 
   49536 static int
   49537 test_xmlXPathNodeSetAddUnique(void) {
   49538     int test_ret = 0;
   49539 
   49540 #if defined(LIBXML_XPATH_ENABLED)
   49541     int mem_base;
   49542     int ret_val;
   49543     xmlNodeSetPtr cur; /* the initial node set */
   49544     int n_cur;
   49545     xmlNodePtr val; /* a new xmlNodePtr */
   49546     int n_val;
   49547 
   49548     for (n_cur = 0;n_cur < gen_nb_xmlNodeSetPtr;n_cur++) {
   49549     for (n_val = 0;n_val < gen_nb_xmlNodePtr;n_val++) {
   49550         mem_base = xmlMemBlocks();
   49551         cur = gen_xmlNodeSetPtr(n_cur, 0);
   49552         val = gen_xmlNodePtr(n_val, 1);
   49553 
   49554         ret_val = xmlXPathNodeSetAddUnique(cur, val);
   49555         desret_int(ret_val);
   49556         call_tests++;
   49557         des_xmlNodeSetPtr(n_cur, cur, 0);
   49558         des_xmlNodePtr(n_val, val, 1);
   49559         xmlResetLastError();
   49560         if (mem_base != xmlMemBlocks()) {
   49561             printf("Leak of %d blocks found in xmlXPathNodeSetAddUnique",
   49562 	           xmlMemBlocks() - mem_base);
   49563 	    test_ret++;
   49564             printf(" %d", n_cur);
   49565             printf(" %d", n_val);
   49566             printf("\n");
   49567         }
   49568     }
   49569     }
   49570     function_tests++;
   49571 #endif
   49572 
   49573     return(test_ret);
   49574 }
   49575 
   49576 
   49577 static int
   49578 test_xmlXPathNodeSetContains(void) {
   49579     int test_ret = 0;
   49580 
   49581 #if defined(LIBXML_XPATH_ENABLED)
   49582     int mem_base;
   49583     int ret_val;
   49584     xmlNodeSetPtr cur; /* the node-set */
   49585     int n_cur;
   49586     xmlNodePtr val; /* the node */
   49587     int n_val;
   49588 
   49589     for (n_cur = 0;n_cur < gen_nb_xmlNodeSetPtr;n_cur++) {
   49590     for (n_val = 0;n_val < gen_nb_xmlNodePtr;n_val++) {
   49591         mem_base = xmlMemBlocks();
   49592         cur = gen_xmlNodeSetPtr(n_cur, 0);
   49593         val = gen_xmlNodePtr(n_val, 1);
   49594 
   49595         ret_val = xmlXPathNodeSetContains(cur, val);
   49596         desret_int(ret_val);
   49597         call_tests++;
   49598         des_xmlNodeSetPtr(n_cur, cur, 0);
   49599         des_xmlNodePtr(n_val, val, 1);
   49600         xmlResetLastError();
   49601         if (mem_base != xmlMemBlocks()) {
   49602             printf("Leak of %d blocks found in xmlXPathNodeSetContains",
   49603 	           xmlMemBlocks() - mem_base);
   49604 	    test_ret++;
   49605             printf(" %d", n_cur);
   49606             printf(" %d", n_val);
   49607             printf("\n");
   49608         }
   49609     }
   49610     }
   49611     function_tests++;
   49612 #endif
   49613 
   49614     return(test_ret);
   49615 }
   49616 
   49617 
   49618 static int
   49619 test_xmlXPathNodeSetDel(void) {
   49620     int test_ret = 0;
   49621 
   49622 #if defined(LIBXML_XPATH_ENABLED)
   49623     int mem_base;
   49624     xmlNodeSetPtr cur; /* the initial node set */
   49625     int n_cur;
   49626     xmlNodePtr val; /* an xmlNodePtr */
   49627     int n_val;
   49628 
   49629     for (n_cur = 0;n_cur < gen_nb_xmlNodeSetPtr;n_cur++) {
   49630     for (n_val = 0;n_val < gen_nb_xmlNodePtr;n_val++) {
   49631         mem_base = xmlMemBlocks();
   49632         cur = gen_xmlNodeSetPtr(n_cur, 0);
   49633         val = gen_xmlNodePtr(n_val, 1);
   49634 
   49635         xmlXPathNodeSetDel(cur, val);
   49636         call_tests++;
   49637         des_xmlNodeSetPtr(n_cur, cur, 0);
   49638         des_xmlNodePtr(n_val, val, 1);
   49639         xmlResetLastError();
   49640         if (mem_base != xmlMemBlocks()) {
   49641             printf("Leak of %d blocks found in xmlXPathNodeSetDel",
   49642 	           xmlMemBlocks() - mem_base);
   49643 	    test_ret++;
   49644             printf(" %d", n_cur);
   49645             printf(" %d", n_val);
   49646             printf("\n");
   49647         }
   49648     }
   49649     }
   49650     function_tests++;
   49651 #endif
   49652 
   49653     return(test_ret);
   49654 }
   49655 
   49656 
   49657 static int
   49658 test_xmlXPathNodeSetMerge(void) {
   49659     int test_ret = 0;
   49660 
   49661 #if defined(LIBXML_XPATH_ENABLED)
   49662     int mem_base;
   49663     xmlNodeSetPtr ret_val;
   49664     xmlNodeSetPtr val1; /* the first NodeSet or NULL */
   49665     int n_val1;
   49666     xmlNodeSetPtr val2; /* the second NodeSet */
   49667     int n_val2;
   49668 
   49669     for (n_val1 = 0;n_val1 < gen_nb_xmlNodeSetPtr;n_val1++) {
   49670     for (n_val2 = 0;n_val2 < gen_nb_xmlNodeSetPtr;n_val2++) {
   49671         mem_base = xmlMemBlocks();
   49672         val1 = gen_xmlNodeSetPtr(n_val1, 0);
   49673         val2 = gen_xmlNodeSetPtr(n_val2, 1);
   49674 
   49675         ret_val = xmlXPathNodeSetMerge(val1, val2);
   49676         desret_xmlNodeSetPtr(ret_val);
   49677         call_tests++;
   49678         des_xmlNodeSetPtr(n_val1, val1, 0);
   49679         des_xmlNodeSetPtr(n_val2, val2, 1);
   49680         xmlResetLastError();
   49681         if (mem_base != xmlMemBlocks()) {
   49682             printf("Leak of %d blocks found in xmlXPathNodeSetMerge",
   49683 	           xmlMemBlocks() - mem_base);
   49684 	    test_ret++;
   49685             printf(" %d", n_val1);
   49686             printf(" %d", n_val2);
   49687             printf("\n");
   49688         }
   49689     }
   49690     }
   49691     function_tests++;
   49692 #endif
   49693 
   49694     return(test_ret);
   49695 }
   49696 
   49697 
   49698 static int
   49699 test_xmlXPathNodeSetRemove(void) {
   49700     int test_ret = 0;
   49701 
   49702 #if defined(LIBXML_XPATH_ENABLED)
   49703     int mem_base;
   49704     xmlNodeSetPtr cur; /* the initial node set */
   49705     int n_cur;
   49706     int val; /* the index to remove */
   49707     int n_val;
   49708 
   49709     for (n_cur = 0;n_cur < gen_nb_xmlNodeSetPtr;n_cur++) {
   49710     for (n_val = 0;n_val < gen_nb_int;n_val++) {
   49711         mem_base = xmlMemBlocks();
   49712         cur = gen_xmlNodeSetPtr(n_cur, 0);
   49713         val = gen_int(n_val, 1);
   49714 
   49715         xmlXPathNodeSetRemove(cur, val);
   49716         call_tests++;
   49717         des_xmlNodeSetPtr(n_cur, cur, 0);
   49718         des_int(n_val, val, 1);
   49719         xmlResetLastError();
   49720         if (mem_base != xmlMemBlocks()) {
   49721             printf("Leak of %d blocks found in xmlXPathNodeSetRemove",
   49722 	           xmlMemBlocks() - mem_base);
   49723 	    test_ret++;
   49724             printf(" %d", n_cur);
   49725             printf(" %d", n_val);
   49726             printf("\n");
   49727         }
   49728     }
   49729     }
   49730     function_tests++;
   49731 #endif
   49732 
   49733     return(test_ret);
   49734 }
   49735 
   49736 
   49737 static int
   49738 test_xmlXPathNodeSetSort(void) {
   49739     int test_ret = 0;
   49740 
   49741 #if defined(LIBXML_XPATH_ENABLED)
   49742     int mem_base;
   49743     xmlNodeSetPtr set; /* the node set */
   49744     int n_set;
   49745 
   49746     for (n_set = 0;n_set < gen_nb_xmlNodeSetPtr;n_set++) {
   49747         mem_base = xmlMemBlocks();
   49748         set = gen_xmlNodeSetPtr(n_set, 0);
   49749 
   49750         xmlXPathNodeSetSort(set);
   49751         call_tests++;
   49752         des_xmlNodeSetPtr(n_set, set, 0);
   49753         xmlResetLastError();
   49754         if (mem_base != xmlMemBlocks()) {
   49755             printf("Leak of %d blocks found in xmlXPathNodeSetSort",
   49756 	           xmlMemBlocks() - mem_base);
   49757 	    test_ret++;
   49758             printf(" %d", n_set);
   49759             printf("\n");
   49760         }
   49761     }
   49762     function_tests++;
   49763 #endif
   49764 
   49765     return(test_ret);
   49766 }
   49767 
   49768 
   49769 static int
   49770 test_xmlXPathNodeTrailing(void) {
   49771     int test_ret = 0;
   49772 
   49773 #if defined(LIBXML_XPATH_ENABLED)
   49774     int mem_base;
   49775     xmlNodeSetPtr ret_val;
   49776     xmlNodeSetPtr nodes; /* a node-set */
   49777     int n_nodes;
   49778     xmlNodePtr node; /* a node */
   49779     int n_node;
   49780 
   49781     for (n_nodes = 0;n_nodes < gen_nb_xmlNodeSetPtr;n_nodes++) {
   49782     for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
   49783         mem_base = xmlMemBlocks();
   49784         nodes = gen_xmlNodeSetPtr(n_nodes, 0);
   49785         node = gen_xmlNodePtr(n_node, 1);
   49786 
   49787         ret_val = xmlXPathNodeTrailing(nodes, node);
   49788         desret_xmlNodeSetPtr(ret_val);
   49789         call_tests++;
   49790         des_xmlNodeSetPtr(n_nodes, nodes, 0);
   49791         des_xmlNodePtr(n_node, node, 1);
   49792         xmlResetLastError();
   49793         if (mem_base != xmlMemBlocks()) {
   49794             printf("Leak of %d blocks found in xmlXPathNodeTrailing",
   49795 	           xmlMemBlocks() - mem_base);
   49796 	    test_ret++;
   49797             printf(" %d", n_nodes);
   49798             printf(" %d", n_node);
   49799             printf("\n");
   49800         }
   49801     }
   49802     }
   49803     function_tests++;
   49804 #endif
   49805 
   49806     return(test_ret);
   49807 }
   49808 
   49809 
   49810 static int
   49811 test_xmlXPathNodeTrailingSorted(void) {
   49812     int test_ret = 0;
   49813 
   49814 #if defined(LIBXML_XPATH_ENABLED)
   49815     int mem_base;
   49816     xmlNodeSetPtr ret_val;
   49817     xmlNodeSetPtr nodes; /* a node-set, sorted by document order */
   49818     int n_nodes;
   49819     xmlNodePtr node; /* a node */
   49820     int n_node;
   49821 
   49822     for (n_nodes = 0;n_nodes < gen_nb_xmlNodeSetPtr;n_nodes++) {
   49823     for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
   49824         mem_base = xmlMemBlocks();
   49825         nodes = gen_xmlNodeSetPtr(n_nodes, 0);
   49826         node = gen_xmlNodePtr(n_node, 1);
   49827 
   49828         ret_val = xmlXPathNodeTrailingSorted(nodes, node);
   49829         desret_xmlNodeSetPtr(ret_val);
   49830         call_tests++;
   49831         des_xmlNodeSetPtr(n_nodes, nodes, 0);
   49832         des_xmlNodePtr(n_node, node, 1);
   49833         xmlResetLastError();
   49834         if (mem_base != xmlMemBlocks()) {
   49835             printf("Leak of %d blocks found in xmlXPathNodeTrailingSorted",
   49836 	           xmlMemBlocks() - mem_base);
   49837 	    test_ret++;
   49838             printf(" %d", n_nodes);
   49839             printf(" %d", n_node);
   49840             printf("\n");
   49841         }
   49842     }
   49843     }
   49844     function_tests++;
   49845 #endif
   49846 
   49847     return(test_ret);
   49848 }
   49849 
   49850 
   49851 static int
   49852 test_xmlXPathNormalizeFunction(void) {
   49853     int test_ret = 0;
   49854 
   49855 #if defined(LIBXML_XPATH_ENABLED)
   49856     int mem_base;
   49857     xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
   49858     int n_ctxt;
   49859     int nargs; /* the number of arguments */
   49860     int n_nargs;
   49861 
   49862     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
   49863     for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
   49864         mem_base = xmlMemBlocks();
   49865         ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
   49866         nargs = gen_int(n_nargs, 1);
   49867 
   49868         xmlXPathNormalizeFunction(ctxt, nargs);
   49869         call_tests++;
   49870         des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
   49871         des_int(n_nargs, nargs, 1);
   49872         xmlResetLastError();
   49873         if (mem_base != xmlMemBlocks()) {
   49874             printf("Leak of %d blocks found in xmlXPathNormalizeFunction",
   49875 	           xmlMemBlocks() - mem_base);
   49876 	    test_ret++;
   49877             printf(" %d", n_ctxt);
   49878             printf(" %d", n_nargs);
   49879             printf("\n");
   49880         }
   49881     }
   49882     }
   49883     function_tests++;
   49884 #endif
   49885 
   49886     return(test_ret);
   49887 }
   49888 
   49889 
   49890 static int
   49891 test_xmlXPathNotEqualValues(void) {
   49892     int test_ret = 0;
   49893 
   49894 #if defined(LIBXML_XPATH_ENABLED)
   49895     int mem_base;
   49896     int ret_val;
   49897     xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
   49898     int n_ctxt;
   49899 
   49900     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
   49901         mem_base = xmlMemBlocks();
   49902         ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
   49903 
   49904         ret_val = xmlXPathNotEqualValues(ctxt);
   49905         desret_int(ret_val);
   49906         call_tests++;
   49907         des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
   49908         xmlResetLastError();
   49909         if (mem_base != xmlMemBlocks()) {
   49910             printf("Leak of %d blocks found in xmlXPathNotEqualValues",
   49911 	           xmlMemBlocks() - mem_base);
   49912 	    test_ret++;
   49913             printf(" %d", n_ctxt);
   49914             printf("\n");
   49915         }
   49916     }
   49917     function_tests++;
   49918 #endif
   49919 
   49920     return(test_ret);
   49921 }
   49922 
   49923 
   49924 static int
   49925 test_xmlXPathNotFunction(void) {
   49926     int test_ret = 0;
   49927 
   49928 #if defined(LIBXML_XPATH_ENABLED)
   49929     int mem_base;
   49930     xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
   49931     int n_ctxt;
   49932     int nargs; /* the number of arguments */
   49933     int n_nargs;
   49934 
   49935     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
   49936     for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
   49937         mem_base = xmlMemBlocks();
   49938         ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
   49939         nargs = gen_int(n_nargs, 1);
   49940 
   49941         xmlXPathNotFunction(ctxt, nargs);
   49942         call_tests++;
   49943         des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
   49944         des_int(n_nargs, nargs, 1);
   49945         xmlResetLastError();
   49946         if (mem_base != xmlMemBlocks()) {
   49947             printf("Leak of %d blocks found in xmlXPathNotFunction",
   49948 	           xmlMemBlocks() - mem_base);
   49949 	    test_ret++;
   49950             printf(" %d", n_ctxt);
   49951             printf(" %d", n_nargs);
   49952             printf("\n");
   49953         }
   49954     }
   49955     }
   49956     function_tests++;
   49957 #endif
   49958 
   49959     return(test_ret);
   49960 }
   49961 
   49962 
   49963 static int
   49964 test_xmlXPathNsLookup(void) {
   49965     int test_ret = 0;
   49966 
   49967 #if defined(LIBXML_XPATH_ENABLED)
   49968     int mem_base;
   49969     const xmlChar * ret_val;
   49970     xmlXPathContextPtr ctxt; /* the XPath context */
   49971     int n_ctxt;
   49972     xmlChar * prefix; /* the namespace prefix value */
   49973     int n_prefix;
   49974 
   49975     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathContextPtr;n_ctxt++) {
   49976     for (n_prefix = 0;n_prefix < gen_nb_const_xmlChar_ptr;n_prefix++) {
   49977         mem_base = xmlMemBlocks();
   49978         ctxt = gen_xmlXPathContextPtr(n_ctxt, 0);
   49979         prefix = gen_const_xmlChar_ptr(n_prefix, 1);
   49980 
   49981         ret_val = xmlXPathNsLookup(ctxt, (const xmlChar *)prefix);
   49982         desret_const_xmlChar_ptr(ret_val);
   49983         call_tests++;
   49984         des_xmlXPathContextPtr(n_ctxt, ctxt, 0);
   49985         des_const_xmlChar_ptr(n_prefix, (const xmlChar *)prefix, 1);
   49986         xmlResetLastError();
   49987         if (mem_base != xmlMemBlocks()) {
   49988             printf("Leak of %d blocks found in xmlXPathNsLookup",
   49989 	           xmlMemBlocks() - mem_base);
   49990 	    test_ret++;
   49991             printf(" %d", n_ctxt);
   49992             printf(" %d", n_prefix);
   49993             printf("\n");
   49994         }
   49995     }
   49996     }
   49997     function_tests++;
   49998 #endif
   49999 
   50000     return(test_ret);
   50001 }
   50002 
   50003 
   50004 static int
   50005 test_xmlXPathNumberFunction(void) {
   50006     int test_ret = 0;
   50007 
   50008 #if defined(LIBXML_XPATH_ENABLED)
   50009     int mem_base;
   50010     xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
   50011     int n_ctxt;
   50012     int nargs; /* the number of arguments */
   50013     int n_nargs;
   50014 
   50015     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
   50016     for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
   50017         mem_base = xmlMemBlocks();
   50018         ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
   50019         nargs = gen_int(n_nargs, 1);
   50020 
   50021         xmlXPathNumberFunction(ctxt, nargs);
   50022         call_tests++;
   50023         des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
   50024         des_int(n_nargs, nargs, 1);
   50025         xmlResetLastError();
   50026         if (mem_base != xmlMemBlocks()) {
   50027             printf("Leak of %d blocks found in xmlXPathNumberFunction",
   50028 	           xmlMemBlocks() - mem_base);
   50029 	    test_ret++;
   50030             printf(" %d", n_ctxt);
   50031             printf(" %d", n_nargs);
   50032             printf("\n");
   50033         }
   50034     }
   50035     }
   50036     function_tests++;
   50037 #endif
   50038 
   50039     return(test_ret);
   50040 }
   50041 
   50042 
   50043 static int
   50044 test_xmlXPathParseNCName(void) {
   50045     int test_ret = 0;
   50046 
   50047 #if defined(LIBXML_XPATH_ENABLED)
   50048     int mem_base;
   50049     xmlChar * ret_val;
   50050     xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
   50051     int n_ctxt;
   50052 
   50053     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
   50054         mem_base = xmlMemBlocks();
   50055         ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
   50056 
   50057         ret_val = xmlXPathParseNCName(ctxt);
   50058         desret_xmlChar_ptr(ret_val);
   50059         call_tests++;
   50060         des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
   50061         xmlResetLastError();
   50062         if (mem_base != xmlMemBlocks()) {
   50063             printf("Leak of %d blocks found in xmlXPathParseNCName",
   50064 	           xmlMemBlocks() - mem_base);
   50065 	    test_ret++;
   50066             printf(" %d", n_ctxt);
   50067             printf("\n");
   50068         }
   50069     }
   50070     function_tests++;
   50071 #endif
   50072 
   50073     return(test_ret);
   50074 }
   50075 
   50076 
   50077 static int
   50078 test_xmlXPathParseName(void) {
   50079     int test_ret = 0;
   50080 
   50081 #if defined(LIBXML_XPATH_ENABLED)
   50082     int mem_base;
   50083     xmlChar * ret_val;
   50084     xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
   50085     int n_ctxt;
   50086 
   50087     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
   50088         mem_base = xmlMemBlocks();
   50089         ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
   50090 
   50091         ret_val = xmlXPathParseName(ctxt);
   50092         desret_xmlChar_ptr(ret_val);
   50093         call_tests++;
   50094         des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
   50095         xmlResetLastError();
   50096         if (mem_base != xmlMemBlocks()) {
   50097             printf("Leak of %d blocks found in xmlXPathParseName",
   50098 	           xmlMemBlocks() - mem_base);
   50099 	    test_ret++;
   50100             printf(" %d", n_ctxt);
   50101             printf("\n");
   50102         }
   50103     }
   50104     function_tests++;
   50105 #endif
   50106 
   50107     return(test_ret);
   50108 }
   50109 
   50110 
   50111 static int
   50112 test_xmlXPathPopBoolean(void) {
   50113     int test_ret = 0;
   50114 
   50115 #if defined(LIBXML_XPATH_ENABLED)
   50116     int mem_base;
   50117     int ret_val;
   50118     xmlXPathParserContextPtr ctxt; /* an XPath parser context */
   50119     int n_ctxt;
   50120 
   50121     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
   50122         mem_base = xmlMemBlocks();
   50123         ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
   50124 
   50125         ret_val = xmlXPathPopBoolean(ctxt);
   50126         desret_int(ret_val);
   50127         call_tests++;
   50128         des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
   50129         xmlResetLastError();
   50130         if (mem_base != xmlMemBlocks()) {
   50131             printf("Leak of %d blocks found in xmlXPathPopBoolean",
   50132 	           xmlMemBlocks() - mem_base);
   50133 	    test_ret++;
   50134             printf(" %d", n_ctxt);
   50135             printf("\n");
   50136         }
   50137     }
   50138     function_tests++;
   50139 #endif
   50140 
   50141     return(test_ret);
   50142 }
   50143 
   50144 
   50145 static int
   50146 test_xmlXPathPopExternal(void) {
   50147     int test_ret = 0;
   50148 
   50149 #if defined(LIBXML_XPATH_ENABLED)
   50150     int mem_base;
   50151     void * ret_val;
   50152     xmlXPathParserContextPtr ctxt; /* an XPath parser context */
   50153     int n_ctxt;
   50154 
   50155     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
   50156         mem_base = xmlMemBlocks();
   50157         ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
   50158 
   50159         ret_val = xmlXPathPopExternal(ctxt);
   50160         desret_void_ptr(ret_val);
   50161         call_tests++;
   50162         des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
   50163         xmlResetLastError();
   50164         if (mem_base != xmlMemBlocks()) {
   50165             printf("Leak of %d blocks found in xmlXPathPopExternal",
   50166 	           xmlMemBlocks() - mem_base);
   50167 	    test_ret++;
   50168             printf(" %d", n_ctxt);
   50169             printf("\n");
   50170         }
   50171     }
   50172     function_tests++;
   50173 #endif
   50174 
   50175     return(test_ret);
   50176 }
   50177 
   50178 
   50179 static int
   50180 test_xmlXPathPopNodeSet(void) {
   50181     int test_ret = 0;
   50182 
   50183 #if defined(LIBXML_XPATH_ENABLED)
   50184     int mem_base;
   50185     xmlNodeSetPtr ret_val;
   50186     xmlXPathParserContextPtr ctxt; /* an XPath parser context */
   50187     int n_ctxt;
   50188 
   50189     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
   50190         mem_base = xmlMemBlocks();
   50191         ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
   50192 
   50193         ret_val = xmlXPathPopNodeSet(ctxt);
   50194         desret_xmlNodeSetPtr(ret_val);
   50195         call_tests++;
   50196         des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
   50197         xmlResetLastError();
   50198         if (mem_base != xmlMemBlocks()) {
   50199             printf("Leak of %d blocks found in xmlXPathPopNodeSet",
   50200 	           xmlMemBlocks() - mem_base);
   50201 	    test_ret++;
   50202             printf(" %d", n_ctxt);
   50203             printf("\n");
   50204         }
   50205     }
   50206     function_tests++;
   50207 #endif
   50208 
   50209     return(test_ret);
   50210 }
   50211 
   50212 
   50213 static int
   50214 test_xmlXPathPopNumber(void) {
   50215     int test_ret = 0;
   50216 
   50217 #if defined(LIBXML_XPATH_ENABLED)
   50218     int mem_base;
   50219     double ret_val;
   50220     xmlXPathParserContextPtr ctxt; /* an XPath parser context */
   50221     int n_ctxt;
   50222 
   50223     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
   50224         mem_base = xmlMemBlocks();
   50225         ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
   50226 
   50227         ret_val = xmlXPathPopNumber(ctxt);
   50228         desret_double(ret_val);
   50229         call_tests++;
   50230         des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
   50231         xmlResetLastError();
   50232         if (mem_base != xmlMemBlocks()) {
   50233             printf("Leak of %d blocks found in xmlXPathPopNumber",
   50234 	           xmlMemBlocks() - mem_base);
   50235 	    test_ret++;
   50236             printf(" %d", n_ctxt);
   50237             printf("\n");
   50238         }
   50239     }
   50240     function_tests++;
   50241 #endif
   50242 
   50243     return(test_ret);
   50244 }
   50245 
   50246 
   50247 static int
   50248 test_xmlXPathPopString(void) {
   50249     int test_ret = 0;
   50250 
   50251 #if defined(LIBXML_XPATH_ENABLED)
   50252     int mem_base;
   50253     xmlChar * ret_val;
   50254     xmlXPathParserContextPtr ctxt; /* an XPath parser context */
   50255     int n_ctxt;
   50256 
   50257     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
   50258         mem_base = xmlMemBlocks();
   50259         ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
   50260 
   50261         ret_val = xmlXPathPopString(ctxt);
   50262         desret_xmlChar_ptr(ret_val);
   50263         call_tests++;
   50264         des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
   50265         xmlResetLastError();
   50266         if (mem_base != xmlMemBlocks()) {
   50267             printf("Leak of %d blocks found in xmlXPathPopString",
   50268 	           xmlMemBlocks() - mem_base);
   50269 	    test_ret++;
   50270             printf(" %d", n_ctxt);
   50271             printf("\n");
   50272         }
   50273     }
   50274     function_tests++;
   50275 #endif
   50276 
   50277     return(test_ret);
   50278 }
   50279 
   50280 
   50281 static int
   50282 test_xmlXPathPositionFunction(void) {
   50283     int test_ret = 0;
   50284 
   50285 #if defined(LIBXML_XPATH_ENABLED)
   50286     int mem_base;
   50287     xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
   50288     int n_ctxt;
   50289     int nargs; /* the number of arguments */
   50290     int n_nargs;
   50291 
   50292     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
   50293     for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
   50294         mem_base = xmlMemBlocks();
   50295         ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
   50296         nargs = gen_int(n_nargs, 1);
   50297 
   50298         xmlXPathPositionFunction(ctxt, nargs);
   50299         call_tests++;
   50300         des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
   50301         des_int(n_nargs, nargs, 1);
   50302         xmlResetLastError();
   50303         if (mem_base != xmlMemBlocks()) {
   50304             printf("Leak of %d blocks found in xmlXPathPositionFunction",
   50305 	           xmlMemBlocks() - mem_base);
   50306 	    test_ret++;
   50307             printf(" %d", n_ctxt);
   50308             printf(" %d", n_nargs);
   50309             printf("\n");
   50310         }
   50311     }
   50312     }
   50313     function_tests++;
   50314 #endif
   50315 
   50316     return(test_ret);
   50317 }
   50318 
   50319 
   50320 static int
   50321 test_xmlXPathRegisterAllFunctions(void) {
   50322     int test_ret = 0;
   50323 
   50324 #if defined(LIBXML_XPATH_ENABLED)
   50325     int mem_base;
   50326     xmlXPathContextPtr ctxt; /* the XPath context */
   50327     int n_ctxt;
   50328 
   50329     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathContextPtr;n_ctxt++) {
   50330         mem_base = xmlMemBlocks();
   50331         ctxt = gen_xmlXPathContextPtr(n_ctxt, 0);
   50332 
   50333         xmlXPathRegisterAllFunctions(ctxt);
   50334         call_tests++;
   50335         des_xmlXPathContextPtr(n_ctxt, ctxt, 0);
   50336         xmlResetLastError();
   50337         if (mem_base != xmlMemBlocks()) {
   50338             printf("Leak of %d blocks found in xmlXPathRegisterAllFunctions",
   50339 	           xmlMemBlocks() - mem_base);
   50340 	    test_ret++;
   50341             printf(" %d", n_ctxt);
   50342             printf("\n");
   50343         }
   50344     }
   50345     function_tests++;
   50346 #endif
   50347 
   50348     return(test_ret);
   50349 }
   50350 
   50351 
   50352 static int
   50353 test_xmlXPathRegisterFunc(void) {
   50354     int test_ret = 0;
   50355 
   50356 
   50357     /* missing type support */
   50358     return(test_ret);
   50359 }
   50360 
   50361 
   50362 static int
   50363 test_xmlXPathRegisterFuncLookup(void) {
   50364     int test_ret = 0;
   50365 
   50366 
   50367     /* missing type support */
   50368     return(test_ret);
   50369 }
   50370 
   50371 
   50372 static int
   50373 test_xmlXPathRegisterFuncNS(void) {
   50374     int test_ret = 0;
   50375 
   50376 
   50377     /* missing type support */
   50378     return(test_ret);
   50379 }
   50380 
   50381 
   50382 static int
   50383 test_xmlXPathRegisterNs(void) {
   50384     int test_ret = 0;
   50385 
   50386 #if defined(LIBXML_XPATH_ENABLED)
   50387     int mem_base;
   50388     int ret_val;
   50389     xmlXPathContextPtr ctxt; /* the XPath context */
   50390     int n_ctxt;
   50391     xmlChar * prefix; /* the namespace prefix cannot be NULL or empty string */
   50392     int n_prefix;
   50393     xmlChar * ns_uri; /* the namespace name */
   50394     int n_ns_uri;
   50395 
   50396     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathContextPtr;n_ctxt++) {
   50397     for (n_prefix = 0;n_prefix < gen_nb_const_xmlChar_ptr;n_prefix++) {
   50398     for (n_ns_uri = 0;n_ns_uri < gen_nb_const_xmlChar_ptr;n_ns_uri++) {
   50399         mem_base = xmlMemBlocks();
   50400         ctxt = gen_xmlXPathContextPtr(n_ctxt, 0);
   50401         prefix = gen_const_xmlChar_ptr(n_prefix, 1);
   50402         ns_uri = gen_const_xmlChar_ptr(n_ns_uri, 2);
   50403 
   50404         ret_val = xmlXPathRegisterNs(ctxt, (const xmlChar *)prefix, (const xmlChar *)ns_uri);
   50405         desret_int(ret_val);
   50406         call_tests++;
   50407         des_xmlXPathContextPtr(n_ctxt, ctxt, 0);
   50408         des_const_xmlChar_ptr(n_prefix, (const xmlChar *)prefix, 1);
   50409         des_const_xmlChar_ptr(n_ns_uri, (const xmlChar *)ns_uri, 2);
   50410         xmlResetLastError();
   50411         if (mem_base != xmlMemBlocks()) {
   50412             printf("Leak of %d blocks found in xmlXPathRegisterNs",
   50413 	           xmlMemBlocks() - mem_base);
   50414 	    test_ret++;
   50415             printf(" %d", n_ctxt);
   50416             printf(" %d", n_prefix);
   50417             printf(" %d", n_ns_uri);
   50418             printf("\n");
   50419         }
   50420     }
   50421     }
   50422     }
   50423     function_tests++;
   50424 #endif
   50425 
   50426     return(test_ret);
   50427 }
   50428 
   50429 
   50430 static int
   50431 test_xmlXPathRegisterVariable(void) {
   50432     int test_ret = 0;
   50433 
   50434 #if defined(LIBXML_XPATH_ENABLED)
   50435     int mem_base;
   50436     int ret_val;
   50437     xmlXPathContextPtr ctxt; /* the XPath context */
   50438     int n_ctxt;
   50439     xmlChar * name; /* the variable name */
   50440     int n_name;
   50441     xmlXPathObjectPtr value; /* the variable value or NULL */
   50442     int n_value;
   50443 
   50444     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathContextPtr;n_ctxt++) {
   50445     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
   50446     for (n_value = 0;n_value < gen_nb_xmlXPathObjectPtr;n_value++) {
   50447         mem_base = xmlMemBlocks();
   50448         ctxt = gen_xmlXPathContextPtr(n_ctxt, 0);
   50449         name = gen_const_xmlChar_ptr(n_name, 1);
   50450         value = gen_xmlXPathObjectPtr(n_value, 2);
   50451 
   50452         ret_val = xmlXPathRegisterVariable(ctxt, (const xmlChar *)name, value);
   50453         desret_int(ret_val);
   50454         call_tests++;
   50455         des_xmlXPathContextPtr(n_ctxt, ctxt, 0);
   50456         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
   50457         des_xmlXPathObjectPtr(n_value, value, 2);
   50458         xmlResetLastError();
   50459         if (mem_base != xmlMemBlocks()) {
   50460             printf("Leak of %d blocks found in xmlXPathRegisterVariable",
   50461 	           xmlMemBlocks() - mem_base);
   50462 	    test_ret++;
   50463             printf(" %d", n_ctxt);
   50464             printf(" %d", n_name);
   50465             printf(" %d", n_value);
   50466             printf("\n");
   50467         }
   50468     }
   50469     }
   50470     }
   50471     function_tests++;
   50472 #endif
   50473 
   50474     return(test_ret);
   50475 }
   50476 
   50477 
   50478 static int
   50479 test_xmlXPathRegisterVariableLookup(void) {
   50480     int test_ret = 0;
   50481 
   50482 
   50483     /* missing type support */
   50484     return(test_ret);
   50485 }
   50486 
   50487 
   50488 static int
   50489 test_xmlXPathRegisterVariableNS(void) {
   50490     int test_ret = 0;
   50491 
   50492 #if defined(LIBXML_XPATH_ENABLED)
   50493     int mem_base;
   50494     int ret_val;
   50495     xmlXPathContextPtr ctxt; /* the XPath context */
   50496     int n_ctxt;
   50497     xmlChar * name; /* the variable name */
   50498     int n_name;
   50499     xmlChar * ns_uri; /* the variable namespace URI */
   50500     int n_ns_uri;
   50501     xmlXPathObjectPtr value; /* the variable value or NULL */
   50502     int n_value;
   50503 
   50504     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathContextPtr;n_ctxt++) {
   50505     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
   50506     for (n_ns_uri = 0;n_ns_uri < gen_nb_const_xmlChar_ptr;n_ns_uri++) {
   50507     for (n_value = 0;n_value < gen_nb_xmlXPathObjectPtr;n_value++) {
   50508         mem_base = xmlMemBlocks();
   50509         ctxt = gen_xmlXPathContextPtr(n_ctxt, 0);
   50510         name = gen_const_xmlChar_ptr(n_name, 1);
   50511         ns_uri = gen_const_xmlChar_ptr(n_ns_uri, 2);
   50512         value = gen_xmlXPathObjectPtr(n_value, 3);
   50513 
   50514         ret_val = xmlXPathRegisterVariableNS(ctxt, (const xmlChar *)name, (const xmlChar *)ns_uri, value);
   50515         desret_int(ret_val);
   50516         call_tests++;
   50517         des_xmlXPathContextPtr(n_ctxt, ctxt, 0);
   50518         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
   50519         des_const_xmlChar_ptr(n_ns_uri, (const xmlChar *)ns_uri, 2);
   50520         des_xmlXPathObjectPtr(n_value, value, 3);
   50521         xmlResetLastError();
   50522         if (mem_base != xmlMemBlocks()) {
   50523             printf("Leak of %d blocks found in xmlXPathRegisterVariableNS",
   50524 	           xmlMemBlocks() - mem_base);
   50525 	    test_ret++;
   50526             printf(" %d", n_ctxt);
   50527             printf(" %d", n_name);
   50528             printf(" %d", n_ns_uri);
   50529             printf(" %d", n_value);
   50530             printf("\n");
   50531         }
   50532     }
   50533     }
   50534     }
   50535     }
   50536     function_tests++;
   50537 #endif
   50538 
   50539     return(test_ret);
   50540 }
   50541 
   50542 
   50543 static int
   50544 test_xmlXPathRegisteredFuncsCleanup(void) {
   50545     int test_ret = 0;
   50546 
   50547 #if defined(LIBXML_XPATH_ENABLED)
   50548     int mem_base;
   50549     xmlXPathContextPtr ctxt; /* the XPath context */
   50550     int n_ctxt;
   50551 
   50552     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathContextPtr;n_ctxt++) {
   50553         mem_base = xmlMemBlocks();
   50554         ctxt = gen_xmlXPathContextPtr(n_ctxt, 0);
   50555 
   50556         xmlXPathRegisteredFuncsCleanup(ctxt);
   50557         call_tests++;
   50558         des_xmlXPathContextPtr(n_ctxt, ctxt, 0);
   50559         xmlResetLastError();
   50560         if (mem_base != xmlMemBlocks()) {
   50561             printf("Leak of %d blocks found in xmlXPathRegisteredFuncsCleanup",
   50562 	           xmlMemBlocks() - mem_base);
   50563 	    test_ret++;
   50564             printf(" %d", n_ctxt);
   50565             printf("\n");
   50566         }
   50567     }
   50568     function_tests++;
   50569 #endif
   50570 
   50571     return(test_ret);
   50572 }
   50573 
   50574 
   50575 static int
   50576 test_xmlXPathRegisteredNsCleanup(void) {
   50577     int test_ret = 0;
   50578 
   50579 #if defined(LIBXML_XPATH_ENABLED)
   50580     int mem_base;
   50581     xmlXPathContextPtr ctxt; /* the XPath context */
   50582     int n_ctxt;
   50583 
   50584     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathContextPtr;n_ctxt++) {
   50585         mem_base = xmlMemBlocks();
   50586         ctxt = gen_xmlXPathContextPtr(n_ctxt, 0);
   50587 
   50588         xmlXPathRegisteredNsCleanup(ctxt);
   50589         call_tests++;
   50590         des_xmlXPathContextPtr(n_ctxt, ctxt, 0);
   50591         xmlResetLastError();
   50592         if (mem_base != xmlMemBlocks()) {
   50593             printf("Leak of %d blocks found in xmlXPathRegisteredNsCleanup",
   50594 	           xmlMemBlocks() - mem_base);
   50595 	    test_ret++;
   50596             printf(" %d", n_ctxt);
   50597             printf("\n");
   50598         }
   50599     }
   50600     function_tests++;
   50601 #endif
   50602 
   50603     return(test_ret);
   50604 }
   50605 
   50606 
   50607 static int
   50608 test_xmlXPathRegisteredVariablesCleanup(void) {
   50609     int test_ret = 0;
   50610 
   50611 #if defined(LIBXML_XPATH_ENABLED)
   50612     int mem_base;
   50613     xmlXPathContextPtr ctxt; /* the XPath context */
   50614     int n_ctxt;
   50615 
   50616     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathContextPtr;n_ctxt++) {
   50617         mem_base = xmlMemBlocks();
   50618         ctxt = gen_xmlXPathContextPtr(n_ctxt, 0);
   50619 
   50620         xmlXPathRegisteredVariablesCleanup(ctxt);
   50621         call_tests++;
   50622         des_xmlXPathContextPtr(n_ctxt, ctxt, 0);
   50623         xmlResetLastError();
   50624         if (mem_base != xmlMemBlocks()) {
   50625             printf("Leak of %d blocks found in xmlXPathRegisteredVariablesCleanup",
   50626 	           xmlMemBlocks() - mem_base);
   50627 	    test_ret++;
   50628             printf(" %d", n_ctxt);
   50629             printf("\n");
   50630         }
   50631     }
   50632     function_tests++;
   50633 #endif
   50634 
   50635     return(test_ret);
   50636 }
   50637 
   50638 
   50639 static int
   50640 test_xmlXPathRoot(void) {
   50641     int test_ret = 0;
   50642 
   50643 #if defined(LIBXML_XPATH_ENABLED)
   50644     int mem_base;
   50645     xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
   50646     int n_ctxt;
   50647 
   50648     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
   50649         mem_base = xmlMemBlocks();
   50650         ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
   50651 
   50652         xmlXPathRoot(ctxt);
   50653         call_tests++;
   50654         des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
   50655         xmlResetLastError();
   50656         if (mem_base != xmlMemBlocks()) {
   50657             printf("Leak of %d blocks found in xmlXPathRoot",
   50658 	           xmlMemBlocks() - mem_base);
   50659 	    test_ret++;
   50660             printf(" %d", n_ctxt);
   50661             printf("\n");
   50662         }
   50663     }
   50664     function_tests++;
   50665 #endif
   50666 
   50667     return(test_ret);
   50668 }
   50669 
   50670 
   50671 static int
   50672 test_xmlXPathRoundFunction(void) {
   50673     int test_ret = 0;
   50674 
   50675 #if defined(LIBXML_XPATH_ENABLED)
   50676     int mem_base;
   50677     xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
   50678     int n_ctxt;
   50679     int nargs; /* the number of arguments */
   50680     int n_nargs;
   50681 
   50682     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
   50683     for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
   50684         mem_base = xmlMemBlocks();
   50685         ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
   50686         nargs = gen_int(n_nargs, 1);
   50687 
   50688         xmlXPathRoundFunction(ctxt, nargs);
   50689         call_tests++;
   50690         des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
   50691         des_int(n_nargs, nargs, 1);
   50692         xmlResetLastError();
   50693         if (mem_base != xmlMemBlocks()) {
   50694             printf("Leak of %d blocks found in xmlXPathRoundFunction",
   50695 	           xmlMemBlocks() - mem_base);
   50696 	    test_ret++;
   50697             printf(" %d", n_ctxt);
   50698             printf(" %d", n_nargs);
   50699             printf("\n");
   50700         }
   50701     }
   50702     }
   50703     function_tests++;
   50704 #endif
   50705 
   50706     return(test_ret);
   50707 }
   50708 
   50709 
   50710 static int
   50711 test_xmlXPathStartsWithFunction(void) {
   50712     int test_ret = 0;
   50713 
   50714 #if defined(LIBXML_XPATH_ENABLED)
   50715     int mem_base;
   50716     xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
   50717     int n_ctxt;
   50718     int nargs; /* the number of arguments */
   50719     int n_nargs;
   50720 
   50721     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
   50722     for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
   50723         mem_base = xmlMemBlocks();
   50724         ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
   50725         nargs = gen_int(n_nargs, 1);
   50726 
   50727         xmlXPathStartsWithFunction(ctxt, nargs);
   50728         call_tests++;
   50729         des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
   50730         des_int(n_nargs, nargs, 1);
   50731         xmlResetLastError();
   50732         if (mem_base != xmlMemBlocks()) {
   50733             printf("Leak of %d blocks found in xmlXPathStartsWithFunction",
   50734 	           xmlMemBlocks() - mem_base);
   50735 	    test_ret++;
   50736             printf(" %d", n_ctxt);
   50737             printf(" %d", n_nargs);
   50738             printf("\n");
   50739         }
   50740     }
   50741     }
   50742     function_tests++;
   50743 #endif
   50744 
   50745     return(test_ret);
   50746 }
   50747 
   50748 
   50749 static int
   50750 test_xmlXPathStringEvalNumber(void) {
   50751     int test_ret = 0;
   50752 
   50753 #if defined(LIBXML_XPATH_ENABLED)
   50754     int mem_base;
   50755     double ret_val;
   50756     xmlChar * str; /* A string to scan */
   50757     int n_str;
   50758 
   50759     for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) {
   50760         mem_base = xmlMemBlocks();
   50761         str = gen_const_xmlChar_ptr(n_str, 0);
   50762 
   50763         ret_val = xmlXPathStringEvalNumber((const xmlChar *)str);
   50764         desret_double(ret_val);
   50765         call_tests++;
   50766         des_const_xmlChar_ptr(n_str, (const xmlChar *)str, 0);
   50767         xmlResetLastError();
   50768         if (mem_base != xmlMemBlocks()) {
   50769             printf("Leak of %d blocks found in xmlXPathStringEvalNumber",
   50770 	           xmlMemBlocks() - mem_base);
   50771 	    test_ret++;
   50772             printf(" %d", n_str);
   50773             printf("\n");
   50774         }
   50775     }
   50776     function_tests++;
   50777 #endif
   50778 
   50779     return(test_ret);
   50780 }
   50781 
   50782 
   50783 static int
   50784 test_xmlXPathStringFunction(void) {
   50785     int test_ret = 0;
   50786 
   50787 #if defined(LIBXML_XPATH_ENABLED)
   50788     int mem_base;
   50789     xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
   50790     int n_ctxt;
   50791     int nargs; /* the number of arguments */
   50792     int n_nargs;
   50793 
   50794     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
   50795     for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
   50796         mem_base = xmlMemBlocks();
   50797         ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
   50798         nargs = gen_int(n_nargs, 1);
   50799 
   50800         xmlXPathStringFunction(ctxt, nargs);
   50801         call_tests++;
   50802         des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
   50803         des_int(n_nargs, nargs, 1);
   50804         xmlResetLastError();
   50805         if (mem_base != xmlMemBlocks()) {
   50806             printf("Leak of %d blocks found in xmlXPathStringFunction",
   50807 	           xmlMemBlocks() - mem_base);
   50808 	    test_ret++;
   50809             printf(" %d", n_ctxt);
   50810             printf(" %d", n_nargs);
   50811             printf("\n");
   50812         }
   50813     }
   50814     }
   50815     function_tests++;
   50816 #endif
   50817 
   50818     return(test_ret);
   50819 }
   50820 
   50821 
   50822 static int
   50823 test_xmlXPathStringLengthFunction(void) {
   50824     int test_ret = 0;
   50825 
   50826 #if defined(LIBXML_XPATH_ENABLED)
   50827     int mem_base;
   50828     xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
   50829     int n_ctxt;
   50830     int nargs; /* the number of arguments */
   50831     int n_nargs;
   50832 
   50833     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
   50834     for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
   50835         mem_base = xmlMemBlocks();
   50836         ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
   50837         nargs = gen_int(n_nargs, 1);
   50838 
   50839         xmlXPathStringLengthFunction(ctxt, nargs);
   50840         call_tests++;
   50841         des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
   50842         des_int(n_nargs, nargs, 1);
   50843         xmlResetLastError();
   50844         if (mem_base != xmlMemBlocks()) {
   50845             printf("Leak of %d blocks found in xmlXPathStringLengthFunction",
   50846 	           xmlMemBlocks() - mem_base);
   50847 	    test_ret++;
   50848             printf(" %d", n_ctxt);
   50849             printf(" %d", n_nargs);
   50850             printf("\n");
   50851         }
   50852     }
   50853     }
   50854     function_tests++;
   50855 #endif
   50856 
   50857     return(test_ret);
   50858 }
   50859 
   50860 
   50861 static int
   50862 test_xmlXPathSubValues(void) {
   50863     int test_ret = 0;
   50864 
   50865 #if defined(LIBXML_XPATH_ENABLED)
   50866     int mem_base;
   50867     xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
   50868     int n_ctxt;
   50869 
   50870     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
   50871         mem_base = xmlMemBlocks();
   50872         ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
   50873 
   50874         xmlXPathSubValues(ctxt);
   50875         call_tests++;
   50876         des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
   50877         xmlResetLastError();
   50878         if (mem_base != xmlMemBlocks()) {
   50879             printf("Leak of %d blocks found in xmlXPathSubValues",
   50880 	           xmlMemBlocks() - mem_base);
   50881 	    test_ret++;
   50882             printf(" %d", n_ctxt);
   50883             printf("\n");
   50884         }
   50885     }
   50886     function_tests++;
   50887 #endif
   50888 
   50889     return(test_ret);
   50890 }
   50891 
   50892 
   50893 static int
   50894 test_xmlXPathSubstringAfterFunction(void) {
   50895     int test_ret = 0;
   50896 
   50897 #if defined(LIBXML_XPATH_ENABLED)
   50898     int mem_base;
   50899     xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
   50900     int n_ctxt;
   50901     int nargs; /* the number of arguments */
   50902     int n_nargs;
   50903 
   50904     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
   50905     for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
   50906         mem_base = xmlMemBlocks();
   50907         ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
   50908         nargs = gen_int(n_nargs, 1);
   50909 
   50910         xmlXPathSubstringAfterFunction(ctxt, nargs);
   50911         call_tests++;
   50912         des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
   50913         des_int(n_nargs, nargs, 1);
   50914         xmlResetLastError();
   50915         if (mem_base != xmlMemBlocks()) {
   50916             printf("Leak of %d blocks found in xmlXPathSubstringAfterFunction",
   50917 	           xmlMemBlocks() - mem_base);
   50918 	    test_ret++;
   50919             printf(" %d", n_ctxt);
   50920             printf(" %d", n_nargs);
   50921             printf("\n");
   50922         }
   50923     }
   50924     }
   50925     function_tests++;
   50926 #endif
   50927 
   50928     return(test_ret);
   50929 }
   50930 
   50931 
   50932 static int
   50933 test_xmlXPathSubstringBeforeFunction(void) {
   50934     int test_ret = 0;
   50935 
   50936 #if defined(LIBXML_XPATH_ENABLED)
   50937     int mem_base;
   50938     xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
   50939     int n_ctxt;
   50940     int nargs; /* the number of arguments */
   50941     int n_nargs;
   50942 
   50943     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
   50944     for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
   50945         mem_base = xmlMemBlocks();
   50946         ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
   50947         nargs = gen_int(n_nargs, 1);
   50948 
   50949         xmlXPathSubstringBeforeFunction(ctxt, nargs);
   50950         call_tests++;
   50951         des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
   50952         des_int(n_nargs, nargs, 1);
   50953         xmlResetLastError();
   50954         if (mem_base != xmlMemBlocks()) {
   50955             printf("Leak of %d blocks found in xmlXPathSubstringBeforeFunction",
   50956 	           xmlMemBlocks() - mem_base);
   50957 	    test_ret++;
   50958             printf(" %d", n_ctxt);
   50959             printf(" %d", n_nargs);
   50960             printf("\n");
   50961         }
   50962     }
   50963     }
   50964     function_tests++;
   50965 #endif
   50966 
   50967     return(test_ret);
   50968 }
   50969 
   50970 
   50971 static int
   50972 test_xmlXPathSubstringFunction(void) {
   50973     int test_ret = 0;
   50974 
   50975 #if defined(LIBXML_XPATH_ENABLED)
   50976     int mem_base;
   50977     xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
   50978     int n_ctxt;
   50979     int nargs; /* the number of arguments */
   50980     int n_nargs;
   50981 
   50982     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
   50983     for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
   50984         mem_base = xmlMemBlocks();
   50985         ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
   50986         nargs = gen_int(n_nargs, 1);
   50987 
   50988         xmlXPathSubstringFunction(ctxt, nargs);
   50989         call_tests++;
   50990         des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
   50991         des_int(n_nargs, nargs, 1);
   50992         xmlResetLastError();
   50993         if (mem_base != xmlMemBlocks()) {
   50994             printf("Leak of %d blocks found in xmlXPathSubstringFunction",
   50995 	           xmlMemBlocks() - mem_base);
   50996 	    test_ret++;
   50997             printf(" %d", n_ctxt);
   50998             printf(" %d", n_nargs);
   50999             printf("\n");
   51000         }
   51001     }
   51002     }
   51003     function_tests++;
   51004 #endif
   51005 
   51006     return(test_ret);
   51007 }
   51008 
   51009 
   51010 static int
   51011 test_xmlXPathSumFunction(void) {
   51012     int test_ret = 0;
   51013 
   51014 #if defined(LIBXML_XPATH_ENABLED)
   51015     int mem_base;
   51016     xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
   51017     int n_ctxt;
   51018     int nargs; /* the number of arguments */
   51019     int n_nargs;
   51020 
   51021     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
   51022     for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
   51023         mem_base = xmlMemBlocks();
   51024         ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
   51025         nargs = gen_int(n_nargs, 1);
   51026 
   51027         xmlXPathSumFunction(ctxt, nargs);
   51028         call_tests++;
   51029         des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
   51030         des_int(n_nargs, nargs, 1);
   51031         xmlResetLastError();
   51032         if (mem_base != xmlMemBlocks()) {
   51033             printf("Leak of %d blocks found in xmlXPathSumFunction",
   51034 	           xmlMemBlocks() - mem_base);
   51035 	    test_ret++;
   51036             printf(" %d", n_ctxt);
   51037             printf(" %d", n_nargs);
   51038             printf("\n");
   51039         }
   51040     }
   51041     }
   51042     function_tests++;
   51043 #endif
   51044 
   51045     return(test_ret);
   51046 }
   51047 
   51048 
   51049 static int
   51050 test_xmlXPathTrailing(void) {
   51051     int test_ret = 0;
   51052 
   51053 #if defined(LIBXML_XPATH_ENABLED)
   51054     int mem_base;
   51055     xmlNodeSetPtr ret_val;
   51056     xmlNodeSetPtr nodes1; /* a node-set */
   51057     int n_nodes1;
   51058     xmlNodeSetPtr nodes2; /* a node-set */
   51059     int n_nodes2;
   51060 
   51061     for (n_nodes1 = 0;n_nodes1 < gen_nb_xmlNodeSetPtr;n_nodes1++) {
   51062     for (n_nodes2 = 0;n_nodes2 < gen_nb_xmlNodeSetPtr;n_nodes2++) {
   51063         mem_base = xmlMemBlocks();
   51064         nodes1 = gen_xmlNodeSetPtr(n_nodes1, 0);
   51065         nodes2 = gen_xmlNodeSetPtr(n_nodes2, 1);
   51066 
   51067         ret_val = xmlXPathTrailing(nodes1, nodes2);
   51068         desret_xmlNodeSetPtr(ret_val);
   51069         call_tests++;
   51070         des_xmlNodeSetPtr(n_nodes1, nodes1, 0);
   51071         des_xmlNodeSetPtr(n_nodes2, nodes2, 1);
   51072         xmlResetLastError();
   51073         if (mem_base != xmlMemBlocks()) {
   51074             printf("Leak of %d blocks found in xmlXPathTrailing",
   51075 	           xmlMemBlocks() - mem_base);
   51076 	    test_ret++;
   51077             printf(" %d", n_nodes1);
   51078             printf(" %d", n_nodes2);
   51079             printf("\n");
   51080         }
   51081     }
   51082     }
   51083     function_tests++;
   51084 #endif
   51085 
   51086     return(test_ret);
   51087 }
   51088 
   51089 
   51090 static int
   51091 test_xmlXPathTrailingSorted(void) {
   51092     int test_ret = 0;
   51093 
   51094 #if defined(LIBXML_XPATH_ENABLED)
   51095     int mem_base;
   51096     xmlNodeSetPtr ret_val;
   51097     xmlNodeSetPtr nodes1; /* a node-set, sorted by document order */
   51098     int n_nodes1;
   51099     xmlNodeSetPtr nodes2; /* a node-set, sorted by document order */
   51100     int n_nodes2;
   51101 
   51102     for (n_nodes1 = 0;n_nodes1 < gen_nb_xmlNodeSetPtr;n_nodes1++) {
   51103     for (n_nodes2 = 0;n_nodes2 < gen_nb_xmlNodeSetPtr;n_nodes2++) {
   51104         mem_base = xmlMemBlocks();
   51105         nodes1 = gen_xmlNodeSetPtr(n_nodes1, 0);
   51106         nodes2 = gen_xmlNodeSetPtr(n_nodes2, 1);
   51107 
   51108         ret_val = xmlXPathTrailingSorted(nodes1, nodes2);
   51109         desret_xmlNodeSetPtr(ret_val);
   51110         call_tests++;
   51111         des_xmlNodeSetPtr(n_nodes1, nodes1, 0);
   51112         des_xmlNodeSetPtr(n_nodes2, nodes2, 1);
   51113         xmlResetLastError();
   51114         if (mem_base != xmlMemBlocks()) {
   51115             printf("Leak of %d blocks found in xmlXPathTrailingSorted",
   51116 	           xmlMemBlocks() - mem_base);
   51117 	    test_ret++;
   51118             printf(" %d", n_nodes1);
   51119             printf(" %d", n_nodes2);
   51120             printf("\n");
   51121         }
   51122     }
   51123     }
   51124     function_tests++;
   51125 #endif
   51126 
   51127     return(test_ret);
   51128 }
   51129 
   51130 
   51131 static int
   51132 test_xmlXPathTranslateFunction(void) {
   51133     int test_ret = 0;
   51134 
   51135 #if defined(LIBXML_XPATH_ENABLED)
   51136     int mem_base;
   51137     xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
   51138     int n_ctxt;
   51139     int nargs; /* the number of arguments */
   51140     int n_nargs;
   51141 
   51142     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
   51143     for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
   51144         mem_base = xmlMemBlocks();
   51145         ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
   51146         nargs = gen_int(n_nargs, 1);
   51147 
   51148         xmlXPathTranslateFunction(ctxt, nargs);
   51149         call_tests++;
   51150         des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
   51151         des_int(n_nargs, nargs, 1);
   51152         xmlResetLastError();
   51153         if (mem_base != xmlMemBlocks()) {
   51154             printf("Leak of %d blocks found in xmlXPathTranslateFunction",
   51155 	           xmlMemBlocks() - mem_base);
   51156 	    test_ret++;
   51157             printf(" %d", n_ctxt);
   51158             printf(" %d", n_nargs);
   51159             printf("\n");
   51160         }
   51161     }
   51162     }
   51163     function_tests++;
   51164 #endif
   51165 
   51166     return(test_ret);
   51167 }
   51168 
   51169 
   51170 static int
   51171 test_xmlXPathTrueFunction(void) {
   51172     int test_ret = 0;
   51173 
   51174 #if defined(LIBXML_XPATH_ENABLED)
   51175     int mem_base;
   51176     xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
   51177     int n_ctxt;
   51178     int nargs; /* the number of arguments */
   51179     int n_nargs;
   51180 
   51181     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
   51182     for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
   51183         mem_base = xmlMemBlocks();
   51184         ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
   51185         nargs = gen_int(n_nargs, 1);
   51186 
   51187         xmlXPathTrueFunction(ctxt, nargs);
   51188         call_tests++;
   51189         des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
   51190         des_int(n_nargs, nargs, 1);
   51191         xmlResetLastError();
   51192         if (mem_base != xmlMemBlocks()) {
   51193             printf("Leak of %d blocks found in xmlXPathTrueFunction",
   51194 	           xmlMemBlocks() - mem_base);
   51195 	    test_ret++;
   51196             printf(" %d", n_ctxt);
   51197             printf(" %d", n_nargs);
   51198             printf("\n");
   51199         }
   51200     }
   51201     }
   51202     function_tests++;
   51203 #endif
   51204 
   51205     return(test_ret);
   51206 }
   51207 
   51208 
   51209 static int
   51210 test_xmlXPathValueFlipSign(void) {
   51211     int test_ret = 0;
   51212 
   51213 #if defined(LIBXML_XPATH_ENABLED)
   51214     int mem_base;
   51215     xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
   51216     int n_ctxt;
   51217 
   51218     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
   51219         mem_base = xmlMemBlocks();
   51220         ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
   51221 
   51222         xmlXPathValueFlipSign(ctxt);
   51223         call_tests++;
   51224         des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
   51225         xmlResetLastError();
   51226         if (mem_base != xmlMemBlocks()) {
   51227             printf("Leak of %d blocks found in xmlXPathValueFlipSign",
   51228 	           xmlMemBlocks() - mem_base);
   51229 	    test_ret++;
   51230             printf(" %d", n_ctxt);
   51231             printf("\n");
   51232         }
   51233     }
   51234     function_tests++;
   51235 #endif
   51236 
   51237     return(test_ret);
   51238 }
   51239 
   51240 
   51241 static int
   51242 test_xmlXPathVariableLookup(void) {
   51243     int test_ret = 0;
   51244 
   51245 #if defined(LIBXML_XPATH_ENABLED)
   51246     int mem_base;
   51247     xmlXPathObjectPtr ret_val;
   51248     xmlXPathContextPtr ctxt; /* the XPath context */
   51249     int n_ctxt;
   51250     xmlChar * name; /* the variable name */
   51251     int n_name;
   51252 
   51253     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathContextPtr;n_ctxt++) {
   51254     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
   51255         mem_base = xmlMemBlocks();
   51256         ctxt = gen_xmlXPathContextPtr(n_ctxt, 0);
   51257         name = gen_const_xmlChar_ptr(n_name, 1);
   51258 
   51259         ret_val = xmlXPathVariableLookup(ctxt, (const xmlChar *)name);
   51260         desret_xmlXPathObjectPtr(ret_val);
   51261         call_tests++;
   51262         des_xmlXPathContextPtr(n_ctxt, ctxt, 0);
   51263         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
   51264         xmlResetLastError();
   51265         if (mem_base != xmlMemBlocks()) {
   51266             printf("Leak of %d blocks found in xmlXPathVariableLookup",
   51267 	           xmlMemBlocks() - mem_base);
   51268 	    test_ret++;
   51269             printf(" %d", n_ctxt);
   51270             printf(" %d", n_name);
   51271             printf("\n");
   51272         }
   51273     }
   51274     }
   51275     function_tests++;
   51276 #endif
   51277 
   51278     return(test_ret);
   51279 }
   51280 
   51281 
   51282 static int
   51283 test_xmlXPathVariableLookupNS(void) {
   51284     int test_ret = 0;
   51285 
   51286 #if defined(LIBXML_XPATH_ENABLED)
   51287     int mem_base;
   51288     xmlXPathObjectPtr ret_val;
   51289     xmlXPathContextPtr ctxt; /* the XPath context */
   51290     int n_ctxt;
   51291     xmlChar * name; /* the variable name */
   51292     int n_name;
   51293     xmlChar * ns_uri; /* the variable namespace URI */
   51294     int n_ns_uri;
   51295 
   51296     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathContextPtr;n_ctxt++) {
   51297     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
   51298     for (n_ns_uri = 0;n_ns_uri < gen_nb_const_xmlChar_ptr;n_ns_uri++) {
   51299         mem_base = xmlMemBlocks();
   51300         ctxt = gen_xmlXPathContextPtr(n_ctxt, 0);
   51301         name = gen_const_xmlChar_ptr(n_name, 1);
   51302         ns_uri = gen_const_xmlChar_ptr(n_ns_uri, 2);
   51303 
   51304         ret_val = xmlXPathVariableLookupNS(ctxt, (const xmlChar *)name, (const xmlChar *)ns_uri);
   51305         desret_xmlXPathObjectPtr(ret_val);
   51306         call_tests++;
   51307         des_xmlXPathContextPtr(n_ctxt, ctxt, 0);
   51308         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
   51309         des_const_xmlChar_ptr(n_ns_uri, (const xmlChar *)ns_uri, 2);
   51310         xmlResetLastError();
   51311         if (mem_base != xmlMemBlocks()) {
   51312             printf("Leak of %d blocks found in xmlXPathVariableLookupNS",
   51313 	           xmlMemBlocks() - mem_base);
   51314 	    test_ret++;
   51315             printf(" %d", n_ctxt);
   51316             printf(" %d", n_name);
   51317             printf(" %d", n_ns_uri);
   51318             printf("\n");
   51319         }
   51320     }
   51321     }
   51322     }
   51323     function_tests++;
   51324 #endif
   51325 
   51326     return(test_ret);
   51327 }
   51328 
   51329 
   51330 static int
   51331 test_xmlXPathWrapCString(void) {
   51332     int test_ret = 0;
   51333 
   51334 #if defined(LIBXML_XPATH_ENABLED)
   51335     int mem_base;
   51336     xmlXPathObjectPtr ret_val;
   51337     char * val; /* the char * value */
   51338     int n_val;
   51339 
   51340     for (n_val = 0;n_val < gen_nb_char_ptr;n_val++) {
   51341         mem_base = xmlMemBlocks();
   51342         val = gen_char_ptr(n_val, 0);
   51343 
   51344         ret_val = xmlXPathWrapCString(val);
   51345         desret_xmlXPathObjectPtr(ret_val);
   51346         call_tests++;
   51347         des_char_ptr(n_val, val, 0);
   51348         xmlResetLastError();
   51349         if (mem_base != xmlMemBlocks()) {
   51350             printf("Leak of %d blocks found in xmlXPathWrapCString",
   51351 	           xmlMemBlocks() - mem_base);
   51352 	    test_ret++;
   51353             printf(" %d", n_val);
   51354             printf("\n");
   51355         }
   51356     }
   51357     function_tests++;
   51358 #endif
   51359 
   51360     return(test_ret);
   51361 }
   51362 
   51363 
   51364 static int
   51365 test_xmlXPathWrapExternal(void) {
   51366     int test_ret = 0;
   51367 
   51368 #if defined(LIBXML_XPATH_ENABLED)
   51369     int mem_base;
   51370     xmlXPathObjectPtr ret_val;
   51371     void * val; /* the user data */
   51372     int n_val;
   51373 
   51374     for (n_val = 0;n_val < gen_nb_void_ptr;n_val++) {
   51375         mem_base = xmlMemBlocks();
   51376         val = gen_void_ptr(n_val, 0);
   51377 
   51378         ret_val = xmlXPathWrapExternal(val);
   51379         desret_xmlXPathObjectPtr(ret_val);
   51380         call_tests++;
   51381         des_void_ptr(n_val, val, 0);
   51382         xmlResetLastError();
   51383         if (mem_base != xmlMemBlocks()) {
   51384             printf("Leak of %d blocks found in xmlXPathWrapExternal",
   51385 	           xmlMemBlocks() - mem_base);
   51386 	    test_ret++;
   51387             printf(" %d", n_val);
   51388             printf("\n");
   51389         }
   51390     }
   51391     function_tests++;
   51392 #endif
   51393 
   51394     return(test_ret);
   51395 }
   51396 
   51397 
   51398 static int
   51399 test_xmlXPathWrapNodeSet(void) {
   51400     int test_ret = 0;
   51401 
   51402 #if defined(LIBXML_XPATH_ENABLED)
   51403     int mem_base;
   51404     xmlXPathObjectPtr ret_val;
   51405     xmlNodeSetPtr val; /* the NodePtr value */
   51406     int n_val;
   51407 
   51408     for (n_val = 0;n_val < gen_nb_xmlNodeSetPtr;n_val++) {
   51409         mem_base = xmlMemBlocks();
   51410         val = gen_xmlNodeSetPtr(n_val, 0);
   51411 
   51412         ret_val = xmlXPathWrapNodeSet(val);
   51413         desret_xmlXPathObjectPtr(ret_val);
   51414         call_tests++;
   51415         des_xmlNodeSetPtr(n_val, val, 0);
   51416         xmlResetLastError();
   51417         if (mem_base != xmlMemBlocks()) {
   51418             printf("Leak of %d blocks found in xmlXPathWrapNodeSet",
   51419 	           xmlMemBlocks() - mem_base);
   51420 	    test_ret++;
   51421             printf(" %d", n_val);
   51422             printf("\n");
   51423         }
   51424     }
   51425     function_tests++;
   51426 #endif
   51427 
   51428     return(test_ret);
   51429 }
   51430 
   51431 
   51432 static int
   51433 test_xmlXPatherror(void) {
   51434     int test_ret = 0;
   51435 
   51436 #if defined(LIBXML_XPATH_ENABLED)
   51437     int mem_base;
   51438     xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
   51439     int n_ctxt;
   51440     const char * file; /* the file name */
   51441     int n_file;
   51442     int line; /* the line number */
   51443     int n_line;
   51444     int no; /* the error number */
   51445     int n_no;
   51446 
   51447     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
   51448     for (n_file = 0;n_file < gen_nb_filepath;n_file++) {
   51449     for (n_line = 0;n_line < gen_nb_int;n_line++) {
   51450     for (n_no = 0;n_no < gen_nb_int;n_no++) {
   51451         mem_base = xmlMemBlocks();
   51452         ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
   51453         file = gen_filepath(n_file, 1);
   51454         line = gen_int(n_line, 2);
   51455         no = gen_int(n_no, 3);
   51456 
   51457         xmlXPatherror(ctxt, file, line, no);
   51458         call_tests++;
   51459         des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
   51460         des_filepath(n_file, file, 1);
   51461         des_int(n_line, line, 2);
   51462         des_int(n_no, no, 3);
   51463         xmlResetLastError();
   51464         if (mem_base != xmlMemBlocks()) {
   51465             printf("Leak of %d blocks found in xmlXPatherror",
   51466 	           xmlMemBlocks() - mem_base);
   51467 	    test_ret++;
   51468             printf(" %d", n_ctxt);
   51469             printf(" %d", n_file);
   51470             printf(" %d", n_line);
   51471             printf(" %d", n_no);
   51472             printf("\n");
   51473         }
   51474     }
   51475     }
   51476     }
   51477     }
   51478     function_tests++;
   51479 #endif
   51480 
   51481     return(test_ret);
   51482 }
   51483 
   51484 static int
   51485 test_xpathInternals(void) {
   51486     int test_ret = 0;
   51487 
   51488     if (quiet == 0) printf("Testing xpathInternals : 106 of 117 functions ...\n");
   51489     test_ret += test_valuePop();
   51490     test_ret += test_valuePush();
   51491     test_ret += test_xmlXPathAddValues();
   51492     test_ret += test_xmlXPathBooleanFunction();
   51493     test_ret += test_xmlXPathCeilingFunction();
   51494     test_ret += test_xmlXPathCompareValues();
   51495     test_ret += test_xmlXPathConcatFunction();
   51496     test_ret += test_xmlXPathContainsFunction();
   51497     test_ret += test_xmlXPathCountFunction();
   51498     test_ret += test_xmlXPathDebugDumpCompExpr();
   51499     test_ret += test_xmlXPathDebugDumpObject();
   51500     test_ret += test_xmlXPathDifference();
   51501     test_ret += test_xmlXPathDistinct();
   51502     test_ret += test_xmlXPathDistinctSorted();
   51503     test_ret += test_xmlXPathDivValues();
   51504     test_ret += test_xmlXPathEqualValues();
   51505     test_ret += test_xmlXPathErr();
   51506     test_ret += test_xmlXPathEvalExpr();
   51507     test_ret += test_xmlXPathEvaluatePredicateResult();
   51508     test_ret += test_xmlXPathFalseFunction();
   51509     test_ret += test_xmlXPathFloorFunction();
   51510     test_ret += test_xmlXPathFunctionLookup();
   51511     test_ret += test_xmlXPathFunctionLookupNS();
   51512     test_ret += test_xmlXPathHasSameNodes();
   51513     test_ret += test_xmlXPathIdFunction();
   51514     test_ret += test_xmlXPathIntersection();
   51515     test_ret += test_xmlXPathIsNodeType();
   51516     test_ret += test_xmlXPathLangFunction();
   51517     test_ret += test_xmlXPathLastFunction();
   51518     test_ret += test_xmlXPathLeading();
   51519     test_ret += test_xmlXPathLeadingSorted();
   51520     test_ret += test_xmlXPathLocalNameFunction();
   51521     test_ret += test_xmlXPathModValues();
   51522     test_ret += test_xmlXPathMultValues();
   51523     test_ret += test_xmlXPathNamespaceURIFunction();
   51524     test_ret += test_xmlXPathNewBoolean();
   51525     test_ret += test_xmlXPathNewCString();
   51526     test_ret += test_xmlXPathNewFloat();
   51527     test_ret += test_xmlXPathNewNodeSet();
   51528     test_ret += test_xmlXPathNewNodeSetList();
   51529     test_ret += test_xmlXPathNewParserContext();
   51530     test_ret += test_xmlXPathNewString();
   51531     test_ret += test_xmlXPathNextAncestor();
   51532     test_ret += test_xmlXPathNextAncestorOrSelf();
   51533     test_ret += test_xmlXPathNextAttribute();
   51534     test_ret += test_xmlXPathNextChild();
   51535     test_ret += test_xmlXPathNextDescendant();
   51536     test_ret += test_xmlXPathNextDescendantOrSelf();
   51537     test_ret += test_xmlXPathNextFollowing();
   51538     test_ret += test_xmlXPathNextFollowingSibling();
   51539     test_ret += test_xmlXPathNextNamespace();
   51540     test_ret += test_xmlXPathNextParent();
   51541     test_ret += test_xmlXPathNextPreceding();
   51542     test_ret += test_xmlXPathNextPrecedingSibling();
   51543     test_ret += test_xmlXPathNextSelf();
   51544     test_ret += test_xmlXPathNodeLeading();
   51545     test_ret += test_xmlXPathNodeLeadingSorted();
   51546     test_ret += test_xmlXPathNodeSetAdd();
   51547     test_ret += test_xmlXPathNodeSetAddNs();
   51548     test_ret += test_xmlXPathNodeSetAddUnique();
   51549     test_ret += test_xmlXPathNodeSetContains();
   51550     test_ret += test_xmlXPathNodeSetDel();
   51551     test_ret += test_xmlXPathNodeSetMerge();
   51552     test_ret += test_xmlXPathNodeSetRemove();
   51553     test_ret += test_xmlXPathNodeSetSort();
   51554     test_ret += test_xmlXPathNodeTrailing();
   51555     test_ret += test_xmlXPathNodeTrailingSorted();
   51556     test_ret += test_xmlXPathNormalizeFunction();
   51557     test_ret += test_xmlXPathNotEqualValues();
   51558     test_ret += test_xmlXPathNotFunction();
   51559     test_ret += test_xmlXPathNsLookup();
   51560     test_ret += test_xmlXPathNumberFunction();
   51561     test_ret += test_xmlXPathParseNCName();
   51562     test_ret += test_xmlXPathParseName();
   51563     test_ret += test_xmlXPathPopBoolean();
   51564     test_ret += test_xmlXPathPopExternal();
   51565     test_ret += test_xmlXPathPopNodeSet();
   51566     test_ret += test_xmlXPathPopNumber();
   51567     test_ret += test_xmlXPathPopString();
   51568     test_ret += test_xmlXPathPositionFunction();
   51569     test_ret += test_xmlXPathRegisterAllFunctions();
   51570     test_ret += test_xmlXPathRegisterFunc();
   51571     test_ret += test_xmlXPathRegisterFuncLookup();
   51572     test_ret += test_xmlXPathRegisterFuncNS();
   51573     test_ret += test_xmlXPathRegisterNs();
   51574     test_ret += test_xmlXPathRegisterVariable();
   51575     test_ret += test_xmlXPathRegisterVariableLookup();
   51576     test_ret += test_xmlXPathRegisterVariableNS();
   51577     test_ret += test_xmlXPathRegisteredFuncsCleanup();
   51578     test_ret += test_xmlXPathRegisteredNsCleanup();
   51579     test_ret += test_xmlXPathRegisteredVariablesCleanup();
   51580     test_ret += test_xmlXPathRoot();
   51581     test_ret += test_xmlXPathRoundFunction();
   51582     test_ret += test_xmlXPathStartsWithFunction();
   51583     test_ret += test_xmlXPathStringEvalNumber();
   51584     test_ret += test_xmlXPathStringFunction();
   51585     test_ret += test_xmlXPathStringLengthFunction();
   51586     test_ret += test_xmlXPathSubValues();
   51587     test_ret += test_xmlXPathSubstringAfterFunction();
   51588     test_ret += test_xmlXPathSubstringBeforeFunction();
   51589     test_ret += test_xmlXPathSubstringFunction();
   51590     test_ret += test_xmlXPathSumFunction();
   51591     test_ret += test_xmlXPathTrailing();
   51592     test_ret += test_xmlXPathTrailingSorted();
   51593     test_ret += test_xmlXPathTranslateFunction();
   51594     test_ret += test_xmlXPathTrueFunction();
   51595     test_ret += test_xmlXPathValueFlipSign();
   51596     test_ret += test_xmlXPathVariableLookup();
   51597     test_ret += test_xmlXPathVariableLookupNS();
   51598     test_ret += test_xmlXPathWrapCString();
   51599     test_ret += test_xmlXPathWrapExternal();
   51600     test_ret += test_xmlXPathWrapNodeSet();
   51601     test_ret += test_xmlXPatherror();
   51602 
   51603     if (test_ret != 0)
   51604 	printf("Module xpathInternals: %d errors\n", test_ret);
   51605     return(test_ret);
   51606 }
   51607 
   51608 static int
   51609 test_xmlXPtrBuildNodeList(void) {
   51610     int test_ret = 0;
   51611 
   51612 #if defined(LIBXML_XPTR_ENABLED)
   51613     int mem_base;
   51614     xmlNodePtr ret_val;
   51615     xmlXPathObjectPtr obj; /* the XPointer result from the evaluation. */
   51616     int n_obj;
   51617 
   51618     for (n_obj = 0;n_obj < gen_nb_xmlXPathObjectPtr;n_obj++) {
   51619         mem_base = xmlMemBlocks();
   51620         obj = gen_xmlXPathObjectPtr(n_obj, 0);
   51621 
   51622         ret_val = xmlXPtrBuildNodeList(obj);
   51623         desret_xmlNodePtr(ret_val);
   51624         call_tests++;
   51625         des_xmlXPathObjectPtr(n_obj, obj, 0);
   51626         xmlResetLastError();
   51627         if (mem_base != xmlMemBlocks()) {
   51628             printf("Leak of %d blocks found in xmlXPtrBuildNodeList",
   51629 	           xmlMemBlocks() - mem_base);
   51630 	    test_ret++;
   51631             printf(" %d", n_obj);
   51632             printf("\n");
   51633         }
   51634     }
   51635     function_tests++;
   51636 #endif
   51637 
   51638     return(test_ret);
   51639 }
   51640 
   51641 
   51642 static int
   51643 test_xmlXPtrEval(void) {
   51644     int test_ret = 0;
   51645 
   51646 #if defined(LIBXML_XPTR_ENABLED)
   51647     int mem_base;
   51648     xmlXPathObjectPtr ret_val;
   51649     xmlChar * str; /* the XPointer expression */
   51650     int n_str;
   51651     xmlXPathContextPtr ctx; /* the XPointer context */
   51652     int n_ctx;
   51653 
   51654     for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) {
   51655     for (n_ctx = 0;n_ctx < gen_nb_xmlXPathContextPtr;n_ctx++) {
   51656         mem_base = xmlMemBlocks();
   51657         str = gen_const_xmlChar_ptr(n_str, 0);
   51658         ctx = gen_xmlXPathContextPtr(n_ctx, 1);
   51659 
   51660         ret_val = xmlXPtrEval((const xmlChar *)str, ctx);
   51661         desret_xmlXPathObjectPtr(ret_val);
   51662         call_tests++;
   51663         des_const_xmlChar_ptr(n_str, (const xmlChar *)str, 0);
   51664         des_xmlXPathContextPtr(n_ctx, ctx, 1);
   51665         xmlResetLastError();
   51666         if (mem_base != xmlMemBlocks()) {
   51667             printf("Leak of %d blocks found in xmlXPtrEval",
   51668 	           xmlMemBlocks() - mem_base);
   51669 	    test_ret++;
   51670             printf(" %d", n_str);
   51671             printf(" %d", n_ctx);
   51672             printf("\n");
   51673         }
   51674     }
   51675     }
   51676     function_tests++;
   51677 #endif
   51678 
   51679     return(test_ret);
   51680 }
   51681 
   51682 
   51683 static int
   51684 test_xmlXPtrEvalRangePredicate(void) {
   51685     int test_ret = 0;
   51686 
   51687 #if defined(LIBXML_XPTR_ENABLED)
   51688     int mem_base;
   51689     xmlXPathParserContextPtr ctxt; /* the XPointer Parser context */
   51690     int n_ctxt;
   51691 
   51692     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
   51693         mem_base = xmlMemBlocks();
   51694         ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
   51695 
   51696         xmlXPtrEvalRangePredicate(ctxt);
   51697         call_tests++;
   51698         des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
   51699         xmlResetLastError();
   51700         if (mem_base != xmlMemBlocks()) {
   51701             printf("Leak of %d blocks found in xmlXPtrEvalRangePredicate",
   51702 	           xmlMemBlocks() - mem_base);
   51703 	    test_ret++;
   51704             printf(" %d", n_ctxt);
   51705             printf("\n");
   51706         }
   51707     }
   51708     function_tests++;
   51709 #endif
   51710 
   51711     return(test_ret);
   51712 }
   51713 
   51714 #ifdef LIBXML_XPTR_ENABLED
   51715 
   51716 #define gen_nb_xmlLocationSetPtr 1
   51717 static xmlLocationSetPtr gen_xmlLocationSetPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
   51718     return(NULL);
   51719 }
   51720 static void des_xmlLocationSetPtr(int no ATTRIBUTE_UNUSED, xmlLocationSetPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
   51721 }
   51722 #endif
   51723 
   51724 
   51725 static int
   51726 test_xmlXPtrLocationSetAdd(void) {
   51727     int test_ret = 0;
   51728 
   51729 #if defined(LIBXML_XPTR_ENABLED)
   51730     int mem_base;
   51731     xmlLocationSetPtr cur; /* the initial range set */
   51732     int n_cur;
   51733     xmlXPathObjectPtr val; /* a new xmlXPathObjectPtr */
   51734     int n_val;
   51735 
   51736     for (n_cur = 0;n_cur < gen_nb_xmlLocationSetPtr;n_cur++) {
   51737     for (n_val = 0;n_val < gen_nb_xmlXPathObjectPtr;n_val++) {
   51738         mem_base = xmlMemBlocks();
   51739         cur = gen_xmlLocationSetPtr(n_cur, 0);
   51740         val = gen_xmlXPathObjectPtr(n_val, 1);
   51741 
   51742         xmlXPtrLocationSetAdd(cur, val);
   51743         call_tests++;
   51744         des_xmlLocationSetPtr(n_cur, cur, 0);
   51745         des_xmlXPathObjectPtr(n_val, val, 1);
   51746         xmlResetLastError();
   51747         if (mem_base != xmlMemBlocks()) {
   51748             printf("Leak of %d blocks found in xmlXPtrLocationSetAdd",
   51749 	           xmlMemBlocks() - mem_base);
   51750 	    test_ret++;
   51751             printf(" %d", n_cur);
   51752             printf(" %d", n_val);
   51753             printf("\n");
   51754         }
   51755     }
   51756     }
   51757     function_tests++;
   51758 #endif
   51759 
   51760     return(test_ret);
   51761 }
   51762 
   51763 
   51764 static int
   51765 test_xmlXPtrLocationSetCreate(void) {
   51766     int test_ret = 0;
   51767 
   51768 
   51769     /* missing type support */
   51770     return(test_ret);
   51771 }
   51772 
   51773 
   51774 static int
   51775 test_xmlXPtrLocationSetDel(void) {
   51776     int test_ret = 0;
   51777 
   51778 #if defined(LIBXML_XPTR_ENABLED)
   51779     int mem_base;
   51780     xmlLocationSetPtr cur; /* the initial range set */
   51781     int n_cur;
   51782     xmlXPathObjectPtr val; /* an xmlXPathObjectPtr */
   51783     int n_val;
   51784 
   51785     for (n_cur = 0;n_cur < gen_nb_xmlLocationSetPtr;n_cur++) {
   51786     for (n_val = 0;n_val < gen_nb_xmlXPathObjectPtr;n_val++) {
   51787         mem_base = xmlMemBlocks();
   51788         cur = gen_xmlLocationSetPtr(n_cur, 0);
   51789         val = gen_xmlXPathObjectPtr(n_val, 1);
   51790 
   51791         xmlXPtrLocationSetDel(cur, val);
   51792         call_tests++;
   51793         des_xmlLocationSetPtr(n_cur, cur, 0);
   51794         des_xmlXPathObjectPtr(n_val, val, 1);
   51795         xmlResetLastError();
   51796         if (mem_base != xmlMemBlocks()) {
   51797             printf("Leak of %d blocks found in xmlXPtrLocationSetDel",
   51798 	           xmlMemBlocks() - mem_base);
   51799 	    test_ret++;
   51800             printf(" %d", n_cur);
   51801             printf(" %d", n_val);
   51802             printf("\n");
   51803         }
   51804     }
   51805     }
   51806     function_tests++;
   51807 #endif
   51808 
   51809     return(test_ret);
   51810 }
   51811 
   51812 
   51813 static int
   51814 test_xmlXPtrLocationSetMerge(void) {
   51815     int test_ret = 0;
   51816 
   51817 
   51818     /* missing type support */
   51819     return(test_ret);
   51820 }
   51821 
   51822 
   51823 static int
   51824 test_xmlXPtrLocationSetRemove(void) {
   51825     int test_ret = 0;
   51826 
   51827 #if defined(LIBXML_XPTR_ENABLED)
   51828     int mem_base;
   51829     xmlLocationSetPtr cur; /* the initial range set */
   51830     int n_cur;
   51831     int val; /* the index to remove */
   51832     int n_val;
   51833 
   51834     for (n_cur = 0;n_cur < gen_nb_xmlLocationSetPtr;n_cur++) {
   51835     for (n_val = 0;n_val < gen_nb_int;n_val++) {
   51836         mem_base = xmlMemBlocks();
   51837         cur = gen_xmlLocationSetPtr(n_cur, 0);
   51838         val = gen_int(n_val, 1);
   51839 
   51840         xmlXPtrLocationSetRemove(cur, val);
   51841         call_tests++;
   51842         des_xmlLocationSetPtr(n_cur, cur, 0);
   51843         des_int(n_val, val, 1);
   51844         xmlResetLastError();
   51845         if (mem_base != xmlMemBlocks()) {
   51846             printf("Leak of %d blocks found in xmlXPtrLocationSetRemove",
   51847 	           xmlMemBlocks() - mem_base);
   51848 	    test_ret++;
   51849             printf(" %d", n_cur);
   51850             printf(" %d", n_val);
   51851             printf("\n");
   51852         }
   51853     }
   51854     }
   51855     function_tests++;
   51856 #endif
   51857 
   51858     return(test_ret);
   51859 }
   51860 
   51861 
   51862 static int
   51863 test_xmlXPtrNewCollapsedRange(void) {
   51864     int test_ret = 0;
   51865 
   51866 #if defined(LIBXML_XPTR_ENABLED)
   51867     int mem_base;
   51868     xmlXPathObjectPtr ret_val;
   51869     xmlNodePtr start; /* the starting and ending node */
   51870     int n_start;
   51871 
   51872     for (n_start = 0;n_start < gen_nb_xmlNodePtr;n_start++) {
   51873         mem_base = xmlMemBlocks();
   51874         start = gen_xmlNodePtr(n_start, 0);
   51875 
   51876         ret_val = xmlXPtrNewCollapsedRange(start);
   51877         desret_xmlXPathObjectPtr(ret_val);
   51878         call_tests++;
   51879         des_xmlNodePtr(n_start, start, 0);
   51880         xmlResetLastError();
   51881         if (mem_base != xmlMemBlocks()) {
   51882             printf("Leak of %d blocks found in xmlXPtrNewCollapsedRange",
   51883 	           xmlMemBlocks() - mem_base);
   51884 	    test_ret++;
   51885             printf(" %d", n_start);
   51886             printf("\n");
   51887         }
   51888     }
   51889     function_tests++;
   51890 #endif
   51891 
   51892     return(test_ret);
   51893 }
   51894 
   51895 
   51896 static int
   51897 test_xmlXPtrNewContext(void) {
   51898     int test_ret = 0;
   51899 
   51900 
   51901     /* missing type support */
   51902     return(test_ret);
   51903 }
   51904 
   51905 
   51906 static int
   51907 test_xmlXPtrNewLocationSetNodeSet(void) {
   51908     int test_ret = 0;
   51909 
   51910 #if defined(LIBXML_XPTR_ENABLED)
   51911     int mem_base;
   51912     xmlXPathObjectPtr ret_val;
   51913     xmlNodeSetPtr set; /* a node set */
   51914     int n_set;
   51915 
   51916     for (n_set = 0;n_set < gen_nb_xmlNodeSetPtr;n_set++) {
   51917         mem_base = xmlMemBlocks();
   51918         set = gen_xmlNodeSetPtr(n_set, 0);
   51919 
   51920         ret_val = xmlXPtrNewLocationSetNodeSet(set);
   51921         desret_xmlXPathObjectPtr(ret_val);
   51922         call_tests++;
   51923         des_xmlNodeSetPtr(n_set, set, 0);
   51924         xmlResetLastError();
   51925         if (mem_base != xmlMemBlocks()) {
   51926             printf("Leak of %d blocks found in xmlXPtrNewLocationSetNodeSet",
   51927 	           xmlMemBlocks() - mem_base);
   51928 	    test_ret++;
   51929             printf(" %d", n_set);
   51930             printf("\n");
   51931         }
   51932     }
   51933     function_tests++;
   51934 #endif
   51935 
   51936     return(test_ret);
   51937 }
   51938 
   51939 
   51940 static int
   51941 test_xmlXPtrNewLocationSetNodes(void) {
   51942     int test_ret = 0;
   51943 
   51944 #if defined(LIBXML_XPTR_ENABLED)
   51945     int mem_base;
   51946     xmlXPathObjectPtr ret_val;
   51947     xmlNodePtr start; /* the start NodePtr value */
   51948     int n_start;
   51949     xmlNodePtr end; /* the end NodePtr value or NULL */
   51950     int n_end;
   51951 
   51952     for (n_start = 0;n_start < gen_nb_xmlNodePtr;n_start++) {
   51953     for (n_end = 0;n_end < gen_nb_xmlNodePtr;n_end++) {
   51954         mem_base = xmlMemBlocks();
   51955         start = gen_xmlNodePtr(n_start, 0);
   51956         end = gen_xmlNodePtr(n_end, 1);
   51957 
   51958         ret_val = xmlXPtrNewLocationSetNodes(start, end);
   51959         desret_xmlXPathObjectPtr(ret_val);
   51960         call_tests++;
   51961         des_xmlNodePtr(n_start, start, 0);
   51962         des_xmlNodePtr(n_end, end, 1);
   51963         xmlResetLastError();
   51964         if (mem_base != xmlMemBlocks()) {
   51965             printf("Leak of %d blocks found in xmlXPtrNewLocationSetNodes",
   51966 	           xmlMemBlocks() - mem_base);
   51967 	    test_ret++;
   51968             printf(" %d", n_start);
   51969             printf(" %d", n_end);
   51970             printf("\n");
   51971         }
   51972     }
   51973     }
   51974     function_tests++;
   51975 #endif
   51976 
   51977     return(test_ret);
   51978 }
   51979 
   51980 
   51981 static int
   51982 test_xmlXPtrNewRange(void) {
   51983     int test_ret = 0;
   51984 
   51985 #if defined(LIBXML_XPTR_ENABLED)
   51986     int mem_base;
   51987     xmlXPathObjectPtr ret_val;
   51988     xmlNodePtr start; /* the starting node */
   51989     int n_start;
   51990     int startindex; /* the start index */
   51991     int n_startindex;
   51992     xmlNodePtr end; /* the ending point */
   51993     int n_end;
   51994     int endindex; /* the ending index */
   51995     int n_endindex;
   51996 
   51997     for (n_start = 0;n_start < gen_nb_xmlNodePtr;n_start++) {
   51998     for (n_startindex = 0;n_startindex < gen_nb_int;n_startindex++) {
   51999     for (n_end = 0;n_end < gen_nb_xmlNodePtr;n_end++) {
   52000     for (n_endindex = 0;n_endindex < gen_nb_int;n_endindex++) {
   52001         mem_base = xmlMemBlocks();
   52002         start = gen_xmlNodePtr(n_start, 0);
   52003         startindex = gen_int(n_startindex, 1);
   52004         end = gen_xmlNodePtr(n_end, 2);
   52005         endindex = gen_int(n_endindex, 3);
   52006 
   52007         ret_val = xmlXPtrNewRange(start, startindex, end, endindex);
   52008         desret_xmlXPathObjectPtr(ret_val);
   52009         call_tests++;
   52010         des_xmlNodePtr(n_start, start, 0);
   52011         des_int(n_startindex, startindex, 1);
   52012         des_xmlNodePtr(n_end, end, 2);
   52013         des_int(n_endindex, endindex, 3);
   52014         xmlResetLastError();
   52015         if (mem_base != xmlMemBlocks()) {
   52016             printf("Leak of %d blocks found in xmlXPtrNewRange",
   52017 	           xmlMemBlocks() - mem_base);
   52018 	    test_ret++;
   52019             printf(" %d", n_start);
   52020             printf(" %d", n_startindex);
   52021             printf(" %d", n_end);
   52022             printf(" %d", n_endindex);
   52023             printf("\n");
   52024         }
   52025     }
   52026     }
   52027     }
   52028     }
   52029     function_tests++;
   52030 #endif
   52031 
   52032     return(test_ret);
   52033 }
   52034 
   52035 
   52036 static int
   52037 test_xmlXPtrNewRangeNodeObject(void) {
   52038     int test_ret = 0;
   52039 
   52040 #if defined(LIBXML_XPTR_ENABLED)
   52041     int mem_base;
   52042     xmlXPathObjectPtr ret_val;
   52043     xmlNodePtr start; /* the starting node */
   52044     int n_start;
   52045     xmlXPathObjectPtr end; /* the ending object */
   52046     int n_end;
   52047 
   52048     for (n_start = 0;n_start < gen_nb_xmlNodePtr;n_start++) {
   52049     for (n_end = 0;n_end < gen_nb_xmlXPathObjectPtr;n_end++) {
   52050         mem_base = xmlMemBlocks();
   52051         start = gen_xmlNodePtr(n_start, 0);
   52052         end = gen_xmlXPathObjectPtr(n_end, 1);
   52053 
   52054         ret_val = xmlXPtrNewRangeNodeObject(start, end);
   52055         desret_xmlXPathObjectPtr(ret_val);
   52056         call_tests++;
   52057         des_xmlNodePtr(n_start, start, 0);
   52058         des_xmlXPathObjectPtr(n_end, end, 1);
   52059         xmlResetLastError();
   52060         if (mem_base != xmlMemBlocks()) {
   52061             printf("Leak of %d blocks found in xmlXPtrNewRangeNodeObject",
   52062 	           xmlMemBlocks() - mem_base);
   52063 	    test_ret++;
   52064             printf(" %d", n_start);
   52065             printf(" %d", n_end);
   52066             printf("\n");
   52067         }
   52068     }
   52069     }
   52070     function_tests++;
   52071 #endif
   52072 
   52073     return(test_ret);
   52074 }
   52075 
   52076 
   52077 static int
   52078 test_xmlXPtrNewRangeNodePoint(void) {
   52079     int test_ret = 0;
   52080 
   52081 #if defined(LIBXML_XPTR_ENABLED)
   52082     int mem_base;
   52083     xmlXPathObjectPtr ret_val;
   52084     xmlNodePtr start; /* the starting node */
   52085     int n_start;
   52086     xmlXPathObjectPtr end; /* the ending point */
   52087     int n_end;
   52088 
   52089     for (n_start = 0;n_start < gen_nb_xmlNodePtr;n_start++) {
   52090     for (n_end = 0;n_end < gen_nb_xmlXPathObjectPtr;n_end++) {
   52091         mem_base = xmlMemBlocks();
   52092         start = gen_xmlNodePtr(n_start, 0);
   52093         end = gen_xmlXPathObjectPtr(n_end, 1);
   52094 
   52095         ret_val = xmlXPtrNewRangeNodePoint(start, end);
   52096         desret_xmlXPathObjectPtr(ret_val);
   52097         call_tests++;
   52098         des_xmlNodePtr(n_start, start, 0);
   52099         des_xmlXPathObjectPtr(n_end, end, 1);
   52100         xmlResetLastError();
   52101         if (mem_base != xmlMemBlocks()) {
   52102             printf("Leak of %d blocks found in xmlXPtrNewRangeNodePoint",
   52103 	           xmlMemBlocks() - mem_base);
   52104 	    test_ret++;
   52105             printf(" %d", n_start);
   52106             printf(" %d", n_end);
   52107             printf("\n");
   52108         }
   52109     }
   52110     }
   52111     function_tests++;
   52112 #endif
   52113 
   52114     return(test_ret);
   52115 }
   52116 
   52117 
   52118 static int
   52119 test_xmlXPtrNewRangeNodes(void) {
   52120     int test_ret = 0;
   52121 
   52122 #if defined(LIBXML_XPTR_ENABLED)
   52123     int mem_base;
   52124     xmlXPathObjectPtr ret_val;
   52125     xmlNodePtr start; /* the starting node */
   52126     int n_start;
   52127     xmlNodePtr end; /* the ending node */
   52128     int n_end;
   52129 
   52130     for (n_start = 0;n_start < gen_nb_xmlNodePtr;n_start++) {
   52131     for (n_end = 0;n_end < gen_nb_xmlNodePtr;n_end++) {
   52132         mem_base = xmlMemBlocks();
   52133         start = gen_xmlNodePtr(n_start, 0);
   52134         end = gen_xmlNodePtr(n_end, 1);
   52135 
   52136         ret_val = xmlXPtrNewRangeNodes(start, end);
   52137         desret_xmlXPathObjectPtr(ret_val);
   52138         call_tests++;
   52139         des_xmlNodePtr(n_start, start, 0);
   52140         des_xmlNodePtr(n_end, end, 1);
   52141         xmlResetLastError();
   52142         if (mem_base != xmlMemBlocks()) {
   52143             printf("Leak of %d blocks found in xmlXPtrNewRangeNodes",
   52144 	           xmlMemBlocks() - mem_base);
   52145 	    test_ret++;
   52146             printf(" %d", n_start);
   52147             printf(" %d", n_end);
   52148             printf("\n");
   52149         }
   52150     }
   52151     }
   52152     function_tests++;
   52153 #endif
   52154 
   52155     return(test_ret);
   52156 }
   52157 
   52158 
   52159 static int
   52160 test_xmlXPtrNewRangePointNode(void) {
   52161     int test_ret = 0;
   52162 
   52163 #if defined(LIBXML_XPTR_ENABLED)
   52164     int mem_base;
   52165     xmlXPathObjectPtr ret_val;
   52166     xmlXPathObjectPtr start; /* the starting point */
   52167     int n_start;
   52168     xmlNodePtr end; /* the ending node */
   52169     int n_end;
   52170 
   52171     for (n_start = 0;n_start < gen_nb_xmlXPathObjectPtr;n_start++) {
   52172     for (n_end = 0;n_end < gen_nb_xmlNodePtr;n_end++) {
   52173         mem_base = xmlMemBlocks();
   52174         start = gen_xmlXPathObjectPtr(n_start, 0);
   52175         end = gen_xmlNodePtr(n_end, 1);
   52176 
   52177         ret_val = xmlXPtrNewRangePointNode(start, end);
   52178         desret_xmlXPathObjectPtr(ret_val);
   52179         call_tests++;
   52180         des_xmlXPathObjectPtr(n_start, start, 0);
   52181         des_xmlNodePtr(n_end, end, 1);
   52182         xmlResetLastError();
   52183         if (mem_base != xmlMemBlocks()) {
   52184             printf("Leak of %d blocks found in xmlXPtrNewRangePointNode",
   52185 	           xmlMemBlocks() - mem_base);
   52186 	    test_ret++;
   52187             printf(" %d", n_start);
   52188             printf(" %d", n_end);
   52189             printf("\n");
   52190         }
   52191     }
   52192     }
   52193     function_tests++;
   52194 #endif
   52195 
   52196     return(test_ret);
   52197 }
   52198 
   52199 
   52200 static int
   52201 test_xmlXPtrNewRangePoints(void) {
   52202     int test_ret = 0;
   52203 
   52204 #if defined(LIBXML_XPTR_ENABLED)
   52205     int mem_base;
   52206     xmlXPathObjectPtr ret_val;
   52207     xmlXPathObjectPtr start; /* the starting point */
   52208     int n_start;
   52209     xmlXPathObjectPtr end; /* the ending point */
   52210     int n_end;
   52211 
   52212     for (n_start = 0;n_start < gen_nb_xmlXPathObjectPtr;n_start++) {
   52213     for (n_end = 0;n_end < gen_nb_xmlXPathObjectPtr;n_end++) {
   52214         mem_base = xmlMemBlocks();
   52215         start = gen_xmlXPathObjectPtr(n_start, 0);
   52216         end = gen_xmlXPathObjectPtr(n_end, 1);
   52217 
   52218         ret_val = xmlXPtrNewRangePoints(start, end);
   52219         desret_xmlXPathObjectPtr(ret_val);
   52220         call_tests++;
   52221         des_xmlXPathObjectPtr(n_start, start, 0);
   52222         des_xmlXPathObjectPtr(n_end, end, 1);
   52223         xmlResetLastError();
   52224         if (mem_base != xmlMemBlocks()) {
   52225             printf("Leak of %d blocks found in xmlXPtrNewRangePoints",
   52226 	           xmlMemBlocks() - mem_base);
   52227 	    test_ret++;
   52228             printf(" %d", n_start);
   52229             printf(" %d", n_end);
   52230             printf("\n");
   52231         }
   52232     }
   52233     }
   52234     function_tests++;
   52235 #endif
   52236 
   52237     return(test_ret);
   52238 }
   52239 
   52240 
   52241 static int
   52242 test_xmlXPtrRangeToFunction(void) {
   52243     int test_ret = 0;
   52244 
   52245 #if defined(LIBXML_XPTR_ENABLED)
   52246     int mem_base;
   52247     xmlXPathParserContextPtr ctxt; /* the XPointer Parser context */
   52248     int n_ctxt;
   52249     int nargs; /* the number of args */
   52250     int n_nargs;
   52251 
   52252     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
   52253     for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
   52254         mem_base = xmlMemBlocks();
   52255         ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
   52256         nargs = gen_int(n_nargs, 1);
   52257 
   52258         xmlXPtrRangeToFunction(ctxt, nargs);
   52259         call_tests++;
   52260         des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
   52261         des_int(n_nargs, nargs, 1);
   52262         xmlResetLastError();
   52263         if (mem_base != xmlMemBlocks()) {
   52264             printf("Leak of %d blocks found in xmlXPtrRangeToFunction",
   52265 	           xmlMemBlocks() - mem_base);
   52266 	    test_ret++;
   52267             printf(" %d", n_ctxt);
   52268             printf(" %d", n_nargs);
   52269             printf("\n");
   52270         }
   52271     }
   52272     }
   52273     function_tests++;
   52274 #endif
   52275 
   52276     return(test_ret);
   52277 }
   52278 
   52279 
   52280 static int
   52281 test_xmlXPtrWrapLocationSet(void) {
   52282     int test_ret = 0;
   52283 
   52284 #if defined(LIBXML_XPTR_ENABLED)
   52285     int mem_base;
   52286     xmlXPathObjectPtr ret_val;
   52287     xmlLocationSetPtr val; /* the LocationSet value */
   52288     int n_val;
   52289 
   52290     for (n_val = 0;n_val < gen_nb_xmlLocationSetPtr;n_val++) {
   52291         mem_base = xmlMemBlocks();
   52292         val = gen_xmlLocationSetPtr(n_val, 0);
   52293 
   52294         ret_val = xmlXPtrWrapLocationSet(val);
   52295         desret_xmlXPathObjectPtr(ret_val);
   52296         call_tests++;
   52297         des_xmlLocationSetPtr(n_val, val, 0);
   52298         xmlResetLastError();
   52299         if (mem_base != xmlMemBlocks()) {
   52300             printf("Leak of %d blocks found in xmlXPtrWrapLocationSet",
   52301 	           xmlMemBlocks() - mem_base);
   52302 	    test_ret++;
   52303             printf(" %d", n_val);
   52304             printf("\n");
   52305         }
   52306     }
   52307     function_tests++;
   52308 #endif
   52309 
   52310     return(test_ret);
   52311 }
   52312 
   52313 static int
   52314 test_xpointer(void) {
   52315     int test_ret = 0;
   52316 
   52317     if (quiet == 0) printf("Testing xpointer : 17 of 21 functions ...\n");
   52318     test_ret += test_xmlXPtrBuildNodeList();
   52319     test_ret += test_xmlXPtrEval();
   52320     test_ret += test_xmlXPtrEvalRangePredicate();
   52321     test_ret += test_xmlXPtrLocationSetAdd();
   52322     test_ret += test_xmlXPtrLocationSetCreate();
   52323     test_ret += test_xmlXPtrLocationSetDel();
   52324     test_ret += test_xmlXPtrLocationSetMerge();
   52325     test_ret += test_xmlXPtrLocationSetRemove();
   52326     test_ret += test_xmlXPtrNewCollapsedRange();
   52327     test_ret += test_xmlXPtrNewContext();
   52328     test_ret += test_xmlXPtrNewLocationSetNodeSet();
   52329     test_ret += test_xmlXPtrNewLocationSetNodes();
   52330     test_ret += test_xmlXPtrNewRange();
   52331     test_ret += test_xmlXPtrNewRangeNodeObject();
   52332     test_ret += test_xmlXPtrNewRangeNodePoint();
   52333     test_ret += test_xmlXPtrNewRangeNodes();
   52334     test_ret += test_xmlXPtrNewRangePointNode();
   52335     test_ret += test_xmlXPtrNewRangePoints();
   52336     test_ret += test_xmlXPtrRangeToFunction();
   52337     test_ret += test_xmlXPtrWrapLocationSet();
   52338 
   52339     if (test_ret != 0)
   52340 	printf("Module xpointer: %d errors\n", test_ret);
   52341     return(test_ret);
   52342 }
   52343 static int
   52344 test_module(const char *module) {
   52345     if (!strcmp(module, "HTMLparser")) return(test_HTMLparser());
   52346     if (!strcmp(module, "HTMLtree")) return(test_HTMLtree());
   52347     if (!strcmp(module, "SAX2")) return(test_SAX2());
   52348     if (!strcmp(module, "c14n")) return(test_c14n());
   52349     if (!strcmp(module, "catalog")) return(test_catalog());
   52350     if (!strcmp(module, "chvalid")) return(test_chvalid());
   52351     if (!strcmp(module, "debugXML")) return(test_debugXML());
   52352     if (!strcmp(module, "dict")) return(test_dict());
   52353     if (!strcmp(module, "encoding")) return(test_encoding());
   52354     if (!strcmp(module, "entities")) return(test_entities());
   52355     if (!strcmp(module, "hash")) return(test_hash());
   52356     if (!strcmp(module, "list")) return(test_list());
   52357     if (!strcmp(module, "nanoftp")) return(test_nanoftp());
   52358     if (!strcmp(module, "nanohttp")) return(test_nanohttp());
   52359     if (!strcmp(module, "parser")) return(test_parser());
   52360     if (!strcmp(module, "parserInternals")) return(test_parserInternals());
   52361     if (!strcmp(module, "pattern")) return(test_pattern());
   52362     if (!strcmp(module, "relaxng")) return(test_relaxng());
   52363     if (!strcmp(module, "schemasInternals")) return(test_schemasInternals());
   52364     if (!strcmp(module, "schematron")) return(test_schematron());
   52365     if (!strcmp(module, "tree")) return(test_tree());
   52366     if (!strcmp(module, "uri")) return(test_uri());
   52367     if (!strcmp(module, "valid")) return(test_valid());
   52368     if (!strcmp(module, "xinclude")) return(test_xinclude());
   52369     if (!strcmp(module, "xmlIO")) return(test_xmlIO());
   52370     if (!strcmp(module, "xmlautomata")) return(test_xmlautomata());
   52371     if (!strcmp(module, "xmlerror")) return(test_xmlerror());
   52372     if (!strcmp(module, "xmlmodule")) return(test_xmlmodule());
   52373     if (!strcmp(module, "xmlreader")) return(test_xmlreader());
   52374     if (!strcmp(module, "xmlregexp")) return(test_xmlregexp());
   52375     if (!strcmp(module, "xmlsave")) return(test_xmlsave());
   52376     if (!strcmp(module, "xmlschemas")) return(test_xmlschemas());
   52377     if (!strcmp(module, "xmlschemastypes")) return(test_xmlschemastypes());
   52378     if (!strcmp(module, "xmlstring")) return(test_xmlstring());
   52379     if (!strcmp(module, "xmlunicode")) return(test_xmlunicode());
   52380     if (!strcmp(module, "xmlwriter")) return(test_xmlwriter());
   52381     if (!strcmp(module, "xpath")) return(test_xpath());
   52382     if (!strcmp(module, "xpathInternals")) return(test_xpathInternals());
   52383     if (!strcmp(module, "xpointer")) return(test_xpointer());
   52384     return(0);
   52385 }
   52386